@verdocs/web-sdk 1.12.0 → 1.12.1
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/verdocs-build.cjs.entry.js +1 -9
- package/dist/cjs/verdocs-send.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-create_2.cjs.entry.js +19 -10
- package/dist/collection/components/embeds/verdocs-build/verdocs-build.js +1 -9
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +1 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +19 -10
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.stories.js +2 -2
- package/dist/components/verdocs-build.js +1 -9
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-template-fields2.js +19 -10
- package/dist/docs.json +1 -1
- package/dist/esm/verdocs-build.entry.js +1 -9
- package/dist/esm/verdocs-send.entry.js +1 -1
- package/dist/esm/verdocs-template-create_2.entry.js +19 -10
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-create_2.entry.js +1 -1
- package/dist/types/components/embeds/verdocs-build/verdocs-build.d.ts +0 -2
- package/dist/typings.d.ts +4 -0
- package/dist/verdocs-web-sdk/{p-70a6176e.entry.js → p-07d519e8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-2ac6b090.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-3903c3c0.system.entry.js → p-619f9cc7.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-7e6d7c07.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-2a5c1eb7.entry.js → p-95171474.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-64841d89.system.entry.js → p-a2c3458c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-e897e87a.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/verdocs-web-sdk/p-75e8cb42.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-ecd33c4e.system.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-7239d28d.js";(()=>{const t=import.meta.url,d={};return""!==t&&(d.resourcesUrl=new URL(".",t).href),e(d)})().then((e=>t([["p-0bb87b59",[[0,"verdocs-template-roles",{endpoint:[16],templateId:[1,"template-id"],showingRoleDialog:[32],showingSenderDialog:[32],sender:[32],forceRerender:[32]}]]],["p-3bc39719",[[0,"verdocs-field-initial",{field:[16],disabled:[4],initials:[1],editable:[4],moveable:[4],done:[4],roleindex:[2],tempInitials:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-dfe6f5d9",[[0,"verdocs-field-signature",{field:[16],name:[1],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],tempSignature:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-70753fe7",[[0,"verdocs-field-checkbox",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-8b9175e2",[[0,"verdocs-field-date",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],containerId:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-5f286724",[[0,"verdocs-field-radio-button",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-005572ea",[[0,"verdocs-field-textarea",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-d50f2d73",[[0,"verdocs-field-textbox",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-de5574a9",[[0,"verdocs-field-timestamp",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-
|
|
1
|
+
import{p as e,b as t}from"./p-7239d28d.js";(()=>{const t=import.meta.url,d={};return""!==t&&(d.resourcesUrl=new URL(".",t).href),e(d)})().then((e=>t([["p-0bb87b59",[[0,"verdocs-template-roles",{endpoint:[16],templateId:[1,"template-id"],showingRoleDialog:[32],showingSenderDialog:[32],sender:[32],forceRerender:[32]}]]],["p-3bc39719",[[0,"verdocs-field-initial",{field:[16],disabled:[4],initials:[1],editable:[4],moveable:[4],done:[4],roleindex:[2],tempInitials:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-dfe6f5d9",[[0,"verdocs-field-signature",{field:[16],name:[1],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],tempSignature:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-70753fe7",[[0,"verdocs-field-checkbox",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-8b9175e2",[[0,"verdocs-field-date",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],containerId:[32],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-5f286724",[[0,"verdocs-field-radio-button",{field:[16],option:[2],disabled:[4],done:[4],roleindex:[2],editable:[4],moveable:[4],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-005572ea",[[0,"verdocs-field-textarea",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-d50f2d73",[[0,"verdocs-field-textbox",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-de5574a9",[[0,"verdocs-field-timestamp",{field:[16],disabled:[4],editable:[4],moveable:[4],done:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-95171474",[[0,"verdocs-build",{endpoint:[16],templateId:[1,"template-id"],step:[32],pdfUrl:[32],template:[32]}]]],["p-b367846e",[[0,"verdocs-sign",{envelopeId:[1,"envelope-id"],roleId:[1,"role-id"],inviteCode:[1,"invite-code"],recipient:[32],signerToken:[32],hasSignature:[32],nextButtonLabel:[32],nextSubmits:[32],errorMessage:[32],focusedField:[32],isDone:[32],showDone:[32],finishLater:[32],showFinishLater:[32],agreed:[32],documentsSingularPlural:[32]}]]],["p-062bd1d6",[[0,"verdocs-template-properties",{endpoint:[16],templateId:[1,"template-id"],template:[32],name:[32],visibility:[32],sendReminders:[32],firstReminderDays:[32],reminderDays:[32]}]]],["p-e8d924d2",[[0,"verdocs-template-reminders",{endpoint:[16],templateId:[1,"template-id"],showPlanBlocker:[32],sendReminders:[32],firstReminderDays:[32],reminderDays:[32],dirty:[32],loading:[32]}]]],["p-96d46a1e",[[0,"verdocs-template-name",{endpoint:[16],templateId:[1,"template-id"],name:[32],dirty:[32],loading:[32]}]]],["p-c11a681f",[[0,"verdocs-auth",{endpoint:[16],visible:[4],logo:[1],isAuthenticated:[32],displayMode:[32],username:[32],password:[32],loggingIn:[32],activeSession:[32],loginError:[32]}]]],["p-e1fb61bb",[[0,"verdocs-search",{endpoint:[16]}]]],["p-d0fc924d",[[0,"verdocs-initial-dialog",{initials:[1],fontLoaded:[32],enteredInitials:[32],mode:[32]}]]],["p-f75b2973",[[0,"verdocs-signature-dialog",{name:[1],fontLoaded:[32],enteredName:[32],mode:[32]}]]],["p-25c56686",[[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-07d519e8",[[0,"verdocs-send",{endpoint:[16],templateId:[1,"template-id"],containerId:[32],rolesAtLevel:[32],showPickerForId:[32],sessionContacts:[32],rolesCompleted:[32],reset:[64]}]]],["p-1e4e776b",[[0,"verdocs-template-visibility",{endpoint:[16],templateId:[1,"template-id"],dirty:[32],loading:[32],personal:[32],public:[32]}]]],["p-24266b55",[[0,"verdocs-field-attachment",{field:[16],disabled:[4],roleIndex:[2,"role-index"],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-295be949",[[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-af1eb1d8",[[0,"verdocs-loader"]]],["p-0d453b2f",[[0,"verdocs-preview",{endpoint:[16],templateId:[1,"template-id"]}]]],["p-717c36c3",[[0,"verdocs-template-attachments",{endpoint:[16],templateId:[1,"template-id"],loading:[32]}]]],["p-4340cdc2",[[0,"verdocs-envelope-sidebar",{endpoint:[16],envelopeId:[1,"envelope-id"],activeTab:[32],panelOpen:[32]}]]],["p-0031154e",[[0,"verdocs-floating-menu",{options:[16]}]]],["p-04ca7746",[[0,"verdocs-kba-dialog",{step:[2],steps:[2],helptitle:[1],helptext:[1],mode:[1],label:[1],placeholder:[1],choices:[16],response:[32]}]]],["p-f9b68c9c",[[0,"verdocs-field-dropdown",{field:[16],disabled:[4],roleindex:[2],focusField:[64],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-dac7b75d",[[0,"verdocs-field-payment",{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],roleindex:[2],preparedMessage:[32],signatureUrl:[32],showSettingsPanel:[64],hideSettingsPanel:[64]}]]],["p-f93d3324",[[0,"verdocs-organization-card",{organization:[16]}]]],["p-9f532d65",[[0,"verdocs-search-tabs",{selected:[32]}]]],["p-ab2ab46e",[[0,"verdocs-status-indicator",{size:[1],theme:[1],status:[1],envelope:[16],isOpen:[32],recipientStatusIcons:[32],containerId:[32]}]]],["p-140e1871",[[0,"verdocs-template-card",{template:[16]}]]],["p-7cb46b17",[[0,"verdocs-template-tags",{tags:[16]}]]],["p-d9aab909",[[0,"verdocs-toggle",{options:[16],theme:[1],selectedOption:[32]}]]],["p-0ccb837b",[[0,"verdocs-radio-button",{checked:[4],name:[1],value:[1],disabled:[4]}]]],["p-2b33748c",[[0,"verdocs-document-page",{pageImageUri:[1,"page-image-uri"],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]}],[0,"verdocs-dropdown",{options:[16],open:[32]}]]],["p-9a5570df",[[0,"verdocs-view",{endpoint:[16],envelopeId:[1,"envelope-id"]}]]],["p-fa977600",[[0,"verdocs-button",{label:[1],startIcon:[1,"start-icon"],endIcon:[1,"end-icon"],size:[1],type:[1],variant:[1],disabled:[4]}]]],["p-79b5b76f",[[0,"verdocs-upload-dialog",{draggingOver:[32],decodedFiles:[32]}]]],["p-833d6274",[[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-4cc43b69",[[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-2ac6b090",[[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]}]]],["p-facf681e",[[0,"verdocs-toggle-button",{active:[4],icon:[1],label:[1],size:[1],_active:[32]}]]],["p-607b66bb",[[0,"verdocs-ok-dialog",{heading:[1],message:[1],showCancel:[4,"show-cancel"]}]]],["p-c296f86f",[[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-e5c28d78",[[0,"verdocs-toolbar-icon",{text:[1],icon:[1],placement:[1],containerId:[32]}]]],["p-6af151f0",[[0,"verdocs-template-field-properties",{endpoint:[16],templateId:[1,"template-id"],fieldName:[1,"field-name"],dirty:[32],loading:[32],type:[32],name:[32],roleName:[32],required:[32],placeholder:[32],defaultValue:[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 +0,0 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as s}from"./p-7239d28d.js";import{c as o,g as a}from"./p-b28ef4bb.js";import{c as l}from"./p-1c02faba.js";import{V as r}from"./p-4e49fb12.js";import{S as n}from"./p-7a1b2643.js";import{i as d}from"./p-642b2f86.js";import{u as h,c as p}from"./p-feb442b1.js";import{a as c,r as m,e as g,f as v,h as f}from"./p-44930c58.js";import{s as x}from"./p-a8b01bb9.js";import{l as u}from"./p-35c46590.js";import"./p-21603661.js";import"./p-388b771c.js";import"./p-aa124212.js";import"./p-ab01f71e.js";import"./p-8b2040be.js";import"./p-7291906c.js";const w=class{constructor(i){e(this,i),this.exit=t(this,"exit",7),this.next=t(this,"next",7),this.sdkError=t(this,"sdkError",7),this.endpoint=r.getDefault(),this.file=void 0,this.creating=!1}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,i,s;if(e.stopPropagation(),console.log("Submitting"),this.file){this.creating=!0;try{const e=await o(this.endpoint,{name:this.file.name});console.log("[CREATE] Created template",e);const t=await l(this.endpoint,e.id,this.file);console.log("[CREATE] Created document",t);let i=null;const s=setInterval((async()=>{var o;console.log("[CREATE] Waiting for template to be processed...",t),i=await a(this.endpoint,e.id),(null==i?void 0:i.processed)&&(console.log("[CREATE] Retrieved new template",i),s&&clearInterval(s),null===(o=this.next)||void 0===o||o.emit(i),this.creating=!1)}),3e3)}catch(e){console.log("[CREATE] Error creating template",e),null===(t=this.sdkError)||void 0===t||t.emit(new n(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?i("form",{onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("input",{type:"file",id:"verdocs-template-create-file",multiple:!0,accept:"application/pdf",style:{display:"none"},onChange:e=>this.handleFileChanged(e)}),this.creating?i("div",{class:"loader-wrapper"},i("verdocs-loader",null),i("div",{class:"loading-text"},"Processing, please wait...")):i("div",{class:"upload-box"},i("div",null,i("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>'})),i("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),i("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?" ":"Or, if you prefer..."),i("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:e=>this.handleUpload(e)})),i("div",{class:"buttons"},i("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:e=>this.handleCancel(e),disabled:this.creating}),i("verdocs-button",{label:"Next",size:"small",onClick:e=>this.handleSubmit(e),disabled:!this.file||this.creating}))):i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}};w.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;padding:0 0 30px 0}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 b=[{id:"checkbox",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:"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:"dropdown",tooltip:"Dropdown",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 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:"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:"radio",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:"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:"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:"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:"timestamp",tooltip:"Timestamp",icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path fill="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>'}],q=class{constructor(i){e(this,i),this.sdkError=t(this,"sdkError",7),this.templateUpdated=t(this,"templateUpdated",7),this.pageHeights={},this.cachedPageInfo={},this.endpoint=r.getDefault(),this.templateId=null,this.toolbarTargetId=null,this.placing=null,this.selectedRoleName="",this.rerender=1}async componentWillLoad(){var e,t,i,s,o,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("[BUILD] Unable to start builder session, must be authenticated");try{console.log(`[FIELDS] Loading template ${this.templateId}`,this.endpoint.session),await u(this.endpoint,this.templateId,!0),this.selectedRoleName=x.roleNames[0],console.log("Starting with role",this.selectedRoleName)}catch(s){console.log("[FIELDS] Error loading template",s),null===(e=this.sdkError)||void 0===e||e.emit(new n(s.message,null===(t=s.response)||void 0===t?void 0:t.status,null===(i=s.response)||void 0===i?void 0:i.data))}}catch(e){console.log("[FIELDS] Error with preview session",e),null===(s=this.sdkError)||void 0===s||s.emit(new n(e.message,null===(o=e.response)||void 0===o?void 0:o.status,null===(a=e.response)||void 0===a?void 0:a.data))}}componentDidRender(){d.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,i){console.log("[FIELDS] handleFieldChange",e,t,i),this.rerender++}attachFieldAttributes(e,t,i,s){s.addEventListener("input",(e=>this.handleFieldChange(t,e))),s.addEventListener("settingsChanged",(()=>{var e;console.log("settings changed",this,t),s.setAttribute("roleindex",c(x.roleNames,t.role_name)),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:x.template,event:"updated-field"})})),s.addEventListener("deleted",(()=>{var e;console.log("deleted",this,t),s.remove(),this.rerender++,null===(e=this.templateUpdated)||void 0===e||e.emit({endpoint:this.endpoint,template:x.template,event:"updated-field"})})),s.setAttribute("roleindex",i),s.setAttribute("pageNumber",e.pageNumber),s.setAttribute("xScale",e.xScale),s.setAttribute("yScale",e.yScale),s.setAttribute("name",t.name)}handlePageRendered(e){const t=e.detail;console.log("[FIELDS] Page rendered",t.pageNumber,t),this.cachedPageInfo[t.pageNumber]=t,this.pageHeights[t.pageNumber]=t.naturalHeight,x.fields.filter((e=>e.page_sequence===t.pageNumber)).forEach((e=>{const i=c(x.roleNames,e.role_name),s=m(e,t,i,{disabled:!0,editable:!0,draggable:!0});s&&(Array.isArray(s)?s.map((s=>this.attachFieldAttributes(t,e,i,s))):this.attachFieldAttributes(t,e,i,s),d(s).draggable({listeners:{start(e){console.log("[FIELDS] Drag started",e.type,e.target)},move(e){const t=+(e.target.getAttribute("posX")||0),i=+(e.target.getAttribute("posY")||0),s=+(e.target.getAttribute("xScale")||1),o=+(e.target.getAttribute("yScale")||1),a=e.dx/s+t,l=e.dy/o+i;e.target.setAttribute("posX",a),e.target.setAttribute("posy",l),g(e.target,"translate",`${a}px, ${l}px`)},end:this.handleMoveField.bind(this)}}))}))}async handleMoveField(e){const t=e.target.getAttribute("pageNumber"),{naturalWidth:i=612,naturalHeight:s=792,renderedHeight:o=792}=this.cachedPageInfo[t];console.log("[FIELDS] Drag ended",t,e.target);const a=e.target.getBoundingClientRect(),l=e.target.parentElement.getBoundingClientRect(),r=Math.max(a.left-l.left,0),n=Math.max(o-(l.bottom-a.bottom),0),{x:d,y:p}=this.viewCoordinatesToPageCoordinates(r,n,t,i-e.rect.width,s-e.rect.height),c=e.target.getAttribute("name"),m=x.fields.find((e=>e.name===c));m&&(m.setting.x=d,m.setting.y=p,await h(this.endpoint,this.templateId,c,m),this.handlePageRendered({detail:this.cachedPageInfo[t]}))}generateFieldName(e,t){let i,s=1;do{i=`${e}P${t}-${s}`,s++}while(x.fields.some((e=>e.name===i)));return console.log("Field name",i),i}viewCoordinatesToPageCoordinates(e,t,i,s,o){const{xScale:a=1,yScale:l=1,renderedHeight:r=792}=this.cachedPageInfo[i];return{x:Math.floor(Math.min(e/a,s)),y:Math.floor(Math.min(Math.max(r-t,0)/l,o))}}async handleClickPage(e,t){var i;if(this.placing){console.log("Placing field",this.placing,t.sequence,e.offsetX,e.offsetY);const s=t.sequence,o=e.offsetX,a=e.offsetY,l=v(this.placing),r=f(this.placing),n=this.cachedPageInfo[s];console.log("Cached page",n);const{naturalWidth:d=612,naturalHeight:h=792}=n,{x:c,y:m}=this.viewCoordinatesToPageCoordinates(o,a,s,d-l,h-r),g={name:this.generateFieldName(this.placing,s),role_name:this.selectedRoleName,template_id:this.templateId,type:this.placing,required:!0,page_sequence:s,validator:null,setting:{x:c,y:m}};switch(g.type){case"attachment":case"payment":g.setting={x:c,y:m};break;case"initial":case"signature":g.setting={x:c,y:m,result:""};break;case"checkbox_group":g.setting={x:c,y:m,minimum_checked:0,maximum_checked:1e3};break;case"date":g.setting={x:c,y:m,width:l,height:r,result:""};break;case"dropdown":g.setting={x:c,y:m,width:l,height:r,value:"",placeholder:"Select a value"};break;case"radio_button_group":g.setting={x:c,y:m};break;case"textbox":g.setting={x:c,y:m,width:l,height:r,result:"",leading:0,alignment:0,upperCase:!1};break;case"timestamp":g.setting={x:c,y:m,width:l,height:r}}const u=await p(this.endpoint,this.templateId,g);console.log("Saved field",u),x.fields.push(u),this.placing=null,null===(i=this.templateUpdated)||void 0===i||i.emit({endpoint:this.endpoint,template:x.template,event:"added-field"}),this.handlePageRendered({detail:this.cachedPageInfo[s]})}}render(){if(!this.endpoint.session)return i(s,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}));if(x.loading||!x.template)return i(s,null,i("verdocs-loader",null));const e=[...x.template.pages];return e.sort(((e,t)=>e.sequence-t.sequence)),i(s,{class:this.placing?{[`placing-${this.placing}`]:!0}:{},"data-r":this.rerender,onSubmit:()=>{console.log("onSubmit")}},i("div",{id:"verdocs-template-fields-toolbar"},b.map((e=>i("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,onClick:()=>this.placing=e.id})))),i("div",{class:"pages"},e.map((e=>i("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"}]})))))}};q.style="verdocs-template-fields{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;position:relative}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;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}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{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 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-dropdown{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-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{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 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\") 0 14, pointer}";export{w as verdocs_template_create,q as verdocs_template_fields}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,s){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function r(e){try{a(s.next(e))}catch(e){i(e)}}function l(e){try{a(s["throw"](e))}catch(e){i(e)}}function a(e){e.done?n(e.value):o(e.value).then(r,l)}a((s=s.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},s,o,i,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return a([e,t])}}function a(r){if(s)throw new TypeError("Generator is already executing.");while(n)try{if(s=1,o&&(i=r[0]&2?o["return"]:r[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,r[1])).done)return i;if(o=0,i)r=[r[0]&2,i.value];switch(r[0]){case 0:case 1:i=r;break;case 4:n.label++;return{value:r[1],done:false};case 5:n.label++;o=r[1];r=[0];continue;case 7:r=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(r[0]===6||r[0]===2)){n=0;continue}if(r[0]===3&&(!i||r[1]>i[0]&&r[1]<i[3])){n.label=r[1];break}if(r[0]===6&&n.label<i[1]){n.label=i[1];i=r;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(r);break}if(i[2])n.ops.pop();n.trys.pop();continue}r=t.call(e,n)}catch(e){r=[6,e];o=0}finally{s=i=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-9422b807.system.js","./p-4f63fae0.system.js","./p-f0f99234.system.js","./p-187b20b7.system.js","./p-af2c2f79.system.js","./p-69912cbf.system.js","./p-03aeaebe.system.js","./p-71c7e1ba.system.js","./p-d50523fd.system.js"],(function(e){"use strict";var t,n,s,o,i,r,l;return{setters:[function(e){t=e.r;n=e.c;s=e.h;o=e.H},function(e){i=e.V},function(e){r=e.l},function(e){l=e.S},function(){},function(){},function(){},function(){},function(){}],execute:function(){var a='verdocs-build{display:-ms-flexbox;display:flex;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}';var c=e("verdocs_build",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.fields=[];this.endpoint=i.getDefault();this.templateId=null;this.step="create";this.pdfUrl=null;this.template=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n,s;return __generator(this,(function(o){switch(o.label){case 0:this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){console.log("[BUILD] No template ID specified, showing upload option");this.step="create";return[2]}o.label=1;case 1:o.trys.push([1,3,,4]);console.log("[BUILD] Loading template ".concat(this.templateId));return[4,r(this.endpoint,this.templateId)];case 2:o.sent();this.step="fields";return[3,4];case 3:s=o.sent();console.log("[BUILD] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(n=s.response)===null||n===void 0?void 0:n.data));return[3,4];case 4:return[2]}}))}))};e.prototype.handleCancel=function(e){console.log("Cancel",e.detail);this.step=""};e.prototype.handleTemplateCreated=function(e){console.log("Created",e.detail);this.step="fields"};e.prototype.handlePropertiesUpdated=function(e){console.log("updated",e.detail);this.step="recipients"};e.prototype.handleRecipientsUpdated=function(e){console.log("updated",e.detail);this.step="fields"};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return s(o,null,s("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return s(o,null,this.step==="create"&&s("verdocs-template-create",{onCancel:function(t){return e.handleCancel(t)},onNext:function(t){return e.handleTemplateCreated(t)}}),this.step==="fields"&&s("verdocs-template-fields",{onCancel:function(t){return e.handleCancel(t)},onNext:function(t){return e.handleCancel(t)}}))};return e}());c.style=a}}}));
|