@verdocs/web-sdk 2.3.79 → 2.3.81
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/{TemplateRoleStore-94afc2b0.js → TemplateRoleStore-a7f2b586.js} +2 -0
- package/dist/cjs/{TemplateStore-9a87282d.js → TemplateStore-62c90f8c.js} +2 -2
- package/dist/cjs/{VerdocsEndpoint-38bcb409.js → VerdocsEndpoint-3036bbb7.js} +26 -5
- package/dist/cjs/ipc-test.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-build.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_15.cjs.entry.js +21 -15
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_8.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +12 -7
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
- package/dist/collection/components/templates/verdocs-template-document-page/verdocs-template-document-page.js +18 -12
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +1 -1
- package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +8 -2
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +1 -2
- package/dist/collection/utils/TemplateRoleStore.js +2 -0
- package/dist/components/TemplateRoleStore.js +2 -0
- package/dist/components/VerdocsEndpoint.js +26 -5
- package/dist/components/verdocs-field-date2.js +1 -1
- package/dist/components/verdocs-template-document-page2.js +18 -12
- package/dist/components/verdocs-template-fields2.js +1 -1
- package/dist/components/verdocs-template-role-properties2.js +8 -2
- package/dist/components/verdocs-template-roles2.js +1 -2
- package/dist/docs.json +1 -1
- package/dist/esm/{TemplateRoleStore-447f2cb6.js → TemplateRoleStore-33229997.js} +2 -0
- package/dist/esm/{TemplateStore-6a7d7297.js → TemplateStore-940da116.js} +2 -2
- package/dist/esm/{VerdocsEndpoint-9a11e843.js → VerdocsEndpoint-8196ff47.js} +26 -5
- package/dist/esm/ipc-test.entry.js +3 -3
- package/dist/esm/verdocs-activity-box.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +1 -1
- package/dist/esm/verdocs-build.entry.js +3 -3
- package/dist/esm/verdocs-checkbox_5.entry.js +3 -3
- package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_15.entry.js +21 -15
- package/dist/esm/verdocs-field-payment.entry.js +1 -1
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_8.entry.js +3 -3
- package/dist/esm/verdocs-quick-functions_2.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm/verdocs-settings.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-fields_4.entry.js +12 -7
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-templates-list.entry.js +1 -1
- package/dist/esm/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/TemplateRoleStore-33229997.js +1 -0
- package/dist/esm-es5/{TemplateStore-6a7d7297.js → TemplateStore-940da116.js} +1 -1
- package/dist/esm-es5/VerdocsEndpoint-8196ff47.js +1 -0
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_15.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/verdocs-web-sdk/{p-ee9336c4.entry.js → p-0fad670a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-55403539.entry.js → p-11313611.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-812d7568.entry.js → p-15bab601.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-1f9d9fe5.system.js +1 -0
- package/dist/verdocs-web-sdk/p-235b4a0b.system.js +1 -0
- package/dist/verdocs-web-sdk/p-2415be91.js +1 -0
- package/dist/verdocs-web-sdk/{p-92a6f625.entry.js → p-24af72a8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d524266d.system.entry.js → p-26510053.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-f6b75e4c.entry.js → p-282f9e5d.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1978c7bd.system.entry.js → p-2b24875a.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d0140be2.entry.js → p-2d19abc4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-48c14014.system.entry.js → p-2e7c8fab.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-05026d67.system.entry.js → p-2fe06d77.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0e6b2f10.system.entry.js → p-339bf806.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b9376079.system.entry.js → p-33b07afa.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-340d2daa.system.entry.js → p-36027210.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d075b6e8.entry.js → p-3caf62b5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e3bfe2de.system.entry.js → p-3e87cba1.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b1e92d11.system.entry.js → p-42df843d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4632097c.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-1a29b57f.system.entry.js → p-4867c205.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-70137c9e.entry.js → p-4e2266f4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8b46dcc3.entry.js → p-50b42b7a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-90734d54.system.entry.js → p-517fd967.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8b78ee37.system.entry.js → p-540181be.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6dad60bb.entry.js → p-5bd07c15.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-5059ff08.entry.js → p-5ffa1866.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-094ea4ba.system.entry.js → p-7284027d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-daebba0a.entry.js → p-72d71bdb.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-8205cd46.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-cb48d6b9.system.entry.js → p-82c670ba.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a87f2e56.entry.js → p-8a6efa9b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6ec51b4b.entry.js → p-8c67e5b4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-906096be.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-786725d0.system.entry.js → p-946cdc47.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-0d1f4272.system.entry.js → p-9a3d8a0e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-9cfcfab1.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-ed319550.entry.js → p-9eccf06a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-49139f23.system.js → p-b6df9fe6.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-24742737.system.entry.js → p-b7c6d8c0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b293e7d0.system.entry.js → p-b9d8c567.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bf2fd0eb.system.entry.js → p-bca5cb27.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4618665e.system.entry.js → p-c693d197.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-2bcd953d.entry.js → p-c71cd002.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-ceadd1e1.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-ccac4998.entry.js → p-d2dafb54.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d425fa2c.js +1 -0
- package/dist/verdocs-web-sdk/{p-9b306355.system.entry.js → p-e0607460.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e93796e2.entry.js → p-e0d4794b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-cda8b816.js → p-e1f4be7c.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a15e1a57.entry.js → p-e25d16cc.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-283d935e.entry.js → p-f5475fa5.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +15 -15
- package/dist/esm-es5/TemplateRoleStore-447f2cb6.js +0 -1
- package/dist/esm-es5/VerdocsEndpoint-9a11e843.js +0 -1
- package/dist/verdocs-web-sdk/p-034bd59e.system.js +0 -1
- package/dist/verdocs-web-sdk/p-07cf78e3.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-337466c7.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-8324a7a3.system.js +0 -1
- package/dist/verdocs-web-sdk/p-b086f9be.js +0 -1
- package/dist/verdocs-web-sdk/p-bc6ce10f.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d522f008.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d77962af.js +0 -1
- package/dist/verdocs-web-sdk/p-f15263ff.system.entry.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
import{r as e,c as t,h as i}from"./p-14b44491.js";import{d as s}from"./p-05788c2b.js";import{V as l}from"./p-d77962af.js";import{c as o}from"./p-3e607686.js";import{V as a}from"./p-ed416acf.js";import{S as n}from"./p-7a1b2643.js";const r=[{value:"",label:""},{value:"Accounting & Tax",label:"Accounting & Tax"},{value:"Business Services / Consulting",label:"Business Services / Consulting"},{value:"Construction",label:"Construction"},{value:"Education",label:"Education"},{value:"Financial Services",label:"Financial Services"},{value:"Government",label:"Government"},{value:"Healthcare - Health Plans & Payers",label:"Healthcare - Health Plans & Payers"},{value:"Healthcare - Providers",label:"Healthcare - Providers"},{value:"Insurance",label:"Insurance"},{value:"Legal",label:"Legal"},{value:"Life Sciences",label:"Life Sciences"},{value:"Manufacturing",label:"Manufacturing"},{value:"Mortgage",label:"Mortgage"},{value:"Not For Profit",label:"Not For Profit"},{value:"Real Estate - Commercial",label:"Real Estate - Commercial"},{value:"Real Estate - Residential",label:"Real Estate - Residential"},{value:"Retail",label:"Retail"},{value:"Technology",label:"Technology"},{value:"Other",label:"Other"}],u=[{value:"",label:""},{value:"I want to send a document for signature.",label:"I want to send a document for signature."},{value:"I just need to sign a document today.",label:"I just need to sign a document today."},{value:"I'm evaluating it for my business.",label:"I'm evaluating it for my business."},{value:"I'm evaluating it for my personal use.",label:"I'm evaluating it for my personal use."},{value:"I'm a developer building an integration.",label:"I'm a developer building an integration."}],d=[{value:"",label:""},{value:"Solo",label:"Solo"},{value:"2-10",label:"2-10"},{value:"11-50",label:"11-50"},{value:"51-200",label:"51-200"},{value:"201-500",label:"201-500"},{value:"501-1000",label:"501-1000"},{value:"1000+",label:"1000+"}],h=class{constructor(i){e(this,i),this.authenticated=t(this,"authenticated",7),this.sdkError=t(this,"sdkError",7),this.recheckTimer=null,this.resendDisabledTimer=null,this.accessTokenForVerification=null,this.endpoint=l.getDefault(),this.visible=!0,this.logo="https://app.verdocs.com/assets/blue-logo.svg",this.isAuthenticated=!1,this.displayMode="login",this.orgname="",this.first="",this.last="",this.username="",this.phone="",this.password="",this.submitting=!1,this.activeSession=null,this.accountType="org",this.howHear="",this.industry="",this.companySize="",this.reason="",this.signupStep=1,this.resendDisabled=!1,this.checkingOrg=!1}componentWillLoad(){var e,t;this.endpoint.loadSession(),this.endpoint.session?(console.log("[AUTH] Authenticated"),this.isAuthenticated=!0,this.activeSession=this.endpoint.session,null===(e=this.authenticated)||void 0===e||e.emit({authenticated:!0,session:this.endpoint.session})):(console.log("[AUTH] Anonymous"),null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!1,session:null}))}disconnectedCallback(){this.cancelRecheckTimer()}cancelRecheckTimer(){if(this.recheckTimer){try{clearTimeout(this.recheckTimer)}catch(e){}this.recheckTimer=null}if(this.resendDisabledTimer){try{clearTimeout(this.resendDisabledTimer)}catch(e){}this.resendDisabledTimer=null}}handleSignup(){this.submitting=!0,this.accessTokenForVerification=null,o(this.endpoint,{email:this.username,password:this.password,firstName:this.first,lastName:this.last,orgName:this.orgname}).then((e=>{console.log("Result",e),console.log("[AUTH] Created profile",e.profile),console.log("[AUTH] Created organization",e.organization),this.loginAndCheckVerification()})).catch((e=>{var t,i,s,l,o,r;console.log("[AUTH] Signup error",e.response),this.submitting=!1,this.activeSession=null,null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!1,session:null}),null===(i=this.sdkError)||void 0===i||i.emit(new n(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(l=e.response)||void 0===l?void 0:l.data)),a("Signup failed: "+(null===(r=null===(o=e.response)||void 0===o?void 0:o.data)||void 0===r?void 0:r.message)||"Unknown Error",{style:"error"})}))}loginAndCheckVerification(){var e,t;this.submitting=!0,this.accessTokenForVerification=null,(e=this.endpoint,t={username:this.username,password:this.password},e.api.post("/authentication/login",t).then((function(e){return e.data}))).then((e=>{var t;this.cancelRecheckTimer(),this.submitting=!1;const i=s(e.accessToken);console.log("[AUTH] Got access token body",i),(null==i?void 0:i.email_verified)?(console.log("[AUTH] Email address is verified, completing login"),this.displayMode="login",this.accessTokenForVerification=null,this.endpoint.setToken(e.accessToken),this.activeSession=this.endpoint.session,this.isAuthenticated=!0,null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!0,session:this.endpoint.session})):(console.log("[AUTH] Logged in, pending email address verification"),this.displayMode="verify",this.accessTokenForVerification=e.accessToken,this.recheckTimer=setTimeout((()=>this.loginAndCheckVerification()),5e3))})).catch((e=>{var t,i,s,l;this.cancelRecheckTimer(),console.log("[AUTH] Authentication error",e.response,JSON.stringify(e)),this.displayMode="login",this.submitting=!1,this.activeSession=null,null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!1,session:null}),null===(i=this.sdkError)||void 0===i||i.emit(new n(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(l=e.response)||void 0===l?void 0:l.data)),a("Login failed. Please check your username and password and try again.",{style:"error"})}))}handleLogout(){var e;this.endpoint.clearSession(),this.isAuthenticated=!1,this.accessTokenForVerification=null,null===(e=this.authenticated)||void 0===e||e.emit({authenticated:!1,session:null})}handleResend(){var e,t;this.resendDisabled=!0,this.resendDisabledTimer=setTimeout((()=>{this.resendDisabled=!1,this.resendDisabledTimer=null}),3e4),(e=this.endpoint,t=this.accessTokenForVerification,e.api.post("/user/email_verification",{},t?{headers:{Authorization:"Bearer ".concat(t)}}:{}).then((function(e){return e.data}))).then((e=>{console.log("[AUTH] Verification request resent",e),a("Please check your email for a message with verification instructions.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to resend verification",e)}))}handleReset(){var e,t;this.submitting=!0,(e=this.endpoint,t={email:this.username},e.api.post("/user/reset_password",t).then((function(e){return e.data}))).then((e=>{console.log("[AUTH] Reset sent",e),this.submitting=!1,this.displayMode="login",a("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to reset password",e),this.submitting=!1}))}render(){if(!this.visible)return i("div",{style:{display:"none"}},"Authenticated");if(this.isAuthenticated)return i("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:()=>this.handleLogout(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}});if("signup"===this.displayMode){const e=this.submitting||!this.first||!this.last||!this.username||!this.password||!this.orgname;return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Sign up for a trial account"),i("h4",null,"Already have an account?",i("verdocs-button",{label:"Log In",variant:"text",onClick:()=>this.displayMode="login",disabled:this.submitting})),1===this.signupStep&&i("form",{onSubmit:()=>this.handleSignup()},i("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},i("verdocs-text-input",{label:"First Name",autocomplete:"first",required:!0,value:this.first,onInput:e=>this.first=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:!0,value:this.last,onInput:e=>this.last=e.target.value,disabled:this.submitting})),i("verdocs-text-input",{label:"Email",autocomplete:"email",required:!0,value:this.username,onInput:e=>this.username=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Phone #",autocomplete:"phone",value:this.phone,onInput:e=>this.phone=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",required:!0,autocomplete:"current-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:!0,value:this.orgname,onInput:e=>this.orgname=e.target.value,disabled:this.submitting,style:{flex:"1"}}),i("div",{style:{marginTop:"30px"}}),i("verdocs-button",{label:"Next",disabled:e,onClick:()=>this.signupStep=2,style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),2===this.signupStep&&i("form",{onSubmit:()=>this.handleSignup()},i("verdocs-text-input",{label:"How did you hear about Verdocs?",value:this.howHear,onInput:e=>this.howHear=e.target.value,disabled:this.submitting}),i("verdocs-select-input",{label:"Your Industry",options:r,value:this.industry,onInput:e=>this.industry=e.target.value,disabled:this.submitting}),i("verdocs-select-input",{label:"Company Size",options:d,value:this.companySize,onInput:e=>this.companySize=e.target.value,disabled:this.submitting}),i("verdocs-select-input",{label:"Purpose",options:u,value:this.reason,onInput:e=>this.reason=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("verdocs-button",{label:"Create Account",disabled:this.submitting,onClick:()=>this.handleSignup(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),3===this.signupStep&&i("form",{onSubmit:()=>this.handleSignup()},i("p",null,"Please check your e-mail inbox for a verification code and follow the instructions provided."),i("p",null,i("em",null,"Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ",i("a",{href:"#"},"Click Here")," to resend it. Be sure to check your spam folder.")),i("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},i("verdocs-button",{label:"Back",disabled:this.submitting,onClick:()=>{this.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}),i("verdocs-button",{label:"Go to Dashboard",disabled:!0,onClick:()=>this.handleSignup(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}))))}return"forgot"===this.displayMode?i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Forgot your password?"),i("p",null,"Enter your e-mail address below, and reset instructions will be sent to your Inbox."),i("p",null,i("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),i("form",{onSubmit:()=>this.handleSignup()},i("verdocs-text-input",{label:"Email",autocomplete:"email",required:!0,value:this.username,onInput:e=>this.username=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",variant:"outline",disabled:this.submitting,onClick:()=>this.displayMode="login"}),i("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:()=>this.handleReset()})))):"verify"===this.displayMode?i("div",{class:"form"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),i("h3",null,"Please Verify your Email Address"),i("p",null,"Check your e-mail inbox for a verification email, and follow the instructions provided."),i("p",null,i("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),i("div",{class:"buttons"},i("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:()=>{this.username="",this.password="",this.cancelRecheckTimer(),this.displayMode="login"}}),i("verdocs-button",{label:"Resend Email",disabled:this.resendDisabled,onClick:()=>this.handleResend()}))):i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Log in to your account"),i("h4",null,"Don't have an account?",i("verdocs-button",{label:"Sign Up",variant:"text",onClick:()=>{this.displayMode="signup",this.signupStep=1},disabled:this.submitting})),i("form",{onSubmit:()=>this.loginAndCheckVerification()},i("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onInput:e=>this.username=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:()=>this.displayMode="forgot",disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),i("verdocs-button",{label:"Login",disabled:this.submitting,onClick:()=>this.loginAndCheckVerification(),style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))}};h.style='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth h4 verdocs-button button.normal .button-label{padding:0}verdocs-auth .buttons{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}';export{h as verdocs_auth}
|
1
|
+
import{r as e,c as t,h as i}from"./p-14b44491.js";import{d as s}from"./p-05788c2b.js";import{V as l}from"./p-2415be91.js";import{c as o}from"./p-3e607686.js";import{V as a}from"./p-ed416acf.js";import{S as n}from"./p-7a1b2643.js";const r=[{value:"",label:""},{value:"Accounting & Tax",label:"Accounting & Tax"},{value:"Business Services / Consulting",label:"Business Services / Consulting"},{value:"Construction",label:"Construction"},{value:"Education",label:"Education"},{value:"Financial Services",label:"Financial Services"},{value:"Government",label:"Government"},{value:"Healthcare - Health Plans & Payers",label:"Healthcare - Health Plans & Payers"},{value:"Healthcare - Providers",label:"Healthcare - Providers"},{value:"Insurance",label:"Insurance"},{value:"Legal",label:"Legal"},{value:"Life Sciences",label:"Life Sciences"},{value:"Manufacturing",label:"Manufacturing"},{value:"Mortgage",label:"Mortgage"},{value:"Not For Profit",label:"Not For Profit"},{value:"Real Estate - Commercial",label:"Real Estate - Commercial"},{value:"Real Estate - Residential",label:"Real Estate - Residential"},{value:"Retail",label:"Retail"},{value:"Technology",label:"Technology"},{value:"Other",label:"Other"}],u=[{value:"",label:""},{value:"I want to send a document for signature.",label:"I want to send a document for signature."},{value:"I just need to sign a document today.",label:"I just need to sign a document today."},{value:"I'm evaluating it for my business.",label:"I'm evaluating it for my business."},{value:"I'm evaluating it for my personal use.",label:"I'm evaluating it for my personal use."},{value:"I'm a developer building an integration.",label:"I'm a developer building an integration."}],d=[{value:"",label:""},{value:"Solo",label:"Solo"},{value:"2-10",label:"2-10"},{value:"11-50",label:"11-50"},{value:"51-200",label:"51-200"},{value:"201-500",label:"201-500"},{value:"501-1000",label:"501-1000"},{value:"1000+",label:"1000+"}],h=class{constructor(i){e(this,i),this.authenticated=t(this,"authenticated",7),this.sdkError=t(this,"sdkError",7),this.recheckTimer=null,this.resendDisabledTimer=null,this.accessTokenForVerification=null,this.endpoint=l.getDefault(),this.visible=!0,this.logo="https://app.verdocs.com/assets/blue-logo.svg",this.isAuthenticated=!1,this.displayMode="login",this.orgname="",this.first="",this.last="",this.username="",this.phone="",this.password="",this.submitting=!1,this.activeSession=null,this.accountType="org",this.howHear="",this.industry="",this.companySize="",this.reason="",this.signupStep=1,this.resendDisabled=!1,this.checkingOrg=!1}componentWillLoad(){var e,t;this.endpoint.loadSession(),this.endpoint.session?(console.log("[AUTH] Authenticated"),this.isAuthenticated=!0,this.activeSession=this.endpoint.session,null===(e=this.authenticated)||void 0===e||e.emit({authenticated:!0,session:this.endpoint.session})):(console.log("[AUTH] Anonymous"),null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!1,session:null}))}disconnectedCallback(){this.cancelRecheckTimer()}cancelRecheckTimer(){if(this.recheckTimer){try{clearTimeout(this.recheckTimer)}catch(e){}this.recheckTimer=null}if(this.resendDisabledTimer){try{clearTimeout(this.resendDisabledTimer)}catch(e){}this.resendDisabledTimer=null}}handleSignup(){this.submitting=!0,this.accessTokenForVerification=null,o(this.endpoint,{email:this.username,password:this.password,firstName:this.first,lastName:this.last,orgName:this.orgname}).then((e=>{console.log("Result",e),console.log("[AUTH] Created profile",e.profile),console.log("[AUTH] Created organization",e.organization),this.loginAndCheckVerification()})).catch((e=>{var t,i,s,l,o,r;console.log("[AUTH] Signup error",e.response),this.submitting=!1,this.activeSession=null,null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!1,session:null}),null===(i=this.sdkError)||void 0===i||i.emit(new n(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(l=e.response)||void 0===l?void 0:l.data)),a("Signup failed: "+(null===(r=null===(o=e.response)||void 0===o?void 0:o.data)||void 0===r?void 0:r.message)||"Unknown Error",{style:"error"})}))}loginAndCheckVerification(){var e,t;this.submitting=!0,this.accessTokenForVerification=null,(e=this.endpoint,t={username:this.username,password:this.password},e.api.post("/authentication/login",t).then((function(e){return e.data}))).then((e=>{var t;this.cancelRecheckTimer(),this.submitting=!1;const i=s(e.accessToken);console.log("[AUTH] Got access token body",i),(null==i?void 0:i.email_verified)?(console.log("[AUTH] Email address is verified, completing login"),this.displayMode="login",this.accessTokenForVerification=null,this.endpoint.setToken(e.accessToken),this.activeSession=this.endpoint.session,this.isAuthenticated=!0,null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!0,session:this.endpoint.session})):(console.log("[AUTH] Logged in, pending email address verification"),this.displayMode="verify",this.accessTokenForVerification=e.accessToken,this.recheckTimer=setTimeout((()=>this.loginAndCheckVerification()),5e3))})).catch((e=>{var t,i,s,l;this.cancelRecheckTimer(),console.log("[AUTH] Authentication error",e.response,JSON.stringify(e)),this.displayMode="login",this.submitting=!1,this.activeSession=null,null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!1,session:null}),null===(i=this.sdkError)||void 0===i||i.emit(new n(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(l=e.response)||void 0===l?void 0:l.data)),a("Login failed. Please check your username and password and try again.",{style:"error"})}))}handleLogout(){var e;this.endpoint.clearSession(),this.isAuthenticated=!1,this.accessTokenForVerification=null,null===(e=this.authenticated)||void 0===e||e.emit({authenticated:!1,session:null})}handleResend(){var e,t;this.resendDisabled=!0,this.resendDisabledTimer=setTimeout((()=>{this.resendDisabled=!1,this.resendDisabledTimer=null}),3e4),(e=this.endpoint,t=this.accessTokenForVerification,e.api.post("/user/email_verification",{},t?{headers:{Authorization:"Bearer ".concat(t)}}:{}).then((function(e){return e.data}))).then((e=>{console.log("[AUTH] Verification request resent",e),a("Please check your email for a message with verification instructions.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to resend verification",e)}))}handleReset(){var e,t;this.submitting=!0,(e=this.endpoint,t={email:this.username},e.api.post("/user/reset_password",t).then((function(e){return e.data}))).then((e=>{console.log("[AUTH] Reset sent",e),this.submitting=!1,this.displayMode="login",a("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to reset password",e),this.submitting=!1}))}render(){if(!this.visible)return i("div",{style:{display:"none"}},"Authenticated");if(this.isAuthenticated)return i("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:()=>this.handleLogout(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}});if("signup"===this.displayMode){const e=this.submitting||!this.first||!this.last||!this.username||!this.password||!this.orgname;return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Sign up for a trial account"),i("h4",null,"Already have an account?",i("verdocs-button",{label:"Log In",variant:"text",onClick:()=>this.displayMode="login",disabled:this.submitting})),1===this.signupStep&&i("form",{onSubmit:()=>this.handleSignup()},i("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},i("verdocs-text-input",{label:"First Name",autocomplete:"first",required:!0,value:this.first,onInput:e=>this.first=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:!0,value:this.last,onInput:e=>this.last=e.target.value,disabled:this.submitting})),i("verdocs-text-input",{label:"Email",autocomplete:"email",required:!0,value:this.username,onInput:e=>this.username=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Phone #",autocomplete:"phone",value:this.phone,onInput:e=>this.phone=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",required:!0,autocomplete:"current-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:!0,value:this.orgname,onInput:e=>this.orgname=e.target.value,disabled:this.submitting,style:{flex:"1"}}),i("div",{style:{marginTop:"30px"}}),i("verdocs-button",{label:"Next",disabled:e,onClick:()=>this.signupStep=2,style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),2===this.signupStep&&i("form",{onSubmit:()=>this.handleSignup()},i("verdocs-text-input",{label:"How did you hear about Verdocs?",value:this.howHear,onInput:e=>this.howHear=e.target.value,disabled:this.submitting}),i("verdocs-select-input",{label:"Your Industry",options:r,value:this.industry,onInput:e=>this.industry=e.target.value,disabled:this.submitting}),i("verdocs-select-input",{label:"Company Size",options:d,value:this.companySize,onInput:e=>this.companySize=e.target.value,disabled:this.submitting}),i("verdocs-select-input",{label:"Purpose",options:u,value:this.reason,onInput:e=>this.reason=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("verdocs-button",{label:"Create Account",disabled:this.submitting,onClick:()=>this.handleSignup(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),3===this.signupStep&&i("form",{onSubmit:()=>this.handleSignup()},i("p",null,"Please check your e-mail inbox for a verification code and follow the instructions provided."),i("p",null,i("em",null,"Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ",i("a",{href:"#"},"Click Here")," to resend it. Be sure to check your spam folder.")),i("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},i("verdocs-button",{label:"Back",disabled:this.submitting,onClick:()=>{this.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}),i("verdocs-button",{label:"Go to Dashboard",disabled:!0,onClick:()=>this.handleSignup(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}))))}return"forgot"===this.displayMode?i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Forgot your password?"),i("p",null,"Enter your e-mail address below, and reset instructions will be sent to your Inbox."),i("p",null,i("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),i("form",{onSubmit:()=>this.handleSignup()},i("verdocs-text-input",{label:"Email",autocomplete:"email",required:!0,value:this.username,onInput:e=>this.username=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",variant:"outline",disabled:this.submitting,onClick:()=>this.displayMode="login"}),i("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:()=>this.handleReset()})))):"verify"===this.displayMode?i("div",{class:"form"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),i("h3",null,"Please Verify your Email Address"),i("p",null,"Check your e-mail inbox for a verification email, and follow the instructions provided."),i("p",null,i("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),i("div",{class:"buttons"},i("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:()=>{this.username="",this.password="",this.cancelRecheckTimer(),this.displayMode="login"}}),i("verdocs-button",{label:"Resend Email",disabled:this.resendDisabled,onClick:()=>this.handleResend()}))):i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Log in to your account"),i("h4",null,"Don't have an account?",i("verdocs-button",{label:"Sign Up",variant:"text",onClick:()=>{this.displayMode="signup",this.signupStep=1},disabled:this.submitting})),i("form",{onSubmit:()=>this.loginAndCheckVerification()},i("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onInput:e=>this.username=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:()=>this.displayMode="forgot",disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),i("verdocs-button",{label:"Login",disabled:this.submitting,onClick:()=>this.loginAndCheckVerification(),style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))}};h.style='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth h4 verdocs-button button.normal .button-label{padding:0}verdocs-auth .buttons{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}';export{h as verdocs_auth}
|