@verdocs/web-sdk 6.0.3 → 6.0.4

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 (114) hide show
  1. package/dist/cjs/{utils-DCB8q98B.js → utils-BXqLrKQZ.js} +3 -2
  2. package/dist/cjs/utils-BXqLrKQZ.js.map +1 -0
  3. package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-delegate-dialog_5.cjs.entry.js +1 -1
  5. package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-preview_7.cjs.entry.js +1 -1
  9. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  11. package/dist/collection/utils/utils.js +1 -0
  12. package/dist/collection/utils/utils.js.map +1 -1
  13. package/dist/components/{p-BrTXDUMP.js → p-BHeendgg.js} +3 -3
  14. package/dist/components/{p-BrTXDUMP.js.map → p-BHeendgg.js.map} +1 -1
  15. package/dist/components/{p-B3z65DlW.js → p-CAJEh6K0.js} +4 -4
  16. package/dist/components/{p-B3z65DlW.js.map → p-CAJEh6K0.js.map} +1 -1
  17. package/dist/components/{p-D9UxTdE4.js → p-CDDk2TOh.js} +4 -4
  18. package/dist/components/{p-D9UxTdE4.js.map → p-CDDk2TOh.js.map} +1 -1
  19. package/dist/components/{p-Flyk-mjn.js → p-CNvRd0Kp.js} +3 -3
  20. package/dist/components/{p-Flyk-mjn.js.map → p-CNvRd0Kp.js.map} +1 -1
  21. package/dist/components/{p-pTXj30z_.js → p-CSQjgm9n.js} +3 -3
  22. package/dist/components/{p-pTXj30z_.js.map → p-CSQjgm9n.js.map} +1 -1
  23. package/dist/components/{p-xS2v_6o_.js → p-CSpoYxdI.js} +3 -3
  24. package/dist/components/{p-xS2v_6o_.js.map → p-CSpoYxdI.js.map} +1 -1
  25. package/dist/components/{p-Bhib7RyH.js → p-DmXt1ckc.js} +3 -3
  26. package/dist/components/{p-Bhib7RyH.js.map → p-DmXt1ckc.js.map} +1 -1
  27. package/dist/components/{p-DnAJsr7Q.js → p-WvXI4EBm.js} +3 -3
  28. package/dist/components/{p-DnAJsr7Q.js.map → p-WvXI4EBm.js.map} +1 -1
  29. package/dist/components/{p-DsBOZHKo.js → p-y2dhcER7.js} +3 -2
  30. package/dist/components/{p-DsBOZHKo.js.map → p-y2dhcER7.js.map} +1 -1
  31. package/dist/components/verdocs-build.js +5 -5
  32. package/dist/components/verdocs-contact-picker.js +1 -1
  33. package/dist/components/verdocs-envelope-document-page.js +1 -1
  34. package/dist/components/verdocs-envelopes-list.js +2 -2
  35. package/dist/components/verdocs-preview.js +1 -1
  36. package/dist/components/verdocs-quick-filter.js +1 -1
  37. package/dist/components/verdocs-send.js +1 -1
  38. package/dist/components/verdocs-sign.js +3 -3
  39. package/dist/components/verdocs-template-document-page.js +1 -1
  40. package/dist/components/verdocs-template-fields.js +1 -1
  41. package/dist/components/verdocs-templates-list.js +1 -1
  42. package/dist/components/verdocs-view.js +1 -1
  43. package/dist/esm/{utils-DmfOx9Ey.js → utils-tbEy96hU.js} +3 -2
  44. package/dist/esm/utils-tbEy96hU.js.map +1 -0
  45. package/dist/esm/verdocs-contact-picker.entry.js +1 -1
  46. package/dist/esm/verdocs-delegate-dialog_5.entry.js +1 -1
  47. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  48. package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
  49. package/dist/esm/verdocs-pagination_2.entry.js +1 -1
  50. package/dist/esm/verdocs-preview_7.entry.js +1 -1
  51. package/dist/esm/verdocs-sign.entry.js +1 -1
  52. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  53. package/dist/esm-es5/{utils-DmfOx9Ey.js → utils-tbEy96hU.js} +1 -1
  54. package/dist/esm-es5/utils-tbEy96hU.js.map +1 -0
  55. package/dist/esm-es5/verdocs-contact-picker.entry.js +2 -2
  56. package/dist/esm-es5/verdocs-delegate-dialog_5.entry.js +1 -1
  57. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  58. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  59. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  60. package/dist/esm-es5/verdocs-preview_7.entry.js +2 -2
  61. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  62. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  63. package/dist/verdocs-web-sdk/{p-92147c8e.entry.js → p-1138cbc8.entry.js} +3 -3
  64. package/dist/verdocs-web-sdk/{p-23d2bebc.system.entry.js → p-1ac2de04.system.entry.js} +2 -2
  65. package/dist/verdocs-web-sdk/{p-dd51c6cf.entry.js → p-21da2b89.entry.js} +3 -3
  66. package/dist/verdocs-web-sdk/{p-3a66ab11.system.entry.js → p-42b32d21.system.entry.js} +2 -2
  67. package/dist/verdocs-web-sdk/{p-baaa811b.entry.js → p-49683659.entry.js} +2 -2
  68. package/dist/verdocs-web-sdk/{p-ceabec49.entry.js → p-6261f76f.entry.js} +2 -2
  69. package/dist/verdocs-web-sdk/{p-9524927b.entry.js → p-664be870.entry.js} +2 -2
  70. package/dist/verdocs-web-sdk/{p-d5f1bffb.entry.js → p-75a43183.entry.js} +2 -2
  71. package/dist/verdocs-web-sdk/{p-fc5c2c45.system.entry.js → p-7a2842d3.system.entry.js} +2 -2
  72. package/dist/verdocs-web-sdk/{p-5f7f20bb.system.entry.js → p-7cb0a86a.system.entry.js} +2 -2
  73. package/dist/verdocs-web-sdk/{p-35d8d17c.system.entry.js → p-8bf7be29.system.entry.js} +3 -3
  74. package/dist/verdocs-web-sdk/{p-nr83qKQ0.system.js.map → p-B2S7Mlv-.system.js.map} +1 -1
  75. package/dist/verdocs-web-sdk/{p-Bu5xpJsB.system.js.map → p-BGP1meB_.system.js.map} +1 -1
  76. package/dist/verdocs-web-sdk/{p-BEywLaeg.system.js.map → p-BskSN54G.system.js.map} +1 -1
  77. package/dist/verdocs-web-sdk/{p-DcCGkiJ-.system.js.map → p-C8jYVW5r.system.js.map} +1 -1
  78. package/dist/verdocs-web-sdk/{p-BscsgV4o.system.js.map → p-CB7Tnry2.system.js.map} +1 -1
  79. package/dist/verdocs-web-sdk/{p-DGdn9mfe.system.js.map → p-CmJ4fTid.system.js.map} +1 -1
  80. package/dist/verdocs-web-sdk/{p-DPhW-51Y.system.js.map → p-CuCpcHZy.system.js.map} +1 -1
  81. package/dist/verdocs-web-sdk/{p-CICLOJJr.system.js.map → p-Dp4d4aXG.system.js.map} +1 -1
  82. package/dist/verdocs-web-sdk/{p-fL0BKEnm.js → p-DvM2ECoi.js} +1 -1
  83. package/dist/verdocs-web-sdk/p-DvM2ECoi.js.map +1 -0
  84. package/dist/verdocs-web-sdk/p-RlE9Yh59.system.js +1 -1
  85. package/dist/verdocs-web-sdk/{p-b4bfad4d.entry.js → p-d94cd03f.entry.js} +2 -2
  86. package/dist/verdocs-web-sdk/{p-f05f021e.entry.js → p-da526fc0.entry.js} +2 -2
  87. package/dist/verdocs-web-sdk/{p-f6598c9b.system.entry.js → p-def666e2.system.entry.js} +2 -2
  88. package/dist/verdocs-web-sdk/{p-2d9b370b.system.entry.js → p-e962f3e2.system.entry.js} +3 -3
  89. package/dist/verdocs-web-sdk/{p-e755e978.system.entry.js → p-ffcb5dbb.system.entry.js} +2 -2
  90. package/dist/verdocs-web-sdk/{p-CD5uiThi.system.js → p-lZ900hhb.system.js} +1 -1
  91. package/dist/verdocs-web-sdk/p-lZ900hhb.system.js.map +1 -0
  92. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  93. package/package.json +2 -2
  94. package/dist/cjs/utils-DCB8q98B.js.map +0 -1
  95. package/dist/esm/utils-DmfOx9Ey.js.map +0 -1
  96. package/dist/esm-es5/utils-DmfOx9Ey.js.map +0 -1
  97. package/dist/verdocs-web-sdk/p-CD5uiThi.system.js.map +0 -1
  98. package/dist/verdocs-web-sdk/p-fL0BKEnm.js.map +0 -1
  99. /package/dist/verdocs-web-sdk/{p-92147c8e.entry.js.map → p-1138cbc8.entry.js.map} +0 -0
  100. /package/dist/verdocs-web-sdk/{p-23d2bebc.system.entry.js.map → p-1ac2de04.system.entry.js.map} +0 -0
  101. /package/dist/verdocs-web-sdk/{p-dd51c6cf.entry.js.map → p-21da2b89.entry.js.map} +0 -0
  102. /package/dist/verdocs-web-sdk/{p-3a66ab11.system.entry.js.map → p-42b32d21.system.entry.js.map} +0 -0
  103. /package/dist/verdocs-web-sdk/{p-baaa811b.entry.js.map → p-49683659.entry.js.map} +0 -0
  104. /package/dist/verdocs-web-sdk/{p-ceabec49.entry.js.map → p-6261f76f.entry.js.map} +0 -0
  105. /package/dist/verdocs-web-sdk/{p-9524927b.entry.js.map → p-664be870.entry.js.map} +0 -0
  106. /package/dist/verdocs-web-sdk/{p-d5f1bffb.entry.js.map → p-75a43183.entry.js.map} +0 -0
  107. /package/dist/verdocs-web-sdk/{p-fc5c2c45.system.entry.js.map → p-7a2842d3.system.entry.js.map} +0 -0
  108. /package/dist/verdocs-web-sdk/{p-5f7f20bb.system.entry.js.map → p-7cb0a86a.system.entry.js.map} +0 -0
  109. /package/dist/verdocs-web-sdk/{p-35d8d17c.system.entry.js.map → p-8bf7be29.system.entry.js.map} +0 -0
  110. /package/dist/verdocs-web-sdk/{p-b4bfad4d.entry.js.map → p-d94cd03f.entry.js.map} +0 -0
  111. /package/dist/verdocs-web-sdk/{p-f05f021e.entry.js.map → p-da526fc0.entry.js.map} +0 -0
  112. /package/dist/verdocs-web-sdk/{p-f6598c9b.system.entry.js.map → p-def666e2.system.entry.js.map} +0 -0
  113. /package/dist/verdocs-web-sdk/{p-2d9b370b.system.entry.js.map → p-e962f3e2.system.entry.js.map} +0 -0
  114. /package/dist/verdocs-web-sdk/{p-e755e978.system.entry.js.map → p-ffcb5dbb.system.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r as e,c as i,h as s,H as o,g as t}from"./p-6vpKbd31.js";import{integerSequence as r}from"@verdocs/js-sdk";import{b as a}from"./p-fL0BKEnm.js";import{c as l}from"./p-BfP9ezJQ.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const n='@-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-pagination{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-pagination .page-button{height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;cursor:pointer;font-size:16px;font-weight:600;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#33364b;border:1px solid #654dcb}verdocs-pagination .page-button svg{width:18px;height:18px}verdocs-pagination .page-button.selected{cursor:default;color:#ffffff;background:#654dcb}verdocs-pagination .ellipsis{width:38px;height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;line-height:32px;-ms-flex-pack:center;justify-content:center;color:#33364b}';const c=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" /></svg>`;const d=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>`;const f=5;const b=({page:e,selected:i,onClick:o})=>{let t;if(e==="first"){t=c}else if(e==="last"){t=d}else{t=String(e+1)}return s("div",{class:`page-button ${e===i?"selected":""}`,onClick:()=>o(e),innerHTML:t})};const p=class a{constructor(s){e(this,s);this.selectPage=i(this,"selectPage");this.selectedPage=0;this.itemCount=1;this.perPage=10}handleSelectPage(e){var i;this.selectedPage=e;(i=this.selectPage)===null||i===void 0?void 0:i.emit({selectedPage:e})}render(){const e=Math.max(0,this.selectedPage-2);const i=this.itemCount>0?Math.ceil(this.itemCount/this.perPage):0;const t=r(0,Math.ceil(this.itemCount/this.perPage)).slice(e,e+f);return s(o,{key:"be5c85f6d219c3589c3ef508e2305cbebea4f320"},this.selectedPage>0&&s(b,{key:"de0c9f90c0af7b77f6d9112c7e2d43978511d0d7",page:"first",selected:this.selectedPage,onClick:()=>this.handleSelectPage(0)}),e>0&&s("div",{key:"f89043de5ca509613e85e3dc00abc8bd3450be6d",class:"ellipsis"},"..."),t.map((e=>s(b,{page:e,selected:this.selectedPage,onClick:e=>this.handleSelectPage(+e)}))),this.selectedPage<i-1&&s("div",{key:"2ddedd7acfab567d550e77bc9471f35114d427de",class:"ellipsis"},"..."),this.selectedPage<i-1&&s(b,{key:"64be509651e68b79bc0f1084eb2e0204d769dfef",page:"last",selected:this.selectedPage,onClick:()=>this.handleSelectPage(i-1)}))}get el(){return t(this)}};p.style=n;const h='@-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-quick-filter{position:relative;font-family:"Inter", "Barlow", sans-serif}verdocs-quick-filter .control{outline:0;height:34px;display:-ms-flexbox;display:flex;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;-webkit-transition:all 100ms ease 0s;transition:all 100ms ease 0s;border:1px solid #cccccc}verdocs-quick-filter .title{padding:0 8px;font-size:14px;max-width:100%;overflow:hidden;color:#33364b;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis}verdocs-quick-filter .title .prefix{display:inline;font-weight:700;margin:0 7px 0 0;color:#4c56cb}verdocs-quick-filter .arrow{width:32px;height:32px;border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#ffffff;-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s}verdocs-quick-filter .arrow svg{-webkit-transition:0.3s;transition:0.3s;fill:#cccccc}verdocs-quick-filter .separator{width:1px;display:block;margin-top:8px;margin-bottom:8px;-ms-flex-item-align:stretch;align-self:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#cccccc}verdocs-quick-filter .items{display:none;z-index:10000;position:absolute;border-radius:4px;background:#ffffff;-webkit-box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px;box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px}verdocs-quick-filter .items[data-show]{display:block}verdocs-quick-filter .option{width:100%;border:none;display:block;font-size:14px;text-align:left;background:none;padding:10px 20px;color:#1e2031}verdocs-quick-filter .option:hover{cursor:pointer;background:rgba(76, 86, 203, 0.2470588235)}verdocs-quick-filter .option[disabled]{color:#aaaaaa}verdocs-quick-filter .option[disabled]:hover{cursor:inherit;background:transparent;color:#aaaaaa}verdocs-quick-filter.open .items{display:block}verdocs-quick-filter.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1)}';const g=`<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-8mmkcg"><path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"></path></svg>`;const u=class{constructor(s){e(this,s);this.optionSelected=i(this,"optionSelected");this.options=[];this.label="Filter";this.value="";this.placeholder="Select...";this.clickListenerSymbol=new AbortController}componentDidLoad(){this.popper=l(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[-1,14]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})}disconnectedCallback(){this.clickListenerSymbol.abort()}clickListener(e){const i=!(e.target==this.el||this.el.contains(e.target));if(i){this.hide()}}handleSelectOption(e,i){e.stopPropagation();this.optionSelected.emit(i);this.value=i.value;this.hide()}showDropdown(){var e,i;this.open=true;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((e=>({...e,modifiers:[...e.modifiers,{name:"eventListeners",enabled:true}]}))).catch((()=>{}));(i=this.popper)===null||i===void 0?void 0:i.update().catch((()=>{}))}handleHideDropdown(e){var i,s;if(((i=e===null||e===void 0?void 0:e.target)===null||i===void 0?void 0:i.localName)==="button"&&((s=e===null||e===void 0?void 0:e.target)===null||s===void 0?void 0:s.className)==="arrow"){return}this.hide()}toggleDropdown(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}}hide(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((e=>({...e,modifiers:[...e.modifiers,{name:"eventListeners",enabled:false}]}))).catch((()=>{}))}render(){var e,i,t;const r=(e=this.options)===null||e===void 0?void 0:e.find((e=>e.value===this.value));const l=(i=this.options)===null||i===void 0?void 0:i.reduce(((e,i)=>e.label.length>i.label.length?e:i));const n=a((l===null||l===void 0?void 0:l.label)||"FILLER","14px Inter, Barlow, sans-serif");const c=a(this.label,"14px Inter, Barlow, sans-serif");const d=`${n+c+40}px`;return s(o,{key:"322a8f4a3843cec17261ac8a20004db1a6a2d8d7",class:{open:!!this.open},style:{minWidth:d,display:"inline-block"}},s("div",{key:"1491f6b3986ccd0764a4dd5bc03ad66fc5d4b7b2",class:"control",onClick:e=>this.toggleDropdown(e),onBlur:e=>this.handleHideDropdown(e)},s("div",{key:"485f1f741ced9c8af1a5eaffffbe87448b3337b4",class:"title",ref:e=>this.dropdownButton=e},s("span",{key:"01aefe07e5802cb69055ac7996fdf1fd1b58d5a5",class:"prefix"},this.label,":"),r?r.label:this.placeholder),s("div",{key:"a5c2a36da359f121a418299018fe6e424f3186b8",style:{flex:"1"}}),s("div",{key:"c1f3ec97d938fe36d90e7047838c67238a4125c4",class:"separator"}),s("div",{key:"86c1ebdabf1b7fcf600f48d3dda1eb33a2184789",class:"arrow",innerHTML:g,"aria-label":"Open Menu"})),s("div",{key:"b4a49186874d81758eee6768f95b136378620439",class:"items","aria-hidden":!this.open,ref:e=>this.dropdownMenu=e,style:{minWidth:d}},(t=this.options)===null||t===void 0?void 0:t.map((e=>e.label?s("button",{onClick:i=>this.handleSelectOption(i,e),class:`option ${e.value===this.value?"selected":""}`,disabled:e.disabled},e.label):s("div",{class:"separator"})))))}get el(){return t(this)}};u.style=h;export{p as verdocs_pagination,u as verdocs_quick_filter};
