@verdocs/web-sdk 5.0.41 → 5.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +18 -33
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +0 -2
- package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js +0 -1
- package/dist/cjs/verdocs-preview_7.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +116 -90
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +0 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +123 -95
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +7 -8
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +0 -2
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js.map +1 -1
- package/dist/components/{p-36368807.js → p-4a04090c.js} +3 -3
- package/dist/components/{p-36368807.js.map → p-4a04090c.js.map} +1 -1
- package/dist/components/{p-c1d312d8.js → p-4a4bf38c.js} +2 -3
- package/dist/components/p-4a4bf38c.js.map +1 -0
- package/dist/components/{p-6bfb8eba.js → p-73a39d5a.js} +19 -34
- package/dist/components/p-73a39d5a.js.map +1 -0
- package/dist/components/{p-795b4192.js → p-91eae04c.js} +3 -3
- package/dist/components/{p-795b4192.js.map → p-91eae04c.js.map} +1 -1
- package/dist/components/{p-52c195dd.js → p-92cce3dc.js} +1 -3
- package/dist/components/{p-52c195dd.js.map → p-92cce3dc.js.map} +1 -1
- package/dist/components/{p-7481c7db.js → p-b474c324.js} +2 -2
- package/dist/components/{p-7481c7db.js.map → p-b474c324.js.map} +1 -1
- package/dist/components/verdocs-build.js +6 -6
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +119 -92
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-contact-picker_2.entry.js +18 -33
- package/dist/esm/verdocs-contact-picker_2.entry.js.map +1 -1
- package/dist/esm/verdocs-field-attachment_13.entry.js +0 -2
- package/dist/esm/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_7.entry.js +0 -1
- package/dist/esm/verdocs-preview_7.entry.js.map +1 -1
- package/dist/esm/verdocs-sign.entry.js +117 -91
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_7.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js.map +1 -1
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +4 -2
- package/dist/verdocs-web-sdk/p-0c1898f6.system.js +1 -1
- package/dist/verdocs-web-sdk/p-0c1898f6.system.js.map +1 -1
- package/dist/verdocs-web-sdk/p-46263e7a.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-46263e7a.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-56170f1d.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-56170f1d.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7f982a59.system.entry.js → p-6cfb51e3.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-6cfb51e3.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-62bde242.system.entry.js → p-89c69404.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-89c69404.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-b232ef42.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-b232ef42.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-d47c58de.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-d47c58de.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-7962eb00.entry.js → p-e7ca4f15.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-e7ca4f15.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-dda88c7f.entry.js → p-e8268ed9.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-e8268ed9.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js.map +1 -1
- package/package.json +3 -3
- package/dist/components/p-6bfb8eba.js.map +0 -1
- package/dist/components/p-c1d312d8.js.map +0 -1
- package/dist/custom-elements.json +0 -2198
- package/dist/verdocs-web-sdk/p-1c8788f5.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-1c8788f5.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-62bde242.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-7962eb00.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-7f982a59.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-a4dd8302.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-a4dd8302.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-dda88c7f.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-df6ab9e9.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-df6ab9e9.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e5684a49.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e5684a49.system.entry.js.map +0 -1
@@ -0,0 +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))};System.register(["./p-60387e15.system.js","@verdocs/js-sdk","./p-f29eb00a.system.js","./p-9b26e4e0.system.js","./p-c8a15cb7.system.js","./p-ebd42be0.system.js","./p-21b1acec.system.js","./p-d738b5db.system.js","./p-2c5350ec.system.js"],(function(e){"use strict";var t,i,n,s,r,o,a,l,c,d,u,h,f,v,p,g,x,m,b,w,y,S,k,_,N,I,G,z,P,T,E,A;return{setters:[function(e){t=e.r;i=e.c;n=e.h;s=e.H;r=e.F},function(e){o=e.VerdocsEndpoint;a=e.startSigningSession;l=e.envelopeRecipientAgree;c=e.envelopeRecipientDecline;d=e.updateEnvelopeField;u=e.createSignature;h=e.updateEnvelopeFieldSignature;f=e.createInitials;v=e.updateEnvelopeFieldInitials;p=e.isValidPhone;g=e.isValidEmail;x=e.sortFields;m=e.envelopeRecipientSubmit;b=e.getEnvelope;w=e.uploadEnvelopeFieldAttachment;y=e.deleteEnvelopeFieldAttachment;S=e.formatFullName;k=e.fullNameToInitials;_=e.authenticateSigner;N=e.integerSequence},function(e){I=e.a;G=e.u;z=e.r;P=e.g},function(e){T=e.V},function(e){E=e.S},function(e){A=e.S},function(){},function(){},function(){}],execute:function(){var j='@-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:#4c56cb}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 D=j;var U=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var L=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var R=e("verdocs_sign",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.envelopeLoaded=i(this,"envelopeLoaded",7);this.envelopeUpdated=i(this,"envelopeUpdated",7);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.authStep=null;this.authDetails=null;this.kbaQuestions=[];this.showSpinner=false;this.kbaChoices=[];this.loading=true;this.envelope=null;this.recipientIndex=-1}e.prototype.componentWillLoad=function(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new o({sessionType:"signing"})}};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,s,r,o,l,c,d,u,h;var f=this;return __generator(this,(function(v){switch(v.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new E("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new E("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new E("[SIGN] Missing required inviteCode",500,""));return[2]}v.label=1;case 1:v.trys.push([1,3,,4]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,a(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 2:l=v.sent(),c=l.envelope,d=l.recipient;console.log("[SIGN] Loaded signing session",c,d);this.recipient=d;this.envelope=c;A.updateEnvelope(this.envelopeId,c);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==f.roleId}));if(this.recipientIndex>-1){console.log("[SIGN] Processing recipient",this.authStep);this.recipient=this.sortedRecipients[this.recipientIndex];this.agreed=this.recipient.agreed;this.submitted=this.recipient.status==="submitted";this.authStep=this.recipient.auth_step;if(this.authStep){console.log("[SIGN] Authentication required",this.authStep)}u=this.recipient.auth_method_states||{};if(Object.values(u).includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}}else{console.warn("[SIGN] Could not find our recipient record",this.roleId,this.sortedRecipients)}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. The sender has been notified."}else if(this.recipient.status==="declined"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="You have declined to sign this envelope. The sender has been notified."}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});return[3,4];case 3:h=v.sent();console.log("[SIGN] Error with signing session",h);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new E(h.message,(r=h.response)===null||r===void 0?void 0:r.status,(o=h.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;l(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 E(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:T("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,c(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. The sender has been notified.";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){I(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;G(n);i.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var i=this;console.log("[SIGN] saveFieldChange",e,t);d(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 E(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,f(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,v(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,u(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,h(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 g(i);case"phone":return p(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"}));x(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(u){switch(u.label){case 0:if(!this.nextSubmits)return[3,5];u.label=1;case 1:u.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,m(this.endpoint,this.envelopeId,this.roleId)];case 2:t=u.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;console.log("[SIGN] Reloading envelope");b(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=u.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)}));x(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=P(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,w(this.endpoint,this.envelopeId,t.name,i.detail)];case 2:n=o.sent();this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();s=z("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);T("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,y(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=z("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);T("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=S(this.recipient);i.setAttribute("initials",k(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=z("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=z("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.handleAuthenticateSigner=function(e){var t=this;console.log("[SIGN] Submitting authentication step",e);_(this.endpoint,e).then((function(e){console.log("[SIGN] Authentication successful",e);t.authStep=e.auth_step;t.authDetails=e.auth_details})).catch((function(e){var i,n,s,r,o;console.log("[SIGN] Error submitting authentication step",e);if((s=(n=(i=e.response)===null||i===void 0?void 0:i.data)===null||n===void 0?void 0:n.error)===null||s===void 0?void 0:s.includes("failed")){t.fatalErrorHeader="Recipient Verification Failed";t.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";t.isDone=true}else{T(((o=(r=e.response)===null||r===void 0?void 0:r.data)===null||o===void 0?void 0:o.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))};e.prototype.render=function(){var e=this;console.log("[SIGN] Rendering",{authStep:this.authStep});if(this.showLoadError){return n(s,null,n("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 n(s,null,n("verdocs-loader",null))}if(this.fatalErrorMessage){return n(s,{class:{agreed:this.agreed}},n("div",{class:"fatal-error"},n("div",{class:"message"},n("div",{class:"header"},this.fatalErrorHeader),n("p",null,this.fatalErrorMessage))))}if(this.isDone){return n(s,{class:{agreed:this.agreed}},n("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&&n("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&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)))}if(!this.agreed){return n(s,{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))),n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("div",{class:"cover"},n("div",{class:"agree"},n("verdocs-checkbox",{name:"agree",label:"By checking this box, you:",onInput:function(){return e.handleClickAgree()}}),n("ul",null,n("li",null,"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"},"Electronic Record and Signatures Disclosure"),"."),n("li",null,"Agree to Verdocs'"," ",n("a",{href:"https://verdocs.com/en/eula",target:"_blank"},"End User License Agreement")," ","and confirm you have read Verdocs'"," ",n("a",{href:"https://verdocs.com/en/privacy-policy/",target:"_blank"},"Privacy Policy"),".")))))}if(this.authStep==="passcode"){return n(s,{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))),n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("div",{class:"cover"},n("div",{class:"kba"},n("verdocs-kba-dialog",{mode:"text",step:1,steps:1,helptitle:"Document is protected by a Passcode",helptext:"Please enter your Passcode to proceed. If you do not have one, please contact the sender.",label:"Passcode",onNext:function(t){return e.handleAuthenticateSigner({auth_method:"passcode",code:t.detail})}}))))}if(this.authStep==="kba"){return n(s,{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))),n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("div",{class:"cover"},n("div",{class:"kba"},n("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;return __generator(this,(function(i){e=t.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:e.first_name,last_name:e.last_name,address:e.address,city:e.city,state:e.state,zip:e.zip,ssn_last_4:e.ssn_last_4,dob:e.dob});return[2]}))}))}}))))}return n(s,null,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),n("div",{style:{flex:"1"}}),!this.finishLater&&n("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),n("div",{style:{marginLeft:"10px"}}),n("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?U:L,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),n("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((function(t){var i=N(1,t.pages);return n(r,null,i.map((function(i){var s;var r=((s=t.page_sizes)===null||s===void 0?void 0:s[i])||{width:612,height:792};return n("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:r.width,virtualHeight:r.height,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&n("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&&n("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&&n("verdocs-portal",null,n("div",{class:"spinner-overlay"},n("verdocs-spinner",null))))};return e}());R.style=D}}}));
|
2
|
+
//# sourceMappingURL=p-b232ef42.system.entry.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["verdocsSignCss","VerdocsSignStyle0","inProgressMenuOptions","id","label","doneMenuOptions","VerdocsSign","exports","class_1","hostRef","this","endpoint","envelopeId","roleId","inviteCode","headerTargetId","roleNames","sortedRecipients","recipient","hasSignature","nextButtonLabel","nextSubmits","fatalErrorHeader","fatalErrorMessage","focusedField","submitting","submitted","isDone","showDone","showLoadError","finishLater","showFinishLater","agreed","documentsSingularPlural","authStep","authDetails","kbaQuestions","showSpinner","kbaChoices","loading","envelope","recipientIndex","prototype","componentWillLoad","console","log","VerdocsEndpoint","sessionType","componentDidLoad","_a","sdkError","emit","SDKError","_b","_c","concat","startSigningSession","_h","_j","sent","Store","updateEnvelope","__spreadArray","recipients","sort","a","b","sequence","order","map","r","role_name","documents","length","findIndex","roleName","_this","status","auth_step","auth_method_states","Object","values","includes","warn","checkRecipientFields","_d","envelopeLoaded","e_1","_e","message","_f","response","_g","data","componentDidRender","headerTarget","document","getElementById","headerEl","remove","append","handleClickAgree","envelopeRecipientAgree","then","envelopeUpdated","event","catch","e","handleOptionSelected","detail","VerdocsToast","envelopeRecipientDecline","declineResult","window","print","firstDoc","find","doc","type","saveAttachment","updateRecipientFieldValue","fieldName","updateResult","getRecipientFields","forEach","oldField","name","value","settings","updateDocumentFieldValue","saveFieldChange","fields","updateEnvelopeField","error","handleFieldChange","field","target","checked","prepared","String","fetch","_k","blob","initialsBlob","createInitials","newInitials","__awaiter","updateEnvelopeFieldInitials","signatureBlob","createSignature","newSignature","updateEnvelopeFieldSignature","formattedDate","ts","getAttribute","isFieldFilled","validator","isValidEmail","isValidPhone","trim","group","filter","f","some","isFieldValid","required","getSortedFillableFields","recipientFields","sortFields","handleNext","envelopeRecipientSubmit","result","getEnvelope","e_2","emptyFields","focusedIndex","nextFocusedIndex","nextRequiredField","skips","getFieldId","el","scrollIntoView","behavior","focusField","invalidFields","attachFieldAttributes","pageInfo","setAttribute","addEventListener","finally","uploadEnvelopeFieldAttachment","newEl","renderDocumentField","disabled","editable","draggable","done","e_3","style","deleteEnvelopeFieldAttachment","e_4","template_id","pageNumber","xScale","yScale","fullName","formatFullName","fullNameToInitials","handlePageRendered","tabIndex","page","Array","isArray","handleAuthenticateSigner","params","authenticateSigner","auth_details","render","h","Host","heading","buttonLabel","onNext","location","reload","class","onSdkError","preventDefault","stopPropagation","src","alt","paddingTop","width","height","boxShadow","marginTop","onInput","href","mode","step","steps","helptitle","helptext","auth_method","code","recipDetails","first_name","last_name","address","city","state","zip","ssn_last_4","dob","flex","size","onClick","marginLeft","options","onOptionSelected","envelopeDocument","pageNumbers","integerSequence","pages","Fragment","pageSize","page_sizes","documentId","virtualWidth","virtualHeight","onPageRendered","layers"],"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-shade;\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 {Event, EventEmitter, Host, Fragment, Component, Prop, State, h} from '@stencil/core';\nimport {authenticateSigner, IEnvelope, IEnvelopeField, IRecipient, TAuthenticateRecipientRequest, TRecipientAuthMethod} from '@verdocs/js-sdk';\nimport {createInitials, createSignature, envelopeRecipientAgree, envelopeRecipientDecline, envelopeRecipientSubmit, formatFullName} from '@verdocs/js-sdk';\nimport {getEnvelope, integerSequence, isValidEmail, isValidPhone, updateEnvelopeFieldInitials} from '@verdocs/js-sdk';\nimport {getFieldId, renderDocumentField, saveAttachment, updateDocumentFieldValue} from '../../../utils/utils';\nimport {updateEnvelopeFieldSignature, uploadEnvelopeFieldAttachment, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {fullNameToInitials, startSigningSession, deleteEnvelopeFieldAttachment} from '@verdocs/js-sdk';\nimport {updateEnvelopeField, sortFields} from '@verdocs/js-sdk';\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 // TODO\n // @State() authStep: TRecipientAuthMethod | null = null;\n @State() authStep: string | null = null;\n @State() authDetails: any = null;\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 console.log('[SIGN] Processing recipient', this.authStep);\n\n this.recipient = this.sortedRecipients[this.recipientIndex];\n this.agreed = this.recipient.agreed;\n this.submitted = this.recipient.status === 'submitted';\n this.authStep = this.recipient.auth_step;\n if (this.authStep) {\n console.log('[SIGN] Authentication required', this.authStep);\n }\n\n const auth_method_states = (this.recipient.auth_method_states || {}) as Record<TRecipientAuthMethod, string>;\n if (Object.values(auth_method_states).includes('failed')) {\n this.fatalErrorHeader = 'Recipient Verification Failed';\n this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';\n this.isDone = true;\n }\n // TODO\n // this.kbaQuestions = (r as any).questions?.question || [];\n // this.kbaChoices = [];\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.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. The sender has been notified.';\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. The sender has been notified.';\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 } 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. The sender has been notified.';\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 handleAuthenticateSigner(params: TAuthenticateRecipientRequest) {\n console.log('[SIGN] Submitting authentication step', params);\n authenticateSigner(this.endpoint, params)\n .then(r => {\n console.log('[SIGN] Authentication successful', r);\n this.authStep = r.auth_step;\n this.authDetails = r.auth_details;\n })\n .catch(e => {\n console.log('[SIGN] Error submitting authentication step', e);\n if (e.response?.data?.error?.includes('failed')) {\n this.fatalErrorHeader = 'Recipient Verification Failed';\n this.fatalErrorMessage = 'We were unable to verify your identity. The sender has been notified.';\n this.isDone = true;\n } else {\n VerdocsToast(e.response?.data?.error || 'Unable to verify your identity. Please try again.', {style: 'error'});\n }\n });\n }\n\n render() {\n console.log('[SIGN] Rendering', {authStep: this.authStep});\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.authStep === 'passcode') {\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 Passcode\"\n helptext=\"Please enter your Passcode to proceed. If you do not have one, please contact the sender.\"\n label=\"Passcode\"\n onNext={e => this.handleAuthenticateSigner({auth_method: 'passcode', code: e.detail as string})}\n />\n </div>\n </div>\n </Host>\n );\n }\n\n if (this.authStep === 'kba') {\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 this.handleAuthenticateSigner({\n auth_method: 'kba',\n first_name: recipDetails.first_name,\n last_name: recipDetails.last_name,\n address: recipDetails.address,\n city: recipDetails.city,\n state: recipDetails.state,\n zip: recipDetails.zip,\n ssn_last_4: recipDetails.ssn_last_4,\n dob: recipDetails.dob,\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. The sender has been notified.';\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"],"mappings":"qsFAAA,IAAMA,EAAiB,sgIACvB,IAAAC,EAAeD,ECYf,IAAME,EAAwB,CAC5B,CAACC,GAAI,QAASC,MAAO,gBAErB,CAACD,GAAI,UAAWC,MAAO,mBACvB,CAACD,GAAI,QAASC,MAAO,yBACrB,CAACD,GAAI,WAAYC,MAAO,aAG1B,IAAMC,EAAkB,CACtB,CAACF,GAAI,QAASC,MAAO,SACrB,CAACD,GAAI,WAAYC,MAAO,a,IAyBbE,EAAWC,EAAA,0BALxB,SAAAC,EAAAC,G,6IASyBC,KAAAC,SAA4B,KAK5BD,KAAAE,WAA4B,KAK5BF,KAAAG,OAAwB,KAKxBH,KAAAI,WAA4B,KAW3CJ,KAAAK,eAAgC,KAkB/BL,KAAAM,UAAsB,GACtBN,KAAAO,iBAAiC,GACjCP,KAAAQ,UAA+B,KAC/BR,KAAAS,aAAe,MACfT,KAAAU,gBAAkB,QAClBV,KAAAW,YAAc,MACdX,KAAAY,iBAAmB,GACnBZ,KAAAa,kBAAoB,GACpBb,KAAAc,aAAe,GACfd,KAAAe,WAAa,MACbf,KAAAgB,UAAY,MACZhB,KAAAiB,OAAS,MACTjB,KAAAkB,SAAW,MACXlB,KAAAmB,cAAgB,MAChBnB,KAAAoB,YAAc,MACdpB,KAAAqB,gBAAkB,MAClBrB,KAAAsB,OAAS,MACTtB,KAAAuB,wBAA0B,WAG1BvB,KAAAwB,SAA0B,KAC1BxB,KAAAyB,YAAmB,KACnBzB,KAAA0B,aAAsB,GACtB1B,KAAA2B,YAAc,MACd3B,KAAA4B,WAAa,GAEb5B,KAAA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AOlJ,EAAK7C,gBAAkB,KAA9B,IAIXrB,KAAKkB,UACJ8L,EAAA,qBACEE,QAAQ,eACRnI,QAAS,sBAAAlC,OAAsB7C,KAAKuB,wBAAuB,gNAC3D6L,OAAQ,WACNlJ,EAAKhD,SAAW,MAChBgD,EAAKjD,OAAS,I,IAKnBjB,KAAKe,YACHf,KAAK2B,aACJqL,EAAA,sBACEA,EAAA,OAAKO,MAAM,mBACTP,EAAA,0B,WAl+BQ,I","ignoreList":[]}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{r as e,c as t,h as n,F as o,H as s}from"./p-ddadabfb.js";import{VerdocsEndpoint as i,formatFullName as r,getActiveEntitlements as c,isValidEmail as a,randomString as l}from"@verdocs/js-sdk";import{h as u}from"./p-0c45b79c.js";import"./p-85aa8e05.js";import"./p-c7ee88c7.js";import"./p-12bab948.js";function f(e,t){return function n(){return e.apply(t,arguments)}}const{toString:d}=Object.prototype;const{getPrototypeOf:h}=Object;const p=(e=>t=>{const n=d.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null));const m=e=>{e=e.toLowerCase();return t=>p(t)===e};const b=e=>t=>typeof t===e;const{isArray:g}=Array;const w=b("undefined");function y(e){return e!==null&&!w(e)&&e.constructor!==null&&!w(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const v=m("ArrayBuffer");function x(e){let t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&v(e.buffer)}return t}const k=b("string");const R=b("function");const O=b("number");const S=e=>e!==null&&typeof e==="object";const E=e=>e===true||e===false;const T=e=>{if(p(e)!=="object"){return false}const t=h(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};const A=m("Date");const C=m("File");const j=m("Blob");const N=m("FileList");const F=e=>S(e)&&R(e.pipe);const P=e=>{let t;return e&&(typeof FormData==="function"&&e instanceof FormData||R(e.append)&&((t=p(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))};const U=m("URLSearchParams");const[B,z,I,_]=["ReadableStream","Request","Response","Headers"].map(m);const D=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function L(e,t,{allOwnKeys:n=false}={}){if(e===null||typeof e==="undefined"){return}let o;let s;if(typeof e!=="object"){e=[e]}if(g(e)){for(o=0,s=e.length;o<s;o++){t.call(null,e[o],o,e)}}else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e);const i=s.length;let r;for(o=0;o<i;o++){r=s[o];t.call(null,e[r],r,e)}}}function q(e,t){t=t.toLowerCase();const n=Object.keys(e);let o=n.length;let s;while(o-- >0){s=n[o];if(t===s.toLowerCase()){return s}}return null}const M=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const H=e=>!w(e)&&e!==M;function $(){const{caseless:e}=H(this)&&this||{};const t={};const n=(n,o)=>{const s=e&&q(t,o)||o;if(T(t[s])&&T(n)){t[s]=$(t[s],n)}else if(T(n)){t[s]=$({},n)}else if(g(n)){t[s]=n.slice()}else{t[s]=n}};for(let e=0,t=arguments.length;e<t;e++){arguments[e]&&L(arguments[e],n)}return t}const K=(e,t,n,{allOwnKeys:o}={})=>{L(t,((t,o)=>{if(n&&R(t)){e[o]=f(t,n)}else{e[o]=t}}),{allOwnKeys:o});return e};const J=e=>{if(e.charCodeAt(0)===65279){e=e.slice(1)}return e};const V=(e,t,n,o)=>{e.prototype=Object.create(t.prototype,o);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});n&&Object.assign(e.prototype,n)};const W=(e,t,n,o)=>{let s;let i;let r;const c={};t=t||{};if(e==null)return t;do{s=Object.getOwnPropertyNames(e);i=s.length;while(i-- >0){r=s[i];if((!o||o(r,e,t))&&!c[r]){t[r]=e[r];c[r]=true}}e=n!==false&&h(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t};const X=(e,t,n)=>{e=String(e);if(n===undefined||n>e.length){n=e.length}n-=t.length;const o=e.indexOf(t,n);return o!==-1&&o===n};const G=e=>{if(!e)return null;if(g(e))return e;let t=e.length;if(!O(t))return null;const n=new Array(t);while(t-- >0){n[t]=e[t]}return n};const Z=(e=>t=>e&&t instanceof e)(typeof Uint8Array!=="undefined"&&h(Uint8Array));const Q=(e,t)=>{const n=e&&e[Symbol.iterator];const o=n.call(e);let s;while((s=o.next())&&!s.done){const n=s.value;t.call(e,n[0],n[1])}};const Y=(e,t)=>{let n;const o=[];while((n=e.exec(t))!==null){o.push(n)}return o};const ee=m("HTMLFormElement");const te=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function e(t,n,o){return n.toUpperCase()+o}));const ne=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype);const oe=m("RegExp");const se=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e);const o={};L(n,((n,s)=>{let i;if((i=t(n,s,e))!==false){o[s]=i||n}}));Object.defineProperties(e,o)};const ie=e=>{se(e,((t,n)=>{if(R(e)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const o=e[n];if(!R(o))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}}}))};const re=(e,t)=>{const n={};const o=e=>{e.forEach((e=>{n[e]=true}))};g(e)?o(e):o(String(e).split(t));return n};const ce=()=>{};const ae=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function le(e){return!!(e&&R(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const ue=e=>{const t=new Array(10);const n=(e,o)=>{if(S(e)){if(t.indexOf(e)>=0){return}if(!("toJSON"in e)){t[o]=e;const s=g(e)?[]:{};L(e,((e,t)=>{const i=n(e,o+1);!w(i)&&(s[t]=i)}));t[o]=undefined;return s}}return e};return n(e,0)};const fe=m("AsyncFunction");const de=e=>e&&(S(e)||R(e))&&R(e.then)&&R(e.catch);const he=((e,t)=>{if(e){return setImmediate}return t?((e,t)=>{M.addEventListener("message",(({source:n,data:o})=>{if(n===M&&o===e){t.length&&t.shift()()}}),false);return n=>{t.push(n);M.postMessage(e,"*")}})(`axios@${Math.random()}`,[]):e=>setTimeout(e)})(typeof setImmediate==="function",R(M.postMessage));const pe=typeof queueMicrotask!=="undefined"?queueMicrotask.bind(M):typeof process!=="undefined"&&process.nextTick||he;const me={isArray:g,isArrayBuffer:v,isBuffer:y,isFormData:P,isArrayBufferView:x,isString:k,isNumber:O,isBoolean:E,isObject:S,isPlainObject:T,isReadableStream:B,isRequest:z,isResponse:I,isHeaders:_,isUndefined:w,isDate:A,isFile:C,isBlob:j,isRegExp:oe,isFunction:R,isStream:F,isURLSearchParams:U,isTypedArray:Z,isFileList:N,forEach:L,merge:$,extend:K,trim:D,stripBOM:J,inherits:V,toFlatObject:W,kindOf:p,kindOfTest:m,endsWith:X,toArray:G,forEachEntry:Q,matchAll:Y,isHTMLForm:ee,hasOwnProperty:ne,hasOwnProp:ne,reduceDescriptors:se,freezeMethods:ie,toObjectSet:re,toCamelCase:te,noop:ce,toFiniteNumber:ae,findKey:q,global:M,isContextDefined:H,isSpecCompliantForm:le,toJSONObject:ue,isAsyncFn:fe,isThenable:de,setImmediate:he,asap:pe};function be(e,t,n,o,s){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=e;this.name="AxiosError";t&&(this.code=t);n&&(this.config=n);o&&(this.request=o);if(s){this.response=s;this.status=s.status?s.status:null}}me.inherits(be,Error,{toJSON:function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:me.toJSONObject(this.config),code:this.code,status:this.status}}});const ge=be.prototype;const we={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{we[e]={value:e}}));Object.defineProperties(be,we);Object.defineProperty(ge,"isAxiosError",{value:true});be.from=(e,t,n,o,s,i)=>{const r=Object.create(ge);me.toFlatObject(e,r,(function e(t){return t!==Error.prototype}),(e=>e!=="isAxiosError"));be.call(r,e.message,t,n,o,s);r.cause=e;r.name=e.name;i&&Object.assign(r,i);return r};const ye=null;function ve(e){return me.isPlainObject(e)||me.isArray(e)}function xe(e){return me.endsWith(e,"[]")?e.slice(0,-2):e}function ke(e,t,n){if(!e)return t;return e.concat(t).map((function e(t,o){t=xe(t);return!n&&o?"["+t+"]":t})).join(n?".":"")}function Re(e){return me.isArray(e)&&!e.some(ve)}const Oe=me.toFlatObject(me,{},null,(function e(t){return/^is[A-Z]/.test(t)}));function Se(e,t,n){if(!me.isObject(e)){throw new TypeError("target must be an object")}t=t||new FormData;n=me.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function e(t,n){return!me.isUndefined(n[t])}));const o=n.metaTokens;const s=n.visitor||u;const i=n.dots;const r=n.indexes;const c=n.Blob||typeof Blob!=="undefined"&&Blob;const a=c&&me.isSpecCompliantForm(t);if(!me.isFunction(s)){throw new TypeError("visitor must be a function")}function l(e){if(e===null)return"";if(me.isDate(e)){return e.toISOString()}if(!a&&me.isBlob(e)){throw new be("Blob is not supported. Use a Buffer instead.")}if(me.isArrayBuffer(e)||me.isTypedArray(e)){return a&&typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function u(e,n,s){let c=e;if(e&&!s&&typeof e==="object"){if(me.endsWith(n,"{}")){n=o?n:n.slice(0,-2);e=JSON.stringify(e)}else if(me.isArray(e)&&Re(e)||(me.isFileList(e)||me.endsWith(n,"[]"))&&(c=me.toArray(e))){n=xe(n);c.forEach((function e(o,s){!(me.isUndefined(o)||o===null)&&t.append(r===true?ke([n],s,i):r===null?n:n+"[]",l(o))}));return false}}if(ve(e)){return true}t.append(ke(s,n,i),l(e));return false}const f=[];const d=Object.assign(Oe,{defaultVisitor:u,convertValue:l,isVisitable:ve});function h(e,n){if(me.isUndefined(e))return;if(f.indexOf(e)!==-1){throw Error("Circular reference detected in "+n.join("."))}f.push(e);me.forEach(e,(function e(o,i){const r=!(me.isUndefined(o)||o===null)&&s.call(t,o,me.isString(i)?i.trim():i,n,d);if(r===true){h(o,n?n.concat(i):[i])}}));f.pop()}if(!me.isObject(e)){throw new TypeError("data must be an object")}h(e);return t}function Ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function e(n){return t[n]}))}function Te(e,t){this._pairs=[];e&&Se(e,this,t)}const Ae=Te.prototype;Ae.append=function e(t,n){this._pairs.push([t,n])};Ae.toString=function e(t){const n=t?function(e){return t.call(this,e,Ee)}:Ee;return this._pairs.map((function e(t){return n(t[0])+"="+n(t[1])}),"").join("&")};function Ce(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function je(e,t,n){if(!t){return e}const o=n&&n.encode||Ce;if(me.isFunction(n)){n={serialize:n}}const s=n&&n.serialize;let i;if(s){i=s(t,n)}else{i=me.isURLSearchParams(t)?t.toString():new Te(t,n).toString(o)}if(i){const t=e.indexOf("#");if(t!==-1){e=e.slice(0,t)}e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ne{constructor(){this.handlers=[]}use(e,t,n){this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(e){if(this.handlers[e]){this.handlers[e]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(e){me.forEach(this.handlers,(function t(n){if(n!==null){e(n)}}))}}const Fe=Ne;const Pe={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const Ue=typeof URLSearchParams!=="undefined"?URLSearchParams:Te;const Be=typeof FormData!=="undefined"?FormData:null;const ze=typeof Blob!=="undefined"?Blob:null;const Ie={isBrowser:true,classes:{URLSearchParams:Ue,FormData:Be,Blob:ze},protocols:["http","https","file","blob","url","data"]};const _e=typeof window!=="undefined"&&typeof document!=="undefined";const De=typeof navigator==="object"&&navigator||undefined;const Le=_e&&(!De||["ReactNative","NativeScript","NS"].indexOf(De.product)<0);const qe=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const Me=_e&&window.location.href||"http://localhost";const He=Object.freeze({__proto__:null,hasBrowserEnv:_e,hasStandardBrowserWebWorkerEnv:qe,hasStandardBrowserEnv:Le,navigator:De,origin:Me});const $e={...He,...Ie};function Ke(e,t){return Se(e,new $e.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,o){if($e.isNode&&me.isBuffer(e)){this.append(t,e.toString("base64"));return false}return o.defaultVisitor.apply(this,arguments)}},t))}function Je(e){return me.matchAll(/\w+|\[(\w*)]/g,e).map((e=>e[0]==="[]"?"":e[1]||e[0]))}function Ve(e){const t={};const n=Object.keys(e);let o;const s=n.length;let i;for(o=0;o<s;o++){i=n[o];t[i]=e[i]}return t}function We(e){function t(e,n,o,s){let i=e[s++];if(i==="__proto__")return true;const r=Number.isFinite(+i);const c=s>=e.length;i=!i&&me.isArray(o)?o.length:i;if(c){if(me.hasOwnProp(o,i)){o[i]=[o[i],n]}else{o[i]=n}return!r}if(!o[i]||!me.isObject(o[i])){o[i]=[]}const a=t(e,n,o[i],s);if(a&&me.isArray(o[i])){o[i]=Ve(o[i])}return!r}if(me.isFormData(e)&&me.isFunction(e.entries)){const n={};me.forEachEntry(e,((e,o)=>{t(Je(e),o,n,0)}));return n}return null}function Xe(e,t,n){if(me.isString(e)){try{(t||JSON.parse)(e);return me.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(n||JSON.stringify)(e)}const Ge={transitional:Pe,adapter:["xhr","http","fetch"],transformRequest:[function e(t,n){const o=n.getContentType()||"";const s=o.indexOf("application/json")>-1;const i=me.isObject(t);if(i&&me.isHTMLForm(t)){t=new FormData(t)}const r=me.isFormData(t);if(r){return s?JSON.stringify(We(t)):t}if(me.isArrayBuffer(t)||me.isBuffer(t)||me.isStream(t)||me.isFile(t)||me.isBlob(t)||me.isReadableStream(t)){return t}if(me.isArrayBufferView(t)){return t.buffer}if(me.isURLSearchParams(t)){n.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}let c;if(i){if(o.indexOf("application/x-www-form-urlencoded")>-1){return Ke(t,this.formSerializer).toString()}if((c=me.isFileList(t))||o.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Se(c?{"files[]":t}:t,e&&new e,this.formSerializer)}}if(i||s){n.setContentType("application/json",false);return Xe(t)}return t}],transformResponse:[function e(t){const n=this.transitional||Ge.transitional;const o=n&&n.forcedJSONParsing;const s=this.responseType==="json";if(me.isResponse(t)||me.isReadableStream(t)){return t}if(t&&me.isString(t)&&(o&&!this.responseType||s)){const e=n&&n.silentJSONParsing;const o=!e&&s;try{return JSON.parse(t)}catch(e){if(o){if(e.name==="SyntaxError"){throw be.from(e,be.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:$e.classes.FormData,Blob:$e.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};me.forEach(["delete","get","head","post","put","patch"],(e=>{Ge.headers[e]={}}));const Ze=Ge;const Qe=me.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Ye=e=>{const t={};let n;let o;let s;e&&e.split("\n").forEach((function e(i){s=i.indexOf(":");n=i.substring(0,s).trim().toLowerCase();o=i.substring(s+1).trim();if(!n||t[n]&&Qe[n]){return}if(n==="set-cookie"){if(t[n]){t[n].push(o)}else{t[n]=[o]}}else{t[n]=t[n]?t[n]+", "+o:o}}));return t};const et=Symbol("internals");function tt(e){return e&&String(e).trim().toLowerCase()}function nt(e){if(e===false||e==null){return e}return me.isArray(e)?e.map(nt):String(e)}function ot(e){const t=Object.create(null);const n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;while(o=n.exec(e)){t[o[1]]=o[2]}return t}const st=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function it(e,t,n,o,s){if(me.isFunction(o)){return o.call(this,t,n)}if(s){t=n}if(!me.isString(t))return;if(me.isString(o)){return t.indexOf(o)!==-1}if(me.isRegExp(o)){return o.test(t)}}function rt(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}function ct(e,t){const n=me.toCamelCase(" "+t);["get","set","has"].forEach((o=>{Object.defineProperty(e,o+n,{value:function(e,n,s){return this[o].call(this,t,e,n,s)},configurable:true})}))}class at{constructor(e){e&&this.set(e)}set(e,t,n){const o=this;function s(e,t,n){const s=tt(t);if(!s){throw new Error("header name must be a non-empty string")}const i=me.findKey(o,s);if(!i||o[i]===undefined||n===true||n===undefined&&o[i]!==false){o[i||t]=nt(e)}}const i=(e,t)=>me.forEach(e,((e,n)=>s(e,n,t)));if(me.isPlainObject(e)||e instanceof this.constructor){i(e,t)}else if(me.isString(e)&&(e=e.trim())&&!st(e)){i(Ye(e),t)}else if(me.isHeaders(e)){for(const[t,o]of e.entries()){s(o,t,n)}}else{e!=null&&s(t,e,n)}return this}get(e,t){e=tt(e);if(e){const n=me.findKey(this,e);if(n){const e=this[n];if(!t){return e}if(t===true){return ot(e)}if(me.isFunction(t)){return t.call(this,e,n)}if(me.isRegExp(t)){return t.exec(e)}throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){e=tt(e);if(e){const n=me.findKey(this,e);return!!(n&&this[n]!==undefined&&(!t||it(this,this[n],n,t)))}return false}delete(e,t){const n=this;let o=false;function s(e){e=tt(e);if(e){const s=me.findKey(n,e);if(s&&(!t||it(n,n[s],s,t))){delete n[s];o=true}}}if(me.isArray(e)){e.forEach(s)}else{s(e)}return o}clear(e){const t=Object.keys(this);let n=t.length;let o=false;while(n--){const s=t[n];if(!e||it(this,this[s],s,e,true)){delete this[s];o=true}}return o}normalize(e){const t=this;const n={};me.forEach(this,((o,s)=>{const i=me.findKey(n,s);if(i){t[i]=nt(o);delete t[s];return}const r=e?rt(s):String(s).trim();if(r!==s){delete t[s]}t[r]=nt(o);n[r]=true}));return this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);me.forEach(this,((n,o)=>{n!=null&&n!==false&&(t[o]=e&&me.isArray(n)?n.join(", "):n)}));return t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);t.forEach((e=>n.set(e)));return n}static accessor(e){const t=this[et]=this[et]={accessors:{}};const n=t.accessors;const o=this.prototype;function s(e){const t=tt(e);if(!n[t]){ct(o,e);n[t]=true}}me.isArray(e)?e.forEach(s):s(e);return this}}at.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);me.reduceDescriptors(at.prototype,(({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}));me.freezeMethods(at);const lt=at;function ut(e,t){const n=this||Ze;const o=t||n;const s=lt.from(o.headers);let i=o.data;me.forEach(e,(function e(o){i=o.call(n,i,s.normalize(),t?t.status:undefined)}));s.normalize();return i}function ft(e){return!!(e&&e.__CANCEL__)}function dt(e,t,n){be.call(this,e==null?"canceled":e,be.ERR_CANCELED,t,n);this.name="CanceledError"}me.inherits(dt,be,{__CANCEL__:true});function ht(e,t,n){const o=n.config.validateStatus;if(!n.status||!o||o(n.status)){e(n)}else{t(new be("Request failed with status code "+n.status,[be.ERR_BAD_REQUEST,be.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}function pt(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function mt(e,t){e=e||10;const n=new Array(e);const o=new Array(e);let s=0;let i=0;let r;t=t!==undefined?t:1e3;return function c(a){const l=Date.now();const u=o[i];if(!r){r=l}n[s]=a;o[s]=l;let f=i;let d=0;while(f!==s){d+=n[f++];f=f%e}s=(s+1)%e;if(s===i){i=(i+1)%e}if(l-r<t){return}const h=u&&l-u;return h?Math.round(d*1e3/h):undefined}}function bt(e,t){let n=0;let o=1e3/t;let s;let i;const r=(t,o=Date.now())=>{n=o;s=null;if(i){clearTimeout(i);i=null}e.apply(null,t)};const c=(...e)=>{const t=Date.now();const c=t-n;if(c>=o){r(e,t)}else{s=e;if(!i){i=setTimeout((()=>{i=null;r(s)}),o-c)}}};const a=()=>s&&r(s);return[c,a]}const gt=(e,t,n=3)=>{let o=0;const s=mt(50,250);return bt((n=>{const i=n.loaded;const r=n.lengthComputable?n.total:undefined;const c=i-o;const a=s(c);const l=i<=r;o=i;const u={loaded:i,total:r,progress:r?i/r:undefined,bytes:c,rate:a?a:undefined,estimated:a&&r&&l?(r-i)/a:undefined,event:n,lengthComputable:r!=null,[t?"download":"upload"]:true};e(u)}),n)};const wt=(e,t)=>{const n=e!=null;return[o=>t[0]({lengthComputable:n,total:e,loaded:o}),t[1]]};const yt=e=>(...t)=>me.asap((()=>e(...t)));const vt=$e.hasStandardBrowserEnv?((e,t)=>n=>{n=new URL(n,$e.origin);return e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)})(new URL($e.origin),$e.navigator&&/(msie|trident)/i.test($e.navigator.userAgent)):()=>true;const xt=$e.hasStandardBrowserEnv?{write(e,t,n,o,s,i){const r=[e+"="+encodeURIComponent(t)];me.isNumber(n)&&r.push("expires="+new Date(n).toGMTString());me.isString(o)&&r.push("path="+o);me.isString(s)&&r.push("domain="+s);i===true&&r.push("secure");document.cookie=r.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function kt(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Rt(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ot(e,t,n){let o=!kt(t);if(e&&o||n==false){return Rt(e,t)}return t}const St=e=>e instanceof lt?{...e}:e;function Et(e,t){t=t||{};const n={};function o(e,t,n,o){if(me.isPlainObject(e)&&me.isPlainObject(t)){return me.merge.call({caseless:o},e,t)}else if(me.isPlainObject(t)){return me.merge({},t)}else if(me.isArray(t)){return t.slice()}return t}function s(e,t,n,s){if(!me.isUndefined(t)){return o(e,t,n,s)}else if(!me.isUndefined(e)){return o(undefined,e,n,s)}}function i(e,t){if(!me.isUndefined(t)){return o(undefined,t)}}function r(e,t){if(!me.isUndefined(t)){return o(undefined,t)}else if(!me.isUndefined(e)){return o(undefined,e)}}function c(n,s,i){if(i in t){return o(n,s)}else if(i in e){return o(undefined,n)}}const a={url:i,method:i,data:i,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,withXSRFToken:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,beforeRedirect:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:c,headers:(e,t,n)=>s(St(e),St(t),n,true)};me.forEach(Object.keys(Object.assign({},e,t)),(function o(i){const r=a[i]||s;const l=r(e[i],t[i],i);me.isUndefined(l)&&r!==c||(n[i]=l)}));return n}const Tt=e=>{const t=Et({},e);let{data:n,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:r,auth:c}=t;t.headers=r=lt.from(r);t.url=je(Ot(t.baseURL,t.url),e.params,e.paramsSerializer);if(c){r.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):"")))}let a;if(me.isFormData(n)){if($e.hasStandardBrowserEnv||$e.hasStandardBrowserWebWorkerEnv){r.setContentType(undefined)}else if((a=r.getContentType())!==false){const[e,...t]=a?a.split(";").map((e=>e.trim())).filter(Boolean):[];r.setContentType([e||"multipart/form-data",...t].join("; "))}}if($e.hasStandardBrowserEnv){o&&me.isFunction(o)&&(o=o(t));if(o||o!==false&&vt(t.url)){const e=s&&i&&xt.read(i);if(e){r.set(s,e)}}}return t};const At=typeof XMLHttpRequest!=="undefined";const Ct=At&&function(e){return new Promise((function t(n,o){const s=Tt(e);let i=s.data;const r=lt.from(s.headers).normalize();let{responseType:c,onUploadProgress:a,onDownloadProgress:l}=s;let u;let f,d;let h,p;function m(){h&&h();p&&p();s.cancelToken&&s.cancelToken.unsubscribe(u);s.signal&&s.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(s.method.toUpperCase(),s.url,true);b.timeout=s.timeout;function g(){if(!b){return}const t=lt.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders());const s=!c||c==="text"||c==="json"?b.responseText:b.response;const i={data:s,status:b.status,statusText:b.statusText,headers:t,config:e,request:b};ht((function e(t){n(t);m()}),(function e(t){o(t);m()}),i);b=null}if("onloadend"in b){b.onloadend=g}else{b.onreadystatechange=function e(){if(!b||b.readyState!==4){return}if(b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)){return}setTimeout(g)}}b.onabort=function t(){if(!b){return}o(new be("Request aborted",be.ECONNABORTED,e,b));b=null};b.onerror=function t(){o(new be("Network Error",be.ERR_NETWORK,e,b));b=null};b.ontimeout=function t(){let n=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const i=s.transitional||Pe;if(s.timeoutErrorMessage){n=s.timeoutErrorMessage}o(new be(n,i.clarifyTimeoutError?be.ETIMEDOUT:be.ECONNABORTED,e,b));b=null};i===undefined&&r.setContentType(null);if("setRequestHeader"in b){me.forEach(r.toJSON(),(function e(t,n){b.setRequestHeader(n,t)}))}if(!me.isUndefined(s.withCredentials)){b.withCredentials=!!s.withCredentials}if(c&&c!=="json"){b.responseType=s.responseType}if(l){[d,p]=gt(l,true);b.addEventListener("progress",d)}if(a&&b.upload){[f,h]=gt(a);b.upload.addEventListener("progress",f);b.upload.addEventListener("loadend",h)}if(s.cancelToken||s.signal){u=t=>{if(!b){return}o(!t||t.type?new dt(null,e,b):t);b.abort();b=null};s.cancelToken&&s.cancelToken.subscribe(u);if(s.signal){s.signal.aborted?u():s.signal.addEventListener("abort",u)}}const w=pt(s.url);if(w&&$e.protocols.indexOf(w)===-1){o(new be("Unsupported protocol "+w+":",be.ERR_BAD_REQUEST,e));return}b.send(i||null)}))};const jt=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController;let o;const s=function(e){if(!o){o=true;r();const t=e instanceof Error?e:this.reason;n.abort(t instanceof be?t:new dt(t instanceof Error?t.message:t))}};let i=t&&setTimeout((()=>{i=null;s(new be(`timeout ${t} of ms exceeded`,be.ETIMEDOUT))}),t);const r=()=>{if(e){i&&clearTimeout(i);i=null;e.forEach((e=>{e.unsubscribe?e.unsubscribe(s):e.removeEventListener("abort",s)}));e=null}};e.forEach((e=>e.addEventListener("abort",s)));const{signal:c}=n;c.unsubscribe=()=>me.asap(r);return c}};const Nt=jt;const Ft=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let o=0;let s;while(o<n){s=o+t;yield e.slice(o,s);o=s}};const Pt=async function*(e,t){for await(const n of Ut(e)){yield*Ft(n,t)}};const Ut=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e){break}yield n}}finally{await t.cancel()}};const Bt=(e,t,n,o)=>{const s=Pt(e,t);let i=0;let r;let c=e=>{if(!r){r=true;o&&o(e)}};return new ReadableStream({async pull(e){try{const{done:t,value:o}=await s.next();if(t){c();e.close();return}let r=o.byteLength;if(n){let e=i+=r;n(e)}e.enqueue(new Uint8Array(o))}catch(e){c(e);throw e}},cancel(e){c(e);return s.return()}},{highWaterMark:2})};const zt=typeof fetch==="function"&&typeof Request==="function"&&typeof Response==="function";const It=zt&&typeof ReadableStream==="function";const _t=zt&&(typeof TextEncoder==="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer()));const Dt=(e,...t)=>{try{return!!e(...t)}catch(e){return false}};const Lt=It&&Dt((()=>{let e=false;const t=new Request($e.origin,{body:new ReadableStream,method:"POST",get duplex(){e=true;return"half"}}).headers.has("Content-Type");return e&&!t}));const qt=64*1024;const Mt=It&&Dt((()=>me.isReadableStream(new Response("").body)));const Ht={stream:Mt&&(e=>e.body)};zt&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!Ht[t]&&(Ht[t]=me.isFunction(e[t])?e=>e[t]():(e,n)=>{throw new be(`Response type '${t}' is not supported`,be.ERR_NOT_SUPPORT,n)})}))})(new Response);const $t=async e=>{if(e==null){return 0}if(me.isBlob(e)){return e.size}if(me.isSpecCompliantForm(e)){const t=new Request($e.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}if(me.isArrayBufferView(e)||me.isArrayBuffer(e)){return e.byteLength}if(me.isURLSearchParams(e)){e=e+""}if(me.isString(e)){return(await _t(e)).byteLength}};const Kt=async(e,t)=>{const n=me.toFiniteNumber(e.getContentLength());return n==null?$t(t):n};const Jt=zt&&(async e=>{let{url:t,method:n,data:o,signal:s,cancelToken:i,timeout:r,onDownloadProgress:c,onUploadProgress:a,responseType:l,headers:u,withCredentials:f="same-origin",fetchOptions:d}=Tt(e);l=l?(l+"").toLowerCase():"text";let h=Nt([s,i&&i.toAbortSignal()],r);let p;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let b;try{if(a&&Lt&&n!=="get"&&n!=="head"&&(b=await Kt(u,o))!==0){let e=new Request(t,{method:"POST",body:o,duplex:"half"});let n;if(me.isFormData(o)&&(n=e.headers.get("content-type"))){u.setContentType(n)}if(e.body){const[t,n]=wt(b,gt(yt(a)));o=Bt(e.body,qt,t,n)}}if(!me.isString(f)){f=f?"include":"omit"}const s="credentials"in Request.prototype;p=new Request(t,{...d,signal:h,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:o,duplex:"half",credentials:s?f:undefined});let i=await fetch(p);const r=Mt&&(l==="stream"||l==="response");if(Mt&&(c||r&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=i[t]}));const t=me.toFiniteNumber(i.headers.get("content-length"));const[n,o]=c&&wt(t,gt(yt(c),true))||[];i=new Response(Bt(i.body,qt,n,(()=>{o&&o();m&&m()})),e)}l=l||"text";let g=await Ht[me.findKey(Ht,l)||"text"](i,e);!r&&m&&m();return await new Promise(((t,n)=>{ht(t,n,{data:g,headers:lt.from(i.headers),status:i.status,statusText:i.statusText,config:e,request:p})}))}catch(t){m&&m();if(t&&t.name==="TypeError"&&/fetch/i.test(t.message)){throw Object.assign(new be("Network Error",be.ERR_NETWORK,e,p),{cause:t.cause||t})}throw be.from(t,t&&t.code,e,p)}});const Vt={http:ye,xhr:Ct,fetch:Jt};me.forEach(Vt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Wt=e=>`- ${e}`;const Xt=e=>me.isFunction(e)||e===null||e===false;const Gt={getAdapter:e=>{e=me.isArray(e)?e:[e];const{length:t}=e;let n;let o;const s={};for(let i=0;i<t;i++){n=e[i];let t;o=n;if(!Xt(n)){o=Vt[(t=String(n)).toLowerCase()];if(o===undefined){throw new be(`Unknown adapter '${t}'`)}}if(o){break}s[t||"#"+i]=o}if(!o){const e=Object.entries(s).map((([e,t])=>`adapter ${e} `+(t===false?"is not supported by the environment":"is not available in the build")));let n=t?e.length>1?"since :\n"+e.map(Wt).join("\n"):" "+Wt(e[0]):"as no adapter specified";throw new be(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return o},adapters:Vt};function Zt(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new dt(null,e)}}function Qt(e){Zt(e);e.headers=lt.from(e.headers);e.data=ut.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}const t=Gt.getAdapter(e.adapter||Ze.adapter);return t(e).then((function t(n){Zt(e);n.data=ut.call(e,e.transformResponse,n);n.headers=lt.from(n.headers);return n}),(function t(n){if(!ft(n)){Zt(e);if(n&&n.response){n.response.data=ut.call(e,e.transformResponse,n.response);n.response.headers=lt.from(n.response.headers)}}return Promise.reject(n)}))}const Yt="1.8.1";const en={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{en[e]=function n(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}}));const tn={};en.transitional=function e(t,n,o){function s(e,t){return"[Axios v"+Yt+"] Transitional option '"+e+"'"+t+(o?". "+o:"")}return(e,o,i)=>{if(t===false){throw new be(s(o," has been removed"+(n?" in "+n:"")),be.ERR_DEPRECATED)}if(n&&!tn[o]){tn[o]=true;console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))}return t?t(e,o,i):true}};en.spelling=function e(t){return(e,n)=>{console.warn(`${n} is likely a misspelling of ${t}`);return true}};function nn(e,t,n){if(typeof e!=="object"){throw new be("options must be an object",be.ERR_BAD_OPTION_VALUE)}const o=Object.keys(e);let s=o.length;while(s-- >0){const i=o[s];const r=t[i];if(r){const t=e[i];const n=t===undefined||r(t,i,e);if(n!==true){throw new be("option "+i+" must be "+n,be.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new be("Unknown option "+i,be.ERR_BAD_OPTION)}}}const on={assertOptions:nn,validators:en};const sn=on.validators;class rn{constructor(e){this.defaults=e;this.interceptors={request:new Fe,response:new Fe}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{if(!e.stack){e.stack=n}else if(n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))){e.stack+="\n"+n}}catch(e){}}throw e}}_request(e,t){if(typeof e==="string"){t=t||{};t.url=e}else{t=e||{}}t=Et(this.defaults,t);const{transitional:n,paramsSerializer:o,headers:s}=t;if(n!==undefined){on.assertOptions(n,{silentJSONParsing:sn.transitional(sn.boolean),forcedJSONParsing:sn.transitional(sn.boolean),clarifyTimeoutError:sn.transitional(sn.boolean)},false)}if(o!=null){if(me.isFunction(o)){t.paramsSerializer={serialize:o}}else{on.assertOptions(o,{encode:sn.function,serialize:sn.function},true)}}if(t.allowAbsoluteUrls!==undefined);else if(this.defaults.allowAbsoluteUrls!==undefined){t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls}else{t.allowAbsoluteUrls=true}on.assertOptions(t,{baseUrl:sn.spelling("baseURL"),withXsrfToken:sn.spelling("withXSRFToken")},true);t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=s&&me.merge(s.common,s[t.method]);s&&me.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete s[e]}));t.headers=lt.concat(i,s);const r=[];let c=true;this.interceptors.request.forEach((function e(n){if(typeof n.runWhen==="function"&&n.runWhen(t)===false){return}c=c&&n.synchronous;r.unshift(n.fulfilled,n.rejected)}));const a=[];this.interceptors.response.forEach((function e(t){a.push(t.fulfilled,t.rejected)}));let l;let u=0;let f;if(!c){const e=[Qt.bind(this),undefined];e.unshift.apply(e,r);e.push.apply(e,a);f=e.length;l=Promise.resolve(t);while(u<f){l=l.then(e[u++],e[u++])}return l}f=r.length;let d=t;u=0;while(u<f){const e=r[u++];const t=r[u++];try{d=e(d)}catch(e){t.call(this,e);break}}try{l=Qt.call(this,d)}catch(e){return Promise.reject(e)}u=0;f=a.length;while(u<f){l=l.then(a[u++],a[u++])}return l}getUri(e){e=Et(this.defaults,e);const t=Ot(e.baseURL,e.url,e.allowAbsoluteUrls);return je(t,e.params,e.paramsSerializer)}}me.forEach(["delete","get","head","options"],(function e(t){rn.prototype[t]=function(e,n){return this.request(Et(n||{},{method:t,url:e,data:(n||{}).data}))}}));me.forEach(["post","put","patch"],(function e(t){function n(e){return function n(o,s,i){return this.request(Et(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:o,data:s}))}}rn.prototype[t]=n();rn.prototype[t+"Form"]=n(true)}));const cn=rn;class an{constructor(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}let t;this.promise=new Promise((function e(n){t=n}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;while(t-- >0){n._listeners[t](e)}n._listeners=null}));this.promise.then=e=>{let t;const o=new Promise((e=>{n.subscribe(e);t=e})).then(e);o.cancel=function e(){n.unsubscribe(t)};return o};e((function e(o,s,i){if(n.reason){return}n.reason=new dt(o,s,i);t(n.reason)}))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}}unsubscribe(e){if(!this._listeners){return}const t=this._listeners.indexOf(e);if(t!==-1){this._listeners.splice(t,1)}}toAbortSignal(){const e=new AbortController;const t=t=>{e.abort(t)};this.subscribe(t);e.signal.unsubscribe=()=>this.unsubscribe(t);return e.signal}static source(){let e;const t=new an((function t(n){e=n}));return{token:t,cancel:e}}}const ln=an;function un(e){return function t(n){return e.apply(null,n)}}function fn(e){return me.isObject(e)&&e.isAxiosError===true}const dn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(dn).forEach((([e,t])=>{dn[t]=e}));const hn=dn;function pn(e){const t=new cn(e);const n=f(cn.prototype.request,t);me.extend(n,cn.prototype,t,{allOwnKeys:true});me.extend(n,t,null,{allOwnKeys:true});n.create=function t(n){return pn(Et(e,n))};return n}const mn=pn(Ze);mn.Axios=cn;mn.CanceledError=dt;mn.CancelToken=ln;mn.isCancel=ft;mn.VERSION=Yt;mn.toFormData=Se;mn.AxiosError=be;mn.Cancel=mn.CanceledError;mn.all=function e(t){return Promise.all(t)};mn.spread=un;mn.isAxiosError=fn;mn.mergeConfig=Et;mn.AxiosHeaders=lt;mn.formToJSON=e=>We(me.isHTMLForm(e)?new FormData(e):e);mn.getAdapter=Gt.getAdapter;mn.HttpStatusCode=hn;mn.default=mn;const bn=mn;const gn=["https://beta.verdocs.com","https://stage.verdocs.com","http://localhost:6006","http://localhost:5173"];const wn=gn.includes(window.location.origin)?"default:development.6348f953f52485d19daf03992f2123a36e9eae59c5ca7f8736dc2b67":"default:production.4808a77b2a149e1796391b480b4fb501d73aa1e11123f60e07809ced";const yn=()=>bn.get("https://unleash.verdocs.com/api/frontend",{headers:{Accept:"application/json",Authorization:wn}}).then((e=>e.data)).catch((e=>{console.log("Unleash: Unable to fetch feature flags",e);throw e}));const vn='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{gap:12px;width:300px;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#f5f5fa}verdocs-contact-picker form .row{gap:8px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-contact-picker form .names-row{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .names-row>input{font-size:14px;width:88px}verdocs-contact-picker form .pin-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .pin-code>input{-ms-flex:0 0 197px;flex:0 0 197px;font-size:14px}verdocs-contact-picker form .address{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .address>input{-ms-flex:1;flex:1;font-size:14px}verdocs-contact-picker form .zip-code{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .zip-code>input{-ms-flex:1;flex:1;font-size:14px}verdocs-contact-picker form label{display:-ms-flexbox;display:flex;-ms-flex:0 0 80px;flex:0 0 80px;font-size:13px;font-weight:500;color:#5c6575}verdocs-contact-picker form .row.message textarea{width:100%;padding:5px 7px;border-radius:4px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-contact-picker form input{-ms-flex:1;flex:1;padding:6px;font-size:14px;border-radius:3px;border:1px solid rgba(112, 122, 229, 0.3725490196)}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}#verdocs-contact-picker-suggestions .dropdown{max-height:225px;overflow-y:scroll;background:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}#verdocs-contact-picker-suggestions .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-contact-picker-suggestions .dropdown .suggestion svg{width:32px;height:32px}#verdocs-contact-picker-suggestions .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}#verdocs-contact-picker-suggestions .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}#verdocs-contact-picker-suggestions .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}#verdocs-contact-picker-suggestions .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}#verdocs-contact-picker-suggestions .dropdown .suggestion:hover{background:#eee;cursor:pointer}';const xn=vn;const kn=`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>`;const Rn=class{constructor(n){e(this,n);this.searchContacts=t(this,"searchContacts",7);this.exit=t(this,"exit",7);this.next=t(this,"next",7);this.endpoint=i.getDefault();this.templateRole=null;this.contactSuggestions=[];this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.auth_methods=[];this.passcode="";this.firstNameFieldId=`verdocs-contact-picker-firstname-${Math.random().toString(36).substring(2,11)}`;this.lastNameFieldId=`verdocs-contact-picker-lastname-${Math.random().toString(36).substring(2,11)}`;this.emailFieldId=`verdocs-contact-picker-email-${Math.random().toString(36).substring(2,11)}`;this.phoneFieldId=`verdocs-contact-picker-phone-${Math.random().toString(36).substring(2,11)}`;this.featureFlags=null;this.activeEntitlements={}}componentWillLoad(){this.endpoint.loadSession();if(this.templateRole){const e=r(this.templateRole);const t=e.split(" ");const n=this.templateRole.first_name||t.shift()||"";const o=this.templateRole.last_name||t.join(" ")||"";this.first_name=n;this.last_name=o;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.auth_methods=this.templateRole.auth_methods||[];this.passcode=this.templateRole.passcode||""}c(this.endpoint).then((e=>{this.activeEntitlements=e;console.log("[CONTACT PICKER] Loaded entitlements",e)})).catch((e=>console.log("[CONTACT PICKER] Error loading entitlements, some features may be disabled.",e)));yn().then((e=>{this.featureFlags=e;console.log("[CONTACT PICKER] Loaded feature flags",e)})).catch((e=>{console.log("[CONTACT PICKER] Unable to fetch feature flags, some features may be disabled.",e)}))}handleFirstNameChange(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})}handleLastNameChange(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})}handleCancel(e){var t;e.stopPropagation();console.log("cxl");this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()}handleSubmit(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator,auth_methods:this.auth_methods,passcode:this.passcode,address:this.address,zip:this.zip})}handleSelectSuggestion(e,t){e.stopPropagation();this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false}render(){var e,t,s,i,c,l,f,d,h,p,m,b,g,w,y,v,x,k;const R=this.first_name&&this.last_name&&a(this.email);const O=!this.auth_methods.length||this.auth_methods.includes("passcode")&&!!this.passcode||this.auth_methods.includes("kba")&&!!this.first_name&&!!this.last_name||this.auth_methods.includes("email")&&!!this.email||this.auth_methods.includes("sms")&&!!this.phone;const S=R&&O;const E=((s=(t=(e=this.featureFlags)===null||e===void 0?void 0:e.toggles)===null||t===void 0?void 0:t.find((e=>e.name==="sms")))===null||s===void 0?void 0:s.enabled)===true;const T=[];if(((l=(c=(i=this.featureFlags)===null||i===void 0?void 0:i.toggles)===null||c===void 0?void 0:c.find((e=>e.name==="passcode-verification")))===null||l===void 0?void 0:l.enabled)===true){T.push({label:"Passcode",value:"passcode"})}if(((h=(d=(f=this.featureFlags)===null||f===void 0?void 0:f.toggles)===null||d===void 0?void 0:d.find((e=>e.name==="email-verification")))===null||h===void 0?void 0:h.enabled)===true){T.push({label:"Email",value:"email"})}if(E&&((b=(m=(p=this.featureFlags)===null||p===void 0?void 0:p.toggles)===null||m===void 0?void 0:m.find((e=>e.name==="sms-verification")))===null||b===void 0?void 0:b.enabled)===true&&!!this.activeEntitlements.sms_auth){T.push({label:"SMS (One-Time Code)",value:"sms"})}if(((y=(w=(g=this.featureFlags)===null||g===void 0?void 0:g.toggles)===null||w===void 0?void 0:w.find((e=>e.name==="kba-verification")))===null||y===void 0?void 0:y.enabled)===true&&!!this.activeEntitlements.kba_auth){T.push({label:"Knowledge-Based (KBA)",value:"kba"})}if(((k=(x=(v=this.featureFlags)===null||v===void 0?void 0:v.toggles)===null||x===void 0?void 0:x.find((e=>e.name==="id-verification")))===null||k===void 0?void 0:k.enabled)===true&&!!this.activeEntitlements.id_auth){T.push({label:"ID Check",value:"id"})}return n("form",{key:"04692a50db278a08b263fa5343a90f832b7a39ee",onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},n("div",{key:"49c73586ee2a3b55284c7060578ce2f76442eb7f",class:"row"},n("label",{key:"c14e09c5fafc682f8e84409cabb8c16080a542ef",htmlFor:this.firstNameFieldId},"Name:"),n("div",{key:"64d1f1411604edaab598852ecccbd2e81cac5d01",class:"names-row"},n("input",{key:"ab738a6d5fb36378c6cae917ffc0cce34eefc251",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.first_name,placeholder:"First...",onFocus:()=>{setTimeout((()=>{var e;this.showSuggestions=((e=this.contactSuggestions)===null||e===void 0?void 0:e.length)>0}),100)},onInput:e=>this.handleFirstNameChange(e)}),n("input",{key:"e78173446c9eb0d24125b1e9a614948b2c0dea34",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.last_name,placeholder:"Last...",onFocus:()=>{setTimeout((()=>{var e;this.showSuggestions=((e=this.contactSuggestions)===null||e===void 0?void 0:e.length)>0}),100)},onInput:e=>this.handleLastNameChange(e)})),this.showSuggestions&&n("verdocs-portal",{key:"9947a7f8ab42d1790df06e579796d4a2e93245d1",anchor:this.firstNameFieldId,onClickAway:()=>this.showSuggestions=false,id:"verdocs-contact-picker-suggestions"},n("div",{key:"fbc62ab9fe1d080bd24cdcd6d06af7608957566c",class:"dropdown"},this.contactSuggestions.filter((e=>!this.first_name||e.first_name.toLowerCase().includes(this.first_name.toLowerCase()))).map((e=>{var t;return n("div",{key:(t=e.id)!==null&&t!==void 0?t:e.email,class:"suggestion",onClick:t=>this.handleSelectSuggestion(t,e)},e.picture?n("img",{alt:"Avatar",class:"avatar",src:e.picture}):n("div",{class:"avatar",innerHTML:kn}),n("div",{class:"details"},n("div",{class:"name"},r(e)),e.email&&n("div",{class:"destination"},e.email),e.phone&&n("div",{class:"destination"},e.phone)))}))))),n("div",{key:"e8e70c9c0eb9aac2949ea3f1cdcad31a0109b1e6",class:"row"},n("label",{key:"1a0446066a2337a8317e4f1a30a7b4bbaac8e9d9",htmlFor:this.emailFieldId},"Email:"),n("input",{key:"700f23efdcdad3569e37f68beb87254768997476",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked","aria-autocomplete":"none",value:this.email,placeholder:"Invite/verify via email...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.email=e.target.value})),E&&n("div",{key:"e10b121fcc2c612b95a9e8ebd35fbbaba78f31ff",class:"row"},n("label",{key:"924df4057ae82c1a42a060f6457999e9e7be3e9d",htmlFor:this.phoneFieldId},"Phone:"),n("input",{key:"be1707e6c04744891626dd14ce7beee679e33b95",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked","aria-autocomplete":"none",value:this.phone,placeholder:"Invite/verify via SMS...",onFocus:()=>this.showSuggestions=false,onInput:e=>{this.phone=u(e.target.value)}})),n(o,{key:"a27e49219aed619f6ce094ca91d7bdb8ee4bd361"},T.length>0&&n("div",{key:"3c2eb231a5e10223a0554b2661f7902a7343ff14",class:"row"},n("label",{key:"2424d844f6c54d6898aff3746c665e8f0028393f"},"Recipient Verification:"),n("verdocs-multiselect",{key:"15e4fdff72818343d016749c83a10602083c19db",label:"",placeholder:"None",options:T,selectedOptions:this.auth_methods,onSelectionChanged:e=>{console.log("selectedOptions changed",e.detail);this.auth_methods=e.detail.selectedOptions}})),this.auth_methods.includes("passcode")&&n("div",{key:"cb92bbf38b29b81dd443ea63ee52f5c38ca3e462",class:"row pin-code"},n("label",{key:"a31d6aa08952a78774e0f7d6fc89a0c992fff0ce",htmlFor:this.phoneFieldId},"Passcode:"),n("input",{key:"416d22a451995e318fed41b36feda632b7324231",id:"verdocs-passcode",name:"verdocs-passcode",type:"text","data-lpignore":"true",autocomplete:"blocked","aria-autocomplete":"none",value:this.passcode,placeholder:"4-8 digits recommended...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.passcode=e.target.value}))),n("div",{key:"12d5f81d3750dfbec08c01d9f9e5ef8ff4e4ab61",class:"row message"},n("label",{key:"c5d2265df1203c2f1cb09e4ef99ece909a11c3d1",htmlFor:"verdocs-contact-picker-message"},"Message:"),n("textarea",{key:"875a4a055860497d1b5f270fe9e4f76fd1594d86",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message","data-lpignore":"true",autocomplete:"blocked",placeholder:"Optional message to include in invitation...",onFocus:()=>this.showSuggestions=false,onInput:e=>this.message=e.target.value},this.message)),n("div",{key:"fc5dc7ca853d00fbeb22b912f7da5db32c394bdb",class:"buttons"},n("div",{key:"cb19eed74dcc4a093d0420352e31b50c252ca857",class:"flex-fill"}),n("verdocs-button",{key:"b94abf0ba4e07bdb661aee267a2d23bd1e5f9555",variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e)}),n("verdocs-button",{key:"2ad4cf79ebbac22818caee6fd732cf4cbf01436b",label:"OK",size:"small",disabled:!S,onClick:!S?()=>{}:e=>this.handleSubmit(e)})))}};Rn.style=xn;const On='@-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-multiselect{width:100%;display:block;margin:0 0 10px 0;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", "Barlow", sans-serif}verdocs-multiselect .input-wrapper{width:100%;position:relative}verdocs-multiselect .input-wrapper .icon{top:6px;right:6px;width:18px;height:18px;z-index:10;position:absolute}verdocs-multiselect.open .input-wrapper .icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}verdocs-multiselect .trigger{gap:3px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;max-width:100%;border-radius:4px;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;padding:5px 32px 5px 7px;background:#ffffff;border:1px solid #707ae5}verdocs-multiselect .trigger::-webkit-input-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger::-moz-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger:-ms-input-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger::-ms-input-placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .trigger::placeholder{opacity:1;color:#aaaaaa}verdocs-multiselect .selected-option{color:white;font-size:12px;padding:2px 6px;border-radius:3px;display:inline-block;background:#46497d}verdocs-multiselect .input-label{display:block;font-weight:700;font-size:14px;margin:0 0 4px 0;color:#555570}#verdocs-multiselect-menu-items{width:200px;z-index:10000;position:absolute;border-radius:5px;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;border:1px solid #654dcb}#verdocs-multiselect-menu-items .option{display:-ms-flexbox;display:flex;gap:4px;padding:5px 8px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-multiselect-menu-items label{font-size:13px}';const Sn=On;const En=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m19.5 8.25-7.5 7.5-7.5-7.5" /></svg>`;const Tn=class{constructor(n){e(this,n);this.selectionChanged=t(this,"selectionChanged",7);this.label="";this.placeholder="Select...";this.selectedOptions=[];this.showPicker=false}handleToggleOption(e,t){var n;if(e.target.checked){this.selectedOptions=[...this.selectedOptions,t.value]}else{this.selectedOptions=this.selectedOptions.filter((e=>e!==t.value))}(n=this.selectionChanged)===null||n===void 0?void 0:n.emit({selectedOptions:this.selectedOptions})}render(){const e=`verdocs-dropdown-${l(8)}`;return n(s,{key:"7fa4d31d423894e8caa3dffd1fb46752b7b87ee5",class:this.showPicker?"open":"closed"},n("label",{key:"891a7d7ee2867d598f2f3ea6609148a47a9a7166"},this.label?n("div",{class:"input-label"},this.label+":"):n("div",null),n("div",{key:"c165f68315aec9d1aca6e9f2214ece090f496363",class:"input-wrapper"},n("button",{key:"2297bfb9c84abd5da4c73dfcbae15fe2f5f04c1c",id:e,class:"trigger",value:"",onClick:()=>this.showPicker=true},this.selectedOptions.length===0?n("span",{class:"placeholder"},this.placeholder):this.selectedOptions.map((e=>{var t;return n("span",{class:"selected-option"},((t=this.options.find((t=>t.value===e)))===null||t===void 0?void 0:t.label)||"Unknown")}))),n("div",{key:"e4929befc449d9be400305ee3e0aeb1c171583fd",class:"icon",innerHTML:En}),this.showPicker&&n("verdocs-portal",{key:"42016ae18aa4acd4c5aac8f2ea3a7d6126116aa6",anchor:e,voffset:2,onClickAway:()=>this.showPicker=false,id:"verdocs-multiselect-menu-items"},this.options.map(((e,t)=>n("div",{class:"option",onClick:()=>this.showPicker=false},n("verdocs-checkbox",{size:"small",id:`verdocs-multi-select-opt-${t}`,value:e.value,checked:this.selectedOptions.includes(e.value),onInput:t=>this.handleToggleOption(t,e)}),n("label",{htmlFor:`verdocs-multi-select-option-${t}`},e.label))))))))}};Tn.style=Sn;export{Rn as verdocs_contact_picker,Tn as verdocs_multiselect};
|
2
|
+
//# sourceMappingURL=p-d47c58de.entry.js.map
|