@verdocs/web-sdk 6.10.5 → 6.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Environment-C3P2cz0J.js +14 -0
- package/dist/cjs/Environment-C3P2cz0J.js.map +1 -0
- package/dist/cjs/{interact.min-CGi6ndGs.js → interact.min-CPZxI9Hv.js} +4 -4
- package/dist/cjs/interact.min-CPZxI9Hv.js.map +1 -0
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +16 -11
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-payment.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-sign.cjs.entry.js +5 -0
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-status-indicator.cjs.entry.js +135 -85
- package/dist/cjs/verdocs-status-indicator.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.css +2 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +5 -0
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +16 -11
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
- package/dist/collection/utils/Environment.js +5 -1
- package/dist/collection/utils/Environment.js.map +1 -1
- package/dist/components/p-6RWROB9R.js +2 -0
- package/dist/components/p-6RWROB9R.js.map +1 -0
- package/dist/components/{p-B3UP88BP.js → p-B1UVXqFA.js} +2 -2
- package/dist/components/{p-v9WkIq1Z.js → p-B6aUlIQe.js} +2 -2
- package/dist/components/{p-BUKCOnKs.js → p-BELGzhZw.js} +2 -2
- package/dist/components/{p-C1VW_3fv.js → p-BQUZjuoP.js} +2 -2
- package/dist/components/{p-CC7jlZnx.js → p-BYVQkYYg.js} +2 -2
- package/dist/components/p-C1iHkDUH.js +2 -0
- package/dist/components/p-C1iHkDUH.js.map +1 -0
- package/dist/components/{p-C4ygd3v_.js → p-COaijEV0.js} +2 -2
- package/dist/components/p-COaijEV0.js.map +1 -0
- package/dist/components/{p-DEhaAbKn.js → p-CYvB5bYX.js} +2 -2
- package/dist/components/{p-DnqXAqmP.js → p-Ck4pdoyc.js} +2 -2
- package/dist/components/{p-BA3SxsdQ.js → p-CsF979IT.js} +2 -2
- package/dist/components/{p-Bi94seCl.js → p-D-TexkaT.js} +2 -2
- package/dist/components/{p-DP_N7u8w.js → p-D1cSgqut.js} +2 -2
- package/dist/components/{p-B3nCB2u5.js → p-D7oMWhqM.js} +2 -2
- package/dist/components/{p-RvR1j0oO.js → p-DJMr11ue.js} +2 -2
- package/dist/components/{p-CHzNcBIz.js → p-DKKsPZnz.js} +2 -2
- package/dist/components/p-DavVixMP.js +2 -0
- package/dist/components/p-DavVixMP.js.map +1 -0
- package/dist/components/{p-CqVkL8_m.js → p-DfIxVX8-.js} +2 -2
- package/dist/components/{p-C_mtaGHG.js → p-DiYuPnJJ.js} +2 -2
- package/dist/components/{p-5fVPVL_Z.js → p-K_PKw6bs.js} +2 -2
- package/dist/components/p-b2u0_wDk.js +2 -0
- package/dist/components/p-b2u0_wDk.js.map +1 -0
- package/dist/components/{p-ohuuh9ZE.js → p-bPe0_Dsn.js} +2 -2
- package/dist/components/verdocs-build.js +1 -1
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-delegate-dialog.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +1 -1
- package/dist/components/verdocs-field-attachment.js +1 -1
- package/dist/components/verdocs-field-checkbox.js +1 -1
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-dropdown.js +1 -1
- package/dist/components/verdocs-field-initial.js +1 -1
- package/dist/components/verdocs-field-payment.js +1 -1
- package/dist/components/verdocs-field-radio.js +1 -1
- package/dist/components/verdocs-field-signature.js +1 -1
- package/dist/components/verdocs-field-textarea.js +1 -1
- package/dist/components/verdocs-field-textbox.js +1 -1
- package/dist/components/verdocs-field-timestamp.js +1 -1
- package/dist/components/verdocs-otp-dialog.js +1 -1
- package/dist/components/verdocs-passcode-dialog.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +1 -1
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-status-indicator.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-toolbar-icon.js +1 -1
- package/dist/esm/Environment-b2u0_wDk.js +12 -0
- package/dist/esm/Environment-b2u0_wDk.js.map +1 -0
- package/dist/esm/{interact.min-BO_a_7pQ.js → interact.min-Bf1WXbdg.js} +4 -4
- package/dist/esm/interact.min-Bf1WXbdg.js.map +1 -0
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +16 -11
- package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +2 -2
- package/dist/esm/verdocs-sign.entry.js +5 -0
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-status-indicator.entry.js +135 -85
- package/dist/esm/verdocs-status-indicator.entry.js.map +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/esm-es5/Environment-b2u0_wDk.js +2 -0
- package/dist/esm-es5/Environment-b2u0_wDk.js.map +1 -0
- package/dist/esm-es5/{interact.min-BO_a_7pQ.js → interact.min-Bf1WXbdg.js} +2 -2
- package/dist/esm-es5/interact.min-Bf1WXbdg.js.map +1 -0
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
- package/dist/esm-es5/verdocs-status-indicator.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-addd303e.system.entry.js → p-006f051b.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-006f051b.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-9c481477.entry.js → p-10d47bbd.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-39c54b65.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-39c54b65.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-4e0788f9.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-4e0788f9.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-d06d9cfd.entry.js → p-4e091415.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js → p-4ea0632f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js.map → p-4ea0632f.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-5f58b4cd.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-5f58b4cd.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-b3ac740e.system.entry.js → p-62464041.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4f9bd0bd.system.entry.js → p-6e8ce989.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ef1083c6.entry.js → p-734c8a8b.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ef1083c6.entry.js.map → p-734c8a8b.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
- package/dist/verdocs-web-sdk/p-COHG5J4h.system.js +2 -0
- package/dist/verdocs-web-sdk/p-COHG5J4h.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-C4ygd3v_.js → p-COaijEV0.js} +2 -2
- package/dist/verdocs-web-sdk/p-COaijEV0.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-DQMNv-mt.system.js → p-CQwimGbQ.system.js} +2 -2
- package/dist/{cjs/interact.min-CGi6ndGs.js.map → verdocs-web-sdk/p-CQwimGbQ.system.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-b2u0_wDk.js +2 -0
- package/dist/verdocs-web-sdk/p-b2u0_wDk.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js → p-ba0d4ff5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js.map → p-ba0d4ff5.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-18ce7226.system.entry.js → p-c86111fd.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-18ce7226.system.entry.js.map → p-c86111fd.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-1273627b.system.entry.js → p-ceda04bc.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-5c2025ca.entry.js → p-d95705c6.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4471c1b4.entry.js → p-ee92c074.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-6af0110a.system.entry.js → p-fad90cf9.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +4 -4
- package/dist/cjs/Environment-CP-XG6Lt.js +0 -13
- package/dist/cjs/Environment-CP-XG6Lt.js.map +0 -1
- package/dist/components/p-29evahil.js +0 -2
- package/dist/components/p-29evahil.js.map +0 -1
- package/dist/components/p-C4ygd3v_.js.map +0 -1
- package/dist/components/p-CA8hWmuL.js +0 -2
- package/dist/components/p-CA8hWmuL.js.map +0 -1
- package/dist/components/p-CYqVJ_kJ.js +0 -2
- package/dist/components/p-CYqVJ_kJ.js.map +0 -1
- package/dist/components/p-DtHLJ-XO.js +0 -2
- package/dist/components/p-DtHLJ-XO.js.map +0 -1
- package/dist/esm/Environment-29evahil.js +0 -11
- package/dist/esm/Environment-29evahil.js.map +0 -1
- package/dist/esm/interact.min-BO_a_7pQ.js.map +0 -1
- package/dist/esm-es5/Environment-29evahil.js +0 -2
- package/dist/esm-es5/Environment-29evahil.js.map +0 -1
- package/dist/esm-es5/interact.min-BO_a_7pQ.js.map +0 -1
- package/dist/verdocs-web-sdk/p-0eaeb487.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-0eaeb487.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-1a06dffb.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-1a06dffb.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-2636ac4d.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-2636ac4d.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-29evahil.js +0 -2
- package/dist/verdocs-web-sdk/p-29evahil.js.map +0 -1
- package/dist/verdocs-web-sdk/p-C4ygd3v_.js.map +0 -1
- package/dist/verdocs-web-sdk/p-CHg64SCg.system.js +0 -2
- package/dist/verdocs-web-sdk/p-CHg64SCg.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-DQMNv-mt.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-addd303e.system.entry.js.map +0 -1
- /package/dist/components/{p-B3UP88BP.js.map → p-B1UVXqFA.js.map} +0 -0
- /package/dist/components/{p-v9WkIq1Z.js.map → p-B6aUlIQe.js.map} +0 -0
- /package/dist/components/{p-BUKCOnKs.js.map → p-BELGzhZw.js.map} +0 -0
- /package/dist/components/{p-C1VW_3fv.js.map → p-BQUZjuoP.js.map} +0 -0
- /package/dist/components/{p-CC7jlZnx.js.map → p-BYVQkYYg.js.map} +0 -0
- /package/dist/components/{p-DEhaAbKn.js.map → p-CYvB5bYX.js.map} +0 -0
- /package/dist/components/{p-DnqXAqmP.js.map → p-Ck4pdoyc.js.map} +0 -0
- /package/dist/components/{p-BA3SxsdQ.js.map → p-CsF979IT.js.map} +0 -0
- /package/dist/components/{p-Bi94seCl.js.map → p-D-TexkaT.js.map} +0 -0
- /package/dist/components/{p-DP_N7u8w.js.map → p-D1cSgqut.js.map} +0 -0
- /package/dist/components/{p-B3nCB2u5.js.map → p-D7oMWhqM.js.map} +0 -0
- /package/dist/components/{p-RvR1j0oO.js.map → p-DJMr11ue.js.map} +0 -0
- /package/dist/components/{p-CHzNcBIz.js.map → p-DKKsPZnz.js.map} +0 -0
- /package/dist/components/{p-CqVkL8_m.js.map → p-DfIxVX8-.js.map} +0 -0
- /package/dist/components/{p-C_mtaGHG.js.map → p-DiYuPnJJ.js.map} +0 -0
- /package/dist/components/{p-5fVPVL_Z.js.map → p-K_PKw6bs.js.map} +0 -0
- /package/dist/components/{p-ohuuh9ZE.js.map → p-bPe0_Dsn.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-9c481477.entry.js.map → p-10d47bbd.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-d06d9cfd.entry.js.map → p-4e091415.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-b3ac740e.system.entry.js.map → p-62464041.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4f9bd0bd.system.entry.js.map → p-6e8ce989.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-1273627b.system.entry.js.map → p-ceda04bc.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-5c2025ca.entry.js.map → p-d95705c6.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4471c1b4.entry.js.map → p-ee92c074.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-6af0110a.system.entry.js.map → p-fad90cf9.system.entry.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"p-b2u0_wDk.js","sources":["src/utils/Environment.ts"],"sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\n\nexport const BETA_ORIGINS = ['https://beta.verdocs.com', 'https://stage.verdocs.com', 'http://localhost:6006', 'http://localhost:5173'];\n\nexport const IS_BETA = BETA_ORIGINS.includes(window.location.origin);\n\nexport const API_URL = IS_BETA ? 'https://stage-api.verdocs.com' : 'https://api.verdocs.com';\n\n// NOTE: Do not call setBaseURL(). The constructor already does, but more important, in most environments\n// this particular code block is lazily loaded and gets run on a component render. That creates a race\n// condition that silently overwrites a host-app preference and is hard to track down. (Definitely breaks\n// the Teams app, among other things.)\nexport const DefaultEndpoint = VerdocsEndpoint.getDefault();\n"],"names":[],"mappings":";;AAQA;AACA;AACA;AACA;MACa,eAAe,GAAG,eAAe,CAAC,UAAU;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function n(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o["throw"](e))}catch(e){s(e)}}function c(e){e.done?i(e.value):r(e.value).then(n,a)}c((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o,r,s,n=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return n.next=a(0),n["throw"]=a(1),n["return"]=a(2),typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(e){return function(t){return c([e,t])}}function c(a){if(o)throw new TypeError("Generator is already executing.");while(n&&(n=0,a[0]&&(i=0)),i)try{if(o=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=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(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{o=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-De3fNE_u.system.js","@verdocs/js-sdk","./p-nfw6V5pF.system.js","./p-fEbwslLK.system.js","./p-DzZgjFK8.system.js","./p-C7pDryJb.system.js","./p-CwIkMPyJ.system.js"],(function(e){"use strict";var t,i,o,r,s,n,a,c,l,d,u,p,h,f;return{setters:[function(e){t=e.r;i=e.c;o=e.h;r=e.H;s=e.F;n=e.g},function(e){a=e.VerdocsEndpoint;c=e.getTemplateDocumentPageDisplayUri;l=e.getTemplate},function(e){d=e.t;u=e.f;p=e.g},function(e){h=e.S},function(e){f=e.c},null,null],execute:function(){var v=function(){return"verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-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-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;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)}"};var b=e("verdocs_template_document_page",function(){function e(e){t(this,e);this.pageRendered=i(this,"pageRendered");this.templateListenerId=null;this.endpoint=a.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-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="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}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,c(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(d((function(t){for(var i=0,o=t;i<o.length;i++){var r=o[i];var s=r.contentRect.width;e.renderedWidth=s;e.renderedHeight=e.virtualHeight*(s/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}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:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return o(r,null,o("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return o(r,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){var r;return i.type==="div"?o("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}},i.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.document_id===e.documentId&&t.page===e.pageNumber})).map((function(t){var i,r;var n=p(t);var a=t.name,c=t.type,l=t.multiline;var d=e,h=d.xScale,f=d.yScale,v=d.templateId,b=d.editable,m=d.disabled,g=d.done,x=d.pageNumber;if(((i=t["setting"])===null||i===void 0?void 0:i.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){c="textarea";l=true}switch(c){case"textbox":return o("verdocs-field-textbox",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,multiline:l,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"textarea":return o("verdocs-field-textarea",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"date":return o("verdocs-field-date",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"attachment":return o("verdocs-field-attachment",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"dropdown":return o("verdocs-field-dropdown",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"initial":return o("verdocs-field-initial",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"signature":return o("verdocs-field-signature",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,e.xScale,e.yScale)});case"timestamp":return o("verdocs-field-timestamp",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"checkbox":return o("verdocs-field-checkbox",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"radio":return o("verdocs-field-radio",{id:n,fieldname:a,source:"template",sourceid:v,editable:b,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});default:return o(s,null,a)}}))):e.pageDisplayUri?o("img",{class:"verdocs-template-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}}):o("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());b.style=v();var m=function(){return'verdocs-toolbar-icon{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}'};var g=e("verdocs_toolbar_icon",function(){function e(e){t(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=f(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return o(r,{key:"56dd7cebb5a2761547a5e24ec76652f7052906b2",class:{}},o("div",{key:"8d2f5e8578bdf5b25db200406460d9e2724c168e","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),o("div",{key:"371c80cf2be530cf3fd8ddb7308fd30f65f3b3f4",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,o("div",{key:"39b43e589f2b52f1658562e79a3d6388478bdcbe","data-popper-arrow":"true",class:"arrow"})))};return e}());g.style=m()}}}));
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,i,o){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,s){function n(e){try{c(o.next(e))}catch(e){s(e)}}function a(e){try{c(o["throw"](e))}catch(e){s(e)}}function c(e){e.done?i(e.value):r(e.value).then(n,a)}c((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o,r,s,n=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return n.next=a(0),n["throw"]=a(1),n["return"]=a(2),typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function a(e){return function(t){return c([e,t])}}function c(a){if(o)throw new TypeError("Generator is already executing.");while(n&&(n=0,a[0]&&(i=0)),i)try{if(o=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=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(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{o=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-De3fNE_u.system.js","@verdocs/js-sdk","./p-nfw6V5pF.system.js","./p-fEbwslLK.system.js","./p-DzZgjFK8.system.js","./p-C7pDryJb.system.js","./p-CwIkMPyJ.system.js"],(function(e){"use strict";var t,i,o,r,s,n,a,c,l,d,u,p,h,f;return{setters:[function(e){t=e.r;i=e.c;o=e.h;r=e.H;s=e.F;n=e.g},function(e){a=e.VerdocsEndpoint;c=e.getTemplateDocumentPageDisplayUri;l=e.getTemplate},function(e){d=e.t;u=e.f;p=e.g},function(e){h=e.S},function(e){f=e.c},null,null],execute:function(){var b=function(){return"verdocs-template-document-page{width:100%;position:relative}verdocs-template-document-page .verdocs-template-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-template-document-page .verdocs-template-document-page-layer.img{width:100%}verdocs-template-document-page .placeholder{opacity:0.1;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)}"};var v=e("verdocs_template_document_page",function(){function e(e){t(this,e);this.pageRendered=i(this,"pageRendered");this.templateListenerId=null;this.endpoint=a.getDefault();this.editable=false;this.disabled=false;this.done=false;this.templateId="";this.documentId="";this.pageNumber=1;this.virtualWidth=612;this.virtualHeight=792;this.layers=[{name:"page",type:"canvas"}];this.containerId="verdocs-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="";this.xScale=1;this.yScale=1;this.loading=true;this.template=null}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,c(this.endpoint,this.documentId,this.pageNumber)];case 1:e.pageDisplayUri=t.sent();this.listenToTemplate();return[2]}}))}))};e.prototype.componentDidLoad=function(){var e=this;this.resizeObserver=new ResizeObserver(d((function(t){for(var i=0,o=t;i<o.length;i++){var r=o[i];var s=r.contentRect.width;e.renderedWidth=s;e.renderedHeight=e.virtualHeight*(s/e.virtualWidth)}e.notifyRenderedSize()}),100));this.resizeObserver.observe(this.container)};e.prototype.componentDidUpdate=function(){this.notifyRenderedSize()};e.prototype.disconnectedCallback=function(){var e;(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();this.unlistenToTemplate()};e.prototype.listenToTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){this.unlistenToTemplate();h.subscribe("templates",this.templateId,(function(){return l(e.endpoint,e.templateId)}),false,(function(t){e.template=t;e.loading=false}));return[2]}))}))};e.prototype.unlistenToTemplate=function(){if(this.templateListenerId){h.store.delListener(this.templateListenerId);this.templateListenerId=null}};e.prototype.notifyRenderedSize=function(){if(this.skipFirstNotification){this.skipFirstNotification=false;return}var e=this.renderedWidth/this.virtualWidth;if(this.xScale!==e){this.xScale=e}var t=this.renderedHeight/this.virtualHeight;if(this.yScale!==t){this.yScale=t}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:e,yScale:t})};e.prototype.render=function(){var e=this;if(this.loading){return o(r,null,o("img",{src:"https://public-assets.verdocs.com/loading-placeholder.png",class:"placeholder",alt:"Placeholder page"}))}var t="".concat(this.renderedHeight,"px");return o(r,{id:"".concat(this.containerId),style:{height:t,flex:"0 0 ".concat(t)}},this.layers.map((function(i){var r;return i.type==="div"?o("div",{class:"verdocs-template-document-page-layer",id:"".concat(e.containerId,"-").concat(i.name),style:{height:t}},i.name==="controls"&&(((r=e.template)===null||r===void 0?void 0:r.fields)||[]).filter((function(t){return t&&t.document_id===e.documentId&&t.page===e.pageNumber})).map((function(t){var i,r;var n=p(t);var a=t.name,c=t.type,l=t.multiline;var d=e,h=d.xScale,f=d.yScale,b=d.templateId,v=d.editable,m=d.disabled,g=d.done,x=d.pageNumber;if(((i=t["setting"])===null||i===void 0?void 0:i.leading)>0||((r=t["settings"])===null||r===void 0?void 0:r.leading)>0){c="textarea";l=true}switch(c){case"textbox":return o("verdocs-field-textbox",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,multiline:l,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"textarea":return o("verdocs-field-textarea",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"date":return o("verdocs-field-date",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"attachment":return o("verdocs-field-attachment",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"dropdown":return o("verdocs-field-dropdown",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"initial":return o("verdocs-field-initial",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"signature":return o("verdocs-field-signature",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,e.xScale,e.yScale)});case"timestamp":return o("verdocs-field-timestamp",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"checkbox":return o("verdocs-field-checkbox",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});case"radio":return o("verdocs-field-radio",{id:n,fieldname:a,source:"template",sourceid:b,editable:v,disabled:m,done:g,xscale:h,yscale:f,pagenumber:x,isPreview:true,style:u(t,h,f)});default:return o(s,null,a)}}))):e.pageDisplayUri?o("img",{class:"verdocs-template-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}}):o("div",null)})))};Object.defineProperty(e.prototype,"container",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());v.style=b();var m=function(){return'verdocs-toolbar-icon{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:absolute;pointer-events:none;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}'};var g=e("verdocs_toolbar_icon",function(){function e(e){t(this,e);this.text="";this.icon="";this.placement="bottom";this.containerId="verdocs-toolbar-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=f(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return o(r,{key:"56dd7cebb5a2761547a5e24ec76652f7052906b2",class:{}},o("div",{key:"8d2f5e8578bdf5b25db200406460d9e2724c168e","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.iconEl=t}}),o("div",{key:"371c80cf2be530cf3fd8ddb7308fd30f65f3b3f4",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:function(t){return e.tooltip=t}},this.text,o("div",{key:"39b43e589f2b52f1658562e79a3d6388478bdcbe","data-popper-arrow":"true",class:"arrow"})))};return e}());g.style=m()}}}));
|
|
2
|
+
//# sourceMappingURL=p-ba0d4ff5.system.entry.js.map
|
package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js.map → p-ba0d4ff5.system.entry.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPage","exports","class_1","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","concat","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","prototype","componentWillLoad","_c","getTemplateDocumentPageDisplayUri","_d","sent","listenToTemplate","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","document_id","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","isPreview","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIcon","class_2","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop({reflect: true}) templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop({reflect: true}) documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop({reflect: true}) pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.document_id === this.documentId && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n position: relative;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"6gEAAA,IAAMA,EAAiC,WAAM,gkB,ICmBhCC,EAA2BC,EAAA,4CALxC,SAAAC,EAAAC,G,mDAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,EAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKQP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMpCV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAAC,OAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAC/ErB,KAAAsB,cAAwBtB,KAAKW,aAC7BX,KAAAuB,eAAyBvB,KAAKY,cAC9BZ,KAAAwB,aAAuBxB,KAAKW,aAC5BX,KAAAyB,cAAwBzB,KAAKY,cAC7BZ,KAAA0B,YAAsB1B,KAAKW,aAAeX,KAAKY,cAC/CZ,KAAA2B,sBAAwB,KACx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qD,IAAA,+DAAuB,OAAOlD,MAAM,W,WAxEf,I","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["verdocsTemplateDocumentPageCss","VerdocsTemplateDocumentPage","exports","class_1","hostRef","this","templateListenerId","endpoint","VerdocsEndpoint","getDefault","editable","disabled","done","templateId","documentId","pageNumber","virtualWidth","virtualHeight","layers","name","type","containerId","concat","Math","random","toString","substring","renderedWidth","renderedHeight","naturalWidth","naturalHeight","aspectRatio","skipFirstNotification","pageDisplayUri","xScale","yScale","loading","template","prototype","componentWillLoad","_c","getTemplateDocumentPageDisplayUri","_d","sent","listenToTemplate","componentDidLoad","_this","resizeObserver","ResizeObserver","throttle","entries","_i","entries_1","length","entry","contentRect","width","notifyRenderedSize","observe","container","componentDidUpdate","disconnectedCallback","_a","disconnect","unlistenToTemplate","Store","subscribe","getTemplate","store","delListener","pageRendered","emit","render","h","Host","src","class","alt","height","id","style","flex","map","layer","fields","filter","field","document_id","page","getFieldId","multiline","leading","_b","fieldname","source","sourceid","xscale","yscale","pagenumber","isPreview","getControlStyles","Fragment","onLoad","e","target","offsetWidth","verdocsToolbarIconCss","VerdocsToolbarIcon","class_2","text","icon","placement","popperInstance","createPopper","iconEl","tooltip","modifiers","options","offset","destroy","show","setAttribute","update","catch","hide","removeAttribute","key","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","role"],"sources":["src/components/templates/verdocs-template-document-page/verdocs-template-document-page.scss?tag=verdocs-template-document-page","src/components/templates/verdocs-template-document-page/verdocs-template-document-page.tsx","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-template-document-page {\n width: 100%;\n position: relative;\n\n .verdocs-template-document-page-layer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n box-shadow: 0 0 10px 5px #0000000f;\n\n &.img {\n width: 100%;\n }\n }\n\n .placeholder {\n opacity: 0.1;\n width: 612px;\n height: 792px;\n box-shadow: 0 0 10px 5px #0000000f;\n }\n}\n","// NOTE: This component does not have a story because it's not intended for external use.\n\nimport {getTemplate, getTemplateDocumentPageDisplayUri, type ITemplate, VerdocsEndpoint} from '@verdocs/js-sdk';\nimport {Component, h, Host, Prop, Event, EventEmitter, State, Element, Fragment} from '@stencil/core';\nimport {IDocumentPageInfo, IPageLayer} from '../../../utils/Types';\nimport {getControlStyles, getFieldId} from '../../../utils/utils';\nimport {throttle} from '../../../utils/utils';\nimport {Store} from '../../../utils/Datastore';\n\n/**\n * Represents one document page. This is primarily a layout container used to coordinate positions of\n * page-related layers such as the page itself, signature fields, etc. It is not intended to be used\n * on its own as an individual component.\n */\n@Component({\n tag: 'verdocs-template-document-page',\n styleUrl: 'verdocs-template-document-page.scss',\n shadow: false,\n})\nexport class VerdocsTemplateDocumentPage {\n private templateListenerId = null;\n private resizeObserver: ResizeObserver;\n\n @Element() container: HTMLElement;\n\n /**\n * The endpoint to load from.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Whether the fields should be editable (Builder)\n */\n @Prop() editable = false;\n\n /**\n * Whether the fields should be disabled (Builder)\n */\n @Prop() disabled = false;\n\n /**\n * Whether the field are interactable (done/submitted disables this)\n */\n @Prop() done = false;\n\n /**\n * The ID of the template the document is for.\n */\n @Prop({reflect: true}) templateId: string = '';\n\n /**\n * The ID of the document to display.\n */\n @Prop({reflect: true}) documentId: string = '';\n\n /**\n * The page number being rendered. (Reminder: page numbers are 1-based.)\n */\n @Prop({reflect: true}) pageNumber: number = 1;\n\n /**\n * The \"virtual\" width of the page canvas. Defaults to 612 which at 72dpi is 8.5\" wide. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop() virtualWidth: number = 612;\n\n /**\n * The \"virtual\" height of the page canvas. Defaults to 792 which at 72dpi is 11\" tall. This is used to compute\n * the aspect ratio of the final rendered element when scaling up/down.\n */\n @Prop({mutable: true}) virtualHeight: number = 792;\n\n /**\n * The layers that will be rendered. The DOM structure will be a DIV container with one child DIV for each layer.\n * The parent DIV will have a unique ID, and each child DIV will have that ID with the layer name appended, e.g.\n * if `pages` was ['page', 'fields'] the structure will be:\n *\n * ```\n * <div id=\"verdocs-document-page-ker2fr1p9\">\n * <div id=\"verdocs-document-page-ker2fr1p9-page\"></div>\n * <div id=\"verdocs-document-page-ker2fr1p9-fields\"></div>\n * </div>\n * ```\n */\n @Prop() layers: IPageLayer[] = [{name: 'page', type: 'canvas'}];\n\n /**\n * Fired when a page has been rendered. This is also fired when the page is resized.\n */\n @Event() pageRendered: EventEmitter<IDocumentPageInfo>;\n\n @State() containerId = `verdocs-document-page-${Math.random().toString(36).substring(2, 11)}`;\n @State() renderedWidth: number = this.virtualWidth;\n @State() renderedHeight: number = this.virtualHeight;\n @State() naturalWidth: number = this.virtualWidth;\n @State() naturalHeight: number = this.virtualHeight;\n @State() aspectRatio: number = this.virtualWidth / this.virtualHeight;\n @State() skipFirstNotification = true;\n @State() pageDisplayUri = '';\n @State() xScale = 1;\n @State() yScale = 1;\n\n @State() loading = true;\n @State() template: ITemplate | null = null;\n\n async componentWillLoad() {\n this.pageDisplayUri = await getTemplateDocumentPageDisplayUri(this.endpoint, this.documentId, this.pageNumber);\n this.listenToTemplate();\n }\n\n componentDidLoad() {\n this.resizeObserver = new ResizeObserver(\n throttle(entries => {\n for (const entry of entries) {\n const renderedWidth = entry.contentRect.width;\n this.renderedWidth = renderedWidth;\n this.renderedHeight = this.virtualHeight * (renderedWidth / this.virtualWidth);\n }\n\n this.notifyRenderedSize();\n }, 100),\n );\n\n this.resizeObserver.observe(this.container);\n }\n\n componentDidUpdate() {\n // This is fired when fields are updated and triggers the parent to re-attach behaviors like drag-and-drop\n this.notifyRenderedSize();\n }\n\n disconnectedCallback() {\n this.resizeObserver?.disconnect();\n this.unlistenToTemplate();\n }\n\n async listenToTemplate() {\n this.unlistenToTemplate();\n Store.subscribe(\n 'templates',\n this.templateId,\n () => getTemplate(this.endpoint, this.templateId),\n false,\n (template: ITemplate) => {\n this.template = template;\n this.loading = false;\n },\n );\n }\n\n unlistenToTemplate() {\n if (this.templateListenerId) {\n Store.store.delListener(this.templateListenerId);\n this.templateListenerId = null;\n }\n }\n\n notifyRenderedSize() {\n // We skip one notification because by default we will always get at least two, one when rendering the initial size\n // and a second once we're able to compute the scale size, when the resizeObserver sets renderedWidth/renderedHeight.\n if (this.skipFirstNotification) {\n this.skipFirstNotification = false;\n return;\n }\n\n const xScale = this.renderedWidth / this.virtualWidth;\n if (this.xScale !== xScale) {\n this.xScale = xScale;\n }\n\n const yScale = this.renderedHeight / this.virtualHeight;\n if (this.yScale !== yScale) {\n this.yScale = yScale;\n }\n\n this.pageRendered.emit({\n // container: this.container,\n containerId: this.containerId,\n documentId: this.documentId,\n pageNumber: this.pageNumber,\n virtualWidth: this.virtualWidth,\n virtualHeight: this.virtualHeight,\n renderedWidth: this.renderedWidth,\n renderedHeight: this.renderedHeight,\n naturalWidth: this.naturalWidth,\n naturalHeight: this.naturalHeight,\n aspectRatio: this.aspectRatio,\n xScale,\n yScale,\n });\n }\n\n render() {\n if (this.loading) {\n return (\n <Host>\n <img src=\"https://public-assets.verdocs.com/loading-placeholder.png\" class=\"placeholder\" alt=\"Placeholder page\" />\n </Host>\n );\n }\n\n const height = `${this.renderedHeight}px`;\n\n return (\n <Host id={`${this.containerId}`} style={{height, flex: `0 0 ${height}`}}>\n {this.layers.map(layer =>\n layer.type === 'div' ? (\n <div class=\"verdocs-template-document-page-layer\" id={`${this.containerId}-${layer.name}`} style={{height}}>\n {layer.name === 'controls' &&\n (this.template?.fields || [])\n .filter(field => field && field.document_id === this.documentId && field.page === this.pageNumber)\n .map(field => {\n const id = getFieldId(field);\n let {name, type, multiline} = field;\n const {xScale, yScale, templateId, editable, disabled, done, pageNumber} = this;\n if (field['setting']?.leading > 0 || field['settings']?.leading > 0) {\n type = 'textarea';\n multiline = true;\n }\n switch (type as any) {\n case 'textbox':\n return (\n <verdocs-field-textbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n multiline={multiline}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'textarea':\n return (\n <verdocs-field-textarea\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'date':\n return (\n <verdocs-field-date\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'attachment':\n return (\n <verdocs-field-attachment\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'dropdown':\n return (\n <verdocs-field-dropdown\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'initial':\n return (\n <verdocs-field-initial\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'signature':\n return (\n <verdocs-field-signature\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, this.xScale, this.yScale)}\n />\n );\n case 'timestamp':\n return (\n <verdocs-field-timestamp\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'checkbox':\n return (\n <verdocs-field-checkbox\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n case 'radio':\n return (\n <verdocs-field-radio\n id={id}\n fieldname={name}\n source=\"template\"\n sourceid={templateId}\n editable={editable}\n disabled={disabled}\n done={done}\n xscale={xScale}\n yscale={yScale}\n pagenumber={pageNumber}\n isPreview\n style={getControlStyles(field, xScale, yScale)}\n />\n );\n default:\n return <Fragment>{name}</Fragment>;\n }\n })}\n </div>\n ) : this.pageDisplayUri ? (\n <img\n class=\"verdocs-template-document-page-layer img\"\n id={`${this.containerId}-${layer.name}`}\n src={this.pageDisplayUri}\n alt={`Page ${this.pageNumber}`}\n aria-hidden={true}\n loading=\"lazy\"\n onLoad={(e: any) => {\n // Note that all we really care about is the aspect ratio. We track the natural Width and Height but they aren't really that\n // useful as individual values. The image will already have been scaled down to fit a DIV for display (100%, auto height).\n // Builder places fields offset into the rendered display area, not the original document's dimensions. So its X/Y values\n // for a field are based on the responsive Web view the Template editor was seeing. The IMG was scaled down there in the\n // exact same way, so we just honor it. We capture the natural width and height here more as information. Then we use the\n // aspect ratio to adjust the \"virtual\" height in case the page is not 8.5\"x11\".\n // TODO: Store this in the DB with each page.\n this.naturalWidth = e.target.naturalWidth;\n this.naturalHeight = e.target.naturalHeight;\n this.aspectRatio = this.naturalWidth / this.naturalHeight;\n this.virtualHeight = this.virtualWidth / this.aspectRatio;\n this.renderedHeight = e.target.offsetWidth / this.aspectRatio;\n }}\n />\n ) : (\n <div></div>\n ),\n )}\n </Host>\n );\n }\n}\n","@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n // MUST be absolute. Popper positions the tooltip with inline transforms and assumes it is out\n // of the normal flow. With position:relative the tooltip instead occupies space inside the\n // flex container when shown, which widens the toolbar and shifts the icon out from under the\n // pointer. That fires mouseleave -> hide -> layout collapses -> mouseenter -> show, an endless\n // flicker where the icon can never be clicked. It only bites where the toolbar has no slack to\n // absorb the width change (e.g. the Teams tab), which is why it looked fine in the web app.\n position: absolute;\n // The tooltip is decoration; never let it capture the hover it was triggered by.\n pointer-events: none;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"6gEAAA,IAAMA,EAAiC,WAAM,gkB,ICmBhCC,EAA2BC,EAAA,4CALxC,SAAAC,EAAAC,G,mDAMUC,KAAAC,mBAAqB,KAQrBD,KAAAE,SAA4BC,EAAgBC,aAK5CJ,KAAAK,SAAW,MAKXL,KAAAM,SAAW,MAKXN,KAAAO,KAAO,MAKQP,KAAAQ,WAAqB,GAKrBR,KAAAS,WAAqB,GAKrBT,KAAAU,WAAqB,EAMpCV,KAAAW,aAAuB,IAMRX,KAAAY,cAAwB,IAcvCZ,KAAAa,OAAuB,CAAC,CAACC,KAAM,OAAQC,KAAM,WAO5Cf,KAAAgB,YAAc,yBAAAC,OAAyBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAC/ErB,KAAAsB,cAAwBtB,KAAKW,aAC7BX,KAAAuB,eAAyBvB,KAAKY,cAC9BZ,KAAAwB,aAAuBxB,KAAKW,aAC5BX,KAAAyB,cAAwBzB,KAAKY,cAC7BZ,KAAA0B,YAAsB1B,KAAKW,aAAeX,KAAKY,cAC/CZ,KAAA2B,sBAAwB,KACxB3B,KAAA4B,eAAiB,GACjB5B,KAAA6B,OAAS,EACT7B,KAAA8B,OAAS,EAET9B,KAAA+B,QAAU,KACV/B,KAAAgC,SAA6B,IAmUvC,CAjUOlC,EAAAmC,UAAAC,kBAAN,W,kHACEC,EAAAnC,KAAsB,SAAMoC,EAAkCpC,KAAKE,SAAUF,KAAKS,WAAYT,KAAKU,a,OAAnGyB,EAAKP,eAAiBS,EAAAC,OACtBtC,KAAKuC,mB,kBAGPzC,EAAAmC,UAAAO,iBAAA,eAAAC,EAAAzC,KACEA,KAAK0C,eAAiB,IAAIC,eACxBC,GAAS,SAAAC,GACP,IAAoB,IAAAC,EAAA,EAAAC,EAAAF,EAAAC,EAAA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C7B,EAAAvF,KAAK2G,kBAAc,MAAApB,SAAA,SAAAA,EAAE8B,SAASC,OAAM,WAAK,G,EAG3Cf,EAAAtE,UAAAsF,KAAA,W,OACE9D,EAAAzD,KAAK8G,WAAO,MAAArD,SAAA,SAAAA,EAAE+D,gBAAgB,Y,EAOhCjB,EAAAtE,UAAAkC,OAAA,eAAA1B,EAAAzC,KACE,OACEoE,EAACC,EAAI,CAAAoD,IAAA,2CAAClD,MAAO,IACXH,EAAA,OAAAqD,IAAA,8DACoBzH,KAAKgB,YACvBuD,MAAM,OACNmD,UAAW1H,KAAKyG,KAChBkB,aAAc,WAAM,OAAAlF,EAAK0E,MAAL,EACpBS,QAAS,WAAM,OAAAnF,EAAK0E,MAAL,EACfU,aAAc,WAAM,OAAApF,EAAK8E,MAAL,EACpBO,OAAQ,WAAM,OAAArF,EAAK8E,MAAL,EACdQ,IAAK,SAAAC,GAAE,OAAKvF,EAAKoE,OAASmB,CAAnB,IAET5D,EAAA,OAAAqD,IAAA,2CAAK/C,GAAI1E,KAAKgB,YAAaiH,KAAK,UAAU1D,MAAM,UAAS,wBAAwBvE,KAAK0G,UAAWqB,IAAK,SAAAC,GAAE,OAAKvF,EAAKqE,QAAUkB,CAApB,GACrGhI,KAAKwG,KACNpC,EAAA,OAAAqD,IAAA,+DAAuB,OAAOlD,MAAM,W,WAxEf,I","ignoreList":[]}
|
|
@@ -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,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?i(e.value):r(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=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(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=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,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,s;n<r;n++){if(s||!(n in t)){if(!s)s=Array.prototype.slice.call(t,0,n);s[n]=t[n]}}return e.concat(s||Array.prototype.slice.call(t))};System.register(["./p-De3fNE_u.system.js","@verdocs/js-sdk","./p-nfw6V5pF.system.js","./p-CwIkMPyJ.system.js","./p-GqS1qR-V.system.js","./p-Dj475wLP.system.js","./p-7Iu0_GGa.system.js","./p-fEbwslLK.system.js","./p-C7pDryJb.system.js"],(function(e){"use strict";var t,i,n,r,s,o,a,l,c,d,u,h,f,v,p,g,m,x,b,w,y,k,C,_,S,I,N,z,G,L,H,T,E,q,D,M,V,j,A,P,U;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.F;o=e.g},function(e){a=e.VerdocsEndpoint;l=e.DEFAULT_DISCLOSURES;c=e.startSigningSession;d=e.getEnvelope;u=e.envelopeRecipientAgree;h=e.updateEnvelopeField;f=e.createSignature;v=e.createInitials;p=e.sortFields;g=e.envelopeRecipientSubmit;m=e.isFieldValid;x=e.isFieldFilled;b=e.uploadEnvelopeFieldAttachment;w=e.deleteEnvelopeFieldAttachment;y=e.formatFullName;k=e.fullNameToInitials;C=e.verifySigner;_=e.getEnvelopesZip;S=e.getEnvelopeDocumentDownloadLink;I=e.getCombinedEnvelopeDocumentDownloadLink;N=e.delegateRecipient;z=e.envelopeRecipientDecline;G=e.integerSequence;L=e.askQuestion},function(e){H=e.u;T=e.g;E=e.r;q=e.a;D=e.d},function(e){M=e.D},function(e){V=e.D;j=e.C},function(e){A=e.V},function(e){P=e.S},function(e){U=e.S},null],execute:function(){var R=function(){return'verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;min-height:700px;position:relative;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#f5f5f5;font-family:var(--verdocs-primary-font, "Inter", "Barlow", 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;padding-right:140px;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>.document .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;max-width:1028px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-sign>.document .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-sign>.document .document-separator:first-child{margin-top:0}verdocs-sign .signed-document-container{width:64%;margin-left:260px;-webkit-transition:all 0.3s ease;transition:all 0.3s ease}verdocs-sign .signed-document-container.zoom-normal{width:64%;margin-left:260px}verdocs-sign .signed-document-container.zoom-zoom1{width:80%;margin-left:200px}verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:150px}verdocs-sign .signed-document-container.zoom-zoom2 .verdocs-flag-instance{opacity:0;pointer-events:none}@media (max-width: 768px){verdocs-sign verdocs-sign-footer{padding:0 10px}verdocs-sign verdocs-sign-footer .buttons{gap:8px}verdocs-sign verdocs-sign-footer .buttons button{font-size:10px}verdocs-sign .signed-document-container{width:100%;margin-left:0}verdocs-sign .signed-document-container.zoom-normal,verdocs-sign .signed-document-container.zoom-zoom1,verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:0}verdocs-sign>.document{padding-right:15px}verdocs-sign .verdocs-flag-instance{display:none !important}verdocs-sign .controls-toolbar .center-controls{display:none}verdocs-sign .controls-toolbar .right-controls .mobile-next-button{display:block;margin-right:10px}verdocs-sign .controls-toolbar .right-controls .minus,verdocs-sign .controls-toolbar .right-controls .plus{display:none}}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,.controls-toolbar,.verdocs-flag-instance,verdocs-signing-progress{display:none !important}verdocs-sign{min-height:auto;background-color:white}verdocs-sign>.document{overflow:visible;height:auto;display:block;padding:0;margin:0}verdocs-sign>.document .document-separator{display:none}verdocs-sign .signed-document-container{width:100%;margin:0}}#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;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px}#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}@media (max-width: 670px){#verdocs-sign-header .title{font-size:14px}}#verdocs-sign-header .remaining-count{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:8px;color:#ffffff;font-size:13px;font-weight:400;white-space:nowrap}#verdocs-sign-header .remaining-count .check-icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}#verdocs-sign-header .remaining-count .check-icon svg{width:16px;height:16px;fill:#55bc81}#verdocs-sign-header .remaining-count .separator{opacity:0.5;margin:0 2px}#verdocs-sign-header .remaining-count .review-optional{cursor:pointer;text-decoration:underline}#verdocs-sign-header .remaining-count .review-optional:hover{color:#54d68c}@media (max-width: 670px){#verdocs-sign-header .remaining-count .review-optional{display:none}}@media (max-width: 670px){#verdocs-sign-header .remaining-count{font-size:12px}}#verdocs-sign-header .icon-button{width:20px;height:32px;display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:4px;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}#verdocs-sign-header .icon-button svg path{fill:#ffffff}#verdocs-sign-header .icon-button:hover{background-color:rgba(255, 255, 255, 0.1)}#verdocs-sign-header .icon-button.disabled{opacity:0.35;pointer-events:none}#verdocs-sign-header .icon-button+.icon-button{margin-left:-6px}@media (max-width: 670px){#verdocs-sign-header .icon-button.magnify{display:none}}.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}.controls-toolbar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:54px;padding:0 12px 0 24px;background-color:#ffffff;border-bottom:1px solid #e0e0e0;-webkit-box-shadow:none;box-shadow:none;font-family:"Inter", sans-serif;color:#424242;z-index:1000}.controls-toolbar .left-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .left-controls .title{font-weight:500;font-size:16px;color:#242424;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.controls-toolbar .center-controls{-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:10px;font-size:14px;display:none}.controls-toolbar .center-controls .label{color:#000000;font-weight:300}.controls-toolbar .center-controls .select-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .center-controls .select-wrapper verdocs-select-input{margin:0}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-label{display:none}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element{background:transparent;border:1px solid #e0e0e0;height:32px;padding:2px 8px;min-width:60px;text-align:center;font-family:inherit;color:#424242}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element:focus{border-color:var(--verdocs-primary-color, #55bc81)}.controls-toolbar .center-controls .count{color:#000000;font-weight:300}.controls-toolbar .right-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.controls-toolbar .right-controls .mobile-next-button{display:none}.controls-toolbar .right-controls .icon-button{width:32px;height:32px;display:-ms-flexbox;display:flex;color:#424242;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}.controls-toolbar .right-controls .icon-button:hover{background-color:#f5f5f5}.controls-toolbar .right-controls .icon-button.disabled{opacity:0.3;pointer-events:none}.controls-toolbar .right-controls .icon-button svg{display:block;width:20px;height:20px}'};var O='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11ZM14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z" fill="#424242" /></svg>';var Y='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5ZM8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z" fill="#424242" /></svg>';var Z='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 16.9988C15.7761 16.9988 16 17.2226 16 17.4988C16 17.7442 15.8231 17.9484 15.5899 17.9907L15.5 17.9988H4.5C4.22386 17.9988 4 17.7749 4 17.4988C4 17.2533 4.17688 17.0492 4.41012 17.0068L4.5 16.9988H15.5ZM10.0001 2.00098C10.2456 2.00098 10.4497 2.17798 10.492 2.41124L10.5 2.50112L10.496 14.295L14.1414 10.6466C14.3148 10.4729 14.5842 10.4534 14.7792 10.5882L14.8485 10.646C15.0222 10.8194 15.0418 11.0888 14.907 11.2838L14.8492 11.3531L10.3574 15.8531C10.285 15.9257 10.1957 15.9714 10.1021 15.9901L9.99608 15.9999C9.83511 15.9999 9.69192 15.9237 9.60051 15.8056L5.14386 11.3537C4.94846 11.1586 4.94823 10.842 5.14336 10.6466C5.3168 10.4729 5.58621 10.4534 5.78117 10.5883L5.85046 10.6461L9.496 14.287L9.5 2.50083C9.50008 2.22469 9.724 2.00098 10.0001 2.00098Z" fill="#424242"/></svg>';var F='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5 4.5C5 3.67157 5.67157 3 6.5 3H13.5C14.3284 3 15 3.67157 15 4.5V5H15.5C16.8807 5 18 6.11929 18 7.5V12.5C18 13.3284 17.3284 14 16.5 14H15V15.5C15 16.3284 14.3284 17 13.5 17H6.5C5.67157 17 5 16.3284 5 15.5V14H3.5C2.67157 14 2 13.3284 2 12.5V7.5C2 6.11929 3.11929 5 4.5 5H5V4.5ZM6 5H14V4.5C14 4.22386 13.7761 4 13.5 4H6.5C6.22386 4 6 4.22386 6 4.5V5ZM5 13V11.5C5 10.6716 5.67157 10 6.5 10H13.5C14.3284 10 15 10.6716 15 11.5V13H16.5C16.7761 13 17 12.7761 17 12.5V7.5C17 6.67157 16.3284 6 15.5 6H4.5C3.67157 6 3 6.67157 3 7.5V12.5C3 12.7761 3.22386 13 3.5 13H5ZM6.5 11C6.22386 11 6 11.2239 6 11.5V15.5C6 15.7761 6.22386 16 6.5 16H13.5C13.7761 16 14 15.7761 14 15.5V11.5C14 11.2239 13.7761 11 13.5 11H6.5Z" fill="#424242"/></svg>';var B=e("verdocs_sign",function(){function e(e){var n=this;t(this,e);this.sdkError=i(this,"sdkError");this.envelopeLoaded=i(this,"envelopeLoaded");this.envelopeUpdated=i(this,"envelopeUpdated");this.endpoint=new a({sessionType:"signing"});this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.toolbarStyle="menu";this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=l;this.fieldUpdateCounter=0;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.adoptingSignature=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.signatureId=null;this.initialId=null;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.pageNumber=1;this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.showDownloadDialog=false;this.loading=true;this.envelope=null;this.zoomLevel="normal";this.signingProgressMode="start";this.polling=true;this.renderedPages={};this.pollingInterval=null;this.handleDoneDialogDismiss=function(){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.showDone=false;if(!!this.isDone)return[3,2];this.prepareForViewTransition();return[4,new Promise((function(e){return requestAnimationFrame((function(){return e()}))}))];case 1:e.sent();this.isDone=true;e.label=2;case 2:return[2]}}))}))}}e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,s,o;var a=this;return __generator(this,(function(l){switch(l.label){case 0:this.updateZoomFromWindow();window.addEventListener("resize",(function(){return a.updateZoomFromWindow()}));if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new P("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new P("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new P("[SIGN] Missing required inviteCode",500,""));return[2]}l.label=1;case 1:l.trys.push([1,3,,4]);return[4,this.initSigningSession()];case 2:l.sent();return[3,4];case 3:o=l.sent();console.log("[SIGN] Error with signing session",o);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new P(o.message,(r=o.response)===null||r===void 0?void 0:r.status,(s=o.response)===null||s===void 0?void 0:s.data));this.showLoadError=true;return[3,4];case 4:return[2]}}))}))};e.prototype.initSigningSession=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,c(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 1:e=t.sent();this.processAuthResponse(e);return[2]}}))}))};e.prototype.retrySigningSession=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n;return __generator(this,(function(r){switch(r.label){case 0:this.showLoadError=false;this.loading=true;r.label=1;case 1:r.trys.push([1,3,,4]);return[4,this.initSigningSession()];case 2:r.sent();return[3,4];case 3:n=r.sent();console.log("[SIGN] Error with signing session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new P(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(i=n.response)===null||i===void 0?void 0:i.data));this.showLoadError=true;this.loading=false;return[3,4];case 4:return[2]}}))}))};e.prototype.prepareForViewTransition=function(){var e,t;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();this.observer=null;(t=document.getElementById("air-datepicker-global-container"))===null||t===void 0?void 0:t.remove()};e.prototype.handleSubmitSuccess=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r;var s=this;return __generator(this,(function(o){switch(o.label){case 0:this.submitting=false;this.submitted=true;this.nextSubmits=false;this.signingProgressMode="completed";o.label=1;case 1:o.trys.push([1,3,,4]);return[4,d(this.endpoint,this.envelopeId)];case 2:i=o.sent();this.envelope=i;U.updateEnvelope(this.envelopeId,i);n=(e=i.recipients)===null||e===void 0?void 0:e.find((function(e){var t;return e.role_name===((t=s.recipient)===null||t===void 0?void 0:t.role_name)}));if(n){this.recipient=n}(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:i,event:"submitted"});return[3,4];case 3:r=o.sent();console.warn("[SIGN] Error refreshing envelope after submit",r);return[3,4];case 4:this.showDone=true;return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}this.setupIntersectionObserver()};e.prototype.disconnectedCallback=function(){var e=this;var t,i,n;this.stopPolling();(t=this.observer)===null||t===void 0?void 0:t.disconnect();window.removeEventListener("resize",(function(){return e.updateZoomFromWindow()}));(i=document.getElementById(this.getOrgStyleOverridesId()))===null||i===void 0?void 0:i.remove();(n=document.getElementById(this.getBrandStyleOverridesId()))===null||n===void 0?void 0:n.remove()};e.prototype.updateZoomFromWindow=function(){var e=window.innerWidth;if(e<768){if(this.zoomLevel!=="zoom2")this.zoomLevel="zoom2"}else if(e<1024){if(this.zoomLevel!=="zoom1")this.zoomLevel="zoom1"}else{if(this.zoomLevel!=="normal")this.zoomLevel="normal"}};e.prototype.setupIntersectionObserver=function(){var e=this;var t=this.el.querySelectorAll("verdocs-envelope-document-page");if(t.length===0)return;if(this.observer){this.observer.disconnect()}var i=this.el.querySelector(".signed-document-container");var n={root:i,rootMargin:"-40% 0px -40% 0px",threshold:0};this.observer=new IntersectionObserver((function(t){t.forEach((function(t){if(t.isIntersecting){var i=t.target.id;var n=parseInt(i.replace("page-",""),10);if(!isNaN(n)&&e.pageNumber!==n){e.pageNumber=n}}}))}),n);t.forEach((function(t){return e.observer.observe(t)}))};e.prototype.getOrgStyleOverridesId=function(){return"verdocs-org-style-overrides-".concat(this.envelopeId)};e.prototype.getBrandStyleOverridesId=function(){return"verdocs-brand-style-overrides-".concat(this.envelopeId)};e.prototype.applyOrgStyleOverrides=function(){var e,t;var i=this.getOrgStyleOverridesId();var n=document.getElementById(i);var r=(t=(e=this.envelope)===null||e===void 0?void 0:e.organization)===null||t===void 0?void 0:t.style_overrides;if(typeof r==="string"){var s=n||document.createElement("style");s.id=i;s.textContent=r;if(!n){document.head.appendChild(s)}}else if(n){n.remove()}};e.prototype.applyBrandStyleOverrides=function(e){var t=this.getBrandStyleOverridesId();var i=document.getElementById(t);var n=e===null||e===void 0?void 0:e.style_overrides;if(typeof n==="string"&&n.length>0){var r=i||document.createElement("style");r.id=t;r.textContent=n;if(!i){document.head.appendChild(r)}}else if(i){i.remove()}};e.prototype.processAuthResponse=function(e){var t,i,n,r;var s=e.envelope,o=e.recipient,a=e.brand;(t=s.documents)===null||t===void 0?void 0:t.sort((function(e,t){return e.order!==t.order?e.order-t.order:e.created_at.localeCompare(t.created_at)}));var c=o.auth_step;this.recipient=o;this.envelope=s;this.disclosures=((n=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||n===void 0?void 0:n.disclaimer)||l;this.applyOrgStyleOverrides();this.applyBrandStyleOverrides(a);this.authStep=c;this.delegated=!!o.delegated_to;this.agreed=o.agreed;this.signatureId=null;this.initialId=null;this.submitted=o.status==="submitted";this.loading=false;this.isDone=this.submitted;this.showDone=this.submitted;U.updateEnvelope(this.envelopeId,s);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=o.auth_method_states||{};this.kbaQuestions=o.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(o.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();(r=this.envelopeLoaded)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope})};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);var t=Intl.DateTimeFormat().resolvedOptions();u(this.endpoint,this.envelopeId,this.roleId,this.disclosures,{locale:t.locale,timezone:t.timeZone}).then((function(){var t;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(t){var i,n,r;console.log("[SIGN] Unable to accept disclosures",t);A("Unable to accept disclosures, please try again later",{style:"error"});(i=e.sdkError)===null||i===void 0?void 0:i.emit(new P(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(r=t.response)===null||r===void 0?void 0:r.data));e.submitting=false}))};e.prototype.handlePageSelect=function(e){var t=parseInt(e.target.value);if(!isNaN(t)){this.pageNumber=t;var i=this.el.querySelector(".signed-document-container");var n=this.el.querySelector("#page-".concat(t));if(i&&n){var r=n.offsetTop-20;i.scrollTo({top:r,behavior:"smooth"})}}};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(n){switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.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();(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":this.showDownloadDialog=true;this.startPolling();break}return[2]}))}))};e.prototype.startPolling=function(){var e=this;this.stopPolling();var t=function(){var t,i,n,r,s,o;var a=((t=e.envelope)===null||t===void 0?void 0:t.status)==="complete"||!!((i=e.envelope)===null||i===void 0?void 0:i.signed);var l=(r=(n=e.envelope)===null||n===void 0?void 0:n.documents)===null||r===void 0?void 0:r.some((function(e){return e.type==="certificate"}));var c=(o=(s=e.envelope)===null||s===void 0?void 0:s.recipients)===null||o===void 0?void 0:o.every((function(e){return e.status==="submitted"}));if(a&&l)return false;if(!c)return false;return true};if(!t()){return}this.polling=true;this.pollingInterval=setInterval((function(){return __awaiter(e,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,d(this.endpoint,this.envelopeId)];case 1:e=n.sent();this.envelope=e;U.updateEnvelope(this.envelopeId,e);this.checkRecipientFields();if(!t()){this.stopPolling()}return[3,3];case 2:i=n.sent();console.error("[SIGN] Polling error",i);this.stopPolling();return[3,3];case 3:return[2]}}))}))}),5e3)};e.prototype.stopPolling=function(){if(this.pollingInterval){clearInterval(this.pollingInterval);this.pollingInterval=null}this.polling=false};e.prototype.handleZoomIn=function(){if(this.zoomLevel==="normal"){this.zoomLevel="zoom1"}else if(this.zoomLevel==="zoom1"){this.zoomLevel="zoom2"}};e.prototype.handleZoomOut=function(){if(this.zoomLevel==="zoom1"){this.zoomLevel="normal"}else if(this.zoomLevel==="zoom2"){this.zoomLevel="zoom1"}};e.prototype.updateRecipientFieldValue=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=t.value;n.settings=t.settings;H(n);i.fieldUpdateCounter++;i.markEnvelopeStarted();i.checkRecipientFields()}}))};e.prototype.getStartedKey=function(){var e;return"".concat(this.envelopeId,":").concat(((e=this.recipient)===null||e===void 0?void 0:e.role_name)||"")};e.prototype.markEnvelopeStarted=function(){var e=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");var t=this.getStartedKey();if(!e.includes(t)){e.push(t);while(e.length>10){e.shift()}localStorage.setItem("startedEnvelopes",JSON.stringify(e))}};e.prototype.saveFieldChange=function(e,t,i){var n=this;var r=this.getRecipientFields().find((function(t){return t.name===e}));if(r===null||r===void 0?void 0:r.readonly){return}console.log("[SIGN] saveFieldChange",e,{value:t,prepared:i});h(this.endpoint,this.envelopeId,this.roleId,e,t,i).then((function(t){return n.updateRecipientFieldValue(e,t)})).catch((function(e){var t,i,r,s,o,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(i=e.response)===null||i===void 0?void 0:i.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");n.fatalErrorHeader="Signing Session Expired";n.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e);A("Unable to save change, please try again later",{style:"error"})}(s=n.sdkError)===null||s===void 0?void 0:s.emit(new P(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,r,s,o,o,o,a,o,o,o,l,c;var d=this;return __generator(this,(function(u){switch(u.label){case 0:if(!t.target){return[2]}i=t.target,n=i.value,r=i.checked;s=e.type;switch(s){case"textarea":return[3,1];case"textbox":return[3,1];case"checkbox":return[3,2];case"radio":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,14];case"date":return[3,23];case"timestamp":return[3,24]}return[3,25];case 1:return[2,this.saveFieldChange(e.name,n,false)];case 2:{return[2,this.saveFieldChange(e.name,String(t.target.checked),false)]}u.label=3;case 3:{return[2,this.saveFieldChange(e.name,String(t.target.checked),false)]}u.label=4;case 4:console.log("Saving dropdown",e.name,t.detail);return[2,this.saveFieldChange(e.name,t.detail,false)];case 5:if(t.detail===undefined){return[2]}if(!(t.detail===null))return[3,7];console.log("[SIGN] Clearing initial");return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,null,false)];case 6:o=u.sent();return[2,this.updateRecipientFieldValue(e.name,o)];case 7:if(!this.initialId)return[3,9];console.log("[SIGN] Reusing initial",this.initialId);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,this.initialId,false)];case 8:o=u.sent();return[2,this.updateRecipientFieldValue(e.name,o)];case 9:if(!(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)))return[3,11];console.log("[SIGN] Reusing initial",t.detail);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false)];case 10:o=u.sent();this.initialId=t.detail;return[2,this.updateRecipientFieldValue(e.name,o)];case 11:this.showSpinner=true;return[4,fetch(t.detail)];case 12:return[4,u.sent().blob()];case 13:a=u.sent();return[2,v(this.endpoint,"initial",a).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.initialId=t.id;this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.log("Error updating initials",e);A("Unable to save initials, please try again later",{style:"error"});d.showSpinner=false}))];case 14:if(t.detail===undefined){return[2]}if(!(t.detail===null))return[3,16];console.log("[SIGN] Clearing signature");return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,null,false)];case 15:o=u.sent();return[2,this.updateRecipientFieldValue(e.name,o)];case 16:if(!this.signatureId)return[3,18];console.log("[SIGN] Reusing signature",this.signatureId);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,this.signatureId,false)];case 17:o=u.sent();return[2,this.updateRecipientFieldValue(e.name,o)];case 18:if(!(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)))return[3,20];console.log("[SIGN] Reusing signature",t.detail);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false)];case 19:o=u.sent();this.signatureId=t.detail;return[2,this.updateRecipientFieldValue(e.name,o)];case 20:this.showSpinner=true;return[4,fetch(t.detail)];case 21:return[4,u.sent().blob()];case 22:l=u.sent();console.log("[SIGN] Creating new signature");return[2,f(this.endpoint,"signature",l).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",t);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.signatureId=t.id;this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e);A("Unable to save signature, please try again later",{style:"error"});d.showSpinner=false}))];case 23:c=t.detail.formattedDate;if(c){return[2,this.saveFieldChange(e.name,c,false)]}return[3,26];case 24:console.log("[SIGN] Updating timestamp",{value:n,ts:t.target.getAttribute("timestamp")});return[3,26];case 25:console.log("[SIGN] Unhandled field update",{value:n,checked:r},e);return[3,26];case 26:return[2]}}))}))};e.prototype.getSortedFillableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"&&!e.readonly}));p(e);return e};e.prototype.getSortedDisplayableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"}));p(e);return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,s,o,a;var l=this;return __generator(this,(function(c){switch(c.label){case 0:if(!this.nextSubmits)return[3,6];if(this.submitted){return[2]}c.label=1;case 1:c.trys.push([1,4,,5]);(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;t=Intl.DateTimeFormat().resolvedOptions();return[4,g(this.endpoint,this.envelopeId,this.roleId,{locale:t.locale,timezone:t.timeZone})];case 2:i=c.sent();console.log("[SIGN] Submitted successfully",i);return[4,this.handleSubmitSuccess()];case 3:c.sent();return[3,5];case 4:n=c.sent();console.log("[SIGN] Error submitting",n);this.submitting=false;A("Unable to submit document, please try again.",{style:"error"});return[3,5];case 5:return[2];case 6:r=this.getSortedFillableFields().filter((function(e){return!l.isFieldActuallyFilled(e)}));s=this.getNextFieldFromList(r);if(s){o=T(s);a=document.getElementById(o);a===null||a===void 0?void 0:a.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});a===null||a===void 0?void 0:a.focusField();this.focusedField=s.name}return[2]}}))}))};e.prototype.handleNextOptional=function(){var e=this;var t=this.getSortedFillableFields().filter((function(t){return!t.required&&!e.isFieldActuallyFilled(t)}));var i=this.getNextFieldFromList(t);if(i){var n=T(i);var r=document.getElementById(n);r===null||r===void 0?void 0:r.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});r===null||r===void 0?void 0:r.focusField();this.focusedField=i.name}};e.prototype.getRecipientFields=function(){var e=this;var t;return((t=this.envelope)===null||t===void 0?void 0:t.fields.filter((function(t){return t.role_name===e.recipient.role_name})))||[]};e.prototype.getRequiredTotalCount=function(){return this.getSortedFillableFields().filter((function(e){return e.required})).length};e.prototype.getRequiredFilledCount=function(){var e=this;return this.getSortedFillableFields().filter((function(t){return t.required&&e.isFieldActuallyFilled(t)})).length};e.prototype.getOptionalUnfilledCount=function(){var e=this;return this.getSortedFillableFields().filter((function(t){return!t.required&&!e.isFieldActuallyFilled(t)})).length};e.prototype.checkRecipientFields=function(){var e=this;if(this.submitted||this.isDone){return}var t=this.getRecipientFields().filter((function(t){return!m(t,e.getRecipientFields())}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}this.updateAllFlags();var i=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");var n=i.includes(this.getStartedKey());if(this.nextSubmits){this.signingProgressMode="completed"}else if(n){this.signingProgressMode="signing"}else{this.signingProgressMode="start"}};e.prototype.isFieldActuallyFilled=function(e){if(e.type==="radio"&&e.group){var t=this.getRecipientFields().some((function(t){return t.group===e.group&&t.value==="true"}));if(t){return true}}return x(e,this.getRecipientFields())&&(e.type!=="dropdown"||!!e.value)&&(e.type!=="radio"||e.value==="true")&&(e.type!=="checkbox"||e.value==="true")};e.prototype.getNextRequiredField=function(){var e=this;var t=this.getSortedFillableFields().filter((function(t){return t.required&&!e.isFieldActuallyFilled(t)}));p(t);if(t.length===0){var i=this.getSortedFillableFields().filter((function(t){return!e.isFieldActuallyFilled(t)}));p(i);if(i.length>0){return this.getNextFieldFromList(i)}return null}return this.getNextFieldFromList(t)};e.prototype.getNextFieldFromList=function(e){var t=this;var i=e.findIndex((function(e){return e.name===t.focusedField}));var n=i+1;if(n>=e.length){n=0}return e[n]};e.prototype.handlePrev=function(){var e=this;var t;var i=this.getSortedFillableFields();var n=i.findIndex((function(t){return t.name===e.focusedField}));if(n>0){var r=i[n-1];var s=T(r);var o=document.getElementById(s);o===null||o===void 0?void 0:o.scrollIntoView({behavior:"smooth",block:"center"});(t=o===null||o===void 0?void 0:o.focusField)===null||t===void 0?void 0:t.call(o);this.focusedField=r.name}};e.prototype.updateAllFlags=function(){var e=this;Object.values(this.renderedPages).forEach((function(t){e.updateFlagsForPage(t)}))};e.prototype.updateFlagsForPage=function(e){var t=this;if(!e)return;var i=document.getElementById(e.containerId+"-controls");if(!i)return;var n=i.querySelectorAll(".verdocs-flag-instance");n.forEach((function(e){return e.remove()}));var r=this.getNextRequiredField();var s=this.getRecipientFields().find((function(e){return e.name===t.focusedField}));if(s&&!x(s,this.getRecipientFields())){r=s}if(r&&r.page===e.pageNumber&&r.document_id===e.documentId){var o="fill";var a="FILL";var l=false;switch(r.type){case"signature":a="SIGN";break;case"initial":a="INITIAL";break;case"checkbox":a="CHECK";break;case"radio":a="SELECT";break;case"date":case"dropdown":a="SELECT";break;case"attachment":a="ATTACH";break;case"payment":a="PAY";break}if(!r.required){l=true}E(e,r.y,r.height||D(r.type),{variant:o,label:a,showSkip:l,onSkip:function(){t.handleNext()},onClick:function(){var e;var t=T(r);var i=document.getElementById(t);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center"});(e=i===null||i===void 0?void 0:i.focusField)===null||e===void 0?void 0:e.call(i)}})}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(function(e){if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));i.addEventListener("attached",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,r,s;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,b(this.endpoint,this.envelopeId,this.roleId,t.name,i.detail)];case 2:n=o.sent();this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();r=q("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,r);this.showSpinner=false;return[3,4];case 3:s=o.sent();console.log("Error uploading attachment",s);A("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("deleted",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,r,s;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,w(this.endpoint,this.envelopeId,this.roleId,t.name)];case 2:n=o.sent();console.log("[SIGN] Deleted attachment",n);this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();r=q("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,r);this.showSpinner=false;return[3,4];case 3:s=o.sent();console.log("Error uploading attachment",s);A("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("focusout",(function(e){if(t.type!=="dropdown"&&t.type!=="attachment"&&t.type!=="signature"&&t.type!=="initial"&&t.type!=="checkbox"&&t.type!=="radio"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}}));i.addEventListener("fieldChange",(function(e){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.addEventListener("adopt",(function(){n.focusedField=t.name;n.adoptingSignature=true}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);var r=y(this.recipient);i.setAttribute("initials",k(r));i.setAttribute("name",r);if(this.signatureId){i.setAttribute("signatureid",this.signatureId)}if(this.initialId){i.setAttribute("initialid",this.initialId)}};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;this.renderedPages["".concat(i.documentId,":").concat(i.pageNumber)]=i;var n=this.getSortedDisplayableFields();n.filter((function(e){return e&&e.document_id===i.documentId&&e.page===i.pageNumber})).forEach((function(e,n){var r=q("envelope",e,i,{disabled:false,editable:false,draggable:false,done:t.isDone},n);if(!r){return}if(Array.isArray(r)){r.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,r)}}));this.envelope.recipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){t.getRecipientFields().filter((function(e){return e.document_id===i.documentId&&e.page===i.pageNumber})).forEach((function(e){var n=q("envelope",e,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,n)}}))}));this.checkRecipientFields();this.updateFlagsForPage(i)};e.prototype.handleAuthenticateSigner=function(e){var t=this;console.log("[SIGN] Submitting authentication step",e);C(this.endpoint,e).then((function(e){console.log("[SIGN] Verification successful",e);t.processAuthResponse(e)})).catch((function(e){var i,n,r,s,o,a;console.log("[SIGN] Error submitting authentication step",e);console.log((i=e.response)===null||i===void 0?void 0:i.data);if((s=(r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)===null||s===void 0?void 0:s.includes("failed")){t.fatalErrorHeader="Recipient Verification Failed";t.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";t.isDone=true}else{A(((a=(o=e.response)===null||o===void 0?void 0:o.data)===null||a===void 0?void 0:a.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))};e.prototype.handleOnDownload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,s,o,a,l,c,d,u,h,f,v,p,g;return __generator(this,(function(m){switch(m.label){case 0:n=e.detail,r=n.action,s=n.documentId;console.log("[SIGN] Download action selected:",r,s);m.label=1;case 1:m.trys.push([1,14,,15]);o=r;switch(o){case M.certificate:return[3,2];case M.combined:return[3,6];case M.document:return[3,8];case M.zip:return[3,11]}return[3,13];case 2:a=this.envelope.documents.find((function(e){return e.type==="certificate"}));if(!a)return[3,4];return[4,S(this.endpoint,a.id)];case 3:l=m.sent();window.open(l,"_blank");return[3,5];case 4:A("Certificate not yet available.",{style:"info"});m.label=5;case 5:return[3,13];case 6:c=s||((t=this.envelope.documents.find((function(e){return e.type==="certificate"})))===null||t===void 0?void 0:t.id);return[4,I(this.endpoint,c)];case 7:d=m.sent();window.open(d,"_blank");return[3,13];case 8:u=s||((i=this.envelope.documents.find((function(e){return e.type==="attachment"})))===null||i===void 0?void 0:i.id);if(!u)return[3,10];return[4,S(this.endpoint,u)];case 9:h=m.sent();window.open(h,"_blank");m.label=10;case 10:return[3,13];case 11:return[4,_(this.endpoint,[this.envelopeId])];case 12:f=m.sent();v=window.URL.createObjectURL(f.data);p=document.createElement("a");p.href=v;p.download="".concat(this.envelope.name,".zip");document.body.appendChild(p);p.click();p.remove();window.URL.revokeObjectURL(v);return[3,13];case 13:return[3,15];case 14:g=m.sent();console.error("Download error",g);A("Unable to complete download request.",{style:"error"});return[3,15];case 15:return[2]}}))}))};e.prototype.render=function(){var e=this;var t;if(this.showLoadError){return n(r,null,n("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:function(){e.retrySigningSession()}}))}if(!this.envelope){return n(r,null,n("verdocs-loader",null))}if(this.fatalErrorMessage){return n(r,{class:{agreed:this.agreed}},n("div",{class:"fatal-error"},n("div",{class:"message"},n("div",{class:"header"},this.fatalErrorHeader),n("p",null,this.fatalErrorMessage))))}if(this.delegated){return n(r,{class:{agreed:false}},n("div",{class:"fatal-error"},n("div",{class:"message"},n("div",{class:"header"},"Delegated Signing Request"),n("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return n(r,{class:{agreed:this.agreed}},n("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var i;return(i=e.sdkError)===null||i===void 0?void 0:i.emit(t.detail)}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(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:function(t){t.preventDefault();t.stopPropagation();e.handleDoneDialogDismiss()},onExit:function(){return e.handleDoneDialogDismiss()}}),this.submitting&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)))}if(this.delegating){return n(r,{class:"agreed"},n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:function(){return e.delegating=false},onNext:function(t){N(e.endpoint,e.envelopeId,e.roleId,t.detail).then((function(t){A("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",t);e.delegated=true;e.delegating=false})).catch((function(e){console.log("[SIGN] Error delegating request",e);A("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return n(r,{class:"agreed"},n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("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:function(){return e.declining=false},onNext:function(){z(e.endpoint,e.envelopeId,e.roleId).then((function(t){console.log("[SIGN] Decline result",t);e.declining=false;e.fatalErrorHeader="Declined";e.fatalErrorMessage="You have declined to sign this request. The sender has been notified."})).catch((function(e){console.warn("[SIGN] Error declining signing session",e);A("Unable to decline, please try again later",{style:"error"})}))}}))}if(!this.agreed){return n(r,{class:"agreed"},n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:function(){return e.delegating=true},onDecline:function(){return e.declining=true},onAccept:function(){return e.handleClickAgree()}}))}if(this.authStep==="passcode"){return n("verdocs-passcode-dialog",{endpoint:this.endpoint,onNext:function(t){return e.processAuthResponse(t.detail.response)}})}if(this.authStep==="email"){return n("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){this.processAuthResponse(t.detail.response);return[2]}))}))}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return n(r,{class:"kba"},n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name))),n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("div",{class:"cover"},n("div",{class:"kba"},n("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=t.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:e.first_name,last_name:e.last_name,address:e.address,city:e.city,state:e.state,zip:e.zip,dob:e.dob});return[2]}))}))}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){var i=this.kbaChoices.length;var o=this.kbaQuestions[i];return n(r,{class:"kba"},n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name))),n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("div",{class:"cover"},n("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?n("verdocs-spinner",null):n("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(o===null||o===void 0?void 0:o.prompt)||"Please select one of the options below.",choices:(o===null||o===void 0?void 0:o.answer)||["Skip Question"],step:i+1,steps:this.kbaQuestions.length,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e,i;var n=this;return __generator(this,(function(r){e=t.detail;this.kbaChoices=__spreadArray(__spreadArray([],this.kbaChoices,true),[e],false);if(this.kbaChoices.length>=this.kbaQuestions.length){i=this.kbaQuestions.map((function(e,t){return{type:e.type,answer:n.kbaChoices[t]}}));console.log("Submitting KBA responses",this.kbaChoices,i);this.handleAuthenticateSigner({auth_method:"kba",responses:i})}return[2]}))}))}}))))}var a=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var l=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){a.unshift({id:"delegate",label:"Delegate"})}var c=this.getRecipientFields().filter((function(t){return!m(t,e.getRecipientFields())}));c.length>0?console.log("[SIGN] Invalid fields remaining",c.map((function(e){return e.name}))):console.log("[SIGN] All field valid");var d=this.envelope.documents.reduce((function(e,t){return e+t.pages}),0);var u=G(1,d).map((function(e){return{label:e.toString(),value:e.toString()}}));var p=0;return n(r,null,this.toolbarStyle==="menu"&&n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("div",{class:"title"},this.envelope.name),n("div",{style:{flex:"1"}}),!this.finishLater&&!this.submitted&&function(){var t=e.getRequiredTotalCount()-e.getRequiredFilledCount();var i=e.getOptionalUnfilledCount();if(t>0){return n("span",{class:"remaining-count"},t," required field",t===1?"":"s"," left")}return n("span",{class:"remaining-count"},n("span",{class:"check-icon",innerHTML:j}),"All required fields complete",i>0&&n("div",{class:"review-optional"},n("span",{class:"separator"},"| "),n("span",{onClick:function(){return e.handleNextOptional()}},"Review ",i," optional")))}(),!this.finishLater&&!this.submitted&&n("verdocs-button",{size:"xsmall",label:this.nextButtonLabel==="Next"?"Next Required":this.nextButtonLabel,disabled:!this.agreed||this.submitting||this.submitted,onClick:function(){return e.handleNext()}}),n("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal",magnify:true},innerHTML:O,onClick:function(){return e.handleZoomOut()}}),n("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2",magnify:true},innerHTML:Y,onClick:function(){return e.handleZoomIn()}}),n("verdocs-dropdown",{options:!this.isDone&&!this.finishLater&&!this.submitted?a:l,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),this.toolbarStyle==="controls"&&n("div",{class:"controls-toolbar"},n("div",{class:"left-controls"},n("div",{class:"title"},this.envelope.name)),n("div",{class:"center-controls"},n("span",{class:"label"},"Page"),n("div",{class:"select-wrapper"},n("verdocs-select-input",{options:u,value:this.pageNumber.toString(),onInput:function(t){return e.handlePageSelect(t)}})),n("span",{class:"count"},"of ",d)),n("div",{class:"right-controls"},!this.submitted&&n("verdocs-button",{class:"mobile-next-button",label:this.nextButtonLabel,size:"xsmall",disabled:!this.agreed||this.submitting,onClick:function(){return e.handleNext()}}),n("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal"},innerHTML:O,onClick:function(){return e.handleZoomOut()}}),n("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2"},innerHTML:Y,onClick:function(){return e.handleZoomIn()}}),n("div",{class:"icon-button download",innerHTML:Z,onClick:function(){return e.handleOptionSelected({detail:{id:"download"}})}}),n("div",{class:"icon-button print",innerHTML:F,onClick:function(){return e.handleOptionSelected({detail:{id:"print"}})}}))),n("div",{class:"document signed-document-container zoom-".concat(this.zoomLevel)},(this.envelope.documents||[]).map((function(t){var i=G(1,t.pages);return n(s,null,e.envelope.documents.length>1&&n("div",{class:"document-separator"},n("div",{innerHTML:V}),n("span",null,t.name)),i.map((function(i){var r;var s=((r=t.page_sizes)===null||r===void 0?void 0:r[i])||{width:612,height:792};p++;return n("verdocs-envelope-document-page",{id:"page-".concat(p),envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:s.width,virtualHeight:s.height,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&n("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){e.isDone=true;e.showFinishLater=false}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(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:function(){e.handleDoneDialogDismiss()},onExit:function(){return e.handleDoneDialogDismiss()}}),this.adoptingSignature&&n("verdocs-adopt-signature-dialog",{name:y(this.recipient),nameLocked:!!((t=this.recipient)===null||t===void 0?void 0:t.name_locked),onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e,i,n,r,s,o,a,l,c;var d=this;return __generator(this,(function(u){switch(u.label){case 0:console.log("[SIGN] Adopting signature/initials block",t.detail);this.showSpinner=true;return[4,fetch(t.detail.signature)];case 1:return[4,u.sent().blob()];case 2:e=u.sent();return[4,fetch(t.detail.initials)];case 3:return[4,u.sent().blob()];case 4:i=u.sent();return[4,f(this.endpoint,"signature",e)];case 5:n=u.sent();console.log("[SIGN] Created signature",n);this.signatureId=n.id;return[4,v(this.endpoint,"initial",i)];case 6:r=u.sent();console.log("[SIGN] Created initials",r);this.initialId=r.id;this.showSpinner=false;this.adoptingSignature=false;this.markEnvelopeStarted();if(!this.focusedField)return[3,9];s=this.getRecipientFields().find((function(e){return e.name===d.focusedField}));if(!s)return[3,8];o=s.type==="signature"?this.signatureId:s.type==="initial"?this.initialId:null;if(!o)return[3,8];return[4,h(this.endpoint,this.envelopeId,this.roleId,s.name,o,false)];case 7:a=u.sent();this.updateRecipientFieldValue(s.name,a);u.label=8;case 8:this.focusedField="";u.label=9;case 9:l=this.el.querySelectorAll("verdocs-field-signature");l.forEach((function(e){return e.setAttribute("signatureid",d.signatureId)}));c=this.el.querySelectorAll("verdocs-field-initial");c.forEach((function(e){return e.setAttribute("initialid",d.initialId)}));this.checkRecipientFields();return[2]}}))}))},onExit:function(){return e.adoptingSignature=false}}),(this.submitting||this.showSpinner)&&n("verdocs-portal",null,n("div",{class:"spinner-overlay"},n("verdocs-spinner",null))),this.showDownloadDialog&&n("verdocs-download-dialog",{signed:this.envelope.signed,polling:this.polling,documents:this.envelope.documents,onExit:function(){e.showDownloadDialog=false;e.stopPolling()},onDownload:function(t){return e.handleOnDownload(t)}}),!this.loading&&!this.isDone&&!this.submitted&&n("verdocs-sign-footer",{endpoint:this.endpoint,envelopeId:this.envelopeId,isDone:this.isDone,onAskQuestion:function(t){L(e.endpoint,e.envelopeId,e.roleId,{question:t.detail.question}).then((function(){return A("Your question has been sent.",{style:"success"})})).catch((function(e){console.log("Error asking question",e);A("Unable to send question, please try again later.",{style:"error"})}))},onDecline:function(){return e.declining=true},onFinishLater:function(){return e.showFinishLater=true}}))};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());B.style=R()}}}));
|
|
2
|
-
//# sourceMappingURL=p-
|
|
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,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n["throw"](e))}catch(e){s(e)}}function l(e){e.done?i(e.value):r(e.value).then(o,a)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,r,s,o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=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(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=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,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,s;n<r;n++){if(s||!(n in t)){if(!s)s=Array.prototype.slice.call(t,0,n);s[n]=t[n]}}return e.concat(s||Array.prototype.slice.call(t))};System.register(["./p-De3fNE_u.system.js","@verdocs/js-sdk","./p-nfw6V5pF.system.js","./p-CwIkMPyJ.system.js","./p-GqS1qR-V.system.js","./p-Dj475wLP.system.js","./p-7Iu0_GGa.system.js","./p-fEbwslLK.system.js","./p-C7pDryJb.system.js"],(function(e){"use strict";var t,i,n,r,s,o,a,l,c,d,u,h,f,v,p,g,m,x,b,w,y,k,_,C,S,N,I,z,G,L,H,T,E,q,D,M,V,j,A,P,U;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;s=e.F;o=e.g},function(e){a=e.VerdocsEndpoint;l=e.DEFAULT_DISCLOSURES;c=e.startSigningSession;d=e.getEnvelope;u=e.envelopeRecipientAgree;h=e.updateEnvelopeField;f=e.createSignature;v=e.createInitials;p=e.sortFields;g=e.envelopeRecipientSubmit;m=e.isFieldValid;x=e.isFieldFilled;b=e.uploadEnvelopeFieldAttachment;w=e.deleteEnvelopeFieldAttachment;y=e.formatFullName;k=e.fullNameToInitials;_=e.verifySigner;C=e.getEnvelopesZip;S=e.getEnvelopeDocumentDownloadLink;N=e.getCombinedEnvelopeDocumentDownloadLink;I=e.delegateRecipient;z=e.envelopeRecipientDecline;G=e.integerSequence;L=e.askQuestion},function(e){H=e.u;T=e.g;E=e.r;q=e.a;D=e.d},function(e){M=e.D},function(e){V=e.D;j=e.C},function(e){A=e.V},function(e){P=e.S},function(e){U=e.S},null],execute:function(){var R=function(){return'verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;min-height:700px;position:relative;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#f5f5f5;font-family:var(--verdocs-primary-font, "Inter", "Barlow", 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;padding-right:140px;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>.document .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;max-width:1028px;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-sign>.document .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-sign>.document .document-separator:first-child{margin-top:0}verdocs-sign .signed-document-container{width:64%;margin-left:260px;-webkit-transition:all 0.3s ease;transition:all 0.3s ease}verdocs-sign .signed-document-container.zoom-normal{width:64%;margin-left:260px}verdocs-sign .signed-document-container.zoom-zoom1{width:80%;margin-left:200px}verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:150px}verdocs-sign .signed-document-container.zoom-zoom2 .verdocs-flag-instance{opacity:0;pointer-events:none}@media (max-width: 768px){verdocs-sign verdocs-sign-footer{padding:0 10px}verdocs-sign verdocs-sign-footer .buttons{gap:8px}verdocs-sign verdocs-sign-footer .buttons button{font-size:10px}verdocs-sign .signed-document-container{width:100%;margin-left:0}verdocs-sign .signed-document-container.zoom-normal,verdocs-sign .signed-document-container.zoom-zoom1,verdocs-sign .signed-document-container.zoom-zoom2{width:100%;margin-left:0}verdocs-sign>.document{padding-right:15px}verdocs-sign .verdocs-flag-instance{display:none !important}verdocs-sign .controls-toolbar .center-controls{display:none}verdocs-sign .controls-toolbar .right-controls .mobile-next-button{display:block;margin-right:10px}verdocs-sign .controls-toolbar .right-controls .minus,verdocs-sign .controls-toolbar .right-controls .plus{display:none}}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,.controls-toolbar,.verdocs-flag-instance,verdocs-signing-progress{display:none !important}verdocs-sign{min-height:auto;background-color:white}verdocs-sign>.document{overflow:visible;height:auto;display:block;padding:0;margin:0}verdocs-sign>.document .document-separator{display:none}verdocs-sign .signed-document-container{width:100%;margin:0}}#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;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px}#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}@media (max-width: 670px){#verdocs-sign-header .title{font-size:14px}}#verdocs-sign-header .remaining-count{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:8px;color:#ffffff;font-size:13px;font-weight:400;white-space:nowrap}#verdocs-sign-header .remaining-count .check-icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}#verdocs-sign-header .remaining-count .check-icon svg{width:16px;height:16px;fill:#55bc81}#verdocs-sign-header .remaining-count .separator{opacity:0.5;margin:0 2px}#verdocs-sign-header .remaining-count .review-optional{cursor:pointer;text-decoration:underline}#verdocs-sign-header .remaining-count .review-optional:hover{color:#54d68c}@media (max-width: 670px){#verdocs-sign-header .remaining-count .review-optional{display:none}}@media (max-width: 670px){#verdocs-sign-header .remaining-count{font-size:12px}}#verdocs-sign-header .icon-button{width:20px;height:32px;display:-ms-flexbox;display:flex;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border-radius:4px;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}#verdocs-sign-header .icon-button svg path{fill:#ffffff}#verdocs-sign-header .icon-button:hover{background-color:rgba(255, 255, 255, 0.1)}#verdocs-sign-header .icon-button.disabled{opacity:0.35;pointer-events:none}#verdocs-sign-header .icon-button+.icon-button{margin-left:-6px}@media (max-width: 670px){#verdocs-sign-header .icon-button.magnify{display:none}}.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}.controls-toolbar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;height:54px;padding:0 12px 0 24px;background-color:#ffffff;border-bottom:1px solid #e0e0e0;-webkit-box-shadow:none;box-shadow:none;font-family:"Inter", sans-serif;color:#424242;z-index:1000}.controls-toolbar .left-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .left-controls .title{font-weight:500;font-size:16px;color:#242424;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.controls-toolbar .center-controls{-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;gap:10px;font-size:14px;display:none}.controls-toolbar .center-controls .label{color:#000000;font-weight:300}.controls-toolbar .center-controls .select-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.controls-toolbar .center-controls .select-wrapper verdocs-select-input{margin:0}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-label{display:none}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element{background:transparent;border:1px solid #e0e0e0;height:32px;padding:2px 8px;min-width:60px;text-align:center;font-family:inherit;color:#424242}.controls-toolbar .center-controls .select-wrapper verdocs-select-input .input-element:focus{border-color:var(--verdocs-primary-color, #55bc81)}.controls-toolbar .center-controls .count{color:#000000;font-weight:300}.controls-toolbar .right-controls{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}.controls-toolbar .right-controls .mobile-next-button{display:none}.controls-toolbar .right-controls .icon-button{width:32px;height:32px;display:-ms-flexbox;display:flex;color:#424242;cursor:pointer;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:background-color 0.2s;transition:background-color 0.2s}.controls-toolbar .right-controls .icon-button:hover{background-color:#f5f5f5}.controls-toolbar .right-controls .icon-button.disabled{opacity:0.3;pointer-events:none}.controls-toolbar .right-controls .icon-button svg{display:block;width:20px;height:20px}'};var O='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11 8C11.2761 8 11.5 8.22386 11.5 8.5C11.5 8.77614 11.2761 9 11 9H6C5.72386 9 5.5 8.77614 5.5 8.5C5.5 8.22386 5.72386 8 6 8H11ZM14 8.5C14 5.46243 11.5376 3 8.5 3C5.46243 3 3 5.46243 3 8.5C3 11.5376 5.46243 14 8.5 14C9.83879 14 11.0659 13.5217 12.0196 12.7266L16.1464 16.8536L16.2157 16.9114C16.4106 17.0464 16.68 17.0271 16.8536 16.8536C17.0488 16.6583 17.0488 16.3417 16.8536 16.1464L12.7266 12.0196C13.5217 11.0659 14 9.83879 14 8.5ZM4 8.5C4 6.01472 6.01472 4 8.5 4C10.9853 4 13 6.01472 13 8.5C13 10.9853 10.9853 13 8.5 13C6.01472 13 4 10.9853 4 8.5Z" fill="#424242" /></svg>';var Y='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M11.5 8.5C11.5 8.22386 11.2761 8 11 8H9V6C9 5.72386 8.77614 5.5 8.5 5.5C8.22386 5.5 8 5.72386 8 6V8H6C5.72386 8 5.5 8.22386 5.5 8.5C5.5 8.77614 5.72386 9 6 9H8V11C8 11.2761 8.22386 11.5 8.5 11.5C8.77614 11.5 9 11.2761 9 11V9H11C11.2761 9 11.5 8.77614 11.5 8.5ZM8.5 3C11.5376 3 14 5.46243 14 8.5C14 9.83879 13.5217 11.0659 12.7266 12.0196L16.8536 16.1464C17.0488 16.3417 17.0488 16.6583 16.8536 16.8536C16.68 17.0271 16.4106 17.0464 16.2157 16.9114L16.1464 16.8536L12.0196 12.7266C11.0659 13.5217 9.83879 14 8.5 14C5.46243 14 3 11.5376 3 8.5C3 5.46243 5.46243 3 8.5 3ZM8.5 4C6.01472 4 4 6.01472 4 8.5C4 10.9853 6.01472 13 8.5 13C10.9853 13 13 10.9853 13 8.5C13 6.01472 10.9853 4 8.5 4Z" fill="#424242" /></svg>';var Z='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 16.9988C15.7761 16.9988 16 17.2226 16 17.4988C16 17.7442 15.8231 17.9484 15.5899 17.9907L15.5 17.9988H4.5C4.22386 17.9988 4 17.7749 4 17.4988C4 17.2533 4.17688 17.0492 4.41012 17.0068L4.5 16.9988H15.5ZM10.0001 2.00098C10.2456 2.00098 10.4497 2.17798 10.492 2.41124L10.5 2.50112L10.496 14.295L14.1414 10.6466C14.3148 10.4729 14.5842 10.4534 14.7792 10.5882L14.8485 10.646C15.0222 10.8194 15.0418 11.0888 14.907 11.2838L14.8492 11.3531L10.3574 15.8531C10.285 15.9257 10.1957 15.9714 10.1021 15.9901L9.99608 15.9999C9.83511 15.9999 9.69192 15.9237 9.60051 15.8056L5.14386 11.3537C4.94846 11.1586 4.94823 10.842 5.14336 10.6466C5.3168 10.4729 5.58621 10.4534 5.78117 10.5883L5.85046 10.6461L9.496 14.287L9.5 2.50083C9.50008 2.22469 9.724 2.00098 10.0001 2.00098Z" fill="#424242"/></svg>';var F='<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M5 4.5C5 3.67157 5.67157 3 6.5 3H13.5C14.3284 3 15 3.67157 15 4.5V5H15.5C16.8807 5 18 6.11929 18 7.5V12.5C18 13.3284 17.3284 14 16.5 14H15V15.5C15 16.3284 14.3284 17 13.5 17H6.5C5.67157 17 5 16.3284 5 15.5V14H3.5C2.67157 14 2 13.3284 2 12.5V7.5C2 6.11929 3.11929 5 4.5 5H5V4.5ZM6 5H14V4.5C14 4.22386 13.7761 4 13.5 4H6.5C6.22386 4 6 4.22386 6 4.5V5ZM5 13V11.5C5 10.6716 5.67157 10 6.5 10H13.5C14.3284 10 15 10.6716 15 11.5V13H16.5C16.7761 13 17 12.7761 17 12.5V7.5C17 6.67157 16.3284 6 15.5 6H4.5C3.67157 6 3 6.67157 3 7.5V12.5C3 12.7761 3.22386 13 3.5 13H5ZM6.5 11C6.22386 11 6 11.2239 6 11.5V15.5C6 15.7761 6.22386 16 6.5 16H13.5C13.7761 16 14 15.7761 14 15.5V11.5C14 11.2239 13.7761 11 13.5 11H6.5Z" fill="#424242"/></svg>';var B=e("verdocs_sign",function(){function e(e){var n=this;t(this,e);this.sdkError=i(this,"sdkError");this.envelopeLoaded=i(this,"envelopeLoaded");this.envelopeUpdated=i(this,"envelopeUpdated");this.endpoint=new a({sessionType:"signing"});this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.toolbarStyle="menu";this.recipient=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.fatalErrorHeader="";this.fatalErrorMessage="";this.focusedField="";this.disclosures=l;this.fieldUpdateCounter=0;this.submitting=false;this.submitted=false;this.isDone=false;this.showDone=false;this.adoptingSignature=false;this.showLoadError=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.signatureId=null;this.initialId=null;this.documentsSingularPlural="document";this.authStep=null;this.authMethodStates={};this.pageNumber=1;this.kbaQuestions=null;this.showSpinner=false;this.declining=false;this.delegating=false;this.delegated=false;this.kbaChoices=[];this.showDownloadDialog=false;this.loading=true;this.envelope=null;this.zoomLevel="normal";this.signingProgressMode="start";this.polling=true;this.renderedPages={};this.pollingInterval=null;this.handleDoneDialogDismiss=function(){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.showDone=false;if(!!this.isDone)return[3,2];this.prepareForViewTransition();return[4,new Promise((function(e){return requestAnimationFrame((function(){return e()}))}))];case 1:e.sent();this.isDone=true;e.label=2;case 2:return[2]}}))}))}}e.prototype.componentDidLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,s,o;var a=this;return __generator(this,(function(l){switch(l.label){case 0:this.updateZoomFromWindow();window.addEventListener("resize",(function(){return a.updateZoomFromWindow()}));if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new P("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new P("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(i=this.sdkError)===null||i===void 0?void 0:i.emit(new P("[SIGN] Missing required inviteCode",500,""));return[2]}l.label=1;case 1:l.trys.push([1,3,,4]);return[4,this.initSigningSession()];case 2:l.sent();return[3,4];case 3:o=l.sent();console.log("[SIGN] Error with signing session",o);(n=this.sdkError)===null||n===void 0?void 0:n.emit(new P(o.message,(r=o.response)===null||r===void 0?void 0:r.status,(s=o.response)===null||s===void 0?void 0:s.data));this.showLoadError=true;return[3,4];case 4:return[2]}}))}))};e.prototype.initSigningSession=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,c(this.endpoint,this.envelopeId,this.roleId,this.inviteCode)];case 1:e=t.sent();this.processAuthResponse(e);return[2]}}))}))};e.prototype.retrySigningSession=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n;return __generator(this,(function(r){switch(r.label){case 0:this.showLoadError=false;this.loading=true;r.label=1;case 1:r.trys.push([1,3,,4]);return[4,this.initSigningSession()];case 2:r.sent();return[3,4];case 3:n=r.sent();console.log("[SIGN] Error with signing session",n);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new P(n.message,(t=n.response)===null||t===void 0?void 0:t.status,(i=n.response)===null||i===void 0?void 0:i.data));this.showLoadError=true;this.loading=false;return[3,4];case 4:return[2]}}))}))};e.prototype.prepareForViewTransition=function(){var e,t;this.stopPolling();(e=this.observer)===null||e===void 0?void 0:e.disconnect();this.observer=null;(t=document.getElementById("air-datepicker-global-container"))===null||t===void 0?void 0:t.remove()};e.prototype.handleSubmitSuccess=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r;var s=this;return __generator(this,(function(o){switch(o.label){case 0:this.submitting=false;this.submitted=true;this.nextSubmits=false;this.signingProgressMode="completed";o.label=1;case 1:o.trys.push([1,3,,4]);return[4,d(this.endpoint,this.envelopeId)];case 2:i=o.sent();this.envelope=i;U.updateEnvelope(this.envelopeId,i);n=(e=i.recipients)===null||e===void 0?void 0:e.find((function(e){var t;return e.role_name===((t=s.recipient)===null||t===void 0?void 0:t.role_name)}));if(n){this.recipient=n}(t=this.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,envelope:i,event:"submitted"});return[3,4];case 3:r=o.sent();console.warn("[SIGN] Error refreshing envelope after submit",r);return[3,4];case 4:this.showDone=true;return[2]}}))}))};e.prototype.componentDidRender=function(){var e=this.headerTargetId?document.getElementById(this.headerTargetId):null;var t=document.getElementById("verdocs-sign-header");if(e&&t){console.log("[SIGN] Moving header");t.remove();e.append(t)}this.setupIntersectionObserver()};e.prototype.disconnectedCallback=function(){var e=this;var t,i,n;this.stopPolling();(t=this.observer)===null||t===void 0?void 0:t.disconnect();window.removeEventListener("resize",(function(){return e.updateZoomFromWindow()}));(i=document.getElementById(this.getOrgStyleOverridesId()))===null||i===void 0?void 0:i.remove();(n=document.getElementById(this.getBrandStyleOverridesId()))===null||n===void 0?void 0:n.remove()};e.prototype.updateZoomFromWindow=function(){var e=window.innerWidth;if(e<768){if(this.zoomLevel!=="zoom2")this.zoomLevel="zoom2"}else if(e<1024){if(this.zoomLevel!=="zoom1")this.zoomLevel="zoom1"}else{if(this.zoomLevel!=="normal")this.zoomLevel="normal"}};e.prototype.setupIntersectionObserver=function(){var e=this;var t=this.el.querySelectorAll("verdocs-envelope-document-page");if(t.length===0)return;if(this.observer){this.observer.disconnect()}var i=this.el.querySelector(".signed-document-container");var n={root:i,rootMargin:"-40% 0px -40% 0px",threshold:0};this.observer=new IntersectionObserver((function(t){t.forEach((function(t){if(t.isIntersecting){var i=t.target.id;var n=parseInt(i.replace("page-",""),10);if(!isNaN(n)&&e.pageNumber!==n){e.pageNumber=n}}}))}),n);t.forEach((function(t){return e.observer.observe(t)}))};e.prototype.getOrgStyleOverridesId=function(){return"verdocs-org-style-overrides-".concat(this.envelopeId)};e.prototype.getBrandStyleOverridesId=function(){return"verdocs-brand-style-overrides-".concat(this.envelopeId)};e.prototype.applyOrgStyleOverrides=function(){var e,t;var i=this.getOrgStyleOverridesId();var n=document.getElementById(i);var r=(t=(e=this.envelope)===null||e===void 0?void 0:e.organization)===null||t===void 0?void 0:t.style_overrides;if(typeof r==="string"){var s=n||document.createElement("style");s.id=i;s.textContent=r;if(!n){document.head.appendChild(s)}}else if(n){n.remove()}};e.prototype.applyBrandStyleOverrides=function(e){var t=this.getBrandStyleOverridesId();var i=document.getElementById(t);var n=e===null||e===void 0?void 0:e.style_overrides;if(typeof n==="string"&&n.length>0){var r=i||document.createElement("style");r.id=t;r.textContent=n;if(!i){document.head.appendChild(r)}}else if(i){i.remove()}};e.prototype.processAuthResponse=function(e){var t,i,n,r;var s=e.envelope,o=e.recipient,a=e.brand;(t=s.documents)===null||t===void 0?void 0:t.sort((function(e,t){return e.order!==t.order?e.order-t.order:e.created_at.localeCompare(t.created_at)}));var c=o.auth_step;this.recipient=o;this.envelope=s;this.disclosures=((n=(i=this.envelope)===null||i===void 0?void 0:i.organization)===null||n===void 0?void 0:n.disclaimer)||l;this.applyOrgStyleOverrides();this.applyBrandStyleOverrides(a);this.authStep=c;this.delegated=!!o.delegated_to;this.agreed=o.agreed;this.signatureId=null;this.initialId=null;this.submitted=o.status==="submitted";this.loading=false;this.isDone=this.submitted;this.showDone=this.submitted;U.updateEnvelope(this.envelopeId,s);if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.authMethodStates=o.auth_method_states||{};this.kbaQuestions=o.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(o.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();(r=this.envelopeLoaded)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope})};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;console.log("[SIGN] Accepting disclosures",this.disclosures);var t=Intl.DateTimeFormat().resolvedOptions();u(this.endpoint,this.envelopeId,this.roleId,this.disclosures,{locale:t.locale,timezone:t.timeZone}).then((function(){var t;e.nextButtonLabel="Next";e.recipient.agreed=true;e.submitting=false;e.agreed=true;(t=e.envelopeUpdated)===null||t===void 0?void 0:t.emit({endpoint:e.endpoint,envelope:e.envelope,event:"agreed"})})).catch((function(t){var i,n,r;console.log("[SIGN] Unable to accept disclosures",t);A("Unable to accept disclosures, please try again later",{style:"error"});(i=e.sdkError)===null||i===void 0?void 0:i.emit(new P(t.message,(n=t.response)===null||n===void 0?void 0:n.status,(r=t.response)===null||r===void 0?void 0:r.data));e.submitting=false}))};e.prototype.handlePageSelect=function(e){var t=parseInt(e.target.value);if(!isNaN(t)){this.pageNumber=t;var i=this.el.querySelector(".signed-document-container");var n=this.el.querySelector("#page-".concat(t));if(i&&n){var r=n.offsetTop-20;i.scrollTo({top:r,behavior:"smooth"})}}};e.prototype.handleOptionSelected=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i;return __generator(this,(function(n){switch(e.detail.id){case"later":this.finishLater=true;this.showFinishLater=true;(t=this.envelopeUpdated)===null||t===void 0?void 0:t.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();(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":this.showDownloadDialog=true;this.startPolling();break}return[2]}))}))};e.prototype.startPolling=function(){var e=this;this.stopPolling();var t=function(){var t,i,n,r,s,o;var a=((t=e.envelope)===null||t===void 0?void 0:t.status)==="complete"||!!((i=e.envelope)===null||i===void 0?void 0:i.signed);var l=(r=(n=e.envelope)===null||n===void 0?void 0:n.documents)===null||r===void 0?void 0:r.some((function(e){return e.type==="certificate"}));var c=(o=(s=e.envelope)===null||s===void 0?void 0:s.recipients)===null||o===void 0?void 0:o.every((function(e){return e.status==="submitted"}));if(a&&l)return false;if(!c)return false;return true};if(!t()){return}this.polling=true;this.pollingInterval=setInterval((function(){return __awaiter(e,void 0,void 0,(function(){var e,i;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,d(this.endpoint,this.envelopeId)];case 1:e=n.sent();this.envelope=e;U.updateEnvelope(this.envelopeId,e);this.checkRecipientFields();if(!t()){this.stopPolling()}return[3,3];case 2:i=n.sent();console.error("[SIGN] Polling error",i);this.stopPolling();return[3,3];case 3:return[2]}}))}))}),5e3)};e.prototype.stopPolling=function(){if(this.pollingInterval){clearInterval(this.pollingInterval);this.pollingInterval=null}this.polling=false};e.prototype.handleZoomIn=function(){if(this.zoomLevel==="normal"){this.zoomLevel="zoom1"}else if(this.zoomLevel==="zoom1"){this.zoomLevel="zoom2"}};e.prototype.handleZoomOut=function(){if(this.zoomLevel==="zoom1"){this.zoomLevel="normal"}else if(this.zoomLevel==="zoom2"){this.zoomLevel="zoom1"}};e.prototype.updateRecipientFieldValue=function(e,t){var i=this;console.log("[SIGN] updateRecipientFieldValue",e,t);this.getRecipientFields().forEach((function(n){if(n.name===e){n.value=t.value;n.settings=t.settings;H(n);i.fieldUpdateCounter++;i.markEnvelopeStarted();i.checkRecipientFields()}}))};e.prototype.getStartedKey=function(){var e;return"".concat(this.envelopeId,":").concat(((e=this.recipient)===null||e===void 0?void 0:e.role_name)||"")};e.prototype.markEnvelopeStarted=function(){var e=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");var t=this.getStartedKey();if(!e.includes(t)){e.push(t);while(e.length>10){e.shift()}localStorage.setItem("startedEnvelopes",JSON.stringify(e))}};e.prototype.saveFieldChange=function(e,t,i){var n=this;var r=this.getRecipientFields().find((function(t){return t.name===e}));if(r===null||r===void 0?void 0:r.readonly){return}console.log("[SIGN] saveFieldChange",e,{value:t,prepared:i});h(this.endpoint,this.envelopeId,this.roleId,e,t,i).then((function(t){return n.updateRecipientFieldValue(e,t)})).catch((function(e){var t,i,r,s,o,a;if(((t=e.response)===null||t===void 0?void 0:t.status)===401&&((r=(i=e.response)===null||i===void 0?void 0:i.data)===null||r===void 0?void 0:r.error)==="jwt expired"){console.log("[SIGN] Signing session expired");n.fatalErrorHeader="Signing Session Expired";n.fatalErrorMessage="Please reload your browser to continue."}else{console.log("[SIGN] Server error",e);A("Unable to save change, please try again later",{style:"error"})}(s=n.sdkError)===null||s===void 0?void 0:s.emit(new P(e.message,(o=e.response)===null||o===void 0?void 0:o.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return __awaiter(this,void 0,void 0,(function(){var i,n,r,s,o,o,o,a,o,o,o,l,c;var d=this;return __generator(this,(function(u){switch(u.label){case 0:if(!t.target){return[2]}i=t.target,n=i.value,r=i.checked;s=e.type;switch(s){case"textarea":return[3,1];case"textbox":return[3,1];case"checkbox":return[3,2];case"radio":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,14];case"date":return[3,23];case"timestamp":return[3,24]}return[3,25];case 1:return[2,this.saveFieldChange(e.name,n,false)];case 2:{return[2,this.saveFieldChange(e.name,String(t.target.checked),false)]}u.label=3;case 3:{return[2,this.saveFieldChange(e.name,String(t.target.checked),false)]}u.label=4;case 4:console.log("Saving dropdown",e.name,t.detail);return[2,this.saveFieldChange(e.name,t.detail,false)];case 5:if(t.detail===undefined){return[2]}if(!(t.detail===null))return[3,7];console.log("[SIGN] Clearing initial");return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,null,false)];case 6:o=u.sent();return[2,this.updateRecipientFieldValue(e.name,o)];case 7:if(!this.initialId)return[3,9];console.log("[SIGN] Reusing initial",this.initialId);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,this.initialId,false)];case 8:o=u.sent();return[2,this.updateRecipientFieldValue(e.name,o)];case 9:if(!(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)))return[3,11];console.log("[SIGN] Reusing initial",t.detail);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false)];case 10:o=u.sent();this.initialId=t.detail;return[2,this.updateRecipientFieldValue(e.name,o)];case 11:this.showSpinner=true;return[4,fetch(t.detail)];case 12:return[4,u.sent().blob()];case 13:a=u.sent();return[2,v(this.endpoint,"initial",a).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.initialId=t.id;this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.log("Error updating initials",e);A("Unable to save initials, please try again later",{style:"error"});d.showSpinner=false}))];case 14:if(t.detail===undefined){return[2]}if(!(t.detail===null))return[3,16];console.log("[SIGN] Clearing signature");return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,null,false)];case 15:o=u.sent();return[2,this.updateRecipientFieldValue(e.name,o)];case 16:if(!this.signatureId)return[3,18];console.log("[SIGN] Reusing signature",this.signatureId);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,this.signatureId,false)];case 17:o=u.sent();return[2,this.updateRecipientFieldValue(e.name,o)];case 18:if(!(typeof t.detail==="string"&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t.detail)))return[3,20];console.log("[SIGN] Reusing signature",t.detail);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,t.detail,false)];case 19:o=u.sent();this.signatureId=t.detail;return[2,this.updateRecipientFieldValue(e.name,o)];case 20:this.showSpinner=true;return[4,fetch(t.detail)];case 21:return[4,u.sent().blob()];case 22:l=u.sent();console.log("[SIGN] Creating new signature");return[2,f(this.endpoint,"signature",l).then((function(t){return __awaiter(d,void 0,void 0,(function(){var i;return __generator(this,(function(n){switch(n.label){case 0:console.log("Signature update result",t);return[4,h(this.endpoint,this.envelopeId,this.roleId,e.name,t.id,false)];case 1:i=n.sent();this.updateRecipientFieldValue(e.name,i);this.signatureId=t.id;this.showSpinner=false;return[2]}}))}))})).catch((function(e){console.warn("[SIGN] Error updating signature",e);A("Unable to save signature, please try again later",{style:"error"});d.showSpinner=false}))];case 23:c=t.detail.formattedDate;if(c){return[2,this.saveFieldChange(e.name,c,false)]}return[3,26];case 24:console.log("[SIGN] Updating timestamp",{value:n,ts:t.target.getAttribute("timestamp")});return[3,26];case 25:console.log("[SIGN] Unhandled field update",{value:n,checked:r},e);return[3,26];case 26:return[2]}}))}))};e.prototype.getSortedFillableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"&&!e.readonly}));p(e);return e};e.prototype.getSortedDisplayableFields=function(){var e=this.getRecipientFields().filter((function(e){return e.type!=="timestamp"}));p(e);return e};e.prototype.handleNext=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,n,r,s,o,a;var l=this;return __generator(this,(function(c){switch(c.label){case 0:if(!this.nextSubmits)return[3,6];if(this.submitted){return[2]}c.label=1;case 1:c.trys.push([1,4,,5]);(e=document.getElementById("air-datepicker-global-container"))===null||e===void 0?void 0:e.remove();this.submitting=true;t=Intl.DateTimeFormat().resolvedOptions();return[4,g(this.endpoint,this.envelopeId,this.roleId,{locale:t.locale,timezone:t.timeZone})];case 2:i=c.sent();console.log("[SIGN] Submitted successfully",i);return[4,this.handleSubmitSuccess()];case 3:c.sent();return[3,5];case 4:n=c.sent();console.log("[SIGN] Error submitting",n);this.submitting=false;A("Unable to submit document, please try again.",{style:"error"});return[3,5];case 5:return[2];case 6:r=this.getSortedFillableFields().filter((function(e){return!l.isFieldActuallyFilled(e)}));s=this.getNextFieldFromList(r);if(s){o=T(s);a=document.getElementById(o);a===null||a===void 0?void 0:a.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});a===null||a===void 0?void 0:a.focusField();this.focusedField=s.name}return[2]}}))}))};e.prototype.handleNextOptional=function(){var e=this;var t=this.getSortedFillableFields().filter((function(t){return!t.required&&!e.isFieldActuallyFilled(t)}));var i=this.getNextFieldFromList(t);if(i){var n=T(i);var r=document.getElementById(n);r===null||r===void 0?void 0:r.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});r===null||r===void 0?void 0:r.focusField();this.focusedField=i.name}};e.prototype.getRecipientFields=function(){var e=this;var t;return((t=this.envelope)===null||t===void 0?void 0:t.fields.filter((function(t){return t.role_name===e.recipient.role_name})))||[]};e.prototype.getRequiredTotalCount=function(){return this.getSortedFillableFields().filter((function(e){return e.required})).length};e.prototype.getRequiredFilledCount=function(){var e=this;return this.getSortedFillableFields().filter((function(t){return t.required&&e.isFieldActuallyFilled(t)})).length};e.prototype.getOptionalUnfilledCount=function(){var e=this;return this.getSortedFillableFields().filter((function(t){return!t.required&&!e.isFieldActuallyFilled(t)})).length};e.prototype.checkRecipientFields=function(){var e=this;if(this.submitted||this.isDone){return}var t=this.getRecipientFields().filter((function(t){return!m(t,e.getRecipientFields())}));if(t.length<1){this.nextButtonLabel="Finish";if(!this.nextSubmits){this.nextSubmits=true}}else{this.nextButtonLabel="Next";this.nextSubmits=false}this.updateAllFlags();var i=JSON.parse(localStorage.getItem("startedEnvelopes")||"[]");var n=i.includes(this.getStartedKey());if(this.nextSubmits){this.signingProgressMode="completed"}else if(n){this.signingProgressMode="signing"}else{this.signingProgressMode="start"}};e.prototype.isFieldActuallyFilled=function(e){if(e.type==="radio"&&e.group){var t=this.getRecipientFields().some((function(t){return t.group===e.group&&t.value==="true"}));if(t){return true}}return x(e,this.getRecipientFields())&&(e.type!=="dropdown"||!!e.value)&&(e.type!=="radio"||e.value==="true")&&(e.type!=="checkbox"||e.value==="true")};e.prototype.getNextRequiredField=function(){var e=this;var t=this.getSortedFillableFields().filter((function(t){return t.required&&!e.isFieldActuallyFilled(t)}));p(t);if(t.length===0){var i=this.getSortedFillableFields().filter((function(t){return!e.isFieldActuallyFilled(t)}));p(i);if(i.length>0){return this.getNextFieldFromList(i)}return null}return this.getNextFieldFromList(t)};e.prototype.getNextFieldFromList=function(e){var t=this;var i=e.findIndex((function(e){return e.name===t.focusedField}));var n=i+1;if(n>=e.length){n=0}return e[n]};e.prototype.handlePrev=function(){var e=this;var t;var i=this.getSortedFillableFields();var n=i.findIndex((function(t){return t.name===e.focusedField}));if(n>0){var r=i[n-1];var s=T(r);var o=document.getElementById(s);o===null||o===void 0?void 0:o.scrollIntoView({behavior:"smooth",block:"center"});(t=o===null||o===void 0?void 0:o.focusField)===null||t===void 0?void 0:t.call(o);this.focusedField=r.name}};e.prototype.updateAllFlags=function(){var e=this;Object.values(this.renderedPages).forEach((function(t){e.updateFlagsForPage(t)}))};e.prototype.updateFlagsForPage=function(e){var t=this;if(!e)return;var i=document.getElementById(e.containerId+"-controls");if(!i)return;var n=i.querySelectorAll(".verdocs-flag-instance");n.forEach((function(e){return e.remove()}));var r=this.getNextRequiredField();var s=this.getRecipientFields().find((function(e){return e.name===t.focusedField}));if(s&&!x(s,this.getRecipientFields())){r=s}if(r&&r.page===e.pageNumber&&r.document_id===e.documentId){var o="fill";var a="FILL";var l=false;switch(r.type){case"signature":a="SIGN";break;case"initial":a="INITIAL";break;case"checkbox":a="CHECK";break;case"radio":a="SELECT";break;case"date":case"dropdown":a="SELECT";break;case"attachment":a="ATTACH";break;case"payment":a="PAY";break}if(!r.required){l=true}E(e,r.y,r.height||D(r.type),{variant:o,label:a,showSkip:l,onSkip:function(){t.handleNext()},onClick:function(){var e;var t=T(r);var i=document.getElementById(t);i===null||i===void 0?void 0:i.scrollIntoView({behavior:"smooth",block:"center"});(e=i===null||i===void 0?void 0:i.focusField)===null||e===void 0?void 0:e.call(i)}})}};e.prototype.attachFieldAttributes=function(e,t,i){var n=this;if(i.getAttribute("attached")==="1"){return}i.setAttribute("attached","1");i.addEventListener("input",(function(e){if(e.target.type==="radio"||e.target.type==="checkbox"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}else{n.checkRecipientFields()}}));i.addEventListener("attached",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,r,s;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onAttached",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,b(this.endpoint,this.envelopeId,this.roleId,t.name,i.detail)];case 2:n=o.sent();this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();r=q("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,r);this.showSpinner=false;return[3,4];case 3:s=o.sent();console.log("Error uploading attachment",s);A("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("deleted",(function(i){return __awaiter(n,void 0,void 0,(function(){var n,r,s;return __generator(this,(function(o){switch(o.label){case 0:console.log("[SIGN] onDeleted",i.detail,i.target.value);this.showSpinner=true;o.label=1;case 1:o.trys.push([1,3,,4]);return[4,w(this.endpoint,this.envelopeId,this.roleId,t.name)];case 2:n=o.sent();console.log("[SIGN] Deleted attachment",n);this.updateRecipientFieldValue(t.name,n);this.checkRecipientFields();r=q("envelope",t,e,{disabled:false,editable:false,draggable:false,done:this.isDone});this.attachFieldAttributes(e,t,r);this.showSpinner=false;return[3,4];case 3:s=o.sent();console.log("Error uploading attachment",s);A("Unable to upload attachment, please try again later",{style:"error"});this.showSpinner=false;return[3,4];case 4:return[2]}}))}))}));i.addEventListener("focusout",(function(e){if(t.type!=="dropdown"&&t.type!=="attachment"&&t.type!=="signature"&&t.type!=="initial"&&t.type!=="checkbox"&&t.type!=="radio"){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}}));i.addEventListener("fieldChange",(function(e){n.handleFieldChange(t,e).finally((function(){return n.checkRecipientFields()}))}));i.addEventListener("adopt",(function(){n.focusedField=t.name;n.adoptingSignature=true}));i.setAttribute("templateid",this.envelope.template_id);i.setAttribute("fieldname",t.name);i.setAttribute("page",e.pageNumber);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);var r=y(this.recipient);i.setAttribute("initials",k(r));i.setAttribute("name",r);if(this.signatureId){i.setAttribute("signatureid",this.signatureId)}if(this.initialId){i.setAttribute("initialid",this.initialId)}};e.prototype.handlePageRendered=function(e){var t=this;var i=e.detail;this.renderedPages["".concat(i.documentId,":").concat(i.pageNumber)]=i;var n=this.getSortedDisplayableFields();n.filter((function(e){return e&&e.document_id===i.documentId&&e.page===i.pageNumber})).forEach((function(e,n){var r=q("envelope",e,i,{disabled:false,editable:false,draggable:false,done:t.isDone},n);if(!r){return}if(Array.isArray(r)){r.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,r)}}));this.envelope.recipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status==="invited"||e.status==="opened"||e.status==="pending")})).forEach((function(){t.getRecipientFields().filter((function(e){return e.document_id===i.documentId&&e.page===i.pageNumber})).forEach((function(e){var n=q("envelope",e,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!n){return}if(Array.isArray(n)){n.map((function(n){return t.attachFieldAttributes(i,e,n)}))}else{t.attachFieldAttributes(i,e,n)}}))}));this.checkRecipientFields();this.updateFlagsForPage(i)};e.prototype.handleAuthenticateSigner=function(e){var t=this;console.log("[SIGN] Submitting authentication step",e);_(this.endpoint,e).then((function(e){console.log("[SIGN] Verification successful",e);t.processAuthResponse(e)})).catch((function(e){var i,n,r,s,o,a;console.log("[SIGN] Error submitting authentication step",e);console.log((i=e.response)===null||i===void 0?void 0:i.data);if((s=(r=(n=e.response)===null||n===void 0?void 0:n.data)===null||r===void 0?void 0:r.error)===null||s===void 0?void 0:s.includes("failed")){t.fatalErrorHeader="Recipient Verification Failed";t.fatalErrorMessage="We were unable to verify your identity. The sender has been notified.";t.isDone=true}else{A(((a=(o=e.response)===null||o===void 0?void 0:o.data)===null||a===void 0?void 0:a.error)||"Unable to verify your identity. Please try again.",{style:"error"})}}))};e.prototype.handleOnDownload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,s,o,a,l,c,d,u,h,f,v,p,g;return __generator(this,(function(m){switch(m.label){case 0:n=e.detail,r=n.action,s=n.documentId;console.log("[SIGN] Download action selected:",r,s);m.label=1;case 1:m.trys.push([1,14,,15]);o=r;switch(o){case M.certificate:return[3,2];case M.combined:return[3,6];case M.document:return[3,8];case M.zip:return[3,11]}return[3,13];case 2:a=this.envelope.documents.find((function(e){return e.type==="certificate"}));if(!a)return[3,4];return[4,S(this.endpoint,a.id)];case 3:l=m.sent();window.open(l,"_blank");return[3,5];case 4:A("Certificate not yet available.",{style:"info"});m.label=5;case 5:return[3,13];case 6:c=s||((t=this.envelope.documents.find((function(e){return e.type==="certificate"})))===null||t===void 0?void 0:t.id);return[4,N(this.endpoint,c)];case 7:d=m.sent();window.open(d,"_blank");return[3,13];case 8:u=s||((i=this.envelope.documents.find((function(e){return e.type==="attachment"})))===null||i===void 0?void 0:i.id);if(!u)return[3,10];return[4,S(this.endpoint,u)];case 9:h=m.sent();window.open(h,"_blank");m.label=10;case 10:return[3,13];case 11:return[4,C(this.endpoint,[this.envelopeId])];case 12:f=m.sent();v=window.URL.createObjectURL(f.data);p=document.createElement("a");p.href=v;p.download="".concat(this.envelope.name,".zip");document.body.appendChild(p);p.click();p.remove();window.URL.revokeObjectURL(v);return[3,13];case 13:return[3,15];case 14:g=m.sent();console.error("Download error",g);A("Unable to complete download request.",{style:"error"});return[3,15];case 15:return[2]}}))}))};e.prototype.render=function(){var e=this;var t;if(this.showLoadError){return n(r,null,n("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:function(){e.retrySigningSession()}}))}if(!this.envelope){return n(r,null,n("verdocs-loader",null))}if(this.fatalErrorMessage){return n(r,{class:{agreed:this.agreed}},n("div",{class:"fatal-error"},n("div",{class:"message"},n("div",{class:"header"},this.fatalErrorHeader),n("p",null,this.fatalErrorMessage))))}if(this.delegated){return n(r,{class:{agreed:false}},n("div",{class:"fatal-error"},n("div",{class:"message"},n("div",{class:"header"},"Delegated Signing Request"),n("p",null,"You have delegated signing to another recipient. You will not be able to sign this request again."))))}if(this.isDone){return n(r,{class:{agreed:this.agreed}},n("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var i;return(i=e.sdkError)===null||i===void 0?void 0:i.emit(t.detail)}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(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:function(t){t.preventDefault();t.stopPropagation();e.handleDoneDialogDismiss()},onExit:function(){return e.handleDoneDialogDismiss()}}),this.submitting&&n("div",{class:"loading-indicator"},n("verdocs-loader",null)))}if(this.delegating){return n(r,{class:"agreed"},n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("verdocs-delegate-dialog",{endpoint:this.endpoint,envelope:this.envelope,onExit:function(){return e.delegating=false},onNext:function(t){I(e.endpoint,e.envelopeId,e.roleId,t.detail).then((function(t){A("Delegation request submitted.",{style:"success"});console.log("[SIGN] Delegated successfully",t);e.delegated=true;e.delegating=false})).catch((function(e){console.log("[SIGN] Error delegating request",e);A("Unable to process delegation request. Please try again later.",{style:"error"})}))}}))}if(this.declining){return n(r,{class:"agreed"},n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("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:function(){return e.declining=false},onNext:function(){z(e.endpoint,e.envelopeId,e.roleId).then((function(t){console.log("[SIGN] Decline result",t);e.declining=false;e.fatalErrorHeader="Declined";e.fatalErrorMessage="You have declined to sign this request. The sender has been notified."})).catch((function(e){console.warn("[SIGN] Error declining signing session",e);A("Unable to decline, please try again later",{style:"error"})}))}}))}if(!this.agreed){return n(r,{class:"agreed"},n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("verdocs-disclosure-dialog",{disclosures:this.disclosures,delegator:this.recipient.delegator,onDelegate:function(){return e.delegating=true},onDecline:function(){return e.declining=true},onAccept:function(){return e.handleClickAgree()}}))}if(this.authStep==="passcode"){return n("verdocs-passcode-dialog",{endpoint:this.endpoint,onNext:function(t){return e.processAuthResponse(t.detail.response)}})}if(this.authStep==="sms"){return n("verdocs-otp-dialog",{endpoint:this.endpoint,method:"sms",onNext:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){this.processAuthResponse(t.detail.response);return[2]}))}))}})}if(this.authStep==="email"){return n("verdocs-otp-dialog",{endpoint:this.endpoint,method:"email",onNext:function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){this.processAuthResponse(t.detail.response);return[2]}))}))}})}if(this.authStep==="kba"&&!this.authMethodStates.kba){return n(r,{class:"kba"},n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name))),n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("div",{class:"cover"},n("div",{class:"kba"},n("verdocs-kba-dialog",{mode:"identity",helptitle:"Document requires identity verification",helptext:"Please complete your contact details to proceed.",recipient:this.recipient,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=t.detail;this.handleAuthenticateSigner({auth_method:"kba",first_name:e.first_name,last_name:e.last_name,address:e.address,city:e.city,state:e.state,zip:e.zip,dob:e.dob});return[2]}))}))}}))))}if(this.authStep==="kba"&&this.authMethodStates.kba==="questions"){var i=this.kbaChoices.length;var o=this.kbaQuestions[i];return n(r,{class:"kba"},n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),n("div",{class:"title"},this.envelope.name))),n("div",{class:"document",style:{paddingTop:"15px"}},n("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"})),n("div",{class:"cover"},n("div",{class:"kba"},this.kbaChoices.length>=this.kbaQuestions.length?n("verdocs-spinner",null):n("verdocs-kba-dialog",{mode:"choice",helptitle:"Your identity requires additional verification",helptext:(o===null||o===void 0?void 0:o.prompt)||"Please select one of the options below.",choices:(o===null||o===void 0?void 0:o.answer)||["Skip Question"],step:i+1,steps:this.kbaQuestions.length,onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e,i;var n=this;return __generator(this,(function(r){e=t.detail;this.kbaChoices=__spreadArray(__spreadArray([],this.kbaChoices,true),[e],false);if(this.kbaChoices.length>=this.kbaQuestions.length){i=this.kbaQuestions.map((function(e,t){return{type:e.type,answer:n.kbaChoices[t]}}));console.log("Submitting KBA responses",this.kbaChoices,i);this.handleAuthenticateSigner({auth_method:"kba",responses:i})}return[2]}))}))}}))))}var a=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var l=[{id:"print",label:"Print"},{id:"download",label:"Download"}];if(this.recipient.delegator){a.unshift({id:"delegate",label:"Delegate"})}var c=this.getRecipientFields().filter((function(t){return!m(t,e.getRecipientFields())}));c.length>0?console.log("[SIGN] Invalid fields remaining",c.map((function(e){return e.name}))):console.log("[SIGN] All field valid");var d=this.envelope.documents.reduce((function(e,t){return e+t.pages}),0);var u=G(1,d).map((function(e){return{label:e.toString(),value:e.toString()}}));var p=0;return n(r,null,this.toolbarStyle==="menu"&&n("div",{id:"verdocs-sign-header"},n("div",{class:"inner"},n("div",{class:"title"},this.envelope.name),n("div",{style:{flex:"1"}}),!this.finishLater&&!this.submitted&&function(){var t=e.getRequiredTotalCount()-e.getRequiredFilledCount();var i=e.getOptionalUnfilledCount();if(t>0){return n("span",{class:"remaining-count"},t," required field",t===1?"":"s"," left")}return n("span",{class:"remaining-count"},n("span",{class:"check-icon",innerHTML:j}),"All required fields complete",i>0&&n("div",{class:"review-optional"},n("span",{class:"separator"},"| "),n("span",{onClick:function(){return e.handleNextOptional()}},"Review ",i," optional")))}(),!this.finishLater&&!this.submitted&&n("verdocs-button",{size:"xsmall",label:this.nextButtonLabel==="Next"?"Next Required":this.nextButtonLabel,disabled:!this.agreed||this.submitting||this.submitted,onClick:function(){return e.handleNext()}}),n("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal",magnify:true},innerHTML:O,onClick:function(){return e.handleZoomOut()}}),n("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2",magnify:true},innerHTML:Y,onClick:function(){return e.handleZoomIn()}}),n("verdocs-dropdown",{options:!this.isDone&&!this.finishLater&&!this.submitted?a:l,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),this.toolbarStyle==="controls"&&n("div",{class:"controls-toolbar"},n("div",{class:"left-controls"},n("div",{class:"title"},this.envelope.name)),n("div",{class:"center-controls"},n("span",{class:"label"},"Page"),n("div",{class:"select-wrapper"},n("verdocs-select-input",{options:u,value:this.pageNumber.toString(),onInput:function(t){return e.handlePageSelect(t)}})),n("span",{class:"count"},"of ",d)),n("div",{class:"right-controls"},!this.submitted&&n("verdocs-button",{class:"mobile-next-button",label:this.nextButtonLabel,size:"xsmall",disabled:!this.agreed||this.submitting,onClick:function(){return e.handleNext()}}),n("div",{class:{"icon-button":true,minus:true,disabled:this.zoomLevel==="normal"},innerHTML:O,onClick:function(){return e.handleZoomOut()}}),n("div",{class:{"icon-button":true,plus:true,disabled:this.zoomLevel==="zoom2"},innerHTML:Y,onClick:function(){return e.handleZoomIn()}}),n("div",{class:"icon-button download",innerHTML:Z,onClick:function(){return e.handleOptionSelected({detail:{id:"download"}})}}),n("div",{class:"icon-button print",innerHTML:F,onClick:function(){return e.handleOptionSelected({detail:{id:"print"}})}}))),n("div",{class:"document signed-document-container zoom-".concat(this.zoomLevel)},(this.envelope.documents||[]).map((function(t){var i=G(1,t.pages);return n(s,null,e.envelope.documents.length>1&&n("div",{class:"document-separator"},n("div",{innerHTML:V}),n("span",null,t.name)),i.map((function(i){var r;var s=((r=t.page_sizes)===null||r===void 0?void 0:r[i])||{width:612,height:792};p++;return n("verdocs-envelope-document-page",{id:"page-".concat(p),envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:s.width,virtualHeight:s.height,pageNumber:i,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&n("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:"To complete the ".concat(this.documentsSingularPlural,", use the link in the original email notification inviting you to review and finish the document."),onNext:function(){e.isDone=true;e.showFinishLater=false}}),this.showDone&&n("verdocs-ok-dialog",{heading:"You're Done!",message:"You can access the ".concat(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:function(){e.handleDoneDialogDismiss()},onExit:function(){return e.handleDoneDialogDismiss()}}),this.adoptingSignature&&n("verdocs-adopt-signature-dialog",{name:y(this.recipient),nameLocked:!!((t=this.recipient)===null||t===void 0?void 0:t.name_locked),onNext:function(t){return __awaiter(e,void 0,void 0,(function(){var e,i,n,r,s,o,a,l,c;var d=this;return __generator(this,(function(u){switch(u.label){case 0:console.log("[SIGN] Adopting signature/initials block",t.detail);this.showSpinner=true;return[4,fetch(t.detail.signature)];case 1:return[4,u.sent().blob()];case 2:e=u.sent();return[4,fetch(t.detail.initials)];case 3:return[4,u.sent().blob()];case 4:i=u.sent();return[4,f(this.endpoint,"signature",e)];case 5:n=u.sent();console.log("[SIGN] Created signature",n);this.signatureId=n.id;return[4,v(this.endpoint,"initial",i)];case 6:r=u.sent();console.log("[SIGN] Created initials",r);this.initialId=r.id;this.showSpinner=false;this.adoptingSignature=false;this.markEnvelopeStarted();if(!this.focusedField)return[3,9];s=this.getRecipientFields().find((function(e){return e.name===d.focusedField}));if(!s)return[3,8];o=s.type==="signature"?this.signatureId:s.type==="initial"?this.initialId:null;if(!o)return[3,8];return[4,h(this.endpoint,this.envelopeId,this.roleId,s.name,o,false)];case 7:a=u.sent();this.updateRecipientFieldValue(s.name,a);u.label=8;case 8:this.focusedField="";u.label=9;case 9:l=this.el.querySelectorAll("verdocs-field-signature");l.forEach((function(e){return e.setAttribute("signatureid",d.signatureId)}));c=this.el.querySelectorAll("verdocs-field-initial");c.forEach((function(e){return e.setAttribute("initialid",d.initialId)}));this.checkRecipientFields();return[2]}}))}))},onExit:function(){return e.adoptingSignature=false}}),(this.submitting||this.showSpinner)&&n("verdocs-portal",null,n("div",{class:"spinner-overlay"},n("verdocs-spinner",null))),this.showDownloadDialog&&n("verdocs-download-dialog",{signed:this.envelope.signed,polling:this.polling,documents:this.envelope.documents,onExit:function(){e.showDownloadDialog=false;e.stopPolling()},onDownload:function(t){return e.handleOnDownload(t)}}),!this.loading&&!this.isDone&&!this.submitted&&n("verdocs-sign-footer",{endpoint:this.endpoint,envelopeId:this.envelopeId,isDone:this.isDone,onAskQuestion:function(t){L(e.endpoint,e.envelopeId,e.roleId,{question:t.detail.question}).then((function(){return A("Your question has been sent.",{style:"success"})})).catch((function(e){console.log("Error asking question",e);A("Unable to send question, please try again later.",{style:"error"})}))},onDecline:function(){return e.declining=true},onFinishLater:function(){return e.showFinishLater=true}}))};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return e}());B.style=R()}}}));
|
|
2
|
+
//# sourceMappingURL=p-c86111fd.system.entry.js.map
|