@verdocs/web-sdk 4.2.127 → 4.2.129

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.
Files changed (47) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js +2 -2
  3. package/dist/cjs/verdocs-kba-dialog_2.cjs.entry.js +3 -2
  4. package/dist/cjs/verdocs-preview_9.cjs.entry.js +13 -12
  5. package/dist/cjs/verdocs-sign.cjs.entry.js +3 -2
  6. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  7. package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +1 -1
  8. package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js +3 -2
  9. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +3 -2
  10. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +3 -2
  11. package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.css +1 -1
  12. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.css +14 -0
  13. package/dist/collection/components/templates/verdocs-template-create/verdocs-template-create.js +29 -10
  14. package/dist/components/verdocs-field-date2.js +1 -1
  15. package/dist/components/verdocs-preview2.js +3 -2
  16. package/dist/components/verdocs-sign.js +3 -2
  17. package/dist/components/verdocs-template-create2.js +13 -11
  18. package/dist/components/verdocs-upload-dialog2.js +1 -1
  19. package/dist/components/verdocs-view2.js +3 -2
  20. package/dist/custom-elements.json +6 -1
  21. package/dist/esm/loader.js +1 -1
  22. package/dist/esm/verdocs-field-attachment_13.entry.js +2 -2
  23. package/dist/esm/verdocs-kba-dialog_2.entry.js +3 -2
  24. package/dist/esm/verdocs-preview_9.entry.js +13 -12
  25. package/dist/esm/verdocs-sign.entry.js +3 -2
  26. package/dist/esm/verdocs-web-sdk.js +1 -1
  27. package/dist/esm-es5/loader.js +1 -1
  28. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  29. package/dist/esm-es5/verdocs-kba-dialog_2.entry.js +1 -1
  30. package/dist/esm-es5/verdocs-preview_9.entry.js +1 -1
  31. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  32. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  33. package/dist/types/components/templates/verdocs-template-create/verdocs-template-create.d.ts +2 -0
  34. package/dist/types/components.d.ts +2 -0
  35. package/dist/verdocs-web-sdk/p-267df026.system.js +1 -1
  36. package/dist/verdocs-web-sdk/p-393c0c21.entry.js +1 -0
  37. package/dist/verdocs-web-sdk/{p-5b5a0ba2.system.entry.js → p-4e6fdce4.system.entry.js} +1 -1
  38. package/dist/verdocs-web-sdk/{p-1cd86ef4.entry.js → p-7244e4e3.entry.js} +1 -1
  39. package/dist/verdocs-web-sdk/p-837551fd.system.entry.js +1 -0
  40. package/dist/verdocs-web-sdk/{p-174325c3.entry.js → p-a33aad57.entry.js} +1 -1
  41. package/dist/verdocs-web-sdk/{p-caaecfc2.system.entry.js → p-bb523ebf.system.entry.js} +1 -1
  42. package/dist/verdocs-web-sdk/{p-40cc1c52.entry.js → p-c6de5539.entry.js} +1 -1
  43. package/dist/verdocs-web-sdk/{p-588d94b5.system.entry.js → p-fa9e69c4.system.entry.js} +1 -1
  44. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  45. package/package.json +2 -2
  46. package/dist/verdocs-web-sdk/p-d879bb87.system.entry.js +0 -1
  47. package/dist/verdocs-web-sdk/p-fc620807.entry.js +0 -1
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,i,o,t){function n(e){return e instanceof o?e:new o((function(i){i(e)}))}return new(o||(o=Promise))((function(o,r){function a(e){try{l(t.next(e))}catch(e){r(e)}}function s(e){try{l(t["throw"](e))}catch(e){r(e)}}function l(e){e.done?o(e.value):n(e.value).then(a,s)}l((t=t.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},t,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(e){return function(i){return l([e,i])}}function l(s){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(t=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:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=i.call(e,o)}catch(e){s=[6,e];n=0}finally{t=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,F as Fragment,H as Host,g as getElement}from"./index-a68c7262.js";import{VerdocsEndpoint,getEnvelope,getDocumentDownloadLink,cancelEnvelope,userCanCancelEnvelope,integerSequence}from"@verdocs/js-sdk";import{s as saveEnvelopesAsZip}from"./utils-6ecd6558.js";import{S as SDKError}from"./errors-887f1e88.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsKbaDialogCss='@-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-kba-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-kba-dialog .dialog{width:440px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#fff;padding:16px;gap:14px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-kba-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-kba-dialog .step{margin-left:6px;color:#666}verdocs-kba-dialog .help-box{background-color:#707ae5;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding:14px;-ms-flex-align:center;align-items:center;color:white}verdocs-kba-dialog .help-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:15px;font-size:14px}verdocs-kba-dialog .help-icon{width:40px;height:40px}verdocs-kba-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-kba-dialog .help-text{font-weight:400}verdocs-kba-dialog .input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:10px;-ms-flex-align:center;align-items:center;margin:16px 0 32px}verdocs-kba-dialog .input label{-ms-flex:0;flex:0;line-height:10px;font-weight:500;white-space:nowrap}verdocs-kba-dialog .input input{-ms-flex:1;flex:1}verdocs-kba-dialog .choices{display:grid;gap:15px;grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));margin:0 0 15px 0}verdocs-kba-dialog .choice{border:1px solid #707ae5;border-radius:5px;display:-ms-flexbox;display:flex;height:60px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center;color:#5c6575;cursor:pointer}verdocs-kba-dialog .choice.selected{background-color:#707ae5;color:#ffffff}verdocs-kba-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-kba-dialog .buttons verdocs-button{margin-left:16px}';var VerdocsKbaDialogStyle0=verdocsKbaDialogCss;var QuestionIcon='<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0C8.95313 0 0 8.95313 0 20C0 31.0469 8.95313 40 20 40C31.0469 40 40 31.0469 40 20C40 8.95313 31.0469 0 20 0ZM20 36.25C11.0391 36.25 3.75 28.9602 3.75 20C3.75 11.0398 11.0391 3.75 20 3.75C28.9609 3.75 36.25 11.0398 36.25 20C36.25 28.9602 28.9609 36.25 20 36.25Z" fill="white"/><path d="M20 26.25C18.5938 26.25 17.5 27.3438 17.5 28.75C17.5 30.1562 18.5234 31.25 20 31.25C21.3359 31.25 22.5 30.1562 22.5 28.75C22.5 27.3438 21.3359 26.25 20 26.25ZM22.5859 10H18.5938C15.5469 10 13.125 12.4219 13.125 15.4688C13.125 16.4844 13.9844 17.3438 15 17.3438C16.0156 17.3438 16.875 16.4844 16.875 15.4688C16.875 14.5312 17.5859 13.75 18.5234 13.75H22.5156C23.5234 13.75 24.375 14.5312 24.375 15.4688C24.375 16.0938 24.0625 16.5703 23.5156 16.8828L19.0625 19.6094C18.4375 20 18.125 20.625 18.125 21.25V22.5C18.125 23.5156 18.9844 24.375 20 24.375C21.0156 24.375 21.875 23.5156 21.875 22.5V22.3438L25.3984 20.1562C27.0391 19.1406 28.0547 17.3438 28.0547 15.4688C28.125 12.4219 25.7031 10 22.5859 10Z" fill="#E7E7E7"/></svg>';var VerdocsKbaDialog=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.step=1;this.steps=3;this.helptitle="Previous Addresses";this.helptext="Please select the address below that you have most recently lived at.";this.mode="choice";this.label="PIN";this.placeholder="Enter your PIN...";this.choices=["553 Arbor Dr","18 Lacey Ln","23A Ball Ct","2375 Cavallo Blvd","23-1 RR-7","151 Boulder Rd"];this.response=""}e.prototype.handleCancel=function(){this.exit.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleCancel()}};e.prototype.handleDone=function(){this.next.emit(this.response)};e.prototype.render=function(){var e=this;return h(Host,{key:"b701c61916561f74950a4f6ea0ea0a13fa61728f"},h("div",{key:"1825ae2f8f73c493a01c59c3e1841a3f9b84e61d",class:"background-overlay",onClick:function(i){return e.handleDismiss(i)}},h("div",{key:"2136fd8cc4b77e8b65d437c551b28f1cfc8bfa9f",class:"dialog"},h("div",{key:"e014b95e040d3689174a58a6c7edd664b05d2c40",class:"heading"},"Confirm Your Identity",this.steps>1?h("span",{class:"step"},"(",this.step,"/",this.steps,")"):h(Fragment,null)),!!this.helptitle&&h("div",{key:"4cf33fb858dff2a041551c6e935fc17c40a751db",class:"help-box"},h("div",{key:"73107418f44702e6107845beaecd79c34586d60e",class:"help-icon",innerHTML:QuestionIcon}),h("div",{key:"c424c9e1df778fdea841c2421154f97bd63a766f",class:"help-details"},h("div",{key:"1e434ef047058786d57104f769bd3dc1a4c73a16",class:"help-title"},this.helptitle),h("div",{key:"6ccc412bc1bdd72bb6cc567e3c01069f5498b2fe",class:"help-text"},this.helptext))),this.mode==="choice"?h("div",{class:"choices"},this.choices.map((function(i){return h("div",{class:"choice ".concat(i===e.response?"selected":""),onClick:function(){return e.response=i}},i)}))):h("div",{class:"input"},h("label",{htmlFor:"verdocs-kba-input"},this.label),h("input",{type:"text",id:"verdocs-kba-input",name:"verdocs-kba-input",placeholder:this.placeholder,value:this.response,onInput:function(i){return e.response=i.target.value}})),h("div",{key:"e616e4fd3a1262148bcd542fe0b770fff4ccd784",class:"buttons"},h("verdocs-button",{key:"c869e469aba34df383a4d81ef3e0fbabebe80f71",label:"Cancel",variant:"outline",onClick:function(){return e.handleCancel()}}),h("verdocs-button",{key:"d5c2bbf5ef881baf3eef9240f328ef0ac0f52422",label:"Done",onClick:function(){return e.handleDone()},disabled:!this.response})))))};return e}();VerdocsKbaDialog.style=VerdocsKbaDialogStyle0;var verdocsViewCss='@-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-view{display:-ms-flexbox;display:flex;overflow:hidden;min-height:600px;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .document{-ms-flex:1;flex:1;width:100%;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;max-width:1200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-view .document .inner{width:100%;max-width:1028px}verdocs-view .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}#verdocs-view-header{width:100%;color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 20px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}@media all and (max-width: 500px){#verdocs-view-header{padding:0 10px}}#verdocs-view-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media all and (max-width: 500px){#verdocs-view-header .inner{padding:0 10px}}#verdocs-view-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-view-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}';var VerdocsViewStyle0=verdocsViewCss;var VerdocsView=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.envelopeUpdated=createEvent(this,"envelopeUpdated",7);this.another=createEvent(this,"another",7);this.view=createEvent(this,"view",7);this.next=createEvent(this,"next",7);this.endpoint=null;this.envelopeId="";this.envelope=null;this.headerTargetId=null;this.canceling=false;this.roleNames=[];this.showCancelDone=false;this.showLoadError=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!this.endpoint){this.endpoint=VerdocsEndpoint.getDefault();this.endpoint.loadSession()}if(!this.envelopeId){console.error("[VIEW] Missing required envelopeId");return[2]}if(!!this.envelope)return[3,4];r.label=1;case 1:r.trys.push([1,3,,4]);console.log("[VIEW] Loading envelope...");t=this;return[4,getEnvelope(this.endpoint,this.envelopeId)];case 2:t.envelope=r.sent();console.log("[VIEW] Loaded envelope",this.envelope);this.roleNames=this.envelope.recipients.map((function(e){return e.role_name}));return[3,4];case 3:n=r.sent();this.showLoadError=true;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(i=n.response)===null||i===void 0?void 0:i.status,(o=n.response)===null||o===void 0?void 0:o.data));return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var i=document.getElementById("verdocs-view-header");if(e&&i){console.log("[VIEW] Moving header");i.remove();e.append(i)}};e.prototype.handlePageRendered=function(e){};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var i,o,t,n,r,a,r;var s=this;return __generator(this,(function(l){switch(l.label){case 0:t=e.detail.id;switch(t){case"cancel":return[3,1];case"print":return[3,2];case"download-attachments":return[3,3];case"download-certificate":return[3,6];case"download-all":return[3,9]}return[3,10];case 1:if(confirm("Are you sure you wish to cancel this envelope? This action cannot be undone.")){this.canceling=true;cancelEnvelope(this.endpoint,this.envelopeId).then((function(e){s.canceling=false;console.log("[VIEW] Envelope canceled",e);return getEnvelope(s.endpoint,s.envelopeId)})).then((function(e){console.log("[VIEW] Loaded new envelope details",e);s.envelope=e})).catch((function(e){var i,o,t;s.canceling=false;console.log("[VIEW] Error canceling envelope",e);(i=s.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(t=e.response)===null||t===void 0?void 0:t.data))}));this.showCancelDone=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"canceled"})}return[3,10];case 2:window.print();(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,10];case 3:n=this.envelope.documents.find((function(e){return e.type==="attachment"}));if(!n)return[3,5];return[4,getDocumentDownloadLink(this.endpoint,this.envelopeId,n.id)];case 4:r=l.sent();window.open(r,"_blank");l.label=5;case 5:return[3,10];case 6:a=this.envelope.documents.find((function(e){return e.type==="certificate"}));if(!a)return[3,8];return[4,getDocumentDownloadLink(this.endpoint,this.envelopeId,a.id)];case 7:r=l.sent();window.open(r,"_blank");l.label=8;case 8:return[3,10];case 9:saveEnvelopesAsZip(this.endpoint,[this.envelope]).then((function(){var e;(e=s.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:s.endpoint,envelope:s.envelope,event:"downloaded"})})).catch((function(e){console.log("Error downloading Zip",e)}));return[3,10];case 10:return[2]}}))}))};e.prototype.render=function(){var e=this;var i;if(this.showLoadError){return h(Host,null,h("verdocs-ok-dialog",{heading:"Unable to View Envelope",message:"Sorry, that envelope is not valid.",buttonLabel:"OK",onNext:function(){e.showLoadError=false}}))}if(!this.envelope){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"}))}var o=[{id:"print",label:"Print"}];if(userCanCancelEnvelope(this.endpoint.profile,this.envelope)){o.push({id:"cancel",label:"Cancel"})}var t=this.envelope.documents.length>0;var n=this.envelope.documents.filter((function(e){return e.type==="attachment"})).length;var r=this.envelope.documents.find((function(e){return e.type==="certificate"}))!==undefined;if(t||r){o.push({label:""});if(t){o.push({id:"download-attachments",label:n>1?"Download Documents":"Download Document"})}if(r){o.push({id:"download-certificate",label:"Download Certificate"})}if(t&&r){o.push({id:"download-all",label:"Download All Files"})}}return h(Host,null,h("div",{id:"verdocs-view-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name),h("div",{style:{flex:"1"}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:o,onOptionSelected:function(i){return e.handleOptionSelected(i)}}))),h("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(((i=this.envelope)===null||i===void 0?void 0:i.documents)||[]).filter((function(e){return e.type!=="certificate"})).map((function(i){var o=integerSequence(1,i.pages);return h(Fragment,null,o.map((function(o){var t=i.page_sizes[o];return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:i.id,endpoint:e.endpoint,type:"filled",virtualWidth:(t===null||t===void 0?void 0:t.width)||612,virtualHeight:(t===null||t===void 0?void 0:t.height)||792,pageNumber:o,onPageRendered:function(i){return e.handlePageRendered(i)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showCancelDone&&h("verdocs-ok-dialog",{heading:"Cancelled",message:"This envelope has been cancelled successfully.",onNext:function(){e.showCancelDone=false}}),this.canceling&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsView.style=VerdocsViewStyle0;export{VerdocsKbaDialog as verdocs_kba_dialog,VerdocsView as verdocs_view};
1
+ var __awaiter=this&&this.__awaiter||function(e,i,o,t){function n(e){return e instanceof o?e:new o((function(i){i(e)}))}return new(o||(o=Promise))((function(o,r){function a(e){try{l(t.next(e))}catch(e){r(e)}}function s(e){try{l(t["throw"](e))}catch(e){r(e)}}function l(e){e.done?o(e.value):n(e.value).then(a,s)}l((t=t.apply(e,i||[])).next())}))};var __generator=this&&this.__generator||function(e,i){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},t,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(e){return function(i){return l([e,i])}}function l(s){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(o=0)),o)try{if(t=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:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=i.call(e,o)}catch(e){s=[6,e];n=0}finally{t=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,F as Fragment,H as Host,g as getElement}from"./index-a68c7262.js";import{VerdocsEndpoint,getEnvelope,getDocumentDownloadLink,cancelEnvelope,userCanCancelEnvelope,integerSequence}from"@verdocs/js-sdk";import{s as saveEnvelopesAsZip}from"./utils-6ecd6558.js";import{S as SDKError}from"./errors-887f1e88.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-95d86a44.js";import"./format-b8602175.js";var verdocsKbaDialogCss='@-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-kba-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-kba-dialog .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:rgba(0, 0, 0, 0.4980392157)}verdocs-kba-dialog .dialog{width:440px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#fff;padding:16px;gap:14px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-kba-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-size:20px;font-weight:500}verdocs-kba-dialog .step{margin-left:6px;color:#666}verdocs-kba-dialog .help-box{background-color:#707ae5;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding:14px;-ms-flex-align:center;align-items:center;color:white}verdocs-kba-dialog .help-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:15px;font-size:14px}verdocs-kba-dialog .help-icon{width:40px;height:40px}verdocs-kba-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-kba-dialog .help-text{font-weight:400}verdocs-kba-dialog .input{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:10px;-ms-flex-align:center;align-items:center;margin:16px 0 32px}verdocs-kba-dialog .input label{-ms-flex:0;flex:0;line-height:10px;font-weight:500;white-space:nowrap}verdocs-kba-dialog .input input{-ms-flex:1;flex:1}verdocs-kba-dialog .choices{display:grid;gap:15px;grid-template-columns:repeat(auto-fill, minmax(100px, 1fr));margin:0 0 15px 0}verdocs-kba-dialog .choice{border:1px solid #707ae5;border-radius:5px;display:-ms-flexbox;display:flex;height:60px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center;color:#5c6575;cursor:pointer}verdocs-kba-dialog .choice.selected{background-color:#707ae5;color:#ffffff}verdocs-kba-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-kba-dialog .buttons verdocs-button{margin-left:16px}';var VerdocsKbaDialogStyle0=verdocsKbaDialogCss;var QuestionIcon='<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20 0C8.95313 0 0 8.95313 0 20C0 31.0469 8.95313 40 20 40C31.0469 40 40 31.0469 40 20C40 8.95313 31.0469 0 20 0ZM20 36.25C11.0391 36.25 3.75 28.9602 3.75 20C3.75 11.0398 11.0391 3.75 20 3.75C28.9609 3.75 36.25 11.0398 36.25 20C36.25 28.9602 28.9609 36.25 20 36.25Z" fill="white"/><path d="M20 26.25C18.5938 26.25 17.5 27.3438 17.5 28.75C17.5 30.1562 18.5234 31.25 20 31.25C21.3359 31.25 22.5 30.1562 22.5 28.75C22.5 27.3438 21.3359 26.25 20 26.25ZM22.5859 10H18.5938C15.5469 10 13.125 12.4219 13.125 15.4688C13.125 16.4844 13.9844 17.3438 15 17.3438C16.0156 17.3438 16.875 16.4844 16.875 15.4688C16.875 14.5312 17.5859 13.75 18.5234 13.75H22.5156C23.5234 13.75 24.375 14.5312 24.375 15.4688C24.375 16.0938 24.0625 16.5703 23.5156 16.8828L19.0625 19.6094C18.4375 20 18.125 20.625 18.125 21.25V22.5C18.125 23.5156 18.9844 24.375 20 24.375C21.0156 24.375 21.875 23.5156 21.875 22.5V22.3438L25.3984 20.1562C27.0391 19.1406 28.0547 17.3438 28.0547 15.4688C28.125 12.4219 25.7031 10 22.5859 10Z" fill="#E7E7E7"/></svg>';var VerdocsKbaDialog=function(){function e(e){registerInstance(this,e);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.step=1;this.steps=3;this.helptitle="Previous Addresses";this.helptext="Please select the address below that you have most recently lived at.";this.mode="choice";this.label="PIN";this.placeholder="Enter your PIN...";this.choices=["553 Arbor Dr","18 Lacey Ln","23A Ball Ct","2375 Cavallo Blvd","23-1 RR-7","151 Boulder Rd"];this.response=""}e.prototype.handleCancel=function(){this.exit.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleCancel()}};e.prototype.handleDone=function(){this.next.emit(this.response)};e.prototype.render=function(){var e=this;return h(Host,{key:"b701c61916561f74950a4f6ea0ea0a13fa61728f"},h("div",{key:"1825ae2f8f73c493a01c59c3e1841a3f9b84e61d",class:"background-overlay",onClick:function(i){return e.handleDismiss(i)}},h("div",{key:"2136fd8cc4b77e8b65d437c551b28f1cfc8bfa9f",class:"dialog"},h("div",{key:"e014b95e040d3689174a58a6c7edd664b05d2c40",class:"heading"},"Confirm Your Identity",this.steps>1?h("span",{class:"step"},"(",this.step,"/",this.steps,")"):h(Fragment,null)),!!this.helptitle&&h("div",{key:"4cf33fb858dff2a041551c6e935fc17c40a751db",class:"help-box"},h("div",{key:"73107418f44702e6107845beaecd79c34586d60e",class:"help-icon",innerHTML:QuestionIcon}),h("div",{key:"c424c9e1df778fdea841c2421154f97bd63a766f",class:"help-details"},h("div",{key:"1e434ef047058786d57104f769bd3dc1a4c73a16",class:"help-title"},this.helptitle),h("div",{key:"6ccc412bc1bdd72bb6cc567e3c01069f5498b2fe",class:"help-text"},this.helptext))),this.mode==="choice"?h("div",{class:"choices"},this.choices.map((function(i){return h("div",{class:"choice ".concat(i===e.response?"selected":""),onClick:function(){return e.response=i}},i)}))):h("div",{class:"input"},h("label",{htmlFor:"verdocs-kba-input"},this.label),h("input",{type:"text",id:"verdocs-kba-input",name:"verdocs-kba-input",placeholder:this.placeholder,value:this.response,onInput:function(i){return e.response=i.target.value}})),h("div",{key:"e616e4fd3a1262148bcd542fe0b770fff4ccd784",class:"buttons"},h("verdocs-button",{key:"c869e469aba34df383a4d81ef3e0fbabebe80f71",label:"Cancel",variant:"outline",onClick:function(){return e.handleCancel()}}),h("verdocs-button",{key:"d5c2bbf5ef881baf3eef9240f328ef0ac0f52422",label:"Done",onClick:function(){return e.handleDone()},disabled:!this.response})))))};return e}();VerdocsKbaDialog.style=VerdocsKbaDialogStyle0;var verdocsViewCss='@-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-view{display:-ms-flexbox;display:flex;overflow:hidden;min-height:600px;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-view div,verdocs-view canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-view .document{-ms-flex:1;flex:1;width:100%;height:100%;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;max-width:1200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-view .document .inner{width:100%;max-width:1028px}verdocs-view .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}#verdocs-view-header{width:100%;color:#fff;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;padding:0 20px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}@media all and (max-width: 500px){#verdocs-view-header{padding:0 10px}}#verdocs-view-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media all and (max-width: 500px){#verdocs-view-header .inner{padding:0 10px}}#verdocs-view-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-view-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}';var VerdocsViewStyle0=verdocsViewCss;var VerdocsView=function(){function e(e){registerInstance(this,e);this.sdkError=createEvent(this,"sdkError",7);this.envelopeUpdated=createEvent(this,"envelopeUpdated",7);this.another=createEvent(this,"another",7);this.view=createEvent(this,"view",7);this.next=createEvent(this,"next",7);this.endpoint=null;this.envelopeId="";this.envelope=null;this.headerTargetId=null;this.canceling=false;this.roleNames=[];this.showCancelDone=false;this.showLoadError=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,i,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!this.endpoint){this.endpoint=VerdocsEndpoint.getDefault();this.endpoint.loadSession()}if(!this.envelopeId){console.error("[VIEW] Missing required envelopeId");return[2]}if(!!this.envelope)return[3,4];r.label=1;case 1:r.trys.push([1,3,,4]);console.log("[VIEW] Loading envelope...");t=this;return[4,getEnvelope(this.endpoint,this.envelopeId)];case 2:t.envelope=r.sent();console.log("[VIEW] Loaded envelope",this.envelope);this.roleNames=this.envelope.recipients.map((function(e){return e.role_name}));return[3,4];case 3:n=r.sent();this.showLoadError=true;(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(n.message,(i=n.response)===null||i===void 0?void 0:i.status,(o=n.response)===null||o===void 0?void 0:o.data));return[3,4];case 4:return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var i=document.getElementById("verdocs-view-header");if(e&&i){console.log("[VIEW] Moving header");i.remove();e.append(i)}};e.prototype.handlePageRendered=function(e){};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var i,o,t,n,r,a,r;var s=this;return __generator(this,(function(l){switch(l.label){case 0:t=e.detail.id;switch(t){case"cancel":return[3,1];case"print":return[3,2];case"download-attachments":return[3,3];case"download-certificate":return[3,6];case"download-all":return[3,9]}return[3,10];case 1:if(confirm("Are you sure you wish to cancel this envelope? This action cannot be undone.")){this.canceling=true;cancelEnvelope(this.endpoint,this.envelopeId).then((function(e){s.canceling=false;console.log("[VIEW] Envelope canceled",e);return getEnvelope(s.endpoint,s.envelopeId)})).then((function(e){console.log("[VIEW] Loaded new envelope details",e);s.envelope=e})).catch((function(e){var i,o,t;s.canceling=false;console.log("[VIEW] Error canceling envelope",e);(i=s.sdkError)===null||i===void 0?void 0:i.emit(new SDKError(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(t=e.response)===null||t===void 0?void 0:t.data))}));this.showCancelDone=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"canceled"})}return[3,10];case 2:window.print();(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,10];case 3:n=this.envelope.documents.find((function(e){return e.type==="attachment"}));if(!n)return[3,5];return[4,getDocumentDownloadLink(this.endpoint,this.envelopeId,n.id)];case 4:r=l.sent();window.open(r,"_blank");l.label=5;case 5:return[3,10];case 6:a=this.envelope.documents.find((function(e){return e.type==="certificate"}));if(!a)return[3,8];return[4,getDocumentDownloadLink(this.endpoint,this.envelopeId,a.id)];case 7:r=l.sent();window.open(r,"_blank");l.label=8;case 8:return[3,10];case 9:saveEnvelopesAsZip(this.endpoint,[this.envelope]).then((function(){var e;(e=s.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:s.endpoint,envelope:s.envelope,event:"downloaded"})})).catch((function(e){console.log("Error downloading Zip",e)}));return[3,10];case 10:return[2]}}))}))};e.prototype.render=function(){var e=this;var i;if(this.showLoadError){return h(Host,null,h("verdocs-ok-dialog",{heading:"Unable to View Envelope",message:"Sorry, that envelope is not valid.",buttonLabel:"OK",onNext:function(){e.showLoadError=false}}))}if(!this.envelope){return h(Host,null,h("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",style:{width:"612px",height:"792px",boxShadow:"0 0 10px 5px #0000000f",marginTop:"15px"},alt:"Placeholder page"}))}var o=[{id:"print",label:"Print"}];if(userCanCancelEnvelope(this.endpoint.profile,this.envelope)){o.push({id:"cancel",label:"Cancel"})}var t=this.envelope.documents.length>0;var n=this.envelope.documents.filter((function(e){return e.type==="attachment"})).length;var r=this.envelope.documents.find((function(e){return e.type==="certificate"}))!==undefined;if(t||r){o.push({label:""});if(t){o.push({id:"download-attachments",label:n>1?"Download Documents":"Download Document"})}if(r){o.push({id:"download-certificate",label:"Download Certificate"})}if(t&&r){o.push({id:"download-all",label:"Download All Files"})}}return h(Host,null,h("div",{id:"verdocs-view-header"},h("div",{class:"inner"},h("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),h("div",{class:"title"},this.envelope.name),h("div",{style:{flex:"1"}}),h("div",{style:{marginLeft:"10px"}}),h("verdocs-dropdown",{options:o,onOptionSelected:function(i){return e.handleOptionSelected(i)}}))),h("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(((i=this.envelope)===null||i===void 0?void 0:i.documents)||[]).filter((function(e){return e.type!=="certificate"})).map((function(i){var o=integerSequence(1,i.pages);return h(Fragment,null,o.map((function(o){var t;var n=((t=i.page_sizes)===null||t===void 0?void 0:t[o])||{width:612,height:792};return h("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:i.id,endpoint:e.endpoint,type:"filled",virtualWidth:n.width,virtualHeight:n.height,pageNumber:o,onPageRendered:function(i){return e.handlePageRendered(i)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showCancelDone&&h("verdocs-ok-dialog",{heading:"Cancelled",message:"This envelope has been cancelled successfully.",onNext:function(){e.showCancelDone=false}}),this.canceling&&h("div",{class:"loading-indicator"},h("verdocs-loader",null)))};Object.defineProperty(e.prototype,"component",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsView.style=VerdocsViewStyle0;export{VerdocsKbaDialog as verdocs_kba_dialog,VerdocsView as verdocs_view};