@verdocs/web-sdk 2.3.77 → 2.3.79
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/{TemplateStore-ae59084b.js → TemplateStore-9a87282d.js} +1 -1
- package/dist/cjs/{VerdocsEndpoint-f4ef9333.js → VerdocsEndpoint-38bcb409.js} +1 -1
- package/dist/cjs/ipc-test.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_15.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_8.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +3 -3
- package/dist/components/VerdocsEndpoint.js +1 -1
- package/dist/components/verdocs-auth.js +3 -3
- package/dist/custom-elements.json +2147 -0
- package/dist/docs.json +1 -1
- package/dist/esm/{TemplateStore-99bf97f0.js → TemplateStore-6a7d7297.js} +1 -1
- package/dist/esm/{VerdocsEndpoint-eab308f6.js → VerdocsEndpoint-9a11e843.js} +1 -1
- package/dist/esm/ipc-test.entry.js +2 -2
- package/dist/esm/verdocs-activity-box.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +4 -4
- package/dist/esm/verdocs-build.entry.js +2 -2
- package/dist/esm/verdocs-checkbox_5.entry.js +2 -2
- package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_15.entry.js +1 -1
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_8.entry.js +2 -2
- package/dist/esm/verdocs-quick-functions_2.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm/verdocs-settings.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-fields_4.entry.js +2 -2
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-templates-list.entry.js +1 -1
- package/dist/esm/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/{TemplateStore-99bf97f0.js → TemplateStore-6a7d7297.js} +1 -1
- package/dist/esm-es5/{VerdocsEndpoint-eab308f6.js → VerdocsEndpoint-9a11e843.js} +1 -1
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_15.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/verdocs-web-sdk/{p-f246348c.system.js → p-034bd59e.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b0e0084b.system.entry.js → p-05026d67.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bbf52926.entry.js → p-07cf78e3.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e7d7bcae.system.entry.js → p-094ea4ba.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-15c88a05.system.entry.js → p-0d1f4272.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-1978c7bd.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-58e85310.system.entry.js → p-1a29b57f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a12b2c26.system.entry.js → p-24742737.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6a93295c.entry.js → p-283d935e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ef99042b.entry.js → p-2bcd953d.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8f36c42a.system.entry.js → p-337466c7.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ea2211d7.system.entry.js → p-340d2daa.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d61bf72b.system.entry.js → p-4618665e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7e5a1766.system.entry.js → p-48c14014.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d0d9ac6d.system.js → p-49139f23.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8a7324b6.entry.js → p-5059ff08.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-159aeaf2.entry.js → p-55403539.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a7907ccf.entry.js → p-6dad60bb.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a9da16c6.entry.js → p-6ec51b4b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1d5f10f4.entry.js → p-70137c9e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e3623a0c.system.entry.js → p-786725d0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-91e94910.entry.js → p-812d7568.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-06618569.entry.js → p-8b46dcc3.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-baf16d17.system.entry.js → p-8b78ee37.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7b3dfc4b.system.entry.js → p-90734d54.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-92a6f625.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-c898e591.system.entry.js → p-9b306355.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-40f5b1c5.entry.js → p-a15e1a57.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9d748d04.entry.js → p-a87f2e56.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bf8e6ba1.system.entry.js → p-b1e92d11.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-77c145b3.system.entry.js → p-b293e7d0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c73e78c8.system.entry.js → p-b9376079.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-bc6ce10f.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-9a816526.system.entry.js → p-bf2fd0eb.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a9b80271.system.entry.js → p-cb48d6b9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4ce528a6.entry.js → p-ccac4998.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-45ecd6eb.js → p-cda8b816.js} +1 -1
- package/dist/verdocs-web-sdk/{p-84679597.entry.js → p-d075b6e8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c179b3e4.entry.js → p-d522f008.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-28c93a3a.system.entry.js → p-d524266d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e04d8f5d.js → p-d77962af.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ac042888.entry.js → p-daebba0a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-de5b9b23.system.entry.js → p-e3bfe2de.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d1c52218.entry.js → p-e93796e2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b8063124.entry.js → p-ed319550.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ac07d476.entry.js → p-ee9336c4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-5e8e5761.system.entry.js → p-f15263ff.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d11ffc76.entry.js → p-f6b75e4c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/verdocs-web-sdk/p-332141f2.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-7519fe6e.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b2d3ac44.entry.js +0 -1
@@ -1 +1 @@
|
|
1
|
-
import{r as e,c as i,h as s,H as t}from"./p-14b44491.js";import{c as n}from"./p-dc2ad047.js";import{u as o}from"./p-29f64c27.js";import{r as l}from"./p-3cd894ff.js";import"./p-05788c2b.js";import{V as a}from"./p-e04d8f5d.js";import{g as d}from"./p-321da456.js";import{F as r}from"./p-1b4e7078.js";import{V as c}from"./p-ed416acf.js";import{S as v}from"./p-7a1b2643.js";import{f as p}from"./p-c220af42.js";import"./p-7648c449.js";const h={visibility:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M12 15a3 3 0 100-6 3 3 0 000 6z" /><path fill-rule="evenodd" d="M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 010-1.113zM17.25 12a5.25 5.25 0 11-10.5 0 5.25 5.25 0 0110.5 0z" clip-rule="evenodd" /></svg>',pencil:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z" /></svg>',mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',contact_mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',done:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 01.208 1.04l-9 13.5a.75.75 0 01-1.154.114l-6-6a.75.75 0 011.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 011.04-.208z" clip-rule="evenodd" /></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>',gesture:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M4.59 6.89c.7-.71 1.4-1.35 1.71-1.22.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1H21v-2.5h-2.47c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3 5.12 3 3.97 4 3.72 4.25c-.36.36-.66.66-.88.93l1.75 1.71zm9.29 11.66c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"/></svg>',clear:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',check_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',cancel:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',done_all:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M18 7l-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.41L6 19l1.41-1.41L1.83 12 .41 13.41z"/></svg>',create:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',perm_identity:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',people:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>',contact_email:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z"/></svg>',textsms:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z"/></svg>',verified_user:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M12.516 2.17a.75.75 0 00-1.032 0 11.209 11.209 0 01-7.877 3.08.75.75 0 00-.722.515A12.74 12.74 0 002.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 00.374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 00-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08zm3.094 8.016a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',account_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>'},w=class{constructor(s){e(this,s),this.sdkError=i(this,"sdkError",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.toggle=i(this,"toggle",7),this.another=i(this,"another",7),this.store=null,this.endpoint=a.getDefault(),this.envelopeId="",this.activeTab=1,this.panelOpen=!1,this.showManageDialog=!1,this.showRecipientDialog="",this.showCancelDialog=!1,this.loading=!0}async componentWillLoad(){var e,i,s;try{if(this.endpoint.loadSession(),!this.envelopeId)return void console.log(`[SIDEBAR] Missing required envelope ID ${this.envelopeId}`);if(!this.endpoint.session)return void console.log("[SIDEBAR] Unable to start session, must be authenticated");this.store=await d(this.endpoint,this.envelopeId,!0),this.sortEnvelopeRecipients(),this.loading=!1}catch(t){console.log("[SIDEBAR] Error loading envelope",t),null===(e=this.sdkError)||void 0===e||e.emit(new v(t.message,null===(i=t.response)||void 0===i?void 0:i.status,null===(s=t.response)||void 0===s?void 0:s.data))}}sortEnvelopeRecipients(){var e,i;null===(i=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===i||i.recipients.sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence))}setTab(e){var i;this.panelOpen=e!==this.activeTab||!this.panelOpen,null===(i=this.toggle)||void 0===i||i.emit({open:this.panelOpen}),this.activeTab=e}canResendRecipient(e){var i,s;return!["pending","declined","submitted","canceled"].includes(e.status)&&!["complete","declined","canceled"].includes(null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s?void 0:s.status)}handleRecipientAction(e,i){var s,t;switch(console.log("[SIDEBAR] Recipient action",i,e),i){case"reminder":l(this.endpoint,this.envelopeId,e.role_name).then((()=>{c("Reminder Sent",{style:"success"})})).catch((e=>{console.log("[SIDEBAR] Error resending invitation",e),c("Error resending invitation: "+e.message,{style:"error"})}));break;case"inperson":this.showRecipientDialog=e.role_name;break;case"modify":case"details":c("This feature will be enabled in a future release. Please try again later.",{style:"info"})}null===(s=this.envelopeUpdated)||void 0===s||s.emit({endpoint:this.endpoint,envelope:null===(t=this.store)||void 0===t?void 0:t.state,event:i})}cancelEnvelope(){this.loading=!0,n(this.endpoint,this.envelopeId).then((async e=>{var i,s;console.log("[SIDEBAR] Envelope canceled",e),c("Envelope canceled",{style:"success"}),this.store=await d(this.endpoint,this.envelopeId,!0),this.sortEnvelopeRecipients(),this.loading=!1,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:null===(s=this.store)||void 0===s?void 0:s.state,event:"canceled"})})).catch((e=>{console.log("[SIDEBAR] Error canceling envelope",e),this.loading=!1,c("Error canceling envelope: "+e.message,{style:"error"})}))}prepareHistoryEntries(){var e,i,s,t,n,o,l,a,d,r,c,v;const p=[],h=(null===(i=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===i?void 0:i.histories)||[];p.push({icon:"pencil",message:"Envelope created.",date:new Date(null===(t=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===t?void 0:t.created_at)}),"complete"===(null===(o=null===(n=this.store)||void 0===n?void 0:n.state)||void 0===o?void 0:o.status)&&p.push({icon:"pencil",message:"Envelope completed.",date:new Date(null===(a=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===a?void 0:a.updated_at)});const w=h.some((e=>"owner:canceled"===e.event));return"canceled"!==(null===(r=null===(d=this.store)||void 0===d?void 0:d.state)||void 0===r?void 0:r.status)||w||p.push({icon:"pencil",message:"Envelope Cancelled.",date:new Date(null===(v=null===(c=this.store)||void 0===c?void 0:c.state)||void 0===v?void 0:v.canceled_at)}),h.forEach((e=>{var i;const s=null===(i=this.store.state)||void 0===i?void 0:i.recipients.find((i=>i.role_name===e.role_name)),t=(null==s?void 0:s.full_name)||"";switch(e.event.toLowerCase()){case"recipient:signed":p.push({icon:"gesture",message:`Signed by ${t}.`,date:new Date(e.created_at)});break;case"recipient:declined":p.push({icon:"clear",message:`Declined by ${t}.`,date:new Date(e.created_at)});break;case"recipient:opened":switch(e.event_detail){case"email":case"mail":p.push({icon:"visibility",message:`Opened by ${t}, via email.`,date:new Date(e.created_at)});break;case"sms":p.push({icon:"visibility",message:`Opened by ${t}, via SMS.`,date:new Date(e.created_at)});break;case"in_person_link":p.push({icon:"visibility",message:`Opened by ${t}, via In-person link.`,date:new Date(e.created_at)});break;case"in_app":p.push({icon:"visibility",message:`Opened by ${t}, via dashboard.`,date:new Date(e.created_at)});break;default:p.push({icon:"visibility",message:`Opened by ${t}.`,date:new Date(e.created_at)})}break;case"recipient:submitted":switch(e.event_detail){case"approver":p.push({icon:"check_circle",message:`Approved by ${t}.`,date:new Date(e.created_at)});break;default:p.push({icon:"send",message:`Submitted by ${t}.`,date:new Date(e.created_at)})}break;case"recipient:prepared":p.push({icon:"send",message:`Prepared by ${t}.`,date:new Date(e.created_at)});break;case"recipient:claimed":"guest"===e.event_detail?p.push({icon:"account_circle",message:`${t} claimed the Verdoc as a guest.`,date:new Date(e.created_at)}):"profile"===e.event_detail&&p.push({icon:"verified_user",message:`${t} claimed the Verdoc as a verified user.`,date:new Date(e.created_at)});break;case"recipient:agreed":p.push({icon:"done",message:`${t} agreed to use electronic records and signatures.`,date:new Date(e.created_at)});break;case"recipient:invited":p.push("sms"===e.event_detail?{icon:"textsms",message:`${t} has been invited via SMS.`,date:new Date(e.created_at)}:{icon:"mail",message:`${t} has been invited via email.`,date:new Date(e.created_at)});break;case"invitation:resent":p.push({icon:"mail",message:`Invitation was resent to ${t} ${"reminder"===e.event_detail?" by reminder":""}.`,date:new Date(e.created_at)});break;case"envelope:cc":p.push({icon:"contact_mail",message:`A copy has been sent to ${t}.`,date:new Date(e.created_at)});break;case"recipient:delegated":p.push({icon:"people",message:e.event_detail,date:new Date(e.created_at)});break;case"recipient:updated_info":case"owner:updated_recipient_info":p.push({icon:"perm_identity",message:e.event_detail,date:new Date(e.created_at)});break;case"created":p.push({icon:"create",message:"Envelope was created.",date:new Date(e.created_at)});break;case"completed":p.push({icon:"done_all",message:"Envelope was completed.",date:new Date(e.created_at)});break;case"canceled":case"owner:canceled":p.push({icon:"cancel",message:"Envelope was canceled by the creator.",date:new Date(e.created_at)});break;case"owner:get_in_person_link":p.push({icon:"link",message:`Owner accessed the In-person link for ${s}.`,date:new Date(e.created_at)});break;default:console.log("[SIDEBAR] Unknown history type",e)}})),p.sort(((e,i)=>i.date.getTime()-e.date.getTime())),p}render(){var e,i,n,l,a,d,c,v,w,g,m,x,b,f,u,y,z,k,M,D,V,B,E,L,H;if(!this.store.state)return s(t,null);const S=this.endpoint.getSession(),_=o(S,this.store.state),$=this.prepareHistoryEntries(),I="pending"!==(null===(i=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===i?void 0:i.status)&&"in progress"!==(null===(l=null===(n=this.store)||void 0===n?void 0:n.state)||void 0===l?void 0:l.status);return s(t,{class:this.panelOpen?"open":""},s("div",{class:"side-buttons"},s("button",{class:1===this.activeTab?"active":"",onClick:()=>this.setTab(1),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>'}),s("button",{class:2===this.activeTab?"active":"",onClick:()=>this.setTab(2),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /></svg>'}),s("button",{class:3===this.activeTab?"active":"",onClick:()=>this.setTab(3),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>'})),1===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"Details"),s("div",{class:"label"},"Envelope ID"),s("div",{class:"value"},null===(d=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===d?void 0:d.id),s("div",{class:"label"},"Date Created"),s("div",{class:"value"},p(new Date(null===(v=null===(c=this.store)||void 0===c?void 0:c.state)||void 0===v?void 0:v.created_at),r)),s("div",{class:"label"},"Last Modified"),s("div",{class:"value"},p(new Date(null===(g=null===(w=this.store)||void 0===w?void 0:w.state)||void 0===g?void 0:g.updated_at),r)),s("div",{class:"label"},"Status"),s("div",{class:"value"},null===(x=null===(m=this.store)||void 0===m?void 0:m.state)||void 0===x?void 0:x.status),s("div",{class:"label"},"Verdoc Owner ID"),s("div",{class:"value"},null===(f=null===(b=this.store)||void 0===b?void 0:b.state)||void 0===f?void 0:f.profile_id),s("div",{class:"label"},"Verdoc Owner Name"),s("div",{class:"value"},null===(z=null===(y=null===(u=this.store)||void 0===u?void 0:u.state)||void 0===y?void 0:y.profile)||void 0===z?void 0:z.first_name," ",null===(D=null===(M=null===(k=this.store)||void 0===k?void 0:k.state)||void 0===M?void 0:M.profile)||void 0===D?void 0:D.last_name),s("div",{class:"label"},"Verdoc Owner Email"),s("div",{class:"value"},null===(E=null===(B=null===(V=this.store)||void 0===V?void 0:V.state)||void 0===B?void 0:B.profile)||void 0===E?void 0:E.email)),2===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"Recipients"),null===(H=null===(L=this.store)||void 0===L?void 0:L.state)||void 0===H?void 0:H.recipients.map(((e,i)=>{const t="submitted"!==e.status&&"canceled"!==e.status&&"declined"!==e.status,n=this.canResendRecipient(e);return s("div",{class:"recipient-detail"},s("div",{class:"recipient-header"},s("div",{class:"recipient-number"},i+1),s("div",{class:"recipient-type"},e.role_name),s("div",{class:{"recipient-status":!0,[e.status]:!0}},e.status),_&&!I&&s("verdocs-dropdown",{onOptionSelected:i=>this.handleRecipientAction(e,i.detail.id),options:[{id:"reminder",label:"Send Reminder",disabled:!n},{id:"inperson",label:"Get In-Person Link",disabled:!t}]})),s("dic",{class:"recipient-content"},s("div",{class:"recipient-name"},e.full_name),s("div",{class:"recipient-name"},e.email),s("div",{class:"recipient-name"},e.phone)))})),_&&s("verdocs-button",{class:"manage-recipients-button",variant:"standard",label:"Cancel Verdoc",onClick:()=>this.showCancelDialog=!I,disabled:I})),3===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"History"),$.map((e=>s("div",{class:"history-entry"},s("div",{class:"activity-icon",innerHTML:h[e.icon]||e.icon}),s("div",{class:"activity-details"},s("div",{class:"activity-text"},e.message),s("div",{class:"activity-date"},p(e.date,r))))))),this.showRecipientDialog&&s("verdocs-envelope-recipient-link",{envelopeId:this.envelopeId,roleName:this.showRecipientDialog,onNext:()=>this.showRecipientDialog=""}),this.showManageDialog&&s("verdocs-envelope-recipient-summary",{envelopeId:this.envelopeId,canView:!1,onAnother:()=>{var e;this.showManageDialog=!1,null===(e=this.another)||void 0===e||e.emit({envelope:this.store.state})},onNext:()=>this.showManageDialog=!1}),this.showCancelDialog&&s("verdocs-ok-dialog",{heading:"Cancel Envelope?",message:"Are you sure you want to cancel this Envelope? This action cannot be undone.",onNext:()=>{this.showCancelDialog=!1,this.cancelEnvelope()}}))}};w.style='verdocs-envelope-sidebar{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;-ms-flex:0 0 56px;flex:0 0 56px;width:56px;min-height:400px;height:100%;background:#41435e;-webkit-transition:0.5s cubic-bezier(0.35, 0, 0.25, 1);transition:0.5s cubic-bezier(0.35, 0, 0.25, 1)}verdocs-envelope-sidebar.open{-ms-flex:0 0 400px;flex:0 0 400px;max-width:100%;width:400px}@media screen and (max-width: 500px){verdocs-envelope-sidebar.open{-ms-flex:0 0 300px;flex:0 0 300px;width:300px}}verdocs-envelope-sidebar .side-buttons{-ms-flex-direction:column;flex-direction:column;-ms-flex:0 0 56px;flex:0 0 56px;display:-ms-flexbox;display:flex}verdocs-envelope-sidebar .side-buttons button{height:50px;outline:none;border:none;border-left:2px solid transparent;background:none;width:100%}verdocs-envelope-sidebar .side-buttons button.active{border-left:2px solid #50bd80}verdocs-envelope-sidebar .side-buttons button svg{color:white;width:24px;height:24px}verdocs-envelope-sidebar .content{-ms-flex:1;flex:1;display:none;color:white;-ms-flex-direction:column;flex-direction:column;padding:12px 16px 16px}verdocs-envelope-sidebar.open .content{display:-ms-flexbox;display:flex;overflow-y:scroll}verdocs-envelope-sidebar verdocs-ok-dialog .content{color:black}verdocs-envelope-sidebar .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px;font-size:16px;line-height:24px;font-weight:400}verdocs-envelope-sidebar .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:14px;font-size:14px;font-weight:500;line-height:16px;color:#fff}verdocs-envelope-sidebar .manage-recipients-button{-ms-flex-item-align:center;align-self:center;white-space:nowrap;width:100%;margin:0 0 10px 0}verdocs-envelope-sidebar .manage-recipients-button .label{color:#ffffff;font-size:14px}verdocs-envelope-sidebar .manage-recipients-button button{width:100%}verdocs-envelope-sidebar .recipient-detail{-ms-flex:0;flex:0;padding:8px;position:relative;-ms-flex-direction:column;flex-direction:column;border:solid 1px #979797;margin-bottom:16px}verdocs-envelope-sidebar .recipient-header{-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;place-content:center space-between;-ms-flex-align:center;align-items:center;margin-bottom:4px}verdocs-envelope-sidebar .recipient-number{width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:24px;font-size:14px;font-weight:500;margin-right:10px;border:solid 1px #979797}verdocs-envelope-sidebar .recipient-type{-ms-flex:1 1 88px;flex:1 1 88px;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:88px;min-width:88px;text-transform:capitalize}verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 100px;flex:1 1 100px;border-radius:5px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100px;min-width:100px;background-color:#616161;text-transform:capitalize;font-size:14px;padding:3px 0}verdocs-envelope-sidebar .recipient-status.invited{background-color:#ff8f00}verdocs-envelope-sidebar .recipient-status.opened{background-color:#616161}verdocs-envelope-sidebar .recipient-status.signed,verdocs-envelope-sidebar .recipient-status.submitted{background-color:#2e7d32}verdocs-envelope-sidebar .recipient-status.pending{background-color:#0277bd}verdocs-envelope-sidebar .recipient-status.canceled,verdocs-envelope-sidebar .recipient-status.declined{background-color:#c62828}@media screen and (max-width: 500px){verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 60px;flex:1 1 60px;max-width:60px;min-width:60px}}verdocs-envelope-sidebar .recipient-content{-ms-flex-direction:column;flex-direction:column}verdocs-envelope-sidebar .recipient-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-envelope-sidebar .history-entry{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:8px 0 0;margin:8px 0 0;border-top:1px solid #dddddd}verdocs-envelope-sidebar .history-entry .activity-icon{margin-right:14px}verdocs-envelope-sidebar .history-entry .activity-icon svg{width:24px;height:24px;fill:#ffffff}verdocs-envelope-sidebar .history-entry .activity-text{font-size:14px;line-height:16px;margin-bottom:4px}verdocs-envelope-sidebar .history-entry .activity-date{font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .content .history-entry:first-of-type{border-top:none}';export{w as verdocs_envelope_sidebar}
|
1
|
+
import{r as e,c as i,h as s,H as t}from"./p-14b44491.js";import{c as n}from"./p-dc2ad047.js";import{u as o}from"./p-29f64c27.js";import{r as l}from"./p-3cd894ff.js";import"./p-05788c2b.js";import{V as a}from"./p-d77962af.js";import{g as d}from"./p-321da456.js";import{F as r}from"./p-1b4e7078.js";import{V as c}from"./p-ed416acf.js";import{S as v}from"./p-7a1b2643.js";import{f as p}from"./p-c220af42.js";import"./p-7648c449.js";const h={visibility:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M12 15a3 3 0 100-6 3 3 0 000 6z" /><path fill-rule="evenodd" d="M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 010-1.113zM17.25 12a5.25 5.25 0 11-10.5 0 5.25 5.25 0 0110.5 0z" clip-rule="evenodd" /></svg>',pencil:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path d="M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z" /></svg>',mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',contact_mail:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/></svg>',done:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M19.916 4.626a.75.75 0 01.208 1.04l-9 13.5a.75.75 0 01-1.154.114l-6-6a.75.75 0 011.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 011.04-.208z" clip-rule="evenodd" /></svg>',send:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/></svg>',gesture:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M4.59 6.89c.7-.71 1.4-1.35 1.71-1.22.5.2 0 1.03-.3 1.52-.25.42-2.86 3.89-2.86 6.31 0 1.28.48 2.34 1.34 2.98.75.56 1.74.73 2.64.46 1.07-.31 1.95-1.4 3.06-2.77 1.21-1.49 2.83-3.44 4.08-3.44 1.63 0 1.65 1.01 1.76 1.79-3.78.64-5.38 3.67-5.38 5.37 0 1.7 1.44 3.09 3.21 3.09 1.63 0 4.29-1.33 4.69-6.1H21v-2.5h-2.47c-.15-1.65-1.09-4.2-4.03-4.2-2.25 0-4.18 1.91-4.94 2.84-.58.73-2.06 2.48-2.29 2.72-.25.3-.68.84-1.11.84-.45 0-.72-.83-.36-1.92.35-1.09 1.4-2.86 1.85-3.52.78-1.14 1.3-1.92 1.3-3.28C8.95 3.69 7.31 3 6.44 3 5.12 3 3.97 4 3.72 4.25c-.36.36-.66.66-.88.93l1.75 1.71zm9.29 11.66c-.31 0-.74-.26-.74-.72 0-.6.73-2.2 2.87-2.76-.3 2.69-1.43 3.48-2.13 3.48z"/></svg>',clear:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',check_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"/></svg>',link:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg>',cancel:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/></svg>',done_all:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M18 7l-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.41L6 19l1.41-1.41L1.83 12 .41 13.41z"/></svg>',create:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',perm_identity:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><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.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>',people:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M16 11c1.66 0 2.99-1.34 2.99-3S17.66 5 16 5c-1.66 0-3 1.34-3 3s1.34 3 3 3zm-8 0c1.66 0 2.99-1.34 2.99-3S9.66 5 8 5C6.34 5 5 6.34 5 8s1.34 3 3 3zm0 2c-2.33 0-7 1.17-7 3.5V19h14v-2.5c0-2.33-4.67-3.5-7-3.5zm8 0c-.29 0-.62.02-.97.05 1.16.84 1.97 1.97 1.97 3.45V19h6v-2.5c0-2.33-4.67-3.5-7-3.5z"/></svg>',contact_email:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M21 8V7l-3 2-3-2v1l3 2 3-2zm1-5H2C.9 3 0 3.9 0 5v14c0 1.1.9 2 2 2h20c1.1 0 1.99-.9 1.99-2L24 5c0-1.1-.9-2-2-2zM8 6c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H2v-1c0-2 4-3.1 6-3.1s6 1.1 6 3.1v1zm8-6h-8V6h8v6z"/></svg>',textsms:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z"/></svg>',verified_user:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#ffffff"><path fill-rule="evenodd" d="M12.516 2.17a.75.75 0 00-1.032 0 11.209 11.209 0 01-7.877 3.08.75.75 0 00-.722.515A12.74 12.74 0 002.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 00.374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 00-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08zm3.094 8.016a.75.75 0 10-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 00-1.06 1.06l2.25 2.25a.75.75 0 001.14-.094l3.75-5.25z" clip-rule="evenodd" /></svg>',account_circle:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 3c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm0 14.2c-2.5 0-4.71-1.28-6-3.22.03-1.99 4-3.08 6-3.08 1.99 0 5.97 1.09 6 3.08-1.29 1.94-3.5 3.22-6 3.22z"/></svg>'},w=class{constructor(s){e(this,s),this.sdkError=i(this,"sdkError",7),this.envelopeUpdated=i(this,"envelopeUpdated",7),this.toggle=i(this,"toggle",7),this.another=i(this,"another",7),this.store=null,this.endpoint=a.getDefault(),this.envelopeId="",this.activeTab=1,this.panelOpen=!1,this.showManageDialog=!1,this.showRecipientDialog="",this.showCancelDialog=!1,this.loading=!0}async componentWillLoad(){var e,i,s;try{if(this.endpoint.loadSession(),!this.envelopeId)return void console.log(`[SIDEBAR] Missing required envelope ID ${this.envelopeId}`);if(!this.endpoint.session)return void console.log("[SIDEBAR] Unable to start session, must be authenticated");this.store=await d(this.endpoint,this.envelopeId,!0),this.sortEnvelopeRecipients(),this.loading=!1}catch(t){console.log("[SIDEBAR] Error loading envelope",t),null===(e=this.sdkError)||void 0===e||e.emit(new v(t.message,null===(i=t.response)||void 0===i?void 0:i.status,null===(s=t.response)||void 0===s?void 0:s.data))}}sortEnvelopeRecipients(){var e,i;null===(i=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===i||i.recipients.sort(((e,i)=>e.sequence===i.sequence?e.order-i.order:e.sequence-i.sequence))}setTab(e){var i;this.panelOpen=e!==this.activeTab||!this.panelOpen,null===(i=this.toggle)||void 0===i||i.emit({open:this.panelOpen}),this.activeTab=e}canResendRecipient(e){var i,s;return!["pending","declined","submitted","canceled"].includes(e.status)&&!["complete","declined","canceled"].includes(null===(s=null===(i=this.store)||void 0===i?void 0:i.state)||void 0===s?void 0:s.status)}handleRecipientAction(e,i){var s,t;switch(console.log("[SIDEBAR] Recipient action",i,e),i){case"reminder":l(this.endpoint,this.envelopeId,e.role_name).then((()=>{c("Reminder Sent",{style:"success"})})).catch((e=>{console.log("[SIDEBAR] Error resending invitation",e),c("Error resending invitation: "+e.message,{style:"error"})}));break;case"inperson":this.showRecipientDialog=e.role_name;break;case"modify":case"details":c("This feature will be enabled in a future release. Please try again later.",{style:"info"})}null===(s=this.envelopeUpdated)||void 0===s||s.emit({endpoint:this.endpoint,envelope:null===(t=this.store)||void 0===t?void 0:t.state,event:i})}cancelEnvelope(){this.loading=!0,n(this.endpoint,this.envelopeId).then((async e=>{var i,s;console.log("[SIDEBAR] Envelope canceled",e),c("Envelope canceled",{style:"success"}),this.store=await d(this.endpoint,this.envelopeId,!0),this.sortEnvelopeRecipients(),this.loading=!1,null===(i=this.envelopeUpdated)||void 0===i||i.emit({endpoint:this.endpoint,envelope:null===(s=this.store)||void 0===s?void 0:s.state,event:"canceled"})})).catch((e=>{console.log("[SIDEBAR] Error canceling envelope",e),this.loading=!1,c("Error canceling envelope: "+e.message,{style:"error"})}))}prepareHistoryEntries(){var e,i,s,t,n,o,l,a,d,r,c,v;const p=[],h=(null===(i=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===i?void 0:i.histories)||[];p.push({icon:"pencil",message:"Envelope created.",date:new Date(null===(t=null===(s=this.store)||void 0===s?void 0:s.state)||void 0===t?void 0:t.created_at)}),"complete"===(null===(o=null===(n=this.store)||void 0===n?void 0:n.state)||void 0===o?void 0:o.status)&&p.push({icon:"pencil",message:"Envelope completed.",date:new Date(null===(a=null===(l=this.store)||void 0===l?void 0:l.state)||void 0===a?void 0:a.updated_at)});const w=h.some((e=>"owner:canceled"===e.event));return"canceled"!==(null===(r=null===(d=this.store)||void 0===d?void 0:d.state)||void 0===r?void 0:r.status)||w||p.push({icon:"pencil",message:"Envelope Cancelled.",date:new Date(null===(v=null===(c=this.store)||void 0===c?void 0:c.state)||void 0===v?void 0:v.canceled_at)}),h.forEach((e=>{var i;const s=null===(i=this.store.state)||void 0===i?void 0:i.recipients.find((i=>i.role_name===e.role_name)),t=(null==s?void 0:s.full_name)||"";switch(e.event.toLowerCase()){case"recipient:signed":p.push({icon:"gesture",message:`Signed by ${t}.`,date:new Date(e.created_at)});break;case"recipient:declined":p.push({icon:"clear",message:`Declined by ${t}.`,date:new Date(e.created_at)});break;case"recipient:opened":switch(e.event_detail){case"email":case"mail":p.push({icon:"visibility",message:`Opened by ${t}, via email.`,date:new Date(e.created_at)});break;case"sms":p.push({icon:"visibility",message:`Opened by ${t}, via SMS.`,date:new Date(e.created_at)});break;case"in_person_link":p.push({icon:"visibility",message:`Opened by ${t}, via In-person link.`,date:new Date(e.created_at)});break;case"in_app":p.push({icon:"visibility",message:`Opened by ${t}, via dashboard.`,date:new Date(e.created_at)});break;default:p.push({icon:"visibility",message:`Opened by ${t}.`,date:new Date(e.created_at)})}break;case"recipient:submitted":switch(e.event_detail){case"approver":p.push({icon:"check_circle",message:`Approved by ${t}.`,date:new Date(e.created_at)});break;default:p.push({icon:"send",message:`Submitted by ${t}.`,date:new Date(e.created_at)})}break;case"recipient:prepared":p.push({icon:"send",message:`Prepared by ${t}.`,date:new Date(e.created_at)});break;case"recipient:claimed":"guest"===e.event_detail?p.push({icon:"account_circle",message:`${t} claimed the Verdoc as a guest.`,date:new Date(e.created_at)}):"profile"===e.event_detail&&p.push({icon:"verified_user",message:`${t} claimed the Verdoc as a verified user.`,date:new Date(e.created_at)});break;case"recipient:agreed":p.push({icon:"done",message:`${t} agreed to use electronic records and signatures.`,date:new Date(e.created_at)});break;case"recipient:invited":p.push("sms"===e.event_detail?{icon:"textsms",message:`${t} has been invited via SMS.`,date:new Date(e.created_at)}:{icon:"mail",message:`${t} has been invited via email.`,date:new Date(e.created_at)});break;case"invitation:resent":p.push({icon:"mail",message:`Invitation was resent to ${t} ${"reminder"===e.event_detail?" by reminder":""}.`,date:new Date(e.created_at)});break;case"envelope:cc":p.push({icon:"contact_mail",message:`A copy has been sent to ${t}.`,date:new Date(e.created_at)});break;case"recipient:delegated":p.push({icon:"people",message:e.event_detail,date:new Date(e.created_at)});break;case"recipient:updated_info":case"owner:updated_recipient_info":p.push({icon:"perm_identity",message:e.event_detail,date:new Date(e.created_at)});break;case"created":p.push({icon:"create",message:"Envelope was created.",date:new Date(e.created_at)});break;case"completed":p.push({icon:"done_all",message:"Envelope was completed.",date:new Date(e.created_at)});break;case"canceled":case"owner:canceled":p.push({icon:"cancel",message:"Envelope was canceled by the creator.",date:new Date(e.created_at)});break;case"owner:get_in_person_link":p.push({icon:"link",message:`Owner accessed the In-person link for ${s}.`,date:new Date(e.created_at)});break;default:console.log("[SIDEBAR] Unknown history type",e)}})),p.sort(((e,i)=>i.date.getTime()-e.date.getTime())),p}render(){var e,i,n,l,a,d,c,v,w,g,m,x,b,f,u,y,z,k,M,D,V,B,E,L,H;if(!this.store.state)return s(t,null);const S=this.endpoint.getSession(),_=o(S,this.store.state),$=this.prepareHistoryEntries(),I="pending"!==(null===(i=null===(e=this.store)||void 0===e?void 0:e.state)||void 0===i?void 0:i.status)&&"in progress"!==(null===(l=null===(n=this.store)||void 0===n?void 0:n.state)||void 0===l?void 0:l.status);return s(t,{class:this.panelOpen?"open":""},s("div",{class:"side-buttons"},s("button",{class:1===this.activeTab?"active":"",onClick:()=>this.setTab(1),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" /></svg>'}),s("button",{class:2===this.activeTab?"active":"",onClick:()=>this.setTab(2),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z" /></svg>'}),s("button",{class:3===this.activeTab?"active":"",onClick:()=>this.setTab(3),innerHTML:'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 002.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 00-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 00.75-.75 2.25 2.25 0 00-.1-.664m-5.8 0A2.251 2.251 0 0113.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25zM6.75 12h.008v.008H6.75V12zm0 3h.008v.008H6.75V15zm0 3h.008v.008H6.75V18z" /></svg>'})),1===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"Details"),s("div",{class:"label"},"Envelope ID"),s("div",{class:"value"},null===(d=null===(a=this.store)||void 0===a?void 0:a.state)||void 0===d?void 0:d.id),s("div",{class:"label"},"Date Created"),s("div",{class:"value"},p(new Date(null===(v=null===(c=this.store)||void 0===c?void 0:c.state)||void 0===v?void 0:v.created_at),r)),s("div",{class:"label"},"Last Modified"),s("div",{class:"value"},p(new Date(null===(g=null===(w=this.store)||void 0===w?void 0:w.state)||void 0===g?void 0:g.updated_at),r)),s("div",{class:"label"},"Status"),s("div",{class:"value"},null===(x=null===(m=this.store)||void 0===m?void 0:m.state)||void 0===x?void 0:x.status),s("div",{class:"label"},"Verdoc Owner ID"),s("div",{class:"value"},null===(f=null===(b=this.store)||void 0===b?void 0:b.state)||void 0===f?void 0:f.profile_id),s("div",{class:"label"},"Verdoc Owner Name"),s("div",{class:"value"},null===(z=null===(y=null===(u=this.store)||void 0===u?void 0:u.state)||void 0===y?void 0:y.profile)||void 0===z?void 0:z.first_name," ",null===(D=null===(M=null===(k=this.store)||void 0===k?void 0:k.state)||void 0===M?void 0:M.profile)||void 0===D?void 0:D.last_name),s("div",{class:"label"},"Verdoc Owner Email"),s("div",{class:"value"},null===(E=null===(B=null===(V=this.store)||void 0===V?void 0:V.state)||void 0===B?void 0:B.profile)||void 0===E?void 0:E.email)),2===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"Recipients"),null===(H=null===(L=this.store)||void 0===L?void 0:L.state)||void 0===H?void 0:H.recipients.map(((e,i)=>{const t="submitted"!==e.status&&"canceled"!==e.status&&"declined"!==e.status,n=this.canResendRecipient(e);return s("div",{class:"recipient-detail"},s("div",{class:"recipient-header"},s("div",{class:"recipient-number"},i+1),s("div",{class:"recipient-type"},e.role_name),s("div",{class:{"recipient-status":!0,[e.status]:!0}},e.status),_&&!I&&s("verdocs-dropdown",{onOptionSelected:i=>this.handleRecipientAction(e,i.detail.id),options:[{id:"reminder",label:"Send Reminder",disabled:!n},{id:"inperson",label:"Get In-Person Link",disabled:!t}]})),s("dic",{class:"recipient-content"},s("div",{class:"recipient-name"},e.full_name),s("div",{class:"recipient-name"},e.email),s("div",{class:"recipient-name"},e.phone)))})),_&&s("verdocs-button",{class:"manage-recipients-button",variant:"standard",label:"Cancel Verdoc",onClick:()=>this.showCancelDialog=!I,disabled:I})),3===this.activeTab&&s("div",{class:"content"},s("div",{class:"title"},"History"),$.map((e=>s("div",{class:"history-entry"},s("div",{class:"activity-icon",innerHTML:h[e.icon]||e.icon}),s("div",{class:"activity-details"},s("div",{class:"activity-text"},e.message),s("div",{class:"activity-date"},p(e.date,r))))))),this.showRecipientDialog&&s("verdocs-envelope-recipient-link",{envelopeId:this.envelopeId,roleName:this.showRecipientDialog,onNext:()=>this.showRecipientDialog=""}),this.showManageDialog&&s("verdocs-envelope-recipient-summary",{envelopeId:this.envelopeId,canView:!1,onAnother:()=>{var e;this.showManageDialog=!1,null===(e=this.another)||void 0===e||e.emit({envelope:this.store.state})},onNext:()=>this.showManageDialog=!1}),this.showCancelDialog&&s("verdocs-ok-dialog",{heading:"Cancel Envelope?",message:"Are you sure you want to cancel this Envelope? This action cannot be undone.",onNext:()=>{this.showCancelDialog=!1,this.cancelEnvelope()}}))}};w.style='verdocs-envelope-sidebar{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;-ms-flex:0 0 56px;flex:0 0 56px;width:56px;min-height:400px;height:100%;background:#41435e;-webkit-transition:0.5s cubic-bezier(0.35, 0, 0.25, 1);transition:0.5s cubic-bezier(0.35, 0, 0.25, 1)}verdocs-envelope-sidebar.open{-ms-flex:0 0 400px;flex:0 0 400px;max-width:100%;width:400px}@media screen and (max-width: 500px){verdocs-envelope-sidebar.open{-ms-flex:0 0 300px;flex:0 0 300px;width:300px}}verdocs-envelope-sidebar .side-buttons{-ms-flex-direction:column;flex-direction:column;-ms-flex:0 0 56px;flex:0 0 56px;display:-ms-flexbox;display:flex}verdocs-envelope-sidebar .side-buttons button{height:50px;outline:none;border:none;border-left:2px solid transparent;background:none;width:100%}verdocs-envelope-sidebar .side-buttons button.active{border-left:2px solid #50bd80}verdocs-envelope-sidebar .side-buttons button svg{color:white;width:24px;height:24px}verdocs-envelope-sidebar .content{-ms-flex:1;flex:1;display:none;color:white;-ms-flex-direction:column;flex-direction:column;padding:12px 16px 16px}verdocs-envelope-sidebar.open .content{display:-ms-flexbox;display:flex;overflow-y:scroll}verdocs-envelope-sidebar verdocs-ok-dialog .content{color:black}verdocs-envelope-sidebar .title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:12px;font-size:16px;line-height:24px;font-weight:400}verdocs-envelope-sidebar .label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:14px;font-size:14px;font-weight:500;line-height:16px;color:#fff}verdocs-envelope-sidebar .manage-recipients-button{-ms-flex-item-align:center;align-self:center;white-space:nowrap;width:100%;margin:0 0 10px 0}verdocs-envelope-sidebar .manage-recipients-button .label{color:#ffffff;font-size:14px}verdocs-envelope-sidebar .manage-recipients-button button{width:100%}verdocs-envelope-sidebar .recipient-detail{-ms-flex:0;flex:0;padding:8px;position:relative;-ms-flex-direction:column;flex-direction:column;border:solid 1px #979797;margin-bottom:16px}verdocs-envelope-sidebar .recipient-header{-ms-flex-direction:row;flex-direction:row;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;place-content:center space-between;-ms-flex-align:center;align-items:center;margin-bottom:4px}verdocs-envelope-sidebar .recipient-number{width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border-radius:24px;font-size:14px;font-weight:500;margin-right:10px;border:solid 1px #979797}verdocs-envelope-sidebar .recipient-type{-ms-flex:1 1 88px;flex:1 1 88px;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:88px;min-width:88px;text-transform:capitalize}verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 100px;flex:1 1 100px;border-radius:5px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100px;min-width:100px;background-color:#616161;text-transform:capitalize;font-size:14px;padding:3px 0}verdocs-envelope-sidebar .recipient-status.invited{background-color:#ff8f00}verdocs-envelope-sidebar .recipient-status.opened{background-color:#616161}verdocs-envelope-sidebar .recipient-status.signed,verdocs-envelope-sidebar .recipient-status.submitted{background-color:#2e7d32}verdocs-envelope-sidebar .recipient-status.pending{background-color:#0277bd}verdocs-envelope-sidebar .recipient-status.canceled,verdocs-envelope-sidebar .recipient-status.declined{background-color:#c62828}@media screen and (max-width: 500px){verdocs-envelope-sidebar .recipient-status{-ms-flex:1 1 60px;flex:1 1 60px;max-width:60px;min-width:60px}}verdocs-envelope-sidebar .recipient-content{-ms-flex-direction:column;flex-direction:column}verdocs-envelope-sidebar .recipient-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}verdocs-envelope-sidebar .history-entry{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;padding:8px 0 0;margin:8px 0 0;border-top:1px solid #dddddd}verdocs-envelope-sidebar .history-entry .activity-icon{margin-right:14px}verdocs-envelope-sidebar .history-entry .activity-icon svg{width:24px;height:24px;fill:#ffffff}verdocs-envelope-sidebar .history-entry .activity-text{font-size:14px;line-height:16px;margin-bottom:4px}verdocs-envelope-sidebar .history-entry .activity-date{font-size:12px;line-height:16px;color:rgba(255, 255, 255, 0.54)}verdocs-envelope-sidebar .content .history-entry:first-of-type{border-top:none}';export{w as verdocs_envelope_sidebar}
|
@@ -1 +1 @@
|
|
1
|
-
System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-
|
1
|
+
System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-034bd59e.system.js","./p-3f628837.system.js"],(function(e){"use strict";var i,l,o,s,r,t;return{setters:[function(e){i=e.r;l=e.c;o=e.h;s=e.H},function(){},function(e){r=e.V},function(e){t=e.u}],execute:function(){var n='verdocs-file-chooser{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-file-chooser .upload-box{text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 15px;color:rgba(0, 0, 0, 0.54)}verdocs-file-chooser .upload-box svg{width:64px;height:64px;fill:#5c6575}verdocs-file-chooser .selected-filename{font-size:20px;font-weight:bold;overflow-wrap:anywhere}verdocs-file-chooser .or-prefer{height:20px;margin:20px 0;font-size:16px}';var c=e("verdocs_file_chooser",function(){function e(e){i(this,e);this.fileSelected=l(this,"fileSelected",7);this.endpoint=r.getDefault();this.file=undefined}e.prototype.handleFileChanged=function(e){var i,l;this.file=((i=e.target.files)===null||i===void 0?void 0:i[0])||null;(l=this.fileSelected)===null||l===void 0?void 0:l.emit({file:this.file});console.debug("[CHOOSER] Selected file",this.file)};e.prototype.handleSelectFile=function(e){var i,l;e.stopPropagation();this.file=null;(i=this.fileSelected)===null||i===void 0?void 0:i.emit({file:null});(l=document.getElementById("verdocs-file-chooser"))===null||l===void 0?void 0:l.click()};e.prototype.render=function(){var e=this;var i=this.file?"Select a different file":"Select a file from your computer";return o(s,null,o("input",{type:"file",multiple:true,id:"verdocs-file-chooser",accept:"application/pdf,.pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document",style:{display:"none"},onChange:function(i){return e.handleFileChanged(i)}}),o("div",{class:"upload-box"},o("div",{class:"selected-filename"},this.file?this.file.name:"Drag a file here"),o("div",{class:"or-prefer"},this.file?t:"Or, if you prefer..."),o("verdocs-button",{label:i,size:"small",onClick:function(i){return e.handleSelectFile(i)}})))};return e}());c.style=n;var a='verdocs-progress-bar{font-family:"Inter", "Barlow", sans-serif;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-progress-bar .labels{display:-ms-flexbox;display:flex;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-progress-bar .labels .label{display:-ms-flexbox;display:flex;font-size:14px;font-weight:600;color:#33364b}verdocs-progress-bar .bar{display:-ms-flexbox;display:flex;-ms-flex:0 0 10px;flex:0 0 10px;border-radius:5px;background-color:#cccccc}verdocs-progress-bar .bar .slider{display:-ms-flexbox;display:flex;border-radius:5px;background-color:#55bc81}';var f=e("verdocs_progress_bar",function(){function e(e){i(this,e);this.label="";this.showPercent=false;this.percent=0}e.prototype.render=function(){var e=Math.ceil(100*Math.min(this.percent,100)/100);return o(s,null,o("div",{class:"labels"},this.label&&o("div",{class:"label"},this.label),this.showPercent&&o("div",{class:"label"},this.percent,"%")),o("div",{class:"bar"},o("div",{class:"slider",style:{width:"".concat(e,"%")}})))};return e}());f.style=a}}}));
|
@@ -1 +1 @@
|
|
1
|
-
import{r as t,c as s,h as i,H as e,a as h}from"./p-14b44491.js";import{m as o}from"./p-dc2ad047.js";import"./p-05788c2b.js";import{V as a}from"./p-
|
1
|
+
import{r as t,c as s,h as i,H as e,a as h}from"./p-14b44491.js";import{m as o}from"./p-dc2ad047.js";import"./p-05788c2b.js";import{V as a}from"./p-d77962af.js";import{t as n}from"./p-b72328af.js";import"./p-eab67c09.js";import"./p-1b4e7078.js";import"./p-c220af42.js";const d=class{constructor(i){t(this,i),this.pageRendered=s(this,"pageRendered",7),this.endpoint=a.getDefault(),this.envelopeId="",this.documentId="",this.pageNumber=1,this.virtualWidth=612,this.virtualHeight=792,this.layers=[{name:"page",type:"canvas"}],this.type="original",this.containerId=`verdocs-envelope-document-page-${Math.random().toString(36).substring(2,11)}`,this.renderedWidth=this.virtualWidth,this.renderedHeight=this.virtualHeight,this.naturalWidth=this.virtualWidth,this.naturalHeight=this.virtualHeight,this.aspectRatio=this.virtualWidth/this.virtualHeight,this.skipFirstNotification=!0,this.pageDisplayUri="https://verdocs-public-assets.s3.amazonaws.com/page-loading-placeholder.png"}async componentWillLoad(){this.pageDisplayUri=await o(this.endpoint,this.envelopeId,this.documentId,this.pageNumber,this.type)}componentDidLoad(){this.resizeObserver=new ResizeObserver(n((t=>{for(const s of t){const t=s.contentRect.width;this.renderedWidth=t,this.renderedHeight=this.virtualHeight*(t/this.virtualWidth)}this.notifyRenderedSize()}),100)),this.resizeObserver.observe(this.container)}disconnectedCallback(){var t;null===(t=this.resizeObserver)||void 0===t||t.disconnect(),console.log("[PAGE] Disconnected",this.containerId)}notifyRenderedSize(){this.skipFirstNotification?this.skipFirstNotification=!1:this.pageRendered.emit({containerId:this.containerId,documentId:this.documentId,pageNumber:this.pageNumber,virtualWidth:this.virtualWidth,virtualHeight:this.virtualHeight,renderedWidth:this.renderedWidth,renderedHeight:this.renderedHeight,naturalWidth:this.naturalWidth,naturalHeight:this.naturalHeight,aspectRatio:this.aspectRatio,xScale:this.renderedWidth/this.virtualWidth,yScale:this.renderedHeight/this.virtualHeight})}render(){const t=`${this.renderedHeight}px`;return i(e,{id:`${this.containerId}`,style:{height:t,flex:`0 0 ${t}`}},this.layers.map((s=>"div"===s.type?i("div",{class:"verdocs-envelope-document-page-layer",id:`${this.containerId}-${s.name}`,style:{height:t}}):this.pageDisplayUri?i("img",{class:"verdocs-envelope-document-page-layer img",id:`${this.containerId}-${s.name}`,src:this.pageDisplayUri,alt:`Page ${this.pageNumber}`,"aria-hidden":!0,loading:"lazy",onLoad:t=>{this.naturalWidth=t.target.naturalWidth,this.naturalHeight=t.target.naturalHeight,this.aspectRatio=this.naturalWidth/this.naturalHeight,this.virtualHeight=this.virtualWidth/this.aspectRatio,this.renderedHeight=t.target.offsetWidth/this.aspectRatio}}):i("div",null))))}get container(){return h(this)}};d.style="verdocs-envelope-document-page{width:100%;position:relative}verdocs-envelope-document-page .verdocs-envelope-document-page-layer{position:absolute;top:0;left:0;right:0;bottom:0;-webkit-box-shadow:0 0 10px 5px #0000000f;box-shadow:0 0 10px 5px #0000000f}verdocs-envelope-document-page .verdocs-envelope-document-page-layer.img{width:100%}";export{d as verdocs_envelope_document_page}
|
@@ -1 +1 @@
|
|
1
|
-
import{r as t,c as e,h as r,H as s}from"./p-14b44491.js";import{V as i}from"./p-
|
1
|
+
import{r as t,c as e,h as r,H as s}from"./p-14b44491.js";import{V as i}from"./p-d77962af.js";import"./p-05788c2b.js";const a=class{constructor(r){t(this,r),this.starChange=e(this,"starChange",7),this.sdkError=e(this,"sdkError",7),this.endpoint=i.getDefault(),this.template=void 0,this.updating=!1}async componentWillLoad(){this.endpoint.loadSession(),this.endpoint.session||console.log("[TEMPLATES] Must be authenticated")}toggle(t){var e,r;t.stopPropagation(),this.updating=!0,(e=i.getDefault(),r=this.template.id,e.api.post("/templates/".concat(r,"/stars/toggle")).then((function(t){return t.data}))).then((t=>{this.updating=!1,this.template.star_counter=t.star_counter,this.starChange.emit({templateId:this.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((t=>{this.updating=!1,console.log("[STAR] Error toggling template star",t.message),this.sdkError.emit(t)}))}render(){return r(s,null,r("div",{class:"star "+(this.updating?"updating":""),innerHTML:this.template.star_counter?'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>':'<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>',onClick:t=>this.toggle(t)}),r("div",{class:"count"},this.template.star_counter||"--"))}};a.style='verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}';export{a as verdocs_template_star}
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function l(e){try{a(i["throw"](e))}catch(e){r(e)}}function a(e){e.done?n(e.value):o(e.value).then(s,l)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return a([e,t])}}function a(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){n.label=s[1];break}if(s[0]===6&&n.label<r[1]){n.label=r[1];r=s;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(s);break}if(r[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];o=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function s(e){try{a(i.next(e))}catch(e){r(e)}}function l(e){try{a(i["throw"](e))}catch(e){r(e)}}function a(e){e.done?n(e.value):o(e.value).then(s,l)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(e){return function(t){return a([e,t])}}function a(s){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,o&&(r=s[0]&2?o["return"]:s[0]?o["throw"]||((r=o["return"])&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;if(o=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;o=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(r=n.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){n.label=s[1];break}if(s[0]===6&&n.label<r[1]){n.label=r[1];r=s;break}if(r&&n.label<r[2]){n.label=r[2];n.ops.push(s);break}if(r[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];o=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-034bd59e.system.js","./p-49139f23.system.js","./p-187b20b7.system.js","./p-3af6b910.system.js","./p-8324a7a3.system.js","./p-95080569.system.js"],(function(e){"use strict";var t,n,i,o,r,s,l,a;return{setters:[function(e){t=e.r;n=e.c;i=e.h;o=e.H;r=e.a},function(){},function(e){s=e.V},function(e){l=e.g},function(e){a=e.S},function(){},function(){},function(){}],execute:function(){var d='verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", 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{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 #0000007f;box-shadow:1px 1px 6px -2px #0000007f}@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}';var p=e("verdocs_build",function(){function e(e){t(this,e);this.sdkError=n(this,"sdkError",7);this.stepChanged=n(this,"stepChanged",7);this.send=n(this,"send",7);this.templateUpdated=n(this,"templateUpdated",7);this.templateCreated=n(this,"templateCreated",7);this.rolesUpdated=n(this,"rolesUpdated",7);this.endpoint=s.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onTemplateIdChanged=function(e){console.log("Template ID changed",e);this.loadTemplate(e).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.onStepChanged=function(e){console.log("Step changed",e);this.loadTemplate(this.templateId).catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,n;return __generator(this,(function(i){try{this.endpoint.loadSession();if(!this.templateId){console.log("[BUILD] No template ID, activating upload mode");this.step="attachments";return[2]}if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return[2]}this.loadTemplate(this.templateId).catch((function(e){return console.log("[BUILD] Unable to load template",e)}))}catch(i){console.log("[BUILD] Error loading template",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new a(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(n=i.response)===null||n===void 0?void 0:n.data))}return[2]}))}))};e.prototype.loadTemplate=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!e)return[3,2];console.log("Loading store",e);t=this;return[4,l(this.endpoint,e,false)];case 1:t.store=n.sent();n.label=2;case 2:return[2]}}))}))};e.prototype.handleCancel=function(e){console.log("Cancel",e.detail);this.step="preview"};e.prototype.handleTemplateCreated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.loadTemplate(e)];case 1:n.sent();this.templateId=e;this.step="roles";(t=this.stepChanged)===null||t===void 0?void 0:t.emit("roles");return[2]}}))}))};e.prototype.handleRolesUpdated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){(t=this.templateUpdated)===null||t===void 0?void 0:t.emit(e.detail);return[2]}))}))};e.prototype.handleTemplateUpdated=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){(t=this.templateUpdated)===null||t===void 0?void 0:t.emit(e.detail);return[2]}))}))};e.prototype.handleAttachmentsNext=function(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")};e.prototype.handleRolesNext=function(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")};e.prototype.handleStepChanged=function(e){var t;console.log("osc",e);this.step=e;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e)};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return i(o,null,i("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.store){console.log("[BUILD] No template ID, rendering created view");return i(o,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:"attachments",onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),i("verdocs-template-create",{endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateCreated:function(t){return e.handleTemplateCreated(t.detail.templateId)}})))}console.log("[BUILD] Rendering build view",this.templateId,this.step,["attachments","roles","settings","fields","preview"].indexOf(this.step));return i(o,null,i("div",{class:"content"},i("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:function(t){var n;return(n=e.sdkError)===null||n===void 0?void 0:n.emit(t.detail)},onStepChanged:function(t){return e.handleStepChanged(t.detail)}}),this.step==="attachments"&&i("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleAttachmentsNext()},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="roles"&&i("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:function(t){return e.handleCancel(t)},onNext:function(){return e.handleRolesNext()},onRolesUpdated:function(t){return e.handleRolesUpdated(t)}}),this.step==="settings"&&i("div",{style:{flexDirection:"column",gap:"20px",display:"flex",maxWidth:"400px",margin:"20px"}},i("verdocs-template-name",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),i("verdocs-template-reminders",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),i("verdocs-template-visibility",{templateId:this.templateId,endpoint:this.endpoint,style:{backgroundColor:"#ffffff",padding:"20px"},onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}})),this.step==="fields"&&i("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:function(t){return e.handleTemplateUpdated(t)}}),this.step==="preview"&&i("div",{class:"preview-container"},i("div",{class:"preview-send-wrapper"},i("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:function(t){var n;return(n=e.send)===null||n===void 0?void 0:n.emit(t.detail)},style:{width:"100%"}})),i("div",{class:"preview-preview-wrapper"},i("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{templateId:["onTemplateIdChanged"],step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());p.style=d}}}));
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,n,r){function a(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function i(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):a(t.value).then(i,s)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(t){return function(e){return l([t,e])}}function l(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,a&&(o=i[0]&2?a["return"]:i[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,i[1])).done)return o;if(a=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;a=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){n.label=i[1];break}if(i[0]===6&&n.label<o[1]){n.label=o[1];o=i;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(i);break}if(o[2])n.ops.pop();n.trys.pop();continue}i=e.call(t,n)}catch(t){i=[6,t];a=0}finally{r=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,n,r){function a(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,o){function i(t){try{l(r.next(t))}catch(t){o(t)}}function s(t){try{l(r["throw"](t))}catch(t){o(t)}}function l(t){t.done?n(t.value):a(t.value).then(i,s)}l((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,a,o,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(t){return function(e){return l([t,e])}}function l(i){if(r)throw new TypeError("Generator is already executing.");while(n)try{if(r=1,a&&(o=i[0]&2?a["return"]:i[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,i[1])).done)return o;if(a=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:n.label++;return{value:i[1],done:false};case 5:n.label++;a=i[1];i=[0];continue;case 7:i=n.ops.pop();n.trys.pop();continue;default:if(!(o=n.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){n=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){n.label=i[1];break}if(i[0]===6&&n.label<o[1]){n.label=o[1];o=i;break}if(o&&n.label<o[2]){n.label=o[2];n.ops.push(i);break}if(o[2])n.ops.pop();n.trys.pop();continue}i=e.call(t,n)}catch(t){i=[6,t];a=0}finally{r=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-fbb8023f.system.js","./p-034bd59e.system.js","./p-54498887.system.js"],(function(t){"use strict";var e,n,r,a,o;return{setters:[function(t){e=t.r;n=t.c;r=t.h;a=t.H},function(t){o=t.V},function(){}],execute:function(){var i=function(t,e){return t.api.post("/templates/".concat(e,"/stars/toggle")).then((function(t){return t.data}))};var s='verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}';var l='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>';var c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>';var u=t("verdocs_template_star",function(){function t(t){e(this,t);this.starChange=n(this,"starChange",7);this.sdkError=n(this,"sdkError",7);this.endpoint=o.getDefault();this.template=undefined;this.updating=false}t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return[2]}return[2]}))}))};t.prototype.toggle=function(t){var e=this;t.stopPropagation();this.updating=true;i(o.getDefault(),this.template.id).then((function(t){e.updating=false;e.template.star_counter=t.star_counter;e.starChange.emit({templateId:e.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((function(t){e.updating=false;console.log("[STAR] Error toggling template star",t.message);e.sdkError.emit(t)}))};t.prototype.render=function(){var t=this;return r(a,null,r("div",{class:"star ".concat(this.updating?"updating":""),innerHTML:this.template.star_counter?c:l,onClick:function(e){return t.toggle(e)}}),r("div",{class:"count"},this.template.star_counter||"--"))};return t}());u.style=s}}}));
|
@@ -0,0 +1 @@
|
|
1
|
+
import{r as e,c as t,h as i}from"./p-14b44491.js";import{d as s}from"./p-05788c2b.js";import{V as l}from"./p-d77962af.js";import{c as o}from"./p-3e607686.js";import{V as a}from"./p-ed416acf.js";import{S as n}from"./p-7a1b2643.js";const r=[{value:"",label:""},{value:"Accounting & Tax",label:"Accounting & Tax"},{value:"Business Services / Consulting",label:"Business Services / Consulting"},{value:"Construction",label:"Construction"},{value:"Education",label:"Education"},{value:"Financial Services",label:"Financial Services"},{value:"Government",label:"Government"},{value:"Healthcare - Health Plans & Payers",label:"Healthcare - Health Plans & Payers"},{value:"Healthcare - Providers",label:"Healthcare - Providers"},{value:"Insurance",label:"Insurance"},{value:"Legal",label:"Legal"},{value:"Life Sciences",label:"Life Sciences"},{value:"Manufacturing",label:"Manufacturing"},{value:"Mortgage",label:"Mortgage"},{value:"Not For Profit",label:"Not For Profit"},{value:"Real Estate - Commercial",label:"Real Estate - Commercial"},{value:"Real Estate - Residential",label:"Real Estate - Residential"},{value:"Retail",label:"Retail"},{value:"Technology",label:"Technology"},{value:"Other",label:"Other"}],u=[{value:"",label:""},{value:"I want to send a document for signature.",label:"I want to send a document for signature."},{value:"I just need to sign a document today.",label:"I just need to sign a document today."},{value:"I'm evaluating it for my business.",label:"I'm evaluating it for my business."},{value:"I'm evaluating it for my personal use.",label:"I'm evaluating it for my personal use."},{value:"I'm a developer building an integration.",label:"I'm a developer building an integration."}],d=[{value:"",label:""},{value:"Solo",label:"Solo"},{value:"2-10",label:"2-10"},{value:"11-50",label:"11-50"},{value:"51-200",label:"51-200"},{value:"201-500",label:"201-500"},{value:"501-1000",label:"501-1000"},{value:"1000+",label:"1000+"}],h=class{constructor(i){e(this,i),this.authenticated=t(this,"authenticated",7),this.sdkError=t(this,"sdkError",7),this.recheckTimer=null,this.resendDisabledTimer=null,this.accessTokenForVerification=null,this.endpoint=l.getDefault(),this.visible=!0,this.logo="https://app.verdocs.com/assets/blue-logo.svg",this.isAuthenticated=!1,this.displayMode="login",this.orgname="",this.first="",this.last="",this.username="",this.phone="",this.password="",this.submitting=!1,this.activeSession=null,this.accountType="org",this.howHear="",this.industry="",this.companySize="",this.reason="",this.signupStep=1,this.resendDisabled=!1,this.checkingOrg=!1}componentWillLoad(){var e,t;this.endpoint.loadSession(),this.endpoint.session?(console.log("[AUTH] Authenticated"),this.isAuthenticated=!0,this.activeSession=this.endpoint.session,null===(e=this.authenticated)||void 0===e||e.emit({authenticated:!0,session:this.endpoint.session})):(console.log("[AUTH] Anonymous"),null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!1,session:null}))}disconnectedCallback(){this.cancelRecheckTimer()}cancelRecheckTimer(){if(this.recheckTimer){try{clearTimeout(this.recheckTimer)}catch(e){}this.recheckTimer=null}if(this.resendDisabledTimer){try{clearTimeout(this.resendDisabledTimer)}catch(e){}this.resendDisabledTimer=null}}handleSignup(){this.submitting=!0,this.accessTokenForVerification=null,o(this.endpoint,{email:this.username,password:this.password,firstName:this.first,lastName:this.last,orgName:this.orgname}).then((e=>{console.log("Result",e),console.log("[AUTH] Created profile",e.profile),console.log("[AUTH] Created organization",e.organization),this.loginAndCheckVerification()})).catch((e=>{var t,i,s,l,o,r;console.log("[AUTH] Signup error",e.response),this.submitting=!1,this.activeSession=null,null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!1,session:null}),null===(i=this.sdkError)||void 0===i||i.emit(new n(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(l=e.response)||void 0===l?void 0:l.data)),a("Signup failed: "+(null===(r=null===(o=e.response)||void 0===o?void 0:o.data)||void 0===r?void 0:r.message)||"Unknown Error",{style:"error"})}))}loginAndCheckVerification(){var e,t;this.submitting=!0,this.accessTokenForVerification=null,(e=this.endpoint,t={username:this.username,password:this.password},e.api.post("/authentication/login",t).then((function(e){return e.data}))).then((e=>{var t;this.cancelRecheckTimer(),this.submitting=!1;const i=s(e.accessToken);console.log("[AUTH] Got access token body",i),(null==i?void 0:i.email_verified)?(console.log("[AUTH] Email address is verified, completing login"),this.displayMode="login",this.accessTokenForVerification=null,this.endpoint.setToken(e.accessToken),this.activeSession=this.endpoint.session,this.isAuthenticated=!0,null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!0,session:this.endpoint.session})):(console.log("[AUTH] Logged in, pending email address verification"),this.displayMode="verify",this.accessTokenForVerification=e.accessToken,this.recheckTimer=setTimeout((()=>this.loginAndCheckVerification()),5e3))})).catch((e=>{var t,i,s,l;this.cancelRecheckTimer(),console.log("[AUTH] Authentication error",e.response,JSON.stringify(e)),this.displayMode="login",this.submitting=!1,this.activeSession=null,null===(t=this.authenticated)||void 0===t||t.emit({authenticated:!1,session:null}),null===(i=this.sdkError)||void 0===i||i.emit(new n(e.message,null===(s=e.response)||void 0===s?void 0:s.status,null===(l=e.response)||void 0===l?void 0:l.data)),a("Login failed. Please check your username and password and try again.",{style:"error"})}))}handleLogout(){var e;this.endpoint.clearSession(),this.isAuthenticated=!1,this.accessTokenForVerification=null,null===(e=this.authenticated)||void 0===e||e.emit({authenticated:!1,session:null})}handleResend(){var e,t;this.resendDisabled=!0,this.resendDisabledTimer=setTimeout((()=>{this.resendDisabled=!1,this.resendDisabledTimer=null}),3e4),(e=this.endpoint,t=this.accessTokenForVerification,e.api.post("/user/email_verification",{},t?{headers:{Authorization:"Bearer ".concat(t)}}:{}).then((function(e){return e.data}))).then((e=>{console.log("[AUTH] Verification request resent",e),a("Please check your email for a message with verification instructions.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to resend verification",e)}))}handleReset(){var e,t;this.submitting=!0,(e=this.endpoint,t={email:this.username},e.api.post("/user/reset_password",t).then((function(e){return e.data}))).then((e=>{console.log("[AUTH] Reset sent",e),this.submitting=!1,this.displayMode="login",a("If your email address is registered, you will receive instructions on resetting your password shortly.",{style:"info"})})).catch((e=>{console.log("[AUTH] Unable to reset password",e),this.submitting=!1}))}render(){if(!this.visible)return i("div",{style:{display:"none"}},"Authenticated");if(this.isAuthenticated)return i("verdocs-button",{label:"Sign Out",disabled:this.submitting,onClick:()=>this.handleLogout(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}});if("signup"===this.displayMode){const e=this.submitting||!this.first||!this.last||!this.username||!this.password||!this.orgname;return i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Sign up for a trial account"),i("h4",null,"Already have an account?",i("verdocs-button",{label:"Log In",variant:"text",onClick:()=>this.displayMode="login",disabled:this.submitting})),1===this.signupStep&&i("form",{onSubmit:()=>this.handleSignup()},i("div",{style:{display:"flex",flexDirection:"row",columnGap:"20px"}},i("verdocs-text-input",{label:"First Name",autocomplete:"first",required:!0,value:this.first,onInput:e=>this.first=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Last Name",autocomplete:"last",required:!0,value:this.last,onInput:e=>this.last=e.target.value,disabled:this.submitting})),i("verdocs-text-input",{label:"Email",autocomplete:"email",required:!0,value:this.username,onInput:e=>this.username=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Phone #",autocomplete:"phone",value:this.phone,onInput:e=>this.phone=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",required:!0,autocomplete:"current-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Organization Name",autocomplete:"org",required:!0,value:this.orgname,onInput:e=>this.orgname=e.target.value,disabled:this.submitting,style:{flex:"1"}}),i("div",{style:{marginTop:"30px"}}),i("verdocs-button",{label:"Next",disabled:e,onClick:()=>this.signupStep=2,style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),2===this.signupStep&&i("form",{onSubmit:()=>this.handleSignup()},i("verdocs-text-input",{label:"How did you hear about Verdocs?",value:this.howHear,onInput:e=>this.howHear=e.target.value,disabled:this.submitting}),i("verdocs-select-input",{label:"Your Industry",options:r,value:this.industry,onInput:e=>this.industry=e.target.value,disabled:this.submitting}),i("verdocs-select-input",{label:"Company Size",options:d,value:this.companySize,onInput:e=>this.companySize=e.target.value,disabled:this.submitting}),i("verdocs-select-input",{label:"Purpose",options:u,value:this.reason,onInput:e=>this.reason=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("verdocs-button",{label:"Create Account",disabled:this.submitting,onClick:()=>this.handleSignup(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})),3===this.signupStep&&i("form",{onSubmit:()=>this.handleSignup()},i("p",null,"Please check your e-mail inbox for a verification code and follow the instructions provided."),i("p",null,i("em",null,"Verification messages may take up to 1 hour to arrive. If you do not receive the invitation, ",i("a",{href:"#"},"Click Here")," to resend it. Be sure to check your spam folder.")),i("div",{style:{display:"flex",flexDirection:"row",gap:"20px"}},i("verdocs-button",{label:"Back",disabled:this.submitting,onClick:()=>{this.signupStep=2},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}),i("verdocs-button",{label:"Go to Dashboard",disabled:!0,onClick:()=>this.handleSignup(),style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}}))))}return"forgot"===this.displayMode?i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Forgot your password?"),i("p",null,"Enter your e-mail address below, and reset instructions will be sent to your Inbox."),i("p",null,i("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),i("form",{onSubmit:()=>this.handleSignup()},i("verdocs-text-input",{label:"Email",autocomplete:"email",required:!0,value:this.username,onInput:e=>this.username=e.target.value,disabled:this.submitting}),i("div",{style:{marginTop:"30px"}}),i("div",{class:"buttons"},i("verdocs-button",{label:"Cancel",variant:"outline",disabled:this.submitting,onClick:()=>this.displayMode="login"}),i("verdocs-button",{label:"Reset",disabled:this.submitting,onClick:()=>this.handleReset()})))):"verify"===this.displayMode?i("div",{class:"form"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),i("h3",null,"Please Verify your Email Address"),i("p",null,"Check your e-mail inbox for a verification email, and follow the instructions provided."),i("p",null,i("em",null,"Please allow up to 24 hours for delivery, and check your spam folder if you do not receive the message. ")),i("div",{class:"buttons"},i("verdocs-button",{label:"Sign Out",variant:"outline",disabled:this.submitting,onClick:()=>{this.username="",this.password="",this.cancelRecheckTimer(),this.displayMode="login"}}),i("verdocs-button",{label:"Resend Email",disabled:this.resendDisabled,onClick:()=>this.handleResend()}))):i("div",{class:"form"},i("a",{href:"https://verdocs.com/en/"},i("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"})),i("h3",null,"Log in to your account"),i("h4",null,"Don't have an account?",i("verdocs-button",{label:"Sign Up",variant:"text",onClick:()=>{this.displayMode="signup",this.signupStep=1},disabled:this.submitting})),i("form",{onSubmit:()=>this.loginAndCheckVerification()},i("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onInput:e=>this.username=e.target.value,disabled:this.submitting}),i("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onInput:e=>this.password=e.target.value,disabled:this.submitting}),i("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:()=>this.displayMode="forgot",disabled:this.submitting,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),i("verdocs-button",{label:"Login",disabled:this.submitting,onClick:()=>this.loginAndCheckVerification(),style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})))}};h.style='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .form{background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth h4 verdocs-button button.normal .button-label{padding:0}verdocs-auth .buttons{gap:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}verdocs-auth .account-option{gap:8px;margin:20px 0 8px 0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-auth p+p{margin-top:0}verdocs-auth verdocs-help-icon{margin-top:18px;display:-ms-flexbox;display:flex;width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px}';export{h as verdocs_auth}
|
@@ -1 +1 @@
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))e[s]=t[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{a(o.next(e))}catch(e){n(e)}}function l(e){try{a(o["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):s(e.value).then(r,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,s,n,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return a([e,t])}}function a(r){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,s&&(n=r[0]&2?s["return"]:r[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,r[1])).done)return n;if(s=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;s=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){i.label=r[1];break}if(r[0]===6&&i.label<n[1]){i.label=n[1];n=r;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(r);break}if(n[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];s=0}finally{o=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,s=t.length,n;o<s;o++){if(n||!(o in t)){if(!n)n=Array.prototype.slice.call(t,0,o);n[o]=t[o]}}return e.concat(n||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-f246348c.system.js","./p-95080569.system.js","./p-8324a7a3.system.js","./p-d0d9ac6d.system.js","./p-0cafdb16.system.js","./p-187b20b7.system.js","./p-8aae8d16.system.js","./p-877c2b06.system.js","./p-05eb4fed.system.js","./p-6e9af353.system.js","./p-3f628837.system.js","./p-ca13070e.system.js","./p-3af6b910.system.js","./p-bbee73c8.system.js","./p-173e86c3.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,i,o,s,n,r,l,a,d,c,p,u,h,m,v,f,g,b,x,y,w,_,k,S,I,E,C,P;return{setters:[function(e){t=e.r;i=e.c;o=e.h;s=e.H},function(){},function(e){n=e.V;r=e.b;l=e.u},function(e){a=e.g},function(e){d=e.g;c=e.b;p=e.a},function(e){u=e.g},function(e){h=e.r},function(e){m=e.S},function(e){v=e.j},function(e){f=e.a;g=e.i},function(e){b=e.g},function(e){x=e.c;y=e.d},function(e){w=e.D;_=e.P;k=e.J;S=e.a;I=e.F;E=e.b;C=e.T},function(e){P=e.V},function(){},function(){},function(){},function(){}],execute:function(){var D=function(e,t,i){return e.api.post("/templates/".concat(t,"/reminder/"),i).then((function(e){return e.data}))};var L=function(e,t,i,o){return e.api.put("/templates/".concat(t,"/reminder/").concat(i),o).then((function(e){return e.data}))};var T=function(e,t,i){return e.api.delete("/templates/".concat(t,"/reminder/").concat(i)).then((function(e){return e.data}))};var z='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;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-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var R=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=n.getDefault();this.templateId=null;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;var o=this;return __generator(this,(function(s){try{this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}u(this.endpoint,this.templateId,true).then((function(e){var t,i;o.templateStore=e;console.log("[PREVIEW] Loaded Template Store",e.state);o.fieldStore=a(o.templateId);o.roleStore=d(o.templateId);console.log("RS",(t=o.roleStore)===null||t===void 0?void 0:t.state);console.log("FS",(i=o.fieldStore)===null||i===void 0?void 0:i.state);console.log("[PREVIEW] Loaded template",o.templateStore.state,o.roleStore.get("roles"),o.fieldStore.get("fields"));o.loading=false})).catch((function(e){console.log(e)}))}catch(o){console.log("[PREVIEW] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){var t,i;var o=e.detail;var s=(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.fields.filter((function(e){return e.page_sequence===o.pageNumber}));console.log("[PREVIEW] Page rendered",o,s);s.forEach((function(e){return h(e,o,{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,i;if(this.loading){return o(s,null,o("verdocs-loader",null))}var n=__spreadArray([],(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.pages,true);n.sort((function(e,t){return e.sequence-t.sequence}));return o(s,null,n.map((function(t){return o("verdocs-template-document-page",{templateId:t.template_id,documentId:t.document_id,pageNumber:t.sequence,disabled:true,editable:true,done:false,virtualWidth:612,virtualHeight:792,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))};return e}());R.style=z;var U='verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:none}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 #97979744}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:#00000089}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-direction:row;flex-direction:row}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)}';var A='<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>';var N='<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>';var M='<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>';var j='<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>';var H=e("verdocs_send",function(){function e(e){t(this,e);this.sendingEnvelope=i(this,"sendingEnvelope",7);this.send=i(this,"send",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.searchContacts=i(this,"searchContacts",7);this.levels=[];this.templateStore=null;this.roleStore=null;this.endpoint=n.getDefault();this.templateId=null;this.environment="web";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={}}e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r,l,a,c;var p=this;return __generator(this,(function(h){switch(h.label){case 0:h.trys.push([0,2,,3]);r=this.endpoint.loadSession();if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SEND] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,u(this.endpoint,this.templateId,false)];case 1:l.templateStore=h.sent();this.roleStore=d(this.templateId);if(!((t=(e=this.templateStore)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_sendable)){console.warn("[SEND] Template is not sendable",this.templateId)}if(this.roleStore.get("roles")){a={};this.rolesCompleted={};this.roleStore.get("roles").forEach((function(e){var t=e.sequence-1;a[t]||(a[t]=[]);var i="r-".concat(t,"-").concat(a[t].length);a[t].push(__assign(__assign({},e),{id:i}));if(e.full_name&&(e.email||e.phone)){p.rolesCompleted[i]=__assign(__assign({},e),{id:i})}}));this.rolesAtLevel=a;this.levels=Object.keys(a).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((i=r===null||r===void 0?void 0:r.session)===null||i===void 0?void 0:i.profile){this.sessionContacts.push({id:r.session.profile.id,name:"".concat(r.session.profile.first_name," ").concat(r.session.profile.last_name),email:r.session.profile.email,phone:r.session.profile.phone})}return[3,3];case 2:c=h.sent();console.log("[SEND] Error with preview session",c);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new m(c.message,(s=c.response)===null||s===void 0?void 0:s.status,(n=c.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return o("div",{class:"level-icon",innerHTML:N})}else if(e>=this.levels.length){return o("div",{class:"level-icon",innerHTML:j})}else{return o("div",{class:"level-icon",innerHTML:M})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var i,o,s;if(this.sending){console.log("Skipping duplicate send",e);return}console.log("Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;(i=this.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:true});var n={template_id:this.templateId,name:(s=(o=this.templateStore)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",n);v(this.endpoint,n).then((function(e){var i,o;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(i=t.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:false});(o=t.send)===null||o===void 0?void 0:o.emit(__assign(__assign({},n),{envelope_id:e.id,envelope:e}))})).catch((function(e){var i;console.log("Send error",e);t.sending=false;(i=t.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:false})}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,i;var n=c(this.roleStore);var r=Object.values(this.rolesCompleted).filter((function(e){return f(e.email)||g(e.phone)}));var l=r.length>=n.length;return o(s,{class:{sendable:(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_sendable}},o("div",{class:"recipients"},o("div",{class:"left-line"}),o("div",{class:"level level-start"},this.getLevelIcon(-1),o("div",{class:"complete"},"Send Envelope")),this.levels.map((function(t){return o("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var i,s,n,r,l,a;var d=!t.email;var c="verdocs-send-recipient-".concat(t.name);return d?o("div",{class:"recipient",style:{backgroundColor:b(p(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(s=(i=e.rolesCompleted[t.id])===null||i===void 0?void 0:i.full_name)!==null&&s!==void 0?s:t.name,o("div",{class:"icon",innerHTML:A}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(n=e.rolesCompleted[t.id])!==null&&n!==void 0?n:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}}))):o("div",{class:"recipient",style:{borderColor:b(p(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(l=(r=e.rolesCompleted[t.id])===null||r===void 0?void 0:r.full_name)!==null&&l!==void 0?l:t.full_name,o("div",{class:"icon",innerHTML:A}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(a=e.rolesCompleted[t.id])!==null&&a!==void 0?a:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}})))})))})),o("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),o("div",{class:"complete"},"Signing Complete"))),o("div",{class:"buttons"},o("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),o("verdocs-button",{label:"Send",size:"small",disabled:!l||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&o("verdocs-spinner",null)))};return e}());H.style=U;var F='verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';var B=e("verdocs_template_attachments",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.templateUpdated=i(this,"templateUpdated",7);this.sdkError=i(this,"sdkError",7);this.endpoint=n.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.store=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}o=this;return[4,u(this.endpoint,this.templateId,false)];case 1:o.store=n.sent();return[3,3];case 2:s=n.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,s,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:e.stopPropagation();n=e.detail.file;if(!n){return[2]}console.log("[ATTACHMENTS] Uploading...",n);this.uploading=true;this.progressLabel="Uploading...";d.label=1;case 1:d.trys.push([1,4,,5]);return[4,x(this.endpoint,this.templateId,n,this.handleUploadProgress.bind(this))];case 2:r=d.sent();console.log("[ATTACHMENTS] Created attachment",r);l=this;return[4,u(this.endpoint,this.templateId,false)];case 3:l.store=d.sent();console.log("[ATTACHMENTS] Updated template",this.store.state);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=d.sent();console.log("[ATTACHMENTS] Error creating template",a);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(a.message,(o=a.response)===null||o===void 0?void 0:o.status,(s=a.response)===null||s===void 0?void 0:s.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.store.state})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,y(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,u(this.endpoint,this.templateId,false)];case 2:e.store=t.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){if(((t=this.store.state)===null||t===void 0?void 0:t.template_documents.length)>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return S;case"image/jpeg":return k;case"image/png":return _;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return w}return I};e.prototype.render=function(){var e=this;var t,i,n;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var r=(t=this.store)===null||t===void 0?void 0:t.state;if(!r.isLoaded){return o(s,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session||!r.profile_id){return o(s,{class:"empty"})}return o(s,null,o("h5",null,"Existing Attachments"),o("div",{class:"attachments"},(i=this.store)===null||i===void 0?void 0:i.state.template_documents.map((function(t){return o("div",{class:"attachment"},o("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),o("div",{class:"filename",title:t.name},t.name),o("div",{class:"pages"},o("div",{class:"count"},t.page_numbers),o("div",{class:"pages-icon",innerHTML:E})),o("div",{class:"trash-icon",innerHTML:C,onClick:function(){return e.handleDelete(t)}}))}))),o("h5",null,"Attach a New Document"),this.uploading?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((n=this.store)===null||n===void 0?void 0:n.state.template_documents.length)||this.uploading})),this.showDeleteError&&o("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&o("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}());B.style=F;var O='verdocs-template-build-tabs{-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;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}';var W=["attachments","roles","settings","fields","preview"];var V=e("verdocs_template_build_tabs",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.stepChanged=i(this,"stepChanged",7);this.endpoint=n.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onStepChanged=function(){console.log("Step changed",this.step,this.templateId);this.loadTemplate().catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="preview";return[2]}this.loadTemplate().catch((function(e){return console.log("[BUILD_TABS] Unable to load template",e)}))}catch(o){console.log("[BUILD_TABS] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.loadTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.templateId)return[3,2];e=this;return[4,u(this.endpoint,this.templateId,false)];case 1:e.store=t.sent();t.label=2;case 2:return[2]}}))}))};e.prototype.setStep=function(e){var t;console.log("Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.render=function(){var e=this;var t,i,n,r,l,a,d,c,p;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var u=false;var h=false;var m=false;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step);if(this.templateId&&this.store&&this.store.state){m=((n=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.template_documents)===null||n===void 0?void 0:n.length)>0;h=m&&((a=(l=(r=this.store)===null||r===void 0?void 0:r.state)===null||l===void 0?void 0:l.roles)===null||a===void 0?void 0:a.length)>0;u=h&&((p=(c=(d=this.store)===null||d===void 0?void 0:d.state)===null||c===void 0?void 0:c.fields)===null||p===void 0?void 0:p.length)>0}var v=Math.max(W.indexOf(this.step),0);if(!u&&v>=4){v=3}if(!h&&v>=3){v=1}if(!m&&v>=1){v=0}console.log({selectedStepIndex:v,canPreview:u,canEditFields:h,canEditRoles:m});return o(s,null,o("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:v,tabs:[{id:"attachments",disabled:false,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!m,label:"Roles"},{id:"settings",disabled:!h,label:"Settings"},{id:"fields",disabled:!h,label:"Fields"},{id:"preview",disabled:!u,label:"Preview/Send"}]}))};Object.defineProperty(e,"watchers",{get:function(){return{step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());V.style=O;var q='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';var Y=" ";var G='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>';var J=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.templateCreated=i(this,"templateCreated",7);this.endpoint=n.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,s,n;var l=this;return __generator(this,(function(a){switch(a.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";a.label=1;case 1:a.trys.push([1,3,,4]);return[4,r(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){l.progressLabel="Processing...";l.progressPercent=100}else{l.progressPercent=e}}))];case 2:s=a.sent();console.log("[CREATE] Created template",s);u(this.endpoint,s.id,true).then((function(){var e,t;(e=l.templateCreated)===null||e===void 0?void 0:e.emit({endpoint:l.endpoint,template:s,templateId:s.id});(t=l.next)===null||t===void 0?void 0:t.emit(s);l.creating=false;l.progressLabel="";l.progressPercent=0})).catch((function(e){console.log(e)}));return[3,4];case 3:n=a.sent();console.log("[CREATE] Error creating template",n);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new m(n.message,(i=n.response)===null||i===void 0?void 0:i.status,(o=n.response)===null||o===void 0?void 0:o.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("div",{class:"upload-box",onDrop:function(t){t.preventDefault();t.target.classList.remove("drag-over");e.file=t.dataTransfer.files[0]},onDragOver:function(e){e.preventDefault();e.dataTransfer.dropEffect="copy"},onDragEnter:function(e){return e.target.classList.add("drag-over")},onDragLeave:function(e){return e.target.classList.remove("drag-over")}},o("div",null,o("span",{innerHTML:G})),o("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),o("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?Y:"Or, if you prefer..."),o("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());J.style=q;var K="";var Q=e("verdocs_template_name",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,u(this.endpoint,this.templateId,false)];case 1:n.store=l.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE NAME] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(r.message,(o=r.response)===null||o===void 0?void 0:o.status,(s=r.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.name=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.name;this.dirty=false;console.log("Closing");(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(s){switch(s.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{name:this.name})];case 1:s.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoading){return o(s,{class:"loading"},o("verdocs-loader",null))}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("label",{htmlFor:"verdocs-template-name"},"Template Name"),o("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var i,o;e.name=t.target.value;e.dirty=e.name!==((o=(i=e.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.name)}}),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Q.style=K;var X='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var Z=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,u(this.endpoint,this.templateId,false)];case 1:n.store=l.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE REMINDERS] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(r.message,(o=r.response)===null||o===void 0?void 0:o.status,(s=r.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.sendReminders=!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id);this.dirty=false;(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,s,n,r,l,a,d,c,p,h,v,f;return __generator(this,(function(g){switch(g.label){case 0:e.stopPropagation();g.label=1;case 1:g.trys.push([1,12,,13]);if(!this.sendReminders)return[3,8];c={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id))return[3,4];return[4,D(this.endpoint,this.templateId,c)];case 2:g.sent();p=this;return[4,u(this.endpoint,this.templateId,false)];case 3:p.store=g.sent();return[3,7];case 4:return[4,L(this.endpoint,this.templateId,(o=this.store)===null||o===void 0?void 0:o.state.reminder_id,c)];case 5:g.sent();h=this;return[4,u(this.endpoint,this.templateId,false)];case 6:h.store=g.sent();g.label=7;case 7:return[3,11];case 8:return[4,T(this.endpoint,this.templateId,(s=this.store)===null||s===void 0?void 0:s.state.reminder_id)];case 9:g.sent();v=this;return[4,u(this.endpoint,this.templateId,false)];case 10:v.store=g.sent();g.label=11;case 11:(n=this.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});return[3,13];case 12:f=g.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",f);P(f.message);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new m(f.message,(l=f.response)===null||l===void 0?void 0:l.status,(a=f.response)===null||a===void 0?void 0:a.data));return[3,13];case 13:this.dirty=false;(d=this.close)===null||d===void 0?void 0:d.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Reminders"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),o("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.sendReminders=t.target.checked;e.dirty=true}})),o("p",null,o("strong",null,"NOTE:")," Reminders will only be sent for up to 14 days."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),o("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){e.firstReminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),o("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){e.reminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&o("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());Z.style=X;var $='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';var ee=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,u(this.endpoint,this.templateId,false)];case 1:l.store=d.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((o=(i=this.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.is_public)||false;this.dirty=false;return[3,3];case 2:a=d.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new m(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(r=a.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o,s,n;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.is_public;this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(s){switch(s.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:s.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Visibility"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-shared"},"Shared"),o("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-public"},"Public"),o("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());ee.style=$}}}));
|
1
|
+
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,i=1,o=arguments.length;i<o;i++){t=arguments[i];for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s))e[s]=t[s]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,i,o){function s(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,n){function r(e){try{a(o.next(e))}catch(e){n(e)}}function l(e){try{a(o["throw"](e))}catch(e){n(e)}}function a(e){e.done?i(e.value):s(e.value).then(r,l)}a((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},o,s,n,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(t){return a([e,t])}}function a(r){if(o)throw new TypeError("Generator is already executing.");while(i)try{if(o=1,s&&(n=r[0]&2?s["return"]:r[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,r[1])).done)return n;if(s=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;s=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(n=i.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){i.label=r[1];break}if(r[0]===6&&i.label<n[1]){i.label=n[1];n=r;break}if(n&&i.label<n[2]){i.label=n[2];i.ops.push(r);break}if(n[2])i.ops.pop();i.trys.pop();continue}r=t.call(e,i)}catch(e){r=[6,e];s=0}finally{o=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var o=0,s=t.length,n;o<s;o++){if(n||!(o in t)){if(!n)n=Array.prototype.slice.call(t,0,o);n[o]=t[o]}}return e.concat(n||Array.prototype.slice.call(t))};System.register(["./p-fbb8023f.system.js","./p-54498887.system.js","./p-034bd59e.system.js","./p-95080569.system.js","./p-8324a7a3.system.js","./p-49139f23.system.js","./p-0cafdb16.system.js","./p-187b20b7.system.js","./p-8aae8d16.system.js","./p-877c2b06.system.js","./p-05eb4fed.system.js","./p-6e9af353.system.js","./p-3f628837.system.js","./p-ca13070e.system.js","./p-3af6b910.system.js","./p-bbee73c8.system.js","./p-173e86c3.system.js","./p-dc9c4361.system.js"],(function(e){"use strict";var t,i,o,s,n,r,l,a,d,c,p,u,h,m,v,f,g,b,x,y,w,_,k,S,I,E,C,P;return{setters:[function(e){t=e.r;i=e.c;o=e.h;s=e.H},function(){},function(e){n=e.V;r=e.b;l=e.u},function(e){a=e.g},function(e){d=e.g;c=e.b;p=e.a},function(e){u=e.g},function(e){h=e.r},function(e){m=e.S},function(e){v=e.j},function(e){f=e.a;g=e.i},function(e){b=e.g},function(e){x=e.c;y=e.d},function(e){w=e.D;_=e.P;k=e.J;S=e.a;I=e.F;E=e.b;C=e.T},function(e){P=e.V},function(){},function(){},function(){},function(){}],execute:function(){var D=function(e,t,i){return e.api.post("/templates/".concat(t,"/reminder/"),i).then((function(e){return e.data}))};var L=function(e,t,i,o){return e.api.put("/templates/".concat(t,"/reminder/").concat(i),o).then((function(e){return e.data}))};var T=function(e,t,i){return e.api.delete("/templates/".concat(t,"/reminder/").concat(i)).then((function(e){return e.data}))};var z='verdocs-preview{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;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-preview div,verdocs-preview canvas{-webkit-box-sizing:border-box;box-sizing:border-box}';var R=e("verdocs_preview",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.templateStore=null;this.fieldStore=null;this.roleStore=null;this.endpoint=n.getDefault();this.templateId=null;this.loading=true}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;var o=this;return __generator(this,(function(s){try{this.endpoint.loadSession();if(!this.templateId){console.log("[PREVIEW] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[PREVIEW] Unable to start builder session, must be authenticated");return[2]}u(this.endpoint,this.templateId,true).then((function(e){var t,i;o.templateStore=e;console.log("[PREVIEW] Loaded Template Store",e.state);o.fieldStore=a(o.templateId);o.roleStore=d(o.templateId);console.log("RS",(t=o.roleStore)===null||t===void 0?void 0:t.state);console.log("FS",(i=o.fieldStore)===null||i===void 0?void 0:i.state);console.log("[PREVIEW] Loaded template",o.templateStore.state,o.roleStore.get("roles"),o.fieldStore.get("fields"));o.loading=false})).catch((function(e){console.log(e)}))}catch(o){console.log("[PREVIEW] Error with preview session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.handlePageRendered=function(e){var t,i;var o=e.detail;var s=(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.fields.filter((function(e){return e.page_sequence===o.pageNumber}));console.log("[PREVIEW] Page rendered",o,s);s.forEach((function(e){return h(e,o,{disabled:true,editable:false,draggable:false})}))};e.prototype.render=function(){var e=this;var t,i;if(this.loading){return o(s,null,o("verdocs-loader",null))}var n=__spreadArray([],(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.pages,true);n.sort((function(e,t){return e.sequence-t.sequence}));return o(s,null,n.map((function(t){return o("verdocs-template-document-page",{templateId:t.template_id,documentId:t.document_id,pageNumber:t.sequence,disabled:true,editable:true,done:false,virtualWidth:612,virtualHeight:792,onPageRendered:function(t){return e.handlePageRendered(t)},layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]})})))};return e}());R.style=z;var U='verdocs-send{padding:10px;position:relative;background:#ffffff;-ms-flex-direction:column;flex-direction:column;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:none}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 #97979744}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:#00000089}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-direction:row;flex-direction:row}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)}';var A='<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>';var N='<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>';var M='<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>';var j='<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>';var H=e("verdocs_send",function(){function e(e){t(this,e);this.sendingEnvelope=i(this,"sendingEnvelope",7);this.send=i(this,"send",7);this.exit=i(this,"exit",7);this.sdkError=i(this,"sdkError",7);this.searchContacts=i(this,"searchContacts",7);this.levels=[];this.templateStore=null;this.roleStore=null;this.endpoint=n.getDefault();this.templateId=null;this.environment="web";this.containerId="verdocs-send-".concat(Math.random().toString(36).substring(2,11));this.rolesAtLevel={};this.showPickerForId="";this.sessionContacts=[];this.sending=false;this.rolesCompleted={}}e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.rolesCompleted={};return[2]}))}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r,l,a,c;var p=this;return __generator(this,(function(h){switch(h.label){case 0:h.trys.push([0,2,,3]);r=this.endpoint.loadSession();if(!this.templateId){console.log("[SEND] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SEND] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,u(this.endpoint,this.templateId,false)];case 1:l.templateStore=h.sent();this.roleStore=d(this.templateId);if(!((t=(e=this.templateStore)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_sendable)){console.warn("[SEND] Template is not sendable",this.templateId)}if(this.roleStore.get("roles")){a={};this.rolesCompleted={};this.roleStore.get("roles").forEach((function(e){var t=e.sequence-1;a[t]||(a[t]=[]);var i="r-".concat(t,"-").concat(a[t].length);a[t].push(__assign(__assign({},e),{id:i}));if(e.full_name&&(e.email||e.phone)){p.rolesCompleted[i]=__assign(__assign({},e),{id:i})}}));this.rolesAtLevel=a;this.levels=Object.keys(a).map((function(e){return+e}));this.levels.sort((function(e,t){return e-t}))}if((i=r===null||r===void 0?void 0:r.session)===null||i===void 0?void 0:i.profile){this.sessionContacts.push({id:r.session.profile.id,name:"".concat(r.session.profile.first_name," ").concat(r.session.profile.last_name),email:r.session.profile.email,phone:r.session.profile.phone})}return[3,3];case 2:c=h.sent();console.log("[SEND] Error with preview session",c);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new m(c.message,(s=c.response)===null||s===void 0?void 0:s.status,(n=c.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.getLevelIcon=function(e){if(e<0){return o("div",{class:"level-icon",innerHTML:N})}else if(e>=this.levels.length){return o("div",{class:"level-icon",innerHTML:j})}else{return o("div",{class:"level-icon",innerHTML:M})}};e.prototype.handleSelectContact=function(e,t){e.preventDefault();this.rolesCompleted[t.id]=__assign(__assign({},t),e.detail);this.showPickerForId=""};e.prototype.handleClickRole=function(e,t){e.stopPropagation();this.showPickerForId=t.id};e.prototype.handleSend=function(e){var t=this;var i,o,s;if(this.sending){console.log("Skipping duplicate send",e);return}console.log("Sending",e);e.preventDefault();e.stopPropagation();this.sending=true;(i=this.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:true});var n={template_id:this.templateId,name:(s=(o=this.templateStore)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.name,environment:this.environment,roles:Object.values(this.rolesCompleted),prepared_fields:[]};console.log("[SEND] Creating envelope",n);v(this.endpoint,n).then((function(e){var i,o;console.log("[SEND] Send envelope",e);t.reset().catch((function(e){return console.log("Unknown Error",e)}));t.sending=false;(i=t.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:false});(o=t.send)===null||o===void 0?void 0:o.emit(__assign(__assign({},n),{envelope_id:e.id,envelope:e}))})).catch((function(e){var i;console.log("Send error",e);t.sending=false;(i=t.sendingEnvelope)===null||i===void 0?void 0:i.emit({sending:false})}))};e.prototype.handleCancel=function(e){var t;e.stopPropagation();(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.render=function(){var e=this;var t,i;var n=c(this.roleStore);var r=Object.values(this.rolesCompleted).filter((function(e){return f(e.email)||g(e.phone)}));var l=r.length>=n.length;return o(s,{class:{sendable:(i=(t=this.templateStore)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_sendable}},o("div",{class:"recipients"},o("div",{class:"left-line"}),o("div",{class:"level level-start"},this.getLevelIcon(-1),o("div",{class:"complete"},"Send Envelope")),this.levels.map((function(t){return o("div",{class:"level level-".concat(t)},e.getLevelIcon(t),e.rolesAtLevel[t].map((function(t){var i,s,n,r,l,a;var d=!t.email;var c="verdocs-send-recipient-".concat(t.name);return d?o("div",{class:"recipient",style:{backgroundColor:b(p(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(s=(i=e.rolesCompleted[t.id])===null||i===void 0?void 0:i.full_name)!==null&&s!==void 0?s:t.name,o("div",{class:"icon",innerHTML:A}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(n=e.rolesCompleted[t.id])!==null&&n!==void 0?n:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}}))):o("div",{class:"recipient",style:{borderColor:b(p(e.roleStore,t.name))},onClick:function(i){return e.handleClickRole(i,t)},id:c},(l=(r=e.rolesCompleted[t.id])===null||r===void 0?void 0:r.full_name)!==null&&l!==void 0?l:t.full_name,o("div",{class:"icon",innerHTML:A}),e.showPickerForId===t.id&&o("verdocs-portal",{anchor:c,onClickAway:function(){return e.showPickerForId=""}},o("verdocs-contact-picker",{onExit:function(){return e.showPickerForId=""},onNext:function(i){return e.handleSelectContact(i,t)},contactSuggestions:e.sessionContacts,templateRole:(a=e.rolesCompleted[t.id])!==null&&a!==void 0?a:t,onSearchContacts:function(t){var i;return(i=e.searchContacts)===null||i===void 0?void 0:i.emit(t.detail)}})))})))})),o("div",{class:"level level-done"},this.getLevelIcon(this.levels.length),o("div",{class:"complete"},"Signing Complete"))),o("div",{class:"buttons"},o("verdocs-button",{label:"Cancel",size:"small",variant:"outline",onClick:function(t){return e.handleCancel(t)},disabled:this.sending}),o("verdocs-button",{label:"Send",size:"small",disabled:!l||this.sending,onClick:function(t){return e.handleSend(t)}}),this.sending&&o("verdocs-spinner",null)))};return e}());H.style=U;var F='verdocs-template-attachments{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-attachments h5{font-size:16px;font-weight:bold;margin:0 0 10px 0;color:#46497d}verdocs-template-attachments .attachments{margin:0 0 40px 0}verdocs-template-attachments .attachment{display:-ms-flexbox;display:flex;padding:5px 0;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#33364b}verdocs-template-attachments .attachment:hover .trash-icon{display:-ms-flexbox;display:flex}verdocs-template-attachments .attachment:hover .pages{display:none}verdocs-template-attachments svg{width:28px;height:28px;fill:#5c6575;margin:2px 0 0 0}verdocs-template-attachments .file-icon{-ms-flex:0;flex:0}verdocs-template-attachments .pages{width:24px;height:24px;-ms-flex:0 0 24px;flex:0 0 24px;padding-left:4px;position:relative;margin:-10px 0 0 0}verdocs-template-attachments .pages .pages-icon{top:0;left:0;width:24px;height:24px;position:absolute}verdocs-template-attachments .pages .count{top:11px;left:7px;z-index:1;width:18px;font-size:12px;font-weight:500;position:absolute;text-align:center;letter-spacing:-2px}verdocs-template-attachments .filename{-ms-flex:1;flex:1;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;border-bottom:1px dotted #cccccc}verdocs-template-attachments .trash-icon{-ms-flex:0;flex:0;display:none}verdocs-template-attachments .trash-icon:hover{cursor:pointer}verdocs-template-attachments verdocs-file-chooser{margin:10px 0;border:2px dashed #979797}verdocs-template-attachments .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .progress-wrapper{padding:20px}verdocs-template-attachments .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-attachments .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-attachments ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-moz-placeholder{color:#aaaaaa}verdocs-template-attachments :-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-attachments ::placeholder{color:#aaaaaa}';var B=e("verdocs_template_attachments",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.templateUpdated=i(this,"templateUpdated",7);this.sdkError=i(this,"sdkError",7);this.endpoint=n.getDefault();this.templateId="";this.uploading=false;this.progressLabel="Uploading...";this.progressPercent=0;this.showDeleteError=false;this.confirmDeleteDocument=null;this.store=null}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}o=this;return[4,u(this.endpoint,this.templateId,false)];case 1:o.store=n.sent();return[3,3];case 2:s=n.sent();console.log("[TEMPLATE ATTACHMENTS] Error loading template",s);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(s.message,(t=s.response)===null||t===void 0?void 0:t.status,(i=s.response)===null||i===void 0?void 0:i.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleUploadProgress=function(e){if(e>=99){this.progressPercent=100;this.progressLabel="Processing..."}else{this.progressPercent=e}};e.prototype.handleUpload=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,s,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:e.stopPropagation();n=e.detail.file;if(!n){return[2]}console.log("[ATTACHMENTS] Uploading...",n);this.uploading=true;this.progressLabel="Uploading...";d.label=1;case 1:d.trys.push([1,4,,5]);return[4,x(this.endpoint,this.templateId,n,this.handleUploadProgress.bind(this))];case 2:r=d.sent();console.log("[ATTACHMENTS] Created attachment",r);l=this;return[4,u(this.endpoint,this.templateId,false)];case 3:l.store=d.sent();console.log("[ATTACHMENTS] Updated template",this.store.state);(t=this.templateUpdated)===null||t===void 0?void 0:t.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});this.uploading=false;this.progressLabel="";this.progressPercent=0;return[3,5];case 4:a=d.sent();console.log("[ATTACHMENTS] Error creating template",a);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(a.message,(o=a.response)===null||o===void 0?void 0:o.status,(s=a.response)===null||s===void 0?void 0:s.data));this.uploading=false;return[3,5];case 5:return[2]}}))}))};e.prototype.handleNext=function(e){var t;e.stopPropagation();this.uploading=false;this.progressLabel="";this.progressPercent=0;(t=this.next)===null||t===void 0?void 0:t.emit({template:this.store.state})};e.prototype.confirmDelete=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,y(this.endpoint,this.templateId,this.confirmDeleteDocument.id)];case 1:t.sent();e=this;return[4,u(this.endpoint,this.templateId,false)];case 2:e.store=t.sent();console.log("[ATTACHMENTS] New template",this.store.state);this.confirmDeleteDocument=null;return[2]}}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(i){if(((t=this.store.state)===null||t===void 0?void 0:t.template_documents.length)>1){this.confirmDeleteDocument=e}else{this.showDeleteError=true}return[2]}))}))};e.prototype.getFileIcon=function(e){switch(e.mime){case"application/pdf":return S;case"image/jpeg":return k;case"image/png":return _;case"application/msword":case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return w}return I};e.prototype.render=function(){var e=this;var t,i,n;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var r=(t=this.store)===null||t===void 0?void 0:t.state;if(!r.isLoaded){return o(s,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session||!r.profile_id){return o(s,{class:"empty"})}return o(s,null,o("h5",null,"Existing Attachments"),o("div",{class:"attachments"},(i=this.store)===null||i===void 0?void 0:i.state.template_documents.map((function(t){return o("div",{class:"attachment"},o("div",{class:"file-icon",innerHTML:e.getFileIcon(t)}),o("div",{class:"filename",title:t.name},t.name),o("div",{class:"pages"},o("div",{class:"count"},t.page_numbers),o("div",{class:"pages-icon",innerHTML:E})),o("div",{class:"trash-icon",innerHTML:C,onClick:function(){return e.handleDelete(t)}}))}))),o("h5",null,"Attach a New Document"),this.uploading?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("verdocs-file-chooser",{onFileSelected:function(t){return e.handleUpload(t)}}),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.uploading}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleNext(t)},disabled:!((n=this.store)===null||n===void 0?void 0:n.state.template_documents.length)||this.uploading})),this.showDeleteError&&o("verdocs-ok-dialog",{heading:"Unable to Delete Attachment",message:"Templates must contain at least one attachment.",onNext:function(){return e.showDeleteError=false}}),this.confirmDeleteDocument&&o("verdocs-ok-dialog",{heading:"Delete this Attachment?",message:"This operation cannot be undone. All fields placed<br />on the deleted attachment will also be removed.",onNext:function(){return e.confirmDelete()},showCancel:true,onExit:function(){e.confirmDeleteDocument=null}}))};return e}());B.style=F;var O='verdocs-template-build-tabs{-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;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-build-tabs verdocs-template-attachments,verdocs-template-build-tabs verdocs-template-roles{margin:20px}verdocs-template-build-tabs verdocs-template-fields{border-top:1px solid #777777}verdocs-template-build-tabs verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-template-build-tabs verdocs-template-fields{width:100%}verdocs-template-build-tabs verdocs-preview{-ms-flex:1;flex:1}';var W=["attachments","roles","settings","fields","preview"];var V=e("verdocs_template_build_tabs",function(){function e(e){t(this,e);this.sdkError=i(this,"sdkError",7);this.stepChanged=i(this,"stepChanged",7);this.endpoint=n.getDefault();this.templateId=null;this.step="preview";this.store=null}e.prototype.onStepChanged=function(){console.log("Step changed",this.step,this.templateId);this.loadTemplate().catch((function(e){return console.log("Unknown Error",e)}))};e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i;return __generator(this,(function(o){try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD_TABS] Unable to start builder session, must be authenticated");return[2]}if(!this.templateId){this.step="preview";return[2]}this.loadTemplate().catch((function(e){return console.log("[BUILD_TABS] Unable to load template",e)}))}catch(o){console.log("[BUILD_TABS] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new m(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(i=o.response)===null||i===void 0?void 0:i.data))}return[2]}))}))};e.prototype.loadTemplate=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:if(!this.templateId)return[3,2];e=this;return[4,u(this.endpoint,this.templateId,false)];case 1:e.store=t.sent();t.label=2;case 2:return[2]}}))}))};e.prototype.setStep=function(e){var t;console.log("Selected step",e.detail.tab.id);e.stopPropagation();e.preventDefault();this.step=e.detail.tab.id;(t=this.stepChanged)===null||t===void 0?void 0:t.emit(e.detail.tab.id)};e.prototype.render=function(){var e=this;var t,i,n,r,l,a,d,c,p;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}var u=false;var h=false;var m=false;console.log("[BUILD_TABS] Rendering tabs",this.templateId,this.step);if(this.templateId&&this.store&&this.store.state){m=((n=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.template_documents)===null||n===void 0?void 0:n.length)>0;h=m&&((a=(l=(r=this.store)===null||r===void 0?void 0:r.state)===null||l===void 0?void 0:l.roles)===null||a===void 0?void 0:a.length)>0;u=h&&((p=(c=(d=this.store)===null||d===void 0?void 0:d.state)===null||c===void 0?void 0:c.fields)===null||p===void 0?void 0:p.length)>0}var v=Math.max(W.indexOf(this.step),0);if(!u&&v>=4){v=3}if(!h&&v>=3){v=1}if(!m&&v>=1){v=0}console.log({selectedStepIndex:v,canPreview:u,canEditFields:h,canEditRoles:m});return o(s,null,o("verdocs-tabs",{onSelectTab:function(t){return e.setStep(t)},selectedTab:v,tabs:[{id:"attachments",disabled:false,label:this.templateId&&this.store?"Attachment(s)":"Upload Attachment(s)"},{id:"roles",disabled:!m,label:"Roles"},{id:"settings",disabled:!h,label:"Settings"},{id:"fields",disabled:!h,label:"Fields"},{id:"preview",disabled:!u,label:"Preview/Send"}]}))};Object.defineProperty(e,"watchers",{get:function(){return{step:["onStepChanged"]}},enumerable:false,configurable:true});return e}());V.style=O;var q='verdocs-template-create{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-create form{background-color:#ffffff;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-create form .upload-box{-webkit-box-sizing:border-box;box-sizing:border-box;width:320px;text-align:center;padding:44px 18px 66px;border:2px dashed #979797;color:rgba(0, 0, 0, 0.54)}verdocs-template-create form .upload-box.drag-over{border:2px solid #4c56cb}verdocs-template-create form .upload-box svg{width:64px;fill:#5c6575}verdocs-template-create .loader-wrapper{background-color:#ffffff;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;width:320px;height:320px;text-align:center;border:2px dashed #979797;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .progress-wrapper{padding:20px}verdocs-template-create .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-create .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-template-create ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-create ::-moz-placeholder{color:#aaaaaa}verdocs-template-create :-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-create ::placeholder{color:#aaaaaa}';var Y=" ";var G='<svg focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6H6zm7 7V3.5L18.5 9H13z"></path></svg>';var J=e("verdocs_template_create",function(){function e(e){t(this,e);this.exit=i(this,"exit",7);this.next=i(this,"next",7);this.sdkError=i(this,"sdkError",7);this.templateCreated=i(this,"templateCreated",7);this.endpoint=n.getDefault();this.file=undefined;this.creating=false;this.progressLabel="Uploading...";this.progressPercent=0}e.prototype.componentWillLoad=function(){this.endpoint.setTimeout(3e4);this.endpoint.loadSession()};e.prototype.handleFileChanged=function(e){var t;this.file=((t=e.target.files)===null||t===void 0?void 0:t[0])||null;console.log("[CREATE] Selected file",this.file)};e.prototype.handleUpload=function(e){e.stopPropagation();var t=document.getElementById("verdocs-template-create-file");t.click()};e.prototype.handleCancel=function(e){e.stopPropagation();this.exit.emit()};e.prototype.handleSubmit=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,s,n;var l=this;return __generator(this,(function(a){switch(a.label){case 0:e.stopPropagation();console.log("Submitting");if(!this.file){return[2]}this.creating=true;this.progressLabel="Uploading...";a.label=1;case 1:a.trys.push([1,3,,4]);return[4,r(this.endpoint,{name:this.file.name,documents:[this.file]},(function(e){if(e>=99){l.progressLabel="Processing...";l.progressPercent=100}else{l.progressPercent=e}}))];case 2:s=a.sent();console.log("[CREATE] Created template",s);u(this.endpoint,s.id,true).then((function(){var e,t;(e=l.templateCreated)===null||e===void 0?void 0:e.emit({endpoint:l.endpoint,template:s,templateId:s.id});(t=l.next)===null||t===void 0?void 0:t.emit(s);l.creating=false;l.progressLabel="";l.progressPercent=0})).catch((function(e){console.log(e)}));return[3,4];case 3:n=a.sent();console.log("[CREATE] Error creating template",n);(t=this.sdkError)===null||t===void 0?void 0:t.emit(new m(n.message,(i=n.response)===null||i===void 0?void 0:i.status,(o=n.response)===null||o===void 0?void 0:o.data));this.creating=false;return[3,4];case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("input",{type:"file",id:"verdocs-template-create-file",multiple:true,accept:"application/pdf",style:{display:"none"},onChange:function(t){return e.handleFileChanged(t)}}),this.creating?o("div",{class:"loader-wrapper"},o("verdocs-loader",null),this.progressLabel&&o("div",{class:"progress-wrapper"},o("verdocs-progress-bar",{showPercent:true,percent:this.progressPercent,label:this.progressLabel}))):o("div",{class:"upload-box",onDrop:function(t){t.preventDefault();t.target.classList.remove("drag-over");e.file=t.dataTransfer.files[0]},onDragOver:function(e){e.preventDefault();e.dataTransfer.dropEffect="copy"},onDragEnter:function(e){return e.target.classList.add("drag-over")},onDragLeave:function(e){return e.target.classList.remove("drag-over")}},o("div",null,o("span",{innerHTML:G})),o("div",{style:{marginTop:"20px",fontSize:"20px",fontWeight:"bold",overflowWrap:"anywhere"}},this.file?this.file.name:"Drag a file here"),o("div",{style:{marginTop:"20px",marginBottom:"20px",fontSize:"16px",height:"20px"}},this.file?Y:"Or, if you prefer..."),o("verdocs-button",{label:this.file?"Select a different file":"Select a file from your computer",size:"small",onClick:function(t){return e.handleUpload(t)}})),o("div",{class:"buttons"},o("verdocs-button",{variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)},disabled:this.creating}),o("verdocs-button",{label:"Next",size:"small",onClick:function(t){return e.handleSubmit(t)},disabled:!this.file||this.creating}))))};return e}());J.style=q;var K="";var Q=e("verdocs_template_name",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.name="";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,u(this.endpoint,this.templateId,false)];case 1:n.store=l.sent();this.name=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.name;this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE NAME] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(r.message,(o=r.response)===null||o===void 0?void 0:o.status,(s=r.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.name=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.name;this.dirty=false;console.log("Closing");(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(s){switch(s.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{name:this.name})];case 1:s.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.name=this.name}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"name"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoading){return o(s,{class:"loading"},o("verdocs-loader",null))}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("label",{htmlFor:"verdocs-template-name"},"Template Name"),o("verdocs-text-input",{id:"verdocs-template-name",value:this.name,autocomplete:"off",placeholder:"Template Name...",onInput:function(t){var i,o;e.name=t.target.value;e.dirty=e.name!==((o=(i=e.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.name)}}),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());Q.style=K;var X='verdocs-template-reminders{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-reminders.loading{min-height:300px;position:relative;display:block}verdocs-template-reminders.empty{display:none}verdocs-template-reminders form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-reminders form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0 0 20px 0}verdocs-template-reminders form label{font-size:16px;font-weight:500;margin:0 0 6px 0;color:#33364b}verdocs-template-reminders form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-reminders form input:focus{outline:none}verdocs-template-reminders form .input-row{display:-ms-flexbox;display:flex;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders form .input-row label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-reminders form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px}verdocs-template-reminders form .input-row verdocs-text-input input{text-align:center}verdocs-template-reminders form .input-row verdocs-checkbox{display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px;-ms-flex-pack:center;justify-content:center}verdocs-template-reminders .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-template-reminders ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-moz-placeholder{color:#aaaaaa}verdocs-template-reminders :-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-reminders ::placeholder{color:#aaaaaa}';var Z=e("verdocs_template_reminders",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.showPlanBlocker=false;this.sendReminders=false;this.firstReminderDays="1";this.reminderDays="1";this.dirty=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return[2]}n=this;return[4,u(this.endpoint,this.templateId,false)];case 1:n.store=l.sent();this.sendReminders=!!((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.reminder_id);this.dirty=false;return[3,3];case 2:r=l.sent();console.log("[TEMPLATE REMINDERS] Error loading template",r);(i=this.sdkError)===null||i===void 0?void 0:i.emit(new m(r.message,(o=r.response)===null||o===void 0?void 0:o.status,(s=r.response)===null||s===void 0?void 0:s.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o;e.stopPropagation();this.sendReminders=!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id);this.dirty=false;(o=this.close)===null||o===void 0?void 0:o.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o,s,n,r,l,a,d,c,p,h,v,f;return __generator(this,(function(g){switch(g.label){case 0:e.stopPropagation();g.label=1;case 1:g.trys.push([1,12,,13]);if(!this.sendReminders)return[3,8];c={setup_time:+this.firstReminderDays,interval_time:+this.reminderDays};if(!!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.reminder_id))return[3,4];return[4,D(this.endpoint,this.templateId,c)];case 2:g.sent();p=this;return[4,u(this.endpoint,this.templateId,false)];case 3:p.store=g.sent();return[3,7];case 4:return[4,L(this.endpoint,this.templateId,(o=this.store)===null||o===void 0?void 0:o.state.reminder_id,c)];case 5:g.sent();h=this;return[4,u(this.endpoint,this.templateId,false)];case 6:h.store=g.sent();g.label=7;case 7:return[3,11];case 8:return[4,T(this.endpoint,this.templateId,(s=this.store)===null||s===void 0?void 0:s.state.reminder_id)];case 9:g.sent();v=this;return[4,u(this.endpoint,this.templateId,false)];case 10:v.store=g.sent();g.label=11;case 11:(n=this.templateUpdated)===null||n===void 0?void 0:n.emit({endpoint:this.endpoint,template:this.store.state,event:"attachments"});return[3,13];case 12:f=g.sent();console.log("[TEMPLATE REMINDERS] Unable to update reminders",f);P(f.message);(r=this.sdkError)===null||r===void 0?void 0:r.emit(new m(f.message,(l=f.response)===null||l===void 0?void 0:l.status,(a=f.response)===null||a===void 0?void 0:a.data));return[3,13];case 13:this.dirty=false;(d=this.close)===null||d===void 0?void 0:d.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Reminders"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-send-reminders"},"Send Automatic Reminders"),o("verdocs-checkbox",{id:"verdocs-send-reminders",name:"automatic-reminders",checked:this.sendReminders,value:"on",onInput:function(t){e.sendReminders=t.target.checked;e.dirty=true}})),o("p",null,o("strong",null,"NOTE:")," Reminders will only be sent for up to 14 days."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-first-reminder-days"},"Days Before First Reminder"),o("verdocs-text-input",{id:"verdocs-first-reminder-days",type:"number",value:this.firstReminderDays,onInput:function(t){e.firstReminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-days-between-reminders"},"Days Between Reminders"),o("verdocs-text-input",{id:"verdocs-days-between-reminders",type:"number",value:this.reminderDays,onInput:function(t){e.reminderDays=t.target.value;e.dirty=true},disabled:!this.sendReminders})),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))),this.showPlanBlocker&&o("verdocs-ok-dialog",{heading:"Upgrade to access this feature",message:"Please upgrade your plan to access this feature.",onNext:function(){return e.showPlanBlocker=false}}))};return e}());Z.style=X;var $='verdocs-template-visibility{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-visibility.loading{min-height:300px;position:relative;display:block}verdocs-template-visibility.empty{display:none}verdocs-template-visibility form{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-visibility form .description{font-size:14px;text-align:justify;color:#5c6575}verdocs-template-visibility form h5{font-size:16px;font-weight:bold;color:#4c56cb;margin:0}verdocs-template-visibility form label{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:500;margin:0 0 4px 0;color:#33364b}verdocs-template-visibility form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-template-visibility form input:focus{outline:none}verdocs-template-visibility form .input-row{display:-ms-flexbox;display:flex;margin:20px 0 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility form .input-row verdocs-text-input{margin:0;display:-ms-flexbox;display:flex;-ms-flex:0 0 40px;flex:0 0 40px}verdocs-template-visibility form .input-row verdocs-text-input input{text-align:center}verdocs-template-visibility form .input-row verdocs-checkbox{-ms-flex:0;flex:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}verdocs-template-visibility form .input-row verdocs-checkbox label>input[type=checkbox]+*::before{margin-right:0}verdocs-template-visibility .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;margin-top:25px;-ms-flex-direction:row;flex-direction:row}verdocs-template-visibility ::-webkit-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-moz-placeholder{color:#aaaaaa}verdocs-template-visibility :-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::-ms-input-placeholder{color:#aaaaaa}verdocs-template-visibility ::placeholder{color:#aaaaaa}';var ee=e("verdocs_template_visibility",function(){function e(e){t(this,e);this.close=i(this,"close",7);this.sdkError=i(this,"sdkError",7);this.templateUpdated=i(this,"templateUpdated",7);this.store=null;this.endpoint=n.getDefault();this.templateId="";this.dirty=false;this.personal=false;this.public=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,i,o,s,n,r,l,a;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[VISIBILITY] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[VISIBILITY] Unable to start builder session, must be authenticated");return[2]}l=this;return[4,u(this.endpoint,this.templateId,false)];case 1:l.store=d.sent();this.personal=((t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.is_personal)||true;this.public=((o=(i=this.store)===null||i===void 0?void 0:i.state)===null||o===void 0?void 0:o.is_public)||false;this.dirty=false;return[3,3];case 2:a=d.sent();console.log("[TEMPLATE VISIBILITY] Error loading template",a);(s=this.sdkError)===null||s===void 0?void 0:s.emit(new m(a.message,(n=a.response)===null||n===void 0?void 0:n.status,(r=a.response)===null||r===void 0?void 0:r.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,i,o,s,n;e.stopPropagation();this.personal=(i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.is_personal;this.public=(s=(o=this.store)===null||o===void 0?void 0:o.state)===null||s===void 0?void 0:s.is_public;this.dirty=false;(n=this.close)===null||n===void 0?void 0:n.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(s){switch(s.label){case 0:e.stopPropagation();return[4,l(this.endpoint,this.templateId,{is_personal:this.personal,is_public:this.public})];case 1:s.sent();if((t=this.store)===null||t===void 0?void 0:t.state){this.store.state.is_personal=this.personal;this.store.state.is_public=this.public}this.dirty=false;(i=this.templateUpdated)===null||i===void 0?void 0:i.emit({endpoint:this.endpoint,template:this.store.state,event:"visibility"});(o=this.close)===null||o===void 0?void 0:o.emit();return[2]}}))}))};e.prototype.render=function(){var e=this;var t,i;if(!this.endpoint.session){return o(s,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((i=(t=this.store)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.isLoaded)){return o(s,{class:"empty"})}return o(s,null,o("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},o("h5",null,"Visibility"),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-shared"},"Shared"),o("verdocs-checkbox",{id:"verdocs-is-shared",name:"is-shared",checked:!this.personal,value:"on",onInput:function(t){e.personal=!t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Shared templates are visible to other members of your Organization (if any)."),o("div",{class:"input-row"},o("label",{htmlFor:"verdocs-is-public"},"Public"),o("verdocs-checkbox",{id:"verdocs-is-public",name:"is-public",checked:this.public,value:"on",onInput:function(t){e.public=t.target.checked;e.dirty=true}})),o("div",{class:"description"},"Public templates may appear in results when any other user searches for templates. Note that a template may be both Personal and Public, which may be useful if you want your template to be found via search but not otherwise displayed to other members of your Organization (if any)."),o("div",{class:"buttons"},o("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),o("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};return e}());ee.style=$}}}));
|