@verdocs/web-sdk 2.0.6 → 2.0.8
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/ipc-test.cjs.entry.js +37 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{verdocs-button-panel_3.cjs.entry.js → verdocs-button-panel_2.cjs.entry.js} +0 -17
- package/dist/cjs/{verdocs-checkbox_4.cjs.entry.js → verdocs-checkbox_5.cjs.entry.js} +18 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-radio-button.cjs.entry.js +23 -0
- package/dist/cjs/verdocs-sign.cjs.entry.js +12 -3
- package/dist/cjs/verdocs-template-attachments_2.cjs.entry.js +236 -0
- package/dist/cjs/{verdocs-template-document-page.cjs.entry.js → verdocs-template-document-page_2.cjs.entry.js} +45 -0
- package/dist/cjs/{verdocs-template-attachments_4.cjs.entry.js → verdocs-template-fields_4.cjs.entry.js} +238 -229
- package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/controls/verdocs-checkbox/verdocs-checkbox.css +1 -0
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.css +2 -0
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +12 -2
- package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +1 -1
- package/dist/collection/components/envelopes/verdocs-envelope-sidebar/verdocs-envelope-sidebar.js +1 -1
- package/dist/collection/components/other/ipctest/ipc-test.css +4 -0
- package/dist/collection/components/other/ipctest/ipc-test.js +79 -0
- package/dist/collection/components/other/ipctest/ipc-test.stories.js +8 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/ipc-test.d.ts +11 -0
- package/dist/components/ipc-test.js +142 -0
- package/dist/components/verdocs-checkbox2.js +1 -1
- package/dist/components/verdocs-contact-picker2.js +1 -1
- package/dist/components/verdocs-envelope-sidebar.js +1 -1
- package/dist/components/verdocs-sign.js +13 -3
- package/dist/docs.json +102 -1
- package/dist/esm/ipc-test.entry.js +33 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-aa016f33.js → utils-51c8f6c7.js} +1 -1
- package/dist/esm/{verdocs-button-panel_3.entry.js → verdocs-button-panel_2.entry.js} +1 -17
- package/dist/esm/{verdocs-checkbox_4.entry.js → verdocs-checkbox_5.entry.js} +18 -2
- package/dist/esm/verdocs-contact-picker.entry.js +2 -2
- package/dist/esm/verdocs-envelope-document-page.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-checkbox.entry.js +1 -1
- package/dist/esm/verdocs-field-date.entry.js +1 -1
- package/dist/esm/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm/verdocs-field-initial.entry.js +1 -1
- package/dist/esm/verdocs-field-payment.entry.js +1 -1
- package/dist/esm/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm/verdocs-field-signature.entry.js +1 -1
- package/dist/esm/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm/verdocs-pagination_3.entry.js +1 -1
- package/dist/esm/verdocs-preview.entry.js +1 -1
- package/dist/esm/verdocs-radio-button.entry.js +19 -0
- package/dist/esm/verdocs-send.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +13 -4
- package/dist/esm/verdocs-template-attachments_2.entry.js +231 -0
- package/dist/esm/{verdocs-template-document-page.entry.js → verdocs-template-document-page_2.entry.js} +46 -2
- package/dist/esm/{verdocs-template-attachments_4.entry.js → verdocs-template-fields_4.entry.js} +236 -227
- package/dist/esm/verdocs-view.entry.js +1 -1
- package/dist/esm/verdocs-web-sdk.js +1 -1
- package/dist/esm-es5/ipc-test.entry.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{utils-aa016f33.js → utils-51c8f6c7.js} +1 -1
- package/dist/esm-es5/verdocs-button-panel_2.entry.js +1 -0
- package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -0
- package/dist/esm-es5/verdocs-contact-picker.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.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-checkbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-date.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-dropdown.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-initial.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-payment.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-radio-button.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-signature.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textarea.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-textbox.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-timestamp.entry.js +1 -1
- package/dist/esm-es5/verdocs-pagination_3.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview.entry.js +1 -1
- package/dist/esm-es5/verdocs-radio-button.entry.js +1 -0
- package/dist/esm-es5/verdocs-send.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-attachments_2.entry.js +1 -0
- package/dist/esm-es5/verdocs-template-document-page_2.entry.js +1 -0
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -0
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/verdocs-web-sdk.js +1 -1
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +1 -0
- package/dist/types/components/other/ipctest/ipc-test.d.ts +17 -0
- package/dist/types/components/other/ipctest/ipc-test.stories.d.ts +4 -0
- package/dist/types/components.d.ts +29 -0
- package/dist/verdocs-web-sdk/{p-3a4d619d.system.entry.js → p-048a6205.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-0c5da644.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-965428e4.entry.js → p-11a30706.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c0b4cda6.entry.js → p-19fefdf7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-26417803.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-d9be74a3.entry.js → p-2ebc0650.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c90a995b.entry.js → p-3561afed.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-3a0ba0b8.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-4c87ae76.system.entry.js → p-403ea34b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-10ed9311.system.entry.js → p-42d2c651.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-cbf15c6d.entry.js → p-450047f1.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-737a2b7c.entry.js → p-455c136c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-da71e206.entry.js → p-485ed6e3.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-4dc8cc71.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-3cf07b3d.entry.js → p-5255e6f7.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-96defbf7.system.entry.js → p-5cff7439.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-5e50330a.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-03775689.system.js → p-62aaeefd.system.js} +1 -1
- package/dist/verdocs-web-sdk/p-63bb14bc.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-647cdb84.system.js +1 -1
- package/dist/verdocs-web-sdk/p-657dacc4.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-bed19bbf.system.entry.js → p-6995a8d8.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1ad38b2b.system.entry.js → p-6e8b1251.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-4239ed46.system.entry.js → p-6ebab009.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e58cfa85.entry.js → p-7cd40ff6.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-7fc89f46.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-7ca5de26.system.entry.js → p-844f5d1b.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c7b1d2a6.system.entry.js → p-87232ec1.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-61eea1eb.entry.js → p-88e0bab8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9b42d207.system.entry.js → p-8b2dc164.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-46a931f2.system.entry.js → p-8b77a5dc.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b1e1de28.system.entry.js → p-90565aa6.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-91b8a076.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-9cc39dc6.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-a106413b.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-05fe6f04.entry.js → p-a3c33953.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-a4dd68fd.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-d317166e.entry.js → p-a88c77bb.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-cd4998db.js → p-ae4c9e4a.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ba5bf927.system.entry.js → p-b42c686d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-b7b48889.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-bd3405ab.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-733909e4.entry.js → p-c7cebd38.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b8b6d7e3.entry.js → p-c8a1de2c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-c91ad3c7.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-bc64de48.system.entry.js → p-cf6d8044.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-596530f0.entry.js → p-d115c414.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d2b86b2e.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-2f4c539d.entry.js → p-d3f3c09a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1d1ab8f4.system.entry.js → p-d45ea55d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d6c341c4.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-e32ff05d.system.entry.js → p-f2207c05.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7680baf7.system.entry.js → p-fac4806c.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c262c7c0.entry.js → p-fc8bb551.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-fea16530.entry.js +1 -0
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/Roles-9b593b95.js +0 -28
- package/dist/cjs/verdocs-radio-button_3.cjs.entry.js +0 -241
- package/dist/cjs/verdocs-toolbar-icon.cjs.entry.js +0 -51
- package/dist/custom-elements.json +0 -1898
- package/dist/esm/Roles-6eb459df.js +0 -24
- package/dist/esm/verdocs-radio-button_3.entry.js +0 -235
- package/dist/esm/verdocs-toolbar-icon.entry.js +0 -47
- package/dist/esm-es5/Roles-6eb459df.js +0 -1
- package/dist/esm-es5/verdocs-button-panel_3.entry.js +0 -1
- package/dist/esm-es5/verdocs-checkbox_4.entry.js +0 -1
- package/dist/esm-es5/verdocs-radio-button_3.entry.js +0 -1
- package/dist/esm-es5/verdocs-template-attachments_4.entry.js +0 -1
- package/dist/esm-es5/verdocs-template-document-page.entry.js +0 -1
- package/dist/esm-es5/verdocs-toolbar-icon.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-0a86db90.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-17ec248a.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-27faf081.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-2960c946.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-4d8a70fc.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-567f8bbb.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-633926d8.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-65167ce1.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-6a56401e.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-781c6f9c.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-7daa9e29.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-8027431e.js +0 -1
- package/dist/verdocs-web-sdk/p-8229e6df.system.js +0 -1
- package/dist/verdocs-web-sdk/p-a27bcbd2.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-a3820b2c.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b2d8c147.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-da78b0c9.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-f3ac446d.system.entry.js +0 -1
@@ -1,24 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* A "role" is an individual participant in a signing flow, such as a signer or CC contact. Roles are identified by
|
3
|
-
* their names, which must be unique (e.g. 'Recipient 1'). Template fields are assigned to roles for signing operations,
|
4
|
-
* so you may have 'Recipient 1 Signature 1' and so forth.
|
5
|
-
*
|
6
|
-
* @module
|
7
|
-
*/
|
8
|
-
var createRole = function (endpoint, templateId, params) {
|
9
|
-
return endpoint.api //
|
10
|
-
.post("/templates/".concat(templateId, "/roles"), params)
|
11
|
-
.then(function (r) { return r.data; });
|
12
|
-
};
|
13
|
-
var updateRole = function (endpoint, templateId, roleName, params) {
|
14
|
-
return endpoint.api //
|
15
|
-
.put("/templates/".concat(templateId, "/roles/").concat(roleName), params)
|
16
|
-
.then(function (r) { return r.data; });
|
17
|
-
};
|
18
|
-
var deleteRole = function (endpoint, templateId, roleName) {
|
19
|
-
return endpoint.api //
|
20
|
-
.delete("/templates/".concat(templateId, "/roles/").concat(roleName))
|
21
|
-
.then(function (r) { return r.data; });
|
22
|
-
};
|
23
|
-
|
24
|
-
export { createRole as c, deleteRole as d, updateRole as u };
|
@@ -1,235 +0,0 @@
|
|
1
|
-
import { r as registerInstance, h, H as Host, c as createEvent } from './index-151c0874.js';
|
2
|
-
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint, T as TemplateSenderTypes } from './VerdocsEndpoint-e447b318.js';
|
4
|
-
import { u as updateRole, d as deleteRole } from './Roles-6eb459df.js';
|
5
|
-
import { g as getTemplateStore } from './TemplateStore-17700116.js';
|
6
|
-
import { S as SDKError } from './errors-9b5498c8.js';
|
7
|
-
import { u as updateTemplate } from './Templates-f90883f7.js';
|
8
|
-
import './index-38d7bc0b.js';
|
9
|
-
|
10
|
-
const verdocsRadioButtonCss = "verdocs-radio-button{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;width:20px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-radio-button.disabled{opacity:0.5}verdocs-radio-button input[type=radio]{position:absolute;opacity:0}verdocs-radio-button input[type=radio]+label:before{content:\"\";background:#f5f5fa;border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:16px;height:16px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-radio-button input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-radio-button input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-radio-button input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#a0a0d0;background:#a0a0d0}verdocs-radio-button input[type=radio]+label:empty:before{margin-right:0}verdocs-radio-button.required input[type=radio]+label:before{border:1px solid #cc0000}verdocs-radio-button.hide{display:none}verdocs-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}";
|
11
|
-
|
12
|
-
const VerdocsRadioButton = class {
|
13
|
-
constructor(hostRef) {
|
14
|
-
registerInstance(this, hostRef);
|
15
|
-
this.checked = false;
|
16
|
-
this.name = '';
|
17
|
-
this.value = '';
|
18
|
-
this.disabled = false;
|
19
|
-
}
|
20
|
-
render() {
|
21
|
-
return (h(Host, { class: { disabled: this.disabled } }, h("input", { type: "radio", value: this.value, name: this.name, id: `verdocs-radio-button-${this.name}-${this.value}`, checked: this.checked, disabled: this.disabled }), h("label", { htmlFor: `verdocs-radio-button-${this.name}-${this.value}` })));
|
22
|
-
}
|
23
|
-
};
|
24
|
-
VerdocsRadioButton.style = verdocsRadioButtonCss;
|
25
|
-
|
26
|
-
const verdocsTemplateRolePropertiesCss = "verdocs-template-role-properties{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-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}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}";
|
27
|
-
|
28
|
-
const TrashIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>`;
|
29
|
-
const VerdocsTemplateRoleProperties = class {
|
30
|
-
constructor(hostRef) {
|
31
|
-
registerInstance(this, hostRef);
|
32
|
-
this.close = createEvent(this, "close", 7);
|
33
|
-
this.delete = createEvent(this, "delete", 7);
|
34
|
-
this.sdkError = createEvent(this, "sdkError", 7);
|
35
|
-
this.store = null;
|
36
|
-
this.endpoint = VerdocsEndpoint.getDefault();
|
37
|
-
this.templateId = '';
|
38
|
-
this.roleName = '';
|
39
|
-
this.sender = TemplateSenderTypes.EVERYONE;
|
40
|
-
this.dirty = false;
|
41
|
-
this.saving = false;
|
42
|
-
this.name = '';
|
43
|
-
this.type = 'signer';
|
44
|
-
this.fullName = '';
|
45
|
-
this.email = '';
|
46
|
-
this.phone = '';
|
47
|
-
this.allowDelegation = false;
|
48
|
-
}
|
49
|
-
async componentWillLoad() {
|
50
|
-
var _a, _b, _c, _d, _e;
|
51
|
-
try {
|
52
|
-
this.endpoint.loadSession();
|
53
|
-
if (!this.templateId) {
|
54
|
-
console.log(`[ROLE_PROPERTIES] Missing required template ID ${this.templateId}`);
|
55
|
-
return;
|
56
|
-
}
|
57
|
-
if (!this.endpoint.session) {
|
58
|
-
console.log('[ROLE_PROPERTIES] Unable to start builder session, must be authenticated');
|
59
|
-
return;
|
60
|
-
}
|
61
|
-
this.store = await getTemplateStore(this.endpoint, this.templateId, false);
|
62
|
-
const editingRole = (_b = (_a = this.store) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.roles.find(role => role.name === this.roleName);
|
63
|
-
if (editingRole) {
|
64
|
-
this.name = editingRole.name;
|
65
|
-
this.type = editingRole.type;
|
66
|
-
this.fullName = editingRole.full_name;
|
67
|
-
this.email = editingRole.email;
|
68
|
-
this.phone = editingRole.phone;
|
69
|
-
this.allowDelegation = editingRole.delegator;
|
70
|
-
console.log('[ROLES] Editing role', editingRole);
|
71
|
-
}
|
72
|
-
}
|
73
|
-
catch (e) {
|
74
|
-
console.log('[TEMPLATE ROLE PROPERTIES] Error with preview session', e);
|
75
|
-
(_c = this.sdkError) === null || _c === void 0 ? void 0 : _c.emit(new SDKError(e.message, (_d = e.response) === null || _d === void 0 ? void 0 : _d.status, (_e = e.response) === null || _e === void 0 ? void 0 : _e.data));
|
76
|
-
}
|
77
|
-
}
|
78
|
-
handleCancel(e) {
|
79
|
-
var _a, _b, _c;
|
80
|
-
e.stopPropagation();
|
81
|
-
this.name = (_b = (_a = this.store) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.name;
|
82
|
-
this.dirty = false;
|
83
|
-
(_c = this.close) === null || _c === void 0 ? void 0 : _c.emit();
|
84
|
-
}
|
85
|
-
async handleSave(e) {
|
86
|
-
e.stopPropagation();
|
87
|
-
this.saving = true;
|
88
|
-
updateRole(this.endpoint, this.templateId, this.roleName, {
|
89
|
-
name: this.name,
|
90
|
-
type: this.type,
|
91
|
-
full_name: this.fullName,
|
92
|
-
email: this.email,
|
93
|
-
phone: this.phone,
|
94
|
-
delegator: this.allowDelegation,
|
95
|
-
})
|
96
|
-
.then(async (r) => {
|
97
|
-
var _a;
|
98
|
-
console.log('[ROLE_PROPERTIES] Update result', r);
|
99
|
-
this.saving = false;
|
100
|
-
this.dirty = false;
|
101
|
-
this.store = await getTemplateStore(this.endpoint, this.templateId, true);
|
102
|
-
// this.sortTemplateRoles();
|
103
|
-
// this.renumberTemplateRoles();
|
104
|
-
// const newRoles = [...this.store.state.roles];
|
105
|
-
// newRoles.forEach(role => {
|
106
|
-
// if (role.name === this.roleName) {
|
107
|
-
// role.name = this.name;
|
108
|
-
// role.type = this.type;
|
109
|
-
// role.full_name = this.fullName;
|
110
|
-
// role.email = this.email;
|
111
|
-
// role.phone = this.phone;
|
112
|
-
// role.delegator = this.allowDelegation;
|
113
|
-
// }
|
114
|
-
// });
|
115
|
-
// this.store.state.roles = newRoles;
|
116
|
-
(_a = this.close) === null || _a === void 0 ? void 0 : _a.emit();
|
117
|
-
})
|
118
|
-
.catch(e => {
|
119
|
-
console.log('Update error', e);
|
120
|
-
this.saving = false;
|
121
|
-
});
|
122
|
-
}
|
123
|
-
async handleDelete(e) {
|
124
|
-
e.stopPropagation();
|
125
|
-
if (window.confirm('Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.')) {
|
126
|
-
deleteRole(this.endpoint, this.templateId, this.roleName)
|
127
|
-
.then(r => {
|
128
|
-
var _a;
|
129
|
-
console.log('Role deleted', r);
|
130
|
-
this.store.state.roles = [...this.store.state.roles.filter(role => role.name !== this.roleName)];
|
131
|
-
(_a = this.delete) === null || _a === void 0 ? void 0 : _a.emit({ templateId: this.templateId, roleName: this.roleName });
|
132
|
-
})
|
133
|
-
.catch(e => {
|
134
|
-
console.log('Deletion error', e);
|
135
|
-
});
|
136
|
-
}
|
137
|
-
}
|
138
|
-
render() {
|
139
|
-
const hasFields = (this.store.state.fields || []).findIndex(field => field.role_name === this.roleName) !== -1;
|
140
|
-
return (h(Host, null, h("div", { class: "background-overlay", onClick: e => this.handleCancel(e) }, h("div", { class: "dialog" }, h("form", { onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off" }, h("verdocs-text-input", { id: "verdocs-recipient-name", label: "Role Name", value: this.name, autocomplete: "off", disabled: hasFields, helpText: hasFields
|
141
|
-
? 'This role has fields assigned and can no longer be renamed.'
|
142
|
-
: 'A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.', placeholder: "Template Name...", onInput: (e) => {
|
143
|
-
this.name = e.target.value;
|
144
|
-
this.dirty = true;
|
145
|
-
} }), h("div", { class: "row" }, h("div", { class: "input-label" }, "Type:"), h("verdocs-select-input", { value: this.type, options: [
|
146
|
-
{ label: 'Signer', value: 'signer' },
|
147
|
-
{ label: 'CC', value: 'cc' },
|
148
|
-
{ label: 'Approver', value: 'approver' },
|
149
|
-
], onInput: (e) => {
|
150
|
-
this.type = e.target.value;
|
151
|
-
this.dirty = true;
|
152
|
-
} }), h("verdocs-help-icon", { text: "Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review." })), h("verdocs-text-input", { id: "verdocs-recipient-email", label: "Full Name", value: this.fullName, autocomplete: "off", helpText: "The recipient's full name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.", placeholder: "Full Name...", onInput: (e) => {
|
153
|
-
this.fullName = e.target.value;
|
154
|
-
this.dirty = true;
|
155
|
-
} }), h("verdocs-text-input", { id: "verdocs-recipient-email", label: "Email", value: this.email, autocomplete: "off", helpText: "The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.", placeholder: "Email Address...", onInput: (e) => {
|
156
|
-
this.email = e.target.value;
|
157
|
-
this.dirty = true;
|
158
|
-
} }), h("verdocs-text-input", { id: "verdocs-recipient-phone", label: "Phone", value: this.phone, autocomplete: "off", helpText: "The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.", placeholder: "Phone Number...", onInput: (e) => {
|
159
|
-
this.phone = e.target.value;
|
160
|
-
this.dirty = true;
|
161
|
-
} }), h("div", { class: "row" }, h("div", { class: "input-label" }, "May Delegate:"), h("div", { class: "checkbox-wrapper" }, h("verdocs-checkbox", { checked: this.allowDelegation, onInput: (e) => {
|
162
|
-
this.allowDelegation = e.target.checked;
|
163
|
-
this.dirty = true;
|
164
|
-
} })), h("verdocs-help-icon", { text: "If enabled, this recipient may delegate their actions to another individual." })), h("div", { class: "buttons" }, h("button", { class: "delete-button", disabled: this.dirty, onClick: e => this.handleDelete(e), innerHTML: TrashIcon }), h("div", { style: { flex: '1' } }), h("verdocs-button", { size: "small", variant: "outline", label: "Cancel", disabled: !this.dirty, onClick: e => this.handleCancel(e) }), h("verdocs-button", { size: "small", label: "Save", disabled: !this.dirty, onClick: e => this.handleSave(e) })))))));
|
165
|
-
}
|
166
|
-
};
|
167
|
-
VerdocsTemplateRoleProperties.style = verdocsTemplateRolePropertiesCss;
|
168
|
-
|
169
|
-
const verdocsTemplateSenderCss = "verdocs-template-sender{font-family:\"Inter\", \"Barlow\", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}";
|
170
|
-
|
171
|
-
const VerdocsTemplateSender = class {
|
172
|
-
constructor(hostRef) {
|
173
|
-
registerInstance(this, hostRef);
|
174
|
-
this.close = createEvent(this, "close", 7);
|
175
|
-
this.sdkError = createEvent(this, "sdkError", 7);
|
176
|
-
this.store = null;
|
177
|
-
this.endpoint = VerdocsEndpoint.getDefault();
|
178
|
-
this.templateId = '';
|
179
|
-
this.sender = TemplateSenderTypes.EVERYONE;
|
180
|
-
this.saving = false;
|
181
|
-
}
|
182
|
-
async componentWillLoad() {
|
183
|
-
var _a, _b, _c, _d, _e;
|
184
|
-
try {
|
185
|
-
this.endpoint.loadSession();
|
186
|
-
if (!this.templateId) {
|
187
|
-
console.log(`[SENDER] Missing required template ID ${this.templateId}`);
|
188
|
-
return;
|
189
|
-
}
|
190
|
-
if (!this.endpoint.session) {
|
191
|
-
console.log('[SENDER] Unable to start builder session, must be authenticated');
|
192
|
-
return;
|
193
|
-
}
|
194
|
-
this.store = await getTemplateStore(this.endpoint, this.templateId, false);
|
195
|
-
this.sender = (_b = (_a = this.store) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.sender;
|
196
|
-
}
|
197
|
-
catch (e) {
|
198
|
-
console.log('[SENDER] Error with preview session', e);
|
199
|
-
(_c = this.sdkError) === null || _c === void 0 ? void 0 : _c.emit(new SDKError(e.message, (_d = e.response) === null || _d === void 0 ? void 0 : _d.status, (_e = e.response) === null || _e === void 0 ? void 0 : _e.data));
|
200
|
-
}
|
201
|
-
}
|
202
|
-
handleClose() {
|
203
|
-
this.close.emit();
|
204
|
-
}
|
205
|
-
// We need a separate event handler for clicking the background because it can receive events "through" other child components
|
206
|
-
handleDismiss(e) {
|
207
|
-
if (e.target.className === 'background-overlay') {
|
208
|
-
e.preventDefault();
|
209
|
-
this.handleClose();
|
210
|
-
}
|
211
|
-
}
|
212
|
-
async handleSelectSetting(value) {
|
213
|
-
this.saving = true;
|
214
|
-
updateTemplate(this.endpoint, this.templateId, { sender: value })
|
215
|
-
.then(r => {
|
216
|
-
var _a;
|
217
|
-
console.log('Update result', r);
|
218
|
-
if ((_a = this.store) === null || _a === void 0 ? void 0 : _a.state) {
|
219
|
-
this.store.state.sender = value;
|
220
|
-
}
|
221
|
-
this.saving = false;
|
222
|
-
this.sender = value;
|
223
|
-
})
|
224
|
-
.catch(e => {
|
225
|
-
console.log('Error saving', e);
|
226
|
-
this.saving = false;
|
227
|
-
});
|
228
|
-
}
|
229
|
-
render() {
|
230
|
-
return (h(Host, null, h("div", { class: "background-overlay", onClick: e => this.handleDismiss(e) }, h("div", { class: "dialog" }, h("div", { class: "options" }, h("div", { class: "option" }, h("verdocs-radio-button", { name: "template-sender", value: TemplateSenderTypes.EVERYONE, checked: this.sender === TemplateSenderTypes.EVERYONE, onInput: () => this.handleSelectSetting(TemplateSenderTypes.EVERYONE) }), h("div", { class: "description" }, h("div", { class: "name" }, "Anyone on the Web"), h("verdocs-help-icon", { text: "Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)" }))), h("div", { class: "option" }, h("verdocs-radio-button", { name: "template-sender", value: TemplateSenderTypes.EVERYONE_AS_CREATOR, checked: this.sender === TemplateSenderTypes.EVERYONE_AS_CREATOR, onInput: () => this.handleSelectSetting(TemplateSenderTypes.EVERYONE_AS_CREATOR) }), h("div", { class: "description" }, h("div", { class: "name" }, "Anyone on the Web as me"), h("verdocs-help-icon", { text: "Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)" }))), h("div", { class: "option" }, h("verdocs-radio-button", { name: "template-sender", value: TemplateSenderTypes.ORGANIZATION_MEMBER, checked: this.sender === TemplateSenderTypes.ORGANIZATION_MEMBER, onInput: () => this.handleSelectSetting(TemplateSenderTypes.ORGANIZATION_MEMBER) }), h("div", { class: "description" }, h("div", { class: "name" }, "Anyone in my organization"), h("verdocs-help-icon", { text: "Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')" }))), h("div", { class: "option" }, h("verdocs-radio-button", { name: "template-sender", value: TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR, checked: this.sender === TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR, onInput: () => this.handleSelectSetting(TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR) }), h("div", { class: "description" }, h("div", { class: "name" }, "Anyone in my organization as me"), h("verdocs-help-icon", { text: "Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)" }))), h("div", { class: "option" }, h("verdocs-radio-button", { name: "template-sender", value: TemplateSenderTypes.CREATOR, checked: this.sender === TemplateSenderTypes.CREATOR, onInput: () => this.handleSelectSetting(TemplateSenderTypes.CREATOR) }), h("div", { class: "description" }, h("div", { class: "name" }, "Me"), h("verdocs-help-icon", { text: "Only I can use this template." })))), h("div", { class: "buttons" }, h("verdocs-button", { label: "Close", onClick: () => this.handleClose() }))))));
|
231
|
-
}
|
232
|
-
};
|
233
|
-
VerdocsTemplateSender.style = verdocsTemplateSenderCss;
|
234
|
-
|
235
|
-
export { VerdocsRadioButton as verdocs_radio_button, VerdocsTemplateRoleProperties as verdocs_template_role_properties, VerdocsTemplateSender as verdocs_template_sender };
|
@@ -1,47 +0,0 @@
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-151c0874.js';
|
2
|
-
import { c as createPopper } from './popper-15e448b4.js';
|
3
|
-
|
4
|
-
const verdocsToolbarIconCss = "verdocs-toolbar-icon{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;display:inline-block}verdocs-toolbar-icon .icon{display:inline-block;cursor:pointer}verdocs-toolbar-icon .icon svg{fill:#5c6575}verdocs-toolbar-icon .tooltip{display:none;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;padding:5px 10px;font-size:13px;position:relative;border-radius:4px;z-index:20000;white-space:nowrap}verdocs-toolbar-icon .tooltip .arrow,verdocs-toolbar-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-toolbar-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-toolbar-icon .tooltip .arrow::before{visibility:visible;content:\"\";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-toolbar-icon .tooltip[data-show]{display:block}verdocs-toolbar-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]{padding:3px 10px}verdocs-toolbar-icon .tooltip[data-popper-placement^=left]>.arrow{right:-1px}";
|
5
|
-
|
6
|
-
const VerdocsToolbarIcon = class {
|
7
|
-
constructor(hostRef) {
|
8
|
-
registerInstance(this, hostRef);
|
9
|
-
this.text = '';
|
10
|
-
this.icon = '';
|
11
|
-
this.placement = 'bottom';
|
12
|
-
this.containerId = `verdocs-toolbar-icon-${Math.random().toString(36).substring(2, 11)}`;
|
13
|
-
}
|
14
|
-
componentDidLoad() {
|
15
|
-
this.popperInstance = createPopper(this.iconEl, this.tooltip, {
|
16
|
-
placement: this.placement,
|
17
|
-
modifiers: this.placement === 'left' ? [{ name: 'offset', options: { offset: [0, 20] } }] : [],
|
18
|
-
});
|
19
|
-
// placement: 'top-end',
|
20
|
-
// modifiers: [{name: 'offset', options: {offset: [0, 10]}}],
|
21
|
-
// });
|
22
|
-
}
|
23
|
-
disconnectedCallback() {
|
24
|
-
if (this.popperInstance) {
|
25
|
-
this.popperInstance.destroy();
|
26
|
-
this.popperInstance = null;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
show() {
|
30
|
-
var _a, _b;
|
31
|
-
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.setAttribute('data-show', '');
|
32
|
-
(_b = this.popperInstance) === null || _b === void 0 ? void 0 : _b.update().catch(() => { });
|
33
|
-
}
|
34
|
-
hide() {
|
35
|
-
var _a;
|
36
|
-
(_a = this.tooltip) === null || _a === void 0 ? void 0 : _a.removeAttribute('data-show');
|
37
|
-
}
|
38
|
-
// handlePress() {
|
39
|
-
// this.press?.emit();
|
40
|
-
// }
|
41
|
-
render() {
|
42
|
-
return (h(Host, { class: {} }, h("div", { "aria-describedby": this.containerId, class: "icon", innerHTML: this.icon, onMouseEnter: () => this.show(), onFocus: () => this.show(), onMouseLeave: () => this.hide(), onBlur: () => this.hide(), ref: el => (this.iconEl = el) }), h("div", { id: this.containerId, role: "tooltip", class: "tooltip", "data-popper-placement": this.placement, ref: el => (this.tooltip = el) }, this.text, h("div", { "data-popper-arrow": "true", class: "arrow" }))));
|
43
|
-
}
|
44
|
-
};
|
45
|
-
VerdocsToolbarIcon.style = verdocsToolbarIconCss;
|
46
|
-
|
47
|
-
export { VerdocsToolbarIcon as verdocs_toolbar_icon };
|
@@ -1 +0,0 @@
|
|
1
|
-
var createRole=function(e,t,a){return e.api.post("/templates/".concat(t,"/roles"),a).then((function(e){return e.data}))};var updateRole=function(e,t,a,n){return e.api.put("/templates/".concat(t,"/roles/").concat(a),n).then((function(e){return e.data}))};var deleteRole=function(e,t,a){return e.api.delete("/templates/".concat(t,"/roles/").concat(a)).then((function(e){return e.data}))};export{createRole as c,deleteRole as d,updateRole as u};
|
@@ -1 +0,0 @@
|
|
1
|
-
var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,o=1,i=arguments.length;o<i;o++){t=arguments[o];for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,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?o(e.value):n(e.value).then(s,l)}a((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,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(o)try{if(i=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];n=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var i=0,n=t.length,r;i<n;i++){if(r||!(i in t)){if(!r)r=Array.prototype.slice.call(t,0,i);r[i]=t[i]}}return e.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,h,H as Host,c as createEvent,a as getElement}from"./index-151c0874.js";import{c as createPopper}from"./popper-15e448b4.js";import{a as commonjsGlobal}from"./_commonjsHelpers-5ec8f9b7.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-e447b318.js";import{u as updateField,d as deleteField}from"./Fields-c82e6df3.js";import{g as getTemplateStore}from"./TemplateStore-17700116.js";import{S as SDKError}from"./errors-9b5498c8.js";import"./index-38d7bc0b.js";import"./Templates-f90883f7.js";var verdocsButtonPanelCss='verdocs-button-panel{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block}verdocs-button-panel .icon{display:inline-block;cursor:pointer;opacity:0.6}verdocs-button-panel .icon svg{fill:#707ae5}verdocs-button-panel .icon:hover{opacity:1}.verdocs-button-panel-content{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;display:none;background:#ffffff;color:#33364b;width:320px;font-weight:bold;padding:15px;font-size:14px;position:relative;border-radius:4px;z-index:10000}.verdocs-button-panel-content .arrow,.verdocs-button-panel-content .arrow::before{position:absolute;width:8px;height:8px;background:inherit}.verdocs-button-panel-content .arrow{visibility:hidden;top:-4px}.verdocs-button-panel-content .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}.verdocs-button-panel-content[data-show]{display:block}.verdocs-button-panel-content[data-popper-placement^=top]>.arrow{bottom:-4px}.verdocs-button-panel-content[data-popper-placement^=bottom]>.arrow{top:-4px}.verdocs-button-panel-content[data-popper-placement^=left]>.arrow{right:-4px}.verdocs-button-panel-content[data-popper-placement^=right]>.arrow{left:-4px}.verdocs-button-panel-content h6{font-size:16px;font-weight:bold;margin:0 0 16px 0;color:#092c4c;border-bottom:1px solid #cccccc}';var VerdocsButtonPanel=function(){function e(e){registerInstance(this,e);this.showing=false;this.icon=""}e.prototype.componentDidRender=function(){document.body.appendChild(this.panelEl);if(this.popperInstance){this.popperInstance.destroy()}this.popperInstance=createPopper(this.iconEl,this.panelEl,{})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}if(this.panelEl){this.panelEl.remove()}};e.prototype.showPanel=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;var o=this;return __generator(this,(function(i){(e=this.panelEl)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}));this.showing=true;this.hiderEl=document.createElement("div");this.hiderEl.id="verdocs-button-panel-hider";this.hiderEl.style.zIndex="100";this.hiderEl.style.position="absolute";this.hiderEl.style.top="0px";this.hiderEl.style.left="0px";this.hiderEl.style.right="0px";this.hiderEl.style.bottom="0px";this.hiderEl.onclick=function(e){e.stopPropagation();o.toggle()};document.body.appendChild(this.hiderEl);return[2]}))}))};e.prototype.hidePanel=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){Array.from(document.getElementsByClassName("verdocs-button-panel-content")).forEach((function(e){e.removeAttribute("data-show")}));(e=document.getElementById("verdocs-button-panel-hider"))===null||e===void 0?void 0:e.remove();this.showing=false;return[2]}))}))};e.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!this.showing)return[3,2];return[4,this.hidePanel()];case 1:e.sent();return[3,4];case 2:return[4,this.showPanel()];case 3:e.sent();e.label=4;case 4:return[2]}}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"icon",innerHTML:this.icon,onClick:function(t){t.stopPropagation();return e.toggle()},ref:function(t){return e.iconEl=t}}),h("div",{role:"tooltip",class:"verdocs-button-panel-content","data-popper-placement":"bottom",ref:function(t){return e.panelEl=t}},h("div",{"data-popper-arrow":"true",class:"arrow"}),h("slot",null)))};return e}();VerdocsButtonPanel.style=verdocsButtonPanelCss;var verdocsSelectInputCss='verdocs-select-input{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-select-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;background:#ffffff;border:1px solid #cccccc;border-radius:4px;background:#ffffff;color:#092c4c;width:100%;font-size:16px;height:28px;padding:2px 8px}verdocs-select-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-select-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}';var VerdocsSelectInput=function(){function e(e){registerInstance(this,e);this.value="";this.label="";this.options=undefined;this.disabled=false}e.prototype.render=function(){var e=this;return h(Host,{class:"input-field"},h("label",null,this.label?h("div",{class:"input-label"},this.label+":"):h("div",null),h("select",{class:"input-element",disabled:this.disabled},this.options.map((function(t){return h("option",{value:t.value,selected:t.value===e.value},t.label)})))))};return e}();VerdocsSelectInput.style=verdocsSelectInputCss;var rng;var crypto=typeof commonjsGlobal!=="undefined"&&(commonjsGlobal.crypto||commonjsGlobal.msCrypto);if(crypto&&crypto.getRandomValues){var rnds8=new Uint8Array(16);rng=function e(){crypto.getRandomValues(rnds8);return rnds8}}if(!rng){var rnds=new Array(16);rng=function(){for(var e=0,t;e<16;e++){if((e&3)===0)t=Math.random()*4294967296;rnds[e]=t>>>((e&3)<<3)&255}return rnds}}var rngBrowser=rng;var byteToHex=[];for(var i=0;i<256;++i){byteToHex[i]=(i+256).toString(16).substr(1)}function bytesToUuid(e,t){var o=t||0;var i=byteToHex;return i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+"-"+i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]+i[e[o++]]}var bytesToUuid_1=bytesToUuid;var _seedBytes=rngBrowser();var _nodeId=[_seedBytes[0]|1,_seedBytes[1],_seedBytes[2],_seedBytes[3],_seedBytes[4],_seedBytes[5]];var _clockseq=(_seedBytes[6]<<8|_seedBytes[7])&16383;var _lastMSecs=0,_lastNSecs=0;function v1(e,t,o){var i=t&&o||0;var n=t||[];e=e||{};var r=e.clockseq!==undefined?e.clockseq:_clockseq;var s=e.msecs!==undefined?e.msecs:(new Date).getTime();var l=e.nsecs!==undefined?e.nsecs:_lastNSecs+1;var a=s-_lastMSecs+(l-_lastNSecs)/1e4;if(a<0&&e.clockseq===undefined){r=r+1&16383}if((a<0||s>_lastMSecs)&&e.nsecs===undefined){l=0}if(l>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}_lastMSecs=s;_lastNSecs=l;_clockseq=r;s+=122192928e5;var d=((s&268435455)*1e4+l)%4294967296;n[i++]=d>>>24&255;n[i++]=d>>>16&255;n[i++]=d>>>8&255;n[i++]=d&255;var p=s/4294967296*1e4&268435455;n[i++]=p>>>8&255;n[i++]=p&255;n[i++]=p>>>24&15|16;n[i++]=p>>>16&255;n[i++]=r>>>8|128;n[i++]=r&255;var c=e.node||_nodeId;for(var u=0;u<6;++u){n[i+u]=c[u]}return t?t:bytesToUuid_1(n)}var v1_1=v1;function v4(e,t,o){var i=t&&o||0;if(typeof e=="string"){t=e=="binary"?new Array(16):null;e=null}e=e||{};var n=e.random||(e.rng||rngBrowser)();n[6]=n[6]&15|64;n[8]=n[8]&63|128;if(t){for(var r=0;r<16;++r){t[i+r]=n[r]}}return t||bytesToUuid_1(n)}var v4_1=v4;var uuid=v4_1;uuid.v1=v1_1;uuid.v4=v4_1;var uuidBrowser=uuid;var verdocsTemplateFieldPropertiesCss='verdocs-template-field-properties{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-template-field-properties .buttons{display:-ms-flexbox;display:flex;margin-top:30px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-field-properties .buttons verdocs-button{margin-left:16px}verdocs-template-field-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-field-properties verdocs-text-input{margin:0;-ms-flex:1;flex:1}verdocs-template-field-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-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}verdocs-template-field-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-field-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-field-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .delete-button:active{background:#f3f3f3}verdocs-template-field-properties .delete-button svg{width:24px;height:24px}verdocs-template-field-properties h6{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex;font-size:16px;font-weight:bold;margin:0 0 8px 0;-ms-flex-direction:row;flex-direction:row;color:#092c4c}verdocs-template-field-properties h6 .help-icon{opacity:0.5}verdocs-template-field-properties h6 .help-icon:hover{opacity:1;cursor:pointer}verdocs-template-field-properties .row-header{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-field-properties .row-header h6{margin-bottom:0}verdocs-template-field-properties .row-header verdocs-help-icon{-webkit-transform:scale(0.85);transform:scale(0.85)}verdocs-template-field-properties .row-header verdocs-help-icon svg{margin-bottom:-5px}verdocs-template-field-properties .row-header .add-button{margin:0;padding:0;border:none;opacity:0.5;cursor:pointer;background:none}verdocs-template-field-properties .row-header .add-button:hover{opacity:1}verdocs-template-field-properties .row-header .add-button svg{width:32px;height:32px}verdocs-template-field-properties .option-row{margin:15px 0}verdocs-template-field-properties .option-row .remove-button{height:28px;display:-ms-flexbox;display:flex;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-field-properties .option-row .remove-button:active{background:#f3f3f3}verdocs-template-field-properties .option-row .remove-button:hover svg{stroke:#a50021}verdocs-template-field-properties .option-row .remove-button svg{width:20px;height:20px;stroke:#333333}verdocs-template-field-properties .options{background:#f3f3f3;padding:0 0 10px 0}verdocs-template-field-properties .options .row-header,verdocs-template-field-properties .options .option-row{padding:0 10px}verdocs-template-field-properties .options .add-option-button{border-radius:5px;border:1px solid #cccccc;background:#46497d;color:#ffffff;padding:3px 8px}verdocs-template-field-properties .options .option-row .input-element{font-size:14px}verdocs-template-field-properties .options verdocs-help-icon{opacity:1;-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-field-properties .options verdocs-help-icon svg{fill:#ffffff}';var capitalize=function(e){return e.charAt(0).toUpperCase()+e.slice(1)};var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var HelpIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';var VerdocsTemplateFieldProperties=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.delete=createEvent(this,"delete",7);this.settingsChanged=createEvent(this,"settingsChanged",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.fieldName="";this.helpText="";this.dirty=false;this.loading=true;this.type="signature";this.setting=null;this.name="";this.roleName="";this.group="";this.fieldType="";this.required=false;this.options=[];this.placeholder="";this.value="";this.leading=0;this.showingHelp=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i,n,r,s,l,a,d,p,c;var u=this;return __generator(this,(function(h){switch(h.label){case 0:h.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[FIELD PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.fieldName){console.error("[FIELD PROPERTIES] Missing required field name");return[2]}if(!this.endpoint.session){console.log("[FIELD PROPERTIES] Unable to start builder session, must be authenticated");return[2]}d=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:d.store=h.sent();p=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.fields.find((function(e){return e.name===u.fieldName}));if(!p){console.log('[FIELD PROPERTIES] Unable to find field "'.concat(this.fieldName,'" in template'))}this.type=p.type;this.name=p.name;this.group=p.name;this.roleName=p.role_name;this.required=p.required;this.fieldType=p.type;this.placeholder=((o=p.setting)===null||o===void 0?void 0:o.placeholder)||"";this.value=((i=p.setting)===null||i===void 0?void 0:i.result)||"";this.leading=((n=p.setting)===null||n===void 0?void 0:n.leading)||0;this.setting=p.setting||{};this.options=((r=p.setting)===null||r===void 0?void 0:r.options)||[];this.dirty=false;this.loading=false;return[3,3];case 2:c=h.sent();console.log("[FIELD PROPERTIES] Error loading template",c);this.loading=false;(s=this.sdkError)===null||s===void 0?void 0:s.emit(new SDKError(c.message,(l=c.response)===null||l===void 0?void 0:l.status,(a=c.response)===null||a===void 0?void 0:a.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t=this;var o,i,n,r,s,l;e.stopPropagation();var a=(i=(o=this.store)===null||o===void 0?void 0:o.state)===null||i===void 0?void 0:i.fields.find((function(e){return e.name===t.fieldName}));if(a){this.name=a.name;this.roleName=a.role_name;this.required=a.required;this.placeholder=((n=a.setting)===null||n===void 0?void 0:n.placeholder)||"";this.value=((r=a.setting)===null||r===void 0?void 0:r.result)||"";this.leading=((s=a.setting)===null||s===void 0?void 0:s.leading)||0}this.dirty=false;(l=this.close)===null||l===void 0?void 0:l.emit()};e.prototype.handleSave=function(e){var t=this;e.stopPropagation();var o={name:this.name,required:this.required,role_name:this.roleName};if(this.type==="checkbox_group"||this.type==="radio_button_group"){o.setting=this.setting;o.setting.options=this.options}else if(this.type==="textarea"||this.type==="textbox"){o.setting=__assign({},this.setting);o.setting.result=(this.value||"").trim()}else if(this.type==="dropdown"){o.setting={x:this.setting.x,y:this.setting.y,options:this.options}}updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var i,n;t.dirty=false;t.updateField(e);(i=t.settingsChanged)===null||i===void 0?void 0:i.emit({fieldName:t.fieldName,settings:o,field:e});(n=t.close)===null||n===void 0?void 0:n.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.handleAddOption=function(e){var t=this;e.stopPropagation();var o={name:this.name,required:this.required,role_name:this.roleName};this.options.push(this.type==="radio_button_group"?{id:uuidBrowser(),value:"Option ".concat(this.options.length+1),selected:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20}:{id:uuidBrowser(),value:"Option ".concat(this.options.length+1),checked:false,x:this.options.length>0?this.options[this.options.length-1].x:20,y:this.options.length>0?this.options[this.options.length-1].y-25:20});o.setting=__assign({},this.setting);delete o.setting.result;o.setting.options=__spreadArray([],this.options,true);updateField(this.endpoint,this.templateId,this.fieldName,o).then((function(e){var i,n;t.dirty=false;t.updateField(e);(i=t.settingsChanged)===null||i===void 0?void 0:i.emit({fieldName:t.fieldName,settings:o,field:e});(n=t.close)===null||n===void 0?void 0:n.emit()})).catch((function(){console.log("Field update failed",e)}))};e.prototype.updateField=function(e){var t=this;var o=__spreadArray([],this.store.state.fields,true);o.forEach((function(o){if(o.name===t.fieldName){Object.assign(o,e)}}));this.store.state.fields=o};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this field? This action cannot be undone.")){deleteField(this.endpoint,this.templateId,this.fieldName).then((function(){var e,o,i,n,r;t.store.state.fields=__spreadArray([],(o=(e=t.store)===null||e===void 0?void 0:e.state)===null||o===void 0?void 0:o.fields.filter((function(e){return e.name!==t.fieldName})),true);(n=(i=t.store)===null||i===void 0?void 0:i.state)===null||n===void 0?void 0:n.roles.forEach((function(e){e.fields=__spreadArray([],e.fields.filter((function(e){return e.name!==t.fieldName})),true)}));(r=t.delete)===null||r===void 0?void 0:r.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("[FIELD PROPERTIES] Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t,o,i,n;if(!this.endpoint.session){return h(Host,null,h("verdocs-component-error",{message:"You must be authenticated to use this module."}))}if(!this.endpoint.session||!((o=(t=this.store)===null||t===void 0?void 0:t.state)===null||o===void 0?void 0:o.isLoaded)){return h(Host,{class:"empty"})}if(this.helpText&&this.showingHelp){return h(Host,null,h("h6",null,capitalize(this.fieldType)," Settings ",h("div",{style:{flex:"1"}}),h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=false}})),h("p",{class:"instructions",innerHTML:this.helpText}))}return h(Host,null,h("h6",null,capitalize(this.fieldType.replace(/_/g," "))," Settings ",h("div",{style:{flex:"1"}}),this.helpText&&h("div",{class:"help-icon",innerHTML:HelpIcon,onClick:function(){return e.showingHelp=true}})),h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{class:"row"},h("verdocs-text-input",{id:"verdocs-field-name",label:"Field Name",value:this.name,autocomplete:"off",placeholder:"Field Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}})),h("div",{class:"row"},h("div",{class:"input-label"},"Role:"),h("verdocs-select-input",{value:this.roleName,options:(n=(i=this.store)===null||i===void 0?void 0:i.state)===null||n===void 0?void 0:n.roles.map((function(e){return{label:e.name,value:e.name}})),onInput:function(t){e.roleName=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-value",label:"Value",value:this.value,autocomplete:"off",placeholder:"Pre-defined value...",onInput:function(t){e.value=t.target.value;e.dirty=true}})),["textbox","textarea"].includes(this.type)&&h("div",{class:"row",style:{marginTop:"10px",marginBottom:"10px"}},h("verdocs-text-input",{id:"verdocs-field-placeholder",label:"Placeholder",value:this.placeholder,autocomplete:"off",placeholder:"Placeholder...",onInput:function(t){e.placeholder=t.target.value;e.dirty=true}})),h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px"}},h("label",{htmlFor:"verdocs-is-required",class:"input-label"},"Required"),h("verdocs-checkbox",{id:"verdocs-is-required",name:"is-required",checked:this.required,value:"on",onInput:function(t){e.required=t.target.checked;e.dirty=true}})),["checkbox_group","radio_button_group"].includes(this.type)&&h("verdocs-button",{size:"small",onClick:function(t){return e.handleAddOption(t)},label:"Add Option"}),["dropdown"].includes(this.type)&&h("div",{class:"options"},h("div",{class:"row",style:{marginTop:"15px",marginBottom:"15px",textAlign:"center",fontWeight:"700",fontSize:"14px",justifyContent:"center",backgroundColor:"#333333",padding:"5px 8px",color:"#ffffff"}},"Options"),h("div",{class:"row-header"},h("h6",null,"ID"),h("h6",null,"Label"),h("div",{style:{width:"34px"}})),this.options.map((function(t,o){return h("div",{class:"row option-row",key:o},h("verdocs-text-input",{id:"verdocs-option-id-".concat(t.id),value:t.id,placeholder:"Unique ID",onInput:function(t){e.options[o].id=t.target.value;e.dirty=true}}),h("verdocs-text-input",{id:"verdocs-option-value-".concat(t.id),value:t.value,placeholder:"Display value",onInput:function(t){e.options[o].value=t.target.value;e.dirty=true}}),h("button",{innerHTML:TrashIcon,class:"remove-button",onClick:function(){e.options=e.options.filter((function(e){return e.id!==t.id}));e.dirty=true}}))})),h("div",{class:"row-header"},h("button",{class:"add-option-button",onClick:function(){e.options=__spreadArray(__spreadArray([],e.options,true),[{id:"option-".concat(e.options.length+1),value:"Option ".concat(e.options.length+1)}],false);e.dirty=true}},"Add Option"))),h("div",{class:"buttons"},h("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{style:{flex:"1"}}),h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();VerdocsTemplateFieldProperties.style=verdocsTemplateFieldPropertiesCss;export{VerdocsButtonPanel as verdocs_button_panel,VerdocsSelectInput as verdocs_select_input,VerdocsTemplateFieldProperties as verdocs_template_field_properties};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{r as registerInstance,h,H as Host}from"./index-151c0874.js";import{c as createPopper}from"./popper-15e448b4.js";var verdocsCheckboxCss='@charset "UTF-8";verdocs-checkbox{line-height:18px;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif}verdocs-checkbox label>input[type=checkbox]{display:none}verdocs-checkbox label>input[type=checkbox]+*::before{content:"";width:20px;height:20px;-ms-flex-negative:0;flex-shrink:0;line-height:20px;border-radius:2px;border-style:solid;border-width:0.1rem;display:inline-block;vertical-align:bottom;border-color:#aeb4bf}verdocs-checkbox label>input[type=checkbox]:checked+*{color:#55bc81}verdocs-checkbox label>input[type=checkbox]:checked+*::before{content:"✓";color:white;text-align:center;background:#55bc81;border-color:#55bc81}verdocs-checkbox.dark label>input[type=checkbox]+*::before{border-color:#ffffff}verdocs-checkbox.dark label>input[type=checkbox]:checked+*::before{background:#55bc81;border-color:#55bc81}';var VerdocsCheckbox=function(){function e(e){registerInstance(this,e);this.checked=false;this.name="";this.label="";this.value="";this.theme="light";this.disabled=false}e.prototype.render=function(){var e;return h(Host,{class:(e={disabled:this.disabled},e[this.theme]=true,e)},h("label",null,h("input",{type:"checkbox",value:this.value,name:this.name,checked:this.checked,disabled:this.disabled}),h("span",null,this.label)))};return e}();VerdocsCheckbox.style=verdocsCheckboxCss;var verdocsComponentErrorCss='verdocs-component-error{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;padding:15px;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-component-error .inner{-ms-flex:1;flex:1;height:300px;display:-ms-flexbox;display:flex;font-size:18px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px;background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}';var VerdocsComponentError=function(){function e(e){registerInstance(this,e);this.message=""}e.prototype.render=function(){return h(Host,null,h("div",{class:"inner"},this.message))};return e}();VerdocsComponentError.style=verdocsComponentErrorCss;var verdocsHelpIconCss='verdocs-help-icon{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:inline-block;opacity:0.3;position:relative}verdocs-help-icon:hover{opacity:1}verdocs-help-icon .icon{display:inline-block}verdocs-help-icon .icon svg{fill:#5c6575}verdocs-help-icon .tooltip{display:none;min-width:200px;-webkit-box-shadow:0 0 10px 1px #999999;box-shadow:0 0 10px 1px #999999;background:#ffffff;color:#33364b;max-width:240px;font-weight:bold;position:absolute;padding:5px 10px;font-size:13px;border-radius:4px;z-index:10000}verdocs-help-icon .tooltip .arrow,verdocs-help-icon .tooltip .arrow::before{position:absolute;width:8px;height:8px;background:inherit}verdocs-help-icon .tooltip .arrow{visibility:hidden;top:-4px}verdocs-help-icon .tooltip .arrow::before{visibility:visible;content:"";-webkit-transform:rotate(45deg);transform:rotate(45deg)}verdocs-help-icon .tooltip[data-show]{display:block}verdocs-help-icon .tooltip[data-popper-placement^=top]>.arrow{bottom:-4px}verdocs-help-icon .tooltip[data-popper-placement^=bottom]>.arrow{top:-4px}verdocs-help-icon .tooltip[data-popper-placement^=left]>.arrow{right:-4px}verdocs-help-icon .tooltip[data-popper-placement^=right]>.arrow{left:-4px}';var helpIcon='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M11.925 18q.55 0 .938-.387.387-.388.387-.938 0-.55-.387-.925-.388-.375-.938-.375-.55 0-.925.375t-.375.925q0 .55.375.938.375.387.925.387Zm-.95-3.85h1.95q0-.8.2-1.287.2-.488 1.025-1.288.65-.625 1.025-1.213.375-.587.375-1.437 0-1.425-1.025-2.175Q13.5 6 12.1 6q-1.425 0-2.35.775t-1.275 1.85l1.775.7q.125-.45.55-.975.425-.525 1.275-.525.725 0 1.1.412.375.413.375.888 0 .475-.287.9-.288.425-.713.775-1.075.95-1.325 1.475-.25.525-.25 1.875ZM12 22.2q-2.125 0-3.988-.8-1.862-.8-3.237-2.175Q3.4 17.85 2.6 15.988 1.8 14.125 1.8 12t.8-3.988q.8-1.862 2.175-3.237Q6.15 3.4 8.012 2.6 9.875 1.8 12 1.8t3.988.8q1.862.8 3.237 2.175Q20.6 6.15 21.4 8.012q.8 1.863.8 3.988t-.8 3.988q-.8 1.862-2.175 3.237Q17.85 20.6 15.988 21.4q-1.863.8-3.988.8Zm0-2.275q3.325 0 5.625-2.3t2.3-5.625q0-3.325-2.3-5.625T12 4.075q-3.325 0-5.625 2.3T4.075 12q0 3.325 2.3 5.625t5.625 2.3ZM12 12Z"/></svg>';var VerdocsHelpIcon=function(){function e(e){registerInstance(this,e);this.text="";this.containerId="verdocs-help-icon-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentDidLoad=function(){this.popperInstance=createPopper(this.icon,this.tooltip,{})};e.prototype.disconnectedCallback=function(){if(this.popperInstance){this.popperInstance.destroy();this.popperInstance=null}};e.prototype.show=function(){var e,t;(e=this.tooltip)===null||e===void 0?void 0:e.setAttribute("data-show","");(t=this.popperInstance)===null||t===void 0?void 0:t.update().catch((function(){}))};e.prototype.hide=function(){var e;(e=this.tooltip)===null||e===void 0?void 0:e.removeAttribute("data-show")};e.prototype.render=function(){var e=this;return h(Host,{class:{}},h("div",{"aria-describedby":this.containerId,class:"icon",innerHTML:helpIcon,onMouseEnter:function(){return e.show()},onFocus:function(){return e.show()},onMouseLeave:function(){return e.hide()},onBlur:function(){return e.hide()},ref:function(t){return e.icon=t}}),h("div",{id:this.containerId,role:"tooltip",class:"tooltip","data-popper-placement":"bottom",ref:function(t){return e.tooltip=t}},h("span",{innerHTML:this.text}),h("div",{"data-popper-arrow":"true",class:"arrow"})))};return e}();VerdocsHelpIcon.style=verdocsHelpIconCss;var verdocsTextInputCss='verdocs-text-input{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box;margin:0 0 10px 0;display:block}verdocs-text-input .input-element{-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid #707ae5;border-radius:4px;background:#ffffff;color:#000;width:100%;font-size:16px;height:28px;padding:4px 12px;outline:none}verdocs-text-input .input-element:disabled{border:1px solid #aeb4bf;background:#f5f5fa}verdocs-text-input .input-element::-webkit-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::-moz-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element:-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::-ms-input-placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element::placeholder{color:#aaaaaa;opacity:1}verdocs-text-input .input-element:focus{outline:1px solid #7d88ff}verdocs-text-input .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0}verdocs-text-input .required{color:red;margin-left:2px;display:inline-block}verdocs-text-input [data-lastpass-icon-root]{display:none !important}';var VerdocsTextInput=function(){function e(e){registerInstance(this,e);this.value="";this.label="";this.placeholder="";this.autocomplete="";this.helpText="";this.type="text";this.disabled=false;this.required=false}e.prototype.render=function(){return h(Host,{class:"input-field"},h("label",null,this.label&&h("div",{class:"input-label"},this.label+":",this.required&&h("span",{class:"required"},"*")),h("input",{type:this.type,value:this.value,required:this.required,class:"input-element","data-lpignore":"true",disabled:this.disabled,placeholder:this.placeholder,autoComplete:this.autocomplete}),this.helpText&&h("verdocs-help-icon",{text:this.helpText})))};return e}();VerdocsTextInput.style=verdocsTextInputCss;export{VerdocsCheckbox as verdocs_checkbox,VerdocsComponentError as verdocs_component_error,VerdocsHelpIcon as verdocs_help_icon,VerdocsTextInput as verdocs_text_input};
|
@@ -1 +0,0 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,o,i){function n(e){return e instanceof o?e:new o((function(t){t(e)}))}return new(o||(o=Promise))((function(o,r){function s(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i["throw"](e))}catch(e){r(e)}}function l(e){e.done?o(e.value):n(e.value).then(s,a)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(o)try{if(i=1,n&&(r=s[0]&2?n["return"]:s[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,s[1])).done)return r;if(n=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;n=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){o.label=s[1];break}if(s[0]===6&&o.label<r[1]){o.label=r[1];r=s;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(s);break}if(r[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];n=0}finally{i=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,o){if(o||arguments.length===2)for(var i=0,n=t.length,r;i<n;i++){if(r||!(i in t)){if(!r)r=Array.prototype.slice.call(t,0,i);r[i]=t[i]}}return e.concat(r||Array.prototype.slice.call(t))};import{r as registerInstance,h,H as Host,c as createEvent}from"./index-151c0874.js";import"./Types-5f31149e.js";import{V as VerdocsEndpoint,T as TemplateSenderTypes}from"./VerdocsEndpoint-e447b318.js";import{u as updateRole,d as deleteRole}from"./Roles-6eb459df.js";import{g as getTemplateStore}from"./TemplateStore-17700116.js";import{S as SDKError}from"./errors-9b5498c8.js";import{u as updateTemplate}from"./Templates-f90883f7.js";import"./index-38d7bc0b.js";var verdocsRadioButtonCss='verdocs-radio-button{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;width:20px;height:20px;display:block;font-size:11px;position:relative;background-color:transparent;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:100%}verdocs-radio-button.disabled{opacity:0.5}verdocs-radio-button input[type=radio]{position:absolute;opacity:0}verdocs-radio-button input[type=radio]+label:before{content:"";background:#f5f5fa;border-radius:100%;border:1px solid rgba(0, 0, 0, 0.6);display:inline-block;width:16px;height:16px;position:absolute;left:1px;top:1px;cursor:pointer;text-align:center;-webkit-transition:all 250ms ease;transition:all 250ms ease}verdocs-radio-button input[type=radio]:checked+label:before{background-color:#55bc81;-webkit-box-shadow:inset 0 0 0 2px #f5f5fa;box-shadow:inset 0 0 0 2px #f5f5fa}verdocs-radio-button input[type=radio]:focus+label:before{outline:none;border-color:#55bc81}verdocs-radio-button input[type=radio]:disabled+label:before{-webkit-box-shadow:inset 0 0 0 4px #f5f5fa;box-shadow:inset 0 0 0 4px #f5f5fa;border-color:#a0a0d0;background:#a0a0d0}verdocs-radio-button input[type=radio]+label:empty:before{margin-right:0}verdocs-radio-button.required input[type=radio]+label:before{border:1px solid #cc0000}verdocs-radio-button.hide{display:none}verdocs-radio-button.focused{-webkit-animation:verdocs-field-pulse 0.75s 2;animation:verdocs-field-pulse 0.75s 2}';var VerdocsRadioButton=function(){function e(e){registerInstance(this,e);this.checked=false;this.name="";this.value="";this.disabled=false}e.prototype.render=function(){return h(Host,{class:{disabled:this.disabled}},h("input",{type:"radio",value:this.value,name:this.name,id:"verdocs-radio-button-".concat(this.name,"-").concat(this.value),checked:this.checked,disabled:this.disabled}),h("label",{htmlFor:"verdocs-radio-button-".concat(this.name,"-").concat(this.value)}))};return e}();VerdocsRadioButton.style=verdocsRadioButtonCss;var verdocsTemplateRolePropertiesCss='verdocs-template-role-properties{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-role-properties .background-overlay{position:fixed;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-role-properties .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-role-properties .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form .row{display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;margin:0 0 10px 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form .row .input-label{display:block;color:#555570;font-weight:700;font-size:14px;margin:0 0 4px 0;-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-select-input{-ms-flex:1;flex:1;margin:0}verdocs-template-role-properties verdocs-text-input{margin:0 0 10px 0}verdocs-template-role-properties verdocs-text-input label{margin:0;display:-ms-flexbox;display:flex;-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}verdocs-template-role-properties verdocs-text-input .input-label{-ms-flex:0 0 100px;flex:0 0 100px}verdocs-template-role-properties verdocs-text-input input{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties verdocs-text-input verdocs-text-input{margin:0}verdocs-template-role-properties .checkbox-wrapper{-ms-flex:1;flex:1;display:-ms-flexbox;display:flex}verdocs-template-role-properties .delete-button{height:34px;display:-ms-flexbox;display:flex;padding:0 6px;cursor:pointer;background:none;border-radius:4px;-ms-flex-align:center;align-items:center;border:1px solid #999;-ms-flex-pack:center;justify-content:center}verdocs-template-role-properties .delete-button svg{width:24px;height:24px}verdocs-template-role-properties .delete-button:active{background:#f3f3f3}';var TrashIcon='<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="#a50021"><path stroke-linecap="round" stroke-linejoin="round" d="M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0" /></svg>';var VerdocsTemplateRoleProperties=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.delete=createEvent(this,"delete",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.roleName="";this.sender=TemplateSenderTypes.EVERYONE;this.dirty=false;this.saving=false;this.name="";this.type="signer";this.fullName="";this.email="";this.phone="";this.allowDelegation=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i,n,r,s,a;var l=this;return __generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[ROLE_PROPERTIES] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[ROLE_PROPERTIES] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:r.store=d.sent();s=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.roles.find((function(e){return e.name===l.roleName}));if(s){this.name=s.name;this.type=s.type;this.fullName=s.full_name;this.email=s.email;this.phone=s.phone;this.allowDelegation=s.delegator;console.log("[ROLES] Editing role",s)}return[3,3];case 2:a=d.sent();console.log("[TEMPLATE ROLE PROPERTIES] Error with preview session",a);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(a.message,(i=a.response)===null||i===void 0?void 0:i.status,(n=a.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleCancel=function(e){var t,o,i;e.stopPropagation();this.name=(o=(t=this.store)===null||t===void 0?void 0:t.state)===null||o===void 0?void 0:o.name;this.dirty=false;(i=this.close)===null||i===void 0?void 0:i.emit()};e.prototype.handleSave=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();this.saving=true;updateRole(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,full_name:this.fullName,email:this.email,phone:this.phone,delegator:this.allowDelegation}).then((function(e){return __awaiter(t,void 0,void 0,(function(){var t,o;return __generator(this,(function(i){switch(i.label){case 0:console.log("[ROLE_PROPERTIES] Update result",e);this.saving=false;this.dirty=false;o=this;return[4,getTemplateStore(this.endpoint,this.templateId,true)];case 1:o.store=i.sent();(t=this.close)===null||t===void 0?void 0:t.emit();return[2]}}))}))})).catch((function(e){console.log("Update error",e);t.saving=false}));return[2]}))}))};e.prototype.handleDelete=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){e.stopPropagation();if(window.confirm("Are you sure you wish to remove this role? All associated fields will be removed as well. This action cannot be undone.")){deleteRole(this.endpoint,this.templateId,this.roleName).then((function(e){var o;console.log("Role deleted",e);t.store.state.roles=__spreadArray([],t.store.state.roles.filter((function(e){return e.name!==t.roleName})),true);(o=t.delete)===null||o===void 0?void 0:o.emit({templateId:t.templateId,roleName:t.roleName})})).catch((function(e){console.log("Deletion error",e)}))}return[2]}))}))};e.prototype.render=function(){var e=this;var t=(this.store.state.fields||[]).findIndex((function(t){return t.role_name===e.roleName}))!==-1;return h(Host,null,h("div",{class:"background-overlay",onClick:function(t){return e.handleCancel(t)}},h("div",{class:"dialog"},h("form",{onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("verdocs-text-input",{id:"verdocs-recipient-name",label:"Role Name",value:this.name,autocomplete:"off",disabled:t,helpText:t?"This role has fields assigned and can no longer be renamed.":"A unique name to identify the role in the workflow. Submitted data will also be tagged with this value.",placeholder:"Template Name...",onInput:function(t){e.name=t.target.value;e.dirty=true}}),h("div",{class:"row"},h("div",{class:"input-label"},"Type:"),h("verdocs-select-input",{value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:function(t){e.type=t.target.value;e.dirty=true}}),h("verdocs-help-icon",{text:"Most participants are Signers. CC roles are notified when documents are signed, but have no other actions. Approvers get notified when signing is completed to perform a final review."})),h("verdocs-text-input",{id:"verdocs-recipient-email",label:"Full Name",value:this.fullName,autocomplete:"off",helpText:"The recipient's full name, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Full Name...",onInput:function(t){e.fullName=t.target.value;e.dirty=true}}),h("verdocs-text-input",{id:"verdocs-recipient-email",label:"Email",value:this.email,autocomplete:"off",helpText:"The recipient's email address, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Email Address...",onInput:function(t){e.email=t.target.value;e.dirty=true}}),h("verdocs-text-input",{id:"verdocs-recipient-phone",label:"Phone",value:this.phone,autocomplete:"off",helpText:"The recipient's phone number, if it will always stay the same. Leave blank to supply this value later, when each new envelope is created from the template.",placeholder:"Phone Number...",onInput:function(t){e.phone=t.target.value;e.dirty=true}}),h("div",{class:"row"},h("div",{class:"input-label"},"May Delegate:"),h("div",{class:"checkbox-wrapper"},h("verdocs-checkbox",{checked:this.allowDelegation,onInput:function(t){e.allowDelegation=t.target.checked;e.dirty=true}})),h("verdocs-help-icon",{text:"If enabled, this recipient may delegate their actions to another individual."})),h("div",{class:"buttons"},h("button",{class:"delete-button",disabled:this.dirty,onClick:function(t){return e.handleDelete(t)},innerHTML:TrashIcon}),h("div",{style:{flex:"1"}}),h("verdocs-button",{size:"small",variant:"outline",label:"Cancel",disabled:!this.dirty,onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{size:"small",label:"Save",disabled:!this.dirty,onClick:function(t){return e.handleSave(t)}}))))))};return e}();VerdocsTemplateRoleProperties.style=verdocsTemplateRolePropertiesCss;var verdocsTemplateSenderCss='verdocs-template-sender{font-family:"Inter", "Barlow", sans-serif;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-sender .background-overlay{position:absolute;z-index:10000;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background:#0000007f}verdocs-template-sender .dialog{width:340px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border-radius:4px;overflow:hidden;background:#ffffff;padding:16px;-webkit-box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4);box-shadow:3px 3px 5px 1px rgba(40, 40, 40, 0.4)}verdocs-template-sender .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .buttons{display:-ms-flexbox;display:flex;margin-top:10px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-template-sender .buttons verdocs-button{margin-left:16px}verdocs-template-sender .options{row-gap:10px}verdocs-template-sender .options .option{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-sender .options .option .description{margin-left:10px}verdocs-template-sender .options .option .description .name{display:inline-block;vertical-align:top;margin-top:4px;margin-right:4px}';var VerdocsTemplateSender=function(){function e(e){registerInstance(this,e);this.close=createEvent(this,"close",7);this.sdkError=createEvent(this,"sdkError",7);this.store=null;this.endpoint=VerdocsEndpoint.getDefault();this.templateId="";this.sender=TemplateSenderTypes.EVERYONE;this.saving=false}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,o,i,n,r,s;return __generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,2,,3]);this.endpoint.loadSession();if(!this.templateId){console.log("[SENDER] Missing required template ID ".concat(this.templateId));return[2]}if(!this.endpoint.session){console.log("[SENDER] Unable to start builder session, must be authenticated");return[2]}r=this;return[4,getTemplateStore(this.endpoint,this.templateId,false)];case 1:r.store=a.sent();this.sender=(t=(e=this.store)===null||e===void 0?void 0:e.state)===null||t===void 0?void 0:t.sender;return[3,3];case 2:s=a.sent();console.log("[SENDER] Error with preview session",s);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new SDKError(s.message,(i=s.response)===null||i===void 0?void 0:i.status,(n=s.response)===null||n===void 0?void 0:n.data));return[3,3];case 3:return[2]}}))}))};e.prototype.handleClose=function(){this.close.emit()};e.prototype.handleDismiss=function(e){if(e.target.className==="background-overlay"){e.preventDefault();this.handleClose()}};e.prototype.handleSelectSetting=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(o){this.saving=true;updateTemplate(this.endpoint,this.templateId,{sender:e}).then((function(o){var i;console.log("Update result",o);if((i=t.store)===null||i===void 0?void 0:i.state){t.store.state.sender=e}t.saving=false;t.sender=e})).catch((function(e){console.log("Error saving",e);t.saving=false}));return[2]}))}))};e.prototype.render=function(){var e=this;return h(Host,null,h("div",{class:"background-overlay",onClick:function(t){return e.handleDismiss(t)}},h("div",{class:"dialog"},h("div",{class:"options"},h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.EVERYONE,checked:this.sender===TemplateSenderTypes.EVERYONE,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.EVERYONE)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone on the Web"),h("verdocs-help-icon",{text:"Anyone can use this template. (Make its visibility is set to to 'Public' or 'Shared'.)"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.EVERYONE_AS_CREATOR,checked:this.sender===TemplateSenderTypes.EVERYONE_AS_CREATOR,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.EVERYONE_AS_CREATOR)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone on the Web as me"),h("verdocs-help-icon",{text:"Anyone can use this template on my behalf. (Make sure its visibility is set to 'Public' or 'Shared'.)"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.ORGANIZATION_MEMBER,checked:this.sender===TemplateSenderTypes.ORGANIZATION_MEMBER,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.ORGANIZATION_MEMBER)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone in my organization"),h("verdocs-help-icon",{text:"Anyone in my organization can use this template. (Make sure its visibility is set to 'Shared')"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR,checked:this.sender===TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.ORGANIZATION_MEMBER_AS_CREATOR)}}),h("div",{class:"description"},h("div",{class:"name"},"Anyone in my organization as me"),h("verdocs-help-icon",{text:"Anyone in my organization can use this template on my behalf. (Make sure its visibility is set to to 'Shared'.)"}))),h("div",{class:"option"},h("verdocs-radio-button",{name:"template-sender",value:TemplateSenderTypes.CREATOR,checked:this.sender===TemplateSenderTypes.CREATOR,onInput:function(){return e.handleSelectSetting(TemplateSenderTypes.CREATOR)}}),h("div",{class:"description"},h("div",{class:"name"},"Me"),h("verdocs-help-icon",{text:"Only I can use this template."})))),h("div",{class:"buttons"},h("verdocs-button",{label:"Close",onClick:function(){return e.handleClose()}})))))};return e}();VerdocsTemplateSender.style=verdocsTemplateSenderCss;export{VerdocsRadioButton as verdocs_radio_button,VerdocsTemplateRoleProperties as verdocs_template_role_properties,VerdocsTemplateSender as verdocs_template_sender};
|