@verdocs/web-sdk 6.10.6 → 6.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Environment-C3P2cz0J.js +14 -0
- package/dist/cjs/Environment-C3P2cz0J.js.map +1 -0
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +12 -14
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-document-page_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.css +2 -1
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +12 -14
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js.map +1 -1
- package/dist/collection/utils/Environment.js +4 -7
- package/dist/collection/utils/Environment.js.map +1 -1
- package/dist/components/{p-DCZz2B7h.js → p-6RWROB9R.js} +2 -2
- package/dist/components/p-6RWROB9R.js.map +1 -0
- package/dist/components/{p-i3o08M2d.js → p-B1UVXqFA.js} +2 -2
- package/dist/components/{p-C43B3SP_.js → p-BYVQkYYg.js} +2 -2
- package/dist/components/{p-zTcSNwsp.js → p-Ck4pdoyc.js} +2 -2
- package/dist/components/{p-DZa0rMk2.js → p-CsF979IT.js} +2 -2
- package/dist/components/{p-DiwfOWXt.js → p-DJMr11ue.js} +2 -2
- package/dist/components/p-DavVixMP.js +2 -0
- package/dist/components/p-DavVixMP.js.map +1 -0
- package/dist/components/{p-Dy2CRiH8.js → p-b2u0_wDk.js} +1 -1
- package/dist/components/p-b2u0_wDk.js.map +1 -0
- package/dist/components/verdocs-build.js +1 -1
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-delegate-dialog.js +1 -1
- package/dist/components/verdocs-otp-dialog.js +1 -1
- package/dist/components/verdocs-passcode-dialog.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-toolbar-icon.js +1 -1
- package/dist/esm/Environment-b2u0_wDk.js +12 -0
- package/dist/esm/Environment-b2u0_wDk.js.map +1 -0
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +12 -14
- package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/esm-es5/{Environment-Dy2CRiH8.js → Environment-b2u0_wDk.js} +1 -1
- package/dist/esm-es5/Environment-b2u0_wDk.js.map +1 -0
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js.map +1 -1
- package/dist/verdocs-web-sdk/{p-46e52384.system.entry.js → p-39c54b65.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-39c54b65.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-255e1915.entry.js → p-4e0788f9.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-4e0788f9.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-4aee15e6.entry.js → p-4e091415.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js → p-4ea0632f.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c6f52cd7.entry.js.map → p-4ea0632f.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-C96xjMgt.system.js → p-COHG5J4h.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-COHG5J4h.system.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-Dy2CRiH8.js → p-b2u0_wDk.js} +1 -1
- package/dist/verdocs-web-sdk/p-b2u0_wDk.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js → p-ba0d4ff5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-098b3852.system.entry.js.map → p-ba0d4ff5.system.entry.js.map} +1 -1
- package/dist/verdocs-web-sdk/{p-c3527f3e.system.entry.js → p-ceda04bc.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-1df29abb.entry.js → p-ee92c074.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e87a29a3.system.entry.js → p-fad90cf9.system.entry.js} +3 -3
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/Environment-CUCX3aWX.js +0 -17
- package/dist/cjs/Environment-CUCX3aWX.js.map +0 -1
- package/dist/components/p-CYqVJ_kJ.js +0 -2
- package/dist/components/p-CYqVJ_kJ.js.map +0 -1
- package/dist/components/p-DCZz2B7h.js.map +0 -1
- package/dist/components/p-Dy2CRiH8.js.map +0 -1
- package/dist/esm/Environment-Dy2CRiH8.js +0 -15
- package/dist/esm/Environment-Dy2CRiH8.js.map +0 -1
- package/dist/esm-es5/Environment-Dy2CRiH8.js.map +0 -1
- package/dist/verdocs-web-sdk/p-255e1915.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-46e52384.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-C96xjMgt.system.js.map +0 -1
- package/dist/verdocs-web-sdk/p-Dy2CRiH8.js.map +0 -1
- /package/dist/components/{p-i3o08M2d.js.map → p-B1UVXqFA.js.map} +0 -0
- /package/dist/components/{p-C43B3SP_.js.map → p-BYVQkYYg.js.map} +0 -0
- /package/dist/components/{p-zTcSNwsp.js.map → p-Ck4pdoyc.js.map} +0 -0
- /package/dist/components/{p-DZa0rMk2.js.map → p-CsF979IT.js.map} +0 -0
- /package/dist/components/{p-DiwfOWXt.js.map → p-DJMr11ue.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4aee15e6.entry.js.map → p-4e091415.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-c3527f3e.system.entry.js.map → p-ceda04bc.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-1df29abb.entry.js.map → p-ee92c074.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e87a29a3.system.entry.js.map → p-fad90cf9.system.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as s,h as o,d as i,F as l,t as a}from"./p-yZBlG3YQ.js";import{i as d}from"./p-COaijEV0.js";import{VerdocsEndpoint as r,getTemplate as n,updateField as c,createField as p,integerSequence as m}from"@verdocs/js-sdk";import{g as h,h as v,i as f,j as g,d as u,k as x}from"./p-BCwFpXpV.js";import{D as w}from"./p-BDv5kBUR.js";import{V as b}from"./p-D97GxsI-.js";import{S as k}from"./p-C1sRVZWv.js";import{S as E}from"./p-C7hFgM52.js";import{d as q}from"./p-C0SHIuoK.js";import{d as C}from"./p-DVx4efoX.js";import{d as Z}from"./p--jRXEN0c.js";import{d as V}from"./p-JGWMBIGy.js";import{d as M}from"./p-D1cSgqut.js";import{d as y}from"./p-K_PKw6bs.js";import{d as H}from"./p-DiYuPnJJ.js";import{d as j}from"./p-DKKsPZnz.js";import{d as S}from"./p-D-TexkaT.js";import{d as D}from"./p-D7oMWhqM.js";import{d as I}from"./p-BQUZjuoP.js";import{d as L}from"./p-DfIxVX8-.js";import{d as Q}from"./p-BELGzhZw.js";import{d as B}from"./p-bPe0_Dsn.js";import{d as z}from"./p-D9yawpPk.js";import{d as F}from"./p-CxIhMndz.js";import{d as T}from"./p-vimrvRye.js";import{d as P}from"./p-Dc3BDcaU.js";import{d as N}from"./p-CIgqf7hj.js";import{d as U}from"./p-u9H54zUE.js";import{d as Y}from"./p-CYvB5bYX.js";import{d as R}from"./p-BWrwPDuU.js";import{d as _}from"./p-BMGs9CCD.js";import{d as J}from"./p-CYqVJ_kJ.js";import{d as W}from"./p-LYpUmpqf.js";const X=()=>`verdocs-template-fields{font-family:var(--verdocs-primary-font, "Inter", "Barlow", 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 rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}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 .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-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}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}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 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{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 $='<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>';const K='<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>';const G='<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>';const O='<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>';const A='<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>';const ee='<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>';const te='<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>';const se='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';const oe='<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>';const ie=[{id:"signature",tooltip:"Signature",icon:A,class:"signature"},{id:"initial",tooltip:"Initials",icon:ee,class:"initial"},{id:"sep1",tooltip:"",icon:oe,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:$,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:K,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:G,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:te,class:"dropdown"},{id:"sep2",tooltip:"",icon:oe,class:"separator"},{id:"date",tooltip:"Date",icon:O,class:"date"},{id:"attachment",tooltip:"Attachment",icon:se,class:"attachment"}];const le=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=s(this,"sdkError");this.templateUpdated=s(this,"templateUpdated");this.templateListenerId=null;this.endpoint=r.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}onTemplateIdChanged(){this.listenToTemplate()}handleKeyDown(e){if(e.key==="Escape"){this.placing=null}}handleFieldSettingsChanged(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"updated-field"})}handleFieldDeleted(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"deleted-field"})}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[FIELDS] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(o){console.log("[FIELDS] Error with fields session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new k(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(s=o.response)===null||s===void 0?void 0:s.data))}}componentDidRender(){d.dynamicDrop(true);document.querySelectorAll(".verdocs-field").forEach((e=>{this.makeDraggable(e)}));const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;const t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){t.remove();e.append(t)}}componentWillUpdate(){var e,t;const s=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));if(!this.selectedRoleName||!s.find((e=>e&&e.name===this.selectedRoleName))){this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();E.subscribe("templates",this.templateId,(()=>n(this.endpoint,this.templateId)),false,(e=>{var t;console.log("Template updated");this.template=e;this.loading=false;if(!this.selectedRoleName){const s=[...e.roles||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||""}}))}unlistenToTemplate(){if(this.templateListenerId){E.store.delListener(this.templateListenerId);this.templateListenerId=null}}handlePageRendered(e){var t,s;var o,i;const l=e.detail;console.log("[FIELDS] Page rendered",l.documentId,l.pageNumber,l.xScale,l.yScale);(t=(o=this.cachedPageInfo)[i=l.documentId])!==null&&t!==void 0?t:o[i]={};this.cachedPageInfo[l.documentId][l.pageNumber]=l;this.pageHeights[l.pageNumber]=l.naturalHeight;(((s=this.template)===null||s===void 0?void 0:s.fields)||[]).filter((e=>e&&e.page===l.pageNumber)).forEach((e=>{const t=h(e);const s=document.getElementById(t);if(s){s.setAttribute("templateid",this.templateId);s.setAttribute("fieldname",e.name);s.setAttribute("documentid",String(e.document_id));s.setAttribute("pagenumber",String(e.page));s.setAttribute("xScale",String(l.xScale));s.setAttribute("yScale",String(l.yScale));this.makeDraggable(s)}}))}makeDraggable(e){d(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0);const s=+(e.target.getAttribute("posY")||0);const o=+(e.target.getAttribute("xScale")||1);const i=+(e.target.getAttribute("yScale")||1);const l=e.dx/o+t;const a=e.dy/i+s;e.target.setAttribute("posX",l);e.target.setAttribute("posy",a);v(e.target,"translate",`${l}px, ${a}px`)}async handleMoveEnd(e){var t,s,o,i,l,a,d,r;const n=e.target.getAttribute("fieldname");const p=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((e=>e.name===n));if(!p){console.log("[FIELDS] Unable to find field",n,e.target);return}const m=e.target.getAttribute("pagenumber");const h=e.target.getAttribute("documentid");let{naturalWidth:v=612,naturalHeight:w=792,renderedHeight:q=792}=this.cachedPageInfo[h][m];const C=e.target.getBoundingClientRect();const Z=e.target.parentElement;const V=Z.getBoundingClientRect();const M=p.width||x(p.type);const y=p.height||u(p.type);const H=Math.max(C.left-V.left,0);let j=Math.max(q-(V.bottom-C.bottom),0);let S=parseInt(m);if(j>q){S=Math.min(S+1,((i=(o=((s=this.template)===null||s===void 0?void 0:s.documents)||[])===null||o===void 0?void 0:o[0])===null||i===void 0?void 0:i.pages)||1);j-=q;q=this.cachedPageInfo[h][S].renderedHeight;console.log("Next page",{newPageNumber:S,newY:j,renderedHeight:q})}else if(j<0){S=Math.max(S-1,1);q=this.cachedPageInfo[h][S].renderedHeight;j+=q;console.log("[FIELDS] Next page",{newPageNumber:S,newY:j,renderedHeight:q})}const{x:D,y:I}=this.viewCoordinatesToPageCoordinates(H,j,h,m,v-M,w-y);try{const t={x:D,y:I,page:S};const s=await c(this.endpoint,this.templateId,n,t);console.log("[FIELDS] Updated",s);const o=JSON.parse(JSON.stringify(this.template));const i=o.fields.findIndex((e=>e.name===n));if(i>-1){o.fields[i]=s}E.updateTemplate(this.templateId,o);e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target);const{xScale:a=1,yScale:d=1}=this.cachedPageInfo[h][m];g(e.target,s,a,d);(l=this.templateUpdated)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,template:o,event:"updated-field"})}catch(t){b("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",t);(a=this.sdkError)===null||a===void 0?void 0:a.emit(new k(t.message,(d=t.response)===null||d===void 0?void 0:d.status,(r=t.response)===null||r===void 0?void 0:r.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target)}}generateFieldName(e,t){var s;let o=1;let i;do{i=`${e}P${t}-${o}`;o++}while((((s=this.template)===null||s===void 0?void 0:s.fields)||[]).some((e=>e&&e.name===i)));return i}viewCoordinatesToPageCoordinates(e,t,s,o,i,l){const{xScale:a=1,yScale:d=1,renderedHeight:r=792}=this.cachedPageInfo[s][o];const n=Math.floor(Math.min(e/a,i));const c=Math.floor(Math.min(Math.max(r-t,0)/d,l));return{x:n,y:c}}async handleClickPage(e,t,s){var o;if(this.placing){const i=e.offsetX;const l=e.offsetY;const a=x(this.placing);const d=u(this.placing);const r=this.cachedPageInfo[t][s];const{naturalWidth:n=612,naturalHeight:c=792}=r;const m=this.viewCoordinatesToPageCoordinates(i,l,t,s,n-a,c-d);const h=Math.floor(m.x);const v=Math.floor(m.y);const f={name:this.generateFieldName(this.placing,s),role_name:this.selectedRoleName,template_id:this.templateId,document_id:r.documentId,type:this.placing,required:this.placing!=="radio"&&this.placing!=="attachment"&&this.placing!=="checkbox",page:s,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:a,height:d,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};const g=await p(this.endpoint,this.templateId,f);console.log("[FIELDS] Created field",g);const w=JSON.parse(JSON.stringify(this.template));w.fields.push(g);E.updateTemplate(this.templateId,w);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:w,event:"added-field"});this.placing=null}}render(){var e,t,s;console.log("Rendering");if(this.loading){return o(i,null,o("verdocs-loader",null))}if(!this.endpoint.session){return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const a=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));const d=a.map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return o(i,{class:this.placing?{[`placing-${this.placing}`]:true}:{},onSubmit:()=>{}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:d,onInput:e=>this.selectedRoleName=e.target.value}),ie.map((e=>o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{if(e.tooltip){if(this.selectedRoleName){this.placing=e.id}else{this.showMustSelectRole=true}}}})))),o("div",{class:"pages"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((e=>{const t=m(1,e.pages);return t.map((t=>{var s;const i=e.page_sizes[t];return o(l,null,((s=this.template)===null||s===void 0?void 0:s.documents.length)>1&&o("div",{class:"document-separator"},o("div",{innerHTML:w}),o("span",null,e.name)),o("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:(i===null||i===void 0?void 0:i.width)||612,virtualHeight:(i===null||i===void 0?void 0:i.height)||792,disabled:true,editable:true,done:false,onClick:s=>this.handleClickPage(s,e.id,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))}))}))),this.showMustSelectRole&&o("verdocs-ok-dialog",{heading:"Unable to add field",message:(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=false}))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return X()}},[0,"verdocs-template-fields",{endpoint:[16],templateId:[1537,"template-id"],toolbarTargetId:[1,"toolbar-target-id"],placing:[32],showMustSelectRole:[32],selectedRoleName:[32],loading:[32],template:[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{templateId:[{onTemplateIdChanged:0}]}]);function ae(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-fields","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-document-page","verdocs-template-field-properties","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-template-fields":if(!customElements.get(a(e))){customElements.define(a(e),le)}break;case"verdocs-button":if(!customElements.get(a(e))){q()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){C()}break;case"verdocs-component-error":if(!customElements.get(a(e))){Z()}break;case"verdocs-dialog":if(!customElements.get(a(e))){V()}break;case"verdocs-field-attachment":if(!customElements.get(a(e))){M()}break;case"verdocs-field-checkbox":if(!customElements.get(a(e))){y()}break;case"verdocs-field-date":if(!customElements.get(a(e))){H()}break;case"verdocs-field-dropdown":if(!customElements.get(a(e))){j()}break;case"verdocs-field-initial":if(!customElements.get(a(e))){S()}break;case"verdocs-field-radio":if(!customElements.get(a(e))){D()}break;case"verdocs-field-signature":if(!customElements.get(a(e))){I()}break;case"verdocs-field-textarea":if(!customElements.get(a(e))){L()}break;case"verdocs-field-textbox":if(!customElements.get(a(e))){Q()}break;case"verdocs-field-timestamp":if(!customElements.get(a(e))){B()}break;case"verdocs-flag":if(!customElements.get(a(e))){z()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){F()}break;case"verdocs-loader":if(!customElements.get(a(e))){T()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){P()}break;case"verdocs-portal":if(!customElements.get(a(e))){N()}break;case"verdocs-select-input":if(!customElements.get(a(e))){U()}break;case"verdocs-template-document-page":if(!customElements.get(a(e))){Y()}break;case"verdocs-template-field-properties":if(!customElements.get(a(e))){R()}break;case"verdocs-text-input":if(!customElements.get(a(e))){_()}break;case"verdocs-toolbar-icon":if(!customElements.get(a(e))){J()}break;case"verdocs-upload-dialog":if(!customElements.get(a(e))){W()}break}}))}export{le as V,ae as d};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as t,c as s,h as o,d as i,F as l,t as a}from"./p-yZBlG3YQ.js";import{i as d}from"./p-COaijEV0.js";import{VerdocsEndpoint as r,getTemplate as n,updateField as c,createField as p,integerSequence as m}from"@verdocs/js-sdk";import{g as h,h as v,i as f,j as g,d as u,k as x}from"./p-BCwFpXpV.js";import{D as w}from"./p-BDv5kBUR.js";import{V as b}from"./p-D97GxsI-.js";import{S as k}from"./p-C1sRVZWv.js";import{S as E}from"./p-C7hFgM52.js";import{d as q}from"./p-C0SHIuoK.js";import{d as C}from"./p-DVx4efoX.js";import{d as Z}from"./p--jRXEN0c.js";import{d as V}from"./p-JGWMBIGy.js";import{d as M}from"./p-D1cSgqut.js";import{d as y}from"./p-K_PKw6bs.js";import{d as H}from"./p-DiYuPnJJ.js";import{d as j}from"./p-DKKsPZnz.js";import{d as D}from"./p-D-TexkaT.js";import{d as S}from"./p-D7oMWhqM.js";import{d as I}from"./p-BQUZjuoP.js";import{d as L}from"./p-DfIxVX8-.js";import{d as Q}from"./p-BELGzhZw.js";import{d as B}from"./p-bPe0_Dsn.js";import{d as z}from"./p-D9yawpPk.js";import{d as F}from"./p-CxIhMndz.js";import{d as P}from"./p-vimrvRye.js";import{d as T}from"./p-Dc3BDcaU.js";import{d as N}from"./p-CIgqf7hj.js";import{d as U}from"./p-u9H54zUE.js";import{d as R}from"./p-CYvB5bYX.js";import{d as Y}from"./p-BWrwPDuU.js";import{d as W}from"./p-BMGs9CCD.js";import{d as X}from"./p-DavVixMP.js";import{d as $}from"./p-LYpUmpqf.js";const _=()=>`verdocs-template-fields{font-family:var(--verdocs-primary-font, "Inter", "Barlow", 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 rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}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 .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-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}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}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 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{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 J='<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>';const K='<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>';const G='<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>';const O='<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>';const A='<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>';const ee='<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>';const te='<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>';const se='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';const oe='<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>';const ie=[{id:"signature",tooltip:"Signature",icon:A,class:"signature"},{id:"initial",tooltip:"Initials",icon:ee,class:"initial"},{id:"sep1",tooltip:"",icon:oe,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:J,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:K,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:G,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:te,class:"dropdown"},{id:"sep2",tooltip:"",icon:oe,class:"separator"},{id:"date",tooltip:"Date",icon:O,class:"date"},{id:"attachment",tooltip:"Attachment",icon:se,class:"attachment"}];const le=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=s(this,"sdkError");this.templateUpdated=s(this,"templateUpdated");this.templateListenerId=null;this.endpoint=r.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}onTemplateIdChanged(){this.listenToTemplate()}handleKeyDown(e){if(e.key==="Escape"){this.placing=null}}handleFieldSettingsChanged(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"updated-field"})}handleFieldDeleted(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"deleted-field"})}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[FIELDS] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(o){console.log("[FIELDS] Error with fields session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new k(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(s=o.response)===null||s===void 0?void 0:s.data))}}componentDidRender(){d.dynamicDrop(true);document.querySelectorAll(".verdocs-field").forEach((e=>{this.makeDraggable(e)}));const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;const t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){t.remove();e.append(t)}}componentWillUpdate(){var e,t;const s=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));if(!this.selectedRoleName||!s.find((e=>e&&e.name===this.selectedRoleName))){this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();E.subscribe("templates",this.templateId,(()=>n(this.endpoint,this.templateId)),false,(e=>{var t;console.log("Template updated");this.template=e;this.loading=false;if(!this.selectedRoleName){const s=[...e.roles||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||""}}))}unlistenToTemplate(){if(this.templateListenerId){E.store.delListener(this.templateListenerId);this.templateListenerId=null}}handlePageRendered(e){var t,s;var o,i;const l=e.detail;console.log("[FIELDS] Page rendered",l.documentId,l.pageNumber,l.xScale,l.yScale);(t=(o=this.cachedPageInfo)[i=l.documentId])!==null&&t!==void 0?t:o[i]={};this.cachedPageInfo[l.documentId][l.pageNumber]=l;this.pageHeights[l.pageNumber]=l.naturalHeight;(((s=this.template)===null||s===void 0?void 0:s.fields)||[]).filter((e=>e&&e.page===l.pageNumber)).forEach((e=>{const t=h(e);const s=document.getElementById(t);if(s){s.setAttribute("templateid",this.templateId);s.setAttribute("fieldname",e.name);s.setAttribute("documentid",String(e.document_id));s.setAttribute("pagenumber",String(e.page));s.setAttribute("xScale",String(l.xScale));s.setAttribute("yScale",String(l.yScale));this.makeDraggable(s)}}))}makeDraggable(e){d(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0);const s=+(e.target.getAttribute("posY")||0);const o=+(e.target.getAttribute("xScale")||1);const i=+(e.target.getAttribute("yScale")||1);const l=e.dx/o+t;const a=e.dy/i+s;e.target.setAttribute("posX",l);e.target.setAttribute("posy",a);v(e.target,"translate",`${l}px, ${a}px`)}async handleMoveEnd(e){var t,s,o,i,l,a,d,r;const n=e.target.getAttribute("fieldname");const p=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((e=>e.name===n));if(!p){console.log("[FIELDS] Unable to find field",n,e.target);return}const m=e.target.getAttribute("pagenumber");const h=e.target.getAttribute("documentid");let{naturalWidth:v=612,naturalHeight:w=792,renderedHeight:q=792}=this.cachedPageInfo[h][m];const C=e.target.getBoundingClientRect();const Z=e.target.parentElement;const V=Z.getBoundingClientRect();const M=p.width||x(p.type);const y=p.height||u(p.type);const H=Math.max(C.left-V.left,0);let j=Math.max(q-(V.bottom-C.bottom),0);let D=parseInt(m);if(j>q){D=Math.min(D+1,((i=(o=((s=this.template)===null||s===void 0?void 0:s.documents)||[])===null||o===void 0?void 0:o[0])===null||i===void 0?void 0:i.pages)||1);j-=q;q=this.cachedPageInfo[h][D].renderedHeight;console.log("Next page",{newPageNumber:D,newY:j,renderedHeight:q})}else if(j<0){D=Math.max(D-1,1);q=this.cachedPageInfo[h][D].renderedHeight;j+=q;console.log("[FIELDS] Next page",{newPageNumber:D,newY:j,renderedHeight:q})}const{x:S,y:I}=this.viewCoordinatesToPageCoordinates(H,j,h,m,v-M,w-y);try{const t={x:S,y:I,page:D};const s=await c(this.endpoint,this.templateId,n,t);console.log("[FIELDS] Updated",s);const o=JSON.parse(JSON.stringify(this.template));const i=o.fields.findIndex((e=>e.name===n));if(i>-1){o.fields[i]=s}E.updateTemplate(this.templateId,o);e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target);const{xScale:a=1,yScale:d=1}=this.cachedPageInfo[h][m];g(e.target,s,a,d);(l=this.templateUpdated)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,template:o,event:"updated-field"})}catch(t){b("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",t);(a=this.sdkError)===null||a===void 0?void 0:a.emit(new k(t.message,(d=t.response)===null||d===void 0?void 0:d.status,(r=t.response)===null||r===void 0?void 0:r.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target)}}generateFieldName(e,t){var s;let o=1;let i;do{i=`${e}P${t}-${o}`;o++}while((((s=this.template)===null||s===void 0?void 0:s.fields)||[]).some((e=>e&&e.name===i)));return i}viewCoordinatesToPageCoordinates(e,t,s,o,i,l){const{xScale:a=1,yScale:d=1,renderedHeight:r=792}=this.cachedPageInfo[s][o];const n=Math.floor(Math.min(e/a,i));const c=Math.floor(Math.min(Math.max(r-t,0)/d,l));return{x:n,y:c}}async handleClickPage(e,t,s){var o;if(this.placing){const i=e.offsetX;const l=e.offsetY;const a=x(this.placing);const d=u(this.placing);const r=this.cachedPageInfo[t][s];const{naturalWidth:n=612,naturalHeight:c=792}=r;const m=this.viewCoordinatesToPageCoordinates(i,l,t,s,n-a,c-d);const h=Math.floor(m.x);const v=Math.floor(m.y);const f={name:this.generateFieldName(this.placing,s),role_name:this.selectedRoleName,template_id:this.templateId,document_id:r.documentId,type:this.placing,required:this.placing!=="radio"&&this.placing!=="attachment"&&this.placing!=="checkbox",page:s,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:a,height:d,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};const g=await p(this.endpoint,this.templateId,f);console.log("[FIELDS] Created field",g);const w=JSON.parse(JSON.stringify(this.template));w.fields.push(g);E.updateTemplate(this.templateId,w);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:w,event:"added-field"});this.placing=null}}render(){var e,t,s;console.log("Rendering");if(this.loading){return o(i,null,o("verdocs-loader",null))}if(!this.endpoint.session){return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const a=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));const d=a.map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return o(i,{class:this.placing?{[`placing-${this.placing}`]:true}:{},onSubmit:()=>{}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:d,onInput:e=>this.selectedRoleName=e.target.value}),ie.map((e=>o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{if(e.tooltip){if(this.selectedRoleName){this.placing=e.id}else{this.showMustSelectRole=true}}}})))),o("div",{class:"pages"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((e=>{const t=m(1,e.pages);return t.map((t=>{var s;const i=e.page_sizes[t];return o(l,null,((s=this.template)===null||s===void 0?void 0:s.documents.length)>1&&o("div",{class:"document-separator"},o("div",{innerHTML:w}),o("span",null,e.name)),o("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:(i===null||i===void 0?void 0:i.width)||612,virtualHeight:(i===null||i===void 0?void 0:i.height)||792,disabled:true,editable:true,done:false,onClick:s=>this.handleClickPage(s,e.id,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))}))}))),this.showMustSelectRole&&o("verdocs-ok-dialog",{heading:"Unable to add field",message:(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=false}))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return _()}},[0,"verdocs-template-fields",{endpoint:[16],templateId:[1537,"template-id"],toolbarTargetId:[1,"toolbar-target-id"],placing:[32],showMustSelectRole:[32],selectedRoleName:[32],loading:[32],template:[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{templateId:[{onTemplateIdChanged:0}]}]);function ae(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-fields","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-document-page","verdocs-template-field-properties","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-template-fields":if(!customElements.get(a(e))){customElements.define(a(e),le)}break;case"verdocs-button":if(!customElements.get(a(e))){q()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){C()}break;case"verdocs-component-error":if(!customElements.get(a(e))){Z()}break;case"verdocs-dialog":if(!customElements.get(a(e))){V()}break;case"verdocs-field-attachment":if(!customElements.get(a(e))){M()}break;case"verdocs-field-checkbox":if(!customElements.get(a(e))){y()}break;case"verdocs-field-date":if(!customElements.get(a(e))){H()}break;case"verdocs-field-dropdown":if(!customElements.get(a(e))){j()}break;case"verdocs-field-initial":if(!customElements.get(a(e))){D()}break;case"verdocs-field-radio":if(!customElements.get(a(e))){S()}break;case"verdocs-field-signature":if(!customElements.get(a(e))){I()}break;case"verdocs-field-textarea":if(!customElements.get(a(e))){L()}break;case"verdocs-field-textbox":if(!customElements.get(a(e))){Q()}break;case"verdocs-field-timestamp":if(!customElements.get(a(e))){B()}break;case"verdocs-flag":if(!customElements.get(a(e))){z()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){F()}break;case"verdocs-loader":if(!customElements.get(a(e))){P()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){T()}break;case"verdocs-portal":if(!customElements.get(a(e))){N()}break;case"verdocs-select-input":if(!customElements.get(a(e))){U()}break;case"verdocs-template-document-page":if(!customElements.get(a(e))){R()}break;case"verdocs-template-field-properties":if(!customElements.get(a(e))){Y()}break;case"verdocs-text-input":if(!customElements.get(a(e))){W()}break;case"verdocs-toolbar-icon":if(!customElements.get(a(e))){X()}break;case"verdocs-upload-dialog":if(!customElements.get(a(e))){$()}break}}))}export{le as V,ae as d};
|
|
2
|
+
//# sourceMappingURL=p-BYVQkYYg.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as i,d as o,t as n}from"./p-yZBlG3YQ.js";import{getTemplate as l,getOrganizationContacts as r,isValidEmail as d,createEnvelope as a,formatFullName as c,getRGBA as p}from"@verdocs/js-sdk";import{D as h}from"./p-Dy2CRiH8.js";import{V as v}from"./p-D97GxsI-.js";import{S as m}from"./p-C1sRVZWv.js";import{S as f}from"./p-C7hFgM52.js";import{d as u}from"./p-C0SHIuoK.js";import{d as x}from"./p-DVx4efoX.js";import{d as b}from"./p--jRXEN0c.js";import{d as g}from"./p-DCZz2B7h.js";import{d as w}from"./p-D9yawpPk.js";import{d as k}from"./p-vimrvRye.js";import{d as S}from"./p-CIgqf7hj.js";import{d as E}from"./p-CoeB7U-_.js";const C=e=>((e===null||e===void 0?void 0:e.roles)||[]).map((e=>e.name));const y=(e,s)=>Math.max(C(e).findIndex((e=>e===s)),0);const D=()=>`verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid rgba(151, 151, 151, 0.2666666667)}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:rgba(0, 0, 0, 0.537254902)}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-send .buttons .error-message{width:100%;color:#cc0000;font-size:13px;margin-bottom:10px}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}`;const z='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';const j='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><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>';const N='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><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>';const I='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><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>';const _=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.beforeSend=t(this,"beforeSend");this.send=t(this,"send");this.exit=t(this,"exit");this.sdkError=t(this,"sdkError");this.searchContacts=t(this,"searchContacts");this.templateListenerId=null;this.endpoint=h;this.templateId=null;this.environment="";this.showCancel=true;this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`;this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={};this.loading=true;this.template=null}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();f.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),true,(e=>{console.log("[SEND] Got new template",e);this.template=e;this.loading=false;this.rolesCompleted={};this.recomputeRolesCompleted()}))}unlistenToTemplate(){if(this.templateListenerId){f.store.delListener(this.templateListenerId);this.templateListenerId=null}}async reset(){this.rolesCompleted={}}onTemplateIdChanged(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()}async componentWillLoad(){var e,s,t;try{this.endpoint.onSessionChanged(((e,s,t)=>{if(!t){return}const i={id:t.id,first_name:t.first_name,last_name:t.last_name,email:t.email,phone:t.phone};if(t){this.sessionContacts=[i];r(this.endpoint).then((e=>{console.log("[SEND] Got contacts",e);this.sessionContacts=[...e,i]})).catch((e=>{console.log("[SEND] Error getting contacts",e)}))}}));this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SEND] Unable to start Send operation, must be authenticated");return}if(!this.templateId){console.log(`[SEND] Missing required template ID ${this.templateId}`);return}this.listenToTemplate()}catch(i){console.log("[SEND] Error with send session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(i.message,(s=i.response)===null||s===void 0?void 0:s.status,(t=i.response)===null||t===void 0?void 0:t.data))}}recomputeRolesCompleted(){var e;this.rolesCompleted={};const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{const t=e.sequence;s[t]||(s[t]=[]);const i=`r-${t}-${s[t].length}`;s[t].push({...e,id:i,role_name:e.name,first_name:e.first_name,last_name:e.last_name});if(e.first_name&&d(e.email)){this.rolesCompleted[i]={...e,id:i,role_name:e.name,first_name:e.first_name,last_name:e.last_name}}}))}getSequenceNumbers(){var e;const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{s[e.sequence]=true}));return Object.keys(s).map((e=>+e)).sort(((e,s)=>e-s))}getRolesAtLevel(e){var s;const t=(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).filter((s=>s.sequence===e)).map(((s,t)=>({...s,id:`r-${e}-${t}`,role_name:s.name,first_name:s.first_name,last_name:s.last_name})));return t}getLevelIcon(e){if(e==="start"){return i("div",{class:"level-icon",innerHTML:j})}else if(e==="end"){return i("div",{class:"level-icon",innerHTML:I})}else{return i("div",{class:"level-icon",innerHTML:N})}}handleSelectContact(e,s){e.preventDefault();this.rolesCompleted[s.id]={...s,...e.detail};this.showPickerForId=""}handleClickRole(e,s){e.stopPropagation();this.showPickerForId=s.id}handleSend(e){var s;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;const t=Intl.DateTimeFormat().resolvedOptions();const i={template_id:this.templateId,name:((s=this.template)===null||s===void 0?void 0:s.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),timezone:t.timeZone,locale:t.locale};const o=this.beforeSend.emit({...i,name:i.name,template:this.template});if(o.defaultPrevented){console.log("[SEND] Send cancelled by parent",i);this.sending=false;return}console.log("[SEND] Creating envelope",i);a(this.endpoint,i).then((e=>{var s;console.log("[SEND] Send envelope",e);this.reset().catch((e=>console.log("Unknown Error",e)));this.sending=false;(s=this.send)===null||s===void 0?void 0:s.emit({...i,name:i.name,envelope_id:e.id,envelope:e})})).catch((e=>{var s,t,i;console.log("[SEND] Send error",e);v(((t=(s=e.response)===null||s===void 0?void 0:s.data)===null||t===void 0?void 0:t.error)||"Error creating envelope, please try again later.");this.sending=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(e)}))}handleCancel(e){var s;e.stopPropagation();(s=this.exit)===null||s===void 0?void 0:s.emit()}render(){var e;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const s=this.getSequenceNumbers();const t=Object.values(this.rolesCompleted).filter((e=>d(e.email)&&e.first_name&&e.last_name));const n=t.length>=C(this.template).length;const l=t.map((e=>e.email.toLowerCase()));const r=new Set(l).size<l.length;return i(o,{class:{sendable:(e=this.template)===null||e===void 0?void 0:e.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:`level level-start`},this.getLevelIcon("start"),i("div",{class:"complete"},"Send Envelope")),s.map((e=>i("div",{class:`level level-${e}`},this.getLevelIcon("sequence"),this.getRolesAtLevel(e).map((e=>{var s,o,n;const l=!e.email||!e.first_name||!e.last_name;const r=((s=this.rolesCompleted[e.id])===null||s===void 0?void 0:s.first_name)?c(this.rolesCompleted[e.id]):l?e.role_name:c(e);const d=`verdocs-send-recipient-${e.role_name}`;const a=y(this.template,e.role_name);const h=p(a);const v=t.findIndex((s=>s.role_name===e.role_name))>-1;const m={backgroundColor:h,border:v?"2px solid #55bc81":"2px solid #dddddd"};return l?i("div",{class:"recipient","data-ri":a,"data-rn":e.role_name,style:m,onClick:s=>this.handleClickRole(s,e),id:d},r,i("div",{class:"icon",innerHTML:z}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:d,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:s=>this.handleSelectContact(s,e),contactSuggestions:this.sessionContacts,templateRole:(o=this.rolesCompleted[e.id])!==null&&o!==void 0?o:e,onSearchContacts:e=>{var s;return(s=this.searchContacts)===null||s===void 0?void 0:s.emit(e.detail)}}))):i("div",{class:"recipient","data-ri":a,"data-rn":e.role_name,style:m,onClick:s=>this.handleClickRole(s,e),id:d},r,i("div",{class:"icon",innerHTML:z}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:d,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:s=>this.handleSelectContact(s,e),contactSuggestions:this.sessionContacts,templateRole:(n=this.rolesCompleted[e.id])!==null&&n!==void 0?n:e,onSearchContacts:e=>{var s;return(s=this.searchContacts)===null||s===void 0?void 0:s.emit(e.detail)}})))}))))),i("div",{class:`level level-done`},this.getLevelIcon("end"),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},r&&i("div",{class:"error-message"},"Recipients cannot share the same email."),this.showCancel&&i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!n||this.sending||r,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return D()}},[0,"verdocs-send",{endpoint:[16],templateId:[513,"template-id"],environment:[1],showCancel:[4,"show-cancel"],containerId:[32],showPickerForId:[32],sessionContacts:[32],sending:[32],rolesCompleted:[32],loading:[32],template:[32],reset:[64]},undefined,{templateId:[{onTemplateIdChanged:0}]}]);function L(){if(typeof customElements==="undefined"){return}const e=["verdocs-send","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-flag","verdocs-loader","verdocs-portal","verdocs-spinner"];e.forEach((e=>{switch(e){case"verdocs-send":if(!customElements.get(n(e))){customElements.define(n(e),_)}break;case"verdocs-button":if(!customElements.get(n(e))){u()}break;case"verdocs-checkbox":if(!customElements.get(n(e))){x()}break;case"verdocs-component-error":if(!customElements.get(n(e))){b()}break;case"verdocs-contact-picker":if(!customElements.get(n(e))){g()}break;case"verdocs-flag":if(!customElements.get(n(e))){w()}break;case"verdocs-loader":if(!customElements.get(n(e))){k()}break;case"verdocs-portal":if(!customElements.get(n(e))){S()}break;case"verdocs-spinner":if(!customElements.get(n(e))){E()}break}}))}export{_ as V,L as d};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as s,c as t,h as i,d as o,t as n}from"./p-yZBlG3YQ.js";import{getTemplate as l,getOrganizationContacts as r,isValidEmail as d,createEnvelope as a,formatFullName as c,getRGBA as p}from"@verdocs/js-sdk";import{D as h}from"./p-b2u0_wDk.js";import{V as v}from"./p-D97GxsI-.js";import{S as m}from"./p-C1sRVZWv.js";import{S as f}from"./p-C7hFgM52.js";import{d as u}from"./p-C0SHIuoK.js";import{d as x}from"./p-DVx4efoX.js";import{d as b}from"./p--jRXEN0c.js";import{d as g}from"./p-6RWROB9R.js";import{d as w}from"./p-D9yawpPk.js";import{d as k}from"./p-vimrvRye.js";import{d as S}from"./p-CIgqf7hj.js";import{d as E}from"./p-CoeB7U-_.js";const C=e=>((e===null||e===void 0?void 0:e.roles)||[]).map((e=>e.name));const y=(e,s)=>Math.max(C(e).findIndex((e=>e===s)),0);const D=()=>`verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-send.sendable{display:-ms-flexbox;display:flex}verdocs-send .recipients{position:relative}verdocs-send .left-line{top:32px;left:20px;z-index:1;width:12px;bottom:30px;position:absolute;background:#ffffff;border-left:3px dotted #9b9b9b}verdocs-send .level{display:-ms-flexbox;display:flex;-webkit-column-gap:10px;-moz-column-gap:10px;column-gap:10px;margin-left:50px;position:relative;-ms-flex-direction:row;flex-direction:row;padding:8px 0 4px 0;border-bottom:1px solid rgba(151, 151, 151, 0.2666666667)}verdocs-send .level .level-icon{top:14px;z-index:2;left:-40px;width:24px;height:24px;position:absolute;background:#ffffff}verdocs-send .level .level-icon svg{fill:rgba(0, 0, 0, 0.537254902)}verdocs-send .level .recipient{height:30px;display:-ms-flexbox;display:flex;-ms-flex:0 0 30px;flex:0 0 30px;color:#000000;cursor:pointer;font-size:14px;-ms-flex-align:center;align-items:center;border-radius:30px;-ms-flex-direction:row;flex-direction:row;background:#dddddd;white-space:nowrap;border:2px solid #dddddd;padding:2px 10px 2px 14px}verdocs-send .level .recipient .icon{width:22px;height:22px;-ms-flex:0 0 22px;flex:0 0 22px;margin:0 0 0 10px}verdocs-send .level .recipient .icon svg{width:22px;height:22px;fill:#333333;outline:none}verdocs-send .level .complete{-ms-flex:1;flex:1;height:30px;display:-ms-flexbox;display:flex;color:#000000;font-size:14px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:3px 10px 3px 2px}verdocs-send .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}verdocs-send .buttons .error-message{width:100%;color:#cc0000;font-size:13px;margin-bottom:10px}verdocs-send verdocs-contact-picker{left:0;top:41px;z-index:10;position:absolute;border:1px solid #dddddd;-webkit-box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1);box-shadow:0 0 6px 3px rgba(0, 0, 0, 0.1)}`;const z='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34a.9959.9959 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"></path></svg>';const j='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><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>';const N='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><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>';const _='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24" tabindex="-1"><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>';const I=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.beforeSend=t(this,"beforeSend");this.send=t(this,"send");this.exit=t(this,"exit");this.sdkError=t(this,"sdkError");this.searchContacts=t(this,"searchContacts");this.templateListenerId=null;this.endpoint=h;this.templateId=null;this.environment="";this.showCancel=true;this.containerId=`verdocs-send-${Math.random().toString(36).substring(2,11)}`;this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={};this.loading=true;this.template=null}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){console.log("[SEND] Loading template",this.templateId);this.unlistenToTemplate();f.subscribe("templates",this.templateId,(()=>l(this.endpoint,this.templateId)),true,(e=>{console.log("[SEND] Got new template",e);this.template=e;this.loading=false;this.rolesCompleted={};this.recomputeRolesCompleted()}))}unlistenToTemplate(){if(this.templateListenerId){f.store.delListener(this.templateListenerId);this.templateListenerId=null}}async reset(){this.rolesCompleted={}}onTemplateIdChanged(e){console.log("[SEND] Template ID changed",e);this.listenToTemplate()}async componentWillLoad(){var e,s,t;try{this.endpoint.onSessionChanged(((e,s,t)=>{if(!t){return}const i={id:t.id,first_name:t.first_name,last_name:t.last_name,email:t.email,phone:t.phone};if(t){this.sessionContacts=[i];r(this.endpoint).then((e=>{console.log("[SEND] Got contacts",e);this.sessionContacts=[...e,i]})).catch((e=>{console.log("[SEND] Error getting contacts",e)}))}}));this.endpoint.loadSession();if(!this.endpoint.session){console.log("[SEND] Unable to start Send operation, must be authenticated");return}if(!this.templateId){console.log(`[SEND] Missing required template ID ${this.templateId}`);return}this.listenToTemplate()}catch(i){console.log("[SEND] Error with send session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(i.message,(s=i.response)===null||s===void 0?void 0:s.status,(t=i.response)===null||t===void 0?void 0:t.data))}}recomputeRolesCompleted(){var e;this.rolesCompleted={};const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{const t=e.sequence;s[t]||(s[t]=[]);const i=`r-${t}-${s[t].length}`;s[t].push({...e,id:i,role_name:e.name,first_name:e.first_name,last_name:e.last_name});if(e.first_name&&d(e.email)){this.rolesCompleted[i]={...e,id:i,role_name:e.name,first_name:e.first_name,last_name:e.last_name}}}))}getSequenceNumbers(){var e;const s={};(((e=this.template)===null||e===void 0?void 0:e.roles)||[]).forEach((e=>{s[e.sequence]=true}));return Object.keys(s).map((e=>+e)).sort(((e,s)=>e-s))}getRolesAtLevel(e){var s;const t=(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).filter((s=>s.sequence===e)).map(((s,t)=>({...s,id:`r-${e}-${t}`,role_name:s.name,first_name:s.first_name,last_name:s.last_name})));return t}getLevelIcon(e){if(e==="start"){return i("div",{class:"level-icon",innerHTML:j})}else if(e==="end"){return i("div",{class:"level-icon",innerHTML:_})}else{return i("div",{class:"level-icon",innerHTML:N})}}handleSelectContact(e,s){e.preventDefault();this.rolesCompleted[s.id]={...s,...e.detail};this.showPickerForId=""}handleClickRole(e,s){e.stopPropagation();this.showPickerForId=s.id}handleSend(e){var s;if(this.sending){console.log("[SEND] Skipping duplicate send",e);return}console.log("[SEND] Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;const t=Intl.DateTimeFormat().resolvedOptions();const i={template_id:this.templateId,name:((s=this.template)===null||s===void 0?void 0:s.name)||"New Envelope",environment:this.environment,initial_reminder:0,followup_reminders:0,recipients:Object.values(this.rolesCompleted),timezone:t.timeZone,locale:t.locale};const o=this.beforeSend.emit({...i,name:i.name,template:this.template});if(o.defaultPrevented){console.log("[SEND] Send cancelled by parent",i);this.sending=false;return}console.log("[SEND] Creating envelope",i);a(this.endpoint,i).then((e=>{var s;console.log("[SEND] Send envelope",e);this.reset().catch((e=>console.log("Unknown Error",e)));this.sending=false;(s=this.send)===null||s===void 0?void 0:s.emit({...i,name:i.name,envelope_id:e.id,envelope:e})})).catch((e=>{var s,t,i;console.log("[SEND] Send error",e);v(((t=(s=e.response)===null||s===void 0?void 0:s.data)===null||t===void 0?void 0:t.error)||"Error creating envelope, please try again later.");this.sending=false;(i=this.sdkError)===null||i===void 0?void 0:i.emit(e)}))}handleCancel(e){var s;e.stopPropagation();(s=this.exit)===null||s===void 0?void 0:s.emit()}render(){var e;if(this.loading){return i(o,null,i("verdocs-loader",null))}if(!this.endpoint.session){return i(o,{style:{display:"flex"}},i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const s=this.getSequenceNumbers();const t=Object.values(this.rolesCompleted).filter((e=>d(e.email)&&e.first_name&&e.last_name));const n=t.length>=C(this.template).length;const l=t.map((e=>e.email.toLowerCase()));const r=new Set(l).size<l.length;return i(o,{class:{sendable:(e=this.template)===null||e===void 0?void 0:e.is_sendable}},i("div",{class:"recipients"},i("div",{class:"left-line"}),i("div",{class:`level level-start`},this.getLevelIcon("start"),i("div",{class:"complete"},"Send Envelope")),s.map((e=>i("div",{class:`level level-${e}`},this.getLevelIcon("sequence"),this.getRolesAtLevel(e).map((e=>{var s,o,n;const l=!e.email||!e.first_name||!e.last_name;const r=((s=this.rolesCompleted[e.id])===null||s===void 0?void 0:s.first_name)?c(this.rolesCompleted[e.id]):l?e.role_name:c(e);const d=`verdocs-send-recipient-${e.role_name}`;const a=y(this.template,e.role_name);const h=p(a);const v=t.findIndex((s=>s.role_name===e.role_name))>-1;const m={backgroundColor:h,border:v?"2px solid #55bc81":"2px solid #dddddd"};return l?i("div",{class:"recipient","data-ri":a,"data-rn":e.role_name,style:m,onClick:s=>this.handleClickRole(s,e),id:d},r,i("div",{class:"icon",innerHTML:z}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:d,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:s=>this.handleSelectContact(s,e),contactSuggestions:this.sessionContacts,templateRole:(o=this.rolesCompleted[e.id])!==null&&o!==void 0?o:e,onSearchContacts:e=>{var s;return(s=this.searchContacts)===null||s===void 0?void 0:s.emit(e.detail)}}))):i("div",{class:"recipient","data-ri":a,"data-rn":e.role_name,style:m,onClick:s=>this.handleClickRole(s,e),id:d},r,i("div",{class:"icon",innerHTML:z}),this.showPickerForId===e.id&&i("verdocs-portal",{anchor:d,onClickAway:()=>this.showPickerForId=""},i("verdocs-contact-picker",{onExit:()=>this.showPickerForId="",onNext:s=>this.handleSelectContact(s,e),contactSuggestions:this.sessionContacts,templateRole:(n=this.rolesCompleted[e.id])!==null&&n!==void 0?n:e,onSearchContacts:e=>{var s;return(s=this.searchContacts)===null||s===void 0?void 0:s.emit(e.detail)}})))}))))),i("div",{class:`level level-done`},this.getLevelIcon("end"),i("div",{class:"complete"},"Signing Complete"))),i("div",{class:"buttons"},r&&i("div",{class:"error-message"},"Recipients cannot share the same email."),this.showCancel&&i("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:e=>this.handleCancel(e),disabled:this.sending}),i("verdocs-button",{label:"Send",size:"small",disabled:!n||this.sending||r,onClick:e=>this.handleSend(e)}),this.sending&&i("verdocs-spinner",null)))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return D()}},[0,"verdocs-send",{endpoint:[16],templateId:[513,"template-id"],environment:[1],showCancel:[4,"show-cancel"],containerId:[32],showPickerForId:[32],sessionContacts:[32],sending:[32],rolesCompleted:[32],loading:[32],template:[32],reset:[64]},undefined,{templateId:[{onTemplateIdChanged:0}]}]);function L(){if(typeof customElements==="undefined"){return}const e=["verdocs-send","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-flag","verdocs-loader","verdocs-portal","verdocs-spinner"];e.forEach((e=>{switch(e){case"verdocs-send":if(!customElements.get(n(e))){customElements.define(n(e),I)}break;case"verdocs-button":if(!customElements.get(n(e))){u()}break;case"verdocs-checkbox":if(!customElements.get(n(e))){x()}break;case"verdocs-component-error":if(!customElements.get(n(e))){b()}break;case"verdocs-contact-picker":if(!customElements.get(n(e))){g()}break;case"verdocs-flag":if(!customElements.get(n(e))){w()}break;case"verdocs-loader":if(!customElements.get(n(e))){k()}break;case"verdocs-portal":if(!customElements.get(n(e))){S()}break;case"verdocs-spinner":if(!customElements.get(n(e))){E()}break}}))}export{I as V,L as d};
|
|
2
|
+
//# sourceMappingURL=p-Ck4pdoyc.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as o,h as s,d as i,t as d}from"./p-yZBlG3YQ.js";import{verifySigner as a}from"@verdocs/js-sdk";import{D as c}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as t,c as o,h as s,d as i,t as d}from"./p-yZBlG3YQ.js";import{verifySigner as a}from"@verdocs/js-sdk";import{D as c}from"./p-b2u0_wDk.js";import{V as n}from"./p-D97GxsI-.js";import{d as l}from"./p-C0SHIuoK.js";import{d as r}from"./p-JGWMBIGy.js";import{d as f}from"./p-CxIhMndz.js";import{d as b}from"./p-BMGs9CCD.js";const p=()=>`verdocs-otp-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-otp-dialog .heading{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}verdocs-otp-dialog .heading .title{font-size:20px;font-weight:500}verdocs-otp-dialog .step{margin-left:6px;color:#666}verdocs-otp-dialog .help-box{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;padding:0;-ms-flex-align:center;align-items:center;color:black;margin-bottom:20px}verdocs-otp-dialog .help-details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin-left:0;font-size:14px;gap:5px}verdocs-otp-dialog .help-title{font-weight:600;margin-bottom:4px}verdocs-otp-dialog .help-text{font-weight:400}verdocs-otp-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end;width:100%}verdocs-otp-dialog .buttons verdocs-button{margin-left:16px}`;const h=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.exit=o(this,"exit");this.next=o(this,"next");this.resendTimeout=null;this.endpoint=c;this.method="email";this.resendDisabled=true;this.response=""}componentDidLoad(){this.startResendTimeout();setTimeout((()=>{a(this.endpoint,{auth_method:this.method,code:"",resend:true}).then((e=>{console.log("Resend result",e);this.response=""})).catch((e=>console.log("Error resending code",e)))}),1e3)}disconnectedCallback(){if(this.resendTimeout){clearTimeout(this.resendTimeout);this.resendTimeout=null}}handleCancel(){this.exit.emit()}startResendTimeout(){this.resendDisabled=true;if(this.resendTimeout){clearTimeout(this.resendTimeout)}this.resendTimeout=setTimeout((()=>{this.resendDisabled=false}),3e4)}handleResend(){this.startResendTimeout();a(this.endpoint,{auth_method:this.method,code:"",resend:true}).then((e=>{console.log("Resend result",e);this.response="";n("A new code has been sent.")})).catch((e=>console.log("Error resending code",e)))}handleSubmit(){this.startResendTimeout();a(this.endpoint,{auth_method:this.method,code:this.response}).then((e=>{console.log("Verification completed",e);this.next.emit({response:e});n("Thank you. Your verification was successful.")})).catch((e=>{n("Invalid verification code. Please try again.");console.log("Invalid code",e)}));this.response=""}render(){return s(i,{key:"dd49120f21d193dc254648d7285bdae58d8b720e"},s("verdocs-dialog",{key:"2052eee544c96b16d02e2bd2b1ba6b9527397d74",persistent:true,onExit:()=>this.handleCancel()},s("div",{key:"68facdc18ef1a6da0796646bdbbabe1567ebdf48",slot:"heading",class:"heading"},s("div",{key:"23d9eb1057aa9f445ccfaf5642c77799c36b7a67",class:"title"},"Verification Required")),s("div",{key:"f6e2d79a28411743a1b48573d120f4cd986656d8",slot:"content",class:"content"},s("div",{key:"8829db746c90efd5c23e1be5f1950f8e6b383582",class:"help-box"},s("div",{key:"9e27a36bb704f789f2dc6a1d612a066ba48cda2e",class:"help-details"},s("div",{key:"c34a9c354f58466690bd77436a1bb105f25f6d04",class:"help-text"},"Please check your messages for a one-time code. If you did not receive it, be sure to check your Spam/Junk folder."))),s("verdocs-text-input",{key:"5aeffa74b7703c86849cf6bbedc746584e346379",id:"verdocs-otp-input",value:this.response,onClick:e=>e.stopPropagation(),placeholder:"Enter your one-time code...",onInput:e=>this.response=e.target.value})),s("div",{key:"d96f03dfaffebabc10d67fb2b35c97303198a08a",slot:"footer",class:"buttons footer"},s("verdocs-button",{key:"0ea3512e6e87650bfe9f137795e6fc98403bdae0",label:"Cancel",variant:"outline",onClick:()=>this.handleCancel()}),s("verdocs-button",{key:"f1ace3296417909507ceee4c777f64f07f5fa061",label:"Resend",onClick:()=>this.handleResend(),disabled:this.resendDisabled}),s("verdocs-button",{key:"3b098c6589cea3ff4a7c3e6b7bf2089324de0931",label:"Submit",onClick:()=>this.handleSubmit(),disabled:!this.response}))))}static get style(){return p()}},[0,"verdocs-otp-dialog",{endpoint:[1040],method:[1],resendDisabled:[32],response:[32]}]);function m(){if(typeof customElements==="undefined"){return}const e=["verdocs-otp-dialog","verdocs-button","verdocs-dialog","verdocs-help-icon","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-otp-dialog":if(!customElements.get(d(e))){customElements.define(d(e),h)}break;case"verdocs-button":if(!customElements.get(d(e))){l()}break;case"verdocs-dialog":if(!customElements.get(d(e))){r()}break;case"verdocs-help-icon":if(!customElements.get(d(e))){f()}break;case"verdocs-text-input":if(!customElements.get(d(e))){b()}break}}))}export{h as V,m as d};
|
|
2
|
+
//# sourceMappingURL=p-CsF979IT.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as o,c as d,h as a,t as c}from"./p-yZBlG3YQ.js";import{D as s}from"./p-
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as o,c as d,h as a,t as c}from"./p-yZBlG3YQ.js";import{D as s}from"./p-b2u0_wDk.js";import{d as t}from"./p-JGWMBIGy.js";const l=()=>`verdocs-delegate-dialog{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-delegate-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-delegate-dialog .heading .icon{}verdocs-delegate-dialog .heading .icon svg{fill:var(--verdocs-dialog-icon-color, #ffffff)}verdocs-delegate-dialog{}verdocs-delegate-dialog .verdocs-form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px;margin-bottom:24px}verdocs-delegate-dialog .verdocs-form-row{display:-ms-flexbox;display:flex;gap:16px;width:100%}verdocs-delegate-dialog .verdocs-form-row>*{-ms-flex:1;flex:1}verdocs-delegate-dialog .verdocs-form-label{font-size:13px;line-height:20px;font-weight:300;color:var(--verdocs-label-color, #616161);margin-bottom:2px;display:block}verdocs-delegate-dialog .verdocs-form-input{border:1px solid #d1d1d1;border-bottom-color:var(--verdocs-input-border-bottom-color, #d1d1d1);border-radius:4px;color:#707070;padding:8px 12px;font-size:14px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit}verdocs-delegate-dialog .verdocs-form-input::-webkit-input-placeholder{color:#9ca3af}verdocs-delegate-dialog .verdocs-form-input::-moz-placeholder{color:#9ca3af}verdocs-delegate-dialog .verdocs-form-input:-ms-input-placeholder{color:#9ca3af}verdocs-delegate-dialog .verdocs-form-input::-ms-input-placeholder{color:#9ca3af}verdocs-delegate-dialog .verdocs-form-input::placeholder{color:#9ca3af}verdocs-delegate-dialog .verdocs-form-input:focus{outline:none;border-color:var(--verdocs-primary-color, #654dcb)}verdocs-delegate-dialog .buttons{gap:12px;display:-ms-flexbox;display:flex;margin-top:0;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-delegate-dialog .buttons button{padding:8px 16px;height:40px;display:-ms-flexbox;display:flex;font-size:14px;font-weight:400;cursor:pointer;-ms-flex-align:center;align-items:center;border-radius:var(--verdocs-button-radius, 4px);-ms-flex-pack:center;justify-content:center;-webkit-transition:all 0.2s ease;transition:all 0.2s ease}verdocs-delegate-dialog .buttons button.cancel{background-color:transparent;border:var(--verdocs-button-secondary-border, 1px solid #d1d5db);color:var(--verdocs-button-secondary-color, #374151)}verdocs-delegate-dialog .buttons button.proceed{background-color:var(--verdocs-primary-color, #55bc81);border:1px solid transparent;color:#ffffff}verdocs-delegate-dialog .buttons button.proceed:hover{background-color:var(--verdocs-primary-color-hover, #2b995b)}verdocs-delegate-dialog .buttons button:disabled{background-color:var(--verdocs-button-disabled-bg, #e5e7eb);color:var(--verdocs-button-disabled-color, #9ca3af);cursor:not-allowed}`;const r=e(class e extends o{constructor(e){super();if(e!==false){this.__registerHost()}this.exit=d(this,"exit");this.next=d(this,"next");this.endpoint=s;this.envelope=null;this.first_name="";this.last_name="";this.email="";this.phone="";this.message=""}handleCancel(){this.exit.emit()}handleDismiss(e){if(e.target.class==="background-overlay"){e.preventDefault();this.handleCancel()}}handleDelegate(){this.next.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message})}render(){return a("verdocs-dialog",{key:"d4b21ede9f6753e83b58014d9fc9f22f180440a0"},a("div",{key:"3147514ded1c2037d6bdf2931d7c84444cc81726",slot:"heading",class:"heading"},a("div",{key:"b47b3ad26c23c0c6aa8f8443eaa2f4fe44dd87e6",class:"icon"},a("svg",{key:"4c9fc9400ca834af65da1e59e3187ce4f76b7dad",width:"22",height:"19",viewBox:"0 0 22 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("g",{key:"88648a465b4e8a4b0a6f4c261cbfd29946e9bbd3","clip-path":"url(#clip0_34208_4881)"},a("path",{key:"469404c0b2232024444c7217836967388e500837",d:"M3.125 0.75C1.88398 0.75 0.875 1.75898 0.875 3V16.5C0.875 17.741 1.88398 18.75 3.125 18.75H12.125C13.366 18.75 14.375 17.741 14.375 16.5V15.8215C14.2801 15.8602 14.1852 15.8918 14.0867 15.9164L11.9738 16.4437C11.8684 16.4684 11.7629 16.4859 11.6574 16.493C11.6258 16.4965 11.5941 16.5 11.5625 16.5H9.3125C9.09805 16.5 8.90469 16.3805 8.80977 16.1906L8.50039 15.5684C8.44062 15.4488 8.32109 15.375 8.19102 15.375C8.06094 15.375 7.93789 15.4488 7.88164 15.5684L7.57227 16.1906C7.47031 16.398 7.24883 16.5211 7.02031 16.5C6.7918 16.4789 6.59492 16.3207 6.53164 16.1027L5.9375 14.1445L5.59297 15.2977C5.37852 16.0113 4.72109 16.5 3.97578 16.5H3.6875C3.37812 16.5 3.125 16.2469 3.125 15.9375C3.125 15.6281 3.37812 15.375 3.6875 15.375H3.97578C4.22539 15.375 4.44336 15.2133 4.51367 14.9742L5.0375 13.234C5.15703 12.8367 5.52266 12.5625 5.9375 12.5625C6.35234 12.5625 6.71797 12.8367 6.8375 13.234L7.24531 14.591C7.50547 14.373 7.83594 14.25 8.1875 14.25C8.74648 14.25 9.25625 14.5664 9.50586 15.0656L9.66055 15.375H9.97344C9.86445 15.0656 9.84336 14.7281 9.92422 14.3977L10.4516 12.2848C10.55 11.8875 10.7539 11.5289 11.0422 11.2406L14.375 7.90781V6.375H9.875C9.25273 6.375 8.75 5.87227 8.75 5.25V0.75H3.125ZM9.875 0.75V5.25H14.375L9.875 0.75ZM20.2039 5.66133C19.6555 5.11289 18.766 5.11289 18.2141 5.66133L17.1805 6.69492L19.6766 9.19102L20.7102 8.15742C21.2586 7.60898 21.2586 6.71953 20.7102 6.16758L20.2039 5.66133ZM11.8402 12.0352C11.6961 12.1793 11.5941 12.3586 11.5449 12.559L11.0176 14.6719C10.9684 14.8652 11.0246 15.0656 11.1652 15.2063C11.3059 15.3469 11.5062 15.4031 11.6996 15.3539L13.8125 14.8266C14.0094 14.7773 14.1922 14.6754 14.3363 14.5312L18.8785 9.98555L16.3824 7.48945L11.8402 12.0352Z"})),a("defs",{key:"3c07a9394deb8c526bb655200a8977d9b8ca7acd"},a("clipPath",{key:"72c433bcd5308661e432889cb0cac60a76705441",id:"clip0_34208_4881"},a("path",{key:"e2f271f62dbe2b724b7b974af9229bcb641fbde8",d:"M0.875 0.75H21.125V18.75H0.875V0.75Z",fill:"white"}))))),a("div",{key:"79780657fb17149521a18eb172f961ea1421a2bc",class:"title"},"Delegate Signing")),a("div",{key:"f00f9769bad5a70e04e9502b603801fafc9a8b80",slot:"content",class:"content"},a("div",{key:"2217095c86469c318477e91bd0ca3220ead46024",class:"verdocs-form"},a("div",{key:"987b0f9f1bd75cbbef3fe2ed6d463785df38ffe9",class:"verdocs-form-row"},a("div",{key:"bdaeae291bf85cdc2440262037cd5bbc33c6dd8f",class:"field-group"},a("label",{key:"02e0b1b82fe99f6353e243c8c29260b569938896",htmlFor:"verdocs-delegate-first",class:"verdocs-form-label"},"New Recipient*"),a("input",{key:"0642146c6887d6df805e1261f1e9f579c87c1229",type:"text",id:"verdocs-delegate-first",name:"verdocs-delegate-first",class:"verdocs-form-input",autocomplete:"blocked",placeholder:"First name",value:this.first_name,onInput:e=>this.first_name=e.target.value})),a("div",{key:"0f2d8b210b6dcabe2568e1695c3fbbf50f763363",class:"field-group"},a("label",{key:"a92195120fcc28d22f0360f66249023f56b255e8",htmlFor:"verdocs-delegate-last",class:"verdocs-form-label"}," "),a("input",{key:"671f4ab62c9c6ee7094b52426fbfec3d30c65f01",type:"text",id:"verdocs-delegate-last",name:"verdocs-delegate-last",class:"verdocs-form-input",autocomplete:"blocked",placeholder:"Last name",value:this.last_name,onInput:e=>this.last_name=e.target.value}))),a("div",{key:"082fb6a00e764aac3220b6816896e2360a58f6e7"},a("label",{key:"c847d34aac89ac041051c40e65aac643be7e8b2a",htmlFor:"verdocs-delegate-email",class:"verdocs-form-label"},"Email Address*"),a("input",{key:"c531b1d3da04c62683355efab2485f1adaf474e8",type:"text",id:"verdocs-delegate-email",name:"verdocs-delegate-email",class:"verdocs-form-input",autocomplete:"blocked",placeholder:"New recipient email address",value:this.email,onInput:e=>this.email=e.target.value})),a("div",{key:"212965cb6ce4022234865c83c885d200395bce9e"},a("label",{key:"bdd73d761ca479ae3394d72bb19ce0ec6a6bdd10",htmlFor:"verdocs-delegate-phone",class:"verdocs-form-label"},"Phone Number"),a("input",{key:"9eccefac65c43219c47f7a3ba89be8ee6f73e97a",type:"text",id:"verdocs-delegate-phone",name:"verdocs-delegate-phone",class:"verdocs-form-input",autocomplete:"blocked",placeholder:"Optional phone number",value:this.phone,onInput:e=>this.phone=e.target.value})),a("div",{key:"ba25791e580303282dac8df271348dd1b9d63229"},a("label",{key:"859c39bcea4e2c3eaa67963741b052ce9300fb41",htmlFor:"verdocs-delegate-message",class:"verdocs-form-label"},"Message (optional)"),a("textarea",{key:"88430c1f20858a52de0cccf7e2321eccc3239f02",id:"verdocs-delegate-message",name:"verdocs-delegate-message",class:"verdocs-form-input",rows:3,autocomplete:"blocked",placeholder:"Type message here...",onInput:e=>this.message=e.target.value},this.message)))),a("div",{key:"262dc5e6373a2c10704156b14b1cd2c06d718777",class:"footer",slot:"footer"},a("div",{key:"327b7a99706bfd48d32c672a2f2deb62324da003",class:"buttons"},a("button",{key:"1cfee94119db51d52f6e7323950fe7b95168b20c",class:"cancel",onClick:()=>this.handleCancel()},"Cancel"),a("button",{key:"604e71d6316c0b0523567fbff135cb0e1d327246",class:"proceed",onClick:()=>this.handleDelegate(),disabled:!this.first_name||!this.last_name||!this.email},"Delegate"))))}static get style(){return l()}},[0,"verdocs-delegate-dialog",{endpoint:[1040],envelope:[16],first_name:[32],last_name:[32],email:[32],phone:[32],message:[32]}]);function i(){if(typeof customElements==="undefined"){return}const e=["verdocs-delegate-dialog","verdocs-dialog"];e.forEach((e=>{switch(e){case"verdocs-delegate-dialog":if(!customElements.get(c(e))){customElements.define(c(e),r)}break;case"verdocs-dialog":if(!customElements.get(c(e))){t()}break}}))}export{r as V,i as d};
|
|
2
|
+
//# sourceMappingURL=p-DJMr11ue.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as o,H as t,h as e,d as i,t as r}from"./p-yZBlG3YQ.js";import{c as s}from"./p-BfP9ezJQ.js";const a=()=>`verdocs-toolbar-icon{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:absolute;pointer-events:none;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}`;const n=o(class o extends t{constructor(o){super();if(o!==false){this.__registerHost()}this.text="";this.icon="";this.placement="bottom";this.containerId=`verdocs-toolbar-icon-${Math.random().toString(36).substring(2,11)}`}componentDidLoad(){this.popperInstance=s(this.iconEl,this.tooltip,{placement:this.placement,modifiers:this.placement==="left"?[{name:"offset",options:{offset:[0,20]}}]:[]})}disconnectedCallback(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}}show(){var o,t;(o=this.tooltip)===null||o===void 0?void 0:o.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((()=>{}))}hide(){var o;(o=this.tooltip)===null||o===void 0?void 0:o.removeAttribute("data-show")}render(){return e(i,{key:"56dd7cebb5a2761547a5e24ec76652f7052906b2",class:{}},e("div",{key:"8d2f5e8578bdf5b25db200406460d9e2724c168e","aria-describedby":this.containerId,class:"icon",innerHTML:this.icon,onMouseEnter:()=>this.show(),onFocus:()=>this.show(),onMouseLeave:()=>this.hide(),onBlur:()=>this.hide(),ref:o=>this.iconEl=o}),e("div",{key:"371c80cf2be530cf3fd8ddb7308fd30f65f3b3f4",id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":this.placement,ref:o=>this.tooltip=o},this.text,e("div",{key:"39b43e589f2b52f1658562e79a3d6388478bdcbe","data-popper-arrow":"true",class:"arrow"})))}static get style(){return a()}},[0,"verdocs-toolbar-icon",{text:[1],icon:[1],placement:[1],containerId:[32]}]);function c(){if(typeof customElements==="undefined"){return}const o=["verdocs-toolbar-icon"];o.forEach((o=>{switch(o){case"verdocs-toolbar-icon":if(!customElements.get(r(o))){customElements.define(r(o),n)}break}}))}export{n as V,c as d};
|
|
2
|
+
//# sourceMappingURL=p-DavVixMP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["verdocsToolbarIconCss","VerdocsToolbarIcon","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","text","icon","placement","containerId","Math","random","toString","substring","componentDidLoad","popperInstance","createPopper","iconEl","tooltip","modifiers","name","options","offset","disconnectedCallback","destroy","show","_a","setAttribute","_b","update","catch","hide","removeAttribute","render","h","Host","key","class","innerHTML","onMouseEnter","onFocus","onMouseLeave","onBlur","ref","el","id","role"],"sources":["src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.scss?tag=verdocs-toolbar-icon","src/components/controls/verdocs-toolbar-icon/verdocs-toolbar-icon.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-toolbar-icon {\n font-family: $verdocs-primary-font;\n //display: inline-block;\n display: flex;\n position: relative;\n align-items: center;\n justify-content: center;\n\n .icon {\n display: inline-block;\n cursor: pointer;\n\n svg {\n fill: $choice-available-color;\n }\n }\n\n .tooltip {\n display: none;\n box-shadow: 0 0 10px 1px #999999;\n background: #ffffff;\n color: $label-color;\n max-width: 240px;\n font-weight: bold;\n padding: 5px 10px;\n font-size: 13px;\n // MUST be absolute. Popper positions the tooltip with inline transforms and assumes it is out\n // of the normal flow. With position:relative the tooltip instead occupies space inside the\n // flex container when shown, which widens the toolbar and shifts the icon out from under the\n // pointer. That fires mouseleave -> hide -> layout collapses -> mouseenter -> show, an endless\n // flicker where the icon can never be clicked. It only bites where the toolbar has no slack to\n // absorb the width change (e.g. the Teams tab), which is why it looked fine in the web app.\n position: absolute;\n // The tooltip is decoration; never let it capture the hover it was triggered by.\n pointer-events: none;\n border-radius: 4px;\n z-index: 20000;\n white-space: nowrap;\n\n .arrow,\n .arrow::before {\n position: absolute;\n width: 8px;\n height: 8px;\n background: inherit;\n }\n\n .arrow {\n visibility: hidden;\n top: -4px;\n }\n\n .arrow::before {\n visibility: visible;\n content: '';\n transform: rotate(45deg);\n }\n\n &[data-show] {\n display: block;\n }\n\n &[data-popper-placement^='top'] > .arrow {\n bottom: -4px;\n }\n\n &[data-popper-placement^='bottom'] > .arrow {\n top: -4px;\n }\n\n &[data-popper-placement^='left'] > .arrow {\n right: -4px;\n }\n\n &[data-popper-placement^='right'] > .arrow {\n left: -4px;\n }\n\n // For the floating menu\n &[data-popper-placement^='left'] {\n //margin-right: 22px !important;\n padding: 3px 10px;\n\n & > .arrow {\n right: -1px;\n }\n }\n }\n}\n","import {createPopper, Instance} from '@popperjs/core';\nimport {Component, h, Host, Prop, State} from '@stencil/core';\nimport {Placement} from '@popperjs/core/lib/enums';\n// import {Component, Event, EventEmitter, h, Host, Prop, State} from '@stencil/core';\n\n/**\n * Displays a simple help icon. Upon hover or focus, a tooltip will be displayed with help text.\n *\n * ```ts\n * <verdocs-toolbar-icon text=\"Sample tooltip text\" icon={CalendarIcon} />\n * ```\n */\n@Component({\n tag: 'verdocs-toolbar-icon',\n styleUrl: 'verdocs-toolbar-icon.scss',\n shadow: false,\n})\nexport class VerdocsToolbarIcon {\n iconEl: HTMLDivElement;\n tooltip: HTMLDivElement;\n popperInstance: Instance;\n\n /**\n * Help text to display on hover/focus\n */\n @Prop() text: string = '';\n\n /**\n * SVG icon to display\n */\n @Prop() icon: string = '';\n\n /**\n * Override the Popper \"placement\" setting\n */\n @Prop() placement: Placement = 'bottom';\n\n /**\n * Triggered when the icon is pressed\n */\n // @Event({composed: true}) press: EventEmitter;\n\n @State() containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;\n\n componentDidLoad() {\n this.popperInstance = createPopper(this.iconEl, this.tooltip, {\n placement: this.placement,\n modifiers: this.placement === 'left' ? [{name: 'offset', options: {offset: [0, 20]}}] : [],\n });\n // placement: 'top-end',\n // modifiers: [{name: 'offset', options: {offset: [0, 10]}}],\n // });\n }\n\n disconnectedCallback() {\n if (this.popperInstance) {\n this.popperInstance.destroy();\n this.popperInstance = null;\n }\n }\n\n show() {\n this.tooltip?.setAttribute('data-show', '');\n this.popperInstance?.update().catch(() => {});\n }\n\n hide() {\n this.tooltip?.removeAttribute('data-show');\n }\n\n // handlePress() {\n // this.press?.emit();\n // }\n\n render() {\n return (\n <Host class={{}}>\n <div\n aria-describedby={this.containerId}\n class=\"icon\"\n innerHTML={this.icon}\n onMouseEnter={() => this.show()}\n onFocus={() => this.show()}\n onMouseLeave={() => this.hide()}\n onBlur={() => this.hide()}\n ref={el => (this.iconEl = el as HTMLDivElement)}\n />\n <div id={this.containerId} role=\"tooltip\" class=\"tooltip\" data-popper-placement={this.placement} ref={el => (this.tooltip = el as HTMLDivElement)}>\n {this.text}\n <div data-popper-arrow=\"true\" class=\"arrow\" />\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"oGAAA,MAAMA,EAAwB,IAAM,m9C,MCiBvBC,EAAkBC,EAAA,MAAAD,UAAAE,EAL/B,WAAAC,CAAAC,G,4CAaUC,KAAAC,KAAe,GAKfD,KAAAE,KAAe,GAKfF,KAAAG,UAAuB,SAOtBH,KAAAI,YAAc,wBAAwBC,KAAKC,SAASC,SAAS,IAAIC,UAAU,EAAG,KAoDxF,CAlDC,gBAAAC,GACET,KAAKU,eAAiBC,EAAaX,KAAKY,OAAQZ,KAAKa,QAAS,CAC5DV,UAAWH,KAAKG,UAChBW,UAAWd,KAAKG,YAAc,OAAS,CAAC,CAACY,KAAM,SAAUC,QAAS,CAACC,OAAQ,CAAC,EAAG,OAAS,I,CAO5F,oBAAAC,GACE,GAAIlB,KAAKU,eAAgB,CACvBV,KAAKU,eAAeS,UACpBnB,KAAKU,eAAiB,I,EAI1B,IAAAU,G,SACEC,EAAArB,KAAKa,WAAO,MAAAQ,SAAA,SAAAA,EAAEC,aAAa,YAAa,KACxCC,EAAAvB,KAAKU,kBAAc,MAAAa,SAAA,SAAAA,EAAEC,SAASC,OAAM,Q,CAGtC,IAAAC,G,OACEL,EAAArB,KAAKa,WAAO,MAAAQ,SAAA,SAAAA,EAAEM,gBAAgB,Y,CAOhC,MAAAC,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CAACC,MAAO,IACXH,EAAA,OAAAE,IAAA,8DACoB/B,KAAKI,YACvB4B,MAAM,OACNC,UAAWjC,KAAKE,KAChBgC,aAAc,IAAMlC,KAAKoB,OACzBe,QAAS,IAAMnC,KAAKoB,OACpBgB,aAAc,IAAMpC,KAAK0B,OACzBW,OAAQ,IAAMrC,KAAK0B,OACnBY,IAAKC,GAAOvC,KAAKY,OAAS2B,IAE5BV,EAAA,OAAAE,IAAA,2CAAKS,GAAIxC,KAAKI,YAAaqC,KAAK,UAAUT,MAAM,UAAS,wBAAwBhC,KAAKG,UAAWmC,IAAKC,GAAOvC,KAAKa,QAAU0B,GACzHvC,KAAKC,KACN4B,EAAA,OAAAE,IAAA,+DAAuB,OAAOC,MAAM,W","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{VerdocsEndpoint as o}from"@verdocs/js-sdk";const s=o.getDefault();export{s as D};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
2
|
+
//# sourceMappingURL=p-b2u0_wDk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DefaultEndpoint","VerdocsEndpoint","getDefault"],"sources":["src/utils/Environment.ts"],"sourcesContent":["import {VerdocsEndpoint} from '@verdocs/js-sdk';\n\nexport const BETA_ORIGINS = ['https://beta.verdocs.com', 'https://stage.verdocs.com', 'http://localhost:6006', 'http://localhost:5173'];\n\nexport const IS_BETA = BETA_ORIGINS.includes(window.location.origin);\n\nexport const API_URL = IS_BETA ? 'https://stage-api.verdocs.com' : 'https://api.verdocs.com';\n\n// NOTE: Do not call setBaseURL(). The constructor already does, but more important, in most environments\n// this particular code block is lazily loaded and gets run on a component render. That creates a race\n// condition that silently overwrites a host-app preference and is hard to track down. (Definitely breaks\n// the Teams app, among other things.)\nexport const DefaultEndpoint = VerdocsEndpoint.getDefault();\n"],"mappings":"wDAYaA,EAAkBC,EAAgBC,oB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as o,d as r,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as d,getTemplate as a}from"@verdocs/js-sdk";import{S as l}from"./p-C1sRVZWv.js";import{S as c}from"./p-C7hFgM52.js";import{d as n}from"./p-C0SHIuoK.js";import{d as m}from"./p-DVx4efoX.js";import{d as p}from"./p--jRXEN0c.js";import{d as f}from"./p-DCZz2B7h.js";import{d as v}from"./p-JGWMBIGy.js";import{d as h}from"./p-D1cSgqut.js";import{d as u}from"./p-K_PKw6bs.js";import{d as b}from"./p-DiYuPnJJ.js";import{d as x}from"./p-DKKsPZnz.js";import{d as k}from"./p-D-TexkaT.js";import{d as w}from"./p-D7oMWhqM.js";import{d as E}from"./p-BQUZjuoP.js";import{d as g}from"./p-DfIxVX8-.js";import{d as j}from"./p-BELGzhZw.js";import{d as y}from"./p-bPe0_Dsn.js";import{d as I}from"./p-CAGp0qKc.js";import{d as C}from"./p-D9yawpPk.js";import{d as U}from"./p-CxIhMndz.js";import{d as B}from"./p-vimrvRye.js";import{d as D}from"./p-B0HO2i65.js";import{d as T}from"./p-Dc3BDcaU.js";import{d as L}from"./p-CIgqf7hj.js";import{d as S}from"./p-B6aUlIQe.js";import{d as z}from"./p-BMzxhyLu.js";import{d as P}from"./p-u9H54zUE.js";import{d as N}from"./p-zTcSNwsp.js";import{d as R}from"./p-CoeB7U-_.js";import{d as G}from"./p-DL4-aTsZ.js";import{d as M}from"./p-CAxzfAvp.js";import{d as W}from"./p-CYvB5bYX.js";import{d as Y}from"./p-BWrwPDuU.js";import{d as Z}from"./p-C43B3SP_.js";import{d as q}from"./p-ByJ9WBGR.js";import{d as J}from"./p-nh9PxN8s.js";import{d as K}from"./p-BMGs9CCD.js";import{d as _}from"./p-CYqVJ_kJ.js";import{d as A}from"./p-LYpUmpqf.js";const V=()=>`verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{display:block;width:500px;max-width:95%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157);box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157)}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}`;const X=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.cancel=t(this,"cancel");this.sdkError=t(this,"sdkError");this.stepChanged=t(this,"stepChanged");this.send=t(this,"send");this.templateUpdated=t(this,"templateUpdated");this.templateCreated=t(this,"templateCreated");this.rolesUpdated=t(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=d.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}onTemplateIdChanged(e,s){if(!s&&e&&this.step==="attachments"){this.step="preview"}this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(){this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,s,t,o,r,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return}if(!this.templateId){console.log(`[BUILD] No template ID, activating upload mode`);this.step="attachments";this.loading=false;return}try{this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(o.message,(s=o.response)===null||s===void 0?void 0:s.status,(t=o.response)===null||t===void 0?void 0:t.data))}}catch(e){console.log("[BUILD] Error with builder session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new l(e.message,(r=e.response)===null||r===void 0?void 0:r.status,(i=e.response)===null||i===void 0?void 0:i.data))}}async loadTemplate(e){if(e){c.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}}disconnectedCallback(){console.log("[BUILD] Disconnected");this.unlistenToTemplate()}unlistenToTemplate(){if(this.templateListenerId){c.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(){var e;this.step="preview";(e=this.cancel)===null||e===void 0?void 0:e.emit()}async handleTemplateCreated(e){var s;await this.loadTemplate(e);this.templateId=e;this.step="roles";(s=this.stepChanged)===null||s===void 0?void 0:s.emit("roles")}async handleRolesUpdated(e){var s;console.log("[BUILD] Roloes updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}async handleTemplateUpdated(e){var s;console.log("[BUILD] Template updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")}handleRolesNext(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")}handleStepChanged(e){var s;this.step=e;(s=this.stepChanged)===null||s===void 0?void 0:s.emit(e)}render(){if(this.loading){return o(r,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(r,null,o("div",{class:"content"},o("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var s;return(s=this.sdkError)===null||s===void 0?void 0:s.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),this.step==="attachments"&&o("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="roles"&&o("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),this.step==="fields"&&o("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="preview"&&o("div",{class:"preview-container"},o("div",{class:"preview-send-wrapper"},o("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var s;return(s=this.send)===null||s===void 0?void 0:s.emit(e.detail)},style:{width:"100%"}})),o("div",{class:"preview-preview-wrapper"},o("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))}get el(){return this}static get watchers(){return{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}}static get style(){return V()}},[0,"verdocs-build",{endpoint:[16],templateId:[1537,"template-id"],step:[1537],loading:[32],template:[32]},undefined,{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}]);function H(){if(typeof customElements==="undefined"){return}const e=["verdocs-build","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-file-chooser","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-menu-panel","verdocs-ok-dialog","verdocs-portal","verdocs-preview","verdocs-progress-bar","verdocs-select-input","verdocs-send","verdocs-spinner","verdocs-template-attachments","verdocs-template-build-tabs","verdocs-template-document-page","verdocs-template-field-properties","verdocs-template-fields","verdocs-template-role-properties","verdocs-template-roles","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-build":if(!customElements.get(i(e))){customElements.define(i(e),X)}break;case"verdocs-button":if(!customElements.get(i(e))){n()}break;case"verdocs-checkbox":if(!customElements.get(i(e))){m()}break;case"verdocs-component-error":if(!customElements.get(i(e))){p()}break;case"verdocs-contact-picker":if(!customElements.get(i(e))){f()}break;case"verdocs-dialog":if(!customElements.get(i(e))){v()}break;case"verdocs-field-attachment":if(!customElements.get(i(e))){h()}break;case"verdocs-field-checkbox":if(!customElements.get(i(e))){u()}break;case"verdocs-field-date":if(!customElements.get(i(e))){b()}break;case"verdocs-field-dropdown":if(!customElements.get(i(e))){x()}break;case"verdocs-field-initial":if(!customElements.get(i(e))){k()}break;case"verdocs-field-radio":if(!customElements.get(i(e))){w()}break;case"verdocs-field-signature":if(!customElements.get(i(e))){E()}break;case"verdocs-field-textarea":if(!customElements.get(i(e))){g()}break;case"verdocs-field-textbox":if(!customElements.get(i(e))){j()}break;case"verdocs-field-timestamp":if(!customElements.get(i(e))){y()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){I()}break;case"verdocs-flag":if(!customElements.get(i(e))){C()}break;case"verdocs-help-icon":if(!customElements.get(i(e))){U()}break;case"verdocs-loader":if(!customElements.get(i(e))){B()}break;case"verdocs-menu-panel":if(!customElements.get(i(e))){D()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){T()}break;case"verdocs-portal":if(!customElements.get(i(e))){L()}break;case"verdocs-preview":if(!customElements.get(i(e))){S()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){z()}break;case"verdocs-select-input":if(!customElements.get(i(e))){P()}break;case"verdocs-send":if(!customElements.get(i(e))){N()}break;case"verdocs-spinner":if(!customElements.get(i(e))){R()}break;case"verdocs-template-attachments":if(!customElements.get(i(e))){G()}break;case"verdocs-template-build-tabs":if(!customElements.get(i(e))){M()}break;case"verdocs-template-document-page":if(!customElements.get(i(e))){W()}break;case"verdocs-template-field-properties":if(!customElements.get(i(e))){Y()}break;case"verdocs-template-fields":if(!customElements.get(i(e))){Z()}break;case"verdocs-template-role-properties":if(!customElements.get(i(e))){q()}break;case"verdocs-template-roles":if(!customElements.get(i(e))){J()}break;case"verdocs-text-input":if(!customElements.get(i(e))){K()}break;case"verdocs-toolbar-icon":if(!customElements.get(i(e))){_()}break;case"verdocs-upload-dialog":if(!customElements.get(i(e))){A()}break}}))}const Q=X;const F=H;export{Q as VerdocsBuild,F as defineCustomElement};
|
|
1
|
+
import{p as e,H as s,c as t,h as o,d as r,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as d,getTemplate as a}from"@verdocs/js-sdk";import{S as l}from"./p-C1sRVZWv.js";import{S as c}from"./p-C7hFgM52.js";import{d as n}from"./p-C0SHIuoK.js";import{d as m}from"./p-DVx4efoX.js";import{d as p}from"./p--jRXEN0c.js";import{d as f}from"./p-6RWROB9R.js";import{d as v}from"./p-JGWMBIGy.js";import{d as h}from"./p-D1cSgqut.js";import{d as u}from"./p-K_PKw6bs.js";import{d as b}from"./p-DiYuPnJJ.js";import{d as x}from"./p-DKKsPZnz.js";import{d as k}from"./p-D-TexkaT.js";import{d as w}from"./p-D7oMWhqM.js";import{d as E}from"./p-BQUZjuoP.js";import{d as g}from"./p-DfIxVX8-.js";import{d as j}from"./p-BELGzhZw.js";import{d as y}from"./p-bPe0_Dsn.js";import{d as I}from"./p-CAGp0qKc.js";import{d as U}from"./p-D9yawpPk.js";import{d as B}from"./p-CxIhMndz.js";import{d as C}from"./p-vimrvRye.js";import{d as D}from"./p-B0HO2i65.js";import{d as T}from"./p-Dc3BDcaU.js";import{d as L}from"./p-CIgqf7hj.js";import{d as R}from"./p-B6aUlIQe.js";import{d as S}from"./p-BMzxhyLu.js";import{d as P}from"./p-u9H54zUE.js";import{d as Y}from"./p-Ck4pdoyc.js";import{d as z}from"./p-CoeB7U-_.js";import{d as M}from"./p-DL4-aTsZ.js";import{d as W}from"./p-CAxzfAvp.js";import{d as G}from"./p-CYvB5bYX.js";import{d as N}from"./p-BWrwPDuU.js";import{d as K}from"./p-BYVQkYYg.js";import{d as Z}from"./p-ByJ9WBGR.js";import{d as q}from"./p-nh9PxN8s.js";import{d as V}from"./p-BMGs9CCD.js";import{d as A}from"./p-DavVixMP.js";import{d as J}from"./p-LYpUmpqf.js";const Q=()=>`verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{display:block;width:500px;max-width:95%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157);box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157)}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}`;const X=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.cancel=t(this,"cancel");this.sdkError=t(this,"sdkError");this.stepChanged=t(this,"stepChanged");this.send=t(this,"send");this.templateUpdated=t(this,"templateUpdated");this.templateCreated=t(this,"templateCreated");this.rolesUpdated=t(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=d.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}onTemplateIdChanged(e,s){if(!s&&e&&this.step==="attachments"){this.step="preview"}this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(){this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,s,t,o,r,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return}if(!this.templateId){console.log(`[BUILD] No template ID, activating upload mode`);this.step="attachments";this.loading=false;return}try{this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(o.message,(s=o.response)===null||s===void 0?void 0:s.status,(t=o.response)===null||t===void 0?void 0:t.data))}}catch(e){console.log("[BUILD] Error with builder session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new l(e.message,(r=e.response)===null||r===void 0?void 0:r.status,(i=e.response)===null||i===void 0?void 0:i.data))}}async loadTemplate(e){if(e){c.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}}disconnectedCallback(){console.log("[BUILD] Disconnected");this.unlistenToTemplate()}unlistenToTemplate(){if(this.templateListenerId){c.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(){var e;this.step="preview";(e=this.cancel)===null||e===void 0?void 0:e.emit()}async handleTemplateCreated(e){var s;await this.loadTemplate(e);this.templateId=e;this.step="roles";(s=this.stepChanged)===null||s===void 0?void 0:s.emit("roles")}async handleRolesUpdated(e){var s;console.log("[BUILD] Roloes updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}async handleTemplateUpdated(e){var s;console.log("[BUILD] Template updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")}handleRolesNext(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")}handleStepChanged(e){var s;this.step=e;(s=this.stepChanged)===null||s===void 0?void 0:s.emit(e)}render(){if(this.loading){return o(r,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(r,null,o("div",{class:"content"},o("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var s;return(s=this.sdkError)===null||s===void 0?void 0:s.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),this.step==="attachments"&&o("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="roles"&&o("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),this.step==="fields"&&o("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="preview"&&o("div",{class:"preview-container"},o("div",{class:"preview-send-wrapper"},o("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var s;return(s=this.send)===null||s===void 0?void 0:s.emit(e.detail)},style:{width:"100%"}})),o("div",{class:"preview-preview-wrapper"},o("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))}get el(){return this}static get watchers(){return{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}}static get style(){return Q()}},[0,"verdocs-build",{endpoint:[16],templateId:[1537,"template-id"],step:[1537],loading:[32],template:[32]},undefined,{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}]);function H(){if(typeof customElements==="undefined"){return}const e=["verdocs-build","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-file-chooser","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-menu-panel","verdocs-ok-dialog","verdocs-portal","verdocs-preview","verdocs-progress-bar","verdocs-select-input","verdocs-send","verdocs-spinner","verdocs-template-attachments","verdocs-template-build-tabs","verdocs-template-document-page","verdocs-template-field-properties","verdocs-template-fields","verdocs-template-role-properties","verdocs-template-roles","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-build":if(!customElements.get(i(e))){customElements.define(i(e),X)}break;case"verdocs-button":if(!customElements.get(i(e))){n()}break;case"verdocs-checkbox":if(!customElements.get(i(e))){m()}break;case"verdocs-component-error":if(!customElements.get(i(e))){p()}break;case"verdocs-contact-picker":if(!customElements.get(i(e))){f()}break;case"verdocs-dialog":if(!customElements.get(i(e))){v()}break;case"verdocs-field-attachment":if(!customElements.get(i(e))){h()}break;case"verdocs-field-checkbox":if(!customElements.get(i(e))){u()}break;case"verdocs-field-date":if(!customElements.get(i(e))){b()}break;case"verdocs-field-dropdown":if(!customElements.get(i(e))){x()}break;case"verdocs-field-initial":if(!customElements.get(i(e))){k()}break;case"verdocs-field-radio":if(!customElements.get(i(e))){w()}break;case"verdocs-field-signature":if(!customElements.get(i(e))){E()}break;case"verdocs-field-textarea":if(!customElements.get(i(e))){g()}break;case"verdocs-field-textbox":if(!customElements.get(i(e))){j()}break;case"verdocs-field-timestamp":if(!customElements.get(i(e))){y()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){I()}break;case"verdocs-flag":if(!customElements.get(i(e))){U()}break;case"verdocs-help-icon":if(!customElements.get(i(e))){B()}break;case"verdocs-loader":if(!customElements.get(i(e))){C()}break;case"verdocs-menu-panel":if(!customElements.get(i(e))){D()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){T()}break;case"verdocs-portal":if(!customElements.get(i(e))){L()}break;case"verdocs-preview":if(!customElements.get(i(e))){R()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){S()}break;case"verdocs-select-input":if(!customElements.get(i(e))){P()}break;case"verdocs-send":if(!customElements.get(i(e))){Y()}break;case"verdocs-spinner":if(!customElements.get(i(e))){z()}break;case"verdocs-template-attachments":if(!customElements.get(i(e))){M()}break;case"verdocs-template-build-tabs":if(!customElements.get(i(e))){W()}break;case"verdocs-template-document-page":if(!customElements.get(i(e))){G()}break;case"verdocs-template-field-properties":if(!customElements.get(i(e))){N()}break;case"verdocs-template-fields":if(!customElements.get(i(e))){K()}break;case"verdocs-template-role-properties":if(!customElements.get(i(e))){Z()}break;case"verdocs-template-roles":if(!customElements.get(i(e))){q()}break;case"verdocs-text-input":if(!customElements.get(i(e))){V()}break;case"verdocs-toolbar-icon":if(!customElements.get(i(e))){A()}break;case"verdocs-upload-dialog":if(!customElements.get(i(e))){J()}break}}))}const _=X;const O=H;export{_ as VerdocsBuild,O as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-build.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as o,d as s}from"./p-
|
|
1
|
+
import{V as o,d as s}from"./p-6RWROB9R.js";const t=o;const p=s;export{t as VerdocsContactPicker,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-contact-picker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as o,d as s}from"./p-
|
|
1
|
+
import{V as o,d as s}from"./p-DJMr11ue.js";const r=o;const t=s;export{r as VerdocsDelegateDialog,t as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-delegate-dialog.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as
|
|
1
|
+
import{V as s,d as o}from"./p-CsF979IT.js";const t=s;const p=o;export{t as VerdocsOtpDialog,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-otp-dialog.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as o,d as s}from"./p-
|
|
1
|
+
import{V as o,d as s}from"./p-B1UVXqFA.js";const t=o;const p=s;export{t as VerdocsPasscodeDialog,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-passcode-dialog.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as
|
|
1
|
+
import{V as o,d as s}from"./p-Ck4pdoyc.js";const p=o;const t=s;export{p as VerdocsSend,t as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-send.js.map
|