2
- //# sourceMappingURL=p-9524927b.entry.js.map
1
+ import{r as e,c as i,h as s,H as o,g as t}from"./p-6vpKbd31.js";import{integerSequence as r}from"@verdocs/js-sdk";import{b as a}from"./p-DvM2ECoi.js";import{c as l}from"./p-BfP9ezJQ.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const n='@-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-pagination{gap:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-pagination .page-button{height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;cursor:pointer;font-size:16px;font-weight:600;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:#33364b;border:1px solid #654dcb}verdocs-pagination .page-button svg{width:18px;height:18px}verdocs-pagination .page-button.selected{cursor:default;color:#ffffff;background:#654dcb}verdocs-pagination .ellipsis{width:38px;height:38px;display:-ms-flexbox;display:flex;-ms-flex:0 0 38px;flex:0 0 38px;line-height:32px;-ms-flex-pack:center;justify-content:center;color:#33364b}';const c=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M18.75 19.5l-7.5-7.5 7.5-7.5m-6 15L5.25 12l7.5-7.5" /></svg>`;const d=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 4.5l7.5 7.5-7.5 7.5m-6-15l7.5 7.5-7.5 7.5" /></svg>`;const f=5;const b=({page:e,selected:i,onClick:o})=>{let t;if(e==="first"){t=c}else if(e==="last"){t=d}else{t=String(e+1)}return s("div",{class:`page-button ${e===i?"selected":""}`,onClick:()=>o(e),innerHTML:t})};const p=class a{constructor(s){e(this,s);this.selectPage=i(this,"selectPage");this.selectedPage=0;this.itemCount=1;this.perPage=10}handleSelectPage(e){var i;this.selectedPage=e;(i=this.selectPage)===null||i===void 0?void 0:i.emit({selectedPage:e})}render(){const e=Math.max(0,this.selectedPage-2);const i=this.itemCount>0?Math.ceil(this.itemCount/this.perPage):0;const t=r(0,Math.ceil(this.itemCount/this.perPage)).slice(e,e+f);return s(o,{key:"be5c85f6d219c3589c3ef508e2305cbebea4f320"},this.selectedPage>0&&s(b,{key:"de0c9f90c0af7b77f6d9112c7e2d43978511d0d7",page:"first",selected:this.selectedPage,onClick:()=>this.handleSelectPage(0)}),e>0&&s("div",{key:"f89043de5ca509613e85e3dc00abc8bd3450be6d",class:"ellipsis"},"..."),t.map((e=>s(b,{page:e,selected:this.selectedPage,onClick:e=>this.handleSelectPage(+e)}))),this.selectedPage<i-1&&s("div",{key:"2ddedd7acfab567d550e77bc9471f35114d427de",class:"ellipsis"},"..."),this.selectedPage<i-1&&s(b,{key:"64be509651e68b79bc0f1084eb2e0204d769dfef",page:"last",selected:this.selectedPage,onClick:()=>this.handleSelectPage(i-1)}))}get el(){return t(this)}};p.style=n;const h='@-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-quick-filter{position:relative;font-family:"Inter", "Barlow", sans-serif}verdocs-quick-filter .control{outline:0;height:34px;display:-ms-flexbox;display:flex;cursor:pointer;border-radius:4px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;-webkit-transition:all 100ms ease 0s;transition:all 100ms ease 0s;border:1px solid #cccccc}verdocs-quick-filter .title{padding:0 8px;font-size:14px;max-width:100%;overflow:hidden;color:#33364b;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis}verdocs-quick-filter .title .prefix{display:inline;font-weight:700;margin:0 7px 0 0;color:#4c56cb}verdocs-quick-filter .arrow{width:32px;height:32px;border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#ffffff;-webkit-transition:color 150ms ease 0s;transition:color 150ms ease 0s}verdocs-quick-filter .arrow svg{-webkit-transition:0.3s;transition:0.3s;fill:#cccccc}verdocs-quick-filter .separator{width:1px;display:block;margin-top:8px;margin-bottom:8px;-ms-flex-item-align:stretch;align-self:stretch;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#cccccc}verdocs-quick-filter .items{display:none;z-index:10000;position:absolute;border-radius:4px;background:#ffffff;-webkit-box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px;box-shadow:rgba(0, 0, 0, 0.1) 0 0 0 1px, rgba(0, 0, 0, 0.1) 0 4px 11px}verdocs-quick-filter .items[data-show]{display:block}verdocs-quick-filter .option{width:100%;border:none;display:block;font-size:14px;text-align:left;background:none;padding:10px 20px;color:#1e2031}verdocs-quick-filter .option:hover{cursor:pointer;background:rgba(76, 86, 203, 0.2470588235)}verdocs-quick-filter .option[disabled]{color:#aaaaaa}verdocs-quick-filter .option[disabled]:hover{cursor:inherit;background:transparent;color:#aaaaaa}verdocs-quick-filter.open .items{display:block}verdocs-quick-filter.open .arrow svg{-webkit-transform:scaleY(-1);transform:scaleY(-1)}';const g=`<svg height="20" width="20" viewBox="0 0 20 20" aria-hidden="true" focusable="false" class="css-8mmkcg"><path d="M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"></path></svg>`;const u=class{constructor(s){e(this,s);this.optionSelected=i(this,"optionSelected");this.options=[];this.label="Filter";this.value="";this.placeholder="Select...";this.clickListenerSymbol=new AbortController}componentDidLoad(){this.popper=l(this.dropdownButton,this.dropdownMenu,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[-1,14]}}]});window.addEventListener("click",this.clickListener.bind(this),{signal:this.clickListenerSymbol.signal})}disconnectedCallback(){this.clickListenerSymbol.abort()}clickListener(e){const i=!(e.target==this.el||this.el.contains(e.target));if(i){this.hide()}}handleSelectOption(e,i){e.stopPropagation();this.optionSelected.emit(i);this.value=i.value;this.hide()}showDropdown(){var e,i;this.open=true;this.dropdownMenu.setAttribute("data-show","");this.dropdownMenu.removeAttribute("aria-hidden");(e=this.popper)===null||e===void 0?void 0:e.setOptions((e=>({...e,modifiers:[...e.modifiers,{name:"eventListeners",enabled:true}]}))).catch((()=>{}));(i=this.popper)===null||i===void 0?void 0:i.update().catch((()=>{}))}handleHideDropdown(e){var i,s;if(((i=e===null||e===void 0?void 0:e.target)===null||i===void 0?void 0:i.localName)==="button"&&((s=e===null||e===void 0?void 0:e.target)===null||s===void 0?void 0:s.className)==="arrow"){return}this.hide()}toggleDropdown(e){e.stopPropagation();if(this.open){this.hide()}else{this.showDropdown()}}hide(){var e;this.open=false;this.dropdownMenu.removeAttribute("data-show");this.dropdownMenu.setAttribute("aria-hidden","true");(e=this.popper)===null||e===void 0?void 0:e.setOptions((e=>({...e,modifiers:[...e.modifiers,{name:"eventListeners",enabled:false}]}))).catch((()=>{}))}render(){var e,i,t;const r=(e=this.options)===null||e===void 0?void 0:e.find((e=>e.value===this.value));const l=(i=this.options)===null||i===void 0?void 0:i.reduce(((e,i)=>e.label.length>i.label.length?e:i));const n=a((l===null||l===void 0?void 0:l.label)||"FILLER","14px Inter, Barlow, sans-serif");const c=a(this.label,"14px Inter, Barlow, sans-serif");const d=`${n+c+40}px`;return s(o,{key:"322a8f4a3843cec17261ac8a20004db1a6a2d8d7",class:{open:!!this.open},style:{minWidth:d,display:"inline-block"}},s("div",{key:"1491f6b3986ccd0764a4dd5bc03ad66fc5d4b7b2",class:"control",onClick:e=>this.toggleDropdown(e),onBlur:e=>this.handleHideDropdown(e)},s("div",{key:"485f1f741ced9c8af1a5eaffffbe87448b3337b4",class:"title",ref:e=>this.dropdownButton=e},s("span",{key:"01aefe07e5802cb69055ac7996fdf1fd1b58d5a5",class:"prefix"},this.label,":"),r?r.label:this.placeholder),s("div",{key:"a5c2a36da359f121a418299018fe6e424f3186b8",style:{flex:"1"}}),s("div",{key:"c1f3ec97d938fe36d90e7047838c67238a4125c4",class:"separator"}),s("div",{key:"86c1ebdabf1b7fcf600f48d3dda1eb33a2184789",class:"arrow",innerHTML:g,"aria-label":"Open Menu"})),s("div",{key:"b4a49186874d81758eee6768f95b136378620439",class:"items","aria-hidden":!this.open,ref:e=>this.dropdownMenu=e,style:{minWidth:d}},(t=this.options)===null||t===void 0?void 0:t.map((e=>e.label?s("button",{onClick:i=>this.handleSelectOption(i,e),class:`option ${e.value===this.value?"selected":""}`,disabled:e.disabled},e.label):s("div",{class:"separator"})))))}get el(){return t(this)}};u.style=h;export{p as verdocs_pagination,u as verdocs_quick_filter};
2
+ //# sourceMappingURL=p-664be870.entry.js.map
@@ -1,2 +1,2 @@
1
- import{r as e,c as i,h as t,H as s,F as o}from"./p-6vpKbd31.js";import{VerdocsEndpoint as n,startSigningSession as a,envelopeRecipientAgree as l,updateEnvelopeField as r,createSignature as d,updateEnvelopeFieldSignature as c,createInitials as h,updateEnvelopeFieldInitials as p,isValidPhone as g,isValidEmail as u,sortFields as v,envelopeRecipientSubmit as f,uploadEnvelopeFieldAttachment as m,deleteEnvelopeFieldAttachment as x,formatFullName as b,fullNameToInitials as y,verifySigner as w,delegateRecipient as k,envelopeRecipientDecline as S,integerSequence as N}from"@verdocs/js-sdk";import{a as I,u as G,g as D,r as P}from"./p-fL0BKEnm.js";import{D as F}from"./p-C_Xku1v2.js";import{V as z}from"./p-CyvDgtoV.js";import{S as T}from"./p-C1sRVZWv.js";import{S as E}from"./p-DmsV595e.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const U='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}verdocs-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);margin-top:15px}verdocs-sign .fatal-error .message{max-width:360px;width:50%;font-size:16px;background:white;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#4c56cb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400;padding:0 10px}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 46px;flex:0 0 46px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 12px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}';const A=`\n<ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the\n <a href="https://verdocs.com/en/electronic-record-signature-disclosure/" target="_blank">\n Electronic Record and Signatures Disclosure</a>.</li>\n <li>\n Agree to Verdocs'\n <a href="https://verdocs.com/en/eula" target="_blank">\n End User License Agreement</a>\n and confirm you have read Verdocs'\n <a href="https://verdocs.com/en/privacy-policy/" target="_blank">\n Privacy Policy</a>.\n </li>\n</ul>`;const R=class{constructor(t){e(this,t);this.sdkError=i(this,"sdkError");this.envelopeLoaded=i(this,"envelopeLoaded");this.envelopeUpdated=i(this,"envelopeUpdated");this.endpoint=F;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=A;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.loading=true;this.envelope=null}componentWillLoad(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new n({sessionType:"signing"})}}async componentDidLoad(){var e,i,t,s,o,n;if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new T("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new T("[SIGN] Missing required inviteCode",500,""));return}try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const e=await a(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);this.processAuthResponse(e)}catch(e){console.log("[SIGN] Error with signing session",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new T(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(n=e.response)===null||n===void 0?void 0:n.data));this.showLoadError=true}}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}}processAuthResponse(e){var i,t,s;const{envelope:o,recipient:n}=e;const{auth_step:a}=n;this.recipient=n;this.envelope=o;this.disclosures=((t=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||t===void 0?void 0:t.disclaimer)||A;this.authStep=a;this.delegated=!!n.delegated_to;this.agreed=n.agreed;this.submitted=n.status==="submitted";this.isDone=this.submitted;this.showDone=this.submitted;E.updateEnvelope(this.envelopeId,o);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=n.auth_method_states||{};this.kbaQuestions=n.kba_questions;if(Object.values(this.authMethodStates).includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. The sender has been notified."}else if(n.status==="declined"){this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(s=this.envelopeLoaded)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope})}handleClickAgree(){this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);l(this.endpoint,this.envelopeId,this.roleId,this.disclosures).then((()=>{var e;this.nextButtonLabel="Next";this.recipient.agreed=true;this.submitting=false;this.agreed=true;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("[SIGN] Unable to accept disclosures",e);z("Unable to accept disclosures, please try again later",{style:"error"});this.submitting=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T(e.message,(t=e.response)===null||t===void 0?void 0:t.status,(s=e.response)===null||s===void 0?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s;switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"delegate":this.delegating=true;break;case"decline":this.declining=true;break;case"print":window.print();(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":{const e=this.envelope.documents.find((e=>e.type==="attachment"));if(e){I(this.endpoint,this.envelope,e.id).catch((e=>{z("Unable to download PDF, please try again later",{style:"error"});console.log("[SIGN] Error downloading PDF",e)}));(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}break}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e,i);this.getRecipientFields().forEach((t=>{if(t.name===e){t.value=i.value;t.settings=i.settings;G(t);this.checkRecipientFields()}}))}saveFieldChange(e,i){console.log("[SIGN] saveFieldChange",e,i);r(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,o,n,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((s=(t=e.response)===null||t===void 0?void 0:t.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");this.fatalErrorHeader="Signing Session Expired";this.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e);z("Unable to save change, please try again later",{style:"error"})}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new T(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(a=e.response)===null||a===void 0?void 0:a.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,{prepared:false,value:t});case"checkbox":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"radio":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"dropdown":console.log("Saving dropdown",e.name,i.detail);return this.saveFieldChange(e.name,{prepared:false,value:i.detail});case"initial":if(!i.detail){return}this.showSpinner=true;const o=await(await fetch(i.detail)).blob();return h(this.endpoint,"initial",o).then((async i=>{const t=await p(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);z("Unable to save initials, please try again later",{style:"error"});this.showSpinner=false}));case"signature":if(!i.detail){return}this.showSpinner=true;const n=await(await fetch(i.detail)).blob();return d(this.endpoint,"signature",n).then((async i=>{console.log("Signature update result",i);const t=await c(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);z("Unable to save signature, please try again later",{style:"error"});this.showSpinner=false}));case"date":const{formattedDate:a}=i.detail;if(a){return this.saveFieldChange(e.name,{prepared:false,value:a})}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:t,checked:s},e);break}}isFieldFilled(e){const{value:i=""}=e;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return u(i);case"phone":return g(i);default:return(i||"").trim()!==""}case"signature":return i==="signed";case"initial":return i==="initialed";case"timestamp":return true;case"date":return!!i;case"attachment":return i==="attached";case"dropdown":return i!=="";case"checkbox":return i==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((i=>i.group===e.group)).some((e=>e.value==="true"))}return e.value==="true";default:return false}}isFieldValid(e){return!e.required||this.isFieldFilled(e)}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));v(e);return e}async handleNext(){var e;if(this.nextSubmits){try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const i=await f(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",i);window.location.reload()}catch(e){console.log("[SIGN] Error submitting",e)}return}const i=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldFilled(e)));v(i);const t=i.findIndex((e=>e.name===this.focusedField));let s=t+1;if(s>=i.length){s=0}let o=i[s];let n=0;if(n<i.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){n++;s++;if(s>=i.length){s=0}o=i[s]}if(n>=i.length){o=null}if(o){const e=D(o);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth"});i===null||i===void 0?void 0:i.focusField();this.focusedField=o.name}}getRecipientFields(){return this.envelope.fields.filter((e=>e.role_name===this.recipient.role_name))}checkRecipientFields(){const e=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}}attachFieldAttributes(e,i,t){if(t.getAttribute("attached")==="1"){return}t.setAttribute("attached","1");t.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));t.addEventListener("attached",(async t=>{console.log("[SIGN] onAttached",t.detail,t.target.value);this.showSpinner=true;try{const s=await m(this.endpoint,this.envelopeId,i.name,t.detail);this.updateRecipientFieldValue(i.name,s);this.checkRecipientFields();const o=P("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,o);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);z("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("deleted",(async t=>{console.log("[SIGN] onDeleted",t.detail,t.target.value);this.showSpinner=true;try{const t=await x(this.endpoint,this.envelopeId,i.name);console.log("[SIGN] Deleted attachment",t);this.updateRecipientFieldValue(i.name,t);this.checkRecipientFields();const s=P("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,s);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);z("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("focusout",(e=>{if(i.type!=="dropdown"&&i.type!=="attachment"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}}));t.addEventListener("fieldChange",(e=>{this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);const s=b(this.recipient);t.setAttribute("initials",y(s));t.setAttribute("name",s)}handlePageRendered(e){const i=e.detail;const t=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,t);t.forEach(((e,t)=>{if(e.page!==i.pageNumber){return}const s=P("envelope",e,i,{disabled:false,editable:false,draggable:false,done:this.isDone},t);if(!s){return}if(Array.isArray(s)){s.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,s)}}));this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending"))).forEach((()=>{this.getRecipientFields().filter((e=>e.page===i.pageNumber)).forEach((e=>{const t=P("envelope",e,i,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!t){return}if(Array.isArray(t)){t.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,t)}}))}));this.checkRecipientFields()}handleAuthenticateSigner(e){console.log("[SIGN] Submitting authentication step",e);w(this.endpoint,e).then((e=>{console.log("[SIGN] Verification successful",e);this.processAuthResponse(e)})).catch((e=>{var i,t,s,o,n;console.log("[SIGN] Error submitting authentication step",e);if((s=(t=(i=e.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||s===void 0?void 0:s.includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}else{z(((n=(o=e.response)===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))}render(){if(this.showLoadError){return t(s,null,t("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`,buttonLabel:"OK",onNext:()=>{window.location.reload()}}))}if(!this.envelope){return t(s,null,t("verdocs-loader",null))}if(this.fatalErrorMessage){return t(s,{class:{agreed:this.agreed}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},this.fatalErrorHeader),t("p",null,this.fatalErrorMessage))))}if(this.delegated){return t(s,{class:{agreed:false}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},"Delegated Signing Request"),t("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return(i=this.sdkError)===null||i===void 0?void 0:i.emit(e.detail)}}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:e=>{e.preventDefault();e.stopPropagation();this.showDone=false;this.isDone=true}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null)))}if(this.delegating){return t(s,{class:"agreed"},t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:()=>this.delegating=false,onNext:e=>{k(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{z("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",e);this.delegated=true;this.delegating=false})).catch((e=>{console.log("[SIGN] Error delegating request",e);z("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return t("verdocs-ok-dialog",{heading:"Decline Signing Request",message:`If you decline to sign this request, you will not be able to sign again in the future. The envelope sender will be notified.`,buttonLabel:"OK",showCancel:true,onExit:()=>this.declining=false,onNext:()=>{S(this.endpoint,this.envelopeId,this.roleId).then((e=>{console.log("[SIGN] Decline result",e);window.location.reload()})).catch((e=>{console.warn("[SIGN] Error declining signing session",e);z("Unable to decline, please try again later",{style:"error"})}))}})}if(!this.agreed){return t(s,{class:"agreed"},t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:()=>this.delegating=true,onDecline:()=>this.declining=true,onAccept:()=>this.handleClickAgree()}))}if(this.authStep==="passcode"){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"text",step:1,steps:1,placeholder:"Enter your passcode...",helptitle:"Document is protected by a Passcode",helptext:"Please enter your Passcode to proceed. If you do not have one, please contact the sender.",label:"Passcode",onNext:e=>this.handleAuthenticateSigner({auth_method:"passcode",code:e.detail})}))))}if(this.authStep==="email"){return t("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:async e=>{const i=e.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:i.first_name,last_name:i.last_name,address:i.address,city:i.city,state:i.state,zip:i.zip,dob:i.dob})}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){const e=this.kbaChoices.length;const i=this.kbaQuestions[e];return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?t("verdocs-spinner",null):t("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(i===null||i===void 0?void 0:i.prompt)||"Please select one of the options below.",choices:(i===null||i===void 0?void 0:i.answer)||["Skip Question"],step:e+1,steps:this.kbaQuestions.length,onNext:async e=>{const i=e.detail;this.kbaChoices=[...this.kbaChoices,i];if(this.kbaChoices.length>=this.kbaQuestions.length){const e=this.kbaQuestions.map(((e,i)=>({type:e.type,answer:this.kbaChoices[i]})));console.log("Submitting KBA responses",this.kbaChoices,e);this.handleAuthenticateSigner({auth_method:"kba",responses:e})}}}))))}const e=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const i=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){e.unshift({id:"delegate",label:"Delegate"})}const n=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));n.length>0?console.log("[SIGN] Invalid fields remaining",n.map((e=>e.name))):console.log("[SIGN] All field valid");return t(s,null,t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}}),!this.finishLater&&t("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed||this.submitting,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?e:i,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((e=>{const i=N(1,e.pages);return t(o,null,i.map((i=>{var s;const o=((s=e.page_sizes)===null||s===void 0?void 0:s[i])||{width:612,height:792};return t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=false}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=false;this.isDone=true}}),(this.submitting||this.showSpinner)&&t("verdocs-portal",null,t("div",{class:"spinner-overlay"},t("verdocs-spinner",null))))}};R.style=U;export{R as verdocs_sign};
2
- //# sourceMappingURL=p-d5f1bffb.entry.js.map
1
+ import{r as e,c as i,h as t,H as s,F as o}from"./p-6vpKbd31.js";import{VerdocsEndpoint as n,startSigningSession as a,envelopeRecipientAgree as l,updateEnvelopeField as r,createSignature as d,updateEnvelopeFieldSignature as c,createInitials as h,updateEnvelopeFieldInitials as p,isValidPhone as g,isValidEmail as u,sortFields as v,envelopeRecipientSubmit as f,uploadEnvelopeFieldAttachment as m,deleteEnvelopeFieldAttachment as x,formatFullName as b,fullNameToInitials as y,verifySigner as w,delegateRecipient as k,envelopeRecipientDecline as S,integerSequence as N}from"@verdocs/js-sdk";import{a as I,u as G,g as D,r as P}from"./p-DvM2ECoi.js";import{D as F}from"./p-C_Xku1v2.js";import{V as z}from"./p-CyvDgtoV.js";import{S as T}from"./p-C1sRVZWv.js";import{S as E}from"./p-DmsV595e.js";import"./p-BFTU3MAI.js";import"./p-dzBXqXlK.js";import"./p-Dl7Xw8F0.js";const U='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:5000;position:absolute;padding-top:100px;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;background:rgba(0, 0, 0, 0.5)}verdocs-sign verdocs-ok-dialog .background-overlay{-ms-flex-align:start;align-items:flex-start;padding-top:100px}verdocs-sign .loading-indicator{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;background-color:rgba(0, 0, 0, 0.7)}verdocs-sign .fatal-error{position:absolute;z-index:100;top:0;left:0;right:0;bottom:0;background-color:#4a4a4a;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-sign .fatal-error .placeholder{position:absolute;opacity:0.1;z-index:-1;top:0;left:0;right:0;bottom:0;width:612px;height:792px;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);margin-top:15px}verdocs-sign .fatal-error .message{max-width:360px;width:50%;font-size:16px;background:white;-webkit-box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235);box-shadow:3px 3px 9px -1px rgba(0, 0, 0, 0.2470588235)}verdocs-sign .fatal-error .header{color:white;font-size:18px;font-weight:500;padding:5px 10px;margin:0 0 10px 0;background:#4c56cb}verdocs-sign .fatal-error p{margin:1rem;font-size:14px;font-weight:400;padding:0 10px}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 46px;flex:0 0 46px;font-size:12px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-webkit-transition:all 0.25s;transition:all 0.25s;background-color:#33354c;-webkit-box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12);box-shadow:0 4px 4px 0 rgba(0, 0, 0, 0.24), 0 0 4px 0 rgba(0, 0, 0, 0.12)}#verdocs-sign-header .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 12px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;overflow:hidden;white-space:nowrap;padding:0 10px 0 0;text-overflow:ellipsis}.spinner-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}';const A=`\n<ul>\n <li>\n Agree to use electronic records and signatures, and confirm you have read the\n <a href="https://verdocs.com/en/electronic-record-signature-disclosure/" target="_blank">\n Electronic Record and Signatures Disclosure</a>.</li>\n <li>\n Agree to Verdocs'\n <a href="https://verdocs.com/en/eula" target="_blank">\n End User License Agreement</a>\n and confirm you have read Verdocs'\n <a href="https://verdocs.com/en/privacy-policy/" target="_blank">\n Privacy Policy</a>.\n </li>\n</ul>`;const R=class{constructor(t){e(this,t);this.sdkError=i(this,"sdkError");this.envelopeLoaded=i(this,"envelopeLoaded");this.envelopeUpdated=i(this,"envelopeUpdated");this.endpoint=F;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=A;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.loading=true;this.envelope=null}componentWillLoad(){if(!this.endpoint){console.log("[SIGN] Creating signing endpoint");this.endpoint=new n({sessionType:"signing"})}}async componentDidLoad(){var e,i,t,s,o,n;if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new T("[SIGN] Missing required envelopId",500,""));return}if(!this.roleId){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T("[SIGN] Missing required roleId",500,""));return}if(!this.inviteCode){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new T("[SIGN] Missing required inviteCode",500,""));return}try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const e=await a(this.endpoint,this.envelopeId,this.roleId,this.inviteCode);this.processAuthResponse(e)}catch(e){console.log("[SIGN] Error with signing session",e);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new T(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(n=e.response)===null||n===void 0?void 0:n.data));this.showLoadError=true}}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null;const i=document.getElementById("verdocs-sign-header");if(e&&i){console.log("[SIGN] Moving header");i.remove();e.append(i)}}processAuthResponse(e){var i,t,s;const{envelope:o,recipient:n}=e;const{auth_step:a}=n;this.recipient=n;this.envelope=o;this.disclosures=((t=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||t===void 0?void 0:t.disclaimer)||A;this.authStep=a;this.delegated=!!n.delegated_to;this.agreed=n.agreed;this.submitted=n.status==="submitted";this.isDone=this.submitted;this.showDone=this.submitted;E.updateEnvelope(this.envelopeId,o);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=n.auth_method_states||{};this.kbaQuestions=n.kba_questions;if(Object.values(this.authMethodStates).includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}if(this.envelope.status==="canceled"){this.fatalErrorHeader="Unable to Start Signing Session";this.fatalErrorMessage="This envelope has been canceled. The sender has been notified."}else if(n.status==="declined"){this.fatalErrorHeader="Declined";this.fatalErrorMessage="You have declined to sign this request. The sender has been notified."}else if(this.agreed){this.nextButtonLabel="Next"}this.checkRecipientFields();(s=this.envelopeLoaded)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope})}handleClickAgree(){this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);l(this.endpoint,this.envelopeId,this.roleId,this.disclosures).then((()=>{var e;this.nextButtonLabel="Next";this.recipient.agreed=true;this.submitting=false;this.agreed=true;(e=this.envelopeUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("[SIGN] Unable to accept disclosures",e);z("Unable to accept disclosures, please try again later",{style:"error"});this.submitting=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(new T(e.message,(t=e.response)===null||t===void 0?void 0:t.status,(s=e.response)===null||s===void 0?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s;switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"delegate":this.delegating=true;break;case"decline":this.declining=true;break;case"print":window.print();(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":{const e=this.envelope.documents.find((e=>e.type==="attachment"));if(e){I(this.endpoint,this.envelope,e.id).catch((e=>{z("Unable to download PDF, please try again later",{style:"error"});console.log("[SIGN] Error downloading PDF",e)}));(s=this.envelopeUpdated)===null||s===void 0?void 0:s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}break}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e,i);this.getRecipientFields().forEach((t=>{if(t.name===e){t.value=i.value;t.settings=i.settings;G(t);this.checkRecipientFields()}}))}saveFieldChange(e,i){console.log("[SIGN] saveFieldChange",e,i);r(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,o,n,a;if(((i=e.response)===null||i===void 0?void 0:i.status)===401&&((s=(t=e.response)===null||t===void 0?void 0:t.data)===null||s===void 0?void 0:s.error)==="jwt expired"){console.log("[SIGN] Signing session expired");this.fatalErrorHeader="Signing Session Expired";this.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e);z("Unable to save change, please try again later",{style:"error"})}(o=this.sdkError)===null||o===void 0?void 0:o.emit(new T(e.message,(n=e.response)===null||n===void 0?void 0:n.status,(a=e.response)===null||a===void 0?void 0:a.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textarea":case"textbox":return this.saveFieldChange(e.name,{prepared:false,value:t});case"checkbox":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"radio":{return this.saveFieldChange(e.name,{prepared:false,value:String(i.target.checked)})}case"dropdown":console.log("Saving dropdown",e.name,i.detail);return this.saveFieldChange(e.name,{prepared:false,value:i.detail});case"initial":if(!i.detail){return}this.showSpinner=true;const o=await(await fetch(i.detail)).blob();return h(this.endpoint,"initial",o).then((async i=>{const t=await p(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.log("Error updating initials",e);z("Unable to save initials, please try again later",{style:"error"});this.showSpinner=false}));case"signature":if(!i.detail){return}this.showSpinner=true;const n=await(await fetch(i.detail)).blob();return d(this.endpoint,"signature",n).then((async i=>{console.log("Signature update result",i);const t=await c(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t);this.showSpinner=false})).catch((e=>{console.warn("[SIGN] Error updating signature",e);z("Unable to save signature, please try again later",{style:"error"});this.showSpinner=false}));case"date":const{formattedDate:a}=i.detail;if(a){return this.saveFieldChange(e.name,{prepared:false,value:a})}break;case"timestamp":console.log("[SIGN] Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("[SIGN] Unhandled field update",{value:t,checked:s},e);break}}isFieldFilled(e){const{value:i=""}=e;switch(e.type){case"textarea":case"textbox":switch(e.validator||""){case"email":return u(i);case"phone":return g(i);default:return(i||"").trim()!==""}case"signature":return i==="signed";case"initial":return i==="initialed";case"timestamp":return true;case"date":return!!i;case"attachment":return i==="attached";case"dropdown":return i!=="";case"checkbox":return i==="true";case"radio":if(!!e.group){return this.getRecipientFields().filter((i=>i.group===e.group)).some((e=>e.value==="true"))}return e.value==="true";default:return false}}isFieldValid(e){return!e.required||this.isFieldFilled(e)}getSortedFillableFields(){const e=this.getRecipientFields().filter((e=>e.type!=="timestamp"));v(e);return e}async handleNext(){var e;if(this.nextSubmits){try{(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;const i=await f(this.endpoint,this.envelopeId,this.roleId);console.log("[SIGN] Submitted successfully",i);window.location.reload()}catch(e){console.log("[SIGN] Error submitting",e)}return}const i=this.getSortedFillableFields().filter((e=>e.required&&!this.isFieldFilled(e)));v(i);const t=i.findIndex((e=>e.name===this.focusedField));let s=t+1;if(s>=i.length){s=0}let o=i[s];let n=0;if(n<i.length&&["signature","initial"].includes(o.type)&&["initialed","signed"].includes(o.value)){n++;s++;if(s>=i.length){s=0}o=i[s]}if(n>=i.length){o=null}if(o){const e=D(o);const i=document.getElementById(e);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth"});i===null||i===void 0?void 0:i.focusField();this.focusedField=o.name}}getRecipientFields(){return this.envelope.fields.filter((e=>e.role_name===this.recipient.role_name))}checkRecipientFields(){const e=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));if(e.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}}attachFieldAttributes(e,i,t){if(t.getAttribute("attached")==="1"){return}t.setAttribute("attached","1");t.addEventListener("input",(e=>{if(e.target.type==="radio"||e.target.type==="checkbox"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}else{this.checkRecipientFields()}}));t.addEventListener("attached",(async t=>{console.log("[SIGN] onAttached",t.detail,t.target.value);this.showSpinner=true;try{const s=await m(this.endpoint,this.envelopeId,i.name,t.detail);this.updateRecipientFieldValue(i.name,s);this.checkRecipientFields();const o=P("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,o);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);z("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("deleted",(async t=>{console.log("[SIGN] onDeleted",t.detail,t.target.value);this.showSpinner=true;try{const t=await x(this.endpoint,this.envelopeId,i.name);console.log("[SIGN] Deleted attachment",t);this.updateRecipientFieldValue(i.name,t);this.checkRecipientFields();const s=P("envelope",i,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,i,s);this.showSpinner=false}catch(t){console.log("Error uploading attachment",t);z("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false}}));t.addEventListener("focusout",(e=>{if(i.type!=="dropdown"&&i.type!=="attachment"){this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}}));t.addEventListener("fieldChange",(e=>{this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))}));t.setAttribute("templateid",this.envelope.template_id);t.setAttribute("fieldname",i.name);t.setAttribute("page",e.pageNumber);t.setAttribute("xScale",e.xScale);t.setAttribute("yScale",e.yScale);const s=b(this.recipient);t.setAttribute("initials",y(s));t.setAttribute("name",s)}handlePageRendered(e){const i=e.detail;const t=this.getSortedFillableFields();console.log("[SIGN] Rendering fields for page",i.pageNumber,t);t.forEach(((e,t)=>{if(e.page!==i.pageNumber){return}const s=P("envelope",e,i,{disabled:false,editable:false,draggable:false,done:this.isDone},t);if(!s){return}if(Array.isArray(s)){s.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,s)}}));this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending"))).forEach((()=>{this.getRecipientFields().filter((e=>e.page===i.pageNumber)).forEach((e=>{const t=P("envelope",e,i,{disabled:true,editable:false,draggable:false,done:this.isDone});if(!t){return}if(Array.isArray(t)){t.map((t=>this.attachFieldAttributes(i,e,t)))}else{this.attachFieldAttributes(i,e,t)}}))}));this.checkRecipientFields()}handleAuthenticateSigner(e){console.log("[SIGN] Submitting authentication step",e);w(this.endpoint,e).then((e=>{console.log("[SIGN] Verification successful",e);this.processAuthResponse(e)})).catch((e=>{var i,t,s,o,n;console.log("[SIGN] Error submitting authentication step",e);if((s=(t=(i=e.response)===null||i===void 0?void 0:i.data)===null||t===void 0?void 0:t.error)===null||s===void 0?void 0:s.includes("failed")){this.fatalErrorHeader="Recipient Verification Failed";this.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";this.isDone=true}else{z(((n=(o=e.response)===null||o===void 0?void 0:o.data)===null||n===void 0?void 0:n.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))}render(){if(this.showLoadError){return t(s,null,t("verdocs-ok-dialog",{heading:"Unable to Start Signing",message:`Sorry, your invite code is invalid or has expired. Please check your email for an updated invitation, or contact the sender.`,buttonLabel:"OK",onNext:()=>{window.location.reload()}}))}if(!this.envelope){return t(s,null,t("verdocs-loader",null))}if(this.fatalErrorMessage){return t(s,{class:{agreed:this.agreed}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},this.fatalErrorHeader),t("p",null,this.fatalErrorMessage))))}if(this.delegated){return t(s,{class:{agreed:false}},t("div",{class:"fatal-error"},t("div",{class:"message"},t("div",{class:"header"},"Delegated Signing Request"),t("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return(i=this.sdkError)===null||i===void 0?void 0:i.emit(e.detail)}}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:e=>{e.preventDefault();e.stopPropagation();this.showDone=false;this.isDone=true}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null)))}if(this.delegating){return t(s,{class:"agreed"},t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:()=>this.delegating=false,onNext:e=>{k(this.endpoint,this.envelopeId,this.roleId,e.detail).then((e=>{z("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",e);this.delegated=true;this.delegating=false})).catch((e=>{console.log("[SIGN] Error delegating request",e);z("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return t("verdocs-ok-dialog",{heading:"Decline Signing Request",message:`If you decline to sign this request, you will not be able to sign again in the future. The envelope sender will be notified.`,buttonLabel:"OK",showCancel:true,onExit:()=>this.declining=false,onNext:()=>{S(this.endpoint,this.envelopeId,this.roleId).then((e=>{console.log("[SIGN] Decline result",e);window.location.reload()})).catch((e=>{console.warn("[SIGN] Error declining signing session",e);z("Unable to decline, please try again later",{style:"error"})}))}})}if(!this.agreed){return t(s,{class:"agreed"},t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:()=>this.delegating=true,onDecline:()=>this.declining=true,onAccept:()=>this.handleClickAgree()}))}if(this.authStep==="passcode"){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"text",step:1,steps:1,placeholder:"Enter your passcode...",helptitle:"Document is protected by a Passcode",helptext:"Please enter your Passcode to proceed. If you do not have one, please contact the sender.",label:"Passcode",onNext:e=>this.handleAuthenticateSigner({auth_method:"passcode",code:e.detail})}))))}if(this.authStep==="email"){return t("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:async e=>{this.processAuthResponse(e.detail.response)}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"kba"},t("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:async e=>{const i=e.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:i.first_name,last_name:i.last_name,address:i.address,city:i.city,state:i.state,zip:i.zip,dob:i.dob})}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){const e=this.kbaChoices.length;const i=this.kbaQuestions[e];return t(s,{class:"kba"},t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name))),t("div",{class:"document",style:{paddingTop:"15px"}},t("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"})),t("div",{class:"cover"},t("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?t("verdocs-spinner",null):t("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(i===null||i===void 0?void 0:i.prompt)||"Please select one of the options below.",choices:(i===null||i===void 0?void 0:i.answer)||["Skip Question"],step:e+1,steps:this.kbaQuestions.length,onNext:async e=>{const i=e.detail;this.kbaChoices=[...this.kbaChoices,i];if(this.kbaChoices.length>=this.kbaQuestions.length){const e=this.kbaQuestions.map(((e,i)=>({type:e.type,answer:this.kbaChoices[i]})));console.log("Submitting KBA responses",this.kbaChoices,e);this.handleAuthenticateSigner({auth_method:"kba",responses:e})}}}))))}const e=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];const i=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){e.unshift({id:"delegate",label:"Delegate"})}const n=this.getRecipientFields().filter((e=>!this.isFieldValid(e)));n.length>0?console.log("[SIGN] Invalid fields remaining",n.map((e=>e.name))):console.log("[SIGN] All field valid");return t(s,null,t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}}),!this.finishLater&&t("verdocs-button",{size:"xsmall",label:this.nextButtonLabel,disabled:!this.agreed||this.submitting,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?e:i,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",{class:"document",style:{paddingTop:"15px"}},(this.envelope.documents||[]).map((e=>{const i=N(1,e.pages);return t(o,null,i.map((i=>{var s;const o=((s=e.page_sizes)===null||s===void 0?void 0:s[i])||{width:612,height:792};return t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:o.width,virtualHeight:o.height,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=false}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=false;this.isDone=true}}),(this.submitting||this.showSpinner)&&t("verdocs-portal",null,t("div",{class:"spinner-overlay"},t("verdocs-spinner",null))))}};R.style=U;export{R as verdocs_sign};
2
+ //# sourceMappingURL=p-75a43183.entry.js.map