@verdocs/web-sdk 1.13.3 → 1.13.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/verdocs-button-panel_3.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-checkbox_4.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-field-date.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-radio-button.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textarea.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-textbox.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +9 -1
- package/dist/cjs/verdocs-template-create_3.cjs.entry.js +7 -2
- package/dist/cjs/verdocs-view.cjs.entry.js +20 -4
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/components/controls/verdocs-checkbox/verdocs-checkbox.css +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +9 -1
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.css +10 -0
- package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +20 -4
- package/dist/collection/components/fields/verdocs-field-attachment/verdocs-field-attachment.js +3 -3
- package/dist/collection/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.css +12 -11
- package/dist/collection/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.js +4 -4
- package/dist/collection/components/fields/verdocs-field-date/verdocs-field-date.js +4 -4
- package/dist/collection/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.js +3 -3
- package/dist/collection/components/fields/verdocs-field-initial/verdocs-field-initial.js +3 -3
- package/dist/collection/components/fields/verdocs-field-payment/verdocs-field-payment.js +3 -3
- package/dist/collection/components/fields/verdocs-field-radio-button-group/verdocs-field-radio-button.js +4 -4
- package/dist/collection/components/fields/verdocs-field-signature/verdocs-field-signature.js +3 -3
- package/dist/collection/components/fields/verdocs-field-textarea/verdocs-field-textarea.js +4 -4
- package/dist/collection/components/fields/verdocs-field-textbox/verdocs-field-textbox.js +4 -4
- package/dist/collection/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.js +3 -3
- package/dist/collection/components/templates/verdocs-template-field-properties/verdocs-template-field-properties.js +1 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.css +6 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +6 -1
- package/dist/components/verdocs-checkbox2.js +1 -1
- package/dist/components/verdocs-field-checkbox.js +2 -2
- package/dist/components/verdocs-field-date.js +1 -1
- package/dist/components/verdocs-field-radio-button.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-sign.js +9 -1
- package/dist/components/verdocs-template-field-properties2.js +1 -1
- package/dist/components/verdocs-template-fields2.js +7 -2
- package/dist/components/verdocs-view2.js +33 -11
- package/dist/docs.json +34 -27
- package/dist/esm/loader.js +1 -1
- package/dist/esm/verdocs-button-panel_3.entry.js +1 -1
- package/dist/esm/verdocs-checkbox_4.entry.js +1 -1
- package/dist/esm/verdocs-field-checkbox.entry.js +2 -2
- package/dist/esm/verdocs-field-date.entry.js +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +9 -1
- package/dist/esm/verdocs-template-create_3.entry.js +7 -2
- package/dist/esm/verdocs-view.entry.js +20 -4
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/verdocs-button-panel_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +1 -1
- package/dist/types/components/fields/verdocs-field-attachment/verdocs-field-attachment.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-checkbox/verdocs-field-checkbox.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-date/verdocs-field-date.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-dropdown/verdocs-field-dropdown.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-initial/verdocs-field-initial.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-payment/verdocs-field-payment.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-radio-button-group/verdocs-field-radio-button.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-signature/verdocs-field-signature.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-textarea/verdocs-field-textarea.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-textbox/verdocs-field-textbox.d.ts +2 -2
- package/dist/types/components/fields/verdocs-field-timestamp/verdocs-field-timestamp.d.ts +2 -2
- package/dist/types/components.d.ts +23 -23
- package/dist/types/utils/utils.d.ts +1 -1
- package/dist/verdocs-web-sdk/p-0714e785.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-59370436.system.entry.js → p-13f91d03.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6a0e0615.system.entry.js → p-16f3cd2d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-194a8f9c.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-bc287bf9.system.entry.js → p-1a34942f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d8343849.entry.js → p-39e906e0.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7306abd0.system.entry.js → p-3b1b11a8.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7a4d71b7.entry.js → p-40bb871d.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8eca5dd8.entry.js → p-42fa6b2f.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-60b59333.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-6caf1137.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-ba62a8f6.system.entry.js → p-798c0134.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-923f56f3.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-c2b91d4d.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-5a3d9d9f.system.entry.js → p-d595eba2.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d643db3b.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-27fe6789.entry.js → p-e16ad8fe.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-92a2bb47.entry.js → p-ebce4300.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-eff8b358.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f2f3583f.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-f44f5d73.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/typings.d.ts +0 -4
- package/dist/verdocs-web-sdk/p-09b008aa.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-22708d7d.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2cb414ec.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-36a31514.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-530e47e2.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-84485446.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-8d32078d.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-d7ca70cc.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f7910b66.entry.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
import{r as e,c as i,h as t,H as s,F as n}from"./p-e035df4b.js";import{b as o,t as a,u as l,c as r,d}from"./p-b3ec6306.js";import{R as c}from"./p-05788c2b.js";import{V as h}from"./p-c2c49441.js";import{a as u,i as p}from"./p-e662f81b.js";import{f as v,i as g}from"./p-7291906c.js";import{s as f,u as x,a as m,r as b,b as w}from"./p-1abcf29d.js";import{S as y}from"./p-7a1b2643.js";import"./p-eab67c09.js";import"./p-aa124212.js";import"./p-ab01f71e.js";var k=function(e,i,t,s){return n=void 0,o=void 0,l=function(){return function(e,i){var t,s,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(r){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(t=1,s&&(n=2&l[0]?s.return:l[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,l[1])).done)return n;switch(s=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,s=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){a.label=l[1];break}if(6===l[0]&&a.label<n[1]){a.label=n[1],n=l;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(l);break}n[2]&&a.ops.pop(),a.trys.pop();continue}l=i.call(e,a)}catch(e){l=[6,e],s=0}finally{t=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,r])}}}(this,(function(){return[2,e.api.put("/envelopes/".concat(i,"/recipients/").concat(t),s).then((function(e){return e.data}))]}))},new((a=void 0)||(a=Promise))((function(e,i){function t(e){try{r(l.next(e))}catch(e){i(e)}}function s(e){try{r(l.throw(e))}catch(e){i(e)}}function r(i){var n;i.done?e(i.value):(n=i.value,n instanceof a?n:new a((function(e){e(n)}))).then(t,s)}r((l=l.apply(n,o||[])).next())}));var n,o,a,l};const S=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}],I=[{id:"print",label:"Print"},{id:"download",label:"Download"}],N=class{constructor(t){e(this,t),this.sdkError=i(this,"sdkError",7),this.envelopeLoaded=i(this,"envelopeLoaded",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.endpoint=null,this.recipientIndex=-1,this.envelopeId=null,this.roleId=null,this.inviteCode=null,this.headerTargetId=null,this.envelope=null,this.roleNames=[],this.recipient=null,this.signerToken=null,this.hasSignature=!1,this.nextButtonLabel="Start",this.nextSubmits=!1,this.errorMessage="",this.focusedField="",this.submitting=!1,this.isDone=!1,this.showDone=!1,this.finishLater=!1,this.showFinishLater=!1,this.agreed=!1,this.documentsSingularPlural="document"}componentWillLoad(){this.endpoint=new h({sessionType:"signing"})}async componentWillRender(){var e,i,t,s,n,l,r;if(this.envelopeId)if(this.roleId)if(this.inviteCode)try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const{session:e,recipient:i,signerToken:t}=await o(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode});console.log(`[SIGN] Loaded signing session ${e.email} / ${e.profile_id}`),this.recipient=i,console.log("[SIGN] We are recipient",this.recipient),this.signerToken=t,this.endpoint.setToken(t),this.agreed&&(this.nextButtonLabel="Next"),this.envelope=await a(this.endpoint,this.envelopeId),this.roleNames=this.envelope.recipients.map((e=>e.role_name)),this.envelope.documents.length>0&&(this.documentsSingularPlural="document(s)"),this.recipientIndex=this.envelope.recipients.findIndex((e=>e.role_name==this.roleId)),this.recipientIndex>-1?(this.recipient=this.envelope.recipients[this.recipientIndex],this.agreed=this.recipient.agreed,console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)):console.log("[SIGN] Could not find our recipient record",this.roleId,this.envelope.recipients),this.isDone=["submitted","canceled","declined"].includes(this.recipient.status),this.checkRecipientFields(),null===(s=this.envelopeLoaded)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope})}catch(e){console.log("Error with signing session",e),null===(n=this.sdkError)||void 0===n||n.emit(new y(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(r=e.response)||void 0===r?void 0:r.data))}else null===(t=this.sdkError)||void 0===t||t.emit(new y("[SIGN] Missing required inviteCode",500,""));else null===(i=this.sdkError)||void 0===i||i.emit(new y("[SIGN] Missing required roleId",500,""));else null===(e=this.sdkError)||void 0===e||e.emit(new y("[SIGN] Missing required envelopId",500,""))}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null,i=document.getElementById("verdocs-sign-header");e&&i&&(console.log("[SIGN] Moving header"),i.remove(),e.append(i))}handleClickAgree(){var e,i,t;this.submitting=!0,(e=this.endpoint,i=this.envelopeId,t=this.roleId,!0,k(e,i,t,{action:"update",agreed:true})).then((()=>{var e;this.nextButtonLabel="Next",this.recipient.agreed=!0,this.submitting=!1,this.agreed=!0,null===(e=this.envelopeUpdated)||void 0===e||e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("Update failure",e),this.submitting=!1,null===(i=this.sdkError)||void 0===i||i.emit(new y(e.message,null===(t=e.response)||void 0===t?void 0:t.status,null===(s=e.response)||void 0===s?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s,n,o,a,l,r;switch(e.detail.id){case"later":this.finishLater=!0,this.showFinishLater=!0,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"claim":window.alert("This feature will be available in an upcoming release."),null===(t=this.envelopeUpdated)||void 0===t||t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});break;case"decline":{this.submitting=!0;const e=await(a=this.endpoint,l=this.envelopeId,r=this.roleId,k(a,l,r,{action:"decline"}));console.log("Decline result",e),null===(s=this.envelopeUpdated)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"}),this.submitting=!1,this.isDone=!0}break;case"print":window.print(),null===(n=this.envelopeUpdated)||void 0===n||n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":f(this.endpoint,this.envelope,this.envelope.envelope_document_id).catch((e=>{console.log("Error downloading PDF",e)})),null===(o=this.envelopeUpdated)||void 0===o||o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e),this.recipient.fields.forEach((t=>{t.name===e&&(t.settings=i.settings,x(t),this.checkRecipientFields())}))}saveFieldChange(e,i){console.log("[SIGN] updateRecipientFieldValue",e),l(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,n,o,a;401===(null===(i=e.response)||void 0===i?void 0:i.status)&&"jwt expired"===(null===(s=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===s?void 0:s.error)?(console.log("[SIGN] Signing session expired"),this.errorMessage="Signing session expired. Please reload your browser to continue."):console.log("[SIGN] Server error",e),null===(n=this.sdkError)||void 0===n||n.emit(new y(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(a=e.response)||void 0===a?void 0:a.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textbox":return this.saveFieldChange(e.name,{prepared:!1,value:t});case"checkbox_group":{const t=e.settings.options.map((e=>({id:e.id,checked:i.target.checked})));return this.saveFieldChange(e.name,{prepared:!1,value:{options:t}})}case"radio_button_group":{const t=e.settings.options.map((e=>({id:e.id,selected:i.target.value===e.id})));return this.saveFieldChange(e.name,{prepared:!1,value:{options:t}})}case"dropdown":return this.saveFieldChange(e.name,{prepared:!1,value:i.detail});case"initial":const l=await(await fetch(i.detail)).blob();return(n=this.endpoint,"initial",o=l,a=new FormData,a.append("initial",o,"initial"),n.api.post("/initials",a).then((function(e){return e.data}))).then((async i=>{const t=await d(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"signature":const c=await(await fetch(i.detail)).blob();return function(e,i,t){var s=new FormData;return s.append("signature",t,"signature"),e.api.post("/signatures",s).then((function(e){return e.data}))}(this.endpoint,0,c).then((async i=>{const t=await r(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"date":const h=i.target.getAttribute("iso");return this.saveFieldChange(e.name,{prepared:!1,value:h});case"timestamp":console.log("Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("Unhandled field update",{value:t,checked:s},e)}var n,o,a}isFieldValid(e){var i,t,s,n,o,a,l;const{required:r=!1}=e,{result:d="",value:c="",base64:h=""}=e.settings||{};switch(e.type){case"textbox":switch((null===(i=e.settings)||void 0===i?void 0:i.validator)||""){case"email":return p(d);case"phone":return u(d);default:return!r||""!==d}case"signature":case"initial":return!r||""!==h;case"timestamp":return!0;case"textarea":case"date":case"attachment":return!r||""!==d;case"dropdown":return!r||""!==c;case"checkbox_group":const v=((null===(s=null===(t=e.settings)||void 0===t?void 0:t.options)||void 0===s?void 0:s.filter((e=>e.checked)))||[]).length;return!r||v>=((null===(n=e.settings)||void 0===n?void 0:n.minimum_checked)||0)&&v<=((null===(o=e.settings)||void 0===o?void 0:o.maximum_checked)||999);case"radio_button_group":return!r||((null===(l=null===(a=e.settings)||void 0===a?void 0:a.options)||void 0===l?void 0:l.filter((e=>e.selected)))||[]).length>0;default:return!1}}async handleNext(){var e,i,t,s;if(this.nextSubmits){try{this.submitting=!0;const e=await(i=this.endpoint,t=this.envelopeId,s=this.roleId,k(i,t,s,{action:"submit"}));console.log("[SIGN] Submitted successfully",e),this.recipient.status="submitted",this.showDone=!0,this.isDone=!0}catch(e){console.log("[SIGN] Error submitting",e)}return void(this.submitting=!1)}const n=this.recipient.fields.filter((e=>e.required));let o=n.findIndex((e=>e.name===this.focusedField))+1;o>=n.length&&(o=0);let a=n[o],l=0;if(l<n.length&&["signature","initial"].includes(a.type)&&"signed"===(null===(e=a.settings)||void 0===e?void 0:e.result)&&(l++,o++,o>=n.length&&(o=0),a=n[o]),l>=n.length&&(a=null),a){const e=w(a),i=document.getElementById(e);null==i||i.focusField(),this.focusedField=a.name}}checkRecipientFields(){const e=this.recipient.fields.filter((e=>!this.isFieldValid(e)));e.length<1?(this.nextButtonLabel="Finish",this.nextSubmits=!0):(console.log("[SIGN] Remaining invalid fields",e),this.nextButtonLabel="Next",this.nextSubmits=!1)}attachFieldAttributes(e,i,t,s){var n;s.addEventListener("input",(e=>{console.log("[SIGN] onfieldInput",e.detail,e.target.value),this.checkRecipientFields()})),s.addEventListener("focusout",(e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())))),s.addEventListener("fieldChange",(e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())))),s.setAttribute("roleindex",t),s.setAttribute("xScale",e.xScale),s.setAttribute("yScale",e.yScale),s.setAttribute("initials",this.recipient?v(this.recipient.full_name):""),s.setAttribute("name",(null===(n=this.recipient)||void 0===n?void 0:n.full_name)||"")}handlePageRendered(e){const i=e.detail,t=m(this.roleNames,this.recipient.role_name),s=this.recipient.fields.filter((e=>e.page===i.pageNumber));console.log("[SIGN] Page rendered, updating fields",{pageInfo:i,roleIndex:t,recipientFields:s}),s.forEach((e=>{const s=b(e,i,t,{disabled:!1,editable:!1,draggable:!1,done:this.isDone});s&&(Array.isArray(s)?s.map((s=>this.attachFieldAttributes(i,e,t,s))):this.attachFieldAttributes(i,e,t,s))})),this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status===c.SUBMITTED||e.status===c.CANCELED||e.status===c.DECLINED))).forEach((e=>{e.fields.forEach((e=>{const s=b(e,i,t,{disabled:!0,editable:!1,draggable:!1,done:this.isDone});s&&(Array.isArray(s)?s.map((s=>this.attachFieldAttributes(i,e,t,s))):this.attachFieldAttributes(i,e,t,s))}))})),this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name)).forEach((e=>{const t=m(this.roleNames,e.role_name);e.fields.filter((e=>e.page===i.pageNumber)).forEach((e=>{const s=b(e,i,t,{disabled:!0,editable:!1,draggable:!1,done:this.isDone});s&&s.setAttribute&&(s.setAttribute("roleindex",t),s.setAttribute("xScale",i.xScale),s.setAttribute("yScale",i.yScale))}))})),this.checkRecipientFields()}render(){return this.envelope?this.isDone?t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return null===(i=this.sdkError)||void 0===i?void 0:i.emit(e.detail)}}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=!1,this.isDone=!0}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null))):t(s,{class:{agreed:this.agreed}},!this.finishLater&&t("div",{class:"intro"},t("div",{class:"inner"},"Please review and act on these documents.")),t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},this.agreed?t(n,null,t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}})):t("div",{class:"agree"},t("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:()=>this.handleClickAgree()})),!this.finishLater&&t("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:this.isDone||this.finishLater?I:S,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",this.agreed?{style:{display:"none"}}:{class:"cover"}),t("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(this.envelope.documents||[]).map((e=>{const i=g(1,e.page_numbers);return t(n,null,i.map((i=>t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=!1}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=!1,this.isDone=!0}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null))):t(s,null,t("verdocs-loader",null))}};N.style='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff}verdocs-sign .intro .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}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)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;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 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;white-space:nowrap;text-overflow:ellipsis}';export{N as verdocs_sign}
|
1
|
+
import{r as e,c as i,h as t,H as s,F as n}from"./p-e035df4b.js";import{b as o,t as a,u as l,c as r,d}from"./p-b3ec6306.js";import{R as c}from"./p-05788c2b.js";import{V as h}from"./p-c2c49441.js";import{a as u,i as p}from"./p-e662f81b.js";import{f as v,i as g}from"./p-7291906c.js";import{s as f,u as x,a as m,r as b,b as w}from"./p-1abcf29d.js";import{S as y}from"./p-7a1b2643.js";import"./p-eab67c09.js";import"./p-aa124212.js";import"./p-ab01f71e.js";var k=function(e,i,t,s){return n=void 0,o=void 0,l=function(){return function(e,i){var t,s,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function l(l){return function(r){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(t=1,s&&(n=2&l[0]?s.return:l[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,l[1])).done)return n;switch(s=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,s=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){a.label=l[1];break}if(6===l[0]&&a.label<n[1]){a.label=n[1],n=l;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(l);break}n[2]&&a.ops.pop(),a.trys.pop();continue}l=i.call(e,a)}catch(e){l=[6,e],s=0}finally{t=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,r])}}}(this,(function(){return[2,e.api.put("/envelopes/".concat(i,"/recipients/").concat(t),s).then((function(e){return e.data}))]}))},new((a=void 0)||(a=Promise))((function(e,i){function t(e){try{r(l.next(e))}catch(e){i(e)}}function s(e){try{r(l.throw(e))}catch(e){i(e)}}function r(i){var n;i.done?e(i.value):(n=i.value,n instanceof a?n:new a((function(e){e(n)}))).then(t,s)}r((l=l.apply(n,o||[])).next())}));var n,o,a,l};const S=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}],I=[{id:"print",label:"Print"},{id:"download",label:"Download"}],N=class{constructor(t){e(this,t),this.sdkError=i(this,"sdkError",7),this.envelopeLoaded=i(this,"envelopeLoaded",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.endpoint=null,this.recipientIndex=-1,this.envelopeId=null,this.roleId=null,this.inviteCode=null,this.headerTargetId=null,this.envelope=null,this.roleNames=[],this.recipient=null,this.signerToken=null,this.hasSignature=!1,this.nextButtonLabel="Start",this.nextSubmits=!1,this.errorMessage="",this.focusedField="",this.submitting=!1,this.isDone=!1,this.showDone=!1,this.finishLater=!1,this.showFinishLater=!1,this.agreed=!1,this.documentsSingularPlural="document"}componentWillLoad(){this.endpoint=new h({sessionType:"signing"})}async componentWillRender(){var e,i,t,s,n,l,r;if(this.envelopeId)if(this.roleId)if(this.inviteCode)try{console.log(`[SIGN] Processing invite code for ${this.envelopeId} / ${this.roleId}`);const{session:e,recipient:i,signerToken:t}=await o(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode});console.log(`[SIGN] Loaded signing session ${e.email} / ${e.profile_id}`),this.recipient=i,console.log("[SIGN] We are recipient",this.recipient),this.signerToken=t,this.endpoint.setToken(t),this.agreed&&(this.nextButtonLabel="Next"),this.envelope=await a(this.endpoint,this.envelopeId),this.roleNames=this.envelope.recipients.map((e=>e.role_name)),this.envelope.documents.length>0&&(this.documentsSingularPlural="document(s)"),this.recipientIndex=this.envelope.recipients.findIndex((e=>e.role_name==this.roleId)),this.recipientIndex>-1?(this.recipient=this.envelope.recipients[this.recipientIndex],this.agreed=this.recipient.agreed,console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)):console.log("[SIGN] Could not find our recipient record",this.roleId,this.envelope.recipients),this.isDone=["submitted","canceled","declined"].includes(this.recipient.status),this.checkRecipientFields(),null===(s=this.envelopeLoaded)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope})}catch(e){console.log("Error with signing session",e),null===(n=this.sdkError)||void 0===n||n.emit(new y(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(r=e.response)||void 0===r?void 0:r.data))}else null===(t=this.sdkError)||void 0===t||t.emit(new y("[SIGN] Missing required inviteCode",500,""));else null===(i=this.sdkError)||void 0===i||i.emit(new y("[SIGN] Missing required roleId",500,""));else null===(e=this.sdkError)||void 0===e||e.emit(new y("[SIGN] Missing required envelopId",500,""))}componentDidRender(){const e=this.headerTargetId?document.getElementById(this.headerTargetId):null,i=document.getElementById("verdocs-sign-header");e&&i&&(console.log("[SIGN] Moving header"),i.remove(),e.append(i))}handleClickAgree(){var e,i,t;this.submitting=!0,(e=this.endpoint,i=this.envelopeId,t=this.roleId,!0,k(e,i,t,{action:"update",agreed:true})).then((()=>{var e;this.nextButtonLabel="Next",this.recipient.agreed=!0,this.submitting=!1,this.agreed=!0,null===(e=this.envelopeUpdated)||void 0===e||e.emit({endpoint:this.endpoint,envelope:this.envelope,event:"agreed"})})).catch((e=>{var i,t,s;console.log("Update failure",e),this.submitting=!1,null===(i=this.sdkError)||void 0===i||i.emit(new y(e.message,null===(t=e.response)||void 0===t?void 0:t.status,null===(s=e.response)||void 0===s?void 0:s.data))}))}async handleOptionSelected(e){var i,t,s,n,o,a,l,r;switch(e.detail.id){case"later":this.finishLater=!0,this.showFinishLater=!0,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"later"});break;case"claim":window.alert("This feature will be available in an upcoming release."),null===(t=this.envelopeUpdated)||void 0===t||t.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});break;case"decline":{this.submitting=!0;const e=await(a=this.endpoint,l=this.envelopeId,r=this.roleId,k(a,l,r,{action:"decline"}));console.log("Decline result",e),null===(s=this.envelopeUpdated)||void 0===s||s.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"}),this.submitting=!1,this.isDone=!0}break;case"print":window.print(),null===(n=this.envelopeUpdated)||void 0===n||n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});break;case"download":f(this.endpoint,this.envelope,this.envelope.envelope_document_id).catch((e=>{console.log("Error downloading PDF",e)})),null===(o=this.envelopeUpdated)||void 0===o||o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"})}}updateRecipientFieldValue(e,i){console.log("[SIGN] updateRecipientFieldValue",e),this.recipient.fields.forEach((t=>{t.name===e&&(t.settings=i.settings,x(t),this.checkRecipientFields())}))}saveFieldChange(e,i){console.log("[SIGN] updateRecipientFieldValue",e),l(this.endpoint,this.envelopeId,e,i).then((i=>this.updateRecipientFieldValue(e,i))).catch((e=>{var i,t,s,n,o,a;401===(null===(i=e.response)||void 0===i?void 0:i.status)&&"jwt expired"===(null===(s=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===s?void 0:s.error)?(console.log("[SIGN] Signing session expired"),this.errorMessage="Signing session expired. Please reload your browser to continue."):console.log("[SIGN] Server error",e),null===(n=this.sdkError)||void 0===n||n.emit(new y(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(a=e.response)||void 0===a?void 0:a.data))}))}async handleFieldChange(e,i){const{value:t,checked:s}=i.target;switch(e.type){case"textbox":return this.saveFieldChange(e.name,{prepared:!1,value:t});case"checkbox_group":{const t=e.settings.options.map((e=>({id:e.id,checked:i.target.checked})));return this.saveFieldChange(e.name,{prepared:!1,value:{options:t}})}case"radio_button_group":{const t=e.settings.options.map((e=>({id:e.id,selected:i.target.value===e.id})));return this.saveFieldChange(e.name,{prepared:!1,value:{options:t}})}case"dropdown":return this.saveFieldChange(e.name,{prepared:!1,value:i.detail});case"initial":const l=await(await fetch(i.detail)).blob();return(n=this.endpoint,"initial",o=l,a=new FormData,a.append("initial",o,"initial"),n.api.post("/initials",a).then((function(e){return e.data}))).then((async i=>{const t=await d(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"signature":const c=await(await fetch(i.detail)).blob();return function(e,i,t){var s=new FormData;return s.append("signature",t,"signature"),e.api.post("/signatures",s).then((function(e){return e.data}))}(this.endpoint,0,c).then((async i=>{const t=await r(this.endpoint,this.envelopeId,e.name,i.id);this.updateRecipientFieldValue(e.name,t)}));case"date":const h=i.target.getAttribute("iso");return this.saveFieldChange(e.name,{prepared:!1,value:h});case"timestamp":console.log("Updating timestamp",{value:t,ts:i.target.getAttribute("timestamp")});break;default:console.log("Unhandled field update",{value:t,checked:s},e)}var n,o,a}isFieldValid(e){var i,t,s,n,o,a,l;const{required:r=!1}=e,{result:d="",value:c="",base64:h=""}=e.settings||{};switch(e.type){case"textbox":switch((null===(i=e.settings)||void 0===i?void 0:i.validator)||""){case"email":return p(d);case"phone":return u(d);default:return!r||""!==d}case"signature":case"initial":return!r||""!==h;case"timestamp":return!0;case"textarea":case"date":case"attachment":return!r||""!==d;case"dropdown":return!r||""!==c;case"checkbox_group":const v=((null===(s=null===(t=e.settings)||void 0===t?void 0:t.options)||void 0===s?void 0:s.filter((e=>e.checked)))||[]).length;return!r||v>=((null===(n=e.settings)||void 0===n?void 0:n.minimum_checked)||0)&&v<=((null===(o=e.settings)||void 0===o?void 0:o.maximum_checked)||999);case"radio_button_group":return!r||((null===(l=null===(a=e.settings)||void 0===a?void 0:a.options)||void 0===l?void 0:l.filter((e=>e.selected)))||[]).length>0;default:return!1}}async handleNext(){var e,i,t,s;if(this.nextSubmits){try{this.submitting=!0;const e=await(i=this.endpoint,t=this.envelopeId,s=this.roleId,k(i,t,s,{action:"submit"}));console.log("[SIGN] Submitted successfully",e),this.recipient.status="submitted",this.showDone=!0,this.isDone=!0}catch(e){console.log("[SIGN] Error submitting",e)}return void(this.submitting=!1)}const n=this.recipient.fields.filter((e=>e.required));let o=n.findIndex((e=>e.name===this.focusedField))+1;o>=n.length&&(o=0);let a=n[o],l=0;if(l<n.length&&["signature","initial"].includes(a.type)&&"signed"===(null===(e=a.settings)||void 0===e?void 0:e.result)&&(l++,o++,o>=n.length&&(o=0),a=n[o]),l>=n.length&&(a=null),a){const e=w(a),i=document.getElementById(e);null==i||i.focusField(),this.focusedField=a.name}}checkRecipientFields(){const e=this.recipient.fields.filter((e=>!this.isFieldValid(e)));e.length<1?(this.nextButtonLabel="Finish",this.nextSubmits=!0):(console.log("[SIGN] Remaining invalid fields",e),this.nextButtonLabel="Next",this.nextSubmits=!1)}attachFieldAttributes(e,i,t,s){var n;s.addEventListener("input",(e=>{console.log("[SIGN] onfieldInput",e.detail,e.target.value),e.target.name.includes("checkbox_group")||e.target.name.includes("radio_button_group")?(console.log("CB",e.target),this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields()))):this.checkRecipientFields()})),s.addEventListener("focusout",(e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())))),s.addEventListener("fieldChange",(e=>this.handleFieldChange(i,e).finally((()=>this.checkRecipientFields())))),s.setAttribute("roleindex",t),s.setAttribute("xScale",e.xScale),s.setAttribute("yScale",e.yScale),s.setAttribute("initials",this.recipient?v(this.recipient.full_name):""),s.setAttribute("name",(null===(n=this.recipient)||void 0===n?void 0:n.full_name)||"")}handlePageRendered(e){const i=e.detail,t=m(this.roleNames,this.recipient.role_name),s=this.recipient.fields.filter((e=>e.page===i.pageNumber));console.log("[SIGN] Page rendered, updating fields",{pageInfo:i,roleIndex:t,recipientFields:s}),s.forEach((e=>{const s=b(e,i,t,{disabled:!1,editable:!1,draggable:!1,done:this.isDone});s&&(Array.isArray(s)?s.map((s=>this.attachFieldAttributes(i,e,t,s))):this.attachFieldAttributes(i,e,t,s))})),this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name&&(e.status===c.SUBMITTED||e.status===c.CANCELED||e.status===c.DECLINED))).forEach((e=>{e.fields.forEach((e=>{const s=b(e,i,t,{disabled:!0,editable:!1,draggable:!1,done:this.isDone});s&&(Array.isArray(s)?s.map((s=>this.attachFieldAttributes(i,e,t,s))):this.attachFieldAttributes(i,e,t,s))}))})),this.envelope.recipients.filter((e=>e.role_name!==this.recipient.role_name)).forEach((e=>{const t=m(this.roleNames,e.role_name);e.fields.filter((e=>e.page===i.pageNumber)).forEach((e=>{const s=b(e,i,t,{disabled:!0,editable:!1,draggable:!1,done:this.isDone});s&&s.setAttribute&&(s.setAttribute("roleindex",t),s.setAttribute("xScale",i.xScale),s.setAttribute("yScale",i.yScale))}))})),this.checkRecipientFields()}render(){return this.envelope?this.isDone?t(s,{class:{agreed:this.agreed}},t("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:e=>{var i;return null===(i=this.sdkError)||void 0===i?void 0:i.emit(e.detail)}}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=!1,this.isDone=!0}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null))):t(s,{class:{agreed:this.agreed}},!this.finishLater&&t("div",{class:"intro"},t("div",{class:"inner"},"Please review and act on these documents.")),t("div",{id:"verdocs-sign-header"},t("div",{class:"inner"},this.agreed?t(n,null,t("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),t("div",{class:"title"},this.envelope.name),t("div",{style:{flex:"1"}})):t("div",{class:"agree"},t("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:()=>this.handleClickAgree()})),!this.finishLater&&t("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:()=>this.handleNext()}),t("div",{style:{marginLeft:"10px"}}),t("verdocs-dropdown",{options:this.isDone||this.finishLater?I:S,onOptionSelected:e=>this.handleOptionSelected(e)}))),t("div",this.agreed?{style:{display:"none"}}:{class:"cover"}),t("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(this.envelope.documents||[]).map((e=>{const i=g(1,e.page_numbers);return t(n,null,i.map((i=>t("verdocs-envelope-document-page",{envelopeId:this.envelopeId,documentId:e.id,endpoint:this.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:i,onPageRendered:e=>this.handlePageRendered(e),type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))))}))),this.showFinishLater&&t("verdocs-ok-dialog",{heading:"You've saved your document to finish later.",message:`To complete the ${this.documentsSingularPlural}, use the link in the original email notification inviting you to review and finish the document.`,onNext:()=>this.showFinishLater=!1}),this.errorMessage&&t("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:()=>this.errorMessage=""}),this.showDone&&t("verdocs-ok-dialog",{heading:"You're Done!",message:`You can access the ${this.documentsSingularPlural} at any time by clicking on the link from the invitation email.<br /><br />After all recipients have completed their actions, you will receive an email with the document and envelope certificate attached.`,onNext:()=>{this.showDone=!1,this.isDone=!0}}),this.submitting&&t("div",{class:"loading-indicator"},t("verdocs-loader",null))):t(s,null,t("verdocs-loader",null))}};N.style='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff}verdocs-sign .intro .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}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)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;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 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;white-space:nowrap;text-overflow:ellipsis}';export{N as verdocs_sign}
|
@@ -1 +1 @@
|
|
1
|
-
import{r as t,c as e,h as o,H as i}from"./p-e035df4b.js";import{g as s}from"./p-6de76553.js";import{g as d}from"./p-1abcf29d.js";import"./p-eab67c09.js";import"./p-b3ec6306.js";import"./p-05788c2b.js";import"./p-aa124212.js";import"./p-ab01f71e.js";const r=class{constructor(o){t(this,o),this.settingsChanged=e(this,"settingsChanged",7),this.deleted=e(this,"deleted",7),this.templateid="",this.field=null,this.option=0,this.disabled=!1,this.done=!1,this.roleindex=0,this.editable=!1,this.moveable=!1,this.rerender=0}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.hidePanel&&t.hidePanel()}render(){var t,e;const r=d(this.field),a=null!==(e=null!==(t=this.disabled)&&void 0!==t?t:r.disabled)&&void 0!==e&&e,n=this.field.rgba||s(this.roleindex),l=this.field.required,p=r.options[this.option],c=`${this.field.name}-${p.id}`;return this.done?o(i,{class:{done:this.done},style:{maxWidth:"10px"}},o("span",{innerHTML:p.selected?'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg>':'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg>'})):o(i,{class:{required:l,disabled:a},style:{backgroundColor:n}},o("input",{id:c,type:"radio",value:p.id,tabIndex:r.order,
|
1
|
+
import{r as t,c as e,h as o,H as i}from"./p-e035df4b.js";import{g as s}from"./p-6de76553.js";import{g as d}from"./p-1abcf29d.js";import"./p-eab67c09.js";import"./p-b3ec6306.js";import"./p-05788c2b.js";import"./p-aa124212.js";import"./p-ab01f71e.js";const r=class{constructor(o){t(this,o),this.settingsChanged=e(this,"settingsChanged",7),this.deleted=e(this,"deleted",7),this.templateid="",this.field=null,this.option=0,this.disabled=!1,this.done=!1,this.roleindex=0,this.editable=!1,this.moveable=!1,this.rerender=0}async showSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.showPanel&&t.showPanel()}async hideSettingsPanel(){const t=document.getElementById(`verdocs-settings-panel-${this.field.name}`);t&&t.hidePanel&&t.hidePanel()}render(){var t,e;const r=d(this.field),a=null!==(e=null!==(t=this.disabled)&&void 0!==t?t:r.disabled)&&void 0!==e&&e,n=this.field.rgba||s(this.roleindex),l=this.field.required,p=r.options[this.option],c=`${this.field.name}-${p.id}`;return this.done?o(i,{class:{done:this.done},style:{maxWidth:"10px"}},o("span",{innerHTML:p.selected?'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg>':'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"></path></svg>'})):o(i,{class:{required:l,disabled:a},style:{backgroundColor:n}},o("input",{id:c,type:"radio",name:this.field.name,value:p.id,tabIndex:r.order,checked:!!p.selected,disabled:a,required:r.required}),o("label",{htmlFor:c}),this.editable&&o("verdocs-button-panel",{icon:'<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>',id:`verdocs-settings-panel-${this.field.name}`},o("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:()=>this.hideSettingsPanel(),onDelete:()=>{var t;return null===(t=this.deleted)||void 0===t||t.emit({fieldName:this.field.name}),this.hideSettingsPanel()},onSettingsChanged:t=>{var e;return null===(e=this.settingsChanged)||void 0===e||e.emit(t.detail),this.hideSettingsPanel()}})))}};r.style='verdocs-field-radio-button{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:12px;height:12px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-field-radio-button svg{margin-top:4px}verdocs-field-radio-button.disabled{opacity:0.5}verdocs-field-radio-button.disabled.done{opacity:1}verdocs-field-radio-button.done input[type=radio]{margin:0;padding:0;width:10px;height:10px}verdocs-field-radio-button:not(.done) input[type=radio]{position:absolute;opacity:0}verdocs-field-radio-button:not(.done) input[type=radio]+label:before{content:"";border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:10px;height:10px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-field-radio-button:not(.done) input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-field-radio-button:not(.done) input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-field-radio-button:not(.done) input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#a0a0d0;background:#a0a0d0}verdocs-field-radio-button:not(.done) input[type=radio]+label:empty:before{margin-right:0}verdocs-field-radio-button.required{border:1px solid #cc0000}verdocs-field-radio-button.hide{display:none}verdocs-field-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-radio-button verdocs-button-panel{margin-left:-20px;margin-top:-7px;-webkit-transform:scale(0.7);transform:scale(0.7)}';export{r as verdocs_field_radio_button}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as e,c as t,h as i,H as s}from"./p-e035df4b.js";import{g as o}from"./p-6de76553.js";import{g as l}from"./p-1abcf29d.js";import"./p-eab67c09.js";import"./p-b3ec6306.js";import"./p-05788c2b.js";import"./p-aa124212.js";import"./p-ab01f71e.js";const c=class{constructor(i){e(this,i),this.settingsChanged=t(this,"settingsChanged",7),this.deleted=t(this,"deleted",7),this.templateid="",this.field=null,this.option=0,this.disabled=!1,this.done=!1,this.roleindex=0,this.editable=!1,this.moveable=!1,this.rerender=0}async showSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.field.name}`);e&&e.showPanel&&e.showPanel()}async hideSettingsPanel(){const e=document.getElementById(`verdocs-settings-panel-${this.field.name}`);e&&e.hidePanel&&e.hidePanel()}render(){var e,t,c,r;const d=l(this.field),n=null!==(t=null===(e=d.options)||void 0===e?void 0:e[this.option])&&void 0!==t?t:{checked:!1},h=null!==(r=null!==(c=this.disabled)&&void 0!==c?c:d.disabled)&&void 0!==r&&r,a=this.field.rgba||o(this.roleindex);return this.done?i(s,{class:{done:this.done}},n.checked?"✓":"☐"):i(s,{class:{required:d.required,disabled:h},style:{backgroundColor:a}},i("label",null,i("input",{name:this.field.name,type:"checkbox",tabIndex:d.order,checked:n.checked,disabled:h,required:d.required,value:n.id}),i("span",null),this.editable&&i("verdocs-button-panel",{icon:'<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20"><path d="m7.5 18.5-.312-2.667q-.188-.125-.396-.25-.209-.125-.396-.229l-2.479 1.063-2.521-4.334 2.125-1.625q.021-.104.021-.229v-.458q0-.125-.021-.229L1.396 7.917l2.521-4.313 2.5 1.042q.166-.104.375-.229.208-.125.396-.229L7.5 1.5h5l.312 2.688q.188.104.396.229.209.125.396.229l2.479-1.042 2.521 4.313-2.125 1.625v.916l2.125 1.625-2.521 4.334-2.5-1.063q-.166.104-.375.229-.208.125-.396.25L12.5 18.5Zm2.479-5.521q1.229 0 2.104-.875T12.958 10q0-1.229-.875-2.104t-2.104-.875q-1.208 0-2.094.875Q7 8.771 7 10t.885 2.104q.886.875 2.094.875Zm0-1.75q-.5 0-.864-.364Q8.75 10.5 8.75 10t.365-.865q.364-.364.864-.364t.865.364q.364.365.364.865t-.364.865q-.365.364-.865.364ZM10.021 10Zm-.792 6.521h1.542l.25-2.146q.625-.167 1.198-.51.573-.344 1.031-.823l2.021.854.771-1.271-1.771-1.354q.104-.292.156-.615.052-.323.052-.656 0-.292-.052-.604-.052-.313-.135-.646l1.77-1.375-.77-1.271-2.021.875q-.479-.5-1.042-.833-.562-.334-1.187-.5l-.271-2.167H9.208l-.25 2.167q-.625.166-1.187.5-.563.333-1.042.812l-2-.854-.771 1.271 1.73 1.354q-.084.333-.136.656Q5.5 9.708 5.5 10t.052.604q.052.313.136.667l-1.73 1.354.771 1.271 2-.834q.479.459 1.042.792.562.334 1.187.5Z"/></svg>',id:`verdocs-settings-panel-${this.field.name}`},i("verdocs-template-field-properties",{templateId:this.templateid,fieldName:this.field.name,onClose:()=>this.hideSettingsPanel(),onDelete:()=>{var e;return null===(e=this.deleted)||void 0===e||e.emit({fieldName:this.field.name}),this.hideSettingsPanel()},onSettingsChanged:e=>{var t;return null===(t=this.settingsChanged)||void 0===t||t.emit(e.detail),this.hideSettingsPanel()}}))))}};c.style='@charset "UTF-8";verdocs-field-checkbox{line-height:18px;-webkit-transform-origin:bottom left;transform-origin:bottom left;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-field-checkbox.disabled{opacity:0.5}verdocs-field-checkbox label>input[type=checkbox]{display:none}verdocs-field-checkbox label>input[type=checkbox]+*::before{content:"";width:1rem;height:1rem;-ms-flex-negative:0;flex-shrink:0;line-height:18px;border-radius:2px;border-style:solid;margin-right:0.5rem;border-width:0.1rem;display:inline-block;vertical-align:bottom;border-color:#aeb4bf}verdocs-field-checkbox label>input[type=checkbox]:checked+*{color:#55bc81}verdocs-field-checkbox label>input[type=checkbox]:checked+*::before{content:"✓";color:white;text-align:center;background:#55bc81;border-color:#55bc81}verdocs-field-checkbox.required{border:1px solid #cc0000}verdocs-field-checkbox.hide{display:none}verdocs-field-checkbox.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}verdocs-field-checkbox verdocs-button-panel{margin-left:-20px;margin-top:-4px;-webkit-transform:scale(0.7);transform:scale(0.7)}';export{c as verdocs_field_checkbox}
|
@@ -0,0 +1 @@
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(o=s[0]&2?r["return"]:s[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;if(r=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){n.label=s[1];break}if(s[0]===6&&n.label<o[1]){n.label=o[1];o=s;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(s);break}if(o[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-871407e9.system.js","./p-d1c37175.system.js","./p-54498887.system.js","./p-c44fd897.system.js","./p-7efdefa3.system.js","./p-d50523fd.system.js","./p-201f27f6.system.js","./p-187b20b7.system.js","./p-bbee73c8.system.js","./p-327858f0.system.js","./p-51a3ea62.system.js"],(function(e){"use strict";var t,n,i,r,o,s,a,l,d,c,u,h,p,f,v,g,m,b,x,w,y,I;return{setters:[function(e){t=e.r;n=e.c;i=e.h;r=e.H;o=e.F},function(e){s=e.b;a=e.t;l=e.u;d=e.c;c=e.d},function(e){u=e.R},function(e){h=e.V},function(e){p=e.a;f=e.i},function(e){v=e.f;g=e.i},function(e){m=e.s;b=e.u;x=e.a;w=e.r;y=e.b},function(e){I=e.S},function(){},function(){},function(){}],execute:function(){var k=undefined&&undefined.__awaiter||function(e,t,n,i){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var S=undefined&&undefined.__generator||function(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(a){if(i)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(n=0)),n)try{if(i=1,r&&(o=a[0]&2?r["return"]:a[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;if(r=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:n.label++;return{value:a[1],done:false};case 5:n.label++;r=a[1];a=[0];continue;case 7:a=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){n=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){n.label=a[1];break}if(a[0]===6&&n.label<o[1]){n.label=o[1];o=a;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(a);break}if(o[2])n.ops.pop();n.trys.pop();continue}a=t.call(e,n)}catch(e){a=[6,e];r=0}finally{i=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var F=function(e,t,n,i){return k(void 0,void 0,void 0,(function(){return S(this,(function(r){return[2,e.api.put("/envelopes/".concat(t,"/recipients/").concat(n),i).then((function(e){return e.data}))]}))}))};var N=function(e,t,n){return F(e,t,n,{action:"submit"})};var _=function(e,t,n){return F(e,t,n,{action:"decline"})};var E=function(e,t,n,i){return F(e,t,n,{action:"update",agreed:i})};var D=function(e,t,n){var i=new FormData;i.append("signature",n,t);return e.api.post("/signatures",i).then((function(e){return e.data}))};var L=function(e,t,n){var i=new FormData;i.append("initial",n,t);return e.api.post("/initials",i).then((function(e){return e.data}))};var A='verdocs-sign{display:-ms-flexbox;display:flex;overflow:hidden;position:relative;min-height:600px;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-sign div{display:block;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-sign input{vertical-align:top}verdocs-sign .intro{width:100%;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;color:#111111;font-size:18px;font-weight:500;line-height:28px;-ms-flex-direction:row;flex-direction:row;background:#ffffff}verdocs-sign .intro .inner{width:100%;display:-ms-flexbox;display:flex;margin:0 auto;padding:0 20px;max-width:1200px;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-sign .cover{top:0;left:0;right:0;bottom:0;z-index:999;position:absolute;background:rgba(0, 0, 0, 0.5)}verdocs-sign>.document{-ms-flex:1;flex:1;width:100%;height:100%;-ms-flex-item-align:center;align-self:center;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;max-width:1200px;min-height:200px;position:relative;overflow-y:scroll;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-sign>.document .inner{width:100%;max-width:1028px}verdocs-sign .agree{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0 15px}verdocs-sign .agree .intro{display:none}verdocs-sign .agree .header{-ms-flex:0 0 56px;flex:0 0 56px}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)}@media print{verdocs-sign .header{display:none}}#verdocs-sign-header{color:#fff;width:100%;display:-ms-flexbox;display:flex;z-index:1000;-ms-flex:0 0 56px;flex:0 0 56px;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 20px;max-width:1200px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}#verdocs-sign-header .logo{width:80px;display:none;margin:-6px 0 0 0}#verdocs-sign-header .title{font-size:18px;font-weight:500;white-space:nowrap;text-overflow:ellipsis}';var C=[{id:"later",label:"Finish Later"},{id:"decline",label:"Decline to Sign"},{id:"print",label:"Print Without Signing"},{id:"download",label:"Download"}];var R=[{id:"print",label:"Print"},{id:"download",label:"Download"}];var G=e("verdocs_sign",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.envelopeLoaded=n(this,"envelopeLoaded",7);this.envelopeUpdated=n(this,"envelopeUpdated",7);this.endpoint=null;this.recipientIndex=-1;this.envelopeId=null;this.roleId=null;this.inviteCode=null;this.headerTargetId=null;this.envelope=null;this.roleNames=[];this.recipient=null;this.signerToken=null;this.hasSignature=false;this.nextButtonLabel="Start";this.nextSubmits=false;this.errorMessage="";this.focusedField="";this.submitting=false;this.isDone=false;this.showDone=false;this.finishLater=false;this.showFinishLater=false;this.agreed=false;this.documentsSingularPlural="document"}e.prototype.componentWillLoad=function(){this.endpoint=new h({sessionType:"signing"})};e.prototype.componentWillRender=function(){return k(this,void 0,void 0,(function(){var e,t,n,i,r,o,l,d,c,u,h,p,f;var v=this;return S(this,(function(g){switch(g.label){case 0:if(!this.envelopeId){(e=this.sdkError)===null||e===void 0?void 0:e.emit(new I("[SIGN] Missing required envelopId",500,""));return[2]}if(!this.roleId){(t=this.sdkError)===null||t===void 0?void 0:t.emit(new I("[SIGN] Missing required roleId",500,""));return[2]}if(!this.inviteCode){(n=this.sdkError)===null||n===void 0?void 0:n.emit(new I("[SIGN] Missing required inviteCode",500,""));return[2]}g.label=1;case 1:g.trys.push([1,4,,5]);console.log("[SIGN] Processing invite code for ".concat(this.envelopeId," / ").concat(this.roleId));return[4,s(this.endpoint,{envelopeId:this.envelopeId,roleId:this.roleId,inviteCode:this.inviteCode})];case 2:d=g.sent(),c=d.session,u=d.recipient,h=d.signerToken;console.log("[SIGN] Loaded signing session ".concat(c.email," / ").concat(c.profile_id));this.recipient=u;console.log("[SIGN] We are recipient",this.recipient);this.signerToken=h;this.endpoint.setToken(h);if(this.agreed){this.nextButtonLabel="Next"}p=this;return[4,a(this.endpoint,this.envelopeId)];case 3:p.envelope=g.sent();this.roleNames=this.envelope.recipients.map((function(e){return e.role_name}));if(this.envelope.documents.length>0){this.documentsSingularPlural="document(s)"}this.recipientIndex=this.envelope.recipients.findIndex((function(e){return e.role_name==v.roleId}));if(this.recipientIndex>-1){this.recipient=this.envelope.recipients[this.recipientIndex];this.agreed=this.recipient.agreed;console.log("[SIGN] Found our recipient in the envelope",this.recipientIndex,this.recipient)}else{console.log("[SIGN] Could not find our recipient record",this.roleId,this.envelope.recipients)}this.isDone=["submitted","canceled","declined"].includes(this.recipient.status);this.checkRecipientFields();(i=this.envelopeLoaded)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope});return[3,5];case 4:f=g.sent();console.log("Error with signing session",f);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new I(f.message,(o=f.response)===null||o===void 0?void 0:o.status,(l=f.response)===null||l===void 0?void 0:l.data));return[3,5];case 5: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)}};e.prototype.handleClickAgree=function(){var e=this;this.submitting=true;E(this.endpoint,this.envelopeId,this.roleId,true).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 n,i,r;console.log("Update failure",t);e.submitting=false;(n=e.sdkError)===null||n===void 0?void 0:n.emit(new I(t.message,(i=t.response)===null||i===void 0?void 0:i.status,(r=t.response)===null||r===void 0?void 0:r.data))}))};e.prototype.handleOptionSelected=function(e){return k(this,void 0,void 0,(function(){var t,n,i,r,o,s,a;return S(this,(function(l){switch(l.label){case 0:s=e.detail.id;switch(s){case"later":return[3,1];case"claim":return[3,2];case"decline":return[3,3];case"print":return[3,5];case"download":return[3,6]}return[3,7];case 1: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"});return[3,7];case 2:window.alert("This feature will be available in an upcoming release.");(n=this.envelopeUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,envelope:this.envelope,event:"claimed"});return[3,7];case 3:this.submitting=true;return[4,_(this.endpoint,this.envelopeId,this.roleId)];case 4:a=l.sent();console.log("Decline result",a);(i=this.envelopeUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,envelope:this.envelope,event:"declined"});this.submitting=false;this.isDone=true;return[3,7];case 5:window.print();(r=this.envelopeUpdated)===null||r===void 0?void 0:r.emit({endpoint:this.endpoint,envelope:this.envelope,event:"printed"});return[3,7];case 6:m(this.endpoint,this.envelope,this.envelope.envelope_document_id).catch((function(e){console.log("Error downloading PDF",e)}));(o=this.envelopeUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,envelope:this.envelope,event:"downloaded"});return[3,7];case 7:return[2]}}))}))};e.prototype.updateRecipientFieldValue=function(e,t){var n=this;console.log("[SIGN] updateRecipientFieldValue",e);this.recipient.fields.forEach((function(i){if(i.name===e){i.settings=t.settings;b(i);n.checkRecipientFields()}}))};e.prototype.saveFieldChange=function(e,t){var n=this;console.log("[SIGN] updateRecipientFieldValue",e);l(this.endpoint,this.envelopeId,e,t).then((function(t){return n.updateRecipientFieldValue(e,t)})).catch((function(e){var t,i,r,o,s,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.errorMessage="Signing session expired. Please reload your browser to continue."}else{console.log("[SIGN] Server error",e)}(o=n.sdkError)===null||o===void 0?void 0:o.emit(new I(e.message,(s=e.response)===null||s===void 0?void 0:s.status,(a=e.response)===null||a===void 0?void 0:a.data))}))};e.prototype.handleFieldChange=function(e,t){return k(this,void 0,void 0,(function(){var n,i,r,o,s,s,a,l,u;var h=this;return S(this,(function(p){switch(p.label){case 0:n=t.target,i=n.value,r=n.checked;o=e.type;switch(o){case"textbox":return[3,1];case"checkbox_group":return[3,2];case"radio_button_group":return[3,3];case"dropdown":return[3,4];case"initial":return[3,5];case"signature":return[3,8];case"date":return[3,11];case"timestamp":return[3,12]}return[3,13];case 1:return[2,this.saveFieldChange(e.name,{prepared:false,value:i})];case 2:{s=e.settings.options.map((function(e){return{id:e.id,checked:t.target.checked}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}p.label=3;case 3:{s=e.settings.options.map((function(e){return{id:e.id,selected:t.target.value===e.id}}));return[2,this.saveFieldChange(e.name,{prepared:false,value:{options:s}})]}p.label=4;case 4:return[2,this.saveFieldChange(e.name,{prepared:false,value:t.detail})];case 5:return[4,fetch(t.detail)];case 6:return[4,p.sent().blob()];case 7:a=p.sent();return[2,L(this.endpoint,"initial",a).then((function(t){return k(h,void 0,void 0,(function(){var n;return S(this,(function(i){switch(i.label){case 0:return[4,c(this.endpoint,this.envelopeId,e.name,t.id)];case 1:n=i.sent();this.updateRecipientFieldValue(e.name,n);return[2]}}))}))}))];case 8:return[4,fetch(t.detail)];case 9:return[4,p.sent().blob()];case 10:l=p.sent();return[2,D(this.endpoint,"signature",l).then((function(t){return k(h,void 0,void 0,(function(){var n;return S(this,(function(i){switch(i.label){case 0:return[4,d(this.endpoint,this.envelopeId,e.name,t.id)];case 1:n=i.sent();this.updateRecipientFieldValue(e.name,n);return[2]}}))}))}))];case 11:u=t.target.getAttribute("iso");return[2,this.saveFieldChange(e.name,{prepared:false,value:u})];case 12:console.log("Updating timestamp",{value:i,ts:t.target.getAttribute("timestamp")});return[3,14];case 13:console.log("Unhandled field update",{value:i,checked:r},e);return[3,14];case 14:return[2]}}))}))};e.prototype.isFieldValid=function(e){var t,n,i,r,o,s,a;var l=e.required,d=l===void 0?false:l;var c=e.settings||{},u=c.result,h=u===void 0?"":u,v=c.value,g=v===void 0?"":v,m=c.base64,b=m===void 0?"":m;switch(e.type){case"textbox":switch(((t=e.settings)===null||t===void 0?void 0:t.validator)||""){case"email":return f(h);case"phone":return p(h);default:return!d||h!==""}case"signature":case"initial":return!d||b!=="";case"timestamp":return true;case"textarea":case"date":case"attachment":return!d||h!=="";case"dropdown":return!d||g!=="";case"checkbox_group":var x=(((i=(n=e.settings)===null||n===void 0?void 0:n.options)===null||i===void 0?void 0:i.filter((function(e){return e.checked})))||[]).length;return!d||x>=(((r=e.settings)===null||r===void 0?void 0:r.minimum_checked)||0)&&x<=(((o=e.settings)===null||o===void 0?void 0:o.maximum_checked)||999);case"radio_button_group":return!d||(((a=(s=e.settings)===null||s===void 0?void 0:s.options)===null||a===void 0?void 0:a.filter((function(e){return e.selected})))||[]).length>0;default:return false}};e.prototype.handleNext=function(){return k(this,void 0,void 0,(function(){var e,t,n,i,r,o,s,a,l,d;var c=this;return S(this,(function(u){switch(u.label){case 0:if(!this.nextSubmits)return[3,5];u.label=1;case 1:u.trys.push([1,3,,4]);this.submitting=true;return[4,N(this.endpoint,this.envelopeId,this.roleId)];case 2:t=u.sent();console.log("[SIGN] Submitted successfully",t);this.recipient.status="submitted";this.showDone=true;this.isDone=true;return[3,4];case 3:n=u.sent();console.log("[SIGN] Error submitting",n);return[3,4];case 4:this.submitting=false;return[2];case 5:i=this.recipient.fields.filter((function(e){return e.required}));r=i.findIndex((function(e){return e.name===c.focusedField}));o=r+1;if(o>=i.length){o=0}s=i[o];a=0;if(a<i.length&&["signature","initial"].includes(s.type)&&((e=s.settings)===null||e===void 0?void 0:e.result)==="signed"){a++;o++;if(o>=i.length){o=0}s=i[o]}if(a>=i.length){s=null}if(s){l=y(s);d=document.getElementById(l);d===null||d===void 0?void 0:d.focusField();this.focusedField=s.name}return[2]}}))}))};e.prototype.checkRecipientFields=function(){var e=this;var t=this.recipient.fields.filter((function(t){return!e.isFieldValid(t)}));if(t.length<1){this.nextButtonLabel="Finish";this.nextSubmits=true}else{console.log("[SIGN] Remaining invalid fields",t);this.nextButtonLabel="Next";this.nextSubmits=false}};e.prototype.attachFieldAttributes=function(e,t,n,i){var r=this;var o;i.addEventListener("input",(function(e){console.log("[SIGN] onfieldInput",e.detail,e.target.value);if(e.target.name.includes("checkbox_group")||e.target.name.includes("radio_button_group")){console.log("CB",e.target);r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}else{r.checkRecipientFields()}}));i.addEventListener("focusout",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.addEventListener("fieldChange",(function(e){return r.handleFieldChange(t,e).finally((function(){return r.checkRecipientFields()}))}));i.setAttribute("roleindex",n);i.setAttribute("xScale",e.xScale);i.setAttribute("yScale",e.yScale);i.setAttribute("initials",this.recipient?v(this.recipient.full_name):"");i.setAttribute("name",((o=this.recipient)===null||o===void 0?void 0:o.full_name)||"")};e.prototype.handlePageRendered=function(e){var t=this;var n=e.detail;var i=x(this.roleNames,this.recipient.role_name);var r=this.recipient.fields.filter((function(e){return e.page===n.pageNumber}));console.log("[SIGN] Page rendered, updating fields",{pageInfo:n,roleIndex:i,recipientFields:r});r.forEach((function(e){var r=w(e,n,i,{disabled:false,editable:false,draggable:false,done:t.isDone});if(!r){return}if(Array.isArray(r)){r.map((function(r){return t.attachFieldAttributes(n,e,i,r)}))}else{t.attachFieldAttributes(n,e,i,r)}}));this.envelope.recipients.filter((function(e){return e.role_name!==t.recipient.role_name&&(e.status===u.SUBMITTED||e.status===u.CANCELED||e.status===u.DECLINED)})).forEach((function(e){e.fields.forEach((function(e){var r=w(e,n,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!r){return}if(Array.isArray(r)){r.map((function(r){return t.attachFieldAttributes(n,e,i,r)}))}else{t.attachFieldAttributes(n,e,i,r)}}))}));this.envelope.recipients.filter((function(e){return e.role_name!==t.recipient.role_name})).forEach((function(e){var i=x(t.roleNames,e.role_name);var r=e.fields.filter((function(e){return e.page===n.pageNumber}));r.forEach((function(e){var r=w(e,n,i,{disabled:true,editable:false,draggable:false,done:t.isDone});if(!r){return}if(r.setAttribute){r.setAttribute("roleindex",i);r.setAttribute("xScale",n.xScale);r.setAttribute("yScale",n.yScale)}}))}));this.checkRecipientFields()};e.prototype.render=function(){var e=this;if(!this.envelope){return i(r,null,i("verdocs-loader",null))}if(this.isDone){return i(r,{class:{agreed:this.agreed}},i("verdocs-view",{endpoint:this.endpoint,envelopeId:this.envelopeId,onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)}}),this.errorMessage&&i("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&i("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.showDone=false;e.isDone=true}}),this.submitting&&i("div",{class:"loading-indicator"},i("verdocs-loader",null)))}return i(r,{class:{agreed:this.agreed}},!this.finishLater&&i("div",{class:"intro"},i("div",{class:"inner"},"Please review and act on these documents.")),i("div",{id:"verdocs-sign-header"},i("div",{class:"inner"},!this.agreed?i("div",{class:"agree"},i("verdocs-checkbox",{name:"agree",label:"I agree to use electronic records and signatures.",onInput:function(){return e.handleClickAgree()}})):i(o,null,i("img",{src:"https://verdocs.com/assets/white-logo.svg",alt:"Verdocs Logo",class:"logo"}),i("div",{class:"title"},this.envelope.name),i("div",{style:{flex:"1"}})),!this.finishLater&&i("verdocs-button",{size:"small",label:this.nextButtonLabel,disabled:!this.agreed,onClick:function(){return e.handleNext()}}),i("div",{style:{marginLeft:"10px"}}),i("verdocs-dropdown",{options:!this.isDone&&!this.finishLater?C:R,onOptionSelected:function(t){return e.handleOptionSelected(t)}}))),!this.agreed?i("div",{class:"cover"}):i("div",{style:{display:"none"}}),i("div",{class:"document",style:{paddingTop:this.headerTargetId?"70px":"15px"}},(this.envelope.documents||[]).map((function(t){var n=g(1,t.page_numbers);return i(o,null,n.map((function(n){return i("verdocs-envelope-document-page",{envelopeId:e.envelopeId,documentId:t.id,endpoint:e.endpoint,virtualWidth:612,virtualHeight:792,pageNumber:n,onPageRendered:function(t){return e.handlePageRendered(t)},type:"filled",layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))}))),this.showFinishLater&&i("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(){return e.showFinishLater=false}}),this.errorMessage&&i("verdocs-ok-dialog",{heading:"Network Error",message:this.errorMessage,onNext:function(){return e.errorMessage=""}}),this.showDone&&i("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.showDone=false;e.isDone=true}}),this.submitting&&i("div",{class:"loading-indicator"},i("verdocs-loader",null)))};return e}());G.style=A}}}));
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as e,c as t,h as o,H as i,F as s,a as l}from"./p-e035df4b.js";import"./p-05788c2b.js";import{c as a,g as r}from"./p-b86b362a.js";import{c as d}from"./p-4cd5eb1f.js";import{V as n,T as p}from"./p-c2c49441.js";import{S as c}from"./p-7a1b2643.js";import{i as h}from"./p-0d28cf05.js";import{u as v,c as m}from"./p-feb442b1.js";import{a as g,r as f,c as u,d as x,e as w}from"./p-1abcf29d.js";import{g as b,a as q}from"./p-c25d965d.js";import{u as y,c as C}from"./p-8027431e.js";import{g as k}from"./p-6de76553.js";import"./p-eab67c09.js";import"./p-b3ec6306.js";import"./p-aa124212.js";import"./p-ab01f71e.js";const Z=class{constructor(o){e(this,o),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.endpoint=n.getDefault(),this.file=void 0,this.creating=!1,this.progressLabel="Uploading...",this.progressPercent=0}componentWillLoad(){this.endpoint.setTimeout(3e4),this.endpoint.loadSession()}handleFileChanged(e){var t;this.file=(null===(t=e.target.files)||void 0===t?void 0:t[0])||null,console.log("[CREATE] Selected file",this.file)}handleUpload(e){e.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(e){e.stopPropagation(),this.exit.emit()}async handleSubmit(e){var t,o,i,s;if(e.stopPropagation(),console.log("Submitting"),this.file){this.creating=!0,this.progressLabel="Uploading...";try{const e=await a(this.endpoint,{name:this.file.name});console.log("[CREATE] Created template",e);const o=await d(this.endpoint,e.id,this.file,(e=>{e>=99?(this.progressLabel="Processing...",this.progressPercent=100):this.progressPercent=e}));console.log("[CREATE] Created document",o);const i=await r(this.endpoint,e.id);null===(t=this.next)||void 0===t||t.emit(i),this.creating=!1,this.progressLabel="",this.progressPercent=0}catch(e){console.log("[CREATE] Error creating template",e),null===(o=this.sdkError)||void 0===o||o.emit(new c(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data)),this.creating=!1}}}render(){return this.endpoint.session?o("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},o("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:"application/pdf",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):o("div",{class:"upload-box"},o("div",null,o("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>'})),o("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),o("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?" ":"Or, if you prefer..."),o("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),o("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating}))):o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};Z.style='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';const M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',E=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>'},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>'},{id:"sep1",tooltip:"",icon:M},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>'},{id:"radio_button_group",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>'},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>'},{id:"sep2",tooltip:"",icon:M},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>'},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>'}],z=class{constructor(o){e(this,o),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.store=null,this.cachedPageInfo={},this.endpoint=n.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,o,i,s,l,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[FIELDS] Unable to start builder session, must be authenticated");this.store=await b(this.endpoint,this.templateId,!0),console.log(`[FIELDS] Loading template ${this.templateId}`,this.endpoint.session),this.selectedRoleName=(null===(i=null===(o=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||void 0===o?void 0:o[0])||void 0===i?void 0:i.name)||"",console.log("Starting with role",this.selectedRoleName)}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new c(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(a=e.response)||void 0===a?void 0:a.data))}}componentDidRender(){h.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,o){console.log("[FIELDS] handleFieldChange",e,t,o),this.rerender++}attachFieldAttributes(e,t,o,i){i.addEventListener("input",(e=>this.handleFieldChange(t,e))),i.addEventListener("settingsChanged",(()=>{var s,l,a,r;this.selectedRoleName=t.role_name,console.log("settings changed",this.selectedRoleName,t),i.setAttribute("roleindex",g(q(this.store),t.role_name)),i.field=null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.fields.find((e=>e.name===t.name)),this.rerender++,i.setAttribute("rerender",this.rerender),null===(a=this.templateUpdated)||void 0===a||a.emit({endpoint:this.endpoint,template:null===(r=this.store)||void 0===r?void 0:r.state,event:"updated-field"}),console.log("Re-rendering field",t.name,e.pageNumber),this.reRenderField(t,e.pageNumber),f(t,e,o,{disabled:!0,editable:!0,draggable:!0})})),i.addEventListener("deleted",(()=>{var e,o;console.log("deleted",this,t),i.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(o=this.store)||void 0===o?void 0:o.state,event:"updated-field"})})),i.setAttribute("templateid",this.templateId),i.setAttribute("roleindex",o),i.setAttribute("pageNumber",e.pageNumber),i.setAttribute("xScale",e.xScale),i.setAttribute("yScale",e.yScale),i.setAttribute("name",t.name)}handlePageRendered(e){var t;const o=e.detail;console.log("[FIELDS] Page rendered",o.pageNumber,o),this.cachedPageInfo[o.pageNumber]=o,this.pageHeights[o.pageNumber]=o.naturalHeight,(null===(t=this.store)||void 0===t?void 0:t.state.fields.filter((e=>e.page_sequence===o.pageNumber))).forEach((e=>this.reRenderField(e,o.pageNumber)))}reRenderField(e,t){const o=this.cachedPageInfo[t],i=g(q(this.store),e.role_name),s=f(e,o,i,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.forEach((t=>{this.attachFieldAttributes(o,e,i,t),h(t).draggable({listeners:{start(e){console.log("[FIELDS] Drag started",e.type,e.target)},move(e){const t=+(e.target.getAttribute("posX")||0),o=+(e.target.getAttribute("posY")||0),i=+(e.target.getAttribute("xScale")||1),s=+(e.target.getAttribute("yScale")||1),l=e.dx/i+t,a=e.dy/s+o;e.target.setAttribute("posX",l),e.target.setAttribute("posy",a),u(e.target,"translate",`${l}px, ${a}px`)},end:this.handleMoveField.bind(this)}})})):(this.attachFieldAttributes(o,e,i,s),h(s).draggable({listeners:{start(e){console.log("[FIELDS] Drag started",e.type,e.target)},move(e){const t=+(e.target.getAttribute("posX")||0),o=+(e.target.getAttribute("posY")||0),i=+(e.target.getAttribute("xScale")||1),s=+(e.target.getAttribute("yScale")||1),l=e.dx/i+t,a=e.dy/s+o;e.target.setAttribute("posX",l),e.target.setAttribute("posy",a),u(e.target,"translate",`${l}px, ${a}px`)},end:this.handleMoveField.bind(this)}})))}async handleMoveField(e){var t;const o=e.target.getAttribute("pageNumber"),{naturalWidth:i=612,naturalHeight:s=792,renderedHeight:l=792}=this.cachedPageInfo[o];console.log("[FIELDS] Drag ended",o,e.target);const a=e.target.getBoundingClientRect(),r=e.target.parentElement.getBoundingClientRect(),d=Math.max(a.left-r.left,0),n=Math.max(l-(r.bottom-a.bottom),0),{x:p,y:c}=this.viewCoordinatesToPageCoordinates(d,n,o,i-e.rect.width,s-e.rect.height),h=e.target.getAttribute("name"),m=+(e.target.getAttribute("option")||"0"),g=null===(t=this.store)||void 0===t?void 0:t.state.fields.find((e=>e.name===h));if(console.log("Will update",h,m,g),g){switch(g.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":g.setting.x=p,g.setting.y=c;break;case"checkbox_group":case"radio_button_group":{const e=g.setting.options[m];e&&(e.x=p,e.y=c)}}await v(this.endpoint,this.templateId,h,g),this.handlePageRendered({detail:this.cachedPageInfo[o]})}}generateFieldName(e,t){var o,i;let s,l=1;do{s=`${e}P${t}-${l}`,console.log("testing field",s),l++}while(null===(o=this.store)||void 0===o?void 0:o.state.fields.some((e=>e.name===s)));return console.log("Will use field name",s,null===(i=this.store)||void 0===i?void 0:i.state.fields),s}viewCoordinatesToPageCoordinates(e,t,o,i,s){const{xScale:l=1,yScale:a=1,renderedHeight:r=792}=this.cachedPageInfo[o];return{x:Math.floor(Math.min(e/l,i)),y:Math.floor(Math.min(Math.max(r-t,0)/a,s))}}async handleClickPage(e,t){var o,i,s;if(this.placing){console.log("Placing field",this.placing,t.sequence,e.offsetX,e.offsetY);const l=t.sequence,a=e.offsetX,r=e.offsetY,d=x(this.placing),n=w(this.placing),p=this.cachedPageInfo[l];console.log("Cached page",p);const{naturalWidth:c=612,naturalHeight:h=792}=p,v=this.viewCoordinatesToPageCoordinates(a,r,l,c-d,h-n),g=Math.floor(v.x),f=Math.floor(v.y),u={name:this.generateFieldName(this.placing,l),role_name:this.selectedRoleName,template_id:this.templateId,type:this.placing,required:!0,page_sequence:l,validator:null,setting:{x:g,y:f},x:g,y:f,tabindex:0,width:d,height:n};switch(u.type){case"attachment":case"payment":u.setting={x:g,y:f};break;case"initial":case"signature":u.setting={x:g,y:f,result:""};break;case"checkbox_group":u.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${u.name}-1`,value:"Option 1",checked:!1,x:g,y:f}]};break;case"date":u.setting={x:g,y:f,width:d,height:n,result:""};break;case"dropdown":u.required=!1,u.setting={x:g,y:f,width:d,height:n,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":u.setting={options:[{id:`${u.name}-1`,value:"Option 1",selected:!1,x:g,y:f}]};break;case"textarea":case"textbox":u.setting={x:g,y:f,width:d,height:n,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":u.setting={x:g,y:f,width:d,height:n}}"textarea"===u.type&&(u.type="textbox");const b=await m(this.endpoint,this.templateId,u);console.log("Saved field",b),this.store.state&&(this.store.state.fields=[...null===(o=this.store)||void 0===o?void 0:o.state.fields,b]),this.placing=null,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:null===(s=this.store)||void 0===s?void 0:s.state,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[l]})}}render(){var e,t,s,l;if(!this.endpoint.session)return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return o(i,null,o("verdocs-loader",null));const a=[...null===(t=this.store)||void 0===t?void 0:t.state.pages];a.sort(((e,t)=>e.sequence-t.sequence));const r=null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.roles.map((e=>({value:e.name,label:e.name})));return o(i,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:r,onInput:e=>this.selectedRoleName=e.target.value}),E.map((e=>o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.placing=e.id)}})))),o("div",{class:"pages"},a.map((e=>o("verdocs-template-document-page",{templateId:e.template_id,documentId:e.document_id,pageNumber:e.sequence,virtualWidth:612,virtualHeight:792,onClick:t=>this.handleClickPage(t,e),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))}};z.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const H={[p.EVERYONE]:"Everyone",[p.EVERYONE_AS_CREATOR]:"Everyone as Me",[p.ORGANIZATION_MEMBER]:"Organization member",[p.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[p.CREATOR]:"Me"},L='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>',V='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',S='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>',T='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',R='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>',_=class{constructor(o){e(this,o),this.next=t(this,"next",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.sequences=[],this.store=null,this.endpoint=n.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null}async componentWillLoad(){var e,t,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await b(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles()}catch(i){console.log("[FIELDS] Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new c(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(o=i.response)||void 0===o?void 0:o.data))}}componentDidRender(){h.dynamicDrop(!0),h(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const t=+(e.target.getAttribute("posX")||0),o=+(e.target.getAttribute("posY")||0),i=e.dx+t,s=e.dy+o;e.target.setAttribute("posX",i),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${i+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),h(".dropzone").dropzone({overlap:.05,ondrop:function(e){var t,o,i,s,l;e.target.classList.remove("active");const a=e.relatedTarget.dataset.rolename,r=+e.target.dataset.sequence,d=+e.target.dataset.order,n=null===(i=null===(o=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===o?void 0:o.roles)||void 0===i?void 0:i.find((e=>e.name===a));n&&(n.sequence=r,n.order=d,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.roles.map((e=>y(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>{var e,t;console.log("[ROLES] Updated roles"),null===(e=this.templateUpdated)||void 0===e||e.emit({event:"updated-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state})})).catch((e=>console.log("[ROLES] Role updates failed",e))))}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(){var e;null===(e=this.exit)||void 0===e||e.emit()}handleSubmit(){var e;null===(e=this.next)||void 0===e||e.emit()}sortTemplateRoles(){var e,t;null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}extractSequenceNumbers(){var e,t;this.sequences=[],null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,t)=>e-t)),this.sequences.forEach(((t,o)=>{var i,s;null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s||s.roles.filter((e=>e.sequence===t)).forEach(((t,i)=>{e.includes(t.name)||(t.sequence=o+1,t.order=i+1,e.push(t.name))}))})),this.extractSequenceNumbers()}getNextRoleName(){var e,t,o,i;let s="",l=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.length;do{l++,s=`Recipient ${l}`}while(!s||(null===(i=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===i?void 0:i.roles.some((e=>e.name===s))));return s}callCreateRole(e,t,o){console.log("[ROLES] Will create role",{name:e,sequence:t,order:o}),C(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,order:o,full_name:"",email:"",phone:"",type:"signer",delegator:!1}).then((e=>{var t,o,i;console.log("[ROLES] Created role",e),this.store.state.roles=[...null===(t=this.store)||void 0===t?void 0:t.state.roles,e],this.renumberTemplateRoles(),null===(o=this.templateUpdated)||void 0===o||o.emit({event:"created-role",endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state})})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){var o;e.stopPropagation();const i=(null===(o=this.store)||void 0===o?void 0:o.state.roles.filter((e=>e.sequence===t)).length)+1,s=this.getNextRoleName();this.callCreateRole(s,t,i)}handleAddStep(e,t){e.stopPropagation();const o=this.getNextRoleName();this.callCreateRole(o,t,1)}render(){var e,t,l,a,r,d;if(!this.endpoint.session)return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return o(i,{class:"loading"},o("verdocs-loader",null));const n=((null===(l=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===l?void 0:l.roles)||[]).map((e=>e.name));return o(i,null,o("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":null===(a=this.store.state)||void 0===a?void 0:a.updateCount},o("h5",null,"Roles and Workflow"),o("div",{class:"participants"},o("div",{class:"left-line"}),o("div",{class:"row"},o("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),o("div",{class:"row-roles"},o("div",{class:"sender"},o("span",{class:"label"},"Sender:")," ",H[null===(d=null===(r=this.store)||void 0===r?void 0:r.state)||void 0===d?void 0:d.sender]," ",o("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),o("div",{class:"row add-sequence","data-sequence":0},o("div",{class:"icon",innerHTML:V}),o("div",{class:"row-roles"},o("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((e=>{var t,i;return o(s,null,o("div",{class:"row"},o("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),o("div",{class:"row-roles"},o("div",{class:"dropzone","data-order":.5,"data-sequence":e}),null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.roles.filter((t=>t.sequence===e)).map((t=>o(s,null,t.email?o("div",{class:"recipient",style:{borderColor:k(g(n,t.name))},"data-rolename":t.name},o("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?R:T}),t.full_name," ",o("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):o("div",{class:"recipient",style:{backgroundColor:k(g(n,t.name))},"data-rolename":t.name},o("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?R:T}),t.name," ",o("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})),o("div",{class:"dropzone","data-order":t.order+.5,"data-sequence":e})))),o("button",{class:"add-role",innerHTML:V,onClick:t=>this.handleAddRole(t,e)}))),this.sequences.length>0&&o("div",{class:"row add-sequence","data-sequence":e},o("div",{class:"row-roles"},o("div",{class:"icon",innerHTML:V}),o("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step"))))})),o("div",{class:"row","data-sequence":this.sequences.length+1},o("div",{class:"row-roles"},o("div",{class:"icon",innerHTML:V}),o("button",{class:"add-step",innerHTML:V,onClick:e=>this.handleAddStep(e,this.sequences.length+1)}))),o("div",{class:"row"},o("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),o("div",{class:"row-roles"},o("div",{class:"complete"},"Document Complete")))),n.length<1&&o("div",{class:"empty"},"You must add at least one Role before proceeding.",o("br",null)," Click the ",o("span",{innerHTML:V})," Add button above to get started."),o("div",{class:"buttons"},o("div",{class:"flex-fill"}),o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),o("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:n.length<1}))),this.showingRoleDialog&&o("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null},onDelete:async()=>{var e,t;await b(this.endpoint,this.templateId,!0),this.renumberTemplateRoles(),this.showingRoleDialog=null,null===(e=this.templateUpdated)||void 0===e||e.emit({event:"deleted-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state})}}),this.showingSenderDialog&&o("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};_.style='verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';export{Z as verdocs_template_create,z as verdocs_template_fields,_ as verdocs_template_roles}
|
@@ -1 +1 @@
|
|
1
|
-
import{p as e,b as t}from"./p-e035df4b.js";(()=>{const t=import.meta.url,d={};return""!==t&&(d.resourcesUrl=new URL(".",t).href),e(d)})().then((e=>t(JSON.parse('[["p-d8343849",[[0,"verdocs-checkbox",{"checked":[4],"name":[1],"label":[1],"value":[1],"theme":[1],"disabled":[4]}],[0,"verdocs-text-input",{"value":[1],"label":[1],"placeholder":[1],"autocomplete":[1],"helpText":[1,"help-text"],"type":[1],"disabled":[4]}],[0,"verdocs-component-error",{"message":[1]}],[0,"verdocs-help-icon",{"text":[1],"containerId":[32]}]]],["p-cc396cda",[[0,"verdocs-build",{"endpoint":[16],"templateId":[1,"template-id"],"step":[32],"pdfUrl":[32],"template":[32]}]]],["p-ab6bd525",[[0,"verdocs-field-initial",{"templateid":[1],"field":[16],"disabled":[4],"initials":[1],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"tempInitials":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-6f511c7b",[[0,"verdocs-field-signature",{"templateid":[1],"field":[16],"name":[1],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"tempSignature":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-36a31514",[[0,"verdocs-field-checkbox",{"templateid":[1],"field":[16],"option":[2],"disabled":[4],"done":[4],"roleindex":[2],"editable":[4],"moveable":[4],"rerender":[2],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-8eca5dd8",[[0,"verdocs-field-date",{"templateId":[1,"template-id"],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"containerId":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-e9751ec7",[[0,"verdocs-field-dropdown",{"templateid":[1],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-92a2bb47",[[0,"verdocs-field-radio-button",{"templateid":[1],"field":[16],"option":[2],"disabled":[4],"done":[4],"roleindex":[2],"editable":[4],"moveable":[4],"rerender":[2],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-d7ca70cc",[[0,"verdocs-field-textarea",{"templateid":[1],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-8d32078d",[[0,"verdocs-field-textbox",{"templateid":[1],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-e9c9cdf5",[[0,"verdocs-field-timestamp",{"templateid":[1],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-27fe6789",[[0,"verdocs-sign",{"envelopeId":[1,"envelope-id"],"roleId":[1,"role-id"],"inviteCode":[1,"invite-code"],"headerTargetId":[1,"header-target-id"],"envelope":[32],"roleNames":[32],"recipient":[32],"signerToken":[32],"hasSignature":[32],"nextButtonLabel":[32],"nextSubmits":[32],"errorMessage":[32],"focusedField":[32],"submitting":[32],"isDone":[32],"showDone":[32],"finishLater":[32],"showFinishLater":[32],"agreed":[32],"documentsSingularPlural":[32]}]]],["p-c8901fde",[[0,"verdocs-template-properties",{"endpoint":[16],"templateId":[1,"template-id"],"name":[32],"visibility":[32],"sendReminders":[32],"firstReminderDays":[32],"reminderDays":[32]}]]],["p-38d0af92",[[0,"verdocs-template-reminders",{"endpoint":[16],"templateId":[1,"template-id"],"showPlanBlocker":[32],"sendReminders":[32],"firstReminderDays":[32],"reminderDays":[32],"dirty":[32]}]]],["p-2d39a000",[[0,"verdocs-template-name",{"endpoint":[16],"templateId":[1,"template-id"],"name":[32],"dirty":[32]}]]],["p-7f13e92e",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"isAuthenticated":[32],"displayMode":[32],"username":[32],"password":[32],"loggingIn":[32],"activeSession":[32],"loginError":[32]}]]],["p-9c36aaaa",[[0,"verdocs-search",{"endpoint":[16]}]]],["p-e4b56475",[[0,"verdocs-send",{"endpoint":[16],"templateId":[1,"template-id"],"containerId":[32],"rolesAtLevel":[32],"showPickerForId":[32],"sessionContacts":[32],"rolesCompleted":[32],"reset":[64]}]]],["p-de4c38a1",[[0,"verdocs-template-visibility",{"endpoint":[16],"templateId":[1,"template-id"],"dirty":[32],"personal":[32],"public":[32]}]]],["p-f7910b66",[[0,"verdocs-view",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"headerTargetId":[1,"header-target-id"],"isProcessing":[32],"envelope":[32],"roleNames":[32],"showCancelDone":[32]}]]],["p-1edbfaf5",[[0,"verdocs-upload-dialog",{"draggingOver":[32],"decodedFiles":[32]}]]],["p-227d07a2",[[0,"verdocs-field-attachment",{"templateid":[1],"field":[16],"disabled":[4],"roleIndex":[2,"role-index"],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-3751d683",[[0,"verdocs-template-document-page",{"endpoint":[16],"templateId":[1,"template-id"],"documentId":[1,"document-id"],"pageNumber":[2,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32]}]]],["p-34eb8a38",[[0,"verdocs-loader"]]],["p-ec81b1f2",[[0,"verdocs-preview",{"endpoint":[16],"templateId":[1,"template-id"]}]]],["p-5b4dd6a0",[[0,"verdocs-template-attachments",{"endpoint":[16],"templateId":[1,"template-id"]}]]],["p-9b9c0ae7",[[0,"verdocs-envelope-sidebar",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"envelope":[32],"roleNames":[32],"activeTab":[32],"panelOpen":[32]}]]],["p-499022e8",[[0,"verdocs-floating-menu",{"options":[16]}]]],["p-77a2ec7e",[[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"choices":[16],"response":[32]}]]],["p-47bba747",[[0,"verdocs-field-payment",{"templateid":[1],"field":[16],"disabled":[4],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"focused":[4],"signed":[4],"rerender":[2],"roleindex":[2],"preparedMessage":[32],"signatureUrl":[32],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-60548c5f",[[0,"verdocs-organization-card",{"organization":[16]}]]],["p-d1f80bd5",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["p-71adad1c",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"envelope":[16],"isOpen":[32],"recipientStatusIcons":[32],"containerId":[32]}]]],["p-3ca6f68d",[[0,"verdocs-template-card",{"template":[16]}]]],["p-8a84234f",[[0,"verdocs-template-tags",{"tags":[16]}]]],["p-603db817",[[0,"verdocs-toggle",{"options":[16],"theme":[1],"selectedOption":[32]}]]],["p-d4f2c4cd",[[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["p-1e782b9d",[[0,"verdocs-initial-dialog",{"initials":[1],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["p-da129971",[[0,"verdocs-signature-dialog",{"name":[1],"fontLoaded":[32],"enteredName":[32],"mode":[32]}]]],["p-07dac8d8",[[0,"verdocs-contact-picker",{"endpoint":[16],"templateRole":[16],"contactSuggestions":[16],"name":[32],"email":[32],"phone":[32],"message":[32],"showSuggestions":[32],"showMessage":[32],"delegator":[32],"nameFieldId":[32],"emailFieldId":[32],"phoneFieldId":[32]}]]],["p-bcc9c2d8",[[0,"verdocs-progress-bar",{"label":[1],"showPercent":[4,"show-percent"],"percent":[2]}]]],["p-07d80297",[[0,"verdocs-toggle-button",{"active":[4],"icon":[1],"label":[1],"size":[1],"_active":[32]}]]],["p-09b008aa",[[0,"verdocs-template-roles",{"endpoint":[16],"templateId":[1,"template-id"],"showingRoleDialog":[32],"showingSenderDialog":[32],"sender":[32]}],[0,"verdocs-template-fields",{"endpoint":[16],"templateId":[1,"template-id"],"toolbarTargetId":[1,"toolbar-target-id"],"placing":[32],"selectedRoleName":[32],"rerender":[32]},[[4,"keydown","handleKeyDown"]]],[0,"verdocs-template-create",{"endpoint":[16],"file":[32],"creating":[32],"progressLabel":[32],"progressPercent":[32]}]]],["p-c9705b22",[[0,"verdocs-quick-functions",{"endpoint":[16]}],[0,"verdocs-search-activity",{"endpoint":[16],"type":[1],"options":[8],"emptyMessage":[32],"authFailure":[32],"title":[32],"recent":[32],"saved":[32],"starred":[32]}],[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1],"grabsFocus":[4,"grabs-focus"],"focusField":[64]}]]],["p-1886b178",[[0,"verdocs-toolbar-icon",{"text":[1],"icon":[1],"placement":[1],"containerId":[32]}]]],["p-b3bca701",[[0,"verdocs-template-role-properties",{"endpoint":[16],"templateId":[1,"template-id"],"roleName":[1,"role-name"],"sender":[1],"dirty":[32],"saving":[32],"name":[32],"type":[32],"fullName":[32],"email":[32],"phone":[32],"allowDelegation":[32]}],[0,"verdocs-template-sender",{"endpoint":[16],"templateId":[1,"template-id"],"sender":[1],"saving":[32]}]]],["p-21ad4745",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"showCancel":[4,"show-cancel"],"closed":[32]}]]],["p-1c75e276",[[0,"verdocs-radio-button",{"checked":[4],"name":[1],"value":[1],"disabled":[4]}]]],["p-32fb9679",[[0,"verdocs-envelope-document-page",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"documentId":[1,"document-id"],"pageNumber":[2,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"type":[1],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32]}],[0,"verdocs-dropdown",{"options":[16],"open":[32]}]]],["p-7a4d71b7",[[0,"verdocs-template-field-properties",{"endpoint":[16],"templateId":[1,"template-id"],"fieldName":[1,"field-name"],"helpText":[1,"help-text"],"dirty":[32],"loading":[32],"type":[32],"setting":[32],"name":[32],"roleName":[32],"group":[32],"fieldType":[32],"required":[32],"options":[32],"placeholder":[32],"defaultValue":[32],"showingHelp":[32]}],[4,"verdocs-button-panel",{"icon":[1],"showPanel":[64],"hidePanel":[64],"toggle":[64]}],[0,"verdocs-select-input",{"value":[1],"label":[1],"options":[16],"disabled":[4]}]]]]'),e)));
|
1
|
+
import{p as e,b as t}from"./p-e035df4b.js";(()=>{const t=import.meta.url,d={};return""!==t&&(d.resourcesUrl=new URL(".",t).href),e(d)})().then((e=>t(JSON.parse('[["p-39e906e0",[[0,"verdocs-checkbox",{"checked":[4],"name":[1],"label":[1],"value":[1],"theme":[1],"disabled":[4]}],[0,"verdocs-text-input",{"value":[1],"label":[1],"placeholder":[1],"autocomplete":[1],"helpText":[1,"help-text"],"type":[1],"disabled":[4]}],[0,"verdocs-component-error",{"message":[1]}],[0,"verdocs-help-icon",{"text":[1],"containerId":[32]}]]],["p-cc396cda",[[0,"verdocs-build",{"endpoint":[16],"templateId":[1,"template-id"],"step":[32],"pdfUrl":[32],"template":[32]}]]],["p-ab6bd525",[[0,"verdocs-field-initial",{"templateid":[1],"field":[16],"disabled":[4],"initials":[1],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"tempInitials":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-6f511c7b",[[0,"verdocs-field-signature",{"templateid":[1],"field":[16],"name":[1],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"tempSignature":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-eff8b358",[[0,"verdocs-field-checkbox",{"templateid":[1],"field":[16],"option":[2],"disabled":[4],"done":[4],"roleindex":[2],"editable":[4],"moveable":[4],"rerender":[2],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-42fa6b2f",[[0,"verdocs-field-date",{"templateId":[1,"template-id"],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"containerId":[32],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-e9751ec7",[[0,"verdocs-field-dropdown",{"templateid":[1],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-ebce4300",[[0,"verdocs-field-radio-button",{"templateid":[1],"field":[16],"option":[2],"disabled":[4],"done":[4],"roleindex":[2],"editable":[4],"moveable":[4],"rerender":[2],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-d643db3b",[[0,"verdocs-field-textarea",{"templateid":[1],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-923f56f3",[[0,"verdocs-field-textbox",{"templateid":[1],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-e9c9cdf5",[[0,"verdocs-field-timestamp",{"templateid":[1],"field":[16],"disabled":[4],"editable":[4],"moveable":[4],"done":[4],"roleindex":[2],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-e16ad8fe",[[0,"verdocs-sign",{"envelopeId":[1,"envelope-id"],"roleId":[1,"role-id"],"inviteCode":[1,"invite-code"],"headerTargetId":[1,"header-target-id"],"envelope":[32],"roleNames":[32],"recipient":[32],"signerToken":[32],"hasSignature":[32],"nextButtonLabel":[32],"nextSubmits":[32],"errorMessage":[32],"focusedField":[32],"submitting":[32],"isDone":[32],"showDone":[32],"finishLater":[32],"showFinishLater":[32],"agreed":[32],"documentsSingularPlural":[32]}]]],["p-c8901fde",[[0,"verdocs-template-properties",{"endpoint":[16],"templateId":[1,"template-id"],"name":[32],"visibility":[32],"sendReminders":[32],"firstReminderDays":[32],"reminderDays":[32]}]]],["p-38d0af92",[[0,"verdocs-template-reminders",{"endpoint":[16],"templateId":[1,"template-id"],"showPlanBlocker":[32],"sendReminders":[32],"firstReminderDays":[32],"reminderDays":[32],"dirty":[32]}]]],["p-2d39a000",[[0,"verdocs-template-name",{"endpoint":[16],"templateId":[1,"template-id"],"name":[32],"dirty":[32]}]]],["p-7f13e92e",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"isAuthenticated":[32],"displayMode":[32],"username":[32],"password":[32],"loggingIn":[32],"activeSession":[32],"loginError":[32]}]]],["p-9c36aaaa",[[0,"verdocs-search",{"endpoint":[16]}]]],["p-e4b56475",[[0,"verdocs-send",{"endpoint":[16],"templateId":[1,"template-id"],"containerId":[32],"rolesAtLevel":[32],"showPickerForId":[32],"sessionContacts":[32],"rolesCompleted":[32],"reset":[64]}]]],["p-de4c38a1",[[0,"verdocs-template-visibility",{"endpoint":[16],"templateId":[1,"template-id"],"dirty":[32],"personal":[32],"public":[32]}]]],["p-0714e785",[[0,"verdocs-view",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"headerTargetId":[1,"header-target-id"],"canceling":[32],"envelope":[32],"roleNames":[32],"showCancelDone":[32]}]]],["p-1edbfaf5",[[0,"verdocs-upload-dialog",{"draggingOver":[32],"decodedFiles":[32]}]]],["p-227d07a2",[[0,"verdocs-field-attachment",{"templateid":[1],"field":[16],"disabled":[4],"roleIndex":[2,"role-index"],"rerender":[2],"focusField":[64],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-3751d683",[[0,"verdocs-template-document-page",{"endpoint":[16],"templateId":[1,"template-id"],"documentId":[1,"document-id"],"pageNumber":[2,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32]}]]],["p-34eb8a38",[[0,"verdocs-loader"]]],["p-ec81b1f2",[[0,"verdocs-preview",{"endpoint":[16],"templateId":[1,"template-id"]}]]],["p-5b4dd6a0",[[0,"verdocs-template-attachments",{"endpoint":[16],"templateId":[1,"template-id"]}]]],["p-9b9c0ae7",[[0,"verdocs-envelope-sidebar",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"envelope":[32],"roleNames":[32],"activeTab":[32],"panelOpen":[32]}]]],["p-499022e8",[[0,"verdocs-floating-menu",{"options":[16]}]]],["p-77a2ec7e",[[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"choices":[16],"response":[32]}]]],["p-47bba747",[[0,"verdocs-field-payment",{"templateid":[1],"field":[16],"disabled":[4],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"focused":[4],"signed":[4],"rerender":[2],"roleindex":[2],"preparedMessage":[32],"signatureUrl":[32],"showSettingsPanel":[64],"hideSettingsPanel":[64]}]]],["p-60548c5f",[[0,"verdocs-organization-card",{"organization":[16]}]]],["p-d1f80bd5",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["p-71adad1c",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"envelope":[16],"isOpen":[32],"recipientStatusIcons":[32],"containerId":[32]}]]],["p-3ca6f68d",[[0,"verdocs-template-card",{"template":[16]}]]],["p-8a84234f",[[0,"verdocs-template-tags",{"tags":[16]}]]],["p-603db817",[[0,"verdocs-toggle",{"options":[16],"theme":[1],"selectedOption":[32]}]]],["p-d4f2c4cd",[[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["p-1e782b9d",[[0,"verdocs-initial-dialog",{"initials":[1],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["p-da129971",[[0,"verdocs-signature-dialog",{"name":[1],"fontLoaded":[32],"enteredName":[32],"mode":[32]}]]],["p-07dac8d8",[[0,"verdocs-contact-picker",{"endpoint":[16],"templateRole":[16],"contactSuggestions":[16],"name":[32],"email":[32],"phone":[32],"message":[32],"showSuggestions":[32],"showMessage":[32],"delegator":[32],"nameFieldId":[32],"emailFieldId":[32],"phoneFieldId":[32]}]]],["p-bcc9c2d8",[[0,"verdocs-progress-bar",{"label":[1],"showPercent":[4,"show-percent"],"percent":[2]}]]],["p-07d80297",[[0,"verdocs-toggle-button",{"active":[4],"icon":[1],"label":[1],"size":[1],"_active":[32]}]]],["p-f44f5d73",[[0,"verdocs-template-roles",{"endpoint":[16],"templateId":[1,"template-id"],"showingRoleDialog":[32],"showingSenderDialog":[32],"sender":[32]}],[0,"verdocs-template-fields",{"endpoint":[16],"templateId":[1,"template-id"],"toolbarTargetId":[1,"toolbar-target-id"],"placing":[32],"selectedRoleName":[32],"rerender":[32]},[[4,"keydown","handleKeyDown"]]],[0,"verdocs-template-create",{"endpoint":[16],"file":[32],"creating":[32],"progressLabel":[32],"progressPercent":[32]}]]],["p-c9705b22",[[0,"verdocs-quick-functions",{"endpoint":[16]}],[0,"verdocs-search-activity",{"endpoint":[16],"type":[1],"options":[8],"emptyMessage":[32],"authFailure":[32],"title":[32],"recent":[32],"saved":[32],"starred":[32]}],[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1],"grabsFocus":[4,"grabs-focus"],"focusField":[64]}]]],["p-1886b178",[[0,"verdocs-toolbar-icon",{"text":[1],"icon":[1],"placement":[1],"containerId":[32]}]]],["p-b3bca701",[[0,"verdocs-template-role-properties",{"endpoint":[16],"templateId":[1,"template-id"],"roleName":[1,"role-name"],"sender":[1],"dirty":[32],"saving":[32],"name":[32],"type":[32],"fullName":[32],"email":[32],"phone":[32],"allowDelegation":[32]}],[0,"verdocs-template-sender",{"endpoint":[16],"templateId":[1,"template-id"],"sender":[1],"saving":[32]}]]],["p-21ad4745",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"showCancel":[4,"show-cancel"],"closed":[32]}]]],["p-1c75e276",[[0,"verdocs-radio-button",{"checked":[4],"name":[1],"value":[1],"disabled":[4]}]]],["p-32fb9679",[[0,"verdocs-envelope-document-page",{"endpoint":[16],"envelopeId":[1,"envelope-id"],"documentId":[1,"document-id"],"pageNumber":[2,"page-number"],"virtualWidth":[2,"virtual-width"],"virtualHeight":[1026,"virtual-height"],"layers":[16],"type":[1],"containerId":[32],"renderedWidth":[32],"renderedHeight":[32],"naturalWidth":[32],"naturalHeight":[32],"aspectRatio":[32],"skipFirstNotification":[32],"pageDisplayUri":[32]}],[0,"verdocs-dropdown",{"options":[16],"open":[32]}]]],["p-40bb871d",[[0,"verdocs-template-field-properties",{"endpoint":[16],"templateId":[1,"template-id"],"fieldName":[1,"field-name"],"helpText":[1,"help-text"],"dirty":[32],"loading":[32],"type":[32],"setting":[32],"name":[32],"roleName":[32],"group":[32],"fieldType":[32],"required":[32],"options":[32],"placeholder":[32],"defaultValue":[32],"showingHelp":[32]}],[4,"verdocs-button-panel",{"icon":[1],"showPanel":[64],"hidePanel":[64],"toggle":[64]}],[0,"verdocs-select-input",{"value":[1],"label":[1],"options":[16],"disabled":[4]}]]]]'),e)));
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@verdocs/web-sdk",
|
3
|
-
"version": "1.13.
|
3
|
+
"version": "1.13.5",
|
4
4
|
"private": false,
|
5
5
|
"description": "Verdocs Web SDK",
|
6
6
|
"license": "MIT",
|
@@ -32,7 +32,7 @@
|
|
32
32
|
"@stencil/core": "2.20.0",
|
33
33
|
"@stencil/store": "^2.0.4",
|
34
34
|
"@svgdotjs/svg.js": "^3.1.2",
|
35
|
-
"@verdocs/js-sdk": "^3.3.
|
35
|
+
"@verdocs/js-sdk": "^3.3.4",
|
36
36
|
"date-fns": "^2.29.3",
|
37
37
|
"flatpickr": "^4.6.13",
|
38
38
|
"interactjs": "^1.10.17",
|
package/dist/typings.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
import{r as e,c as t,h as o,H as i,F as s,a as l}from"./p-e035df4b.js";import"./p-05788c2b.js";import{c as a,g as r}from"./p-b86b362a.js";import{c as d}from"./p-4cd5eb1f.js";import{V as n,T as p}from"./p-c2c49441.js";import{S as c}from"./p-7a1b2643.js";import{i as h}from"./p-0d28cf05.js";import{u as v,c as m}from"./p-feb442b1.js";import{a as g,r as f,c as u,d as x,e as w}from"./p-1abcf29d.js";import{g as b,a as q}from"./p-c25d965d.js";import{u as y,c as C}from"./p-8027431e.js";import{g as k}from"./p-6de76553.js";import"./p-eab67c09.js";import"./p-b3ec6306.js";import"./p-aa124212.js";import"./p-ab01f71e.js";const Z=class{constructor(o){e(this,o),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.endpoint=n.getDefault(),this.file=void 0,this.creating=!1,this.progressLabel="Uploading...",this.progressPercent=0}componentWillLoad(){this.endpoint.setTimeout(3e4),this.endpoint.loadSession()}handleFileChanged(e){var t;this.file=(null===(t=e.target.files)||void 0===t?void 0:t[0])||null,console.log("[CREATE] Selected file",this.file)}handleUpload(e){e.stopPropagation(),document.getElementById("verdocs-template-create-file").click()}handleCancel(e){e.stopPropagation(),this.exit.emit()}async handleSubmit(e){var t,o,i,s;if(e.stopPropagation(),console.log("Submitting"),this.file){this.creating=!0,this.progressLabel="Uploading...";try{const e=await a(this.endpoint,{name:this.file.name});console.log("[CREATE] Created template",e);const o=await d(this.endpoint,e.id,this.file,(e=>{e>=99?(this.progressLabel="Processing...",this.progressPercent=100):this.progressPercent=e}));console.log("[CREATE] Created document",o);const i=await r(this.endpoint,e.id);null===(t=this.next)||void 0===t||t.emit(i),this.creating=!1,this.progressLabel="",this.progressPercent=0}catch(e){console.log("[CREATE] Error creating template",e),null===(o=this.sdkError)||void 0===o||o.emit(new c(e.message,null===(i=e.response)||void 0===i?void 0:i.status,null===(s=e.response)||void 0===s?void 0:s.data)),this.creating=!1}}}render(){return this.endpoint.session?o("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},o("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:"application/pdf",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:!0,percent:this.progressPercent,label:this.progressLabel}))):o("div",{class:"upload-box"},o("div",null,o("span",{innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>'})),o("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),o("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?" ":"Or, if you prefer..."),o("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),o("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating}))):o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};Z.style='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';const M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>',E=[{id:"signature",tooltip:"Signature",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>'},{id:"initial",tooltip:"Initials",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>'},{id:"sep1",tooltip:"",icon:M},{id:"textbox",tooltip:"Text Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>'},{id:"textarea",tooltip:"Text Area",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z"/></svg>'},{id:"checkbox_group",tooltip:"Check Box",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>'},{id:"radio_button_group",tooltip:"Radio Button",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>'},{id:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>'},{id:"sep2",tooltip:"",icon:M},{id:"date",tooltip:"Date",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>'},{id:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z"></path></svg>'}],z=class{constructor(o){e(this,o),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.store=null,this.cachedPageInfo={},this.endpoint=n.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,o,i,s,l,a;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[FIELDS] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[FIELDS] Unable to start builder session, must be authenticated");this.store=await b(this.endpoint,this.templateId,!0),console.log(`[FIELDS] Loading template ${this.templateId}`,this.endpoint.session),this.selectedRoleName=(null===(i=null===(o=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles)||void 0===o?void 0:o[0])||void 0===i?void 0:i.name)||"",console.log("Starting with role",this.selectedRoleName)}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new c(e.message,null===(l=e.response)||void 0===l?void 0:l.status,null===(a=e.response)||void 0===a?void 0:a.data))}}componentDidRender(){h.dynamicDrop(!0);const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null,t=document.getElementById("verdocs-template-fields-toolbar");e&&t&&(console.log("[FIELDS] Moving toolbar"),t.remove(),e.append(t))}handleKeyDown(e){"Escape"===e.key&&(this.placing=null)}async handleFieldChange(e,t,o){console.log("[FIELDS] handleFieldChange",e,t,o),this.rerender++}attachFieldAttributes(e,t,o,i){i.addEventListener("input",(e=>this.handleFieldChange(t,e))),i.addEventListener("settingsChanged",(()=>{var s,l,a,r;this.selectedRoleName=t.role_name,console.log("settings changed",this.selectedRoleName,t),i.setAttribute("roleindex",g(q(this.store),t.role_name)),i.field=null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.fields.find((e=>e.name===t.name)),this.rerender++,i.setAttribute("rerender",this.rerender),null===(a=this.templateUpdated)||void 0===a||a.emit({endpoint:this.endpoint,template:null===(r=this.store)||void 0===r?void 0:r.state,event:"updated-field"}),console.log("Re-rendering field",t.name,e.pageNumber),this.reRenderField(t,e.pageNumber),f(t,e,o,{disabled:!0,editable:!0,draggable:!0})})),i.addEventListener("deleted",(()=>{var e,o;console.log("deleted",this,t),i.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:null===(o=this.store)||void 0===o?void 0:o.state,event:"updated-field"})})),i.setAttribute("templateid",this.templateId),i.setAttribute("roleindex",o),i.setAttribute("pageNumber",e.pageNumber),i.setAttribute("xScale",e.xScale),i.setAttribute("yScale",e.yScale),i.setAttribute("name",t.name)}handlePageRendered(e){var t;const o=e.detail;console.log("[FIELDS] Page rendered",o.pageNumber,o),this.cachedPageInfo[o.pageNumber]=o,this.pageHeights[o.pageNumber]=o.naturalHeight,(null===(t=this.store)||void 0===t?void 0:t.state.fields.filter((e=>e.page_sequence===o.pageNumber))).forEach((e=>this.reRenderField(e,o.pageNumber)))}reRenderField(e,t){const o=this.cachedPageInfo[t],i=g(q(this.store),e.role_name),s=f(e,o,i,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.forEach((t=>{this.attachFieldAttributes(o,e,i,t),h(t).draggable({listeners:{start(e){console.log("[FIELDS] Drag started",e.type,e.target)},move(e){const t=+(e.target.getAttribute("posX")||0),o=+(e.target.getAttribute("posY")||0),i=+(e.target.getAttribute("xScale")||1),s=+(e.target.getAttribute("yScale")||1),l=e.dx/i+t,a=e.dy/s+o;e.target.setAttribute("posX",l),e.target.setAttribute("posy",a),u(e.target,"translate",`${l}px, ${a}px`)},end:this.handleMoveField.bind(this)}})})):(this.attachFieldAttributes(o,e,i,s),h(s).draggable({listeners:{start(e){console.log("[FIELDS] Drag started",e.type,e.target)},move(e){const t=+(e.target.getAttribute("posX")||0),o=+(e.target.getAttribute("posY")||0),i=+(e.target.getAttribute("xScale")||1),s=+(e.target.getAttribute("yScale")||1),l=e.dx/i+t,a=e.dy/s+o;e.target.setAttribute("posX",l),e.target.setAttribute("posy",a),u(e.target,"translate",`${l}px, ${a}px`)},end:this.handleMoveField.bind(this)}})))}async handleMoveField(e){var t;const o=e.target.getAttribute("pageNumber"),{naturalWidth:i=612,naturalHeight:s=792,renderedHeight:l=792}=this.cachedPageInfo[o];console.log("[FIELDS] Drag ended",o,e.target);const a=e.target.getBoundingClientRect(),r=e.target.parentElement.getBoundingClientRect(),d=Math.max(a.left-r.left,0),n=Math.max(l-(r.bottom-a.bottom),0),{x:p,y:c}=this.viewCoordinatesToPageCoordinates(d,n,o,i-e.rect.width,s-e.rect.height),h=e.target.getAttribute("name"),m=+(e.target.getAttribute("option")||"0"),g=null===(t=this.store)||void 0===t?void 0:t.state.fields.find((e=>e.name===h));if(console.log("Will update",h,m,g),g){switch(g.type){case"attachment":case"payment":case"initial":case"signature":case"date":case"dropdown":case"textarea":case"textbox":case"timestamp":g.setting.x=p,g.setting.y=c;break;case"checkbox_group":case"radio_button_group":{const e=g.setting.options[m];e&&(e.x=p,e.y=c)}}await v(this.endpoint,this.templateId,h,g),this.handlePageRendered({detail:this.cachedPageInfo[o]})}}generateFieldName(e,t){var o,i;let s,l=1;do{s=`${e}P${t}-${l}`,console.log("testing field",s),l++}while(null===(o=this.store)||void 0===o?void 0:o.state.fields.some((e=>e.name===s)));return console.log("Will use field name",s,null===(i=this.store)||void 0===i?void 0:i.state.fields),s}viewCoordinatesToPageCoordinates(e,t,o,i,s){const{xScale:l=1,yScale:a=1,renderedHeight:r=792}=this.cachedPageInfo[o];return{x:Math.floor(Math.min(e/l,i)),y:Math.floor(Math.min(Math.max(r-t,0)/a,s))}}async handleClickPage(e,t){var o,i,s;if(this.placing){console.log("Placing field",this.placing,t.sequence,e.offsetX,e.offsetY);const l=t.sequence,a=e.offsetX,r=e.offsetY,d=x(this.placing),n=w(this.placing),p=this.cachedPageInfo[l];console.log("Cached page",p);const{naturalWidth:c=612,naturalHeight:h=792}=p,v=this.viewCoordinatesToPageCoordinates(a,r,l,c-d,h-n),g=Math.floor(v.x),f=Math.floor(v.y),u={name:this.generateFieldName(this.placing,l),role_name:this.selectedRoleName,template_id:this.templateId,type:this.placing,required:!0,page_sequence:l,validator:null,setting:{x:g,y:f}};switch(u.type){case"attachment":case"payment":u.setting={x:g,y:f};break;case"initial":case"signature":u.setting={x:g,y:f,result:""};break;case"checkbox_group":u.setting={minimum_checked:0,maximum_checked:1e3,options:[{id:`${u.name}-1`,value:"Option 1",checked:!1,x:g,y:f}]};break;case"date":u.setting={x:g,y:f,width:d,height:n,result:""};break;case"dropdown":u.required=!1,u.setting={x:g,y:f,width:d,height:n,value:null,placeholder:"Choose",options:[{id:"option-1",value:"Option 1"}]};break;case"radio_button_group":u.setting={options:[{id:`${u.name}-1`,value:"Option 1",selected:!1,x:g,y:f}]};break;case"textarea":case"textbox":u.setting={x:g,y:f,width:d,height:n,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":u.setting={x:g,y:f,width:d,height:n}}"textarea"===u.type&&(u.type="textbox");const b=await m(this.endpoint,this.templateId,u);console.log("Saved field",b),this.store.state&&(this.store.state.fields=[...null===(o=this.store)||void 0===o?void 0:o.state.fields,b]),this.placing=null,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:null===(s=this.store)||void 0===s?void 0:s.state,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[l]})}}render(){var e,t,s,l;if(!this.endpoint.session)return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return o(i,null,o("verdocs-loader",null));const a=[...null===(t=this.store)||void 0===t?void 0:t.state.pages];a.sort(((e,t)=>e.sequence-t.sequence));const r=null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.roles.map((e=>({value:e.name,label:e.name})));return o(i,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:r,onInput:e=>this.selectedRoleName=e.target.value}),E.map((e=>o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>{e.tooltip&&(this.placing=e.id)}})))),o("div",{class:"pages"},a.map((e=>o("verdocs-template-document-page",{templateId:e.template_id,documentId:e.document_id,pageNumber:e.sequence,virtualWidth:612,virtualHeight:792,onClick:t=>this.handleClickPage(t,e),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})))))}};z.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields #verdocs-template-fields-toolbar{height:50px;display:-ms-flexbox;display:flex;-ms-flex:0 0 50px;flex:0 0 50px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{font-weight:500;margin:0;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}verdocs-template-fields.placing-attachment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-checkbox_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-radio_button_group{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E\") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url(\"data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A\") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E\") 16 16, pointer}";const H={[p.EVERYONE]:"Everyone",[p.EVERYONE_AS_CREATOR]:"Everyone as Me",[p.ORGANIZATION_MEMBER]:"Organization member",[p.ORGANIZATION_MEMBER_AS_CREATOR]:"Organization Member as Me",[p.CREATOR]:"Me"},L='<svg xmlns="http://www.w3.org/2000/svg" height="20" width="20" fill="#00000089"><path d="m8.021 17.917-.313-2.5q-.27-.125-.625-.334-.354-.208-.625-.395l-2.312.979-1.979-3.438 1.979-1.5q-.021-.167-.031-.364-.011-.198-.011-.365 0-.146.011-.344.01-.198.031-.385l-1.979-1.5 1.979-3.417 2.312.958q.271-.187.615-.385t.635-.344l.313-2.5h3.958l.313 2.5q.312.167.625.344.312.177.604.385l2.333-.958 1.979 3.417-1.979 1.521q.021.187.021.364V10q0 .146-.01.333-.011.188-.011.396l1.958 1.5-1.979 3.438-2.312-.979q-.292.208-.615.395-.323.188-.614.334l-.313 2.5Zm1.937-5.355q1.063 0 1.813-.75t.75-1.812q0-1.062-.75-1.812t-1.813-.75q-1.041 0-1.802.75-.76.75-.76 1.812t.76 1.812q.761.75 1.802.75Zm0-1.333q-.5 0-.864-.364-.365-.365-.365-.865t.365-.865q.364-.364.864-.364t.865.364q.365.365.365.865t-.365.865q-.365.364-.865.364ZM10.021 10Zm-.854 6.583h1.666l.25-2.187q.605-.167 1.136-.49.531-.323 1.031-.802l2.021.875.854-1.375-1.792-1.354q.105-.333.136-.635.031-.303.031-.615 0-.292-.031-.573-.031-.281-.115-.635l1.792-1.396-.834-1.375-2.062.875q-.438-.438-1.021-.781-.583-.344-1.125-.49l-.271-2.208H9.167l-.271 2.208q-.584.146-1.125.458-.542.313-1.042.792l-2.021-.854-.833 1.375 1.75 1.354q-.083.333-.125.646-.042.312-.042.604t.042.594q.042.302.125.635l-1.75 1.375.833 1.375 2.021-.854q.479.458 1.021.771.542.312 1.146.479Z"/></svg>',V='<svg xmlns="http://www.w3.org/2000/svg" fill="#ffffff" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor"><path strokeLinecap="round" strokeLinejoin="round" d="M12 9v6m3-3H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>',S='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>',T='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12zm13.36-1.814a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',R='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z" /><path d="M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z" /></svg>',_=class{constructor(o){e(this,o),this.next=t(this,"next",7),this.exit=t(this,"exit",7),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.sequences=[],this.store=null,this.endpoint=n.getDefault(),this.templateId="",this.showingRoleDialog=null,this.showingSenderDialog=!1,this.sender=null}async componentWillLoad(){var e,t,o;try{if(this.endpoint.loadSession(),!this.templateId)return void console.log(`[ROLES] Missing required template ID ${this.templateId}`);if(!this.endpoint.session)return void console.log("[ROLES] Unable to start builder session, must be authenticated");this.store=await b(this.endpoint,this.templateId,!0),this.sortTemplateRoles(),this.renumberTemplateRoles()}catch(i){console.log("[FIELDS] Error with preview session",i),null===(e=this.sdkError)||void 0===e||e.emit(new c(i.message,null===(t=i.response)||void 0===t?void 0:t.status,null===(o=i.response)||void 0===o?void 0:o.data))}}componentDidRender(){h.dynamicDrop(!0),h(".recipient").draggable({listeners:{start:function(e){e.target.classList.add("dragging"),this.el.classList.add("dragging")}.bind(this),move:function(e){const t=+(e.target.getAttribute("posX")||0),o=+(e.target.getAttribute("posY")||0),i=e.dx+t,s=e.dy+o;e.target.setAttribute("posX",i),e.target.setAttribute("posy",s),e.target.style.transform=`translate(${i+100}px, ${s-40}px)`}.bind(this),end:function(e){e.target.classList.remove("dragging"),this.el.classList.remove("dragging"),e.target.setAttribute("posX",0),e.target.setAttribute("posy",0),e.target.style.transform="translate(0px, 0px)"}.bind(this)}}),h(".dropzone").dropzone({overlap:.05,ondrop:function(e){var t,o,i,s,l;e.target.classList.remove("active");const a=e.relatedTarget.dataset.rolename,r=+e.target.dataset.sequence,d=+e.target.dataset.order,n=null===(i=null===(o=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===o?void 0:o.roles)||void 0===i?void 0:i.find((e=>e.name===a));n&&(n.sequence=r,n.order=d,this.sortTemplateRoles(),this.renumberTemplateRoles(),this.forceRerender++,Promise.all(null===(l=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===l?void 0:l.roles.map((e=>y(this.endpoint,this.templateId,e.name,{sequence:e.sequence,order:e.order})))).then((()=>{var e,t;console.log("[ROLES] Updated roles"),null===(e=this.templateUpdated)||void 0===e||e.emit({event:"updated-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state})})).catch((e=>console.log("[ROLES] Role updates failed",e))))}.bind(this),ondropactivate:e=>{e.target.classList.add("visible")},ondropdeactivate:e=>{e.target.classList.remove("visible")},ondragenter:e=>{e.target.classList.add("active")},ondragleave:e=>{e.target.classList.remove("active")}})}handleCancel(){var e;null===(e=this.exit)||void 0===e||e.emit()}handleSubmit(){var e;null===(e=this.next)||void 0===e||e.emit()}sortTemplateRoles(){var e,t;null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.sort(((e,t)=>e.sequence===t.sequence?e.order-t.order:e.sequence-t.sequence))}extractSequenceNumbers(){var e,t;this.sequences=[],null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t||t.roles.forEach((e=>{this.sequences.includes(e.sequence)||this.sequences.push(e.sequence)}))}renumberTemplateRoles(){this.extractSequenceNumbers();const e=[];this.sequences.sort(((e,t)=>e-t)),this.sequences.forEach(((t,o)=>{var i,s;null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s||s.roles.filter((e=>e.sequence===t)).forEach(((t,i)=>{e.includes(t.name)||(t.sequence=o+1,t.order=i+1,e.push(t.name))}))})),this.extractSequenceNumbers()}getNextRoleName(){var e,t,o,i;let s="",l=null===(t=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===t?void 0:t.roles.length;do{l++,s=`Recipient ${l}`}while(!s||(null===(i=null===(o=this.store)||void 0===o?void 0:o.state)||void 0===i?void 0:i.roles.some((e=>e.name===s))));return s}callCreateRole(e,t,o){console.log("[ROLES] Will create role",{name:e,sequence:t,order:o}),C(this.endpoint,this.templateId,{template_id:this.templateId,name:e,sequence:t,order:o,full_name:"",email:"",phone:"",type:"signer",delegator:!1}).then((e=>{var t,o,i;console.log("[ROLES] Created role",e),this.store.state.roles=[...null===(t=this.store)||void 0===t?void 0:t.state.roles,e],this.renumberTemplateRoles(),null===(o=this.templateUpdated)||void 0===o||o.emit({event:"created-role",endpoint:this.endpoint,template:null===(i=this.store)||void 0===i?void 0:i.state})})).catch((e=>{console.log("[ROLES] Error creating role",e)}))}handleAddRole(e,t){var o;e.stopPropagation();const i=(null===(o=this.store)||void 0===o?void 0:o.state.roles.filter((e=>e.sequence===t)).length)+1,s=this.getNextRoleName();this.callCreateRole(s,t,i)}handleAddStep(e,t){e.stopPropagation();const o=this.getNextRoleName();this.callCreateRole(o,t,1)}render(){var e,t,l,a,r,d;if(!this.endpoint.session)return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(!(null===(e=this.store)||void 0===e?void 0:e.state.isLoaded))return o(i,{class:"loading"},o("verdocs-loader",null));const n=((null===(l=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===l?void 0:l.roles)||[]).map((e=>e.name));return o(i,null,o("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off","data-r":null===(a=this.store.state)||void 0===a?void 0:a.updateCount},o("h5",null,"Roles and Workflow"),o("div",{class:"participants"},o("div",{class:"left-line"}),o("div",{class:"row"},o("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M2 12C2 6.48 6.48 2 12 2s10 4.48 10 10-4.48 10-10 10S2 17.52 2 12zm10 6c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6z"></path></svg>'}),o("div",{class:"row-roles"},o("div",{class:"sender"},o("span",{class:"label"},"Sender:")," ",H[null===(d=null===(r=this.store)||void 0===r?void 0:r.state)||void 0===d?void 0:d.sender]," ",o("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingSenderDialog=!0,"aria-role":"button"})))),o("div",{class:"row add-sequence","data-sequence":0},o("div",{class:"icon",innerHTML:V}),o("div",{class:"row-roles"},o("div",{class:"dropzone","data-sequence":0,"data-order":1},"Add Step"))),this.sequences.map((e=>{var t,i;return o(s,null,o("div",{class:"row"},o("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"></path></svg>'}),o("div",{class:"row-roles"},o("div",{class:"dropzone","data-order":.5,"data-sequence":e}),null===(i=null===(t=this.store)||void 0===t?void 0:t.state)||void 0===i?void 0:i.roles.filter((t=>t.sequence===e)).map((t=>o(s,null,t.email?o("div",{class:"recipient",style:{borderColor:k(g(n,t.name))},"data-rolename":t.name},o("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?R:T}),t.full_name," ",o("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})):o("div",{class:"recipient",style:{backgroundColor:k(g(n,t.name))},"data-rolename":t.name},o("span",{class:"type-icon",innerHTML:"signer"===t.type?S:"cc"===t.type?R:T}),t.name," ",o("div",{class:"settings-button",innerHTML:L,onClick:()=>this.showingRoleDialog=t.name,"aria-role":"button"})),o("div",{class:"dropzone","data-order":t.order+.5,"data-sequence":e})))),o("button",{class:"add-role",innerHTML:V,onClick:t=>this.handleAddRole(t,e)}))),this.sequences.length>0&&o("div",{class:"row add-sequence","data-sequence":e},o("div",{class:"row-roles"},o("div",{class:"icon",innerHTML:V}),o("div",{class:"dropzone","data-sequence":e+1,"data-order":1},"Add Step"))))})),o("div",{class:"row","data-sequence":this.sequences.length+1},o("div",{class:"row-roles"},o("div",{class:"icon",innerHTML:V}),o("button",{class:"add-step",innerHTML:V,onClick:e=>this.handleAddStep(e,this.sequences.length+1)}))),o("div",{class:"row"},o("div",{class:"icon",innerHTML:'<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" fill="#00000089"><path d="m18 7-1.41-1.41-6.34 6.34 1.41 1.41L18 7zm4.24-1.41L11.66 16.17 7.48 12l-1.41 1.41L11.66 19l12-12-1.42-1.41zM.41 13.41 6 19l1.41-1.41L1.83 12 .41 13.41z"></path></svg>'}),o("div",{class:"row-roles"},o("div",{class:"complete"},"Document Complete")))),n.length<1&&o("div",{class:"empty"},"You must add at least one Role before proceeding.",o("br",null)," Click the ",o("span",{innerHTML:V})," Add button above to get started."),o("div",{class:"buttons"},o("div",{class:"flex-fill"}),o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:()=>this.handleCancel()}),o("verdocs-button",{label:"OK",size:"small",onClick:()=>this.handleSubmit(),disabled:n.length<1}))),this.showingRoleDialog&&o("verdocs-template-role-properties",{endpoint:this.endpoint,templateId:this.templateId,roleName:this.showingRoleDialog,onClose:()=>{this.showingRoleDialog=null},onDelete:async()=>{var e,t;await b(this.endpoint,this.templateId,!0),this.renumberTemplateRoles(),this.showingRoleDialog=null,null===(e=this.templateUpdated)||void 0===e||e.emit({event:"deleted-role",endpoint:this.endpoint,template:null===(t=this.store)||void 0===t?void 0:t.state})}}),this.showingSenderDialog&&o("verdocs-template-sender",{endpoint:this.endpoint,templateId:this.templateId,onClose:()=>this.showingSenderDialog=!1}))}get el(){return l(this)}};_.style='verdocs-template-roles{display:block;min-width:400px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-roles>form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;padding:12px}verdocs-template-roles>form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 10px 0}verdocs-template-roles>form .participants{position:relative}verdocs-template-roles>form .left-line{top:32px;left:11px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-template-roles>form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:0;-moz-column-gap:0;column-gap:0;min-height:35px;margin-left:40px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:6px 0 4px 0}verdocs-template-roles>form .row .row-roles{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles>form .row .icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-template-roles>form .row .sender{height:30px;display:-ms-flexbox;display:flex;font-size:14px;line-height:30px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 15px;border:1px solid #c6c9cc;background-color:#f5f5fa}verdocs-template-roles>form .row .complete{height:30px;display:-ms-flexbox;display:flex;font-size:14px;padding:0 15px;line-height:30px;-ms-flex-direction:row;flex-direction:row;border-radius:30px;background-color:#f5f5fa;border:1px solid #aeb4bf}verdocs-template-roles>form .row .label{font-weight:bold;margin-right:6px;color:#33364b}verdocs-template-roles>form .row .settings-button{display:-ms-flexbox;display:flex;cursor:pointer;margin:0 0 0 9px}verdocs-template-roles>form .row .recipient{height:30px;display:-ms-flexbox;display:flex;font-size:14px;border-radius:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:0 5px 0 6px;white-space:nowrap;border:2px solid #aeb4bf}verdocs-template-roles>form .row .recipient .type-icon{width:24px;height:24px;-webkit-transform:scale(0.8);transform:scale(0.8);opacity:0.6;margin:0 12px 0 0}verdocs-template-roles>form .row .recipient.dragging{position:absolute}verdocs-template-roles>form .row .recipient.dragging+.dropzone{display:none !important}verdocs-template-roles>form .row .dropzone{width:14px;height:30px;display:none}verdocs-template-roles>form .row .dropzone svg{fill:#cccccc}verdocs-template-roles>form .row .dropzone.visible{margin:0 7px;display:-ms-flexbox;display:flex;-ms-flex:0 0 14px;flex:0 0 14px}verdocs-template-roles>form .row .dropzone.active{-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;background:#654dcb7f;border:1px dashed #654dcb}verdocs-template-roles>form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-template-roles>form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-roles>form input:focus{outline:none}verdocs-template-roles .row.add-sequence{display:none}verdocs-template-roles .add-role{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-role:hover{opacity:1}verdocs-template-roles .add-role svg{width:32px;height:32px}verdocs-template-roles .add-step{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-roles .add-step:hover{opacity:1}verdocs-template-roles .add-step svg{width:32px;height:32px}verdocs-template-roles.dragging .add-role{display:none}verdocs-template-roles.dragging form .row .recipient+.dropzone{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence{display:-ms-flexbox;display:flex}verdocs-template-roles.dragging .row.add-sequence .dropzone{opacity:0.5;-ms-flex:0 0 120px;flex:0 0 120px;border-radius:30px;-ms-flex-align:center;align-items:center;background:#654dcb7f;-ms-flex-pack:center;justify-content:center;border:1px dashed #654dcb}verdocs-template-roles.dragging .row.add-sequence .dropzone.active{opacity:1}verdocs-template-roles .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-roles .empty{font-size:13px;margin-top:15px;margin-bottom:5px}verdocs-template-roles .empty svg{width:20px;height:20px;stroke:#666666;margin-bottom:-5px}verdocs-template-roles ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-moz-placeholder{color:#aaaaaa}verdocs-template-roles :-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-roles ::placeholder{color:#aaaaaa}';export{Z as verdocs_template_create,z as verdocs_template_fields,_ as verdocs_template_roles}
|