@verdocs/web-sdk 5.0.22 → 5.0.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"file":"verdocs-sign.entry.js","mappings":";;;;;;;;;;AAAA,MAAM,cAAc,GAAG,g/HAAg/H,CAAC;AACxgI,0BAAe,cAAc;;ACY7B,MAAM,qBAAqB,GAAG;IAC5B,EAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAC;;IAEpC,EAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAC;IACzC,EAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,uBAAuB,EAAC;IAC7C,EAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAC;CACpC,CAAC;AAEF,MAAM,eAAe,GAAG;IACtB,EAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAC;IAC7B,EAAC,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAC;CACpC,CAAC;MAwBW,WAAW;;;;;;QA0EtB,mBAAc,GAAW,CAAC,CAAC,CAAC;wBAtEuB,IAAI;0BAKJ,IAAI;sBAKR,IAAI;0BAKA,IAAI;8BAWf,IAAI;yBAkBb,EAAE;gCACS,EAAE;yBACJ,IAAI;4BACpB,KAAK;+BACF,OAAO;2BACX,KAAK;gCACA,EAAE;iCACD,EAAE;4BACP,EAAE;0BACJ,KAAK;yBACN,KAAK;sBACR,KAAK;wBACH,KAAK;6BACA,KAAK;2BACP,KAAK;+BACD,KAAK;sBACd,KAAK;uCACY,UAAU;uBAC1B,EAAE;4BACU,EAAE;2BACV,KAAK;0BACN,EAAE;uBAEL,IAAI;wBACe,IAAI;;IAI1C,iBAAiB;QACf,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;YAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAe,CAAC,EAAC,WAAW,EAAE,SA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AAU,EACtB,cAAc,EAAE,CAAC,IAAI,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,EAC/C,IAAI,EAAC,QAAQ,EACb,MAAM,EAAE;wBACN,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;wBAC9B,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAC;qBAChC,GACD,EACF;aACH,CAAC,CACO,EACX;SACH,CAAC,CACE,EAEL,IAAI,CAAC,eAAe,KACnB,yBACE,OAAO,EAAC,6CAA6C,EACrD,OAAO,EAAE,mBAAmB,IAAI,CAAC,uBAAuB,mGAAmG,EAC3J,MAAM,EAAE,OAAO,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,GAC5C,CACH,EAEA,IAAI,CAAC,QAAQ,KACZ,yBACE,OAAO,EAAC,cAAc,EACtB,OAAO,EAAE,sBAAsB,IAAI,CAAC,uBAAuB,8MAA8M,EACzQ,MAAM,EAAE;gBACN,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACtB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;aACpB,GACD,CACH,EAEA,IAAI,CAAC,UAAU;aACb,IAAI,CAAC,WAAW,KACf,0BACE,WAAK,KAAK,EAAC,iBAAiB,IAC1B,0BAAmB,CACf,CACS,CAClB,CAAC,CACC,EACP;KACH;;;;;;","names":[],"sources":["src/components/embeds/verdocs-sign/verdocs-sign.scss?tag=verdocs-sign","src/components/embeds/verdocs-sign/verdocs-sign.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-sign {\n display: flex;\n overflow: hidden;\n position: relative;\n min-height: 600px;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div {\n display: block;\n box-sizing: border-box;\n }\n\n input {\n vertical-align: top;\n }\n\n //.intro {\n // width: 100%;\n // display: flex;\n // flex: 0 0 60px;\n // color: #111111;\n // font-size: 18px;\n // font-weight: 500;\n // line-height: 28px;\n // flex-direction: row;\n // background: #ffffff;\n //\n // .inner {\n // width: 100%;\n // display: flex;\n // margin: 0 auto;\n // padding: 0 20px;\n // max-width: 1200px;\n // flex-direction: row;\n // align-items: center;\n // }\n //}\n\n > .document {\n flex: 1;\n width: 100%;\n height: 100%;\n align-self: center;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n max-width: 1200px;\n min-height: 200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n //justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .cover {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 5000;\n position: absolute;\n padding-top: 100px;\n align-items: center;\n flex-direction: column;\n background: rgba(0, 0, 0, 0.5);\n }\n\n .agree {\n flex: 0;\n width: 600px;\n display: flex;\n max-width: 90%;\n padding: 30px 15px;\n flex-direction: column;\n background-color: #ffffff;\n\n .header {\n flex: 0 0 56px;\n }\n\n li {\n margin: 0.5em 0;\n }\n }\n\n verdocs-ok-dialog .background-overlay {\n align-items: flex-start;\n padding-top: 100px;\n }\n\n .loading-indicator {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 10000;\n position: fixed;\n background-color: rgba(0, 0, 0, 0.7);\n }\n\n .fatal-error {\n position: absolute;\n z-index: 100;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #4a4a4a;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .placeholder {\n position: absolute;\n opacity: 0.1;\n z-index: -1;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n margin-top: 15px;\n }\n\n .message {\n width: 50%;\n font-size: 16px;\n background: white;\n border-radius: 5px;\n box-shadow: 3px 3px 9px -1px #0000003f;\n }\n\n .header {\n color: white;\n font-size: 18px;\n font-weight: 500;\n padding: 5px 10px;\n margin: 0 0 10px 0;\n background: $verdocs-purple;\n }\n\n p {\n margin: 1rem;\n font-size: 14px;\n font-weight: 400;\n }\n }\n}\n\n@media print {\n verdocs-sign .header {\n display: none;\n }\n}\n\n#verdocs-sign-header {\n color: #fff;\n width: 100%;\n display: flex;\n z-index: 1000;\n flex: 0 0 46px;\n font-size: 12px;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n transition: all 0.25s;\n background-color: $medium-bg;\n box-shadow:\n 0 4px 4px 0 rgb(0 0 0 / 24%),\n 0 0 4px 0 rgb(0 0 0 / 12%);\n\n .inner {\n width: 100%;\n display: flex;\n margin: 0 auto;\n padding: 0 12px;\n max-width: 1200px;\n align-items: center;\n flex-direction: row;\n }\n\n .logo {\n width: 80px;\n display: none;\n margin: -6px 0 0 0;\n }\n\n .title {\n font-size: 18px;\n font-weight: 500;\n overflow: hidden;\n white-space: nowrap;\n padding: 0 10px 0 0;\n text-overflow: ellipsis;\n }\n}\n\n.spinner-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n background: #0000007f;\n justify-content: center;\n}\n","import type {IEnvelope, IEnvelopeField, IRecipient} from '@verdocs/js-sdk';\nimport {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {updateEnvelopeFieldSignature, uploadEnvelopeFieldAttachment, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {updateEnvelopeField, sortFields, submitKbaIdentity, submitKbaChallengeResponse} from '@verdocs/js-sdk';\nimport {fullNameToInitials, startSigningSession, deleteEnvelopeFieldAttachment, getKbaStep} from '@verdocs/js-sdk';\nimport {getEnvelope, integerSequence, isValidEmail, isValidPhone, submitKbaPin, updateEnvelopeFieldInitials} from '@verdocs/js-sdk';\nimport {createInitials, createSignature, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, formatFullName} from '@verdocs/js-sdk';\nimport {getFieldId, renderDocumentField, saveAttachment, updateDocumentFieldValue} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst inProgressMenuOptions = [\n {id: 'later', label: 'Finish Later'}, //\n // {id: 'claim', label: 'Claim the Document', disabled: true},\n {id: 'decline', label: 'Decline to Sign'},\n {id: 'print', label: 'Print Without Signing'},\n {id: 'download', label: 'Download'},\n];\n\nconst doneMenuOptions = [\n {id: 'print', label: 'Print'},\n {id: 'download', label: 'Download'},\n];\n\n/**\n * Display an envelope signing experience. This will display the envelope's attached\n * documents with signing fields overlaid on each page.\n *\n * The component will attempt to initiate a signing session and load the specified\n * envelope. If successful, the recipient's fields will be enabled and the user will\n * be able to sign the envelope's attached documents. If not, an `sdkError` will be\n * thrown and the component will be blank/empty. To provide the best user experience,\n * applications should capture and handle this error to provide the user with\n * instructions/options for next steps based on the application's design and workflow.\n *\n * Unlike other components, this will always create its own endpoint to manage the\n * session session. This endpoint will be included in event callbacks for the\n * convenience of host applications that may wish to make server calls using the\n * signer's credentials once signing is complete (e.g. to obtain copies of\n * the signed attachments.)\n */\n@Component({\n tag: 'verdocs-sign',\n styleUrl: 'verdocs-sign.scss',\n shadow: false,\n})\nexport class VerdocsSign {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop({mutable: true}) endpoint: VerdocsEndpoint = null;\n\n /**\n * The ID of the envelope to sign.\n */\n @Prop({reflect: true}) envelopeId: string | null = null;\n\n /**\n * The ID of the role that will be signing e.g. 'Recipient 1'\n */\n @Prop({reflect: true}) roleId: string | null = null;\n\n /**\n * The invite code for the signer.\n */\n @Prop({reflect: true}) inviteCode: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the header will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects (e.g. \"fixed\").\n *\n * The movement of the header to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the header's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() headerTargetId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeLoaded: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope}>;\n\n /**\n * Event fired when the envelope is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n @State() roleNames: string[] = [];\n @State() sortedRecipients: IRecipient[] = [];\n @State() recipient: IRecipient | null = null;\n @State() hasSignature = false;\n @State() nextButtonLabel = 'Start';\n @State() nextSubmits = false;\n @State() fatalErrorHeader = '';\n @State() fatalErrorMessage = '';\n @State() focusedField = '';\n @State() submitting = false;\n @State() submitted = false;\n @State() isDone = false;\n @State() showDone = false;\n @State() showLoadError = false;\n @State() finishLater = false;\n @State() showFinishLater = false;\n @State() agreed = false;\n @State() documentsSingularPlural = 'document';\n @State() kbaStep = '';\n @State() kbaQuestions: any[] = [];\n @State() showSpinner = false;\n @State() kbaChoices = [];\n\n @State() loading = true;\n @State() envelope: IEnvelope | null = null;\n\n recipientIndex: number = -1;\n\n componentWillLoad() {\n if (!this.endpoint) {\n console.log('[SIGN] Creating signing endpoint');\n this.endpoint = new VerdocsEndpoint({sessionType: 'signing'});\n }\n }\n\n async componentDidLoad() {\n if (!this.envelopeId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required envelopId', 500, ''));\n return;\n }\n\n if (!this.roleId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required roleId', 500, ''));\n return;\n }\n\n if (!this.inviteCode) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required inviteCode', 500, ''));\n return;\n }\n\n try {\n console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);\n\n // NOTE: We don't listen to the store here because we are often an independent\n // session and might have a different \"view\" of the envelope.\n const {envelope, recipient} = await startSigningSession(this.endpoint, this.envelopeId, this.roleId, this.inviteCode);\n console.log(`[SIGN] Loaded signing session`, envelope, recipient);\n this.recipient = recipient;\n this.envelope = envelope;\n\n Store.updateEnvelope(this.envelopeId, envelope);\n\n // TODO: Can be cleaned up shortly.\n this.sortedRecipients = [...this.envelope.recipients];\n this.sortedRecipients.sort((a, b) => {\n return a.sequence === b.sequence ? a.order - b.order : a.sequence - b.sequence;\n });\n\n this.roleNames = this.sortedRecipients.map(r => r.role_name);\n\n if (this.envelope.documents.length > 0) {\n this.documentsSingularPlural = 'document(s)';\n }\n\n this.recipientIndex = this.roleNames.findIndex(roleName => roleName == this.roleId);\n if (this.recipientIndex > -1) {\n this.recipient = this.sortedRecipients[this.recipientIndex];\n this.agreed = this.recipient.agreed;\n } else {\n console.warn('[SIGN] Could not find our recipient record', this.roleId, this.sortedRecipients);\n }\n\n // TODO: Envelope \"complete\" | \"declined\" | \"canceled\"\n // TODO: Recipient \"canceled\"\n this.submitted = this.recipient.status === 'submitted';\n this.isDone = this.submitted;\n this.showDone = this.submitted;\n\n if (this.envelope.status === 'canceled') {\n this.fatalErrorHeader = 'Unable to Start Signing Session';\n this.fatalErrorMessage = 'This envelope has been canceled. Please contact its sender for more information.';\n } else if (this.recipient.status === 'declined') {\n this.fatalErrorHeader = 'Unable to Start Signing Session';\n this.fatalErrorMessage = 'You have declined to sign this envelope.';\n } else if (this.agreed) {\n this.nextButtonLabel = 'Next';\n }\n\n this.checkRecipientFields();\n this.envelopeLoaded?.emit({endpoint: this.endpoint, envelope: this.envelope});\n\n if (!this.isDone) {\n getKbaStep(this.endpoint, this.envelopeId, this.roleId)\n .then(r => {\n console.log('[SIGN] KBA Step', r);\n this.kbaStep = r.kba_step;\n if (this.kbaStep === 'failed') {\n this.fatalErrorHeader = 'Identity Verification Failed';\n this.fatalErrorMessage = \"We were unable to verify your identity. Please contact the document's sender.\";\n this.isDone = true;\n } else {\n this.kbaQuestions = (r as any).questions?.question || [];\n this.kbaChoices = [];\n }\n })\n .catch(e => console.log('Error getting KBA step', e));\n }\n } catch (e) {\n console.log('[SIGN] Error with signing session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n this.showLoadError = true;\n }\n }\n\n componentDidRender() {\n const headerTarget = this.headerTargetId ? document.getElementById(this.headerTargetId) : null;\n const headerEl = document.getElementById('verdocs-sign-header');\n if (headerTarget && headerEl) {\n console.log('[SIGN] Moving header');\n headerEl.remove();\n headerTarget.append(headerEl);\n }\n }\n\n handleClickAgree() {\n this.submitting = true;\n envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)\n .then(() => {\n this.nextButtonLabel = 'Next';\n this.recipient.agreed = true;\n this.submitting = false;\n this.agreed = true; // The server returns a recipient object but it's not \"deep\" so we track this locally\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'agreed'});\n })\n .catch(e => {\n console.log('[SIGN] Update failure', e);\n this.submitting = false;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleOptionSelected(e: any) {\n switch (e.detail.id) {\n case 'later':\n this.finishLater = true;\n this.showFinishLater = true;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'later'});\n break;\n\n case 'claim':\n VerdocsToast('This feature will be available in an upcoming release.');\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'claimed'});\n break;\n\n case 'decline':\n {\n this.submitting = true;\n const declineResult = await envelopeRecipientDecline(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Decline result', declineResult);\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'declined'});\n this.submitting = false;\n this.fatalErrorHeader = 'Declined';\n this.fatalErrorMessage = 'You have declined to sign this envelope.';\n }\n break;\n\n case 'print':\n window.print();\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'printed'});\n break;\n\n case 'download':\n {\n const firstDoc = this.envelope.documents.find(doc => doc.type === 'attachment');\n if (firstDoc) {\n saveAttachment(this.endpoint, this.envelope, firstDoc.id).catch(e => {\n console.log('[SIGN] Error downloading PDF', e);\n });\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'downloaded'});\n }\n }\n break;\n }\n }\n\n updateRecipientFieldValue(fieldName: string, updateResult: any) {\n console.log('[SIGN] updateRecipientFieldValue', fieldName, updateResult);\n this.getRecipientFields().forEach(oldField => {\n if (oldField.name === fieldName) {\n oldField.value = updateResult.value;\n // TODO: Keeping this while attachments still rely on it\n oldField.settings = updateResult.settings;\n updateDocumentFieldValue(oldField);\n this.checkRecipientFields();\n }\n });\n }\n\n saveFieldChange(fieldName: string, fields: Record<string, any>) {\n console.log('[SIGN] saveFieldChange', fieldName, fields);\n updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //\n .then(updateResult => this.updateRecipientFieldValue(fieldName, updateResult))\n .catch(e => {\n if (e.response?.status === 401 && e.response?.data?.error === 'jwt expired') {\n console.log('[SIGN] Signing session expired');\n this.fatalErrorHeader = 'Signing Session Expired';\n this.fatalErrorMessage = 'Please reload your browser to continue.';\n } else {\n console.log('[SIGN] Server error', e);\n }\n\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleFieldChange(field: IEnvelopeField, e: any) {\n const {value, checked} = e.target;\n\n switch (field.type as any) {\n // TODO: Remove legacy type when no longer needed\n case 'textarea':\n case 'textbox':\n return this.saveFieldChange(field.name, {prepared: false, value});\n\n case 'checkbox': {\n return this.saveFieldChange(field.name, {prepared: false, value: String(e.target.checked)});\n }\n\n case 'radio': {\n return this.saveFieldChange(field.name, {prepared: false, value: String(e.target.checked)});\n }\n\n case 'dropdown':\n // TODO: Set prepared to false server-side.\n console.log('Saving dropdown', field.name, e.detail);\n return this.saveFieldChange(field.name, {prepared: false, value: e.detail});\n\n case 'initial':\n // This can be caused by a focus-out event if the user clicks the field\n // after it's already filled in, then clicks something else like a textbox.\n // We don't visually indicate the focus, but it's still there.\n if (!e.detail) {\n return;\n }\n\n this.showSpinner = true;\n const initialsBlob = await (await fetch(e.detail)).blob();\n return createInitials(this.endpoint, 'initial', initialsBlob) //\n .then(async newInitials => {\n const updateResult = await updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.showSpinner = false;\n })\n .catch(e => {\n console.log('Error updating initials', e);\n this.showSpinner = false;\n });\n\n case 'signature':\n // This can be caused by a focus-out event if the user clicks the field\n // after it's already filled in, then clicks something else like a textbox.\n // We don't visually indicate the focus, but it's still there.\n if (!e.detail) {\n return;\n }\n\n this.showSpinner = true;\n const signatureBlob = await (await fetch(e.detail)).blob();\n return createSignature(this.endpoint, 'signature', signatureBlob) //\n .then(async newSignature => {\n console.log('Signature update result', newSignature);\n const updateResult = await updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.showSpinner = false;\n })\n .catch(e => {\n console.warn('[SIGN] Error updating signature', e);\n this.showSpinner = false;\n });\n\n case 'date':\n const {formattedDate} = e.detail;\n if (formattedDate) {\n return this.saveFieldChange(field.name, {prepared: false, value: formattedDate});\n }\n break;\n\n case 'timestamp':\n console.log('[SIGN] Updating timestamp', {value, ts: e.target.getAttribute('timestamp')});\n break;\n\n default:\n console.log('[SIGN] Unhandled field update', {value, checked}, field);\n break;\n }\n }\n\n isFieldFilled(field: IEnvelopeField) {\n const {value = ''} = field;\n switch (field.type as any) {\n case 'textarea':\n case 'textbox':\n switch (field.validator || '') {\n case 'email':\n return isValidEmail(value);\n case 'phone':\n return isValidPhone(value);\n default:\n return (value || '').trim() !== '';\n }\n\n case 'signature':\n return value === 'signed';\n\n case 'initial':\n return value === 'initialed';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'date':\n return !!value;\n\n case 'attachment':\n return value === 'attached';\n\n case 'dropdown':\n return value !== '';\n\n case 'checkbox':\n return value === 'true';\n\n case 'radio':\n if (!!field.group) {\n return this.getRecipientFields()\n .filter(f => f.group === field.group)\n .some(field => field.value === 'true');\n }\n\n return field.value === 'true';\n\n default:\n return false;\n }\n }\n\n isFieldValid(field: IEnvelopeField) {\n return !field.required || this.isFieldFilled(field);\n }\n\n getSortedFillableFields() {\n const recipientFields = this.getRecipientFields().filter(field => field.type !== 'timestamp');\n sortFields(recipientFields);\n return recipientFields;\n }\n\n async handleNext() {\n if (this.nextSubmits) {\n try {\n // Patches the date picker to be forcibly removed if still showing during submission\n document.getElementById('air-datepicker-global-container')?.remove();\n\n this.submitting = true;\n const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Submitted successfully', result);\n this.recipient.status = 'submitted';\n this.showDone = true;\n console.log('[SIGN] Reloading envelope');\n getEnvelope(this.endpoint, this.envelopeId)\n .then(envelope => {\n this.envelope = envelope;\n // The show-done dialog does this\n // this.isDone = true;\n this.submitting = false;\n })\n .catch(e => {\n // this.isDone = true;\n console.log('[SIGN] Error reloading envelope', e);\n this.submitting = false;\n });\n } catch (e) {\n console.log('[SIGN] Error submitting', e);\n }\n\n return;\n }\n\n // Find and focus the next incomplete field (that is fillable)\n const emptyFields = this.getSortedFillableFields().filter(field => field.required && !this.isFieldFilled(field));\n sortFields(emptyFields);\n\n const focusedIndex = emptyFields.findIndex(field => field.name === this.focusedField);\n let nextFocusedIndex = focusedIndex + 1;\n if (nextFocusedIndex >= emptyFields.length) {\n nextFocusedIndex = 0;\n }\n\n let nextRequiredField = emptyFields[nextFocusedIndex];\n // console.log('Next field', nextRequiredField, emptyFields);\n\n // Skip signature and initial fields that are already filled in. We have to count our \"skips\" just in case, to avoid infinite loops.\n let skips = 0;\n if (skips < emptyFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && ['initialed', 'signed'].includes(nextRequiredField.value)) {\n skips++;\n nextFocusedIndex++;\n if (nextFocusedIndex >= emptyFields.length) {\n nextFocusedIndex = 0;\n }\n nextRequiredField = emptyFields[nextFocusedIndex];\n }\n\n if (skips >= emptyFields.length) {\n nextRequiredField = null;\n }\n\n if (nextRequiredField) {\n const id = getFieldId(nextRequiredField);\n const el = document.getElementById(id) as any;\n el?.scrollIntoView({behavior: 'smooth'});\n el?.focusField();\n this.focusedField = nextRequiredField.name;\n }\n }\n\n getRecipientFields() {\n return this.envelope.fields.filter(field => field.role_name === this.recipient.role_name);\n }\n\n // See if everything that \"needs to be\" filled in is, and all \"fillable fields\" are valid\n checkRecipientFields() {\n const invalidFields = this.getRecipientFields().filter(field => !this.isFieldValid(field));\n if (invalidFields.length < 1) {\n this.nextButtonLabel = 'Finish';\n if (!this.nextSubmits) {\n this.nextSubmits = true;\n }\n } else {\n console.log(\n '[SIGN] Invalid fields remaining',\n invalidFields.map(field => field.name),\n );\n this.nextButtonLabel = 'Next';\n this.nextSubmits = false;\n }\n }\n\n attachFieldAttributes(pageInfo, field, el) {\n // We can get called multiple times as rendering completes and it's hard to avoid that\n // because it's a ton of work for the callers to know it's been done already. But we\n // don't want to attach multiple event listeners or we get dupe event handling, like\n // calling the server twice on every field update. Since JS has no removeAllEventListeners()\n // option, using removeEventListener() isn't reliable the way Stencil binds local function\n // contexts, and cloneNode messes up the rest of the rendering, we just track it with a flag.\n if (el.getAttribute('attached') === '1') {\n return;\n }\n el.setAttribute('attached', '1');\n\n el.addEventListener('input', (e: any) => {\n // console.log('[SIGN] onfieldInput', e.detail, e.target.value);\n // These field types don't emit fieldChange. Should we standardize on that? We don't tap \"input\" for fields like\n // text boxes because we'd be updating the field on every keystroke. We do those on blur which fires fieldChange.\n if (e.target.type === 'radio' || e.target.type === 'checkbox') {\n // if (e.target.type === 'radio' || e.target.name.includes('date') || e.target.name.includes('checkbox')) {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n } else {\n this.checkRecipientFields();\n }\n });\n el.addEventListener('attached', async (e: any) => {\n console.log('[SIGN] onAttached', e.detail, e.target.value);\n this.showSpinner = true;\n try {\n const updateResult = await uploadEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name, e.detail);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.checkRecipientFields();\n\n const newEl = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone});\n this.attachFieldAttributes(pageInfo, field, newEl);\n\n this.showSpinner = false;\n } catch (e) {\n console.log('Error uploading attachment', e);\n VerdocsToast('Unable to upload attachment, please try again later', {style: 'error'});\n this.showSpinner = false;\n }\n });\n el.addEventListener('deleted', async (e: any) => {\n console.log('[SIGN] onDeleted', e.detail, e.target.value);\n this.showSpinner = true;\n try {\n const updateResult = await deleteEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name);\n console.log('[SIGN] Deleted attachment', updateResult);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.checkRecipientFields();\n\n const newEl = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone});\n this.attachFieldAttributes(pageInfo, field, newEl);\n\n this.showSpinner = false;\n } catch (e) {\n console.log('Error uploading attachment', e);\n VerdocsToast('Unable to upload attachment, please try again later', {style: 'error'});\n this.showSpinner = false;\n }\n });\n el.addEventListener('focusout', e => {\n // These field types trigger focusout as they're used, even without a value change\n if (field.type !== 'dropdown' && field.type !== 'attachment') {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n }\n });\n el.addEventListener('fieldChange', e => {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n });\n\n el.setAttribute('templateid', this.envelope.template_id);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('page', pageInfo.pageNumber);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n\n const fullName = formatFullName(this.recipient);\n el.setAttribute('initials', fullNameToInitials(fullName));\n el.setAttribute('name', fullName);\n }\n\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n\n // NOTE: We don't filter on pageNumber here because we need the position in the\n // entire list to set the tabIndex.\n const recipientFields = this.getSortedFillableFields();\n console.log('[SIGN] Rendering fields for page', pageInfo.pageNumber, recipientFields);\n\n // First render the fields for the signer\n recipientFields.forEach((field, tabIndex) => {\n if (field.page !== pageInfo.pageNumber) {\n return;\n }\n\n const el = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone}, tabIndex);\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, el);\n }\n });\n\n // Now render the fields for other signers who have yet to act\n this.sortedRecipients\n .filter(r => r.role_name !== this.recipient.role_name && (r.status === 'invited' || r.status === 'opened' || r.status === 'pending'))\n .forEach(() => {\n this.getRecipientFields()\n .filter(field => field.page === pageInfo.pageNumber)\n .forEach(field => {\n const el = renderDocumentField('envelope', field, pageInfo, {disabled: true, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, el);\n }\n });\n });\n\n this.checkRecipientFields();\n }\n\n render() {\n if (this.showLoadError) {\n return (\n <Host>\n <verdocs-ok-dialog\n heading=\"Unable to Start Signing\"\n message={`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`}\n buttonLabel=\"OK\"\n onNext={() => {\n window.location.reload();\n }}\n />\n </Host>\n );\n }\n\n if (!this.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (this.fatalErrorMessage) {\n return (\n <Host class={{agreed: this.agreed}}>\n <div class=\"fatal-error\">\n <div class=\"message\">\n <div class=\"header\">{this.fatalErrorHeader}</div>\n <p>{this.fatalErrorMessage}</p>\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.isDone) {\n return (\n <Host class={{agreed: this.agreed}}>\n <verdocs-view endpoint={this.endpoint} envelopeId={this.envelopeId} onSdkError={e => this.sdkError?.emit(e.detail)} />\n\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message={`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`}\n onNext={(e: any) => {\n e.preventDefault();\n e.stopPropagation();\n this.showDone = false;\n this.isDone = true;\n }}\n />\n )}\n\n {this.submitting && (\n <div class=\"loading-indicator\">\n <verdocs-loader />\n </div>\n )}\n </Host>\n );\n }\n\n if (!this.agreed) {\n return (\n <Host class=\"agreed\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"agree\">\n <verdocs-checkbox name=\"agree\" label=\"By checking this box, you:\" onInput={() => this.handleClickAgree()} />\n <ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the{' '}\n <a href=\"https://verdocs.com/en/electronic-record-signature-disclosure/\" target=\"_blank\">\n Electronic Record and Signatures Disclosure\n </a>\n .\n </li>\n <li>\n Agree to Verdocs'{' '}\n <a href=\"https://verdocs.com/en/eula\" target=\"_blank\">\n End User License Agreement\n </a>{' '}\n and confirm you have read Verdocs'{' '}\n <a href=\"https://verdocs.com/en/privacy-policy/\" target=\"_blank\">\n Privacy Policy\n </a>\n .\n </li>\n </ul>\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.kbaStep === 'pin') {\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n <verdocs-kba-dialog\n mode=\"text\"\n step={1}\n steps={1}\n helptitle=\"Document is protected by a PIN code\"\n helptext=\"Please enter your PIN code to proceed. If you do not have one, please contact the sender.\"\n label=\"PIN Code\"\n onNext={async e => {\n submitKbaPin(this.endpoint, this.envelopeId, this.roleId, e.detail as string)\n .then(r => {\n console.log('[SIGN] PIN code submission result', r);\n if (r.kba_step === 'complete') {\n this.kbaStep = '';\n }\n })\n .catch(e => {\n console.log('[SIGN] Error submitting PIN', e);\n VerdocsToast(e.response?.data?.error || 'Unable to verify PIN code. Please try again.', {style: 'error'});\n });\n }}\n />\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.kbaStep === 'identity') {\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n <verdocs-kba-dialog\n mode=\"identity\"\n helptitle=\"Document requires identity verification\"\n helptext=\"Please complete your contact details to proceed.\"\n recipient={this.recipient}\n onNext={async e => {\n const recipDetails = e.detail as IRecipient;\n submitKbaIdentity(this.endpoint, this.envelopeId, this.roleId, {\n firstName: recipDetails.first_name,\n lastName: recipDetails.last_name,\n address: recipDetails.address,\n city: recipDetails.city,\n state: recipDetails.state,\n zip: recipDetails.zip,\n ssnLast4: recipDetails.ssn_last_4,\n })\n .then(r => {\n console.log('[SIGN] Identity submission result', r);\n this.kbaStep = r.kba_step;\n })\n .catch(e => {\n console.log('[SIGN] Error submitting identity', e);\n VerdocsToast(e.response?.data?.error || 'Unable to verify identity.', {style: 'error'});\n });\n }}\n />\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.kbaStep === 'challenge') {\n const questionNumber = this.kbaChoices.length;\n const kbaQuestion = this.kbaQuestions[questionNumber];\n console.log('Showing KBA question', {questionNumber, kbaQuestion}, this.kbaChoices);\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n {this.kbaChoices.length >= this.kbaQuestions.length ? (\n <verdocs-spinner />\n ) : (\n <verdocs-kba-dialog\n mode=\"choice\"\n helptitle=\"Your identity requires additional verification\"\n helptext={kbaQuestion?.prompt || 'Please select one of the options below.'}\n choices={kbaQuestion?.answer || ['Skip Question']}\n step={questionNumber + 1}\n steps={this.kbaQuestions.length}\n onNext={async (e: any) => {\n const answer = e.detail as string;\n this.kbaChoices = [...this.kbaChoices, answer];\n if (this.kbaChoices.length >= this.kbaQuestions.length) {\n const responses = this.kbaQuestions.map((q, i) => ({type: q.type, answer: this.kbaChoices[i]}));\n console.log('Submitting KBA responses', this.kbaChoices, responses);\n try {\n const response = await submitKbaChallengeResponse(this.endpoint, this.envelopeId, this.roleId, responses);\n console.log('KBA challenge response', response);\n this.kbaStep = response.kba_step;\n if (this.kbaStep === 'failed') {\n this.fatalErrorHeader = 'Identity Verification Failed';\n this.fatalErrorMessage = \"We were unable to verify your identity. Please contact the document's sender.\";\n this.isDone = true;\n } else {\n this.kbaQuestions = (response as any).questions?.question || [];\n this.kbaChoices = [];\n }\n } catch (e) {\n console.log('Error submitting KBA challenge', e);\n this.kbaStep = '';\n this.fatalErrorHeader = 'Unable to Verify Identity';\n this.fatalErrorMessage = e.response?.data?.error || 'Please try again later.';\n this.isDone = true;\n }\n }\n }}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n <div style={{flex: '1'}} />\n\n {!this.finishLater && <verdocs-button size=\"xsmall\" label={this.nextButtonLabel} disabled={!this.agreed} onClick={() => this.handleNext()} />}\n\n <div style={{marginLeft: '10px'}} />\n <verdocs-dropdown options={!this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n {(this.envelope.documents || []).map(envelopeDocument => {\n const pageNumbers = integerSequence(1, envelopeDocument.pages);\n\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = envelopeDocument.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n // In signing mode we show the original template page with all the recipient fields so we can show source formatting and\n // where everything went. This is also a visual indicator when optional fields weren't filled in by previous actors, or\n // future signers still need to act. Once we're \"done\" we flip to showing the envelope's documents which have the final\n // field vales (so far) stamped into them.\n // TODO: Confirm that a pure page-number match is good enough to find the matching template page. We need to make sure\n // we either don't reset our page numbers for additional attachments, or add match-on identifiers to work around that.\n // console.log('tp', templatePage, page);\n return (\n <verdocs-envelope-document-page\n envelopeId={this.envelopeId}\n documentId={envelopeDocument.id}\n endpoint={this.endpoint}\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\n pageNumber={pageNumber}\n onPageRendered={e => this.handlePageRendered(e)}\n type=\"filled\"\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n\n {this.showFinishLater && (\n <verdocs-ok-dialog\n heading=\"You've saved your document to finish later.\"\n message={`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`}\n onNext={() => (this.showFinishLater = false)}\n />\n )}\n\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message={`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`}\n onNext={() => {\n this.showDone = false;\n this.isDone = true;\n }}\n />\n )}\n\n {this.submitting ||\n (this.showSpinner && (\n <verdocs-portal>\n <div class=\"spinner-overlay\">\n <verdocs-spinner />\n </div>\n </verdocs-portal>\n ))}\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"verdocs-sign.entry.js","mappings":";;;;;;;;;;AAAA,MAAM,cAAc,GAAG,6gIAA6gI,CAAC;AACriI,0BAAe,cAAc;;ACY7B,MAAM,qBAAqB,GAAG;IAC5B,EAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAC;;IAEpC,EAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAC;IACzC,EAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,uBAAuB,EAAC;IAC7C,EAAC,EA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,EAAC,cAAc,EACtB,OAAO,EAAE,sBAAsB,IAAI,CAAC,uBAAuB,8MAA8M,EACzQ,MAAM,EAAE;gBACN,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;gBACtB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;aACpB,GACD,CACH,EAEA,IAAI,CAAC,UAAU;aACb,IAAI,CAAC,WAAW,KACf,0BACE,WAAK,KAAK,EAAC,iBAAiB,IAC1B,0BAAmB,CACf,CACS,CAClB,CAAC,CACC,EACP;KACH;;;;;;","names":[],"sources":["src/components/embeds/verdocs-sign/verdocs-sign.scss?tag=verdocs-sign","src/components/embeds/verdocs-sign/verdocs-sign.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-sign {\n display: flex;\n overflow: hidden;\n position: relative;\n min-height: 600px;\n flex-direction: column;\n box-sizing: border-box;\n font-family: $verdocs-primary-font;\n\n div {\n display: block;\n box-sizing: border-box;\n }\n\n input {\n vertical-align: top;\n }\n\n //.intro {\n // width: 100%;\n // display: flex;\n // flex: 0 0 60px;\n // color: #111111;\n // font-size: 18px;\n // font-weight: 500;\n // line-height: 28px;\n // flex-direction: row;\n // background: #ffffff;\n //\n // .inner {\n // width: 100%;\n // display: flex;\n // margin: 0 auto;\n // padding: 0 20px;\n // max-width: 1200px;\n // flex-direction: row;\n // align-items: center;\n // }\n //}\n\n > .document {\n flex: 1;\n width: 100%;\n height: 100%;\n align-self: center;\n display: flex;\n padding: 15px;\n row-gap: 15px;\n max-width: 1200px;\n min-height: 200px;\n position: relative;\n overflow-y: scroll;\n align-items: center;\n box-sizing: border-box;\n flex-direction: column;\n //justify-content: center;\n\n .inner {\n width: 100%;\n max-width: 1028px;\n }\n }\n\n .cover {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 5000;\n position: absolute;\n padding-top: 100px;\n align-items: center;\n flex-direction: column;\n background: rgba(0, 0, 0, 0.5);\n }\n\n .agree {\n flex: 0;\n width: 600px;\n display: flex;\n max-width: 90%;\n padding: 30px 15px;\n flex-direction: column;\n background-color: #ffffff;\n\n .header {\n flex: 0 0 56px;\n }\n\n li {\n margin: 0.5em 0;\n }\n }\n\n verdocs-ok-dialog .background-overlay {\n align-items: flex-start;\n padding-top: 100px;\n }\n\n .loading-indicator {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n z-index: 10000;\n position: fixed;\n background-color: rgba(0, 0, 0, 0.7);\n }\n\n .fatal-error {\n position: absolute;\n z-index: 100;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: #4a4a4a;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .placeholder {\n position: absolute;\n opacity: 0.1;\n z-index: -1;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n margin-top: 15px;\n }\n\n .message {\n max-width: 50%;\n width: 50%;\n font-size: 16px;\n background: white;\n border-radius: 5px;\n box-shadow: 3px 3px 9px -1px #0000003f;\n }\n\n .header {\n color: white;\n font-size: 18px;\n font-weight: 500;\n padding: 5px 10px;\n margin: 0 0 10px 0;\n background: $verdocs-purple;\n }\n\n p {\n margin: 1rem;\n font-size: 14px;\n font-weight: 400;\n padding: 0 10px;\n }\n }\n}\n\n@media print {\n verdocs-sign .header {\n display: none;\n }\n}\n\n#verdocs-sign-header {\n color: #fff;\n width: 100%;\n display: flex;\n z-index: 1000;\n flex: 0 0 46px;\n font-size: 12px;\n column-gap: 15px;\n align-items: center;\n flex-direction: row;\n transition: all 0.25s;\n background-color: $medium-bg;\n box-shadow:\n 0 4px 4px 0 rgb(0 0 0 / 24%),\n 0 0 4px 0 rgb(0 0 0 / 12%);\n\n .inner {\n width: 100%;\n display: flex;\n margin: 0 auto;\n padding: 0 12px;\n max-width: 1200px;\n align-items: center;\n flex-direction: row;\n }\n\n .logo {\n width: 80px;\n display: none;\n margin: -6px 0 0 0;\n }\n\n .title {\n font-size: 18px;\n font-weight: 500;\n overflow: hidden;\n white-space: nowrap;\n padding: 0 10px 0 0;\n text-overflow: ellipsis;\n }\n}\n\n.spinner-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n display: flex;\n align-items: center;\n background: #0000007f;\n justify-content: center;\n}\n","import type {IEnvelope, IEnvelopeField, IRecipient} from '@verdocs/js-sdk';\nimport {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {updateEnvelopeFieldSignature, uploadEnvelopeFieldAttachment, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {updateEnvelopeField, sortFields, submitKbaIdentity, submitKbaChallengeResponse} from '@verdocs/js-sdk';\nimport {fullNameToInitials, startSigningSession, deleteEnvelopeFieldAttachment, getKbaStep} from '@verdocs/js-sdk';\nimport {getEnvelope, integerSequence, isValidEmail, isValidPhone, submitKbaPin, updateEnvelopeFieldInitials} from '@verdocs/js-sdk';\nimport {createInitials, createSignature, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, formatFullName} from '@verdocs/js-sdk';\nimport {getFieldId, renderDocumentField, saveAttachment, updateDocumentFieldValue} from '../../../utils/utils';\nimport {IDocumentPageInfo} from '../../../utils/Types';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\nimport {Store} from '../../../utils/Datastore';\n\nconst inProgressMenuOptions = [\n {id: 'later', label: 'Finish Later'}, //\n // {id: 'claim', label: 'Claim the Document', disabled: true},\n {id: 'decline', label: 'Decline to Sign'},\n {id: 'print', label: 'Print Without Signing'},\n {id: 'download', label: 'Download'},\n];\n\nconst doneMenuOptions = [\n {id: 'print', label: 'Print'},\n {id: 'download', label: 'Download'},\n];\n\n/**\n * Display an envelope signing experience. This will display the envelope's attached\n * documents with signing fields overlaid on each page.\n *\n * The component will attempt to initiate a signing session and load the specified\n * envelope. If successful, the recipient's fields will be enabled and the user will\n * be able to sign the envelope's attached documents. If not, an `sdkError` will be\n * thrown and the component will be blank/empty. To provide the best user experience,\n * applications should capture and handle this error to provide the user with\n * instructions/options for next steps based on the application's design and workflow.\n *\n * Unlike other components, this will always create its own endpoint to manage the\n * session session. This endpoint will be included in event callbacks for the\n * convenience of host applications that may wish to make server calls using the\n * signer's credentials once signing is complete (e.g. to obtain copies of\n * the signed attachments.)\n */\n@Component({\n tag: 'verdocs-sign',\n styleUrl: 'verdocs-sign.scss',\n shadow: false,\n})\nexport class VerdocsSign {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop({mutable: true}) endpoint: VerdocsEndpoint = null;\n\n /**\n * The ID of the envelope to sign.\n */\n @Prop({reflect: true}) envelopeId: string | null = null;\n\n /**\n * The ID of the role that will be signing e.g. 'Recipient 1'\n */\n @Prop({reflect: true}) roleId: string | null = null;\n\n /**\n * The invite code for the signer.\n */\n @Prop({reflect: true}) inviteCode: string | null = null;\n\n /**\n * If set, (recommended), the host application should create a <DIV> element with a unique ID. When this\n * component renders, the header will be removed from its default location and placed in the target element.\n * This allows the parent application to more easily control its placement and scroll effects (e.g. \"fixed\").\n *\n * The movement of the header to the target container is not dynamic - it is performed only on the initial\n * render. Host applications should not conditionally render this container. If the header's visibility must\n * be externally controlled, use CSS display options to hide/show it instead.\n */\n @Prop() headerTargetId: string | null = null;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n /**\n * Event fired when the envelope is updated in any way.\n */\n @Event({composed: true}) envelopeLoaded: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope}>;\n\n /**\n * Event fired when the envelope is updated in any way. May be used for tasks such as cache invalidation or reporting to other systems.\n */\n @Event({composed: true}) envelopeUpdated: EventEmitter<{endpoint: VerdocsEndpoint; envelope: IEnvelope; event: string}>;\n\n @State() roleNames: string[] = [];\n @State() sortedRecipients: IRecipient[] = [];\n @State() recipient: IRecipient | null = null;\n @State() hasSignature = false;\n @State() nextButtonLabel = 'Start';\n @State() nextSubmits = false;\n @State() fatalErrorHeader = '';\n @State() fatalErrorMessage = '';\n @State() focusedField = '';\n @State() submitting = false;\n @State() submitted = false;\n @State() isDone = false;\n @State() showDone = false;\n @State() showLoadError = false;\n @State() finishLater = false;\n @State() showFinishLater = false;\n @State() agreed = false;\n @State() documentsSingularPlural = 'document';\n @State() kbaStep = '';\n @State() kbaQuestions: any[] = [];\n @State() showSpinner = false;\n @State() kbaChoices = [];\n\n @State() loading = true;\n @State() envelope: IEnvelope | null = null;\n\n recipientIndex: number = -1;\n\n componentWillLoad() {\n if (!this.endpoint) {\n console.log('[SIGN] Creating signing endpoint');\n this.endpoint = new VerdocsEndpoint({sessionType: 'signing'});\n }\n }\n\n async componentDidLoad() {\n if (!this.envelopeId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required envelopId', 500, ''));\n return;\n }\n\n if (!this.roleId) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required roleId', 500, ''));\n return;\n }\n\n if (!this.inviteCode) {\n this.sdkError?.emit(new SDKError('[SIGN] Missing required inviteCode', 500, ''));\n return;\n }\n\n try {\n console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);\n\n // NOTE: We don't listen to the store here because we are often an independent\n // session and might have a different \"view\" of the envelope.\n const {envelope, recipient} = await startSigningSession(this.endpoint, this.envelopeId, this.roleId, this.inviteCode);\n console.log(`[SIGN] Loaded signing session`, envelope, recipient);\n this.recipient = recipient;\n this.envelope = envelope;\n\n Store.updateEnvelope(this.envelopeId, envelope);\n\n // TODO: Can be cleaned up shortly.\n this.sortedRecipients = [...this.envelope.recipients];\n this.sortedRecipients.sort((a, b) => {\n return a.sequence === b.sequence ? a.order - b.order : a.sequence - b.sequence;\n });\n\n this.roleNames = this.sortedRecipients.map(r => r.role_name);\n\n if (this.envelope.documents.length > 0) {\n this.documentsSingularPlural = 'document(s)';\n }\n\n this.recipientIndex = this.roleNames.findIndex(roleName => roleName == this.roleId);\n if (this.recipientIndex > -1) {\n this.recipient = this.sortedRecipients[this.recipientIndex];\n this.agreed = this.recipient.agreed;\n } else {\n console.warn('[SIGN] Could not find our recipient record', this.roleId, this.sortedRecipients);\n }\n\n // TODO: Envelope \"complete\" | \"declined\" | \"canceled\"\n // TODO: Recipient \"canceled\"\n this.submitted = this.recipient.status === 'submitted';\n this.isDone = this.submitted;\n this.showDone = this.submitted;\n\n if (this.envelope.status === 'canceled') {\n this.fatalErrorHeader = 'Unable to Start Signing Session';\n this.fatalErrorMessage = 'This envelope has been canceled. Please contact its sender for more information.';\n } else if (this.recipient.status === 'declined') {\n this.fatalErrorHeader = 'Unable to Start Signing Session';\n this.fatalErrorMessage = 'You have declined to sign this envelope.';\n } else if (this.agreed) {\n this.nextButtonLabel = 'Next';\n }\n\n this.checkRecipientFields();\n this.envelopeLoaded?.emit({endpoint: this.endpoint, envelope: this.envelope});\n\n if (!this.isDone) {\n getKbaStep(this.endpoint, this.envelopeId, this.roleId)\n .then(r => {\n console.log('[SIGN] KBA Step', r);\n this.kbaStep = r.kba_step;\n if (this.kbaStep === 'failed') {\n this.fatalErrorHeader = 'Identity Verification Failed';\n this.fatalErrorMessage = \"We were unable to verify your identity. Please contact the document's sender.\";\n this.isDone = true;\n } else {\n this.kbaQuestions = (r as any).questions?.question || [];\n this.kbaChoices = [];\n }\n })\n .catch(e => console.log('Error getting KBA step', e));\n }\n } catch (e) {\n console.log('[SIGN] Error with signing session', e);\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n this.showLoadError = true;\n }\n }\n\n componentDidRender() {\n const headerTarget = this.headerTargetId ? document.getElementById(this.headerTargetId) : null;\n const headerEl = document.getElementById('verdocs-sign-header');\n if (headerTarget && headerEl) {\n console.log('[SIGN] Moving header');\n headerEl.remove();\n headerTarget.append(headerEl);\n }\n }\n\n handleClickAgree() {\n this.submitting = true;\n envelopeRecipientAgree(this.endpoint, this.envelopeId, this.roleId, true)\n .then(() => {\n this.nextButtonLabel = 'Next';\n this.recipient.agreed = true;\n this.submitting = false;\n this.agreed = true; // The server returns a recipient object but it's not \"deep\" so we track this locally\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'agreed'});\n })\n .catch(e => {\n console.log('[SIGN] Update failure', e);\n this.submitting = false;\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleOptionSelected(e: any) {\n switch (e.detail.id) {\n case 'later':\n this.finishLater = true;\n this.showFinishLater = true;\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'later'});\n break;\n\n case 'claim':\n VerdocsToast('This feature will be available in an upcoming release.');\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'claimed'});\n break;\n\n case 'decline':\n {\n this.submitting = true;\n const declineResult = await envelopeRecipientDecline(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Decline result', declineResult);\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'declined'});\n this.submitting = false;\n this.fatalErrorHeader = 'Declined';\n this.fatalErrorMessage = 'You have declined to sign this envelope.';\n }\n break;\n\n case 'print':\n window.print();\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'printed'});\n break;\n\n case 'download':\n {\n const firstDoc = this.envelope.documents.find(doc => doc.type === 'attachment');\n if (firstDoc) {\n saveAttachment(this.endpoint, this.envelope, firstDoc.id).catch(e => {\n console.log('[SIGN] Error downloading PDF', e);\n });\n this.envelopeUpdated?.emit({endpoint: this.endpoint, envelope: this.envelope, event: 'downloaded'});\n }\n }\n break;\n }\n }\n\n updateRecipientFieldValue(fieldName: string, updateResult: any) {\n console.log('[SIGN] updateRecipientFieldValue', fieldName, updateResult);\n this.getRecipientFields().forEach(oldField => {\n if (oldField.name === fieldName) {\n oldField.value = updateResult.value;\n // TODO: Keeping this while attachments still rely on it\n oldField.settings = updateResult.settings;\n updateDocumentFieldValue(oldField);\n this.checkRecipientFields();\n }\n });\n }\n\n saveFieldChange(fieldName: string, fields: Record<string, any>) {\n console.log('[SIGN] saveFieldChange', fieldName, fields);\n updateEnvelopeField(this.endpoint, this.envelopeId, fieldName, fields) //\n .then(updateResult => this.updateRecipientFieldValue(fieldName, updateResult))\n .catch(e => {\n if (e.response?.status === 401 && e.response?.data?.error === 'jwt expired') {\n console.log('[SIGN] Signing session expired');\n this.fatalErrorHeader = 'Signing Session Expired';\n this.fatalErrorMessage = 'Please reload your browser to continue.';\n } else {\n console.log('[SIGN] Server error', e);\n }\n\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n });\n }\n\n async handleFieldChange(field: IEnvelopeField, e: any) {\n const {value, checked} = e.target;\n\n switch (field.type as any) {\n // TODO: Remove legacy type when no longer needed\n case 'textarea':\n case 'textbox':\n return this.saveFieldChange(field.name, {prepared: false, value});\n\n case 'checkbox': {\n return this.saveFieldChange(field.name, {prepared: false, value: String(e.target.checked)});\n }\n\n case 'radio': {\n return this.saveFieldChange(field.name, {prepared: false, value: String(e.target.checked)});\n }\n\n case 'dropdown':\n // TODO: Set prepared to false server-side.\n console.log('Saving dropdown', field.name, e.detail);\n return this.saveFieldChange(field.name, {prepared: false, value: e.detail});\n\n case 'initial':\n // This can be caused by a focus-out event if the user clicks the field\n // after it's already filled in, then clicks something else like a textbox.\n // We don't visually indicate the focus, but it's still there.\n if (!e.detail) {\n return;\n }\n\n this.showSpinner = true;\n const initialsBlob = await (await fetch(e.detail)).blob();\n return createInitials(this.endpoint, 'initial', initialsBlob) //\n .then(async newInitials => {\n const updateResult = await updateEnvelopeFieldInitials(this.endpoint, this.envelopeId, field.name, newInitials.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.showSpinner = false;\n })\n .catch(e => {\n console.log('Error updating initials', e);\n this.showSpinner = false;\n });\n\n case 'signature':\n // This can be caused by a focus-out event if the user clicks the field\n // after it's already filled in, then clicks something else like a textbox.\n // We don't visually indicate the focus, but it's still there.\n if (!e.detail) {\n return;\n }\n\n this.showSpinner = true;\n const signatureBlob = await (await fetch(e.detail)).blob();\n return createSignature(this.endpoint, 'signature', signatureBlob) //\n .then(async newSignature => {\n console.log('Signature update result', newSignature);\n const updateResult = await updateEnvelopeFieldSignature(this.endpoint, this.envelopeId, field.name, newSignature.id);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.showSpinner = false;\n })\n .catch(e => {\n console.warn('[SIGN] Error updating signature', e);\n this.showSpinner = false;\n });\n\n case 'date':\n const {formattedDate} = e.detail;\n if (formattedDate) {\n return this.saveFieldChange(field.name, {prepared: false, value: formattedDate});\n }\n break;\n\n case 'timestamp':\n console.log('[SIGN] Updating timestamp', {value, ts: e.target.getAttribute('timestamp')});\n break;\n\n default:\n console.log('[SIGN] Unhandled field update', {value, checked}, field);\n break;\n }\n }\n\n isFieldFilled(field: IEnvelopeField) {\n const {value = ''} = field;\n switch (field.type as any) {\n case 'textarea':\n case 'textbox':\n switch (field.validator || '') {\n case 'email':\n return isValidEmail(value);\n case 'phone':\n return isValidPhone(value);\n default:\n return (value || '').trim() !== '';\n }\n\n case 'signature':\n return value === 'signed';\n\n case 'initial':\n return value === 'initialed';\n\n // Timestamp fields get automatically filled when the envelope is submitted.\n case 'timestamp':\n return true;\n\n case 'date':\n return !!value;\n\n case 'attachment':\n return value === 'attached';\n\n case 'dropdown':\n return value !== '';\n\n case 'checkbox':\n return value === 'true';\n\n case 'radio':\n if (!!field.group) {\n return this.getRecipientFields()\n .filter(f => f.group === field.group)\n .some(field => field.value === 'true');\n }\n\n return field.value === 'true';\n\n default:\n return false;\n }\n }\n\n isFieldValid(field: IEnvelopeField) {\n return !field.required || this.isFieldFilled(field);\n }\n\n getSortedFillableFields() {\n const recipientFields = this.getRecipientFields().filter(field => field.type !== 'timestamp');\n sortFields(recipientFields);\n return recipientFields;\n }\n\n async handleNext() {\n if (this.nextSubmits) {\n try {\n // Patches the date picker to be forcibly removed if still showing during submission\n document.getElementById('air-datepicker-global-container')?.remove();\n\n this.submitting = true;\n const result = await envelopeRecipientSubmit(this.endpoint, this.envelopeId, this.roleId);\n console.log('[SIGN] Submitted successfully', result);\n this.recipient.status = 'submitted';\n this.showDone = true;\n console.log('[SIGN] Reloading envelope');\n getEnvelope(this.endpoint, this.envelopeId)\n .then(envelope => {\n this.envelope = envelope;\n // The show-done dialog does this\n // this.isDone = true;\n this.submitting = false;\n })\n .catch(e => {\n // this.isDone = true;\n console.log('[SIGN] Error reloading envelope', e);\n this.submitting = false;\n });\n } catch (e) {\n console.log('[SIGN] Error submitting', e);\n }\n\n return;\n }\n\n // Find and focus the next incomplete field (that is fillable)\n const emptyFields = this.getSortedFillableFields().filter(field => field.required && !this.isFieldFilled(field));\n sortFields(emptyFields);\n\n const focusedIndex = emptyFields.findIndex(field => field.name === this.focusedField);\n let nextFocusedIndex = focusedIndex + 1;\n if (nextFocusedIndex >= emptyFields.length) {\n nextFocusedIndex = 0;\n }\n\n let nextRequiredField = emptyFields[nextFocusedIndex];\n // console.log('Next field', nextRequiredField, emptyFields);\n\n // Skip signature and initial fields that are already filled in. We have to count our \"skips\" just in case, to avoid infinite loops.\n let skips = 0;\n if (skips < emptyFields.length && ['signature', 'initial'].includes(nextRequiredField.type) && ['initialed', 'signed'].includes(nextRequiredField.value)) {\n skips++;\n nextFocusedIndex++;\n if (nextFocusedIndex >= emptyFields.length) {\n nextFocusedIndex = 0;\n }\n nextRequiredField = emptyFields[nextFocusedIndex];\n }\n\n if (skips >= emptyFields.length) {\n nextRequiredField = null;\n }\n\n if (nextRequiredField) {\n const id = getFieldId(nextRequiredField);\n const el = document.getElementById(id) as any;\n el?.scrollIntoView({behavior: 'smooth'});\n el?.focusField();\n this.focusedField = nextRequiredField.name;\n }\n }\n\n getRecipientFields() {\n return this.envelope.fields.filter(field => field.role_name === this.recipient.role_name);\n }\n\n // See if everything that \"needs to be\" filled in is, and all \"fillable fields\" are valid\n checkRecipientFields() {\n const invalidFields = this.getRecipientFields().filter(field => !this.isFieldValid(field));\n if (invalidFields.length < 1) {\n this.nextButtonLabel = 'Finish';\n if (!this.nextSubmits) {\n this.nextSubmits = true;\n }\n } else {\n console.log(\n '[SIGN] Invalid fields remaining',\n invalidFields.map(field => field.name),\n );\n this.nextButtonLabel = 'Next';\n this.nextSubmits = false;\n }\n }\n\n attachFieldAttributes(pageInfo, field, el) {\n // We can get called multiple times as rendering completes and it's hard to avoid that\n // because it's a ton of work for the callers to know it's been done already. But we\n // don't want to attach multiple event listeners or we get dupe event handling, like\n // calling the server twice on every field update. Since JS has no removeAllEventListeners()\n // option, using removeEventListener() isn't reliable the way Stencil binds local function\n // contexts, and cloneNode messes up the rest of the rendering, we just track it with a flag.\n if (el.getAttribute('attached') === '1') {\n return;\n }\n el.setAttribute('attached', '1');\n\n el.addEventListener('input', (e: any) => {\n // console.log('[SIGN] onfieldInput', e.detail, e.target.value);\n // These field types don't emit fieldChange. Should we standardize on that? We don't tap \"input\" for fields like\n // text boxes because we'd be updating the field on every keystroke. We do those on blur which fires fieldChange.\n if (e.target.type === 'radio' || e.target.type === 'checkbox') {\n // if (e.target.type === 'radio' || e.target.name.includes('date') || e.target.name.includes('checkbox')) {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n } else {\n this.checkRecipientFields();\n }\n });\n el.addEventListener('attached', async (e: any) => {\n console.log('[SIGN] onAttached', e.detail, e.target.value);\n this.showSpinner = true;\n try {\n const updateResult = await uploadEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name, e.detail);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.checkRecipientFields();\n\n const newEl = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone});\n this.attachFieldAttributes(pageInfo, field, newEl);\n\n this.showSpinner = false;\n } catch (e) {\n console.log('Error uploading attachment', e);\n VerdocsToast('Unable to upload attachment, please try again later', {style: 'error'});\n this.showSpinner = false;\n }\n });\n el.addEventListener('deleted', async (e: any) => {\n console.log('[SIGN] onDeleted', e.detail, e.target.value);\n this.showSpinner = true;\n try {\n const updateResult = await deleteEnvelopeFieldAttachment(this.endpoint, this.envelopeId, field.name);\n console.log('[SIGN] Deleted attachment', updateResult);\n this.updateRecipientFieldValue(field.name, updateResult);\n this.checkRecipientFields();\n\n const newEl = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone});\n this.attachFieldAttributes(pageInfo, field, newEl);\n\n this.showSpinner = false;\n } catch (e) {\n console.log('Error uploading attachment', e);\n VerdocsToast('Unable to upload attachment, please try again later', {style: 'error'});\n this.showSpinner = false;\n }\n });\n el.addEventListener('focusout', e => {\n // These field types trigger focusout as they're used, even without a value change\n if (field.type !== 'dropdown' && field.type !== 'attachment') {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n }\n });\n el.addEventListener('fieldChange', e => {\n this.handleFieldChange(field, e).finally(() => this.checkRecipientFields());\n });\n\n el.setAttribute('templateid', this.envelope.template_id);\n el.setAttribute('fieldname', field.name);\n el.setAttribute('page', pageInfo.pageNumber);\n el.setAttribute('xScale', pageInfo.xScale);\n el.setAttribute('yScale', pageInfo.yScale);\n\n const fullName = formatFullName(this.recipient);\n el.setAttribute('initials', fullNameToInitials(fullName));\n el.setAttribute('name', fullName);\n }\n\n handlePageRendered(e: any) {\n const pageInfo = e.detail as IDocumentPageInfo;\n\n // NOTE: We don't filter on pageNumber here because we need the position in the\n // entire list to set the tabIndex.\n const recipientFields = this.getSortedFillableFields();\n console.log('[SIGN] Rendering fields for page', pageInfo.pageNumber, recipientFields);\n\n // First render the fields for the signer\n recipientFields.forEach((field, tabIndex) => {\n if (field.page !== pageInfo.pageNumber) {\n return;\n }\n\n const el = renderDocumentField('envelope', field, pageInfo, {disabled: false, editable: false, draggable: false, done: this.isDone}, tabIndex);\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, el);\n }\n });\n\n // Now render the fields for other signers who have yet to act\n this.sortedRecipients\n .filter(r => r.role_name !== this.recipient.role_name && (r.status === 'invited' || r.status === 'opened' || r.status === 'pending'))\n .forEach(() => {\n this.getRecipientFields()\n .filter(field => field.page === pageInfo.pageNumber)\n .forEach(field => {\n const el = renderDocumentField('envelope', field, pageInfo, {disabled: true, editable: false, draggable: false, done: this.isDone});\n if (!el) {\n return;\n }\n\n if (Array.isArray(el)) {\n el.map(e => this.attachFieldAttributes(pageInfo, field, e));\n } else {\n this.attachFieldAttributes(pageInfo, field, el);\n }\n });\n });\n\n this.checkRecipientFields();\n }\n\n render() {\n if (this.showLoadError) {\n return (\n <Host>\n <verdocs-ok-dialog\n heading=\"Unable to Start Signing\"\n message={`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`}\n buttonLabel=\"OK\"\n onNext={() => {\n window.location.reload();\n }}\n />\n </Host>\n );\n }\n\n if (!this.envelope) {\n return (\n <Host>\n <verdocs-loader />\n </Host>\n );\n }\n\n if (this.fatalErrorMessage) {\n return (\n <Host class={{agreed: this.agreed}}>\n <div class=\"fatal-error\">\n <div class=\"message\">\n <div class=\"header\">{this.fatalErrorHeader}</div>\n <p>{this.fatalErrorMessage}</p>\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.isDone) {\n return (\n <Host class={{agreed: this.agreed}}>\n <verdocs-view endpoint={this.endpoint} envelopeId={this.envelopeId} onSdkError={e => this.sdkError?.emit(e.detail)} />\n\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message={`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`}\n onNext={(e: any) => {\n e.preventDefault();\n e.stopPropagation();\n this.showDone = false;\n this.isDone = true;\n }}\n />\n )}\n\n {this.submitting && (\n <div class=\"loading-indicator\">\n <verdocs-loader />\n </div>\n )}\n </Host>\n );\n }\n\n if (!this.agreed) {\n return (\n <Host class=\"agreed\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"agree\">\n <verdocs-checkbox name=\"agree\" label=\"By checking this box, you:\" onInput={() => this.handleClickAgree()} />\n <ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the{' '}\n <a href=\"https://verdocs.com/en/electronic-record-signature-disclosure/\" target=\"_blank\">\n Electronic Record and Signatures Disclosure\n </a>\n .\n </li>\n <li>\n Agree to Verdocs'{' '}\n <a href=\"https://verdocs.com/en/eula\" target=\"_blank\">\n End User License Agreement\n </a>{' '}\n and confirm you have read Verdocs'{' '}\n <a href=\"https://verdocs.com/en/privacy-policy/\" target=\"_blank\">\n Privacy Policy\n </a>\n .\n </li>\n </ul>\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.kbaStep === 'pin') {\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n <verdocs-kba-dialog\n mode=\"text\"\n step={1}\n steps={1}\n helptitle=\"Document is protected by a PIN code\"\n helptext=\"Please enter your PIN code to proceed. If you do not have one, please contact the sender.\"\n label=\"PIN Code\"\n onNext={async e => {\n submitKbaPin(this.endpoint, this.envelopeId, this.roleId, e.detail as string)\n .then(r => {\n console.log('[SIGN] PIN code submission result', r);\n if (r.kba_step === 'complete') {\n this.kbaStep = '';\n }\n })\n .catch(e => {\n console.log('[SIGN] Error submitting PIN', e);\n VerdocsToast(e.response?.data?.error || 'Unable to verify PIN code. Please try again.', {style: 'error'});\n });\n }}\n />\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.kbaStep === 'identity') {\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n <verdocs-kba-dialog\n mode=\"identity\"\n helptitle=\"Document requires identity verification\"\n helptext=\"Please complete your contact details to proceed.\"\n recipient={this.recipient}\n onNext={async e => {\n const recipDetails = e.detail as IRecipient;\n submitKbaIdentity(this.endpoint, this.envelopeId, this.roleId, {\n firstName: recipDetails.first_name,\n lastName: recipDetails.last_name,\n address: recipDetails.address,\n city: recipDetails.city,\n state: recipDetails.state,\n zip: recipDetails.zip,\n ssnLast4: recipDetails.ssn_last_4,\n })\n .then(r => {\n console.log('[SIGN] Identity submission result', r);\n this.kbaStep = r.kba_step;\n })\n .catch(e => {\n console.log('[SIGN] Error submitting identity', e);\n VerdocsToast(e.response?.data?.error || 'Unable to verify identity.', {style: 'error'});\n });\n }}\n />\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.kbaStep === 'challenge') {\n const questionNumber = this.kbaChoices.length;\n const kbaQuestion = this.kbaQuestions[questionNumber];\n return (\n <Host class=\"kba\">\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n <img\n src=\"https://public-assets.verdocs.com/loading-placeholder.png\"\n style={{width: '612px', height: '792px', boxShadow: '0 0 10px 5px #0000000f', marginTop: '15px'}}\n alt=\"Placeholder page\"\n />\n </div>\n\n <div class=\"cover\">\n <div class=\"kba\">\n {this.kbaChoices.length >= this.kbaQuestions.length ? (\n <verdocs-spinner />\n ) : (\n <verdocs-kba-dialog\n mode=\"choice\"\n helptitle=\"Your identity requires additional verification\"\n helptext={kbaQuestion?.prompt || 'Please select one of the options below.'}\n choices={kbaQuestion?.answer || ['Skip Question']}\n step={questionNumber + 1}\n steps={this.kbaQuestions.length}\n onNext={async (e: any) => {\n const answer = e.detail as string;\n this.kbaChoices = [...this.kbaChoices, answer];\n if (this.kbaChoices.length >= this.kbaQuestions.length) {\n const responses = this.kbaQuestions.map((q, i) => ({type: q.type, answer: this.kbaChoices[i]}));\n console.log('Submitting KBA responses', this.kbaChoices, responses);\n try {\n const response = await submitKbaChallengeResponse(this.endpoint, this.envelopeId, this.roleId, responses);\n console.log('KBA challenge response', response);\n this.kbaStep = response.kba_step;\n if (this.kbaStep === 'failed') {\n this.fatalErrorHeader = 'Identity Verification Failed';\n this.fatalErrorMessage = \"We were unable to verify your identity. Please contact the document's sender.\";\n this.isDone = true;\n } else {\n this.kbaQuestions = (response as any).questions?.question || [];\n this.kbaChoices = [];\n }\n } catch (e) {\n console.log('Error submitting KBA challenge', e);\n this.kbaStep = '';\n this.fatalErrorHeader = 'Unable to Verify Identity';\n this.fatalErrorMessage = e.response?.data?.error || 'Please try again later.';\n this.isDone = true;\n }\n }\n }}\n />\n )}\n </div>\n </div>\n </Host>\n );\n }\n\n return (\n <Host>\n <div id=\"verdocs-sign-header\">\n <div class=\"inner\">\n <img src=\"https://verdocs.com/assets/white-logo.svg\" alt=\"Verdocs Logo\" class=\"logo\" />\n <div class=\"title\">{this.envelope.name}</div>\n <div style={{flex: '1'}} />\n\n {!this.finishLater && <verdocs-button size=\"xsmall\" label={this.nextButtonLabel} disabled={!this.agreed} onClick={() => this.handleNext()} />}\n\n <div style={{marginLeft: '10px'}} />\n <verdocs-dropdown options={!this.isDone && !this.finishLater ? inProgressMenuOptions : doneMenuOptions} onOptionSelected={e => this.handleOptionSelected(e)} />\n </div>\n </div>\n\n <div class=\"document\" style={{paddingTop: '15px'}}>\n {(this.envelope.documents || []).map(envelopeDocument => {\n const pageNumbers = integerSequence(1, envelopeDocument.pages);\n\n return (\n <Fragment>\n {pageNumbers.map(pageNumber => {\n const pageSize = envelopeDocument.page_sizes?.[pageNumber] || {width: 612, height: 792};\n\n // In signing mode we show the original template page with all the recipient fields so we can show source formatting and\n // where everything went. This is also a visual indicator when optional fields weren't filled in by previous actors, or\n // future signers still need to act. Once we're \"done\" we flip to showing the envelope's documents which have the final\n // field vales (so far) stamped into them.\n // TODO: Confirm that a pure page-number match is good enough to find the matching template page. We need to make sure\n // we either don't reset our page numbers for additional attachments, or add match-on identifiers to work around that.\n // console.log('tp', templatePage, page);\n return (\n <verdocs-envelope-document-page\n envelopeId={this.envelopeId}\n documentId={envelopeDocument.id}\n endpoint={this.endpoint}\n virtualWidth={pageSize.width}\n virtualHeight={pageSize.height}\n pageNumber={pageNumber}\n onPageRendered={e => this.handlePageRendered(e)}\n type=\"filled\"\n layers={[\n {name: 'page', type: 'canvas'},\n {name: 'controls', type: 'div'},\n ]}\n />\n );\n })}\n </Fragment>\n );\n })}\n </div>\n\n {this.showFinishLater && (\n <verdocs-ok-dialog\n heading=\"You've saved your document to finish later.\"\n message={`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`}\n onNext={() => (this.showFinishLater = false)}\n />\n )}\n\n {this.showDone && (\n <verdocs-ok-dialog\n heading=\"You're Done!\"\n message={`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`}\n onNext={() => {\n this.showDone = false;\n this.isDone = true;\n }}\n />\n )}\n\n {this.submitting ||\n (this.showSpinner && (\n <verdocs-portal>\n <div class=\"spinner-overlay\">\n <verdocs-spinner />\n </div>\n </verdocs-portal>\n ))}\n </Host>\n );\n }\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,n){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?i(e.value):s(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];s=0}finally{n=r=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,t,i){if(i||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return e.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment}from"./index-272d51a4.js";import{VerdocsEndpoint,startSigningSession,getKbaStep,envelopeRecipientAgree,envelopeRecipientDecline,updateEnvelopeField,createSignature,updateEnvelopeFieldSignature,createInitials,updateEnvelopeFieldInitials,isValidPhone,isValidEmail,sortFields,envelopeRecipientSubmit,getEnvelope,uploadEnvelopeFieldAttachment,deleteEnvelopeFieldAttachment,formatFullName,fullNameToInitials,submitKbaPin,submitKbaIdentity,submitKbaChallengeResponse,integerSequence}from"@verdocs/js-sdk";import{a as saveAttachment,u as updateDocumentFieldValue,r as renderDocumentField,g as getFieldId}from"./utils-bd656c37.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";import{S as Store}from"./Datastore-3f924d94.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.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)}verdocs-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);margin-top:15px}verdocs-sign .fatal-error .message{width:50%;font-size:16px;background:white;border-radius:5px;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#654dcb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400}@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 46px;flex:0 0 46px;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 12px;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}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}';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.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.kbaStep="";this.kbaQuestions=[];this.showSpinner=false;this.kbaChoices=[];this.loading=true;this.envelope=null}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,t,i,n,s,r,o,a,l,c,d;var h=this;return __generator(this,(function(u){switch(u.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){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new SDKError("[SIGN] Missing required inviteCode",500,""));return[2]}u.label=1;case 1:u.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=u.sent(),l=a.envelope,c=a.recipient;console.log("[SIGN] Loaded signing session",l,c);this.recipient=c;this.envelope=l;Store.updateEnvelope(this.envelopeId,l);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.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==h.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.submitted=this.recipient.status==="submitted";this.isDone=this.submitted;this.showDone=this.submitted;if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. Please contact its sender for more information."}else if(this.recipient.status==="declined"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="You have declined to sign this envelope."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});if(!this.isDone){getKbaStep(this.endpoint,this.envelopeId,this.roleId).then((function(e){var t;console.log("[SIGN] KBA Step",e);h.kbaStep=e.kba_step;if(h.kbaStep==="failed"){h.fatalErrorHeader="Identity Verification Failed";h.fatalErrorMessage="We were unable to verify your identity. Please contact the document's sender.";h.isDone=true}else{h.kbaQuestions=((t=e.questions)===null||t===void 0?void 0:t.question)||[];h.kbaChoices=[]}})).catch((function(e){return console.log("Error getting KBA step",e)}))}return[3,4];case 3:d=u.sent();console.log("[SIGN] Error with signing session",d);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(d.message,(r=d.response)===null||r===void 0?void 0:r.status,(o=d.response)===null||o===void 0?void 0:o.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 t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;envelopeRecipientAgree(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var t;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(t){var i,n,s;console.log("[SIGN] Update failure",t);e.submitting=false;(i=e.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(s=t.response)===null||s===void 0?void 0:s.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,s,r,o,a,l;return __generator(this,(function(c){switch(c.label){case 0:o=e.detail.id;switch(o){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:VerdocsToast("This feature will be available in an upcoming release.");(i=this.envelopeUpdated)===null||i===void 0?void 0:i.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.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this envelope.";return[3,7];case 5:window.print();(s=this.envelopeUpdated)===null||s===void 0?void 0:s.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)}));(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=t.value;n.settings=t.settings;updateDocumentFieldValue(n);i.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var i=this;console.log("[SIGN] saveFieldChange",e,t);updateEnvelopeField(this.endpoint,this.envelopeId,e,t).then((function(t){return i.updateRecipientFieldValue(e,t)})).catch((function(e){var t,n,s,r,o,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((s=(n=e.response)===null||n===void 0?void 0:n.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");i.fatalErrorHeader="Signing Session Expired";i.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(r=i.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,s,r,o,a,l;var c=this;return __generator(this,(function(d){switch(d.label){case 0:i=t.target,n=i.value,s=i.checked;r=e.type;switch(r){case"textarea":return[3,1];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(t.target.checked)})]}d.label=3;case 3:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(t.target.checked)})]}d.label=4;case 4:console.log("Saving dropdown",e.name,t.detail);return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:if(!t.detail){return[2]}this.showSpinner=true;return[4,fetch(t.detail)];case 6:return[4,d.sent().blob()];case 7:o=d.sent();return[2,createInitials(this.endpoint,"initial",o).then((function(t){return __awaiter(c,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,updateEnvelopeFieldInitials(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.log("Error updating initials",e);c.showSpinner=false}))];case 8:if(!t.detail){return[2]}this.showSpinner=true;return[4,fetch(t.detail)];case 9:return[4,d.sent().blob()];case 10:a=d.sent();return[2,createSignature(this.endpoint,"signature",a).then((function(t){return __awaiter(c,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",t);return[4,updateEnvelopeFieldSignature(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e);c.showSpinner=false}))];case 11:l=t.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:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("[SIGN] Unhandled field update",{value:n,checked:s},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldFilled=function(e){var t=e.value,i=t===void 0?"":t;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return isValidEmail(i);case"phone":return isValidPhone(i);default:return(i||"").trim()!==""}case"signature":return i==="signed";case"initial":return i==="initialed";case"timestamp":return true;case"date":return!!i;case"attachment":return i==="attached";case"dropdown":return i!=="";case"checkbox":return i==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((function(t){return t.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"}));sortFields(e);return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,s,r,o,a,l,c;var d=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;console.log("[SIGN] Reloading envelope");getEnvelope(this.endpoint,this.envelopeId).then((function(e){d.envelope=e;d.submitting=false})).catch((function(e){console.log("[SIGN] Error reloading envelope",e);d.submitting=false}));return[3,4];case 3:i=h.sent();console.log("[SIGN] Error submitting",i);return[3,4];case 4:return[2];case 5:n=this.getSortedFillableFields().filter((function(e){return e.required&&!d.isFieldFilled(e)}));sortFields(n);s=n.findIndex((function(e){return e.name===d.focusedField}));r=s+1;if(r>=n.length){r=0}o=n[r];a=0;if(a<n.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){a++;r++;if(r>=n.length){r=0}o=n[r]}if(a>=n.length){o=null}if(o){l=getFieldId(o);c=document.getElementById(l);c===null||c===void 0?void 0:c.scrollIntoView({behavior:"smooth"});c===null||c===void 0?void 0:c.focusField();this.focusedField=o.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(t){return t.role_name===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.getRecipientFields().filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",t.map((function(e){return e.name})));this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(function(e){if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));i.addEventListener("attached",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,s,r;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,uploadEnvelopeFieldAttachment(this.endpoint,this.envelopeId,t.name,i.detail)];case 2:n=o.sent();this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();s=renderDocumentField("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false;return[3,4];case 3:r=o.sent();console.log("Error uploading attachment",r);VerdocsToast("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("deleted",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,s,r;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,deleteEnvelopeFieldAttachment(this.endpoint,this.envelopeId,t.name)];case 2:n=o.sent();console.log("[SIGN] Deleted attachment",n);this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();s=renderDocumentField("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false;return[3,4];case 3:r=o.sent();console.log("Error uploading attachment",r);VerdocsToast("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("focusout",(function(e){if(t.type!=="dropdown"&&t.type!=="attachment"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}}));i.addEventListener("fieldChange",(function(e){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);var s=formatFullName(this.recipient);i.setAttribute("initials",fullNameToInitials(s));i.setAttribute("name",s)};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;var n=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,n);n.forEach((function(e,n){if(e.page!==i.pageNumber){return}var s=renderDocumentField("envelope",e,i,{disabled:false,editable:false,draggable:false,done:t.isDone},n);if(!s){return}if(Array.isArray(s)){s.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,s)}}));this.sortedRecipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){t.getRecipientFields().filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var n=renderDocumentField("envelope",e,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,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.fatalErrorMessage){return h(Host,{class:{agreed:this.agreed}},h("div",{class:"fatal-error"},h("div",{class:"message"},h("div",{class:"header"},this.fatalErrorHeader),h("p",null,this.fatalErrorMessage))))}if(this.isDone){return h(Host,{class:{agreed:this.agreed}},h("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var i;return(i=e.sdkError)===null||i===void 0?void 0:i.emit(t.detail)}}),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(t){t.preventDefault();t.stopPropagation();e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))}if(!this.agreed){return h(Host,{class:"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",{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"})),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"),".")))))}if(this.kbaStep==="pin"){return h(Host,{class:"kba"},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",{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"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a PIN code",helptext:"Please enter your PIN code to proceed. If you do not have one, please contact the sender.",label:"PIN Code",onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){submitKbaPin(this.endpoint,this.envelopeId,this.roleId,t.detail).then((function(t){console.log("[SIGN] PIN code submission result",t);if(t.kba_step==="complete"){e.kbaStep=""}})).catch((function(e){var t,i;console.log("[SIGN] Error submitting PIN",e);VerdocsToast(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Unable to verify PIN code. Please try again.",{style:"error"})}));return[2]}))}))}}))))}if(this.kbaStep==="identity"){return h(Host,{class:"kba"},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",{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"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e;var i=this;return __generator(this,(function(n){e=t.detail;submitKbaIdentity(this.endpoint,this.envelopeId,this.roleId,{firstName:e.first_name,lastName:e.last_name,address:e.address,city:e.city,state:e.state,zip:e.zip,ssnLast4:e.ssn_last_4}).then((function(e){console.log("[SIGN] Identity submission result",e);i.kbaStep=e.kba_step})).catch((function(e){var t,i;console.log("[SIGN] Error submitting identity",e);VerdocsToast(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Unable to verify identity.",{style:"error"})}));return[2]}))}))}}))))}if(this.kbaStep==="challenge"){var t=this.kbaChoices.length;var i=this.kbaQuestions[t];console.log("Showing KBA question",{questionNumber:t,kbaQuestion:i},this.kbaChoices);return h(Host,{class:"kba"},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",{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"})),h("div",{class:"cover"},h("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?h("verdocs-spinner",null):h("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(i===null||i===void 0?void 0:i.prompt)||"Please select one of the options below.",choices:(i===null||i===void 0?void 0:i.answer)||["Skip Question"],step:t+1,steps:this.kbaQuestions.length,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e,i,n,s,r,o,a;var l=this;return __generator(this,(function(c){switch(c.label){case 0:s=t.detail;this.kbaChoices=__spreadArray(__spreadArray([],this.kbaChoices,true),[s],false);if(!(this.kbaChoices.length>=this.kbaQuestions.length))return[3,4];r=this.kbaQuestions.map((function(e,t){return{type:e.type,answer:l.kbaChoices[t]}}));console.log("Submitting KBA responses",this.kbaChoices,r);c.label=1;case 1:c.trys.push([1,3,,4]);return[4,submitKbaChallengeResponse(this.endpoint,this.envelopeId,this.roleId,r)];case 2:o=c.sent();console.log("KBA challenge response",o);this.kbaStep=o.kba_step;if(this.kbaStep==="failed"){this.fatalErrorHeader="Identity Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. Please contact the document's sender.";this.isDone=true}else{this.kbaQuestions=((e=o.questions)===null||e===void 0?void 0:e.question)||[];this.kbaChoices=[]}return[3,4];case 3:a=c.sent();console.log("Error submitting KBA challenge",a);this.kbaStep="";this.fatalErrorHeader="Unable to Verify Identity";this.fatalErrorMessage=((n=(i=a.response)===null||i===void 0?void 0:i.data)===null||n===void 0?void 0:n.error)||"Please try again later.";this.isDone=true;return[3,4];case 4:return[2]}}))}))}}))))}return h(Host,null,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.finishLater&&h("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?inProgressMenuOptions:doneMenuOptions,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),h("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(t){var i=integerSequence(1,t.pages);return h(Fragment,null,i.map((function(i){var n;var s=((n=t.page_sizes)===null||n===void 0?void 0:n[i])||{width:612,height:792};return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:s.width,virtualHeight:s.height,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),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.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||this.showSpinner&&h("verdocs-portal",null,h("div",{class:"spinner-overlay"},h("verdocs-spinner",null))))};return e}();VerdocsSign.style=VerdocsSignStyle0;export{VerdocsSign as verdocs_sign};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n["throw"](e))}catch(e){r(e)}}function l(e){e.done?i(e.value):s(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,s,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;s=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(a[0]===6&&i.label<r[1]){i.label=r[1];r=a;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(a);break}if(r[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];s=0}finally{n=r=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,t,i){if(i||arguments.length===2)for(var n=0,s=t.length,r;n<s;n++){if(r||!(n in t)){if(!r)r=Array.prototype.slice.call(t,0,n);r[n]=t[n]}}return e.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,c as createEvent,h,H as Host,F as Fragment}from"./index-272d51a4.js";import{VerdocsEndpoint,startSigningSession,getKbaStep,envelopeRecipientAgree,envelopeRecipientDecline,updateEnvelopeField,createSignature,updateEnvelopeFieldSignature,createInitials,updateEnvelopeFieldInitials,isValidPhone,isValidEmail,sortFields,envelopeRecipientSubmit,getEnvelope,uploadEnvelopeFieldAttachment,deleteEnvelopeFieldAttachment,formatFullName,fullNameToInitials,submitKbaPin,submitKbaIdentity,submitKbaChallengeResponse,integerSequence}from"@verdocs/js-sdk";import{a as saveAttachment,u as updateDocumentFieldValue,r as renderDocumentField,g as getFieldId}from"./utils-bd656c37.js";import{V as VerdocsToast}from"./Toast-c4843828.js";import{S as SDKError}from"./errors-887f1e88.js";import{S as Store}from"./Datastore-3f924d94.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.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)}verdocs-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);margin-top:15px}verdocs-sign .fatal-error .message{max-width:50%;width:50%;font-size:16px;background:white;border-radius:5px;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#654dcb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400;padding:0 10px}@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 46px;flex:0 0 46px;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 12px;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}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}';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.roleNames=[];this.sortedRecipients=[];this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.kbaStep="";this.kbaQuestions=[];this.showSpinner=false;this.kbaChoices=[];this.loading=true;this.envelope=null}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,t,i,n,s,r,o,a,l,d,c;var h=this;return __generator(this,(function(u){switch(u.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){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new SDKError("[SIGN] Missing required inviteCode",500,""));return[2]}u.label=1;case 1:u.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=u.sent(),l=a.envelope,d=a.recipient;console.log("[SIGN] Loaded signing session",l,d);this.recipient=d;this.envelope=l;Store.updateEnvelope(this.envelopeId,l);this.sortedRecipients=__spreadArray([],this.envelope.recipients,true);this.sortedRecipients.sort((function(e,t){return e.sequence===t.sequence?e.order-t.order:e.sequence-t.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==h.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.submitted=this.recipient.status==="submitted";this.isDone=this.submitted;this.showDone=this.submitted;if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. Please contact its sender for more information."}else if(this.recipient.status==="declined"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="You have declined to sign this envelope."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(n=this.envelopeLoaded)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope});if(!this.isDone){getKbaStep(this.endpoint,this.envelopeId,this.roleId).then((function(e){var t;console.log("[SIGN] KBA Step",e);h.kbaStep=e.kba_step;if(h.kbaStep==="failed"){h.fatalErrorHeader="Identity Verification Failed";h.fatalErrorMessage="We were unable to verify your identity. Please contact the document's sender.";h.isDone=true}else{h.kbaQuestions=((t=e.questions)===null||t===void 0?void 0:t.question)||[];h.kbaChoices=[]}})).catch((function(e){return console.log("Error getting KBA step",e)}))}return[3,4];case 3:c=u.sent();console.log("[SIGN] Error with signing session",c);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(c.message,(r=c.response)===null||r===void 0?void 0:r.status,(o=c.response)===null||o===void 0?void 0:o.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 t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;envelopeRecipientAgree(this.endpoint,this.envelopeId,this.roleId,true).then((function(){var t;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(t){var i,n,s;console.log("[SIGN] Update failure",t);e.submitting=false;(i=e.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(s=t.response)===null||s===void 0?void 0:s.data))}))};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,s,r,o,a,l;return __generator(this,(function(d){switch(d.label){case 0:o=e.detail.id;switch(o){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1:this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});return[3,7];case 2:VerdocsToast("This feature will be available in an upcoming release.");(i=this.envelopeUpdated)===null||i===void 0?void 0:i.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=d.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.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this envelope.";return[3,7];case 5:window.print();(s=this.envelopeUpdated)===null||s===void 0?void 0:s.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)}));(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=t.value;n.settings=t.settings;updateDocumentFieldValue(n);i.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var i=this;console.log("[SIGN] saveFieldChange",e,t);updateEnvelopeField(this.endpoint,this.envelopeId,e,t).then((function(t){return i.updateRecipientFieldValue(e,t)})).catch((function(e){var t,n,s,r,o,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((s=(n=e.response)===null||n===void 0?void 0:n.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");i.fatalErrorHeader="Signing Session Expired";i.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(r=i.sdkError)===null||r===void 0?void 0:r.emit(new SDKError(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,s,r,o,a,l;var d=this;return __generator(this,(function(c){switch(c.label){case 0:i=t.target,n=i.value,s=i.checked;r=e.type;switch(r){case"textarea":return[3,1];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(t.target.checked)})]}c.label=3;case 3:{return[2,this.saveFieldChange(e.name,{prepared:false,value:String(t.target.checked)})]}c.label=4;case 4:console.log("Saving dropdown",e.name,t.detail);return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:if(!t.detail){return[2]}this.showSpinner=true;return[4,fetch(t.detail)];case 6:return[4,c.sent().blob()];case 7:o=c.sent();return[2,createInitials(this.endpoint,"initial",o).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,updateEnvelopeFieldInitials(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.log("Error updating initials",e);d.showSpinner=false}))];case 8:if(!t.detail){return[2]}this.showSpinner=true;return[4,fetch(t.detail)];case 9:return[4,c.sent().blob()];case 10:a=c.sent();return[2,createSignature(this.endpoint,"signature",a).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",t);return[4,updateEnvelopeFieldSignature(this.endpoint,this.envelopeId,e.name,t.id)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e);d.showSpinner=false}))];case 11:l=t.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:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("[SIGN] Unhandled field update",{value:n,checked:s},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldFilled=function(e){var t=e.value,i=t===void 0?"":t;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return isValidEmail(i);case"phone":return isValidPhone(i);default:return(i||"").trim()!==""}case"signature":return i==="signed";case"initial":return i==="initialed";case"timestamp":return true;case"date":return!!i;case"attachment":return i==="attached";case"dropdown":return i!=="";case"checkbox":return i==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((function(t){return t.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"}));sortFields(e);return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,s,r,o,a,l,d;var c=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;console.log("[SIGN] Reloading envelope");getEnvelope(this.endpoint,this.envelopeId).then((function(e){c.envelope=e;c.submitting=false})).catch((function(e){console.log("[SIGN] Error reloading envelope",e);c.submitting=false}));return[3,4];case 3:i=h.sent();console.log("[SIGN] Error submitting",i);return[3,4];case 4:return[2];case 5:n=this.getSortedFillableFields().filter((function(e){return e.required&&!c.isFieldFilled(e)}));sortFields(n);s=n.findIndex((function(e){return e.name===c.focusedField}));r=s+1;if(r>=n.length){r=0}o=n[r];a=0;if(a<n.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){a++;r++;if(r>=n.length){r=0}o=n[r]}if(a>=n.length){o=null}if(o){l=getFieldId(o);d=document.getElementById(l);d===null||d===void 0?void 0:d.scrollIntoView({behavior:"smooth"});d===null||d===void 0?void 0:d.focusField();this.focusedField=o.name}return[2]}}))}))};e.prototype.getRecipientFields=function(){var e=this;return this.envelope.fields.filter((function(t){return t.role_name===e.recipient.role_name}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.getRecipientFields().filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{console.log("[SIGN] Invalid fields remaining",t.map((function(e){return e.name})));this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(function(e){if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));i.addEventListener("attached",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,s,r;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,uploadEnvelopeFieldAttachment(this.endpoint,this.envelopeId,t.name,i.detail)];case 2:n=o.sent();this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();s=renderDocumentField("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false;return[3,4];case 3:r=o.sent();console.log("Error uploading attachment",r);VerdocsToast("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("deleted",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,s,r;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,deleteEnvelopeFieldAttachment(this.endpoint,this.envelopeId,t.name)];case 2:n=o.sent();console.log("[SIGN] Deleted attachment",n);this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();s=renderDocumentField("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,s);this.showSpinner=false;return[3,4];case 3:r=o.sent();console.log("Error uploading attachment",r);VerdocsToast("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("focusout",(function(e){if(t.type!=="dropdown"&&t.type!=="attachment"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}}));i.addEventListener("fieldChange",(function(e){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);var s=formatFullName(this.recipient);i.setAttribute("initials",fullNameToInitials(s));i.setAttribute("name",s)};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;var n=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,n);n.forEach((function(e,n){if(e.page!==i.pageNumber){return}var s=renderDocumentField("envelope",e,i,{disabled:false,editable:false,draggable:false,done:t.isDone},n);if(!s){return}if(Array.isArray(s)){s.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,s)}}));this.sortedRecipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){t.getRecipientFields().filter((function(e){return e.page===i.pageNumber})).forEach((function(e){var n=renderDocumentField("envelope",e,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,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.fatalErrorMessage){return h(Host,{class:{agreed:this.agreed}},h("div",{class:"fatal-error"},h("div",{class:"message"},h("div",{class:"header"},this.fatalErrorHeader),h("p",null,this.fatalErrorMessage))))}if(this.isDone){return h(Host,{class:{agreed:this.agreed}},h("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var i;return(i=e.sdkError)===null||i===void 0?void 0:i.emit(t.detail)}}),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(t){t.preventDefault();t.stopPropagation();e.showDone=false;e.isDone=true}}),this.submitting&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))}if(!this.agreed){return h(Host,{class:"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",{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"})),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"),".")))))}if(this.kbaStep==="pin"){return h(Host,{class:"kba"},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",{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"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a PIN code",helptext:"Please enter your PIN code to proceed. If you do not have one, please contact the sender.",label:"PIN Code",onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e=this;return __generator(this,(function(i){submitKbaPin(this.endpoint,this.envelopeId,this.roleId,t.detail).then((function(t){console.log("[SIGN] PIN code submission result",t);if(t.kba_step==="complete"){e.kbaStep=""}})).catch((function(e){var t,i;console.log("[SIGN] Error submitting PIN",e);VerdocsToast(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Unable to verify PIN code. Please try again.",{style:"error"})}));return[2]}))}))}}))))}if(this.kbaStep==="identity"){return h(Host,{class:"kba"},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",{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"})),h("div",{class:"cover"},h("div",{class:"kba"},h("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e;var i=this;return __generator(this,(function(n){e=t.detail;submitKbaIdentity(this.endpoint,this.envelopeId,this.roleId,{firstName:e.first_name,lastName:e.last_name,address:e.address,city:e.city,state:e.state,zip:e.zip,ssnLast4:e.ssn_last_4}).then((function(e){console.log("[SIGN] Identity submission result",e);i.kbaStep=e.kba_step})).catch((function(e){var t,i;console.log("[SIGN] Error submitting identity",e);VerdocsToast(((i=(t=e.response)===null||t===void 0?void 0:t.data)===null||i===void 0?void 0:i.error)||"Unable to verify identity.",{style:"error"})}));return[2]}))}))}}))))}if(this.kbaStep==="challenge"){var t=this.kbaChoices.length;var i=this.kbaQuestions[t];return h(Host,{class:"kba"},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",{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"})),h("div",{class:"cover"},h("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?h("verdocs-spinner",null):h("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(i===null||i===void 0?void 0:i.prompt)||"Please select one of the options below.",choices:(i===null||i===void 0?void 0:i.answer)||["Skip Question"],step:t+1,steps:this.kbaQuestions.length,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e,i,n,s,r,o,a;var l=this;return __generator(this,(function(d){switch(d.label){case 0:s=t.detail;this.kbaChoices=__spreadArray(__spreadArray([],this.kbaChoices,true),[s],false);if(!(this.kbaChoices.length>=this.kbaQuestions.length))return[3,4];r=this.kbaQuestions.map((function(e,t){return{type:e.type,answer:l.kbaChoices[t]}}));console.log("Submitting KBA responses",this.kbaChoices,r);d.label=1;case 1:d.trys.push([1,3,,4]);return[4,submitKbaChallengeResponse(this.endpoint,this.envelopeId,this.roleId,r)];case 2:o=d.sent();console.log("KBA challenge response",o);this.kbaStep=o.kba_step;if(this.kbaStep==="failed"){this.fatalErrorHeader="Identity Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. Please contact the document's sender.";this.isDone=true}else{this.kbaQuestions=((e=o.questions)===null||e===void 0?void 0:e.question)||[];this.kbaChoices=[]}return[3,4];case 3:a=d.sent();console.log("Error submitting KBA challenge",a);this.kbaStep="";this.fatalErrorHeader="Unable to Verify Identity";this.fatalErrorMessage=((n=(i=a.response)===null||i===void 0?void 0:i.data)===null||n===void 0?void 0:n.error)||"Please try again later.";this.isDone=true;return[3,4];case 4:return[2]}}))}))}}))))}return h(Host,null,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.finishLater&&h("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?inProgressMenuOptions:doneMenuOptions,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),h("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(t){var i=integerSequence(1,t.pages);return h(Fragment,null,i.map((function(i){var n;var s=((n=t.page_sizes)===null||n===void 0?void 0:n[i])||{width:612,height:792};return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:s.width,virtualHeight:s.height,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),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.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||this.showSpinner&&h("verdocs-portal",null,h("div",{class:"spinner-overlay"},h("verdocs-spinner",null))))};return e}();VerdocsSign.style=VerdocsSignStyle0;export{VerdocsSign as verdocs_sign};
2
2
  //# sourceMappingURL=verdocs-sign.entry.js.map