@verdocs/web-sdk 6.0.2 → 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 (136) 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-field-attachment_13.cjs.entry.js +1 -4
  8. package/dist/cjs/verdocs-field-attachment_13.cjs.entry.js.map +1 -1
  9. package/dist/cjs/verdocs-pagination_2.cjs.entry.js +1 -1
  10. package/dist/cjs/verdocs-preview_7.cjs.entry.js +1 -1
  11. package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
  12. package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
  13. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +2 -5
  14. package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js.map +1 -1
  15. package/dist/collection/utils/utils.js +1 -0
  16. package/dist/collection/utils/utils.js.map +1 -1
  17. package/dist/components/{p-DCaVuows.js → p-BHeendgg.js} +5 -5
  18. package/dist/components/{p-DCaVuows.js.map → p-BHeendgg.js.map} +1 -1
  19. package/dist/components/{p-Cmm_Efcd.js → p-CAJEh6K0.js} +6 -6
  20. package/dist/components/{p-Cmm_Efcd.js.map → p-CAJEh6K0.js.map} +1 -1
  21. package/dist/components/{p-D9UxTdE4.js → p-CDDk2TOh.js} +4 -4
  22. package/dist/components/{p-D9UxTdE4.js.map → p-CDDk2TOh.js.map} +1 -1
  23. package/dist/components/{p-AQsHwZ27.js → p-CNvRd0Kp.js} +5 -5
  24. package/dist/components/{p-AQsHwZ27.js.map → p-CNvRd0Kp.js.map} +1 -1
  25. package/dist/components/{p-pTXj30z_.js → p-CSQjgm9n.js} +3 -3
  26. package/dist/components/{p-pTXj30z_.js.map → p-CSQjgm9n.js.map} +1 -1
  27. package/dist/components/{p-xS2v_6o_.js → p-CSpoYxdI.js} +3 -3
  28. package/dist/components/{p-xS2v_6o_.js.map → p-CSpoYxdI.js.map} +1 -1
  29. package/dist/components/{p-DepyvOoM.js → p-CsyhCKk4.js} +3 -3
  30. package/dist/components/{p-DepyvOoM.js.map → p-CsyhCKk4.js.map} +1 -1
  31. package/dist/components/{p-Bhib7RyH.js → p-DmXt1ckc.js} +3 -3
  32. package/dist/components/{p-Bhib7RyH.js.map → p-DmXt1ckc.js.map} +1 -1
  33. package/dist/components/{p-DnAJsr7Q.js → p-WvXI4EBm.js} +3 -3
  34. package/dist/components/{p-DnAJsr7Q.js.map → p-WvXI4EBm.js.map} +1 -1
  35. package/dist/components/{p-C1nftqjj.js → p-kCaWRqn0.js} +3 -6
  36. package/dist/components/p-kCaWRqn0.js.map +1 -0
  37. package/dist/components/{p-DsBOZHKo.js → p-y2dhcER7.js} +3 -2
  38. package/dist/components/{p-DsBOZHKo.js.map → p-y2dhcER7.js.map} +1 -1
  39. package/dist/components/verdocs-build.js +7 -7
  40. package/dist/components/verdocs-contact-picker.js +1 -1
  41. package/dist/components/verdocs-envelope-document-page.js +1 -1
  42. package/dist/components/verdocs-envelopes-list.js +2 -2
  43. package/dist/components/verdocs-field-initial.js +1 -1
  44. package/dist/components/verdocs-initial-dialog.js +1 -1
  45. package/dist/components/verdocs-preview.js +1 -1
  46. package/dist/components/verdocs-quick-filter.js +1 -1
  47. package/dist/components/verdocs-send.js +1 -1
  48. package/dist/components/verdocs-sign.js +3 -3
  49. package/dist/components/verdocs-template-document-page.js +1 -1
  50. package/dist/components/verdocs-template-fields.js +1 -1
  51. package/dist/components/verdocs-templates-list.js +1 -1
  52. package/dist/components/verdocs-view.js +1 -1
  53. package/dist/esm/{utils-DmfOx9Ey.js → utils-tbEy96hU.js} +3 -2
  54. package/dist/esm/utils-tbEy96hU.js.map +1 -0
  55. package/dist/esm/verdocs-contact-picker.entry.js +1 -1
  56. package/dist/esm/verdocs-delegate-dialog_5.entry.js +1 -1
  57. package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
  58. package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
  59. package/dist/esm/verdocs-field-attachment_13.entry.js +1 -4
  60. package/dist/esm/verdocs-field-attachment_13.entry.js.map +1 -1
  61. package/dist/esm/verdocs-pagination_2.entry.js +1 -1
  62. package/dist/esm/verdocs-preview_7.entry.js +1 -1
  63. package/dist/esm/verdocs-sign.entry.js +1 -1
  64. package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
  65. package/dist/esm-es5/{utils-DmfOx9Ey.js → utils-tbEy96hU.js} +1 -1
  66. package/dist/esm-es5/utils-tbEy96hU.js.map +1 -0
  67. package/dist/esm-es5/verdocs-contact-picker.entry.js +2 -2
  68. package/dist/esm-es5/verdocs-delegate-dialog_5.entry.js +1 -1
  69. package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
  70. package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
  71. package/dist/esm-es5/verdocs-field-attachment_13.entry.js +1 -1
  72. package/dist/esm-es5/verdocs-field-attachment_13.entry.js.map +1 -1
  73. package/dist/esm-es5/verdocs-pagination_2.entry.js +1 -1
  74. package/dist/esm-es5/verdocs-preview_7.entry.js +2 -2
  75. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  76. package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
  77. package/dist/types/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.d.ts +2 -1
  78. package/dist/types/components.d.ts +1 -1
  79. package/dist/verdocs-web-sdk/{p-92147c8e.entry.js → p-1138cbc8.entry.js} +3 -3
  80. package/dist/verdocs-web-sdk/{p-23d2bebc.system.entry.js → p-1ac2de04.system.entry.js} +2 -2
  81. package/dist/verdocs-web-sdk/{p-dd51c6cf.entry.js → p-21da2b89.entry.js} +3 -3
  82. package/dist/verdocs-web-sdk/{p-4761e4b9.entry.js → p-25c15dc4.entry.js} +2 -2
  83. package/dist/verdocs-web-sdk/{p-4761e4b9.entry.js.map → p-25c15dc4.entry.js.map} +1 -1
  84. package/dist/verdocs-web-sdk/{p-3a66ab11.system.entry.js → p-42b32d21.system.entry.js} +2 -2
  85. package/dist/verdocs-web-sdk/{p-baaa811b.entry.js → p-49683659.entry.js} +2 -2
  86. package/dist/verdocs-web-sdk/{p-ceabec49.entry.js → p-6261f76f.entry.js} +2 -2
  87. package/dist/verdocs-web-sdk/{p-9524927b.entry.js → p-664be870.entry.js} +2 -2
  88. package/dist/verdocs-web-sdk/{p-d5f1bffb.entry.js → p-75a43183.entry.js} +2 -2
  89. package/dist/verdocs-web-sdk/{p-fc5c2c45.system.entry.js → p-7a2842d3.system.entry.js} +2 -2
  90. package/dist/verdocs-web-sdk/{p-5f7f20bb.system.entry.js → p-7cb0a86a.system.entry.js} +2 -2
  91. package/dist/verdocs-web-sdk/{p-35d8d17c.system.entry.js → p-8bf7be29.system.entry.js} +3 -3
  92. package/dist/verdocs-web-sdk/{p-nr83qKQ0.system.js.map → p-B2S7Mlv-.system.js.map} +1 -1
  93. package/dist/verdocs-web-sdk/{p-D7IFi8me.system.js.map → p-BDRwNwHO.system.js.map} +1 -1
  94. package/dist/verdocs-web-sdk/{p-Bu5xpJsB.system.js.map → p-BGP1meB_.system.js.map} +1 -1
  95. package/dist/verdocs-web-sdk/{p-BEywLaeg.system.js.map → p-BskSN54G.system.js.map} +1 -1
  96. package/dist/verdocs-web-sdk/{p-DcCGkiJ-.system.js.map → p-C8jYVW5r.system.js.map} +1 -1
  97. package/dist/verdocs-web-sdk/{p-BscsgV4o.system.js.map → p-CB7Tnry2.system.js.map} +1 -1
  98. package/dist/verdocs-web-sdk/{p-DGdn9mfe.system.js.map → p-CmJ4fTid.system.js.map} +1 -1
  99. package/dist/verdocs-web-sdk/{p-DPhW-51Y.system.js.map → p-CuCpcHZy.system.js.map} +1 -1
  100. package/dist/verdocs-web-sdk/{p-CICLOJJr.system.js.map → p-Dp4d4aXG.system.js.map} +1 -1
  101. package/dist/verdocs-web-sdk/{p-fL0BKEnm.js → p-DvM2ECoi.js} +1 -1
  102. package/dist/verdocs-web-sdk/p-DvM2ECoi.js.map +1 -0
  103. package/dist/verdocs-web-sdk/p-RlE9Yh59.system.js +1 -1
  104. package/dist/verdocs-web-sdk/{p-b4bfad4d.entry.js → p-d94cd03f.entry.js} +2 -2
  105. package/dist/verdocs-web-sdk/{p-f05f021e.entry.js → p-da526fc0.entry.js} +2 -2
  106. package/dist/verdocs-web-sdk/{p-f6598c9b.system.entry.js → p-def666e2.system.entry.js} +2 -2
  107. package/dist/verdocs-web-sdk/{p-b72d1a5f.system.entry.js → p-e3cf3f48.system.entry.js} +2 -2
  108. package/dist/verdocs-web-sdk/{p-b72d1a5f.system.entry.js.map → p-e3cf3f48.system.entry.js.map} +1 -1
  109. package/dist/verdocs-web-sdk/{p-2d9b370b.system.entry.js → p-e962f3e2.system.entry.js} +3 -3
  110. package/dist/verdocs-web-sdk/{p-e755e978.system.entry.js → p-ffcb5dbb.system.entry.js} +2 -2
  111. package/dist/verdocs-web-sdk/{p-CD5uiThi.system.js → p-lZ900hhb.system.js} +1 -1
  112. package/dist/verdocs-web-sdk/p-lZ900hhb.system.js.map +1 -0
  113. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  114. package/package.json +2 -2
  115. package/dist/cjs/utils-DCB8q98B.js.map +0 -1
  116. package/dist/components/p-C1nftqjj.js.map +0 -1
  117. package/dist/esm/utils-DmfOx9Ey.js.map +0 -1
  118. package/dist/esm-es5/utils-DmfOx9Ey.js.map +0 -1
  119. package/dist/verdocs-web-sdk/p-CD5uiThi.system.js.map +0 -1
  120. package/dist/verdocs-web-sdk/p-fL0BKEnm.js.map +0 -1
  121. /package/dist/verdocs-web-sdk/{p-92147c8e.entry.js.map → p-1138cbc8.entry.js.map} +0 -0
  122. /package/dist/verdocs-web-sdk/{p-23d2bebc.system.entry.js.map → p-1ac2de04.system.entry.js.map} +0 -0
  123. /package/dist/verdocs-web-sdk/{p-dd51c6cf.entry.js.map → p-21da2b89.entry.js.map} +0 -0
  124. /package/dist/verdocs-web-sdk/{p-3a66ab11.system.entry.js.map → p-42b32d21.system.entry.js.map} +0 -0
  125. /package/dist/verdocs-web-sdk/{p-baaa811b.entry.js.map → p-49683659.entry.js.map} +0 -0
  126. /package/dist/verdocs-web-sdk/{p-ceabec49.entry.js.map → p-6261f76f.entry.js.map} +0 -0
  127. /package/dist/verdocs-web-sdk/{p-9524927b.entry.js.map → p-664be870.entry.js.map} +0 -0
  128. /package/dist/verdocs-web-sdk/{p-d5f1bffb.entry.js.map → p-75a43183.entry.js.map} +0 -0
  129. /package/dist/verdocs-web-sdk/{p-fc5c2c45.system.entry.js.map → p-7a2842d3.system.entry.js.map} +0 -0
  130. /package/dist/verdocs-web-sdk/{p-5f7f20bb.system.entry.js.map → p-7cb0a86a.system.entry.js.map} +0 -0
  131. /package/dist/verdocs-web-sdk/{p-35d8d17c.system.entry.js.map → p-8bf7be29.system.entry.js.map} +0 -0
  132. /package/dist/verdocs-web-sdk/{p-b4bfad4d.entry.js.map → p-d94cd03f.entry.js.map} +0 -0
  133. /package/dist/verdocs-web-sdk/{p-f05f021e.entry.js.map → p-da526fc0.entry.js.map} +0 -0
  134. /package/dist/verdocs-web-sdk/{p-f6598c9b.system.entry.js.map → p-def666e2.system.entry.js.map} +0 -0
  135. /package/dist/verdocs-web-sdk/{p-2d9b370b.system.entry.js.map → p-e962f3e2.system.entry.js.map} +0 -0
  136. /package/dist/verdocs-web-sdk/{p-e755e978.system.entry.js.map → p-ffcb5dbb.system.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n["throw"](e))}catch(e){o(e)}}function c(e){e.done?i(e.value):r(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(i=0)),i)try{if(n=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-6vpKbd31.js";import{VerdocsEndpoint,getEnvelopeDocumentPageDisplayUri}from"@verdocs/js-sdk";import{t as throttle}from"./utils-DmfOx9Ey.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-dzBXqXlK.js";import"./Types-Dl7Xw8F0.js";var verdocsEnvelopeDocumentPageCss="@-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-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-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)}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var VerdocsEnvelopeDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered");this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getEnvelopeDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber,this.type)];case 1:e.pageDisplayUri=t.sent();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var i=0,n=t;i<n.length;i++){var r=n[i];var o=r.contentRect.width;e.renderedWidth=o;e.renderedHeight=e.virtualHeight*(o/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};e.prototype.render=function(){var e=this;var t="".concat(this.renderedHeight,"px");return h(Host,{key:"750f27fff50ae426a33898cd1abbc0c5e108421c",id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){return i.type==="div"?h("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}}):e.pageDisplayUri?h("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(e.containerId,"-").concat(i.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsEnvelopeDocumentPage.style=verdocsEnvelopeDocumentPageCss;export{VerdocsEnvelopeDocumentPage as verdocs_envelope_document_page};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n["throw"](e))}catch(e){o(e)}}function c(e){e.done?i(e.value):r(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(i=0)),i)try{if(n=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(a[0]===6&&i.label<o[1]){i.label=o[1];o=a;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(a);break}if(o[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-6vpKbd31.js";import{VerdocsEndpoint,getEnvelopeDocumentPageDisplayUri}from"@verdocs/js-sdk";import{t as throttle}from"./utils-tbEy96hU.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-dzBXqXlK.js";import"./Types-Dl7Xw8F0.js";var verdocsEnvelopeDocumentPageCss="@-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-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-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)}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";var VerdocsEnvelopeDocumentPage=function(){function e(e){registerInstance(this,e);this.pageRendered=createEvent(this,"pageRendered");this.endpoint=VerdocsEndpoint.getDefault();this.envelopeId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.type="original";this.containerId="verdocs-envelope-document-page-".concat(Math.random().toString(36).substring(2,11));this.renderedWidth=this.virtualWidth;this.renderedHeight=this.virtualHeight;this.naturalWidth=this.virtualWidth;this.naturalHeight=this.virtualHeight;this.aspectRatio=this.virtualWidth/this.virtualHeight;this.skipFirstNotification=true;this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:e=this;return[4,getEnvelopeDocumentPageDisplayUri(this.endpoint,this.documentId,this.pageNumber,this.type)];case 1:e.pageDisplayUri=t.sent();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(throttle((function(t){for(var i=0,n=t;i<n.length;i++){var r=n[i];var o=r.contentRect.width;e.renderedWidth=o;e.renderedHeight=e.virtualHeight*(o/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect()};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})};e.prototype.render=function(){var e=this;var t="".concat(this.renderedHeight,"px");return h(Host,{key:"750f27fff50ae426a33898cd1abbc0c5e108421c",id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){return i.type==="div"?h("div",{class:"verdocs-envelope-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}}):e.pageDisplayUri?h("img",{class:"verdocs-envelope-document-page-layer img",id:"".concat(e.containerId,"-").concat(i.name),src:e.pageDisplayUri,alt:"Page ".concat(e.pageNumber),"aria-hidden":true,loading:"lazy",onLoad:function(t){e.naturalWidth=t.target.naturalWidth;e.naturalHeight=t.target.naturalHeight;e.aspectRatio=e.naturalWidth/e.naturalHeight;e.virtualHeight=e.virtualWidth/e.aspectRatio;e.renderedHeight=t.target.offsetWidth/e.aspectRatio}}):h("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsEnvelopeDocumentPage.style=verdocsEnvelopeDocumentPageCss;export{VerdocsEnvelopeDocumentPage as verdocs_envelope_document_page};
2
2
  //# sourceMappingURL=verdocs-envelope-document-page.entry.js.map
@@ -1,2 +1,2 @@
1
- var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s))e[s]=n[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,t,i){function s(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i["throw"](e))}catch(e){r(e)}}function l(e){e.done?t(e.value):s(e.value).then(o,a)}l((i=i.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,s,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(n){return l([e,n])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(t=0)),t)try{if(i=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;s=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){t.label=a[1];break}if(a[0]===6&&t.label<r[1]){t.label=r[1];r=a;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(a);break}if(r[2])t.ops.pop();t.trys.pop();continue}a=n.call(e,t)}catch(e){a=[6,e];s=0}finally{i=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,n,t){if(t||arguments.length===2)for(var i=0,s=n.length,r;i<s;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return e.concat(r||Array.prototype.slice.call(n))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-6vpKbd31.js";import{VerdocsEndpoint,getEnvelopes,integerSequence,getRecipientsWithActions,userCanCancelEnvelope,userCanAct,formatFullName,cancelEnvelope}from"@verdocs/js-sdk";import{s as saveEnvelopesAsZip}from"./utils-DmfOx9Ey.js";import{V as VerdocsToast}from"./Toast-CyvDgtoV.js";import{S as SDKError}from"./errors-C1sRVZWv.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-dzBXqXlK.js";import"./Types-Dl7Xw8F0.js";var verdocsEnvelopesListCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';var DocumentIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var ViewFilters=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}];var StatusFilters=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}];var SortFilters=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}];var VerdocsEnvelopesList=function(){function e(e){registerInstance(this,e);this.changeView=createEvent(this,"changeView");this.changeStatus=createEvent(this,"changeStatus");this.changeSort=createEvent(this,"changeSort");this.changeMatch=createEvent(this,"changeMatch");this.sdkError=createEvent(this,"sdkError");this.viewEnvelope=createEvent(this,"viewEnvelope");this.finishEnvelope=createEvent(this,"finishEnvelope");this.endpoint=VerdocsEndpoint.getDefault();this.view=undefined;this.status="all";this.sort="created_at";this.match="";this.showPagination=true;this.rowsPerPage=10;this.selectedPage=0;this.count=0;this.initiallyLoaded=false;this.loading=true;this.selectedEnvelopes=[];this.envelopes=[]}e.prototype.handleViewUpdated=function(){return this.queryEnvelopes()};e.prototype.handleStatusUpdated=function(){return this.queryEnvelopes()};e.prototype.handleSortUpdated=function(){return this.queryEnvelopes()};e.prototype.handleMatchUpdated=function(){return this.queryEnvelopes()};e.prototype.handlePageUpdated=function(){return this.queryEnvelopes()};e.prototype.componentWillLoad=function(){this.endpoint.onSessionChanged((function(e,n,t){console.log("[ENVELOPES_LIST] onSessionChanged",n,t)}));this.endpoint.loadSession()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.queryEnvelopes()];case 1:e.sent();this.initiallyLoaded=true;return[2]}}))}))};e.prototype.queryEnvelopes=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,t,i,s,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.loading=true;i={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]});break;case"inbox":i=__assign({},i);break;case"sent":i=__assign({},i);break;case"action":i=__assign(__assign({},i),{status:["pending","in progress"]});break;case"waiting":i=__assign(__assign({},i),{status:["pending","in progress"]});break;case"completed":i=__assign(__assign({},i),{status:["complete"]});break;default:i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]})}if(this.view==="all"){if(this.status!=="all"){i.status=[this.status]}}if(this.match.trim());return[4,getEnvelopes(this.endpoint,i)];case 1:s=o.sent();this.envelopes=s.envelopes;this.count=s.count;this.loading=false;return[3,3];case 2:r=o.sent();this.loading=false;console.log("[ENVELOPES] Error listing envelopes",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(n=r.response)===null||n===void 0?void 0:n.status,(t=r.response)===null||t===void 0?void 0:t.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDownload=function(){var e=this;saveEnvelopesAsZip(this.endpoint,this.selectedEnvelopes).then((function(){e.selectedEnvelopes=[]})).catch((function(e){console.log("[ENVELOPES] Download error",e);VerdocsToast("Download error: "+e.message,{style:"error"})}))};e.prototype.downloadEnvelope=function(e){saveEnvelopesAsZip(this.endpoint,[e]).catch((function(e){console.log("[ENVELOPES] Download error",e);VerdocsToast("Download error: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;return h(Host,{key:"43bb496e91b0891e680e476c0cb842c8a71a6dbe"},h("div",{key:"a63499bc8c56ec934ca3c8598d45cd2b2cf167bb",class:"header"},h("div",{key:"0c710bfa77e0cd52a87eb2de542f41874d342cef",class:"filter"},h("verdocs-text-input",{key:"7f2f134343fc5e877a9f1e5d58aa773e0ce99bb5",id:"verdocs-filter-name",value:this.match,clearable:true,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:function(n){var t;e.match=n.target.value.trim();(t=e.changeMatch)===null||t===void 0?void 0:t.emit(e.match)}})),h("verdocs-quick-filter",{key:"1ad11247696bafc2a8468e370ad558e6686de0ba",label:"View",value:this.view,options:ViewFilters,onOptionSelected:function(n){e.view=n.detail.value}}),this.view==="all"&&h("verdocs-quick-filter",{key:"a9a85fef5de5e17c3206257508c425e1e0dfb47d",label:"Status",value:this.status,options:StatusFilters,onOptionSelected:function(n){e.status=n.detail.value}}),this.view==="all"&&h("verdocs-quick-filter",{key:"8eea4f02f9bdd8d42b01c046ad9e18fae4cf4a34",label:"Sort By",value:this.sort,options:SortFilters,onOptionSelected:function(n){e.sort=n.detail.value}}),this.loading&&h("verdocs-spinner",{key:"b45c5ea18fe8344444a6d2275cd9e22031685ee2",mode:"dark",size:24}),h("div",{key:"a87ed02343a9ebf3aa8fa075b58ede3d7295f095",style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&h("verdocs-button",{key:"4cfde469bbf48a4e05b5e7166d6be933257de015",label:"Download (".concat(this.selectedEnvelopes.length,")"),onClick:function(){return e.handleDownload()}})),this.envelopes.map((function(n){var t;var i=getRecipientsWithActions(n);var s=userCanCancelEnvelope(e.endpoint.profile,n);var r=i.find((function(n){var t;return n.email===((t=e.endpoint.session)===null||t===void 0?void 0:t.email)||""}));var o=r&&s&&userCanAct(((t=e.endpoint.session)===null||t===void 0?void 0:t.email)||"",i);var a=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!o},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!s}];return h("div",{class:"envelope",key:n.id,onClick:function(){var t;return(t=e.viewEnvelope)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:n})}},h("div",{class:"inner"},h("verdocs-checkbox",{checked:e.selectedEnvelopes.findIndex((function(e){return e.id===n.id}))!==-1,onClick:function(e){return e.stopPropagation()},onInput:function(t){if(t.target.checked){e.selectedEnvelopes=__spreadArray(__spreadArray([],e.selectedEnvelopes,true),[n],false)}else{e.selectedEnvelopes=e.selectedEnvelopes.filter((function(e){return e.id!==n.id}))}}}),h("div",{class:"vert-spacer"}),h("span",{innerHTML:DocumentIcon,class:"envelope-icon"}),h("div",{class:"envelope-name"},n.name,":  ",h("div",{class:"envelope-recipients"},n.recipients.map((function(e){return formatFullName(e)})))),h("div",{class:"vert-spacer"}),h("verdocs-status-indicator",{envelope:n,style:{width:"125px"}}),h("div",{class:"vert-spacer"}),h("div",{class:"last-modified"},new Date(n.updated_at).toLocaleString()),h("div",{class:"vert-spacer"}),h("verdocs-dropdown",{options:a,onOptionSelected:function(t){var i,s;switch(t.detail.id){case"view":(i=e.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:n});break;case"finish":(s=e.finishEnvelope)===null||s===void 0?void 0:s.emit({endpoint:e.endpoint,envelope:n});break;case"download":e.downloadEnvelope(n);break;case"cancel":if(window.confirm("Are you sure you want to cancel this envelope?")){cancelEnvelope(e.endpoint,n.id).then((function(){return VerdocsToast("Envelope canceled")})).catch((function(e){return VerdocsToast("Unable to cancel envelope: "+e.messabge,{style:"error"})}));e.queryEnvelopes().catch((function(){}))}break}}})))})),!this.initiallyLoaded&&h("div",{key:"dee1ed02683c459f29e503651684dce31f1c26d9",style:{width:"100%"}},integerSequence(0,this.rowsPerPage).map((function(){return h("div",{class:"envelope-placeholder"})}))),this.initiallyLoaded&&!this.envelopes.length&&h("div",{key:"b8381cec788ae60740e629e0ebe5f4de6c622139",class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?h("div",{style:{marginTop:"20px"}},h("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:function(n){e.selectedPage=n.detail.selectedPage}})):h("div",null))};Object.defineProperty(e,"watchers",{get:function(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}},enumerable:false,configurable:true});return e}();VerdocsEnvelopesList.style=verdocsEnvelopesListCss;export{VerdocsEnvelopesList as verdocs_envelopes_list};
1
+ var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++){n=arguments[t];for(var s in n)if(Object.prototype.hasOwnProperty.call(n,s))e[s]=n[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,n,t,i){function s(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,r){function o(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i["throw"](e))}catch(e){r(e)}}function l(e){e.done?t(e.value):s(e.value).then(o,a)}l((i=i.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,s,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(n){return l([e,n])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(t=0)),t)try{if(i=1,s&&(r=a[0]&2?s["return"]:a[0]?s["throw"]||((r=s["return"])&&r.call(s),0):s.next)&&!(r=r.call(s,a[1])).done)return r;if(s=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;s=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){t.label=a[1];break}if(a[0]===6&&t.label<r[1]){t.label=r[1];r=a;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(a);break}if(r[2])t.ops.pop();t.trys.pop();continue}a=n.call(e,t)}catch(e){a=[6,e];s=0}finally{i=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,n,t){if(t||arguments.length===2)for(var i=0,s=n.length,r;i<s;i++){if(r||!(i in n)){if(!r)r=Array.prototype.slice.call(n,0,i);r[i]=n[i]}}return e.concat(r||Array.prototype.slice.call(n))};import{r as registerInstance,c as createEvent,h,H as Host}from"./index-6vpKbd31.js";import{VerdocsEndpoint,getEnvelopes,integerSequence,getRecipientsWithActions,userCanCancelEnvelope,userCanAct,formatFullName,cancelEnvelope}from"@verdocs/js-sdk";import{s as saveEnvelopesAsZip}from"./utils-tbEy96hU.js";import{V as VerdocsToast}from"./Toast-CyvDgtoV.js";import{S as SDKError}from"./errors-C1sRVZWv.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-dzBXqXlK.js";import"./Types-Dl7Xw8F0.js";var verdocsEnvelopesListCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-envelopes-list{display:-ms-flexbox;display:flex;padding:10px;font-size:18px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;border-radius:6px;color:#33364b;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", "Barlow", sans-serif}@media screen and (max-width: 800px){verdocs-envelopes-list{font-size:14px}}verdocs-envelopes-list .envelope-placeholder{height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin:5px 0;border-radius:5px;background:#f5f5fa}verdocs-envelopes-list .header{width:100%;row-gap:4px;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-column-gap:12px;-moz-column-gap:12px;column-gap:12px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-envelopes-list .header .filter{width:300px}verdocs-envelopes-list .header verdocs-text-input{margin:0}verdocs-envelopes-list .header verdocs-text-input input{height:32px}verdocs-envelopes-list .filter{-ms-flex-align:center;align-items:center}verdocs-envelopes-list .envelope{width:100%;margin:3px 0;background:#ffffff}verdocs-envelopes-list .envelope:hover{cursor:pointer;background:#f5f5fa}verdocs-envelopes-list .envelope .inner{gap:12px;display:-ms-flexbox;display:flex;padding:8px 14px;border-radius:5px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;container-type:inline-size}verdocs-envelopes-list .envelope .inner svg{width:24px;height:24px}verdocs-envelopes-list .vert-spacer{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 1px;flex:0 0 1px;border-right:1px solid #dad8dd}@media screen and (max-width: 800px){verdocs-envelopes-list .vert-spacer{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list .envelope-icon{display:none}}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-checkbox{display:none}}verdocs-envelopes-list .last-modified{color:#444;display:-ms-flexbox;display:flex;-ms-flex:0 0 180px;flex:0 0 180px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;white-space:nowrap}@media screen and (max-width: 800px){verdocs-envelopes-list .last-modified{display:none}}verdocs-envelopes-list .envelope-name{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;color:#000000;line-height:28px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .envelope-recipients{color:#4b5563;font-weight:700;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}verdocs-envelopes-list .empty-text{text-align:center;margin:16px 0 0 0;padding:80px 80px;border:2px solid #ccc}verdocs-envelopes-list .containing{gap:12px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}@media screen and (max-width: 800px){verdocs-envelopes-list verdocs-status-indicator{font-size:14px}}';var DocumentIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" stroke="#000000" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>';var ViewFilters=[{value:"all",label:"All"},{value:"inbox",label:"Inbox"},{value:"sent",label:"Sent"},{value:"completed",label:"Completed"},{value:"action",label:"Action Required"},{value:"waiting",label:"Waiting on Others"}];var StatusFilters=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"in progress",label:"In Progress"},{value:"complete",label:"Completed"},{value:"declined",label:"Declined"},{value:"canceled",label:"Canceled"}];var SortFilters=[{value:"created_at",label:"Created"},{value:"updated_at",label:"Updated"},{value:"canceled_at",label:"Canceled"},{value:"envelope_name",label:"Name"},{value:"envelope_status",label:"Status"}];var VerdocsEnvelopesList=function(){function e(e){registerInstance(this,e);this.changeView=createEvent(this,"changeView");this.changeStatus=createEvent(this,"changeStatus");this.changeSort=createEvent(this,"changeSort");this.changeMatch=createEvent(this,"changeMatch");this.sdkError=createEvent(this,"sdkError");this.viewEnvelope=createEvent(this,"viewEnvelope");this.finishEnvelope=createEvent(this,"finishEnvelope");this.endpoint=VerdocsEndpoint.getDefault();this.view=undefined;this.status="all";this.sort="created_at";this.match="";this.showPagination=true;this.rowsPerPage=10;this.selectedPage=0;this.count=0;this.initiallyLoaded=false;this.loading=true;this.selectedEnvelopes=[];this.envelopes=[]}e.prototype.handleViewUpdated=function(){return this.queryEnvelopes()};e.prototype.handleStatusUpdated=function(){return this.queryEnvelopes()};e.prototype.handleSortUpdated=function(){return this.queryEnvelopes()};e.prototype.handleMatchUpdated=function(){return this.queryEnvelopes()};e.prototype.handlePageUpdated=function(){return this.queryEnvelopes()};e.prototype.componentWillLoad=function(){this.endpoint.onSessionChanged((function(e,n,t){console.log("[ENVELOPES_LIST] onSessionChanged",n,t)}));this.endpoint.loadSession()};e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.queryEnvelopes()];case 1:e.sent();this.initiallyLoaded=true;return[2]}}))}))};e.prototype.queryEnvelopes=function(){return __awaiter(this,void 0,void 0,(function(){var e,n,t,i,s,r;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,,3]);this.loading=true;i={page:this.selectedPage,rows:this.rowsPerPage};switch(this.view){case"all":i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]});break;case"inbox":i=__assign({},i);break;case"sent":i=__assign({},i);break;case"action":i=__assign(__assign({},i),{status:["pending","in progress"]});break;case"waiting":i=__assign(__assign({},i),{status:["pending","in progress"]});break;case"completed":i=__assign(__assign({},i),{status:["complete"]});break;default:i=__assign(__assign({},i),{status:this.status==="all"?["pending","in progress","complete","declined","canceled"]:[this.status]})}if(this.view==="all"){if(this.status!=="all"){i.status=[this.status]}}if(this.match.trim());return[4,getEnvelopes(this.endpoint,i)];case 1:s=o.sent();this.envelopes=s.envelopes;this.count=s.count;this.loading=false;return[3,3];case 2:r=o.sent();this.loading=false;console.log("[ENVELOPES] Error listing envelopes",r);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new SDKError(r.message,(n=r.response)===null||n===void 0?void 0:n.status,(t=r.response)===null||t===void 0?void 0:t.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleDownload=function(){var e=this;saveEnvelopesAsZip(this.endpoint,this.selectedEnvelopes).then((function(){e.selectedEnvelopes=[]})).catch((function(e){console.log("[ENVELOPES] Download error",e);VerdocsToast("Download error: "+e.message,{style:"error"})}))};e.prototype.downloadEnvelope=function(e){saveEnvelopesAsZip(this.endpoint,[e]).catch((function(e){console.log("[ENVELOPES] Download error",e);VerdocsToast("Download error: "+e.message,{style:"error"})}))};e.prototype.render=function(){var e=this;return h(Host,{key:"43bb496e91b0891e680e476c0cb842c8a71a6dbe"},h("div",{key:"a63499bc8c56ec934ca3c8598d45cd2b2cf167bb",class:"header"},h("div",{key:"0c710bfa77e0cd52a87eb2de542f41874d342cef",class:"filter"},h("verdocs-text-input",{key:"7f2f134343fc5e877a9f1e5d58aa773e0ce99bb5",id:"verdocs-filter-name",value:this.match,clearable:true,autocomplete:"off",placeholder:"Filter by Name, Recipient, or Field...",onFocusout:function(n){var t;e.match=n.target.value.trim();(t=e.changeMatch)===null||t===void 0?void 0:t.emit(e.match)}})),h("verdocs-quick-filter",{key:"1ad11247696bafc2a8468e370ad558e6686de0ba",label:"View",value:this.view,options:ViewFilters,onOptionSelected:function(n){e.view=n.detail.value}}),this.view==="all"&&h("verdocs-quick-filter",{key:"a9a85fef5de5e17c3206257508c425e1e0dfb47d",label:"Status",value:this.status,options:StatusFilters,onOptionSelected:function(n){e.status=n.detail.value}}),this.view==="all"&&h("verdocs-quick-filter",{key:"8eea4f02f9bdd8d42b01c046ad9e18fae4cf4a34",label:"Sort By",value:this.sort,options:SortFilters,onOptionSelected:function(n){e.sort=n.detail.value}}),this.loading&&h("verdocs-spinner",{key:"b45c5ea18fe8344444a6d2275cd9e22031685ee2",mode:"dark",size:24}),h("div",{key:"a87ed02343a9ebf3aa8fa075b58ede3d7295f095",style:{display:"flex",flex:"1"}}),this.selectedEnvelopes.length>0&&h("verdocs-button",{key:"4cfde469bbf48a4e05b5e7166d6be933257de015",label:"Download (".concat(this.selectedEnvelopes.length,")"),onClick:function(){return e.handleDownload()}})),this.envelopes.map((function(n){var t;var i=getRecipientsWithActions(n);var s=userCanCancelEnvelope(e.endpoint.profile,n);var r=i.find((function(n){var t;return n.email===((t=e.endpoint.session)===null||t===void 0?void 0:t.email)||""}));var o=r&&s&&userCanAct(((t=e.endpoint.session)===null||t===void 0?void 0:t.email)||"",i);var a=[{label:"View Envelope",id:"view"},{label:"Finish Envelope",id:"finish",disabled:!o},{label:"Download",id:"download"},{label:"Cancel",id:"cancel",disabled:!s}];return h("div",{class:"envelope",key:n.id,onClick:function(){var t;return(t=e.viewEnvelope)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:n})}},h("div",{class:"inner"},h("verdocs-checkbox",{checked:e.selectedEnvelopes.findIndex((function(e){return e.id===n.id}))!==-1,onClick:function(e){return e.stopPropagation()},onInput:function(t){if(t.target.checked){e.selectedEnvelopes=__spreadArray(__spreadArray([],e.selectedEnvelopes,true),[n],false)}else{e.selectedEnvelopes=e.selectedEnvelopes.filter((function(e){return e.id!==n.id}))}}}),h("div",{class:"vert-spacer"}),h("span",{innerHTML:DocumentIcon,class:"envelope-icon"}),h("div",{class:"envelope-name"},n.name,":  ",h("div",{class:"envelope-recipients"},n.recipients.map((function(e){return formatFullName(e)})))),h("div",{class:"vert-spacer"}),h("verdocs-status-indicator",{envelope:n,style:{width:"125px"}}),h("div",{class:"vert-spacer"}),h("div",{class:"last-modified"},new Date(n.updated_at).toLocaleString()),h("div",{class:"vert-spacer"}),h("verdocs-dropdown",{options:a,onOptionSelected:function(t){var i,s;switch(t.detail.id){case"view":(i=e.viewEnvelope)===null||i===void 0?void 0:i.emit({endpoint:e.endpoint,envelope:n});break;case"finish":(s=e.finishEnvelope)===null||s===void 0?void 0:s.emit({endpoint:e.endpoint,envelope:n});break;case"download":e.downloadEnvelope(n);break;case"cancel":if(window.confirm("Are you sure you want to cancel this envelope?")){cancelEnvelope(e.endpoint,n.id).then((function(){return VerdocsToast("Envelope canceled")})).catch((function(e){return VerdocsToast("Unable to cancel envelope: "+e.messabge,{style:"error"})}));e.queryEnvelopes().catch((function(){}))}break}}})))})),!this.initiallyLoaded&&h("div",{key:"dee1ed02683c459f29e503651684dce31f1c26d9",style:{width:"100%"}},integerSequence(0,this.rowsPerPage).map((function(){return h("div",{class:"envelope-placeholder"})}))),this.initiallyLoaded&&!this.envelopes.length&&h("div",{key:"b8381cec788ae60740e629e0ebe5f4de6c622139",class:"empty-text"},"No matching envelopes found. Please adjust your filters and try again."),this.initiallyLoaded&&this.envelopes.length&&this.showPagination?h("div",{style:{marginTop:"20px"}},h("verdocs-pagination",{selectedPage:this.selectedPage,perPage:this.rowsPerPage,itemCount:this.count,onSelectPage:function(n){e.selectedPage=n.detail.selectedPage}})):h("div",null))};Object.defineProperty(e,"watchers",{get:function(){return{view:["handleViewUpdated"],status:["handleStatusUpdated"],sort:["handleSortUpdated"],match:["handleMatchUpdated"],selectedPage:["handlePageUpdated"]}},enumerable:false,configurable:true});return e}();VerdocsEnvelopesList.style=verdocsEnvelopesListCss;export{VerdocsEnvelopesList as verdocs_envelopes_list};
2
2
  //# sourceMappingURL=verdocs-envelopes-list.entry.js.map