@verdocs/web-sdk 4.2.1 → 4.2.11
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-activity-box.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +30 -57
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +12 -10
- package/dist/cjs/verdocs-preview_10.cjs.entry.js +10 -5
- package/dist/cjs/verdocs-sign.cjs.entry.js +3 -9
- package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-view.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +33 -65
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +3 -10
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +4 -4
- package/dist/collection/components/envelopes/verdocs-activity-box/verdocs-activity-box.js +4 -4
- package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +13 -11
- package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +4 -9
- package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +2 -2
- package/dist/collection/components/templates/verdocs-template-roles/verdocs-template-roles.js +9 -4
- package/dist/collection/utils/utils.js +1 -1
- package/dist/components/verdocs-activity-box.js +1 -1
- package/dist/components/verdocs-auth.js +37 -75
- package/dist/components/verdocs-envelopes-list.js +13 -11
- package/dist/components/verdocs-sign.js +3 -10
- package/dist/components/verdocs-status-indicator2.js +2 -2
- package/dist/components/verdocs-template-create2.js +2 -2
- package/dist/components/verdocs-template-roles2.js +9 -4
- package/dist/components/verdocs-view2.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-activity-box.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +30 -57
- package/dist/esm/verdocs-envelopes-list.entry.js +13 -11
- package/dist/esm/verdocs-preview_10.entry.js +11 -6
- package/dist/esm/verdocs-sign.entry.js +3 -9
- package/dist/esm/verdocs-status-indicator.entry.js +2 -2
- package/dist/esm/verdocs-view.entry.js +4 -4
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/loader.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-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_10.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/embeds/verdocs-auth/verdocs-auth.d.ts +4 -8
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +0 -1
- package/dist/types/components/envelopes/verdocs-activity-box/verdocs-activity-box.d.ts +3 -3
- package/dist/types/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.d.ts +2 -2
- package/dist/types/components.d.ts +6 -6
- package/dist/types/utils/utils.d.ts +2 -2
- package/dist/verdocs-web-sdk/p-18363901.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-322fa613.system.js +1 -1
- package/dist/verdocs-web-sdk/p-4f90b641.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-51544250.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-8d0807ab.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-a2a0c7b4.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-a7dac539.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-27ab21de.system.entry.js → p-b96e571d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a11d459d.system.entry.js → p-cef88396.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-3dcdaf36.entry.js → p-cf1ae7bf.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d6f6f255.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-ee08c75b.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f0299a13.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-fd2c9b30.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-feddcfe3.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/custom-elements.json +0 -2086
- package/dist/verdocs-web-sdk/p-16beca12.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-203d8ff0.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-413ab8a1.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-61257cb2.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-687c07ad.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-9bef9a21.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-aedcd301.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b6b6f12a.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-dc5ebc7c.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-eb0c78af.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f1d41587.system.entry.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,i,e,o){function n(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function a(t){try{c(o.next(t))}catch(t){r(t)}}function s(t){try{c(o["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):n(t.value).then(a,s)}c((o=o.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return c([t,i])}}function c(s){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(e=0)),e)try{if(o=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=i.call(t,e)}catch(t){s=[6,t];n=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-b89cf6a4.js";import{VerdocsEndpoint,getEnvelopesSummary,integerSequence,formatShortTimeAgo}from"@verdocs/js-sdk";import{S as SDKError}from"./errors-887f1e88.js";var verdocsActivityBoxCss='@-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-activity-box{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:18px;min-width:300px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#33364b;-ms-flex-align:center;align-items:center;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;padding:20px 20px 8px 20px}verdocs-activity-box .box-title{width:100%;display:-ms-flexbox;display:flex;color:#33364b;font-size:20px;font-weight:600;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin:0 0 20px 0;-ms-flex-align:center;align-items:center}verdocs-activity-box .box-title .count{margin:0 0 0 6px;font-weight:300}verdocs-activity-box .box-title verdocs-loader{margin:0 0 20px 0}@media screen and (max-width: 1200px){verdocs-activity-box .box-title{font-size:18px}verdocs-activity-box .box-title .count{display:none}}verdocs-activity-box .spacer{-ms-flex:1;flex:1}verdocs-activity-box .loading-placeholder{width:100%;height:62px;display:block;-ms-flex:0 0 62px;flex:0 0 62px;margin:0 0 10px 0;border-radius:6px;background-color:#f5f8f9}verdocs-activity-box .loading-placeholder .loading-placeholder-bg{height:62px;position:relative;background:#f5f8f9;-webkit-animation-duration:1.25s;animation-duration:1.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:loadingPlaceholderSwoop;animation-name:loadingPlaceholderSwoop;background:-webkit-gradient(linear, left top, right top, color-stop(10%, #f5f8f9), color-stop(18%, #eeeeee), color-stop(33%, #f5f8f9));background:linear-gradient(to right, #f5f8f9 10%, #eeeeee 18%, #f5f8f9 33%);background-size:800px 62px}verdocs-activity-box .activity-entry{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 62px;flex:0 0 62px;border-radius:6px;margin-bottom:10px;-ms-flex-direction:row;flex-direction:row;padding:0 16px 0 0;background:#f5f8f9;-ms-flex-align:center;align-items:center;border:1px solid #f5f8f9}verdocs-activity-box .activity-entry:hover{cursor:pointer;background:#f2f4f5;border:1px solid #ddd}verdocs-activity-box .activity-entry svg{width:32px;height:32px;margin-right:20px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry svg{width:24px;height:24px;margin-right:15px}}verdocs-activity-box .activity-entry .title{-ms-flex:1;flex:1;color:black;font-size:16px;font-weight:500;margin-left:12px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .title{font-size:14px}}verdocs-activity-box .activity-entry .time-ago{height:24px;display:-ms-flexbox;display:flex;-ms-flex:0 0 24px;flex:0 0 24px;color:#7f8e92;font-size:16px;font-weight:500;padding-left:14px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-left:1px solid #d8e3e6}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .time-ago{font-size:14px}}@-webkit-keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}@keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}';var VerdocsActivityBoxStyle0=verdocsActivityBoxCss;var EmptyImage="https://verdocs-public-assets.s3.amazonaws.com/no-verdocs.png";var VerdocsActivityBox=function(){function t(t){registerInstance(this,t);this.sdkError=createEvent(this,"sdkError",7);this.viewEnvelope=createEvent(this,"viewEnvelope",7);this.viewAll=createEvent(this,"viewAll",7);this.endpoint=VerdocsEndpoint.getDefault();this.items=5;this.view=undefined;this.header=undefined;this.title="";this.count=0;this.loading=true;this.entries=[]}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[ACTIVITIES] Must be authenticated");return[2]}this.loadActivity()}catch(o){console.log("[ACTIVITIES] Error with preview session",o);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(o.message,(i=o.response)===null||i===void 0?void 0:i.status,(e=o.response)===null||e===void 0?void 0:e.data))}return[2]}))}))};t.prototype.handleItemsUpdated=function(){return this.loadActivity()};t.prototype.handleViewUpdated=function(){return this.loadActivity()};t.prototype.loadActivity=function(){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(e){switch(e.label){case 0:this.loading=true;return[4,getEnvelopesSummary(this.endpoint,0)];case 1:t=e.sent();if(this.view==="action"){i="Action Required";this.entries=t.action_required.result;this.count=t.action_required.total}else if(this.view==="waiting"){i="Waiting on Others";this.entries=t.waiting_others.result;this.count=t.waiting_others.total}else if(this.view==="completed"){i="Completed";this.entries=t.completed.result;this.count=t.completed.total}this.title=this.header!==undefined?this.header:i;this.loading=false;return[2]}}))}))};t.prototype.render=function(){var t=this;if(this.loading){return h(Host,{style:{minHeight:"300px"}},this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(0)")),integerSequence(0,this.items).map((function(){return h("div",{class:"loading-placeholder"},h("div",{class:"loading-placeholder-bg"}))})))}return h(Host,null,this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(",this.count,")"),h("div",{class:"spacer"}),h("verdocs-button",{label:"View All",size:"small",onClick:function(){var i;return(i=t.viewAll)===null||i===void 0?void 0:i.emit({endpoint:t.endpoint,view:t.view})}})),this.count>0?this.entries.slice(0,Math.max(this.items,1)).map((function(i){return h("div",{class:"activity-entry",onClick:function(){var e;(e=t.viewEnvelope)===null||e===void 0?void 0:e.emit({endpoint:t.endpoint,entry:i})}},h("div",{class:"title"},i.name
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,i,e,o){function n(t){return t instanceof e?t:new e((function(i){i(t)}))}return new(e||(e=Promise))((function(e,r){function a(t){try{c(o.next(t))}catch(t){r(t)}}function s(t){try{c(o["throw"](t))}catch(t){r(t)}}function c(t){t.done?e(t.value):n(t.value).then(a,s)}c((o=o.apply(t,i||[])).next())}))};var __generator=this&&this.__generator||function(t,i){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,n,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(t){return function(i){return c([t,i])}}function c(s){if(o)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(e=0)),e)try{if(o=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=i.call(t,e)}catch(t){s=[6,t];n=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-b89cf6a4.js";import{VerdocsEndpoint,getEnvelopesSummary,integerSequence,formatShortTimeAgo}from"@verdocs/js-sdk";import{S as SDKError}from"./errors-887f1e88.js";var verdocsActivityBoxCss='@-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-activity-box{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:18px;min-width:300px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#33364b;-ms-flex-align:center;align-items:center;border:1px solid #ccc;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif;background:#ffffff;padding:20px 20px 8px 20px}verdocs-activity-box .box-title{width:100%;display:-ms-flexbox;display:flex;color:#33364b;font-size:20px;font-weight:600;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin:0 0 20px 0;-ms-flex-align:center;align-items:center}verdocs-activity-box .box-title .count{margin:0 0 0 6px;font-weight:300}verdocs-activity-box .box-title verdocs-loader{margin:0 0 20px 0}@media screen and (max-width: 1200px){verdocs-activity-box .box-title{font-size:18px}verdocs-activity-box .box-title .count{display:none}}verdocs-activity-box .spacer{-ms-flex:1;flex:1}verdocs-activity-box .loading-placeholder{width:100%;height:62px;display:block;-ms-flex:0 0 62px;flex:0 0 62px;margin:0 0 10px 0;border-radius:6px;background-color:#f5f8f9}verdocs-activity-box .loading-placeholder .loading-placeholder-bg{height:62px;position:relative;background:#f5f8f9;-webkit-animation-duration:1.25s;animation-duration:1.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:loadingPlaceholderSwoop;animation-name:loadingPlaceholderSwoop;background:-webkit-gradient(linear, left top, right top, color-stop(10%, #f5f8f9), color-stop(18%, #eeeeee), color-stop(33%, #f5f8f9));background:linear-gradient(to right, #f5f8f9 10%, #eeeeee 18%, #f5f8f9 33%);background-size:800px 62px}verdocs-activity-box .activity-entry{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 62px;flex:0 0 62px;border-radius:6px;margin-bottom:10px;-ms-flex-direction:row;flex-direction:row;padding:0 16px 0 0;background:#f5f8f9;-ms-flex-align:center;align-items:center;border:1px solid #f5f8f9}verdocs-activity-box .activity-entry:hover{cursor:pointer;background:#f2f4f5;border:1px solid #ddd}verdocs-activity-box .activity-entry svg{width:32px;height:32px;margin-right:20px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry svg{width:24px;height:24px;margin-right:15px}}verdocs-activity-box .activity-entry .title{-ms-flex:1;flex:1;color:black;font-size:16px;font-weight:500;margin-left:12px}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .title{font-size:14px}}verdocs-activity-box .activity-entry .time-ago{height:24px;display:-ms-flexbox;display:flex;-ms-flex:0 0 24px;flex:0 0 24px;color:#7f8e92;font-size:16px;font-weight:500;padding-left:14px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-left:1px solid #d8e3e6}@media screen and (max-width: 1300px){verdocs-activity-box .activity-entry .time-ago{font-size:14px}}@-webkit-keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}@keyframes loadingPlaceholderSwoop{0%{background-position:-468px 0}100%{background-position:468px 0}}';var VerdocsActivityBoxStyle0=verdocsActivityBoxCss;var EmptyImage="https://verdocs-public-assets.s3.amazonaws.com/no-verdocs.png";var VerdocsActivityBox=function(){function t(t){registerInstance(this,t);this.sdkError=createEvent(this,"sdkError",7);this.viewEnvelope=createEvent(this,"viewEnvelope",7);this.viewAll=createEvent(this,"viewAll",7);this.endpoint=VerdocsEndpoint.getDefault();this.items=5;this.view=undefined;this.header=undefined;this.title="";this.count=0;this.loading=true;this.entries=[]}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t,i,e;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[ACTIVITIES] Must be authenticated");return[2]}this.loadActivity()}catch(o){console.log("[ACTIVITIES] Error with preview session",o);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new SDKError(o.message,(i=o.response)===null||i===void 0?void 0:i.status,(e=o.response)===null||e===void 0?void 0:e.data))}return[2]}))}))};t.prototype.handleItemsUpdated=function(){return this.loadActivity()};t.prototype.handleViewUpdated=function(){return this.loadActivity()};t.prototype.loadActivity=function(){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(e){switch(e.label){case 0:this.loading=true;return[4,getEnvelopesSummary(this.endpoint,0)];case 1:t=e.sent();if(this.view==="action"){i="Action Required";this.entries=t.action_required.result;this.count=t.action_required.total}else if(this.view==="waiting"){i="Waiting on Others";this.entries=t.waiting_others.result;this.count=t.waiting_others.total}else if(this.view==="completed"){i="Completed";this.entries=t.completed.result;this.count=t.completed.total}this.title=this.header!==undefined?this.header:i;this.loading=false;return[2]}}))}))};t.prototype.render=function(){var t=this;if(this.loading){return h(Host,{style:{minHeight:"300px"}},this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(0)")),integerSequence(0,this.items).map((function(){return h("div",{class:"loading-placeholder"},h("div",{class:"loading-placeholder-bg"}))})))}return h(Host,null,this.title&&h("div",{class:"box-title"},this.title," ",h("span",{class:"count"},"(",this.count,")"),h("div",{class:"spacer"}),h("verdocs-button",{label:"View All",size:"small",onClick:function(){var i;return(i=t.viewAll)===null||i===void 0?void 0:i.emit({endpoint:t.endpoint,view:t.view})}})),this.count>0?this.entries.slice(0,Math.max(this.items,1)).map((function(i){return h("div",{class:"activity-entry",onClick:function(){var e;(e=t.viewEnvelope)===null||e===void 0?void 0:e.emit({endpoint:t.endpoint,entry:i})}},h("div",{class:"title"},i.name),h("div",{class:"time-ago"},formatShortTimeAgo(i.updated_at)))})):h("img",{src:EmptyImage,alt:"No documents to show",style:{width:"190px",margin:"0 auto"}}))};Object.defineProperty(t,"watchers",{get:function(){return{items:["handleItemsUpdated"],view:["handleViewUpdated"]}},enumerable:false,configurable:true});return t}();VerdocsActivityBox.style=VerdocsActivityBoxStyle0;export{VerdocsActivityBox as verdocs_activity_box};
|
@@ -1 +1 @@
|
|
1
|
-
import{r as registerInstance,c as createEvent,h}from"./index-b89cf6a4.js";import{VerdocsEndpoint,createProfile,authenticate,decodeAccessTokenBody,resendVerification,resetPassword}from"@verdocs/js-sdk";import{V as VerdocsToast}from"./Toast-b71de686.js";import{S as SDKError}from"./errors-887f1e88.js";var verdocsAuthCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-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}';var VerdocsAuthStyle0=verdocsAuthCss;var RECHECK_INTERVAL=5e3;var Industries=[{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"}];var Reasons=[{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."}];var CompanySizes=[{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+"}];var VerdocsAuth=function(){function e(e){registerInstance(this,e);this.authenticated=createEvent(this,"authenticated",7);this.sdkError=createEvent(this,"sdkError",7);this.recheckTimer=null;this.resendDisabledTimer=null;this.accessTokenForVerification=null;this.endpoint=VerdocsEndpoint.getDefault();this.visible=true;this.logo="https://app.verdocs.com/assets/blue-logo.svg";this.isAuthenticated=false;this.displayMode="login";this.orgname="";this.first="";this.last="";this.username="";this.phone="";this.password="";this.submitting=false;this.activeSession=null;this.accountType="org";this.howHear="";this.industry="";this.companySize="";this.reason="";this.signupStep=1;this.resendDisabled=false;this.checkingOrg=false}e.prototype.componentWillLoad=function(){var e,t;this.endpoint.loadSession();if(this.endpoint.session){console.log("[AUTH] Authenticated");this.isAuthenticated=true;this.activeSession=this.endpoint.session;(e=this.authenticated)===null||e===void 0?void 0:e.emit({authenticated:true,session:this.endpoint.session})}else{console.log("[AUTH] Anonymous");(t=this.authenticated)===null||t===void 0?void 0:t.emit({authenticated:false,session:null})}};e.prototype.disconnectedCallback=function(){this.cancelRecheckTimer()};e.prototype.cancelRecheckTimer=function(){if(this.recheckTimer){try{clearTimeout(this.recheckTimer)}catch(e){}this.recheckTimer=null}if(this.resendDisabledTimer){try{clearTimeout(this.resendDisabledTimer)}catch(e){}this.resendDisabledTimer=null}};e.prototype.handleSignup=function(){var e=this;this.submitting=true;this.accessTokenForVerification=null;createProfile(this.endpoint,{email:this.username,password:this.password,firstName:this.first,lastName:this.last,orgName:this.orgname}).then((function(t){console.log("Result",t);console.log("[AUTH] Created profile",t.profile);console.log("[AUTH] Created organization",t.organization);e.loginAndCheckVerification()})).catch((function(t){var i,o,n,s,l,a;console.log("[AUTH] Signup error",t.response);e.submitting=false;e.activeSession=null;(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:false,session:null});(o=e.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(s=t.response)===null||s===void 0?void 0:s.data));VerdocsToast("Signup failed: "+((a=(l=t.response)===null||l===void 0?void 0:l.data)===null||a===void 0?void 0:a.message)||"Unknown Error",{style:"error"})}))};e.prototype.loginAndCheckVerification=function(){var e=this;this.submitting=true;this.accessTokenForVerification=null;authenticate(this.endpoint,{username:this.username,password:this.password,grant_type:"password"}).then((function(t){var i;e.cancelRecheckTimer();e.submitting=false;var o=decodeAccessTokenBody(t.access_token);console.log("[AUTH] Got access token body",o);if(o===null||o===void 0?void 0:o.email_verified){console.log("[AUTH] Email address is verified, completing login");e.displayMode="login";e.accessTokenForVerification=null;e.endpoint.setToken(t.access_token);e.activeSession=e.endpoint.session;e.isAuthenticated=true;(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:true,session:e.endpoint.session})}else{console.log("[AUTH] Logged in, pending email address verification");e.displayMode="verify";e.accessTokenForVerification=t.access_token;e.recheckTimer=setTimeout((function(){return e.loginAndCheckVerification()}),RECHECK_INTERVAL)}})).catch((function(t){var i,o,n,s;e.cancelRecheckTimer();console.log("[AUTH] Authentication error",t.response,JSON.stringify(t));e.displayMode="login";e.submitting=false;e.activeSession=null;(i=e.authenticated)===null||i===void 0?void 0:i.emit({authenticated:false,session:null});(o=e.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(s=t.response)===null||s===void 0?void 0:s.data));VerdocsToast("Login failed. Please check your username and password and try again.",{style:"error"})}))};e.prototype.handleLogout=function(){var e;this.endpoint.clearSession();this.isAuthenticated=false;this.accessTokenForVerification=null;(e=this.authenticated)===null||e===void 0?void 0:e.emit({authenticated:false,session:null})};e.prototype.handleResend=function(){var e=this;this.resendDisabled=true;this.resendDisabledTimer=setTimeout((function(){e.resendDisabled=false;e.resendDisabledTimer=null}),3e4);resendVerification(this.endpoint,this.accessTokenForVerification).then((function(e){console.log("[AUTH] Verification request resent",e);VerdocsToast("Please check your email for a message with verification instructions.",{style:"info"})})).catch((function(e){console.log("[AUTH] Unable to resend verification",e)}))};e.prototype.handleReset=function(){var e=this;this.submitting=true;resetPassword(this.endpoint,{email:this.username}).then((function(t){console.log("[AUTH] Reset sent",t);e.submitting=false;e.displayMode="login";VerdocsToast("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"})})).catch((function(t){console.log("[AUTH] Unable to reset password",t);e.submitting=false}))};e.prototype.render=function(){var e=this;if(!this.visible){return h("div",{style:{display:"none"}},"Authenticated")}if(this.isAuthenticated){return h("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:function(){return e.handleLogout()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})}if(this.displayMode==="signup"){var t=this.submitting||!this.first||!this.last||!this.username||!this.password||!this.orgname;return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Sign up for a trial account"),h("h4",null,"Already have an account?",h("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return e.displayMode="login"},disabled:this.submitting})),this.signupStep===1&&h("form",{onSubmit:function(){return e.handleSignup()}},h("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},h("verdocs-text-input",{label:"First Name",autocomplete:"first",required:true,value:this.first,onInput:function(t){return e.first=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:true,value:this.last,onInput:function(t){return e.last=t.target.value},disabled:this.submitting})),h("verdocs-text-input",{label:"Email",autocomplete:"email",required:true,value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Phone #",autocomplete:"phone",value:this.phone,onInput:function(t){return e.phone=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:true,value:this.orgname,onInput:function(t){return e.orgname=t.target.value},disabled:this.submitting,style:{flex:"1"}}),h("div",{style:{marginTop:"30px"}}),h("verdocs-button",{label:"Next",disabled:t,onClick:function(){return e.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),this.signupStep===2&&h("form",{onSubmit:function(){return e.handleSignup()}},h("verdocs-text-input",{label:"How did you hear about Verdocs?",value:this.howHear,onInput:function(t){return e.howHear=t.target.value},disabled:this.submitting}),h("verdocs-select-input",{label:"Your Industry",options:Industries,value:this.industry,onInput:function(t){return e.industry=t.target.value},disabled:this.submitting}),h("verdocs-select-input",{label:"Company Size",options:CompanySizes,value:this.companySize,onInput:function(t){return e.companySize=t.target.value},disabled:this.submitting}),h("verdocs-select-input",{label:"Purpose",options:Reasons,value:this.reason,onInput:function(t){return e.reason=t.target.value},disabled:this.submitting}),h("div",{style:{marginTop:"30px"}}),h("verdocs-button",{label:"Create Account",disabled:this.submitting,onClick:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),this.signupStep===3&&h("form",{onSubmit:function(){return e.handleSignup()}},h("p",null,"Please check your e-mail inbox for a verification code and follow the instructions provided."),h("p",null,h("em",null,"Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ",h("a",{href:"#"},"Click Here")," to resend it. Be sure to check your spam folder.")),h("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},h("verdocs-button",{label:"Back",disabled:this.submitting,onClick:function(){e.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}),h("verdocs-button",{label:"Go to Dashboard",disabled:true,onClick:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}))))}if(this.displayMode==="forgot"){return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Forgot your password?"),h("p",null,"Enter your e-mail address below, and reset instructions will be sent to your Inbox."),h("p",null,h("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),h("form",{onSubmit:function(){return e.handleSignup()}},h("verdocs-text-input",{label:"Email",autocomplete:"email",required:true,value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("div",{style:{marginTop:"30px"}}),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",disabled:this.submitting,onClick:function(){return e.displayMode="login"}}),h("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:function(){return e.handleReset()}}))))}if(this.displayMode==="verify"){return h("div",{class:"form"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),h("h3",null,"Please Verify your Email Address"),h("p",null,"Check your e-mail inbox for a verification email, and follow the instructions provided."),h("p",null,h("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),h("div",{class:"buttons"},h("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:function(){e.username="";e.password="";e.cancelRecheckTimer();e.displayMode="login"}}),h("verdocs-button",{label:"Resend Email",disabled:this.resendDisabled,onClick:function(){return e.handleResend()}})))}return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Log in to your account"),h("h4",null,"Don't have an account?",h("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){e.displayMode="signup";e.signupStep=1},disabled:this.submitting})),h("form",{onSubmit:function(){return e.loginAndCheckVerification()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return e.displayMode="forgot"},disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),h("verdocs-button",{label:"Login",disabled:this.submitting,onClick:function(){return e.loginAndCheckVerification()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))};return e}();VerdocsAuth.style=VerdocsAuthStyle0;export{VerdocsAuth as verdocs_auth};
|
1
|
+
import{r as registerInstance,c as createEvent,h}from"./index-b89cf6a4.js";import{VerdocsEndpoint,createProfile,authenticate,decodeAccessTokenBody,resendVerification,resetPassword}from"@verdocs/js-sdk";import{V as VerdocsToast}from"./Toast-b71de686.js";import{S as SDKError}from"./errors-887f1e88.js";var verdocsAuthCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-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}';var VerdocsAuthStyle0=verdocsAuthCss;var RECHECK_INTERVAL=5e3;var VerdocsAuth=function(){function e(e){registerInstance(this,e);this.authenticated=createEvent(this,"authenticated",7);this.sdkError=createEvent(this,"sdkError",7);this.recheckTimer=null;this.resendDisabledTimer=null;this.accessTokenForVerification=null;this.endpoint=VerdocsEndpoint.getDefault();this.visible=true;this.logo="https://app.verdocs.com/assets/blue-logo.svg";this.isAuthenticated=false;this.displayMode="login";this.org_name="";this.first_name="";this.last_name="";this.username="";this.password="";this.submitting=false;this.activeSession=null;this.accountType="org";this.signupStep=1;this.resendDisabled=false;this.checkingOrg=false}e.prototype.componentWillLoad=function(){var e,t;this.endpoint.loadSession();if(this.endpoint.session){console.log("[AUTH] Authenticated");this.isAuthenticated=true;this.activeSession=this.endpoint.session;(e=this.authenticated)===null||e===void 0?void 0:e.emit({authenticated:true,session:this.endpoint.session})}else{console.log("[AUTH] Anonymous");(t=this.authenticated)===null||t===void 0?void 0:t.emit({authenticated:false,session:null})}};e.prototype.disconnectedCallback=function(){this.cancelRecheckTimer()};e.prototype.cancelRecheckTimer=function(){if(this.recheckTimer){try{clearTimeout(this.recheckTimer)}catch(e){}this.recheckTimer=null}if(this.resendDisabledTimer){try{clearTimeout(this.resendDisabledTimer)}catch(e){}this.resendDisabledTimer=null}};e.prototype.isPasswordComplex=function(e){var t=function(e){return/[A-Z]/.test(e)};var o=function(e){return/[a-z]/.test(e)};var i=function(e){return/[`!@#$%^&*()_\-+=\[\]{};':"\\|,.<>\/?~ ]/.test(e)};var s=0,n=0,r=0;for(var l=0;l<e.length;l++){var a=e.charAt(l);if(t(a))s++;else if(o(a))n++;else if(i(a))r++}return e.length>=8&&n>0&&s>0&&r>0};e.prototype.handleSignup=function(){var e=this;this.submitting=true;this.accessTokenForVerification=null;if(!this.isPasswordComplex(this.password)){window.alert("Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.");return}createProfile(this.endpoint,{email:this.username,password:this.password,first_name:this.first_name,last_name:this.last_name,org_name:this.org_name}).then((function(t){console.log("Profile creation result",t);e.loginAndCheckVerification()})).catch((function(t){var o,i,s,n,r,l;console.log("[AUTH] Signup error",t.response);e.submitting=false;e.activeSession=null;(o=e.authenticated)===null||o===void 0?void 0:o.emit({authenticated:false,session:null});(i=e.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(t.message,(s=t.response)===null||s===void 0?void 0:s.status,(n=t.response)===null||n===void 0?void 0:n.data));VerdocsToast("Signup failed: "+((l=(r=t.response)===null||r===void 0?void 0:r.data)===null||l===void 0?void 0:l.message)||"Unknown Error",{style:"error"})}))};e.prototype.loginAndCheckVerification=function(){var e=this;this.submitting=true;this.accessTokenForVerification=null;authenticate(this.endpoint,{username:this.username,password:this.password,grant_type:"password"}).then((function(t){var o;e.cancelRecheckTimer();e.submitting=false;var i=decodeAccessTokenBody(t.access_token);console.log("[AUTH] Got access token body",i);if(i===null||i===void 0?void 0:i.email_verified){console.log("[AUTH] Email address is verified, completing login");e.displayMode="login";e.accessTokenForVerification=null;e.endpoint.setToken(t.access_token);e.activeSession=e.endpoint.session;e.isAuthenticated=true;(o=e.authenticated)===null||o===void 0?void 0:o.emit({authenticated:true,session:e.endpoint.session})}else{console.log("[AUTH] Logged in, pending email address verification");e.displayMode="verify";e.accessTokenForVerification=t.access_token;e.recheckTimer=setTimeout(e.loginAndCheckVerification,RECHECK_INTERVAL)}})).catch((function(t){var o,i,s,n;e.cancelRecheckTimer();console.log("[AUTH] Authentication error",t.response,JSON.stringify(t));e.displayMode="login";e.submitting=false;e.activeSession=null;(o=e.authenticated)===null||o===void 0?void 0:o.emit({authenticated:false,session:null});(i=e.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(t.message,(s=t.response)===null||s===void 0?void 0:s.status,(n=t.response)===null||n===void 0?void 0:n.data));VerdocsToast("Login failed. Please check your username and password and try again.",{style:"error"})}))};e.prototype.handleLogout=function(){var e;this.endpoint.clearSession();this.isAuthenticated=false;this.accessTokenForVerification=null;(e=this.authenticated)===null||e===void 0?void 0:e.emit({authenticated:false,session:null})};e.prototype.handleResend=function(){var e=this;this.resendDisabled=true;this.resendDisabledTimer=setTimeout((function(){e.resendDisabled=false;e.resendDisabledTimer=null}),3e4);resendVerification(this.endpoint,this.accessTokenForVerification).then((function(e){console.log("[AUTH] Verification request resent",e);VerdocsToast("Please check your email for a message with verification instructions.",{style:"info"})})).catch((function(e){console.log("[AUTH] Unable to resend verification",e)}))};e.prototype.handleReset=function(){var e=this;this.submitting=true;resetPassword(this.endpoint,{email:this.username}).then((function(t){console.log("[AUTH] Reset sent",t);e.submitting=false;e.displayMode="login";VerdocsToast("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"})})).catch((function(t){console.log("[AUTH] Unable to reset password",t);e.submitting=false}))};e.prototype.render=function(){var e=this;if(!this.visible){return h("div",{style:{display:"none"}},"Authenticated")}if(this.isAuthenticated){return h("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:function(){return e.handleLogout()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})}if(this.displayMode==="signup"){var t=this.submitting||!this.first_name||!this.last_name||!this.username||!this.password||!this.org_name;return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Sign up for a free account"),h("h4",null,"Already have an account?",h("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return e.displayMode="login"},disabled:this.submitting})),this.signupStep===1&&h("form",{onSubmit:function(){return e.handleSignup()}},h("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},h("verdocs-text-input",{label:"First Name",autocomplete:"first",required:true,value:this.first_name,onInput:function(t){return e.first_name=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:true,value:this.last_name,onInput:function(t){return e.last_name=t.target.value},disabled:this.submitting})),h("verdocs-text-input",{label:"Email Address",autocomplete:"email",required:true,value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",required:true,autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:true,value:this.org_name,onInput:function(t){return e.org_name=t.target.value},disabled:this.submitting,style:{flex:"1"}}),h("div",{style:{marginTop:"30px"}}),h("verdocs-button",{label:"Next",disabled:t,onClick:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),this.signupStep===3&&h("form",{onSubmit:function(){return e.handleSignup()}},h("p",null,"Please check your e-mail inbox for a verification code and follow the instructions provided."),h("p",null,h("em",null,"Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ",h("a",{href:"#"},"Click Here")," to resend it. Be sure to check your spam folder.")),h("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},h("verdocs-button",{label:"Back",disabled:this.submitting,onClick:function(){e.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}),h("verdocs-button",{label:"Go to Dashboard",disabled:true,onClick:function(){return e.handleSignup()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}))))}if(this.displayMode==="forgot"){return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Forgot your password?"),h("p",null,"Enter your e-mail address below, and reset instructions will be sent to your Inbox."),h("p",null,h("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),h("form",{onSubmit:function(){return e.handleSignup()}},h("verdocs-text-input",{label:"Email",autocomplete:"email",required:true,value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("div",{style:{marginTop:"30px"}}),h("div",{class:"buttons"},h("verdocs-button",{label:"Cancel",variant:"outline",disabled:this.submitting,onClick:function(){return e.displayMode="login"}}),h("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:function(){return e.handleReset()}}))))}if(this.displayMode==="verify"){return h("div",{class:"form"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),h("h3",null,"Please Verify your Email Address"),h("p",null,"Check your e-mail inbox for a verification email, and follow the instructions provided."),h("p",null,h("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),h("div",{class:"buttons"},h("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:function(){e.username="";e.password="";e.cancelRecheckTimer();e.displayMode="login"}}),h("verdocs-button",{label:"Resend Email",disabled:this.resendDisabled,onClick:function(){return e.handleResend()}})))}return h("div",{class:"form"},h("a",{href:"https://verdocs.com/en/"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),h("h3",null,"Log in to your account"),h("h4",null,"Don't have an account?",h("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){e.displayMode="signup";e.signupStep=1},disabled:this.submitting})),h("form",{onSubmit:function(){return e.loginAndCheckVerification()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onInput:function(t){return e.username=t.target.value},disabled:this.submitting}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:function(t){return e.password=t.target.value},disabled:this.submitting}),h("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return e.displayMode="forgot"},disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),h("verdocs-button",{label:"Login",disabled:this.submitting,onClick:function(){return e.loginAndCheckVerification()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))};return e}();VerdocsAuth.style=VerdocsAuthStyle0;export{VerdocsAuth as verdocs_auth};
|
@@ -1 +1 @@
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s))e[s]=n[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,t,i){function s(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i["throw"](e))}catch(e){r(e)}}function l(e){e.done?t(e.value):s(e.value).then(o,a)}l((i=i.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,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(n){return l([e,n])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(t=0)),t)try{if(i=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:t.label++;return{value:a[1],done:false};case 5:t.label++;s=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){t.label=a[1];break}if(a[0]===6&&t.label<r[1]){t.label=r[1];r=a;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(a);break}if(r[2])t.ops.pop();t.trys.pop();continue}a=n.call(e,t)}catch(e){a=[6,e];s=0}finally{i=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,n,t){if(t||arguments.length===2)for(var i=0,s=n.length,r;i<s;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return e.concat(r||Array.prototype.slice.call(n))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-b89cf6a4.js";import{VerdocsEndpoint,listEnvelopes,integerSequence,getRecipientsWithActions,userCanCancelEnvelope,userCanAct,cancelEnvelope}from"@verdocs/js-sdk";import{s as saveEnvelopesAsZip}from"./utils-d1c95309.js";import{V as VerdocsToast}from"./Toast-b71de686.js";import{S as SDKError}from"./errors-887f1e88.js";import"./Types-e4a6eba5.js";import"./index-0329eed3.js";var verdocsEnvelopesListCss='@-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-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';var VerdocsEnvelopesListStyle0=verdocsEnvelopesListCss;var DocumentIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var ViewFilters=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}];var StatusFilters=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}];var SortFilters=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}];var VerdocsEnvelopesList=function(){function e(e){registerInstance(this,e);this.changeView=createEvent(this,"changeView",7);this.changeStatus=createEvent(this,"changeStatus",7);this.changeSort=createEvent(this,"changeSort",7);this.changeMatch=createEvent(this,"changeMatch",7);this.sdkError=createEvent(this,"sdkError",7);this.viewEnvelope=createEvent(this,"viewEnvelope",7);this.finishEnvelope=createEvent(this,"finishEnvelope",7);this.endpoint=VerdocsEndpoint.getDefault();this.view=undefined;this.status="all";this.sort="created_at";this.match="";this.showPagination=true;this.rowsPerPage=10;this.selectedPage=0;this.count=0;this.initiallyLoaded=false;this.loading=true;this.selectedEnvelopes=[];this.envelopes=[]}e.prototype.handleViewUpdated=function(){return this.queryEnvelopes()};e.prototype.handleStatusUpdated=function(){return this.queryEnvelopes()};e.prototype.handleSortUpdated=function(){return this.queryEnvelopes()};e.prototype.handleMatchUpdated=function(){return this.queryEnvelopes()};e.prototype.handlePageUpdated=function(){return this.queryEnvelopes()};e.prototype.componentWillLoad=function(){this.endpoint.onSessionChanged((function(e,n,t){console.log("[ENVELOPES_LIST] onSessionChanged",n,t)}));this.endpoint.loadSession()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.queryEnvelopes()];case 1:e.sent();this.initiallyLoaded=true;return[2]}}))}))};e.prototype.queryEnvelopes=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,t,i,s,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.loading=true;i={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]});break;case"inbox":i=__assign({},i);break;case"sent":i=__assign(__assign({},i),{is_owner:true});break;case"action":i=__assign(__assign({},i),{status:["pending","in progress"]});break;case"waiting":i=__assign(__assign({},i),{is_owner:true,status:["pending","in progress"]});break;case"completed":i=__assign(__assign({},i),{status:["complete"]});break;default:i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]})}if(this.view==="all"){if(this.status!=="all"){i.status=[this.status]}}if(this.match.trim());return[4,listEnvelopes(this.endpoint,i)];case 1:s=o.sent();this.envelopes=s.envelopes;this.count=s.total;this.loading=false;return[3,3];case 2:r=o.sent();this.loading=false;console.log("[ENVELOPES] Error listing envelopes",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(n=r.response)===null||n===void 0?void 0:n.status,(t=r.response)===null||t===void 0?void 0:t.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDownload=function(){var e=this;saveEnvelopesAsZip(this.endpoint,this.selectedEnvelopes).then((function(){e.selectedEnvelopes=[]})).catch((function(e){console.log("[ENVELOPES] Download error",e);VerdocsToast("Download error: "+e.message,{style:"error"})}))};e.prototype.downloadEnvelope=function(e){saveEnvelopesAsZip(this.endpoint,[e]).catch((function(e){console.log("[ENVELOPES] Download error",e);VerdocsToast("Download error: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;return h(Host,{key:"fa39f66d3d2c557bf70bdf51b8232920da5f17c3"},h("div",{key:"88681a60242e65fc5f60546dcedc0b90bb2866ab",class:"header"},h("div",{key:"7e881cff0962a3867776aefb92b8045571fd3537",class:"filter"},h("verdocs-text-input",{key:"a8387f075c6c6f107d46c2879bd2bd557af97838",id:"verdocs-filter-name",value:this.match,clearable:true,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:function(n){var t;e.match=n.target.value.trim();(t=e.changeMatch)===null||t===void 0?void 0:t.emit(e.match)}})),h("verdocs-quick-filter",{key:"70f3794df71c00ab7cd76558ae2661caddd54b53",label:"View",value:this.view,options:ViewFilters,onOptionSelected:function(n){e.view=n.detail.value}}),this.view==="all"&&h("verdocs-quick-filter",{key:"02145f9b41a95655c7456520352ab7395c02a518",label:"Status",value:this.status,options:StatusFilters,onOptionSelected:function(n){e.status=n.detail.value}}),this.view==="all"&&h("verdocs-quick-filter",{key:"271a35272e0ea4e5c079e30a4f61fafca207097f",label:"Sort By",value:this.sort,options:SortFilters,onOptionSelected:function(n){e.sort=n.detail.value}}),this.loading&&h("verdocs-spinner",{key:"4a885f1f7c7513a3941847313a4e41616b3c841c",mode:"dark",size:24}),h("div",{key:"055587fbd6bc0e9aa9c38dc5c067d5d0bd6923a4",style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&h("verdocs-button",{key:"feb763f42c31aebfcd2b74761431212206691b28",label:"Download (".concat(this.selectedEnvelopes.length,")"),onClick:function(){return e.handleDownload()}})),this.envelopes.map((function(n){var t;var i=getRecipientsWithActions(n);var s=userCanCancelEnvelope(e.endpoint.profile,n);var r=i.find((function(n){var t;return n.email===((t=e.endpoint.session)===null||t===void 0?void 0:t.email)||""}));var o=r&&s&&userCanAct(((t=e.endpoint.session)===null||t===void 0?void 0:t.email)||"",i);var a=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!o},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!s}];return h("div",{class:"envelope",key:n.id,onClick:function(){var t;return(t=e.viewEnvelope)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:n})}},h("div",{class:"inner"},h("verdocs-checkbox",{checked:e.selectedEnvelopes.findIndex((function(e){return e.id===n.id}))!==-1,onClick:function(e){return e.stopPropagation()},onInput:function(t){if(t.target.checked){e.selectedEnvelopes=__spreadArray(__spreadArray([],e.selectedEnvelopes,true),[n],false)}else{e.selectedEnvelopes=e.selectedEnvelopes.filter((function(e){return e.id!==n.id}))}}}),h("div",{class:"vert-spacer"}),h("span",{innerHTML:DocumentIcon,class:"envelope-icon"}),h("div",{class:"envelope-name"},n.name,": ",h("div",{class:"envelope-recipients"},n.recipients.map((function(e){return e.full_name})).join(", "))),h("div",{class:"vert-spacer"}),h("verdocs-status-indicator",{envelope:n,style:{width:"125px"}}),h("div",{class:"vert-spacer"}),h("div",{class:"last-modified"},new Date(n.updated_at).toLocaleString()),h("div",{class:"vert-spacer"}),h("verdocs-dropdown",{options:a,onOptionSelected:function(t){var i,s;switch(t.detail.id){case"view":(i=e.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:n});break;case"finish":(s=e.finishEnvelope)===null||s===void 0?void 0:s.emit({endpoint:e.endpoint,envelope:n});break;case"download":e.downloadEnvelope(n);break;case"cancel":if(window.confirm("Are you sure you want to cancel this envelope?")){cancelEnvelope(e.endpoint,n.id).then((function(){return VerdocsToast("Envelope canceled")})).catch((function(e){return VerdocsToast("Unable to cancel envelope: "+e.messabge,{style:"error"})}));e.queryEnvelopes().catch((function(){}))}break}}})))})),!this.initiallyLoaded&&h("div",{key:"19835ba9dbe9c56ef8c45c08f38c537a7c70bebd",style:{width:"100%"}},integerSequence(0,this.rowsPerPage).map((function(){return h("div",{class:"envelope-placeholder"})}))),this.initiallyLoaded&&!this.envelopes.length&&h("div",{key:"5844f2a1576d7c574865c01b3e7af99eb82b4303",class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?h("div",{style:{marginTop:"20px"}},h("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:function(n){e.selectedPage=n.detail.selectedPage}})):h("div",null))};Object.defineProperty(e,"watchers",{get:function(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}},enumerable:false,configurable:true});return e}();VerdocsEnvelopesList.style=VerdocsEnvelopesListStyle0;export{VerdocsEnvelopesList as verdocs_envelopes_list};
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s))e[s]=n[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,t,i){function s(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i["throw"](e))}catch(e){r(e)}}function l(e){e.done?t(e.value):s(e.value).then(o,a)}l((i=i.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,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(n){return l([e,n])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(t=0)),t)try{if(i=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:t.label++;return{value:a[1],done:false};case 5:t.label++;s=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){t.label=a[1];break}if(a[0]===6&&t.label<r[1]){t.label=r[1];r=a;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(a);break}if(r[2])t.ops.pop();t.trys.pop();continue}a=n.call(e,t)}catch(e){a=[6,e];s=0}finally{i=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,n,t){if(t||arguments.length===2)for(var i=0,s=n.length,r;i<s;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return e.concat(r||Array.prototype.slice.call(n))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-b89cf6a4.js";import{VerdocsEndpoint,getEnvelopes,integerSequence,getRecipientsWithActions,userCanCancelEnvelope,userCanAct,cancelEnvelope}from"@verdocs/js-sdk";import{s as saveEnvelopesAsZip}from"./utils-d1c95309.js";import{V as VerdocsToast}from"./Toast-b71de686.js";import{S as SDKError}from"./errors-887f1e88.js";import"./Types-e4a6eba5.js";import"./index-0329eed3.js";var verdocsEnvelopesListCss='@-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-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';var VerdocsEnvelopesListStyle0=verdocsEnvelopesListCss;var DocumentIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var ViewFilters=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}];var StatusFilters=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}];var SortFilters=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}];var VerdocsEnvelopesList=function(){function e(e){registerInstance(this,e);this.changeView=createEvent(this,"changeView",7);this.changeStatus=createEvent(this,"changeStatus",7);this.changeSort=createEvent(this,"changeSort",7);this.changeMatch=createEvent(this,"changeMatch",7);this.sdkError=createEvent(this,"sdkError",7);this.viewEnvelope=createEvent(this,"viewEnvelope",7);this.finishEnvelope=createEvent(this,"finishEnvelope",7);this.endpoint=VerdocsEndpoint.getDefault();this.view=undefined;this.status="all";this.sort="created_at";this.match="";this.showPagination=true;this.rowsPerPage=10;this.selectedPage=0;this.count=0;this.initiallyLoaded=false;this.loading=true;this.selectedEnvelopes=[];this.envelopes=[]}e.prototype.handleViewUpdated=function(){return this.queryEnvelopes()};e.prototype.handleStatusUpdated=function(){return this.queryEnvelopes()};e.prototype.handleSortUpdated=function(){return this.queryEnvelopes()};e.prototype.handleMatchUpdated=function(){return this.queryEnvelopes()};e.prototype.handlePageUpdated=function(){return this.queryEnvelopes()};e.prototype.componentWillLoad=function(){this.endpoint.onSessionChanged((function(e,n,t){console.log("[ENVELOPES_LIST] onSessionChanged",n,t)}));this.endpoint.loadSession()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.queryEnvelopes()];case 1:e.sent();this.initiallyLoaded=true;return[2]}}))}))};e.prototype.queryEnvelopes=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,t,i,s,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.loading=true;i={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]});break;case"inbox":i=__assign({},i);break;case"sent":i=__assign({},i);break;case"action":i=__assign(__assign({},i),{status:["pending","in progress"]});break;case"waiting":i=__assign(__assign({},i),{status:["pending","in progress"]});break;case"completed":i=__assign(__assign({},i),{status:["complete"]});break;default:i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]})}if(this.view==="all"){if(this.status!=="all"){i.status=[this.status]}}if(this.match.trim());return[4,getEnvelopes(this.endpoint,i)];case 1:s=o.sent();this.envelopes=s.envelopes;this.count=s.count;this.loading=false;return[3,3];case 2:r=o.sent();this.loading=false;console.log("[ENVELOPES] Error listing envelopes",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(n=r.response)===null||n===void 0?void 0:n.status,(t=r.response)===null||t===void 0?void 0:t.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDownload=function(){var e=this;saveEnvelopesAsZip(this.endpoint,this.selectedEnvelopes).then((function(){e.selectedEnvelopes=[]})).catch((function(e){console.log("[ENVELOPES] Download error",e);VerdocsToast("Download error: "+e.message,{style:"error"})}))};e.prototype.downloadEnvelope=function(e){saveEnvelopesAsZip(this.endpoint,[e]).catch((function(e){console.log("[ENVELOPES] Download error",e);VerdocsToast("Download error: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;return h(Host,{key:"d4376bc5804b00acaf916e9c8b2a7ada6136d815"},h("div",{key:"cc459ff3e86b3ff69f44c0183760cffdcc66ce05",class:"header"},h("div",{key:"0fe7ea1fd4c72069c7769125c1d85f97ccca4c68",class:"filter"},h("verdocs-text-input",{key:"acf0938c03d4cd334c1aa55e7175e1ee32b7b839",id:"verdocs-filter-name",value:this.match,clearable:true,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:function(n){var t;e.match=n.target.value.trim();(t=e.changeMatch)===null||t===void 0?void 0:t.emit(e.match)}})),h("verdocs-quick-filter",{key:"3eb1c2303641b9d40d062be7f3cd284d85a964f8",label:"View",value:this.view,options:ViewFilters,onOptionSelected:function(n){e.view=n.detail.value}}),this.view==="all"&&h("verdocs-quick-filter",{key:"eb998a048a18e45f0dc7285ccaebde3e68144197",label:"Status",value:this.status,options:StatusFilters,onOptionSelected:function(n){e.status=n.detail.value}}),this.view==="all"&&h("verdocs-quick-filter",{key:"cd05ac9a66127ccd23bbadb16e5bfa154b2e97c2",label:"Sort By",value:this.sort,options:SortFilters,onOptionSelected:function(n){e.sort=n.detail.value}}),this.loading&&h("verdocs-spinner",{key:"7531bf499f830af651c3b9507ca9bd9dbcbec236",mode:"dark",size:24}),h("div",{key:"43abd416e136338f3c6189e086a461e0f9ba160b",style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&h("verdocs-button",{key:"c54021bbf6ea0bddf03b51f31444c693e25f6a1a",label:"Download (".concat(this.selectedEnvelopes.length,")"),onClick:function(){return e.handleDownload()}})),this.envelopes.map((function(n){var t;var i=getRecipientsWithActions(n);var s=userCanCancelEnvelope(e.endpoint.profile,n);var r=i.find((function(n){var t;return n.email===((t=e.endpoint.session)===null||t===void 0?void 0:t.email)||""}));var o=r&&s&&userCanAct(((t=e.endpoint.session)===null||t===void 0?void 0:t.email)||"",i);var a=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!o},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!s}];return h("div",{class:"envelope",key:n.id,onClick:function(){var t;return(t=e.viewEnvelope)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:n})}},h("div",{class:"inner"},h("verdocs-checkbox",{checked:e.selectedEnvelopes.findIndex((function(e){return e.id===n.id}))!==-1,onClick:function(e){return e.stopPropagation()},onInput:function(t){if(t.target.checked){e.selectedEnvelopes=__spreadArray(__spreadArray([],e.selectedEnvelopes,true),[n],false)}else{e.selectedEnvelopes=e.selectedEnvelopes.filter((function(e){return e.id!==n.id}))}}}),h("div",{class:"vert-spacer"}),h("span",{innerHTML:DocumentIcon,class:"envelope-icon"}),h("div",{class:"envelope-name"},n.name,": ",h("div",{class:"envelope-recipients"},n.recipients.map((function(e){return e.full_name})).join(", "))),h("div",{class:"vert-spacer"}),h("verdocs-status-indicator",{envelope:n,style:{width:"125px"}}),h("div",{class:"vert-spacer"}),h("div",{class:"last-modified"},new Date(n.updated_at).toLocaleString()),h("div",{class:"vert-spacer"}),h("verdocs-dropdown",{options:a,onOptionSelected:function(t){var i,s;switch(t.detail.id){case"view":(i=e.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:n});break;case"finish":(s=e.finishEnvelope)===null||s===void 0?void 0:s.emit({endpoint:e.endpoint,envelope:n});break;case"download":e.downloadEnvelope(n);break;case"cancel":if(window.confirm("Are you sure you want to cancel this envelope?")){cancelEnvelope(e.endpoint,n.id).then((function(){return VerdocsToast("Envelope canceled")})).catch((function(e){return VerdocsToast("Unable to cancel envelope: "+e.messabge,{style:"error"})}));e.queryEnvelopes().catch((function(){}))}break}}})))})),!this.initiallyLoaded&&h("div",{key:"7d72106e9315ef78e1e310da22744126599b8017",style:{width:"100%"}},integerSequence(0,this.rowsPerPage).map((function(){return h("div",{class:"envelope-placeholder"})}))),this.initiallyLoaded&&!this.envelopes.length&&h("div",{key:"b2228f90e7414cace475ab71854a690112b696b3",class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?h("div",{style:{marginTop:"20px"}},h("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:function(n){e.selectedPage=n.detail.selectedPage}})):h("div",null))};Object.defineProperty(e,"watchers",{get:function(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}},enumerable:false,configurable:true});return e}();VerdocsEnvelopesList.style=VerdocsEnvelopesListStyle0;export{VerdocsEnvelopesList as verdocs_envelopes_list};
|