@verdocs/web-sdk 6.9.13 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/verdocs-adopt-signature-dialog_7.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-auth.cjs.entry.js +0 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js +422 -115
- package/dist/cjs/verdocs-contact-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js +6 -6
- package/dist/cjs/verdocs-download-dialog_4.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +6 -6
- package/dist/cjs/verdocs-field-attachment_11.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-initial-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-menu-panel_2.cjs.entry.js +7 -7
- package/dist/cjs/verdocs-ok-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js +0 -1
- package/dist/cjs/verdocs-preview_6.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search-tabs.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +75 -20
- package/dist/cjs/verdocs-sign.cjs.entry.js.map +1 -1
- package/dist/cjs/verdocs-signature-dialog.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-status-indicator.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-template-card.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-tags.cjs.entry.js +1 -1
- package/dist/collection/components/dialogs/verdocs-download-dialog/verdocs-download-dialog.js +3 -3
- package/dist/collection/components/dialogs/verdocs-download-dialog/verdocs-download-dialog.js.map +1 -1
- package/dist/collection/components/dialogs/verdocs-initial-dialog/verdocs-initial-dialog.js +1 -1
- package/dist/collection/components/dialogs/verdocs-ok-dialog/verdocs-ok-dialog.js +1 -1
- package/dist/collection/components/dialogs/verdocs-otp-dialog/verdocs-otp-dialog.js +1 -1
- package/dist/collection/components/dialogs/verdocs-passcode-dialog/verdocs-passcode-dialog.js +1 -1
- package/dist/collection/components/dialogs/verdocs-question-dialog/verdocs-question-dialog.js +1 -1
- package/dist/collection/components/dialogs/verdocs-signature-dialog/verdocs-signature-dialog.js +1 -1
- package/dist/collection/components/dialogs/verdocs-upload-dialog/verdocs-upload-dialog.js +1 -1
- package/dist/collection/components/elements/verdocs-quick-functions/verdocs-quick-functions.js +1 -1
- package/dist/collection/components/elements/verdocs-search-tabs/verdocs-search-tabs.js +1 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +0 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +0 -1
- package/dist/collection/components/embeds/verdocs-send/verdocs-send.js.map +1 -1
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +75 -20
- package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js.map +1 -1
- package/dist/collection/components/envelopes/verdocs-envelope-document-page/verdocs-envelope-document-page.js +1 -1
- package/dist/collection/components/envelopes/verdocs-envelopes-list/verdocs-envelopes-list.js +6 -6
- package/dist/collection/components/envelopes/verdocs-sign-footer/verdocs-sign-footer.js +1 -1
- package/dist/collection/components/envelopes/verdocs-status-indicator/verdocs-status-indicator.js +2 -2
- package/dist/collection/components/templates/verdocs-template-card/verdocs-template-card.js +1 -1
- package/dist/collection/components/templates/verdocs-template-role-properties/verdocs-template-role-properties.js +7 -7
- package/dist/collection/components/templates/verdocs-template-star/verdocs-template-star.js +1 -1
- package/dist/collection/components/templates/verdocs-template-tags/verdocs-template-tags.js +1 -1
- package/dist/components/{p-DSK9z7EN.js → p-BT8wzCXz.js} +2 -2
- package/dist/components/{p-CGt7KiUu.js → p-BvtSJusb.js} +2 -2
- package/dist/components/{p-BIc5CIpg.js → p-BxOEoXie.js} +2 -2
- package/dist/components/{p-DClinO5r.js → p-C-V6jrel.js} +2 -2
- package/dist/components/{p-Bkae9I4G.js → p-CBKrl6B7.js} +2 -2
- package/dist/components/{p-qDQgyl7L.js → p-CDMCVJys.js} +2 -2
- package/dist/components/{p-sPseFic3.js → p-CFEw4Xbi.js} +2 -2
- package/dist/components/p-CPYFXW2q.js +3 -0
- package/dist/components/p-CPYFXW2q.js.map +1 -0
- package/dist/components/{p-DGws2Zgt.js → p-CnoHN1S8.js} +2 -2
- package/dist/components/{p-DGws2Zgt.js.map → p-CnoHN1S8.js.map} +1 -1
- package/dist/components/{p-BwUTiBud.js → p-D3qUITiS.js} +2 -2
- package/dist/components/{p-DyhyfLyV.js → p-DIOVejyL.js} +2 -2
- package/dist/components/{p-DRgoGiAA.js → p-DVGumEtx.js} +2 -2
- package/dist/components/{p-C8r3qDBh.js → p-DfaM_cug.js} +2 -2
- package/dist/components/p-DfaM_cug.js.map +1 -0
- package/dist/components/{p-BcQsqsDy.js → p-DjOTs59Z.js} +2 -2
- package/dist/components/{p-CSIVZcVx.js → p-Dmw-lE3L.js} +2 -2
- package/dist/components/{p-CGWVITS0.js → p-DsEO0-XR.js} +2 -2
- package/dist/components/{p-BfKv6ivN.js → p-Dtndevf4.js} +2 -2
- package/dist/components/{p-db6IAGB0.js → p-Yxa93LOl.js} +2 -2
- package/dist/components/{p-DXbBz25U.js → p-tub_01MP.js} +2 -2
- package/dist/components/{p-CQUV5gMT.js → p-u16vefxk.js} +2 -2
- package/dist/components/verdocs-auth.js.map +1 -1
- package/dist/components/verdocs-build.js +1 -1
- package/dist/components/verdocs-contact-picker.js +1 -1
- package/dist/components/verdocs-download-dialog.js +1 -1
- package/dist/components/verdocs-envelope-document-page.js +1 -1
- package/dist/components/verdocs-envelope-sidebar.js +1 -1
- package/dist/components/verdocs-envelopes-list.js +1 -1
- package/dist/components/verdocs-field-attachment.js +1 -1
- package/dist/components/verdocs-initial-dialog.js +1 -1
- package/dist/components/verdocs-ok-dialog.js +1 -1
- package/dist/components/verdocs-otp-dialog.js +1 -1
- package/dist/components/verdocs-passcode-dialog.js +1 -1
- package/dist/components/verdocs-preview.js +1 -1
- package/dist/components/verdocs-question-dialog.js +1 -1
- package/dist/components/verdocs-quick-functions.js +1 -1
- package/dist/components/verdocs-search-tabs.js +1 -1
- package/dist/components/verdocs-send.js +1 -1
- package/dist/components/verdocs-sign-footer.js +1 -1
- package/dist/components/verdocs-sign.js +1 -1
- package/dist/components/verdocs-sign.js.map +1 -1
- package/dist/components/verdocs-signature-dialog.js +1 -1
- package/dist/components/verdocs-status-indicator.js +1 -1
- package/dist/components/verdocs-template-attachments.js +1 -1
- package/dist/components/verdocs-template-card.js +1 -1
- package/dist/components/verdocs-template-document-page.js +1 -1
- package/dist/components/verdocs-template-fields.js +1 -1
- package/dist/components/verdocs-template-role-properties.js +1 -1
- package/dist/components/verdocs-template-roles.js +1 -1
- package/dist/components/verdocs-template-star.js +1 -1
- package/dist/components/verdocs-template-tags.js +1 -1
- package/dist/components/verdocs-templates-list.js +1 -1
- package/dist/components/verdocs-upload-dialog.js +1 -1
- package/dist/components/verdocs-view.js +1 -1
- package/dist/esm/verdocs-adopt-signature-dialog_7.entry.js +2 -2
- package/dist/esm/verdocs-auth.entry.js +0 -1
- package/dist/esm/verdocs-auth.entry.js.map +1 -1
- package/dist/esm/verdocs-contact-picker.entry.js +422 -115
- package/dist/esm/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm/verdocs-download-dialog_4.entry.js +6 -6
- package/dist/esm/verdocs-download-dialog_4.entry.js.map +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +6 -6
- package/dist/esm/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm/verdocs-initial-dialog.entry.js +1 -1
- package/dist/esm/verdocs-menu-panel_2.entry.js +7 -7
- package/dist/esm/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm/verdocs-preview_6.entry.js +0 -1
- package/dist/esm/verdocs-preview_6.entry.js.map +1 -1
- package/dist/esm/verdocs-quick-functions.entry.js +1 -1
- package/dist/esm/verdocs-search-tabs.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +76 -21
- package/dist/esm/verdocs-sign.entry.js.map +1 -1
- package/dist/esm/verdocs-signature-dialog.entry.js +1 -1
- package/dist/esm/verdocs-status-indicator.entry.js +2 -2
- package/dist/esm/verdocs-template-card.entry.js +1 -1
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-template-tags.entry.js +1 -1
- package/dist/esm-es5/verdocs-adopt-signature-dialog_7.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-contact-picker.entry.js +2 -2
- package/dist/esm-es5/verdocs-contact-picker.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-download-dialog_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-download-dialog_4.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_11.entry.js +1 -1
- package/dist/esm-es5/verdocs-initial-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-menu-panel_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-ok-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_6.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
- package/dist/esm-es5/verdocs-search-tabs.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js.map +1 -1
- package/dist/esm-es5/verdocs-signature-dialog.entry.js +1 -1
- package/dist/esm-es5/verdocs-status-indicator.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-card.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-tags.entry.js +1 -1
- package/dist/types/components/embeds/verdocs-sign/verdocs-sign.d.ts +5 -0
- package/dist/verdocs-web-sdk/{p-b1146326.system.entry.js → p-04d2fa80.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-11c3e5bb.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-11c3e5bb.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-15a1b8b5.system.entry.js → p-16d655d4.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-16d655d4.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-b6390a11.system.entry.js → p-1827477d.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b2aa0637.system.entry.js → p-1929a794.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-1ce27c81.system.entry.js +4 -0
- package/dist/verdocs-web-sdk/p-1ce27c81.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-82d0e009.entry.js → p-1f1fc6d7.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-2d72560a.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-2d72560a.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-0625e073.system.entry.js → p-2f96e7c9.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-33cfc977.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-33cfc977.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-07a07c6b.system.entry.js → p-40f5ecf3.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-cbfc895c.entry.js → p-421c231a.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ed5c3f2d.entry.js → p-43ee0267.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-43ee0267.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-36aa8081.system.entry.js → p-4798c2a5.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-bd17bff7.system.entry.js → p-495ed75e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-4e84a5b6.entry.js +3 -0
- package/dist/verdocs-web-sdk/p-4e84a5b6.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/p-62b6402f.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-4d8bf603.system.entry.js → p-6754dfcf.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-682c5a5c.entry.js +2 -0
- package/dist/verdocs-web-sdk/{p-5678acd8.entry.js → p-810e09ca.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-e207c469.entry.js → p-842c345c.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-BdZ5Ghsa.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-3c9a2290.system.entry.js → p-c5b70927.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-c3660cce.system.entry.js → p-ca03555a.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-609527c7.entry.js → p-cfb275c5.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-4934f908.entry.js → p-d09a4bb9.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ae92881f.entry.js → p-d0e8419b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-d0e8419b.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-e991121e.system.entry.js → p-d3b798ae.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-ba39a8ce.system.entry.js → p-d3d177d0.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-98adcb3a.entry.js → p-d4f72da9.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-b35a1ea8.system.entry.js → p-d60cfa3e.system.entry.js} +2 -2
- package/dist/verdocs-web-sdk/p-e608d2bc.system.entry.js +2 -0
- package/dist/verdocs-web-sdk/p-e608d2bc.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-c2b70cb9.entry.js → p-e632e92c.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-1f898c53.entry.js → p-e95723ac.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-996cc1f6.entry.js → p-ed953cca.entry.js} +2 -2
- package/dist/verdocs-web-sdk/{p-d5cfbdac.system.entry.js → p-edab1fed.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-edab1fed.system.entry.js.map +1 -0
- package/dist/verdocs-web-sdk/{p-fff5d042.entry.js → p-f97ca49e.entry.js} +2 -2
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/components/p-C8r3qDBh.js.map +0 -1
- package/dist/components/p-DeQsR41s.js +0 -3
- package/dist/components/p-DeQsR41s.js.map +0 -1
- package/dist/verdocs-web-sdk/p-15a1b8b5.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-2fa4010a.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-2fa4010a.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-3a542ed0.system.entry.js +0 -4
- package/dist/verdocs-web-sdk/p-3a542ed0.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-48e2baa9.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-48e2baa9.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-4fe507ee.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-90400330.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-ae4290c6.entry.js +0 -3
- package/dist/verdocs-web-sdk/p-ae4290c6.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-ae92881f.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-b81c87ee.system.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-b81c87ee.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-d5cfbdac.system.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-e679a32a.entry.js +0 -2
- package/dist/verdocs-web-sdk/p-e679a32a.entry.js.map +0 -1
- package/dist/verdocs-web-sdk/p-ed5c3f2d.entry.js.map +0 -1
- /package/dist/components/{p-DSK9z7EN.js.map → p-BT8wzCXz.js.map} +0 -0
- /package/dist/components/{p-CGt7KiUu.js.map → p-BvtSJusb.js.map} +0 -0
- /package/dist/components/{p-BIc5CIpg.js.map → p-BxOEoXie.js.map} +0 -0
- /package/dist/components/{p-DClinO5r.js.map → p-C-V6jrel.js.map} +0 -0
- /package/dist/components/{p-Bkae9I4G.js.map → p-CBKrl6B7.js.map} +0 -0
- /package/dist/components/{p-qDQgyl7L.js.map → p-CDMCVJys.js.map} +0 -0
- /package/dist/components/{p-sPseFic3.js.map → p-CFEw4Xbi.js.map} +0 -0
- /package/dist/components/{p-BwUTiBud.js.map → p-D3qUITiS.js.map} +0 -0
- /package/dist/components/{p-DyhyfLyV.js.map → p-DIOVejyL.js.map} +0 -0
- /package/dist/components/{p-DRgoGiAA.js.map → p-DVGumEtx.js.map} +0 -0
- /package/dist/components/{p-BcQsqsDy.js.map → p-DjOTs59Z.js.map} +0 -0
- /package/dist/components/{p-CSIVZcVx.js.map → p-Dmw-lE3L.js.map} +0 -0
- /package/dist/components/{p-CGWVITS0.js.map → p-DsEO0-XR.js.map} +0 -0
- /package/dist/components/{p-BfKv6ivN.js.map → p-Dtndevf4.js.map} +0 -0
- /package/dist/components/{p-db6IAGB0.js.map → p-Yxa93LOl.js.map} +0 -0
- /package/dist/components/{p-DXbBz25U.js.map → p-tub_01MP.js.map} +0 -0
- /package/dist/components/{p-CQUV5gMT.js.map → p-u16vefxk.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-b1146326.system.entry.js.map → p-04d2fa80.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-b6390a11.system.entry.js.map → p-1827477d.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-b2aa0637.system.entry.js.map → p-1929a794.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-82d0e009.entry.js.map → p-1f1fc6d7.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-0625e073.system.entry.js.map → p-2f96e7c9.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-07a07c6b.system.entry.js.map → p-40f5ecf3.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-cbfc895c.entry.js.map → p-421c231a.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-36aa8081.system.entry.js.map → p-4798c2a5.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-bd17bff7.system.entry.js.map → p-495ed75e.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4fe507ee.entry.js.map → p-62b6402f.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4d8bf603.system.entry.js.map → p-6754dfcf.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-90400330.entry.js.map → p-682c5a5c.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-5678acd8.entry.js.map → p-810e09ca.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e207c469.entry.js.map → p-842c345c.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-3c9a2290.system.entry.js.map → p-c5b70927.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-c3660cce.system.entry.js.map → p-ca03555a.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-609527c7.entry.js.map → p-cfb275c5.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-4934f908.entry.js.map → p-d09a4bb9.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-e991121e.system.entry.js.map → p-d3b798ae.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-ba39a8ce.system.entry.js.map → p-d3d177d0.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-98adcb3a.entry.js.map → p-d4f72da9.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-b35a1ea8.system.entry.js.map → p-d60cfa3e.system.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-c2b70cb9.entry.js.map → p-e632e92c.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-1f898c53.entry.js.map → p-e95723ac.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-996cc1f6.entry.js.map → p-ed953cca.entry.js.map} +0 -0
- /package/dist/verdocs-web-sdk/{p-fff5d042.entry.js.map → p-f97ca49e.entry.js.map} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as s,h as i,d as o,t as a}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as l,getTemplate as r,updateTemplateRole as d,deleteTemplateRole as c,isValidEmail as n}from"@verdocs/js-sdk";import{S as p}from"./p-C1sRVZWv.js";import{S as f}from"./p-C7hFgM52.js";import{d as h}from"./p-Bdf8pPWm.js";import{d as m}from"./p-CioaaWeS.js";import{d as b}from"./p-BXGNkmyr.js";import{d as u}from"./p-DYtSnUj9.js";const v=()=>`verdocs-template-role-properties{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", "Barlow", sans-serif}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}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:justify;justify-content:space-between}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form{gap:15px;padding:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-role-properties form .instructions{margin:7px 0 0 0;font-size:12px;font-style:italic}verdocs-template-role-properties form .input-label{display:block;font-size:14px;-ms-flex:0 0 100px;flex:0 0 100px;font-weight:700;margin:0 0 4px 0;color:#555570}verdocs-template-role-properties form .first-last{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form verdocs-help-icon{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-role-properties verdocs-select-input label{display:block}verdocs-template-role-properties verdocs-text-input{margin:0}verdocs-template-role-properties verdocs-text-input label{display:block}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}`;const x=`<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>`;const y=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.close=s(this,"close");this.delete=s(this,"delete");this.sdkError=s(this,"sdkError");this.templateListenerId=null;this.endpoint=l.getDefault();this.templateId="";this.roleName="";this.dirty=false;this.saving=false;this.name="";this.type="signer";this.first_name="";this.last_name="";this.email="";this.phone="";this.delegator=false;this.loading=true;this.template=null}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[ROLES] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(i){console.log("[ROLES Error with preview session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new p(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(s=i.response)===null||s===void 0?void 0:s.data))}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){console.log("[ROLES] Loading tempate",this.templateId);this.unlistenToTemplate();f.subscribe("templates",this.templateId,(()=>r(this.endpoint,this.templateId)),false,(e=>{var t;console.log("[BUILD] Template Updated",e);this.template=e;this.loading=false;const s=(t=this.template)===null||t===void 0?void 0:t.roles.find((e=>e.name===this.roleName));if(s){this.name=s.name;this.type=s.type;this.first_name=s.first_name;this.last_name=s.last_name;this.email=s.email;this.phone=s.phone;this.delegator=s.delegator;console.log("[ROLES] Editing role",s)}}))}unlistenToTemplate(){if(this.templateListenerId){f.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(e){var t,s;e.stopPropagation();const i=(t=this.template)===null||t===void 0?void 0:t.roles.find((e=>e.name===this.roleName));if(i){this.name=i.name;this.type=i.type;this.first_name=i.first_name;this.last_name=i.last_name;this.email=i.email;this.phone=i.phone;this.delegator=i.delegator}this.dirty=false;(s=this.close)===null||s===void 0?void 0:s.emit()}async handleSave(e){e.stopPropagation();this.saving=true;d(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((async e=>{var t;console.log("[ROLES] Update result",e);this.saving=false;this.dirty=false;const s=JSON.parse(JSON.stringify(this.template));const i=s.roles.findIndex((e=>e.name===this.roleName));if(i>-1){s.roles[i]=e}f.updateTemplate(this.templateId,s);(t=this.close)===null||t===void 0?void 0:t.emit()})).catch((e=>{console.log("[ROLES Update error",e);this.saving=false}))}async handleDelete(e){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.")){c(this.endpoint,this.templateId,this.roleName).then((()=>{var e,t;const s=JSON.parse(JSON.stringify(this.template));s.roles=s.roles.filter((e=>e.name!==this.roleName));f.getTemplate(this.endpoint,this.templateId,true);(e=this.delete)===null||e===void 0?void 0:e.emit({templateId:this.templateId,roleName:this.roleName});(t=this.close)===null||t===void 0?void 0:t.emit()})).catch((e=>{console.log("[ROLES Deletion error",e)}))}}render(){var e;const t=(((e=this.template)===null||e===void 0?void 0:e.fields)||[]).some((e=>e.role_name===this.roleName));const s=!this.email&&!this.first_name&&!this.last_name||n(this.email)&&!!this.first_name&&!!this.last_name;return i(o,{key:"14d2d9bb4253201a9cb659c6637960194dc7d134"},i("form",{key:"09d0a10f48c8f4ca3f6b679d09c3c71ea0c0cdb9",onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("div",{key:"b65e74e82bb7689d706ba0e56521d04fe01ae057"},i("verdocs-text-input",{key:"c7e3da4d57b096f71a4c5e49948ee0a4e0594e0c",id:"verdocs-role-name",label:"Role Name (Must be unique)",value:this.name,autocomplete:"off",disabled:t,placeholder:"Role Name...",onInput:e=>{this.name=e.target.value;this.dirty=true}}),t&&i("div",{key:"9a80102f0a04118069c2865c9295e5da3914b381",class:"instructions"},"This role has fields assigned and can no longer be renamed.")),i("div",{key:"93ca24cfbc2b1f8e729c30a0726b14091695ba92"},i("div",{key:"0b5eeeab4aad7e1659581eb8c17e14012d79b5e6",class:"input-label"},"Type:"),i("verdocs-select-input",{key:"883b1456bad033a17023559a210f61efc17cb1ab",value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value;this.dirty=true}})),i("div",{key:"fec29a6add9ab2a60e4deb29ee77c851973e0517"},i("div",{key:"a18a7d1edfb673e382d76d04d833f3daf28ca26f",class:"input-label"},"Default Contact Info:"),i("div",{key:"1206cab495d52ab12428dbc346126df3a2aa9c1a",class:"first-last"},i("verdocs-text-input",{key:"aa4433e84dee223043c49235c8e9feb7569707e9",id:"verdocs-recipient-first",value:this.first_name,autocomplete:"off",placeholder:"First...",onInput:e=>{this.first_name=e.target.value;this.dirty=true}}),i("verdocs-text-input",{key:"b8c1069666a4674faff0c1b72bc988cf3ed3ca9b",id:"verdocs-recipient-first",value:this.last_name,autocomplete:"off",placeholder:"Last...",onInput:e=>{this.last_name=e.target.value;this.dirty=true}}))),i("div",{key:"5ea9ada6f0dac2a52b78946275603e2c99887666"},i("verdocs-text-input",{key:"767135ec9d13ae00e6c1d259a6d53fbf85caeedd",id:"verdocs-recipient-email",value:this.email,autocomplete:"off",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value;this.dirty=true}}),i("div",{key:"0c4ffc5553a054ae331bcbf48a7b702d0fd5a81e",style:{height:"15px"}}),i("div",{key:"17815735c29adc551f65a7f29d1a791c9260edfc"},i("verdocs-text-input",{key:"0d41ae8e9cda72d881791df7d63f89f25d08da5e",id:"verdocs-recipient-phone",value:this.phone,autocomplete:"off",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value;this.dirty=true}}))),i("div",{key:"be29c3c856e62cab357391146485230461e6c5c9",class:"buttons"},i("button",{key:"a714765b9f8f524a0c6573653b6ba6a59661b4d2",class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:x}),i("div",{key:"aae4bf7f4fa5fc685ace057a2312461a7cf993f3",style:{flex:"1"}}),i("verdocs-button",{key:"027aa0723fc32b4713e7a9cb33e6a1b7d4b5ab18",size:"small",label:"Save",disabled:!this.dirty||!s,onClick:e=>this.handleSave(e)}))))}static get style(){return v()}},[0,"verdocs-template-role-properties",{endpoint:[16],templateId:[1,"template-id"],roleName:[1,"role-name"],dirty:[32],saving:[32],name:[32],type:[32],first_name:[32],last_name:[32],email:[32],phone:[32],delegator:[32],loading:[32],template:[32]}]);function k(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-role-properties","verdocs-button","verdocs-help-icon","verdocs-select-input","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-template-role-properties":if(!customElements.get(a(e))){customElements.define(a(e),y)}break;case"verdocs-button":if(!customElements.get(a(e))){h()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){m()}break;case"verdocs-select-input":if(!customElements.get(a(e))){b()}break;case"verdocs-text-input":if(!customElements.get(a(e))){u()}break}}))}export{y as V,k as d};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as t,c as s,h as i,d as o,t as l}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as r,getTemplate as a,updateTemplateRole as d,deleteTemplateRole as n,isValidEmail as c}from"@verdocs/js-sdk";import{S as p}from"./p-C1sRVZWv.js";import{S as f}from"./p-C7hFgM52.js";import{d as h}from"./p-Bdf8pPWm.js";import{d as m}from"./p-CioaaWeS.js";import{d as b}from"./p-BXGNkmyr.js";import{d as u}from"./p-DYtSnUj9.js";const v=()=>`verdocs-template-role-properties{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", "Barlow", sans-serif}verdocs-template-role-properties div{-webkit-box-sizing:border-box;box-sizing:border-box}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:justify;justify-content:space-between}verdocs-template-role-properties .buttons verdocs-button{margin-left:16px}verdocs-template-role-properties form{gap:15px;padding:20px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-template-role-properties form .instructions{margin:7px 0 0 0;font-size:12px;font-style:italic}verdocs-template-role-properties form .input-label{display:block;font-size:14px;-ms-flex:0 0 100px;flex:0 0 100px;font-weight:700;margin:0 0 4px 0;color:#555570}verdocs-template-role-properties form .first-last{gap:15px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}verdocs-template-role-properties form verdocs-help-icon{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-role-properties verdocs-select-input label{display:block}verdocs-template-role-properties verdocs-text-input{margin:0}verdocs-template-role-properties verdocs-text-input label{display:block}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}`;const x=`<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>`;const y=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.close=s(this,"close");this.delete=s(this,"delete");this.sdkError=s(this,"sdkError");this.templateListenerId=null;this.endpoint=r.getDefault();this.templateId="";this.roleName="";this.dirty=false;this.saving=false;this.name="";this.type="signer";this.first_name="";this.last_name="";this.email="";this.phone="";this.delegator=false;this.loading=true;this.template=null}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[ROLES] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[ROLES] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(i){console.log("[ROLES Error with preview session",i);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new p(i.message,(t=i.response)===null||t===void 0?void 0:t.status,(s=i.response)===null||s===void 0?void 0:s.data))}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){console.log("[ROLES] Loading tempate",this.templateId);this.unlistenToTemplate();f.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{var t;console.log("[BUILD] Template Updated",e);this.template=e;this.loading=false;const s=(t=this.template)===null||t===void 0?void 0:t.roles.find((e=>e.name===this.roleName));if(s){this.name=s.name;this.type=s.type;this.first_name=s.first_name;this.last_name=s.last_name;this.email=s.email;this.phone=s.phone;this.delegator=s.delegator;console.log("[ROLES] Editing role",s)}}))}unlistenToTemplate(){if(this.templateListenerId){f.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(e){var t,s;e.stopPropagation();const i=(t=this.template)===null||t===void 0?void 0:t.roles.find((e=>e.name===this.roleName));if(i){this.name=i.name;this.type=i.type;this.first_name=i.first_name;this.last_name=i.last_name;this.email=i.email;this.phone=i.phone;this.delegator=i.delegator}this.dirty=false;(s=this.close)===null||s===void 0?void 0:s.emit()}async handleSave(e){e.stopPropagation();this.saving=true;d(this.endpoint,this.templateId,this.roleName,{name:this.name,type:this.type,first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,delegator:this.delegator}).then((async e=>{var t;console.log("[ROLES] Update result",e);this.saving=false;this.dirty=false;const s=JSON.parse(JSON.stringify(this.template));const i=s.roles.findIndex((e=>e.name===this.roleName));if(i>-1){s.roles[i]=e}f.updateTemplate(this.templateId,s);(t=this.close)===null||t===void 0?void 0:t.emit()})).catch((e=>{console.log("[ROLES Update error",e);this.saving=false}))}async handleDelete(e){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.")){n(this.endpoint,this.templateId,this.roleName).then((()=>{var e,t;const s=JSON.parse(JSON.stringify(this.template));s.roles=s.roles.filter((e=>e.name!==this.roleName));f.getTemplate(this.endpoint,this.templateId,true);(e=this.delete)===null||e===void 0?void 0:e.emit({templateId:this.templateId,roleName:this.roleName});(t=this.close)===null||t===void 0?void 0:t.emit()})).catch((e=>{console.log("[ROLES Deletion error",e)}))}}render(){var e;const t=(((e=this.template)===null||e===void 0?void 0:e.fields)||[]).some((e=>e.role_name===this.roleName));const s=!this.email&&!this.first_name&&!this.last_name||c(this.email)&&!!this.first_name&&!!this.last_name;return i(o,{key:"ffbdcf7c23ed14bf001bf85dd969fee3e4018abf"},i("form",{key:"10ee145cbd8b2d1035cbafe86a88c5e4e93b211f",onSubmit:e=>e.preventDefault(),onClick:e=>e.stopPropagation(),autocomplete:"off"},i("div",{key:"476268ed74137b49dc4a22159e7df0991e9644a8"},i("verdocs-text-input",{key:"dfacfb292a4bc93422f1d28166a8853d30736a71",id:"verdocs-role-name",label:"Role Name (Must be unique)",value:this.name,autocomplete:"off",disabled:t,placeholder:"Role Name...",onInput:e=>{this.name=e.target.value;this.dirty=true}}),t&&i("div",{key:"bcc8c63bb93ce9b81dd9b8282db9b8cd28f764b6",class:"instructions"},"This role has fields assigned and can no longer be renamed.")),i("div",{key:"edd762e1f0b0c50bb9752da44195a8fd37ad46b8"},i("div",{key:"f7cbb564016a693ed8d59da0e3b06d3f2e3013a3",class:"input-label"},"Type:"),i("verdocs-select-input",{key:"eca486e7960b077234e5a8867f972511c4a429b6",value:this.type,options:[{label:"Signer",value:"signer"},{label:"CC",value:"cc"},{label:"Approver",value:"approver"}],onInput:e=>{this.type=e.target.value;this.dirty=true}})),i("div",{key:"d45d4354a061453e85e993be8e6b57da104c0ad5"},i("div",{key:"7b1afb527741ca786eb546bec5071078d1504433",class:"input-label"},"Default Contact Info:"),i("div",{key:"6de4c8b89c7b11ea5f8ae89ff69212472375e4ac",class:"first-last"},i("verdocs-text-input",{key:"8a591cc37cf7d9c2e5a211640a36a876a794590f",id:"verdocs-recipient-first",value:this.first_name,autocomplete:"off",placeholder:"First...",onInput:e=>{this.first_name=e.target.value;this.dirty=true}}),i("verdocs-text-input",{key:"de8ee6a8802ff5443f93d1a017609bbabb745f13",id:"verdocs-recipient-first",value:this.last_name,autocomplete:"off",placeholder:"Last...",onInput:e=>{this.last_name=e.target.value;this.dirty=true}}))),i("div",{key:"1a7ac3d8fab0e28d031d4bafe892fadc1ab76ac4"},i("verdocs-text-input",{key:"e11e543134ad024362e4f39f026c132e90c4ad9a",id:"verdocs-recipient-email",value:this.email,autocomplete:"off",placeholder:"Email Address...",onInput:e=>{this.email=e.target.value;this.dirty=true}}),i("div",{key:"04a394d1e1f9d377da12ea565119a0d5cd68a627",style:{height:"15px"}}),i("div",{key:"1ff2ead2361795d3ec3e6361715d30e779fae4b8"},i("verdocs-text-input",{key:"3c0d4de18bb9fd6da3ba02d70a66dfcd2306af7f",id:"verdocs-recipient-phone",value:this.phone,autocomplete:"off",placeholder:"Phone Number...",onInput:e=>{this.phone=e.target.value;this.dirty=true}}))),i("div",{key:"a6c73356acbe10339d53f24a956205b914f386aa",class:"buttons"},i("button",{key:"034614017ee9e5b0acdafa1a2950c3cd44328517",class:"delete-button",disabled:this.dirty,onClick:e=>this.handleDelete(e),innerHTML:x}),i("div",{key:"5febc5c4fbbe44afbe1f6a1fe23586efdd5bf3df",style:{flex:"1"}}),i("verdocs-button",{key:"895635dd85f706e87bc14dde3224894f11af9029",size:"small",label:"Save",disabled:!this.dirty||!s,onClick:e=>this.handleSave(e)}))))}static get style(){return v()}},[0,"verdocs-template-role-properties",{endpoint:[16],templateId:[1,"template-id"],roleName:[1,"role-name"],dirty:[32],saving:[32],name:[32],type:[32],first_name:[32],last_name:[32],email:[32],phone:[32],delegator:[32],loading:[32],template:[32]}]);function k(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-role-properties","verdocs-button","verdocs-help-icon","verdocs-select-input","verdocs-text-input"];e.forEach((e=>{switch(e){case"verdocs-template-role-properties":if(!customElements.get(l(e))){customElements.define(l(e),y)}break;case"verdocs-button":if(!customElements.get(l(e))){h()}break;case"verdocs-help-icon":if(!customElements.get(l(e))){m()}break;case"verdocs-select-input":if(!customElements.get(l(e))){b()}break;case"verdocs-text-input":if(!customElements.get(l(e))){u()}break}}))}export{y as V,k as d};
|
|
2
|
+
//# sourceMappingURL=p-Dtndevf4.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as t,c as s,h as o,d as i,F as l,t as a}from"./p-yZBlG3YQ.js";import{i as d}from"./p-CGNX5HqF.js";import{VerdocsEndpoint as r,getTemplate as n,updateField as c,createField as p,integerSequence as m}from"@verdocs/js-sdk";import{g as h,h as v,i as f,j as g,d as u,k as w}from"./p-BCwFpXpV.js";import{D as x}from"./p-BDv5kBUR.js";import{V as b}from"./p-D97GxsI-.js";import{S as k}from"./p-C1sRVZWv.js";import{S as E}from"./p-C7hFgM52.js";import{d as q}from"./p-Bdf8pPWm.js";import{d as C}from"./p-REnrt0JM.js";import{d as Z}from"./p-CyDWJAOZ.js";import{d as V}from"./p-DT0LGcPi.js";import{d as M}from"./p-DSK9z7EN.js";import{d as y}from"./p-BasWFMeN.js";import{d as H}from"./p-DwPH0TQ4.js";import{d as j}from"./p-BwEGkh_6.js";import{d as S}from"./p-DXLcCG08.js";import{d as D}from"./p-B845hxhl.js";import{d as L}from"./p-5E7bNT3k.js";import{d as I}from"./p-Cfiprngx.js";import{d as Q}from"./p-pyA5cdVX.js";import{d as B}from"./p-DhO1wfh-.js";import{d as T}from"./p-wUsR0Dpa.js";import{d as F}from"./p-CioaaWeS.js";import{d as z}from"./p-B-_kYJtC.js";import{d as N}from"./p-BwUTiBud.js";import{d as P}from"./p-DQTI8vRX.js";import{d as R}from"./p-BXGNkmyr.js";import{d as U}from"./p-DRgoGiAA.js";import{d as W}from"./p-D3ohABOv.js";import{d as X}from"./p-DYtSnUj9.js";import{d as A}from"./p-Bxmki12o.js";import{d as Y}from"./p-CQUV5gMT.js";const $=()=>`verdocs-template-fields{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url("data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E") 16 16, pointer}`;const _='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';const G='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';const O='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>';const J='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>';const K='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';const ee='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>';const te='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>';const se='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';const oe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>';const ie=[{id:"signature",tooltip:"Signature",icon:K,class:"signature"},{id:"initial",tooltip:"Initials",icon:ee,class:"initial"},{id:"sep1",tooltip:"",icon:oe,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:_,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:G,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:O,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:te,class:"dropdown"},{id:"sep2",tooltip:"",icon:oe,class:"separator"},{id:"date",tooltip:"Date",icon:J,class:"date"},{id:"attachment",tooltip:"Attachment",icon:se,class:"attachment"}];const le=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=s(this,"sdkError");this.templateUpdated=s(this,"templateUpdated");this.templateListenerId=null;this.endpoint=r.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}onTemplateIdChanged(){this.listenToTemplate()}handleKeyDown(e){if(e.key==="Escape"){this.placing=null}}handleFieldSettingsChanged(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"updated-field"})}handleFieldDeleted(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"deleted-field"})}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[FIELDS] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(o){console.log("[FIELDS] Error with fields session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new k(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(s=o.response)===null||s===void 0?void 0:s.data))}}componentDidRender(){d.dynamicDrop(true);document.querySelectorAll(".verdocs-field").forEach((e=>{this.makeDraggable(e)}));const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;const t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){t.remove();e.append(t)}}componentWillUpdate(){var e,t;const s=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));if(!this.selectedRoleName||!s.find((e=>e&&e.name===this.selectedRoleName))){this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();E.subscribe("templates",this.templateId,(()=>n(this.endpoint,this.templateId)),false,(e=>{var t;console.log("Template updated");this.template=e;this.loading=false;if(!this.selectedRoleName){const s=[...e.roles||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||""}}))}unlistenToTemplate(){if(this.templateListenerId){E.store.delListener(this.templateListenerId);this.templateListenerId=null}}handlePageRendered(e){var t,s;var o,i;const l=e.detail;console.log("[FIELDS] Page rendered",l.documentId,l.pageNumber,l.xScale,l.yScale);(t=(o=this.cachedPageInfo)[i=l.documentId])!==null&&t!==void 0?t:o[i]={};this.cachedPageInfo[l.documentId][l.pageNumber]=l;this.pageHeights[l.pageNumber]=l.naturalHeight;(((s=this.template)===null||s===void 0?void 0:s.fields)||[]).filter((e=>e&&e.page===l.pageNumber)).forEach((e=>{const t=h(e);const s=document.getElementById(t);if(s){s.setAttribute("templateid",this.templateId);s.setAttribute("fieldname",e.name);s.setAttribute("documentid",String(e.document_id));s.setAttribute("pagenumber",String(e.page));s.setAttribute("xScale",String(l.xScale));s.setAttribute("yScale",String(l.yScale));this.makeDraggable(s)}}))}makeDraggable(e){d(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0);const s=+(e.target.getAttribute("posY")||0);const o=+(e.target.getAttribute("xScale")||1);const i=+(e.target.getAttribute("yScale")||1);const l=e.dx/o+t;const a=e.dy/i+s;e.target.setAttribute("posX",l);e.target.setAttribute("posy",a);v(e.target,"translate",`${l}px, ${a}px`)}async handleMoveEnd(e){var t,s,o,i,l,a,d,r;const n=e.target.getAttribute("fieldname");const p=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((e=>e.name===n));if(!p){console.log("[FIELDS] Unable to find field",n,e.target);return}const m=e.target.getAttribute("pagenumber");const h=e.target.getAttribute("documentid");let{naturalWidth:v=612,naturalHeight:x=792,renderedHeight:q=792}=this.cachedPageInfo[h][m];const C=e.target.getBoundingClientRect();const Z=e.target.parentElement;const V=Z.getBoundingClientRect();const M=p.width||w(p.type);const y=p.height||u(p.type);const H=Math.max(C.left-V.left,0);let j=Math.max(q-(V.bottom-C.bottom),0);let S=parseInt(m);if(j>q){S=Math.min(S+1,((i=(o=((s=this.template)===null||s===void 0?void 0:s.documents)||[])===null||o===void 0?void 0:o[0])===null||i===void 0?void 0:i.pages)||1);j-=q;q=this.cachedPageInfo[h][S].renderedHeight;console.log("Next page",{newPageNumber:S,newY:j,renderedHeight:q})}else if(j<0){S=Math.max(S-1,1);q=this.cachedPageInfo[h][S].renderedHeight;j+=q;console.log("[FIELDS] Next page",{newPageNumber:S,newY:j,renderedHeight:q})}const{x:D,y:L}=this.viewCoordinatesToPageCoordinates(H,j,h,m,v-M,x-y);try{const t={x:D,y:L,page:S};const s=await c(this.endpoint,this.templateId,n,t);console.log("[FIELDS] Updated",s);const o=JSON.parse(JSON.stringify(this.template));const i=o.fields.findIndex((e=>e.name===n));if(i>-1){o.fields[i]=s}E.updateTemplate(this.templateId,o);e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target);const{xScale:a=1,yScale:d=1}=this.cachedPageInfo[h][m];g(e.target,s,a,d);(l=this.templateUpdated)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,template:o,event:"updated-field"})}catch(t){b("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",t);(a=this.sdkError)===null||a===void 0?void 0:a.emit(new k(t.message,(d=t.response)===null||d===void 0?void 0:d.status,(r=t.response)===null||r===void 0?void 0:r.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target)}}generateFieldName(e,t){var s;let o=1;let i;do{i=`${e}P${t}-${o}`;o++}while((((s=this.template)===null||s===void 0?void 0:s.fields)||[]).some((e=>e&&e.name===i)));return i}viewCoordinatesToPageCoordinates(e,t,s,o,i,l){const{xScale:a=1,yScale:d=1,renderedHeight:r=792}=this.cachedPageInfo[s][o];const n=Math.floor(Math.min(e/a,i));const c=Math.floor(Math.min(Math.max(r-t,0)/d,l));return{x:n,y:c}}async handleClickPage(e,t,s){var o;if(this.placing){const i=e.offsetX;const l=e.offsetY;const a=w(this.placing);const d=u(this.placing);const r=this.cachedPageInfo[t][s];const{naturalWidth:n=612,naturalHeight:c=792}=r;const m=this.viewCoordinatesToPageCoordinates(i,l,t,s,n-a,c-d);const h=Math.floor(m.x);const v=Math.floor(m.y);const f={name:this.generateFieldName(this.placing,s),role_name:this.selectedRoleName,template_id:this.templateId,document_id:r.documentId,type:this.placing,required:this.placing!=="radio"&&this.placing!=="attachment"&&this.placing!=="checkbox",page:s,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:a,height:d,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};const g=await p(this.endpoint,this.templateId,f);console.log("[FIELDS] Created field",g);const x=JSON.parse(JSON.stringify(this.template));x.fields.push(g);E.updateTemplate(this.templateId,x);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:x,event:"added-field"});this.placing=null}}render(){var e,t,s;console.log("Rendering");if(this.loading){return o(i,null,o("verdocs-loader",null))}if(!this.endpoint.session){return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const a=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));const d=a.map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return o(i,{class:this.placing?{[`placing-${this.placing}`]:true}:{},onSubmit:()=>{}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:d,onInput:e=>this.selectedRoleName=e.target.value}),ie.map((e=>o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{if(e.tooltip){if(this.selectedRoleName){this.placing=e.id}else{this.showMustSelectRole=true}}}})))),o("div",{class:"pages"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((e=>{const t=m(1,e.pages);return t.map((t=>{var s;const i=e.page_sizes[t];return o(l,null,((s=this.template)===null||s===void 0?void 0:s.documents.length)>1&&o("div",{class:"document-separator"},o("div",{innerHTML:x}),o("span",null,e.name)),o("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:(i===null||i===void 0?void 0:i.width)||612,virtualHeight:(i===null||i===void 0?void 0:i.height)||792,disabled:true,editable:true,done:false,onClick:s=>this.handleClickPage(s,e.id,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))}))}))),this.showMustSelectRole&&o("verdocs-ok-dialog",{heading:"Unable to add field",message:(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=false}))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return $()}},[0,"verdocs-template-fields",{endpoint:[16],templateId:[1537,"template-id"],toolbarTargetId:[1,"toolbar-target-id"],placing:[32],showMustSelectRole:[32],selectedRoleName:[32],loading:[32],template:[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{templateId:[{onTemplateIdChanged:0}]}]);function ae(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-fields","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-document-page","verdocs-template-field-properties","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-template-fields":if(!customElements.get(a(e))){customElements.define(a(e),le)}break;case"verdocs-button":if(!customElements.get(a(e))){q()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){C()}break;case"verdocs-component-error":if(!customElements.get(a(e))){Z()}break;case"verdocs-dialog":if(!customElements.get(a(e))){V()}break;case"verdocs-field-attachment":if(!customElements.get(a(e))){M()}break;case"verdocs-field-checkbox":if(!customElements.get(a(e))){y()}break;case"verdocs-field-date":if(!customElements.get(a(e))){H()}break;case"verdocs-field-dropdown":if(!customElements.get(a(e))){j()}break;case"verdocs-field-initial":if(!customElements.get(a(e))){S()}break;case"verdocs-field-radio":if(!customElements.get(a(e))){D()}break;case"verdocs-field-signature":if(!customElements.get(a(e))){L()}break;case"verdocs-field-textarea":if(!customElements.get(a(e))){I()}break;case"verdocs-field-textbox":if(!customElements.get(a(e))){Q()}break;case"verdocs-field-timestamp":if(!customElements.get(a(e))){B()}break;case"verdocs-flag":if(!customElements.get(a(e))){T()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){F()}break;case"verdocs-loader":if(!customElements.get(a(e))){z()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){N()}break;case"verdocs-portal":if(!customElements.get(a(e))){P()}break;case"verdocs-select-input":if(!customElements.get(a(e))){R()}break;case"verdocs-template-document-page":if(!customElements.get(a(e))){U()}break;case"verdocs-template-field-properties":if(!customElements.get(a(e))){W()}break;case"verdocs-text-input":if(!customElements.get(a(e))){X()}break;case"verdocs-toolbar-icon":if(!customElements.get(a(e))){A()}break;case"verdocs-upload-dialog":if(!customElements.get(a(e))){Y()}break}}))}export{le as V,ae as d};
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as t,c as s,h as o,d as i,F as l,t as a}from"./p-yZBlG3YQ.js";import{i as d}from"./p-CGNX5HqF.js";import{VerdocsEndpoint as r,getTemplate as n,updateField as c,createField as p,integerSequence as m}from"@verdocs/js-sdk";import{g as h,h as v,i as f,j as g,d as u,k as x}from"./p-BCwFpXpV.js";import{D as w}from"./p-BDv5kBUR.js";import{V as b}from"./p-D97GxsI-.js";import{S as k}from"./p-C1sRVZWv.js";import{S as E}from"./p-C7hFgM52.js";import{d as q}from"./p-Bdf8pPWm.js";import{d as C}from"./p-REnrt0JM.js";import{d as Z}from"./p-CyDWJAOZ.js";import{d as V}from"./p-DT0LGcPi.js";import{d as M}from"./p-BT8wzCXz.js";import{d as y}from"./p-BasWFMeN.js";import{d as H}from"./p-DwPH0TQ4.js";import{d as j}from"./p-BwEGkh_6.js";import{d as S}from"./p-DXLcCG08.js";import{d as D}from"./p-B845hxhl.js";import{d as L}from"./p-5E7bNT3k.js";import{d as I}from"./p-Cfiprngx.js";import{d as Q}from"./p-pyA5cdVX.js";import{d as B}from"./p-DhO1wfh-.js";import{d as T}from"./p-wUsR0Dpa.js";import{d as F}from"./p-CioaaWeS.js";import{d as z}from"./p-B-_kYJtC.js";import{d as N}from"./p-D3qUITiS.js";import{d as P}from"./p-DQTI8vRX.js";import{d as R}from"./p-BXGNkmyr.js";import{d as X}from"./p-DVGumEtx.js";import{d as U}from"./p-D3ohABOv.js";import{d as W}from"./p-DYtSnUj9.js";import{d as Y}from"./p-Bxmki12o.js";import{d as $}from"./p-u16vefxk.js";const _=()=>`verdocs-template-fields{font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif);position:relative;display:block;min-height:600px}verdocs-template-fields .page-0{padding:65px 15px 0 15px;-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .page-0 .user-placed-fields{height:100px;position:relative;background:#ffffff;-webkit-box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294);box-shadow:0 0 10px 5px rgba(0, 0, 0, 0.0588235294)}verdocs-template-fields .page-0 .user-placed-fields .title{top:0;left:0;color:#ffffff;font-size:12px;padding:3px 6px;font-weight:bold;position:absolute;background:#46497d}verdocs-template-fields .pages{display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-template-fields .pages div,verdocs-template-fields .pages canvas{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-template-fields .pages .document-separator{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:10px;padding:12px 20px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#33364b;color:white;border-radius:6px;font-size:16px;font-weight:500;margin-top:20px;-webkit-box-shadow:0 2px 4px rgba(0, 0, 0, 0.1);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}verdocs-template-fields .pages .document-separator svg{-ms-flex-negative:0;flex-shrink:0}verdocs-template-fields .pages .document-separator:first-child{margin-top:0}verdocs-template-fields #verdocs-template-fields-toolbar{width:100%;height:50px;display:-ms-flexbox;display:flex;-webkit-column-gap:15px;-moz-column-gap:15px;column-gap:15px;font-weight:700;padding:0 20px 0 0;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;color:#f5f5fa;-ms-flex-pack:center;justify-content:center;background:#46497d}verdocs-template-fields #verdocs-template-fields-toolbar>verdocs-select-input{margin:0}verdocs-template-fields #verdocs-template-fields-toolbar svg{width:24px;height:24px}verdocs-template-fields #verdocs-template-fields-toolbar .add-for{margin:0;font-weight:500;color:#f5f5fa}verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{margin:0 20px 0 0}@media all and (max-width: 1000px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:8px;-moz-column-gap:8px;column-gap:8px;padding:0 10px 0 0}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}@media all and (max-width: 600px){verdocs-template-fields #verdocs-template-fields-toolbar{-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px}verdocs-template-fields #verdocs-template-fields-toolbar svg{-webkit-transform:scale(0.6);transform:scale(0.6)}verdocs-template-fields #verdocs-template-fields-toolbar .separator,verdocs-template-fields #verdocs-template-fields-toolbar .add-for,verdocs-template-fields #verdocs-template-fields-toolbar verdocs-select-input{display:none}}verdocs-template-fields.placing-attachment{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-checkbox{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-date{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-dropdown{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24' stroke-width='1.5' stroke='currentColor'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' d='M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25' /%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-initial{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-payment{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-radio{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-signature{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-textarea{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath d='M3.225 20.725v-3.15h11.55v3.15Zm0-4.775V12.8h17.55v3.15Zm0-4.75V8.05h17.55v3.15Zm0-4.775v-3.15h17.55v3.15Z'/%3E%3C/svg%3E") 16 16, pointer}verdocs-template-fields.placing-textbox{cursor:url("data:image/svg+xml,%3Csvg width='32' height='15' viewBox='0 0 32 15' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cmask id='path-1-inside-1_1401_24' fill='white'%3E%3Cpath d='M0 0H32V15H0V0Z'/%3E%3C/mask%3E%3Cpath d='M0 0H32V15H0V0Z' fill='%234C56CB' fill-opacity='0.1'/%3E%3Cpath d='M0 0V-1H-1V0H0ZM0 15H-1V16H0V15ZM0 1H32V-1H0V1ZM32 14H0V16H32V14ZM1 15V0H-1V15H1Z' fill='%234C56CB' mask='url(%23path-1-inside-1_1401_24)'/%3E%3Cpath d='M3 11.8V8.65H14.15V11.8H3ZM3 6.65V3.5H20.15V6.65H3Z' fill='%234C56CB'/%3E%3Cline x1='31.5' y1='1' x2='31.5' y2='14' stroke='%234C56CB' stroke-opacity='0.32' stroke-dasharray='1 1'/%3E%3C/svg%3E%0A") 0 14, pointer}verdocs-template-fields.placing-timestamp{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' width='24'%3E%3Cpath fill='%23000000' d='M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM13 14h-2V8h2v6z'%3E%3C/path%3E%3C/svg%3E") 16 16, pointer}`;const G='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M3.425 16.15V13h11.15v3.15Zm0-5.15V7.85h17.15V11Z"/></svg>';const O='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m10.55 16.55 7.275-7.275L16.05 7.5l-5.5 5.45-2.675-2.65L6.1 12.075Zm-5.375 4.925q-1.125 0-1.887-.763-.763-.762-.763-1.887V5.175q0-1.125.763-1.888.762-.762 1.887-.762h13.65q1.125 0 1.888.762.762.763.762 1.888v13.65q0 1.125-.762 1.887-.763.763-1.888.763Zm0-2.65h13.65V5.175H5.175v13.65Zm0-13.65v13.65-13.65Z"/></svg>';const A='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M12 17q2.075 0 3.538-1.463Q17 14.075 17 12t-1.462-3.538Q14.075 7 12 7 9.925 7 8.463 8.462 7 9.925 7 12q0 2.075 1.463 3.537Q9.925 17 12 17Zm0 5.85q-2.275 0-4.25-.85t-3.438-2.312Q2.85 18.225 2 16.25q-.85-1.975-.85-4.25T2 7.75q.85-1.975 2.312-3.438Q5.775 2.85 7.75 2q1.975-.85 4.25-.85t4.25.85q1.975.85 3.438 2.312Q21.15 5.775 22 7.75q.85 1.975.85 4.25T22 16.25q-.85 1.975-2.312 3.438Q18.225 21.15 16.25 22q-1.975.85-4.25.85Zm0-3.15q3.25 0 5.475-2.225Q19.7 15.25 19.7 12q0-3.25-2.225-5.475Q15.25 4.3 12 4.3q-3.25 0-5.475 2.225Q4.3 8.75 4.3 12q0 3.25 2.225 5.475Q8.75 19.7 12 19.7Zm0-7.7Z"/></svg>';const J='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M7.6 13.925q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375Zm4.4 0q-.55 0-.925-.375t-.375-.925q0-.55.375-.937.375-.388.925-.388t.925.388q.375.387.375.937t-.375.925q-.375.375-.925.375ZM5.3 22.85q-1.325 0-2.238-.912-.912-.913-.912-2.238V6.3q0-1.325.912-2.238.913-.912 2.238-.912H6v-2h2.575v2h6.85v-2H18v2h.7q1.325 0 2.238.912.912.913.912 2.238v13.4q0 1.325-.912 2.238-.913.912-2.238.912Zm0-3.15h13.4V10H5.3v9.7ZM5.3 8h13.4V6.3H5.3Zm0 0V6.3 8Z"/></svg>';const K='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="m9.225 21.225 4.65-4.65h8.45v4.65Zm-5.35-2.2H5.05l8.5-8.5-1.175-1.175-8.5 8.5Zm14.25-9.95L13.8 4.8l1.325-1.325q.625-.65 1.525-.663.9-.012 1.6.663l1.225 1.175q.675.675.663 1.562-.013.888-.663 1.513ZM16.7 10.55 6 21.225H1.675V16.9L12.35 6.225Zm-3.725-.625-.6-.575 1.175 1.175Z"/></svg>';const ee='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path fill="#ffffff" d="M6.225 20.775V7h-5V3.225H15V7h-5v13.775Zm9.775 0v-8h-3V9h9.775v3.775h-3v8Z"/></svg>';const te='<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" stroke-width="1.5" stroke="currentColor"><path stroke="#ffffff" stroke-linecap="round" stroke-linejoin="round" d="M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0l-3.75-3.75M17.25 21L21 17.25" /></svg>';const se='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6"><path stroke-linecap="round" stroke-linejoin="round" d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13" /></svg>';const oe='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.707 14.707"><g><rect x="6.275" y="0" fill="#ffffff7f" width="1" height="15"/></g></svg>';const ie=[{id:"signature",tooltip:"Signature",icon:K,class:"signature"},{id:"initial",tooltip:"Initials",icon:ee,class:"initial"},{id:"sep1",tooltip:"",icon:oe,class:"separator"},{id:"textbox",tooltip:"Text Box",icon:G,class:"textbox"},{id:"checkbox",tooltip:"Check Box",icon:O,class:"checkbox"},{id:"radio",tooltip:"Radio Button",icon:A,class:"radio"},{id:"dropdown",tooltip:"Dropdown",icon:te,class:"dropdown"},{id:"sep2",tooltip:"",icon:oe,class:"separator"},{id:"date",tooltip:"Date",icon:J,class:"date"},{id:"attachment",tooltip:"Attachment",icon:se,class:"attachment"}];const le=e(class e extends t{constructor(e){super();if(e!==false){this.__registerHost()}this.sdkError=s(this,"sdkError");this.templateUpdated=s(this,"templateUpdated");this.templateListenerId=null;this.endpoint=r.getDefault();this.templateId=null;this.toolbarTargetId=null;this.placing=null;this.showMustSelectRole=false;this.selectedRoleName="";this.loading=true;this.template=null;this.pageHeights={};this.cachedPageInfo={}}onTemplateIdChanged(){this.listenToTemplate()}handleKeyDown(e){if(e.key==="Escape"){this.placing=null}}handleFieldSettingsChanged(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"updated-field"})}handleFieldDeleted(){var e;(e=this.templateUpdated)===null||e===void 0?void 0:e.emit({endpoint:this.endpoint,template:this.template,event:"deleted-field"})}async componentWillLoad(){var e,t,s;try{this.endpoint.loadSession();if(!this.templateId){console.log(`[FIELDS] Missing required template ID ${this.templateId}`);return}if(!this.endpoint.session){console.log("[FIELDS] Unable to start builder session, must be authenticated");return}this.listenToTemplate()}catch(o){console.log("[FIELDS] Error with fields session",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new k(o.message,(t=o.response)===null||t===void 0?void 0:t.status,(s=o.response)===null||s===void 0?void 0:s.data))}}componentDidRender(){d.dynamicDrop(true);document.querySelectorAll(".verdocs-field").forEach((e=>{this.makeDraggable(e)}));const e=this.toolbarTargetId?document.getElementById(this.toolbarTargetId):null;const t=document.getElementById("verdocs-template-fields-toolbar");if(e&&t){t.remove();e.append(t)}}componentWillUpdate(){var e,t;const s=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));if(!this.selectedRoleName||!s.find((e=>e&&e.name===this.selectedRoleName))){this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||"";console.log("[FIELDS] Selected new role",this.selectedRoleName)}}disconnectedCallback(){this.unlistenToTemplate()}async listenToTemplate(){this.unlistenToTemplate();E.subscribe("templates",this.templateId,(()=>n(this.endpoint,this.templateId)),false,(e=>{var t;console.log("Template updated");this.template=e;this.loading=false;if(!this.selectedRoleName){const s=[...e.roles||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));this.selectedRoleName=((t=s[0])===null||t===void 0?void 0:t.name)||""}}))}unlistenToTemplate(){if(this.templateListenerId){E.store.delListener(this.templateListenerId);this.templateListenerId=null}}handlePageRendered(e){var t,s;var o,i;const l=e.detail;console.log("[FIELDS] Page rendered",l.documentId,l.pageNumber,l.xScale,l.yScale);(t=(o=this.cachedPageInfo)[i=l.documentId])!==null&&t!==void 0?t:o[i]={};this.cachedPageInfo[l.documentId][l.pageNumber]=l;this.pageHeights[l.pageNumber]=l.naturalHeight;(((s=this.template)===null||s===void 0?void 0:s.fields)||[]).filter((e=>e&&e.page===l.pageNumber)).forEach((e=>{const t=h(e);const s=document.getElementById(t);if(s){s.setAttribute("templateid",this.templateId);s.setAttribute("fieldname",e.name);s.setAttribute("documentid",String(e.document_id));s.setAttribute("pagenumber",String(e.page));s.setAttribute("xScale",String(l.xScale));s.setAttribute("yScale",String(l.yScale));this.makeDraggable(s)}}))}makeDraggable(e){d(e).draggable({listeners:{move:this.handleMoveField.bind(this),end:this.handleMoveEnd.bind(this)}})}async handleMoveField(e){const t=+(e.target.getAttribute("posX")||0);const s=+(e.target.getAttribute("posY")||0);const o=+(e.target.getAttribute("xScale")||1);const i=+(e.target.getAttribute("yScale")||1);const l=e.dx/o+t;const a=e.dy/i+s;e.target.setAttribute("posX",l);e.target.setAttribute("posy",a);v(e.target,"translate",`${l}px, ${a}px`)}async handleMoveEnd(e){var t,s,o,i,l,a,d,r;const n=e.target.getAttribute("fieldname");const p=(((t=this.template)===null||t===void 0?void 0:t.fields)||[]).find((e=>e.name===n));if(!p){console.log("[FIELDS] Unable to find field",n,e.target);return}const m=e.target.getAttribute("pagenumber");const h=e.target.getAttribute("documentid");let{naturalWidth:v=612,naturalHeight:w=792,renderedHeight:q=792}=this.cachedPageInfo[h][m];const C=e.target.getBoundingClientRect();const Z=e.target.parentElement;const V=Z.getBoundingClientRect();const M=p.width||x(p.type);const y=p.height||u(p.type);const H=Math.max(C.left-V.left,0);let j=Math.max(q-(V.bottom-C.bottom),0);let S=parseInt(m);if(j>q){S=Math.min(S+1,((i=(o=((s=this.template)===null||s===void 0?void 0:s.documents)||[])===null||o===void 0?void 0:o[0])===null||i===void 0?void 0:i.pages)||1);j-=q;q=this.cachedPageInfo[h][S].renderedHeight;console.log("Next page",{newPageNumber:S,newY:j,renderedHeight:q})}else if(j<0){S=Math.max(S-1,1);q=this.cachedPageInfo[h][S].renderedHeight;j+=q;console.log("[FIELDS] Next page",{newPageNumber:S,newY:j,renderedHeight:q})}const{x:D,y:L}=this.viewCoordinatesToPageCoordinates(H,j,h,m,v-M,w-y);try{const t={x:D,y:L,page:S};const s=await c(this.endpoint,this.templateId,n,t);console.log("[FIELDS] Updated",s);const o=JSON.parse(JSON.stringify(this.template));const i=o.fields.findIndex((e=>e.name===n));if(i>-1){o.fields[i]=s}E.updateTemplate(this.templateId,o);e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target);const{xScale:a=1,yScale:d=1}=this.cachedPageInfo[h][m];g(e.target,s,a,d);(l=this.templateUpdated)===null||l===void 0?void 0:l.emit({endpoint:this.endpoint,template:o,event:"updated-field"})}catch(t){b("Error updating field, please try again later",{style:"error"});console.log("[FIELDS] Error updating field",t);(a=this.sdkError)===null||a===void 0?void 0:a.emit(new k(t.message,(d=t.response)===null||d===void 0?void 0:d.status,(r=t.response)===null||r===void 0?void 0:r.data));e.target.removeAttribute("posX");e.target.removeAttribute("posY");f(e.target)}}generateFieldName(e,t){var s;let o=1;let i;do{i=`${e}P${t}-${o}`;o++}while((((s=this.template)===null||s===void 0?void 0:s.fields)||[]).some((e=>e&&e.name===i)));return i}viewCoordinatesToPageCoordinates(e,t,s,o,i,l){const{xScale:a=1,yScale:d=1,renderedHeight:r=792}=this.cachedPageInfo[s][o];const n=Math.floor(Math.min(e/a,i));const c=Math.floor(Math.min(Math.max(r-t,0)/d,l));return{x:n,y:c}}async handleClickPage(e,t,s){var o;if(this.placing){const i=e.offsetX;const l=e.offsetY;const a=x(this.placing);const d=u(this.placing);const r=this.cachedPageInfo[t][s];const{naturalWidth:n=612,naturalHeight:c=792}=r;const m=this.viewCoordinatesToPageCoordinates(i,l,t,s,n-a,c-d);const h=Math.floor(m.x);const v=Math.floor(m.y);const f={name:this.generateFieldName(this.placing,s),role_name:this.selectedRoleName,template_id:this.templateId,document_id:r.documentId,type:this.placing,required:this.placing!=="radio"&&this.placing!=="attachment"&&this.placing!=="checkbox",page:s,validator:null,label:null,default:null,placeholder:null,group:null,settings:{},x:h,y:v,width:a,height:d,multiline:false,readonly:false,options:this.placing==="radio"?[{id:"option-1",label:"Option 1"}]:[]};const g=await p(this.endpoint,this.templateId,f);console.log("[FIELDS] Created field",g);const w=JSON.parse(JSON.stringify(this.template));w.fields.push(g);E.updateTemplate(this.templateId,w);(o=this.templateUpdated)===null||o===void 0?void 0:o.emit({endpoint:this.endpoint,template:w,event:"added-field"});this.placing=null}}render(){var e,t,s;console.log("Rendering");if(this.loading){return o(i,null,o("verdocs-loader",null))}if(!this.endpoint.session){return o(i,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}const a=[...((e=this.template)===null||e===void 0?void 0:e.roles)||[]].sort(((e,t)=>{var s,o;return((s=e.sequence)!==null&&s!==void 0?s:0)-((o=t.sequence)!==null&&o!==void 0?o:0)}));const d=a.map((e=>({value:e.name,label:e.full_name?`${e.name}: ${e.full_name}`:e.name})));return o(i,{class:this.placing?{[`placing-${this.placing}`]:true}:{},onSubmit:()=>{}},o("div",{id:"verdocs-template-fields-toolbar"},o("div",{class:"add-for"},"Add field:"),o("verdocs-select-input",{value:this.selectedRoleName,options:d,onInput:e=>this.selectedRoleName=e.target.value}),ie.map((e=>o("verdocs-toolbar-icon",{text:e.tooltip,icon:e.icon,class:e.class,onClick:()=>{if(e.tooltip){if(this.selectedRoleName){this.placing=e.id}else{this.showMustSelectRole=true}}}})))),o("div",{class:"pages"},(((t=this.template)===null||t===void 0?void 0:t.documents)||[]).map((e=>{const t=m(1,e.pages);return t.map((t=>{var s;const i=e.page_sizes[t];return o(l,null,((s=this.template)===null||s===void 0?void 0:s.documents.length)>1&&o("div",{class:"document-separator"},o("div",{innerHTML:w}),o("span",null,e.name)),o("verdocs-template-document-page",{templateId:this.templateId,documentId:e.id,pageNumber:t,virtualWidth:(i===null||i===void 0?void 0:i.width)||612,virtualHeight:(i===null||i===void 0?void 0:i.height)||792,disabled:true,editable:true,done:false,onClick:s=>this.handleClickPage(s,e.id,t),onPageRendered:e=>this.handlePageRendered(e),layers:[{name:"page",type:"canvas"},{name:"controls",type:"div"}]}))}))}))),this.showMustSelectRole&&o("verdocs-ok-dialog",{heading:"Unable to add field",message:(((s=this.template)===null||s===void 0?void 0:s.roles)||[]).length>0?"Please select a role before adding fields.":"Please add at least one role before adding fields.",onNext:()=>this.showMustSelectRole=false}))}static get watchers(){return{templateId:[{onTemplateIdChanged:0}]}}static get style(){return _()}},[0,"verdocs-template-fields",{endpoint:[16],templateId:[1537,"template-id"],toolbarTargetId:[1,"toolbar-target-id"],placing:[32],showMustSelectRole:[32],selectedRoleName:[32],loading:[32],template:[32]},[[4,"keydown","handleKeyDown"],[0,"settingsChanged","handleFieldSettingsChanged"],[0,"deleted","handleFieldDeleted"]],{templateId:[{onTemplateIdChanged:0}]}]);function ae(){if(typeof customElements==="undefined"){return}const e=["verdocs-template-fields","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-ok-dialog","verdocs-portal","verdocs-select-input","verdocs-template-document-page","verdocs-template-field-properties","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-template-fields":if(!customElements.get(a(e))){customElements.define(a(e),le)}break;case"verdocs-button":if(!customElements.get(a(e))){q()}break;case"verdocs-checkbox":if(!customElements.get(a(e))){C()}break;case"verdocs-component-error":if(!customElements.get(a(e))){Z()}break;case"verdocs-dialog":if(!customElements.get(a(e))){V()}break;case"verdocs-field-attachment":if(!customElements.get(a(e))){M()}break;case"verdocs-field-checkbox":if(!customElements.get(a(e))){y()}break;case"verdocs-field-date":if(!customElements.get(a(e))){H()}break;case"verdocs-field-dropdown":if(!customElements.get(a(e))){j()}break;case"verdocs-field-initial":if(!customElements.get(a(e))){S()}break;case"verdocs-field-radio":if(!customElements.get(a(e))){D()}break;case"verdocs-field-signature":if(!customElements.get(a(e))){L()}break;case"verdocs-field-textarea":if(!customElements.get(a(e))){I()}break;case"verdocs-field-textbox":if(!customElements.get(a(e))){Q()}break;case"verdocs-field-timestamp":if(!customElements.get(a(e))){B()}break;case"verdocs-flag":if(!customElements.get(a(e))){T()}break;case"verdocs-help-icon":if(!customElements.get(a(e))){F()}break;case"verdocs-loader":if(!customElements.get(a(e))){z()}break;case"verdocs-ok-dialog":if(!customElements.get(a(e))){N()}break;case"verdocs-portal":if(!customElements.get(a(e))){P()}break;case"verdocs-select-input":if(!customElements.get(a(e))){R()}break;case"verdocs-template-document-page":if(!customElements.get(a(e))){X()}break;case"verdocs-template-field-properties":if(!customElements.get(a(e))){U()}break;case"verdocs-text-input":if(!customElements.get(a(e))){W()}break;case"verdocs-toolbar-icon":if(!customElements.get(a(e))){Y()}break;case"verdocs-upload-dialog":if(!customElements.get(a(e))){$()}break}}))}export{le as V,ae as d};
|
|
2
|
+
//# sourceMappingURL=p-Yxa93LOl.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as t,H as e,c as s,h as r,d as a,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as n,toggleTemplateStar as o}from"@verdocs/js-sdk";const l=()=>`verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}`;const c=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>`;const d=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>`;const f=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.starChange=s(this,"starChange");this.sdkError=s(this,"sdkError");this.endpoint=n.getDefault();this.updating=false}async componentWillLoad(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return}}toggle(t){t.stopPropagation();this.updating=true;o(n.getDefault(),this.template.id).then((t=>{this.updating=false;this.template.star_counter=t.star_counter;this.starChange.emit({templateId:this.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((t=>{this.updating=false;console.log("[STAR] Error toggling template star",t.message);this.sdkError.emit(t)}))}render(){return r(a,{key:"
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as t,H as e,c as s,h as r,d as a,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as n,toggleTemplateStar as o}from"@verdocs/js-sdk";const l=()=>`verdocs-template-star{display:-ms-flexbox;display:flex;-ms-flex:0 0 60px;flex:0 0 60px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;font-family:"Inter", "Barlow", sans-serif}verdocs-template-star .star{line-height:10px}verdocs-template-star .star.updating{-webkit-animation:spinningStar 2s infinite linear;animation:spinningStar 2s infinite linear}verdocs-template-star .star svg{width:24px;height:24px}verdocs-template-star .count{color:#595c5d;font-size:14px;margin-left:10px}@-webkit-keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinningStar{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}`;const c=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" /></svg>`;const d=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006z" clip-rule="evenodd" /></svg>`;const f=t(class t extends e{constructor(t){super();if(t!==false){this.__registerHost()}this.starChange=s(this,"starChange");this.sdkError=s(this,"sdkError");this.endpoint=n.getDefault();this.updating=false}async componentWillLoad(){this.endpoint.loadSession();if(!this.endpoint.session){console.log("[TEMPLATES] Must be authenticated");return}}toggle(t){t.stopPropagation();this.updating=true;o(n.getDefault(),this.template.id).then((t=>{this.updating=false;this.template.star_counter=t.star_counter;this.starChange.emit({templateId:this.template.id,starred:t.star_counter>0,count:t.star_counter})})).catch((t=>{this.updating=false;console.log("[STAR] Error toggling template star",t.message);this.sdkError.emit(t)}))}render(){return r(a,{key:"11f23b3f7dc779128e3ce967619491255d2f46e5"},r("div",{key:"a8b0281d77522a51cc5ed57e752327b79749986d",class:`star ${this.updating?"updating":""}`,innerHTML:this.template.star_counter?d:c,onClick:t=>this.toggle(t)}),r("div",{key:"ca4e6ed0e494f0255cce552150ac17008f76ae3e",class:"count"},this.template.star_counter||"--"))}static get style(){return l()}},[0,"verdocs-template-star",{endpoint:[16],template:[1040],updating:[32]}]);function m(){if(typeof customElements==="undefined"){return}const t=["verdocs-template-star"];t.forEach((t=>{switch(t){case"verdocs-template-star":if(!customElements.get(i(t))){customElements.define(i(t),f)}break}}))}export{f as V,m as d};
|
|
2
|
+
//# sourceMappingURL=p-tub_01MP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as a,c as t,h as o,F as i,d as s,t as d}from"./p-yZBlG3YQ.js";import{d as
|
|
2
|
-
//# sourceMappingURL=p-
|
|
1
|
+
import{p as e,H as a,c as t,h as o,F as i,d as s,t as d}from"./p-yZBlG3YQ.js";import{d as l}from"./p-Bdf8pPWm.js";import{d as c}from"./p-DT0LGcPi.js";import{d as n}from"./p-D3qUITiS.js";const r=()=>`verdocs-upload-dialog{position:fixed;-webkit-box-sizing:border-box;box-sizing:border-box;font-family:"Inter", "Barlow", sans-serif}verdocs-upload-dialog div{-webkit-box-sizing:border-box;box-sizing:border-box}verdocs-upload-dialog .background-overlay{top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;z-index:10000;position:fixed;-ms-flex-align:center;align-items:center;background:rgba(0, 0, 0, 0.4980392157);-ms-flex-pack:center;justify-content:center}verdocs-upload-dialog .upload-dialog-content{width:320px;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-upload-dialog .heading{display:-ms-flexbox;display:flex;font-size:20px;font-weight:500;-ms-flex-direction:row;flex-direction:row}verdocs-upload-dialog .buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:end;justify-content:flex-end}verdocs-upload-dialog .buttons verdocs-button{margin-left:16px}verdocs-upload-dialog .current-label{margin:20px 0 5px 0}verdocs-upload-dialog .drop-target{opacity:1;width:100%;display:-ms-flexbox;display:flex;margin:20px 0;min-height:260px;padding:30px 15px;text-align:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;background-color:#f5f5f5;color:#33364b;border:2px dashed #979797}verdocs-upload-dialog .drop-target p{margin:12px 0;font-weight:500}verdocs-upload-dialog .drop-target p.subscript{margin:20px;color:#5c6575;font-size:14px}verdocs-upload-dialog .drop-target.dragging-over{border:5px solid #4c56cb}verdocs-upload-dialog .drop-target>verdocs-button{margin:12px 0;display:inline-block}verdocs-upload-dialog .attachments{height:56px;font-size:0;margin:20px 0;padding:0 16px;line-height:56px;white-space:normal;-webkit-box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14);box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.12), 0 0 2px 0 rgba(0, 0, 0, 0.14)}verdocs-upload-dialog .attachments .attachment{gap:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-upload-dialog .attachments .attachment .icon{width:18px;height:18px;line-height:18px}verdocs-upload-dialog .attachments .attachment .icon.trash{cursor:pointer}verdocs-upload-dialog .attachments .attachment .name{-ms-flex:1;flex:1;font-size:14px;overflow:hidden;font-weight:400;white-space:nowrap;text-overflow:ellipsis}verdocs-upload-dialog .error{margin:20px 0;color:#cc0000}`;const f=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" /></svg>`;const p=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13" /></svg>`;const h=e(class e extends a{constructor(e){super();if(e!==false){this.__registerHost()}this.exit=t(this,"exit");this.next=t(this,"next");this.remove=t(this,"remove");this.maxSize=20*1024*1024;this.draggingOver=false;this.confirmDelete=false;this.selectedFiles=[];this.errorMessage=""}handleCancel(){this.exit.emit()}handleDismiss(e){if(e.target.class==="background-overlay"){e.preventDefault();this.handleCancel()}}handleDone(){this.next.emit(this.selectedFiles)}handleDragOver(e){e.preventDefault();this.draggingOver=true}handleDragLeave(e){e.preventDefault();this.draggingOver=false}async handleDrop(e){e.preventDefault();this.draggingOver=false;this.handleSetSelected(Array.from(e.dataTransfer.files))}handleRemoveAttachment(e){const a=[...this.selectedFiles];a.splice(e,1);this.handleSetSelected(a)}handleSetSelected(e){this.selectedFiles=e;this.errorMessage="";const a=this.selectedFiles.reduce(((e,a)=>e+a.size),0);if(a>this.maxSize){this.errorMessage="Total file size must not exceed 20MB."}}handleDeleteAttachment(e){var a;e.preventDefault();e.stopPropagation();(a=this.remove)===null||a===void 0?void 0:a.emit();this.existingFile=null;this.confirmDelete=false}handleSelectFile(){var e;(e=this.fileInput)===null||e===void 0?void 0:e.click()}async handleFileChange(){var e;const a=Array.from((e=this.fileInput)===null||e===void 0?void 0:e.files);this.handleSetSelected(a)}render(){var e;const a=((e=this.existingFile)===null||e===void 0?void 0:e.name)?this.existingFile:null;return o(s,{key:"afb8059122df5f070ae3ded2cbc5fd402ddf4c30"},o("div",{key:"0acdbe273ac24e4026e1d21637eedc45b04096ff",class:"background-overlay",onClick:e=>this.handleDismiss(e)},o("div",{key:"8714ae9328f8acfc08b1cfddacaf160ff1ba27f4",class:"upload-dialog-content"},o("div",{key:"c26e45a11d45f80517ea5862af39e0cafb534523",class:"heading"},"Upload attachment"),this.selectedFiles.length<1&&a&&o(i,{key:"34eccf225b38f37cb542d6bea63a792a61e5c2e4"},o("div",{key:"19bc692a2a352a60448481f5fab214a9a733d560",class:"current-label"},"Current Attachment"),o("div",{key:"18ec31779f257a11303dca40508eb6af155e94ae",class:"attachments",style:{marginTop:"0"}},o("div",{key:"f282e58bac16e5cf2ddcecd5969ce314c5747e92",class:"attachment"},o("div",{key:"9dcafcd10b951a0b2ed7756feb5b1d60dd7ccc97",class:"icon",innerHTML:p}),o("div",{key:"95e6448c10b17130eef74cb3f88236764e4ff94d",class:"name"},a.name),o("div",{key:"70b3fa880b75d0ec311e29660ee482b47427f41e",class:"icon trash",innerHTML:f,onClick:()=>this.confirmDelete=true})))),this.selectedFiles.length<1&&!a&&o("div",{key:"53ba2d4e6a992c69996001137e36db16f527868b",class:{"drop-target":true,"dragging-over":this.draggingOver},onDragOver:e=>this.handleDragOver(e),onDragLeave:e=>this.handleDragLeave(e),onDrop:e=>this.handleDrop(e)},o("p",{key:"1a2326c8f41cf429ea8d206531118762f68eb37b"},"Drag and drop your files here"),o("p",{key:"bf4153d3624e0cca52ce3499c5d6a8009d0eb909",class:"subscript"},"Supported files: PDF, Word, JPG, PNG"),o("verdocs-button",{key:"411c2e054887771ebfb1ebcd192247d51a011d65",label:!!a?"Replace files":"Select files",onClick:()=>this.handleSelectFile()}),o("input",{key:"ff57cbb18b9c9852bb09b7e82303768d52690caa",type:"file",ref:e=>this.fileInput=e,style:{display:"none"},accept:".pdf,application/pdf,.doc,.docx,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,image/*",onChange:()=>this.handleFileChange()})),this.selectedFiles.length>0&&o("div",{key:"4560c6fbd51be1e385081d0e5da1b5f028a2fe4c",class:"attachments"},this.selectedFiles.map(((e,a)=>o("div",{class:"attachment"},o("div",{class:"icon",innerHTML:p}),o("div",{class:"name"},e.name),o("div",{class:"icon trash",innerHTML:f,onClick:()=>this.handleRemoveAttachment(a)}))))),!!this.errorMessage&&o("div",{key:"496b1953cce011c1be512ae704b86a99b672ef32",class:"error"},this.errorMessage),o("div",{key:"1fe1a4d1879c7d97e2cb0613aed65eb4f6134319",class:"buttons"},o("verdocs-button",{key:"3d5b3360099b341ffa3873a723523b237b5fd99c",label:"Cancel",variant:"outline",onClick:()=>this.handleCancel()}),o("verdocs-button",{key:"aa176cfae4504f73adb79eb55b6cebe369f0e509",label:"Upload",onClick:()=>this.handleDone(),disabled:!!this.errorMessage||this.selectedFiles.length<1})))),this.confirmDelete&&o("verdocs-ok-dialog",{key:"7e05ca66affc86277df7e10efda054121a8f5787",heading:"Delete Attachment?",message:"Are you sure you wish to delete this attachment? This action cannot be undone.",showCancel:true,onExit:e=>{e.preventDefault();e.stopPropagation();this.confirmDelete=false},onNext:e=>this.handleDeleteAttachment(e)}))}static get style(){return r()}},[0,"verdocs-upload-dialog",{maxSize:[1026,"max-size"],existingFile:[1032,"existing-file"],draggingOver:[32],confirmDelete:[32],selectedFiles:[32],errorMessage:[32]}]);function b(){if(typeof customElements==="undefined"){return}const e=["verdocs-upload-dialog","verdocs-button","verdocs-dialog","verdocs-ok-dialog"];e.forEach((e=>{switch(e){case"verdocs-upload-dialog":if(!customElements.get(d(e))){customElements.define(d(e),h)}break;case"verdocs-button":if(!customElements.get(d(e))){l()}break;case"verdocs-dialog":if(!customElements.get(d(e))){c()}break;case"verdocs-ok-dialog":if(!customElements.get(d(e))){n()}break}}))}export{h as V,b as d};
|
|
2
|
+
//# sourceMappingURL=p-u16vefxk.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["verdocsAuthCss","VerdocsAuth","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","endpoint","VerdocsEndpoint","getDefault","visible","logo","displayMode","org_name","first_name","last_name","email","phone","verificationCode","newPassword","password","confirmpass","submitting","resendDisabled","session","profile","resendDisabledTimer","tempAuthEndpoint","baseURL","getBaseURL","persist","handleHashChange","applyHashDisplayMode","componentWillLoad","loadSession","window","addEventListener","onSessionChanged","_endpoint","_a","authenticated","emit","_b","disconnectedCallback","removeEventListener","hash","location","replace","toLowerCase","isPasswordComplex","isUppercase","ch","test","isLowercase","isSpecialChar","countOfUpperCase","countOfLowerCase","countOfSpecialChar","i","length","charAt","handleSignup","VerdocsToast","style","clearSession","formattedPhone","convertToE164","localeData","Intl","DateTimeFormat","resolvedOptions","createProfile","timezone","timeZone","locale","then","r","console","log","setToken","access_token","catch","e","response","sdkError","SDKError","message","_c","status","_d","data","_f","_e","error","handleVerification","verificationResult","verifyEmail","token","completeLogin","result","clearForms","loginAndCheckVerification","authResult","authenticate","username","trim","grant_type","user","getMyUser","email_verified","handleLogout","handleResendVerification","setTimeout","resendVerification","handleResendReset","resetPassword","handleResetGetCode","handleResetPassword","resetResult","code","new_password","handleReset","render","h","display","label","disabled","onClick","justifyContent","margin","invalid","class","href","src","alt","variant","onSubmit","flexDirection","columnGap","autocomplete","required","value","onInput","target","type","flex","marginTop","size"],"sources":["src/components/embeds/verdocs-auth/verdocs-auth.scss?tag=verdocs-auth","src/components/embeds/verdocs-auth/verdocs-auth.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-auth {\n font-family: $verdocs-primary-font;\n display: flex;\n align-items: center;\n flex-direction: column;\n justify-content: center;\n\n .form {\n width: 350px;\n display: flex;\n padding: 20px;\n max-width: 90%;\n align-items: center;\n flex-direction: column;\n box-sizing: border-box;\n justify-content: center;\n background: $verdocs-grey-4;\n }\n\n .logo {\n width: 128px;\n max-width: 100%;\n margin: 20px 0 30px;\n }\n\n h3 {\n color: $verdocs-grey-0;\n text-align: center;\n font-weight: 400;\n font-size: 18px;\n line-height: 1.75;\n margin: 0;\n }\n\n em {\n font-size: 14px;\n margin: 15px 0;\n }\n\n .buttons {\n gap: 20px;\n margin: 20px 0 0 0;\n display: flex;\n flex-direction: row;\n justify-content: center;\n }\n\n .status-result {\n display: none;\n\n &.debug {\n white-space: pre-wrap;\n font-size: 14px;\n background: #fff;\n padding: 10px;\n display: block;\n flex-direction: row;\n justify-content: center;\n }\n }\n\n form {\n width: 100%;\n }\n\n verdocs-text-input {\n margin-bottom: 10px;\n }\n\n .account-option {\n gap: 8px;\n margin: 20px 0 8px 0;\n display: flex;\n flex-direction: row;\n }\n\n p {\n color: $verdocs-grey-0;\n margin: 1em 0;\n font-size: 14px;\n }\n\n // Our <p>s are in a flex layout which prevents margins from collapsing because each item creates its own row\n p + p {\n margin-top: 0;\n }\n\n verdocs-help-icon {\n margin-top: 18px;\n display: flex;\n width: 32px;\n height: 32px;\n flex: 0 0 32px;\n }\n\n .already-have {\n color: $verdocs-grey-0;\n margin: 0.5em 0;\n font-size: 14px;\n text-align: center;\n }\n\n .service-agreement {\n font-size: 12px;\n color: #777;\n\n a {\n color: $verdocs-grey-0;\n }\n }\n}\n","import {Component, Prop, State, h, Event, EventEmitter} from '@stencil/core';\nimport {verifyEmail, IAuthenticateResponse, getMyUser, IProfile, convertToE164} from '@verdocs/js-sdk';\nimport {TSession, VerdocsEndpoint, createProfile, authenticate, resendVerification, resetPassword} from '@verdocs/js-sdk';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\n\nexport interface IAuthStatus {\n authenticated: boolean;\n session: TSession;\n profile: IProfile | null;\n}\n\n/**\n * Display an authentication dialog that allows the user to login or sign up. If the user is\n * already authenticated with a valid session, this component will hide itself and fire the\n * success callback immediately. It is up to the host application to render the next appropriate\n * view for the application.\n *\n * To simplify UI development, a visibility flag can force this component to never display. This\n * allows you to subscribe to notifications from client apps without calling the lower-level JS SDK.\n *\n * This embed is responsive / mobile-friendly, but the calling application should provide at\n * least a 300px wide container to allow sufficient space for the required forms.\n *\n * ```ts\n * <verdocs-auth\n * onAuthenticated={({ detail }) => console.log('Authentication state:', detail) }\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-auth',\n styleUrl: 'verdocs-auth.scss',\n shadow: false,\n})\nexport class VerdocsAuth {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Normally, if the user has a valid session, this embed will be invisible, otherwise it will display\n * login / signup forms. If this is set to false, this embed will be invisible in both cases. Apps may\n * use this to verify if a user has a valid session without needing a separate call to Verdocs JS SDK.\n */\n @Prop() visible: boolean = true;\n\n /**\n * By default, a Verdocs logo will be displayed above the login/signup forms. This may be used to\n * override its source. (Alternatively, you may simply hide it via CSS overrides.) Logos should be\n * in SVG format for best results.\n */\n @Prop() logo: string = 'https://app.verdocs.com/assets/blue-logo.svg';\n\n /**\n * The display mode to start in.\n */\n @Prop({mutable: true}) displayMode: 'login' | 'forgot' | 'reset' | 'signup' | 'verify' = 'login';\n\n /**\n * Event fired when session authentication process has completed. Check the event\n * contents for completion status. This event will always be called at least once,\n * when the component is first rendered.\n */\n @Event({composed: true}) authenticated: EventEmitter<IAuthStatus>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() org_name: string = '';\n @State() first_name: string = '';\n @State() last_name: string = '';\n @State() email: string = '';\n @State() phone: string = '';\n @State() verificationCode: string = '';\n @State() newPassword: string = '';\n @State() password: string = '';\n @State() confirmpass: string = '';\n @State() submitting: boolean = false;\n @State() resendDisabled = false;\n @State() session: TSession = null;\n @State() profile: IProfile | null = null;\n\n resendDisabledTimer = null;\n\n // We can't instantly log in on the default endpoint because other listeners might see\n // its events and incorrectly trigger before we're done. So we manage our own temp\n // endpoint and pass the final tokens to the default once we're ready.\n tempAuthEndpoint = new VerdocsEndpoint({\n baseURL: VerdocsEndpoint.getDefault().getBaseURL(),\n persist: false,\n });\n\n componentWillLoad() {\n this.endpoint.loadSession();\n this.applyHashDisplayMode();\n\n // We need to listen to the hashchange to know when we're being sent to #forgot\n if (typeof window !== 'undefined') {\n window.addEventListener('hashchange', this.handleHashChange);\n }\n\n VerdocsEndpoint.getDefault().onSessionChanged((_endpoint, session, profile) => {\n this.session = session;\n this.profile = profile;\n if (session) {\n this.authenticated?.emit({authenticated: true, session, profile});\n } else {\n this.authenticated?.emit({authenticated: false, session, profile});\n }\n });\n }\n\n disconnectedCallback() {\n if (typeof window !== 'undefined') {\n window.removeEventListener('hashchange', this.handleHashChange);\n }\n }\n\n handleHashChange = () => {\n this.applyHashDisplayMode();\n };\n\n applyHashDisplayMode() {\n if (typeof window === 'undefined') {\n return;\n }\n\n const hash = (window.location.hash || '').replace(/^#/, '').toLowerCase();\n if (hash === 'forgot') {\n this.displayMode = 'forgot';\n }\n }\n\n isPasswordComplex(password: string) {\n const isUppercase = (ch: string) => /[A-Z]/.test(ch);\n const isLowercase = (ch: string) => /[a-z]/.test(ch);\n const isSpecialChar = (ch: string) => /[`!@#$%^&*()_\\-+=\\[\\]{};':\"\\\\|,.<>\\/?~ ]/.test(ch);\n let countOfUpperCase = 0,\n countOfLowerCase = 0,\n countOfSpecialChar = 0;\n for (let i = 0; i < password.length; i++) {\n let ch = password.charAt(i);\n if (isUppercase(ch)) countOfUpperCase++;\n else if (isLowercase(ch)) countOfLowerCase++;\n else if (isSpecialChar(ch)) countOfSpecialChar++;\n }\n return password.length >= 8 && countOfLowerCase > 0 && countOfUpperCase > 0 && countOfSpecialChar > 0;\n }\n\n handleSignup() {\n if (!this.isPasswordComplex(this.password)) {\n VerdocsToast('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.', {style: 'error'});\n return;\n }\n\n if (this.password !== this.confirmpass) {\n VerdocsToast('Passwords do not match.', {style: 'error'});\n return;\n }\n\n this.submitting = true;\n this.tempAuthEndpoint.clearSession();\n const formattedPhone = convertToE164(this.phone);\n const localeData = Intl.DateTimeFormat().resolvedOptions();\n\n createProfile(this.tempAuthEndpoint, {\n email: this.email,\n password: this.password,\n first_name: this.first_name,\n last_name: this.last_name,\n org_name: this.org_name,\n phone: formattedPhone,\n // @ts-expect-error - v6.9.13\n timezone: localeData.timeZone,\n locale: localeData.locale,\n })\n .then(r => {\n console.log('[AUTH] Profile creation result', r);\n this.tempAuthEndpoint.setToken(r.access_token);\n // We can't clearForms because we need email to stick around\n this.password = '';\n this.phone = '';\n this.first_name = '';\n this.last_name = '';\n this.org_name = '';\n this.displayMode = 'verify';\n this.submitting = false;\n })\n .catch(e => {\n console.log('[AUTH] Signup error', e.response);\n this.submitting = false;\n this.authenticated?.emit({authenticated: false, profile: null, session: null});\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n\n VerdocsToast('Signup failed: ' + e.response?.data?.error || 'Unknown Error', {style: 'error'});\n });\n }\n\n async handleVerification() {\n this.submitting = true;\n\n try {\n this.submitting = false;\n const verificationResult = await verifyEmail(this.tempAuthEndpoint, {email: this.email, token: this.verificationCode});\n VerdocsToast('Thank you for verifying your email address.', {style: 'success'});\n this.completeLogin(verificationResult);\n } catch (e) {\n this.submitting = false;\n console.log('Verification error', e);\n VerdocsToast('Verification error, please check the code and try again.');\n }\n }\n\n completeLogin(result: IAuthenticateResponse) {\n this.clearForms();\n this.tempAuthEndpoint.clearSession();\n this.endpoint.setToken(result.access_token);\n }\n\n async loginAndCheckVerification() {\n if (this.submitting) {\n return;\n }\n\n this.submitting = true;\n this.tempAuthEndpoint.clearSession();\n\n try {\n this.submitting = false;\n const authResult = await authenticate(this.tempAuthEndpoint, {username: this.email.trim(), password: this.password, grant_type: 'password'});\n console.log('[AUTH] Authenticated, checking email verification');\n this.tempAuthEndpoint.setToken(authResult.access_token);\n\n const user = await getMyUser(this.tempAuthEndpoint);\n\n if (!user.email_verified) {\n console.log('[AUTH] Logged in, pending email address verification');\n this.displayMode = 'verify';\n } else {\n console.log('[AUTH] Email address is verified, completing login');\n this.completeLogin(authResult);\n }\n } catch (e) {\n this.submitting = false;\n console.log('[AUTH] Auth failure', e.response?.data || e);\n VerdocsToast('Login failed. Please check your credentials and try again.', {style: 'error'});\n }\n }\n\n clearForms() {\n this.submitting = false;\n this.resendDisabled = false;\n this.email = '';\n this.phone = '';\n this.password = '';\n this.newPassword = '';\n this.confirmpass = '';\n this.verificationCode = '';\n this.first_name = '';\n this.last_name = '';\n this.org_name = '';\n }\n\n handleLogout() {\n console.log('logging out');\n this.endpoint.clearSession();\n this.tempAuthEndpoint.clearSession();\n this.clearForms();\n this.displayMode = 'login';\n }\n\n handleResendVerification() {\n // Avoid the user just click-spamming this pathway. The server rate-limits this anyway so it's not a\n // security issue but it's a poor user experience to allow it.\n this.resendDisabled = true;\n this.resendDisabledTimer = setTimeout(() => {\n this.resendDisabled = false;\n this.resendDisabledTimer = null;\n }, 30000);\n\n resendVerification(this.tempAuthEndpoint)\n .then(r => {\n console.log('[AUTH] Verification request resent', r);\n VerdocsToast('Please check your email for a verification code.', {style: 'info'});\n })\n .catch((e: any) => {\n console.log('[AUTH] Unable to resend verification', e);\n VerdocsToast('Unable to resend code. Please try again later.', {style: 'error'});\n });\n }\n\n handleResendReset() {\n // Avoid the user just click-spamming this pathway. The server rate-limits this anyway so it's not a\n // security issue but it's a poor user experience to allow it.\n this.resendDisabled = true;\n this.resendDisabledTimer = setTimeout(() => {\n this.resendDisabled = false;\n this.resendDisabledTimer = null;\n }, 30000);\n\n resetPassword(this.tempAuthEndpoint, {email: this.email})\n .then(r => {\n console.log('[AUTH] Resend-code request resent', r);\n VerdocsToast('Please check your email again for a verification code.', {style: 'info'});\n })\n .catch((e: any) => {\n console.log('[AUTH] Unable to resend reset request', e);\n VerdocsToast('Unable to resend code. Please try again later.', {style: 'error'});\n });\n }\n\n async handleResetGetCode() {\n this.submitting = true;\n this.confirmpass = '';\n this.newPassword = '';\n\n try {\n this.submitting = false;\n const result = await resetPassword(this.endpoint, {email: this.email});\n console.log('[AUTH] Reset result', result);\n VerdocsToast('Please check your email inbox for a password reset code.', {style: 'success'});\n this.verificationCode = '';\n this.confirmpass = '';\n this.newPassword = '';\n this.displayMode = 'reset';\n } catch (e) {\n this.submitting = false;\n console.log('Reset request error', e);\n VerdocsToast('Request failed. Please check your email address and try again.');\n }\n }\n\n async handleResetPassword() {\n if (!this.isPasswordComplex(this.newPassword)) {\n VerdocsToast('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.', {style: 'error'});\n return;\n }\n\n if (this.newPassword !== this.confirmpass) {\n VerdocsToast('Passwords do not match.', {style: 'error'});\n return;\n }\n\n this.submitting = true;\n try {\n this.submitting = false;\n const resetResult = await resetPassword(this.endpoint, {email: this.email, code: this.verificationCode, new_password: this.newPassword});\n console.log('reset result', resetResult);\n VerdocsToast('Your password has been reset. You may now use your new password to login.', {style: 'success'});\n this.verificationCode = '';\n this.confirmpass = '';\n this.newPassword = '';\n this.password = '';\n this.displayMode = 'login';\n } catch (e) {\n this.submitting = false;\n console.log('Verification error', e);\n VerdocsToast('Verification error, please check the code and try again.');\n }\n }\n\n async handleReset() {\n this.submitting = true;\n\n try {\n const result = await resetPassword(this.endpoint, {email: this.email});\n console.log('[AUTH] Reset sent', result);\n this.submitting = false;\n this.displayMode = 'login';\n VerdocsToast('If your email address is registered, you will receive instructions on resetting your password shortly.', {style: 'info'});\n } catch (e) {\n console.log('[AUTH] Unable to reset password', e);\n this.submitting = false;\n VerdocsToast('Unable to reset password. Please check your email address and try again.', {style: 'error'});\n }\n }\n\n render() {\n if (!this.visible) {\n return <div style={{display: 'none'}}>Authenticated</div>;\n }\n\n if (this.session) {\n return (\n <verdocs-button\n label=\"Sign Out\"\n disabled={this.submitting}\n onClick={() => this.handleLogout()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n );\n }\n\n if (this.displayMode === 'signup') {\n const invalid = this.submitting || !this.first_name || !this.last_name || !this.email || !this.password || !this.confirmpass || !this.org_name;\n\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Sign up for a free account</h3>\n <div class=\"already-have\">\n Already have an account?\n <verdocs-button label=\"Log In\" variant=\"text\" onClick={() => (this.displayMode = 'login')} disabled={this.submitting} />\n </div>\n\n <form onSubmit={() => this.handleSignup()}>\n <div style={{display: 'flex', flexDirection: 'row', columnGap: '20px'}}>\n <verdocs-text-input\n label=\"First Name\"\n autocomplete=\"first\"\n required={true}\n value={this.first_name}\n onInput={(e: any) => (this.first_name = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Last Name\"\n autocomplete=\"last\"\n required={true}\n value={this.last_name}\n onInput={(e: any) => (this.last_name = e.target.value)}\n disabled={this.submitting}\n />\n </div>\n <verdocs-text-input\n label=\"Email Address\"\n autocomplete=\"email\"\n required={true}\n value={this.email}\n onInput={(e: any) => (this.email = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n required={true}\n autocomplete=\"new-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Confirm Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.confirmpass}\n onInput={(e: any) => (this.confirmpass = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Phone Number\"\n type=\"tel\"\n required={true}\n autocomplete=\"phone\"\n value={this.phone}\n onInput={(e: any) => (this.phone = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Organization Name\"\n autocomplete=\"org\"\n required={true}\n value={this.org_name}\n onInput={(e: any) => (this.org_name = e.target.value)}\n disabled={this.submitting}\n style={{flex: '1'}}\n />\n\n <div class=\"service-agreement\">\n By clicking the Create Account button, you agree to the{' '}\n <a href=\"https://verdocs.com/eula\" target=\"_blank\">\n End User License Agreement\n </a>\n . Learn about how we use and protect your data and how you can opt-out in our{' '}\n <a href=\"https://verdocs.com/privacy-policy\" target=\"_blank\">\n Privacy Policy\n </a>\n .\n </div>\n\n <div style={{marginTop: '30px'}} />\n\n <verdocs-button\n label=\"Next\"\n disabled={invalid}\n onClick={invalid ? () => {} : () => this.handleSignup()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'verify') {\n return (\n <div class=\"form\">\n <form onSubmit={() => this.handleVerification()}>\n <p>Please check your e-mail inbox for a verification code and enter it below.</p>\n\n <verdocs-text-input\n label=\"Verification Code\"\n required={true}\n value={this.verificationCode}\n onInput={(e: any) => (this.verificationCode = e.target.value)}\n disabled={this.submitting}\n />\n\n <div class=\"buttons\">\n <verdocs-button label=\"Sign Out\" variant=\"outline\" disabled={this.submitting} onClick={() => this.handleLogout()} />\n <verdocs-button label=\"Verify\" disabled={this.submitting || !this.verificationCode || this.verificationCode.length !== 6} onClick={() => this.handleVerification()} />\n </div>\n <div class=\"buttons\">\n <verdocs-button variant=\"text\" label=\"Resend Code\" disabled={this.resendDisabled || this.submitting} onClick={() => this.handleResendVerification()} />\n </div>\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'forgot') {\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Forgot your password?</h3>\n\n <p>\n Enter your e-mail address below. If the e-mail address is valid, a password reset code will be sent to your inbox. Please allow up to 15 minutes to arrive, and check\n your spam folder if you do not receive the message.\n </p>\n\n <form onSubmit={() => this.handleResetGetCode()}>\n <verdocs-text-input\n label=\"Email Address\"\n autocomplete=\"email\"\n required={true}\n value={this.email}\n onInput={(e: any) => (this.email = e.target.value)}\n disabled={this.submitting}\n />\n\n <div style={{marginTop: '30px'}} />\n\n <div class=\"buttons\">\n <verdocs-button size=\"small\" label=\"Cancel\" variant=\"outline\" disabled={this.submitting} onClick={() => (this.displayMode = 'login')} />\n <verdocs-button size=\"small\" label=\"Request Code\" disabled={this.submitting} onClick={() => this.handleResetGetCode()} />\n </div>\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'reset') {\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Forgot your password?</h3>\n\n <p>\n Enter your e-mail address below, and reset instructions will be sent to your Inbox. Please allow up to 15 minutes to arrive. Check your spam folder if you do not\n receive the message.\n </p>\n\n <form onSubmit={() => this.handleResetPassword()}>\n <verdocs-text-input\n label=\"Verification Code\"\n required={true}\n value={this.verificationCode}\n onInput={(e: any) => (this.verificationCode = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.newPassword}\n onInput={(e: any) => (this.newPassword = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Confirm Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.confirmpass}\n onInput={(e: any) => (this.confirmpass = e.target.value)}\n disabled={this.submitting}\n />\n\n <div style={{marginTop: '30px'}} />\n\n <div class=\"buttons\">\n <verdocs-button label=\"Cancel\" variant=\"outline\" disabled={this.submitting} onClick={() => (this.displayMode = 'login')} />\n <verdocs-button label=\"Reset\" disabled={this.submitting} onClick={() => this.handleResetPassword()} />\n </div>\n\n <div class=\"buttons\">\n <verdocs-button variant=\"text\" label=\"Resend Code\" disabled={this.resendDisabled || this.submitting} onClick={() => this.handleResendReset()} />\n </div>\n </form>\n </div>\n );\n }\n\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Log in to your account</h3>\n <div class=\"already-have\">\n Don't have an account?\n <verdocs-button label=\"Sign Up\" variant=\"text\" onClick={() => (this.displayMode = 'signup')} disabled={this.submitting} />\n </div>\n\n <form onSubmit={() => this.loginAndCheckVerification()}>\n <verdocs-text-input label=\"Email\" autocomplete=\"username\" value={this.email} onInput={(e: any) => (this.email = e.target.value)} disabled={this.submitting} />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n autocomplete=\"current-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.submitting}\n />\n\n <verdocs-button\n label=\"Forgot Your Password?\"\n variant=\"text\"\n onClick={() => (this.displayMode = 'forgot')}\n disabled={this.submitting}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 20px'}}\n />\n\n <verdocs-button\n label=\"Login\"\n disabled={this.submitting}\n onClick={() => this.loginAndCheckVerification()}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 0'}}\n />\n </form>\n </div>\n );\n }\n}\n"],"mappings":"yaAAA,MAAMA,EAAiB,IAAM,wwD,MCoChBC,EAAWC,EAAA,MAAAD,UAAAE,EALxB,WAAAC,CAAAC,G,wHASUC,KAAAC,SAA4BC,EAAgBC,aAO5CH,KAAAI,QAAmB,KAOnBJ,KAAAK,KAAe,+CAKAL,KAAAM,YAAkE,QAehFN,KAAAO,SAAmB,GACnBP,KAAAQ,WAAqB,GACrBR,KAAAS,UAAoB,GACpBT,KAAAU,MAAgB,GAChBV,KAAAW,MAAgB,GAChBX,KAAAY,iBAA2B,GAC3BZ,KAAAa,YAAsB,GACtBb,KAAAc,SAAmB,GACnBd,KAAAe,YAAsB,GACtBf,KAAAgB,WAAsB,MACtBhB,KAAAiB,eAAiB,MACjBjB,KAAAkB,QAAoB,KACpBlB,KAAAmB,QAA2B,KAEpCnB,KAAAoB,oBAAsB,KAKtBpB,KAAAqB,iBAAmB,IAAInB,EAAgB,CACrCoB,QAASpB,EAAgBC,aAAaoB,aACtCC,QAAS,QA6BXxB,KAAAyB,iBAAmB,KACjBzB,KAAK0B,sBAAsB,CAwhB9B,CAnjBC,iBAAAC,GACE3B,KAAKC,SAAS2B,cACd5B,KAAK0B,uBAGL,UAAWG,SAAW,YAAa,CACjCA,OAAOC,iBAAiB,aAAc9B,KAAKyB,iB,CAG7CvB,EAAgBC,aAAa4B,kBAAiB,CAACC,EAAWd,EAASC,K,QACjEnB,KAAKkB,QAAUA,EACflB,KAAKmB,QAAUA,EACf,GAAID,EAAS,EACXe,EAAAjC,KAAKkC,iBAAa,MAAAD,SAAA,SAAAA,EAAEE,KAAK,CAACD,cAAe,KAAMhB,UAASC,W,KACnD,EACLiB,EAAApC,KAAKkC,iBAAa,MAAAE,SAAA,SAAAA,EAAED,KAAK,CAACD,cAAe,MAAOhB,UAASC,W,KAK/D,oBAAAkB,GACE,UAAWR,SAAW,YAAa,CACjCA,OAA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AUC,OAAQ,oBAG7DN,EAAA,kBACEE,MAAM,QACNC,SAAUxH,KAAKgB,WACfyG,QAAS,IAAMzH,KAAK+F,4BACpBtC,MAAO,CAAC6D,QAAS,OAAQI,eAAgB,SAAUC,OAAQ,kB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["verdocsAuthCss","VerdocsAuth","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","endpoint","VerdocsEndpoint","getDefault","visible","logo","displayMode","org_name","first_name","last_name","email","phone","verificationCode","newPassword","password","confirmpass","submitting","resendDisabled","session","profile","resendDisabledTimer","tempAuthEndpoint","baseURL","getBaseURL","persist","handleHashChange","applyHashDisplayMode","componentWillLoad","loadSession","window","addEventListener","onSessionChanged","_endpoint","_a","authenticated","emit","_b","disconnectedCallback","removeEventListener","hash","location","replace","toLowerCase","isPasswordComplex","isUppercase","ch","test","isLowercase","isSpecialChar","countOfUpperCase","countOfLowerCase","countOfSpecialChar","i","length","charAt","handleSignup","VerdocsToast","style","clearSession","formattedPhone","convertToE164","localeData","Intl","DateTimeFormat","resolvedOptions","createProfile","timezone","timeZone","locale","then","r","console","log","setToken","access_token","catch","e","response","sdkError","SDKError","message","_c","status","_d","data","_f","_e","error","handleVerification","verificationResult","verifyEmail","token","completeLogin","result","clearForms","loginAndCheckVerification","authResult","authenticate","username","trim","grant_type","user","getMyUser","email_verified","handleLogout","handleResendVerification","setTimeout","resendVerification","handleResendReset","resetPassword","handleResetGetCode","handleResetPassword","resetResult","code","new_password","handleReset","render","h","display","label","disabled","onClick","justifyContent","margin","invalid","class","href","src","alt","variant","onSubmit","flexDirection","columnGap","autocomplete","required","value","onInput","target","type","flex","marginTop","size"],"sources":["src/components/embeds/verdocs-auth/verdocs-auth.scss?tag=verdocs-auth","src/components/embeds/verdocs-auth/verdocs-auth.tsx"],"sourcesContent":["@import '../../../theme.scss';\n\nverdocs-auth {\n font-family: $verdocs-primary-font;\n display: flex;\n align-items: center;\n flex-direction: column;\n justify-content: center;\n\n .form {\n width: 350px;\n display: flex;\n padding: 20px;\n max-width: 90%;\n align-items: center;\n flex-direction: column;\n box-sizing: border-box;\n justify-content: center;\n background: $verdocs-grey-4;\n }\n\n .logo {\n width: 128px;\n max-width: 100%;\n margin: 20px 0 30px;\n }\n\n h3 {\n color: $verdocs-grey-0;\n text-align: center;\n font-weight: 400;\n font-size: 18px;\n line-height: 1.75;\n margin: 0;\n }\n\n em {\n font-size: 14px;\n margin: 15px 0;\n }\n\n .buttons {\n gap: 20px;\n margin: 20px 0 0 0;\n display: flex;\n flex-direction: row;\n justify-content: center;\n }\n\n .status-result {\n display: none;\n\n &.debug {\n white-space: pre-wrap;\n font-size: 14px;\n background: #fff;\n padding: 10px;\n display: block;\n flex-direction: row;\n justify-content: center;\n }\n }\n\n form {\n width: 100%;\n }\n\n verdocs-text-input {\n margin-bottom: 10px;\n }\n\n .account-option {\n gap: 8px;\n margin: 20px 0 8px 0;\n display: flex;\n flex-direction: row;\n }\n\n p {\n color: $verdocs-grey-0;\n margin: 1em 0;\n font-size: 14px;\n }\n\n // Our <p>s are in a flex layout which prevents margins from collapsing because each item creates its own row\n p + p {\n margin-top: 0;\n }\n\n verdocs-help-icon {\n margin-top: 18px;\n display: flex;\n width: 32px;\n height: 32px;\n flex: 0 0 32px;\n }\n\n .already-have {\n color: $verdocs-grey-0;\n margin: 0.5em 0;\n font-size: 14px;\n text-align: center;\n }\n\n .service-agreement {\n font-size: 12px;\n color: #777;\n\n a {\n color: $verdocs-grey-0;\n }\n }\n}\n","import {Component, Prop, State, h, Event, EventEmitter} from '@stencil/core';\nimport {verifyEmail, IAuthenticateResponse, getMyUser, IProfile, convertToE164} from '@verdocs/js-sdk';\nimport {TSession, VerdocsEndpoint, createProfile, authenticate, resendVerification, resetPassword} from '@verdocs/js-sdk';\nimport {VerdocsToast} from '../../../utils/Toast';\nimport {SDKError} from '../../../utils/errors';\n\nexport interface IAuthStatus {\n authenticated: boolean;\n session: TSession;\n profile: IProfile | null;\n}\n\n/**\n * Display an authentication dialog that allows the user to login or sign up. If the user is\n * already authenticated with a valid session, this component will hide itself and fire the\n * success callback immediately. It is up to the host application to render the next appropriate\n * view for the application.\n *\n * To simplify UI development, a visibility flag can force this component to never display. This\n * allows you to subscribe to notifications from client apps without calling the lower-level JS SDK.\n *\n * This embed is responsive / mobile-friendly, but the calling application should provide at\n * least a 300px wide container to allow sufficient space for the required forms.\n *\n * ```ts\n * <verdocs-auth\n * onAuthenticated={({ detail }) => console.log('Authentication state:', detail) }\n * onSdkError={({ detail }) => { console.log('SDK error', detail) }\n * />\n * ```\n */\n@Component({\n tag: 'verdocs-auth',\n styleUrl: 'verdocs-auth.scss',\n shadow: false,\n})\nexport class VerdocsAuth {\n /**\n * The endpoint to use to communicate with Verdocs. If not set, the default endpoint will be used.\n */\n @Prop() endpoint: VerdocsEndpoint = VerdocsEndpoint.getDefault();\n\n /**\n * Normally, if the user has a valid session, this embed will be invisible, otherwise it will display\n * login / signup forms. If this is set to false, this embed will be invisible in both cases. Apps may\n * use this to verify if a user has a valid session without needing a separate call to Verdocs JS SDK.\n */\n @Prop() visible: boolean = true;\n\n /**\n * By default, a Verdocs logo will be displayed above the login/signup forms. This may be used to\n * override its source. (Alternatively, you may simply hide it via CSS overrides.) Logos should be\n * in SVG format for best results.\n */\n @Prop() logo: string = 'https://app.verdocs.com/assets/blue-logo.svg';\n\n /**\n * The display mode to start in.\n */\n @Prop({mutable: true}) displayMode: 'login' | 'forgot' | 'reset' | 'signup' | 'verify' = 'login';\n\n /**\n * Event fired when session authentication process has completed. Check the event\n * contents for completion status. This event will always be called at least once,\n * when the component is first rendered.\n */\n @Event({composed: true}) authenticated: EventEmitter<IAuthStatus>;\n\n /**\n * Event fired if an error occurs. The event details will contain information about the error. Most errors will\n * terminate the process, and the calling application should correct the condition and re-render the component.\n */\n @Event({composed: true}) sdkError: EventEmitter<SDKError>;\n\n @State() org_name: string = '';\n @State() first_name: string = '';\n @State() last_name: string = '';\n @State() email: string = '';\n @State() phone: string = '';\n @State() verificationCode: string = '';\n @State() newPassword: string = '';\n @State() password: string = '';\n @State() confirmpass: string = '';\n @State() submitting: boolean = false;\n @State() resendDisabled = false;\n @State() session: TSession = null;\n @State() profile: IProfile | null = null;\n\n resendDisabledTimer = null;\n\n // We can't instantly log in on the default endpoint because other listeners might see\n // its events and incorrectly trigger before we're done. So we manage our own temp\n // endpoint and pass the final tokens to the default once we're ready.\n tempAuthEndpoint = new VerdocsEndpoint({\n baseURL: VerdocsEndpoint.getDefault().getBaseURL(),\n persist: false,\n });\n\n componentWillLoad() {\n this.endpoint.loadSession();\n this.applyHashDisplayMode();\n\n // We need to listen to the hashchange to know when we're being sent to #forgot\n if (typeof window !== 'undefined') {\n window.addEventListener('hashchange', this.handleHashChange);\n }\n\n VerdocsEndpoint.getDefault().onSessionChanged((_endpoint, session, profile) => {\n this.session = session;\n this.profile = profile;\n if (session) {\n this.authenticated?.emit({authenticated: true, session, profile});\n } else {\n this.authenticated?.emit({authenticated: false, session, profile});\n }\n });\n }\n\n disconnectedCallback() {\n if (typeof window !== 'undefined') {\n window.removeEventListener('hashchange', this.handleHashChange);\n }\n }\n\n handleHashChange = () => {\n this.applyHashDisplayMode();\n };\n\n applyHashDisplayMode() {\n if (typeof window === 'undefined') {\n return;\n }\n\n const hash = (window.location.hash || '').replace(/^#/, '').toLowerCase();\n if (hash === 'forgot') {\n this.displayMode = 'forgot';\n }\n }\n\n isPasswordComplex(password: string) {\n const isUppercase = (ch: string) => /[A-Z]/.test(ch);\n const isLowercase = (ch: string) => /[a-z]/.test(ch);\n const isSpecialChar = (ch: string) => /[`!@#$%^&*()_\\-+=\\[\\]{};':\"\\\\|,.<>\\/?~ ]/.test(ch);\n let countOfUpperCase = 0,\n countOfLowerCase = 0,\n countOfSpecialChar = 0;\n for (let i = 0; i < password.length; i++) {\n let ch = password.charAt(i);\n if (isUppercase(ch)) countOfUpperCase++;\n else if (isLowercase(ch)) countOfLowerCase++;\n else if (isSpecialChar(ch)) countOfSpecialChar++;\n }\n return password.length >= 8 && countOfLowerCase > 0 && countOfUpperCase > 0 && countOfSpecialChar > 0;\n }\n\n handleSignup() {\n if (!this.isPasswordComplex(this.password)) {\n VerdocsToast('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.', {style: 'error'});\n return;\n }\n\n if (this.password !== this.confirmpass) {\n VerdocsToast('Passwords do not match.', {style: 'error'});\n return;\n }\n\n this.submitting = true;\n this.tempAuthEndpoint.clearSession();\n const formattedPhone = convertToE164(this.phone);\n const localeData = Intl.DateTimeFormat().resolvedOptions();\n\n createProfile(this.tempAuthEndpoint, {\n email: this.email,\n password: this.password,\n first_name: this.first_name,\n last_name: this.last_name,\n org_name: this.org_name,\n phone: formattedPhone,\n timezone: localeData.timeZone,\n locale: localeData.locale,\n })\n .then(r => {\n console.log('[AUTH] Profile creation result', r);\n this.tempAuthEndpoint.setToken(r.access_token);\n // We can't clearForms because we need email to stick around\n this.password = '';\n this.phone = '';\n this.first_name = '';\n this.last_name = '';\n this.org_name = '';\n this.displayMode = 'verify';\n this.submitting = false;\n })\n .catch(e => {\n console.log('[AUTH] Signup error', e.response);\n this.submitting = false;\n this.authenticated?.emit({authenticated: false, profile: null, session: null});\n this.sdkError?.emit(new SDKError(e.message, e.response?.status, e.response?.data));\n\n VerdocsToast('Signup failed: ' + e.response?.data?.error || 'Unknown Error', {style: 'error'});\n });\n }\n\n async handleVerification() {\n this.submitting = true;\n\n try {\n this.submitting = false;\n const verificationResult = await verifyEmail(this.tempAuthEndpoint, {email: this.email, token: this.verificationCode});\n VerdocsToast('Thank you for verifying your email address.', {style: 'success'});\n this.completeLogin(verificationResult);\n } catch (e) {\n this.submitting = false;\n console.log('Verification error', e);\n VerdocsToast('Verification error, please check the code and try again.');\n }\n }\n\n completeLogin(result: IAuthenticateResponse) {\n this.clearForms();\n this.tempAuthEndpoint.clearSession();\n this.endpoint.setToken(result.access_token);\n }\n\n async loginAndCheckVerification() {\n if (this.submitting) {\n return;\n }\n\n this.submitting = true;\n this.tempAuthEndpoint.clearSession();\n\n try {\n this.submitting = false;\n const authResult = await authenticate(this.tempAuthEndpoint, {username: this.email.trim(), password: this.password, grant_type: 'password'});\n console.log('[AUTH] Authenticated, checking email verification');\n this.tempAuthEndpoint.setToken(authResult.access_token);\n\n const user = await getMyUser(this.tempAuthEndpoint);\n\n if (!user.email_verified) {\n console.log('[AUTH] Logged in, pending email address verification');\n this.displayMode = 'verify';\n } else {\n console.log('[AUTH] Email address is verified, completing login');\n this.completeLogin(authResult);\n }\n } catch (e) {\n this.submitting = false;\n console.log('[AUTH] Auth failure', e.response?.data || e);\n VerdocsToast('Login failed. Please check your credentials and try again.', {style: 'error'});\n }\n }\n\n clearForms() {\n this.submitting = false;\n this.resendDisabled = false;\n this.email = '';\n this.phone = '';\n this.password = '';\n this.newPassword = '';\n this.confirmpass = '';\n this.verificationCode = '';\n this.first_name = '';\n this.last_name = '';\n this.org_name = '';\n }\n\n handleLogout() {\n console.log('logging out');\n this.endpoint.clearSession();\n this.tempAuthEndpoint.clearSession();\n this.clearForms();\n this.displayMode = 'login';\n }\n\n handleResendVerification() {\n // Avoid the user just click-spamming this pathway. The server rate-limits this anyway so it's not a\n // security issue but it's a poor user experience to allow it.\n this.resendDisabled = true;\n this.resendDisabledTimer = setTimeout(() => {\n this.resendDisabled = false;\n this.resendDisabledTimer = null;\n }, 30000);\n\n resendVerification(this.tempAuthEndpoint)\n .then(r => {\n console.log('[AUTH] Verification request resent', r);\n VerdocsToast('Please check your email for a verification code.', {style: 'info'});\n })\n .catch((e: any) => {\n console.log('[AUTH] Unable to resend verification', e);\n VerdocsToast('Unable to resend code. Please try again later.', {style: 'error'});\n });\n }\n\n handleResendReset() {\n // Avoid the user just click-spamming this pathway. The server rate-limits this anyway so it's not a\n // security issue but it's a poor user experience to allow it.\n this.resendDisabled = true;\n this.resendDisabledTimer = setTimeout(() => {\n this.resendDisabled = false;\n this.resendDisabledTimer = null;\n }, 30000);\n\n resetPassword(this.tempAuthEndpoint, {email: this.email})\n .then(r => {\n console.log('[AUTH] Resend-code request resent', r);\n VerdocsToast('Please check your email again for a verification code.', {style: 'info'});\n })\n .catch((e: any) => {\n console.log('[AUTH] Unable to resend reset request', e);\n VerdocsToast('Unable to resend code. Please try again later.', {style: 'error'});\n });\n }\n\n async handleResetGetCode() {\n this.submitting = true;\n this.confirmpass = '';\n this.newPassword = '';\n\n try {\n this.submitting = false;\n const result = await resetPassword(this.endpoint, {email: this.email});\n console.log('[AUTH] Reset result', result);\n VerdocsToast('Please check your email inbox for a password reset code.', {style: 'success'});\n this.verificationCode = '';\n this.confirmpass = '';\n this.newPassword = '';\n this.displayMode = 'reset';\n } catch (e) {\n this.submitting = false;\n console.log('Reset request error', e);\n VerdocsToast('Request failed. Please check your email address and try again.');\n }\n }\n\n async handleResetPassword() {\n if (!this.isPasswordComplex(this.newPassword)) {\n VerdocsToast('Password must be at least 8 characters long and contain at least one uppercase, one lowercase, and one special character.', {style: 'error'});\n return;\n }\n\n if (this.newPassword !== this.confirmpass) {\n VerdocsToast('Passwords do not match.', {style: 'error'});\n return;\n }\n\n this.submitting = true;\n try {\n this.submitting = false;\n const resetResult = await resetPassword(this.endpoint, {email: this.email, code: this.verificationCode, new_password: this.newPassword});\n console.log('reset result', resetResult);\n VerdocsToast('Your password has been reset. You may now use your new password to login.', {style: 'success'});\n this.verificationCode = '';\n this.confirmpass = '';\n this.newPassword = '';\n this.password = '';\n this.displayMode = 'login';\n } catch (e) {\n this.submitting = false;\n console.log('Verification error', e);\n VerdocsToast('Verification error, please check the code and try again.');\n }\n }\n\n async handleReset() {\n this.submitting = true;\n\n try {\n const result = await resetPassword(this.endpoint, {email: this.email});\n console.log('[AUTH] Reset sent', result);\n this.submitting = false;\n this.displayMode = 'login';\n VerdocsToast('If your email address is registered, you will receive instructions on resetting your password shortly.', {style: 'info'});\n } catch (e) {\n console.log('[AUTH] Unable to reset password', e);\n this.submitting = false;\n VerdocsToast('Unable to reset password. Please check your email address and try again.', {style: 'error'});\n }\n }\n\n render() {\n if (!this.visible) {\n return <div style={{display: 'none'}}>Authenticated</div>;\n }\n\n if (this.session) {\n return (\n <verdocs-button\n label=\"Sign Out\"\n disabled={this.submitting}\n onClick={() => this.handleLogout()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n );\n }\n\n if (this.displayMode === 'signup') {\n const invalid = this.submitting || !this.first_name || !this.last_name || !this.email || !this.password || !this.confirmpass || !this.org_name;\n\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Sign up for a free account</h3>\n <div class=\"already-have\">\n Already have an account?\n <verdocs-button label=\"Log In\" variant=\"text\" onClick={() => (this.displayMode = 'login')} disabled={this.submitting} />\n </div>\n\n <form onSubmit={() => this.handleSignup()}>\n <div style={{display: 'flex', flexDirection: 'row', columnGap: '20px'}}>\n <verdocs-text-input\n label=\"First Name\"\n autocomplete=\"first\"\n required={true}\n value={this.first_name}\n onInput={(e: any) => (this.first_name = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Last Name\"\n autocomplete=\"last\"\n required={true}\n value={this.last_name}\n onInput={(e: any) => (this.last_name = e.target.value)}\n disabled={this.submitting}\n />\n </div>\n <verdocs-text-input\n label=\"Email Address\"\n autocomplete=\"email\"\n required={true}\n value={this.email}\n onInput={(e: any) => (this.email = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n required={true}\n autocomplete=\"new-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Confirm Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.confirmpass}\n onInput={(e: any) => (this.confirmpass = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Phone Number\"\n type=\"tel\"\n required={true}\n autocomplete=\"phone\"\n value={this.phone}\n onInput={(e: any) => (this.phone = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Organization Name\"\n autocomplete=\"org\"\n required={true}\n value={this.org_name}\n onInput={(e: any) => (this.org_name = e.target.value)}\n disabled={this.submitting}\n style={{flex: '1'}}\n />\n\n <div class=\"service-agreement\">\n By clicking the Create Account button, you agree to the{' '}\n <a href=\"https://verdocs.com/eula\" target=\"_blank\">\n End User License Agreement\n </a>\n . Learn about how we use and protect your data and how you can opt-out in our{' '}\n <a href=\"https://verdocs.com/privacy-policy\" target=\"_blank\">\n Privacy Policy\n </a>\n .\n </div>\n\n <div style={{marginTop: '30px'}} />\n\n <verdocs-button\n label=\"Next\"\n disabled={invalid}\n onClick={invalid ? () => {} : () => this.handleSignup()}\n style={{display: 'flex', justifyContent: 'center', margin: '30px auto 0'}}\n />\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'verify') {\n return (\n <div class=\"form\">\n <form onSubmit={() => this.handleVerification()}>\n <p>Please check your e-mail inbox for a verification code and enter it below.</p>\n\n <verdocs-text-input\n label=\"Verification Code\"\n required={true}\n value={this.verificationCode}\n onInput={(e: any) => (this.verificationCode = e.target.value)}\n disabled={this.submitting}\n />\n\n <div class=\"buttons\">\n <verdocs-button label=\"Sign Out\" variant=\"outline\" disabled={this.submitting} onClick={() => this.handleLogout()} />\n <verdocs-button label=\"Verify\" disabled={this.submitting || !this.verificationCode || this.verificationCode.length !== 6} onClick={() => this.handleVerification()} />\n </div>\n <div class=\"buttons\">\n <verdocs-button variant=\"text\" label=\"Resend Code\" disabled={this.resendDisabled || this.submitting} onClick={() => this.handleResendVerification()} />\n </div>\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'forgot') {\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Forgot your password?</h3>\n\n <p>\n Enter your e-mail address below. If the e-mail address is valid, a password reset code will be sent to your inbox. Please allow up to 15 minutes to arrive, and check\n your spam folder if you do not receive the message.\n </p>\n\n <form onSubmit={() => this.handleResetGetCode()}>\n <verdocs-text-input\n label=\"Email Address\"\n autocomplete=\"email\"\n required={true}\n value={this.email}\n onInput={(e: any) => (this.email = e.target.value)}\n disabled={this.submitting}\n />\n\n <div style={{marginTop: '30px'}} />\n\n <div class=\"buttons\">\n <verdocs-button size=\"small\" label=\"Cancel\" variant=\"outline\" disabled={this.submitting} onClick={() => (this.displayMode = 'login')} />\n <verdocs-button size=\"small\" label=\"Request Code\" disabled={this.submitting} onClick={() => this.handleResetGetCode()} />\n </div>\n </form>\n </div>\n );\n }\n\n if (this.displayMode === 'reset') {\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Forgot your password?</h3>\n\n <p>\n Enter your e-mail address below, and reset instructions will be sent to your Inbox. Please allow up to 15 minutes to arrive. Check your spam folder if you do not\n receive the message.\n </p>\n\n <form onSubmit={() => this.handleResetPassword()}>\n <verdocs-text-input\n label=\"Verification Code\"\n required={true}\n value={this.verificationCode}\n onInput={(e: any) => (this.verificationCode = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.newPassword}\n onInput={(e: any) => (this.newPassword = e.target.value)}\n disabled={this.submitting}\n />\n <verdocs-text-input\n label=\"Confirm Password\"\n type=\"password\"\n required={true}\n autocomplete=\"off\"\n value={this.confirmpass}\n onInput={(e: any) => (this.confirmpass = e.target.value)}\n disabled={this.submitting}\n />\n\n <div style={{marginTop: '30px'}} />\n\n <div class=\"buttons\">\n <verdocs-button label=\"Cancel\" variant=\"outline\" disabled={this.submitting} onClick={() => (this.displayMode = 'login')} />\n <verdocs-button label=\"Reset\" disabled={this.submitting} onClick={() => this.handleResetPassword()} />\n </div>\n\n <div class=\"buttons\">\n <verdocs-button variant=\"text\" label=\"Resend Code\" disabled={this.resendDisabled || this.submitting} onClick={() => this.handleResendReset()} />\n </div>\n </form>\n </div>\n );\n }\n\n return (\n <div class=\"form\">\n <a href=\"https://verdocs.com/en/\">\n <img src={this.logo} alt=\"Verdocs Logo\" class=\"logo\" />\n </a>\n\n <h3>Log in to your account</h3>\n <div class=\"already-have\">\n Don't have an account?\n <verdocs-button label=\"Sign Up\" variant=\"text\" onClick={() => (this.displayMode = 'signup')} disabled={this.submitting} />\n </div>\n\n <form onSubmit={() => this.loginAndCheckVerification()}>\n <verdocs-text-input label=\"Email\" autocomplete=\"username\" value={this.email} onInput={(e: any) => (this.email = e.target.value)} disabled={this.submitting} />\n <verdocs-text-input\n label=\"Password\"\n type=\"password\"\n autocomplete=\"current-password\"\n value={this.password}\n onInput={(e: any) => (this.password = e.target.value)}\n disabled={this.submitting}\n />\n\n <verdocs-button\n label=\"Forgot Your Password?\"\n variant=\"text\"\n onClick={() => (this.displayMode = 'forgot')}\n disabled={this.submitting}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 20px'}}\n />\n\n <verdocs-button\n label=\"Login\"\n disabled={this.submitting}\n onClick={() => this.loginAndCheckVerification()}\n style={{display: 'flex', justifyContent: 'center', margin: '10px auto 0'}}\n />\n </form>\n </div>\n );\n }\n}\n"],"mappings":"yaAAA,MAAMA,EAAiB,IAAM,wwD,MCoChBC,EAAWC,EAAA,MAAAD,UAAAE,EALxB,WAAAC,CAAAC,G,wHASUC,KAAAC,SAA4BC,EAAgBC,aAO5CH,KAAAI,QAAmB,KAOnBJ,KAAAK,KAAe,+CAKAL,KAAAM,YAAkE,QAehFN,KAAAO,SAAmB,GACnBP,KAAAQ,WAAqB,GACrBR,KAAAS,UAAoB,GACpBT,KAAAU,MAAgB,GAChBV,KAAAW,MAAgB,GAChBX,KAAAY,iBAA2B,GAC3BZ,KAAAa,YAAsB,GACtBb,KAAAc,SAAmB,GACnBd,KAAAe,YAAsB,GACtBf,KAAAgB,WAAsB,MACtBh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KAAK,2BACNT,EAAA,OAAKU,IAAK/H,KAAKK,KAAM2H,IAAI,eAAeH,MAAM,UAGhDR,EAAA,oCACAA,EAAA,OAAKQ,MAAM,gBAAc,yBAEvBR,EAAA,kBAAgBE,MAAM,UAAUU,QAAQ,OAAOR,QAAS,IAAOzH,KAAKM,YAAc,SAAWkH,SAAUxH,KAAKgB,cAG9GqG,EAAA,QAAMa,SAAU,IAAMlI,KAAK+F,6BACzBsB,EAAA,sBAAoBE,MAAM,QAAQc,aAAa,WAAWE,MAAOvI,KAAKU,MAAO8H,QAAU5D,GAAY5E,KAAKU,MAAQkE,EAAE6D,OAAOF,MAAQf,SAAUxH,KAAKgB,aAChJqG,EAAA,sBACEE,MAAM,WACNmB,KAAK,WACLL,aAAa,mBACbE,MAAOvI,KAAKc,SACZ0H,QAAU5D,GAAY5E,KAAKc,SAAW8D,EAAE6D,OAAOF,MAC/Cf,SAAUxH,KAAKgB,aAGjBqG,EAAA,kBACEE,MAAM,wBACNU,QAAQ,OACRR,QAAS,IAAOzH,KAAKM,YAAc,SACnCkH,SAAUxH,KAAKgB,WACfyC,MAAO,CAAC6D,QAAS,OAAQI,eAAgB,SAAUC,OAAQ,oBAG7DN,EAAA,kBACEE,MAAM,QACNC,SAAUxH,KAAKgB,WACfyG,QAAS,IAAMzH,KAAK+F,4BACpBtC,MAAO,CAAC6D,QAAS,OAAQI,eAAgB,SAAUC,OAAQ,kB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as o,d as r,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as d,getTemplate as a}from"@verdocs/js-sdk";import{S as l}from"./p-C1sRVZWv.js";import{S as c}from"./p-C7hFgM52.js";import{d as n}from"./p-Bdf8pPWm.js";import{d as m}from"./p-REnrt0JM.js";import{d as p}from"./p-CyDWJAOZ.js";import{d as f}from"./p-DeQsR41s.js";import{d as v}from"./p-DT0LGcPi.js";import{d as h}from"./p-DSK9z7EN.js";import{d as u}from"./p-BasWFMeN.js";import{d as b}from"./p-DwPH0TQ4.js";import{d as x}from"./p-BwEGkh_6.js";import{d as k}from"./p-DXLcCG08.js";import{d as w}from"./p-B845hxhl.js";import{d as E}from"./p-5E7bNT3k.js";import{d as g}from"./p-Cfiprngx.js";import{d as j}from"./p-pyA5cdVX.js";import{d as y}from"./p-DhO1wfh-.js";import{d as D}from"./p-CLxwSMOV.js";import{d as B}from"./p-wUsR0Dpa.js";import{d as I}from"./p-CioaaWeS.js";import{d as C}from"./p-B-_kYJtC.js";import{d as U}from"./p-BhtYCb5T.js";import{d as T}from"./p-BwUTiBud.js";import{d as L}from"./p-DQTI8vRX.js";import{d as S}from"./p-BcQsqsDy.js";import{d as N}from"./p-2bW-AL6b.js";import{d as R}from"./p-BXGNkmyr.js";import{d as A}from"./p-DGws2Zgt.js";import{d as G}from"./p-BXQO5Vza.js";import{d as Q}from"./p-sPseFic3.js";import{d as W}from"./p-Dm9oOnhq.js";import{d as O}from"./p-DRgoGiAA.js";import{d as M}from"./p-D3ohABOv.js";import{d as V}from"./p-db6IAGB0.js";import{d as X}from"./p-BfKv6ivN.js";import{d as Y}from"./p-qDQgyl7L.js";import{d as z}from"./p-DYtSnUj9.js";import{d as P}from"./p-Bxmki12o.js";import{d as Z}from"./p-CQUV5gMT.js";const q=()=>`verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{display:block;width:500px;max-width:95%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157);box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157)}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}`;const F=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.cancel=t(this,"cancel");this.sdkError=t(this,"sdkError");this.stepChanged=t(this,"stepChanged");this.send=t(this,"send");this.templateUpdated=t(this,"templateUpdated");this.templateCreated=t(this,"templateCreated");this.rolesUpdated=t(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=d.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}onTemplateIdChanged(e,s){if(!s&&e&&this.step==="attachments"){this.step="preview"}this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(){this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,s,t,o,r,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return}if(!this.templateId){console.log(`[BUILD] No template ID, activating upload mode`);this.step="attachments";this.loading=false;return}try{this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(o.message,(s=o.response)===null||s===void 0?void 0:s.status,(t=o.response)===null||t===void 0?void 0:t.data))}}catch(e){console.log("[BUILD] Error with builder session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new l(e.message,(r=e.response)===null||r===void 0?void 0:r.status,(i=e.response)===null||i===void 0?void 0:i.data))}}async loadTemplate(e){if(e){c.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}}disconnectedCallback(){console.log("[BUILD] Disconnected");this.unlistenToTemplate()}unlistenToTemplate(){if(this.templateListenerId){c.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(){var e;this.step="preview";(e=this.cancel)===null||e===void 0?void 0:e.emit()}async handleTemplateCreated(e){var s;await this.loadTemplate(e);this.templateId=e;this.step="roles";(s=this.stepChanged)===null||s===void 0?void 0:s.emit("roles")}async handleRolesUpdated(e){var s;console.log("[BUILD] Roloes updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}async handleTemplateUpdated(e){var s;console.log("[BUILD] Template updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")}handleRolesNext(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")}handleStepChanged(e){var s;this.step=e;(s=this.stepChanged)===null||s===void 0?void 0:s.emit(e)}render(){if(this.loading){return o(r,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(r,null,o("div",{class:"content"},o("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var s;return(s=this.sdkError)===null||s===void 0?void 0:s.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),this.step==="attachments"&&o("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="roles"&&o("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),this.step==="fields"&&o("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="preview"&&o("div",{class:"preview-container"},o("div",{class:"preview-send-wrapper"},o("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var s;return(s=this.send)===null||s===void 0?void 0:s.emit(e.detail)},style:{width:"100%"}})),o("div",{class:"preview-preview-wrapper"},o("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))}get el(){return this}static get watchers(){return{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}}static get style(){return q()}},[0,"verdocs-build",{endpoint:[16],templateId:[1537,"template-id"],step:[1537],loading:[32],template:[32]},undefined,{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}]);function J(){if(typeof customElements==="undefined"){return}const e=["verdocs-build","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-file-chooser","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-menu-panel","verdocs-ok-dialog","verdocs-portal","verdocs-preview","verdocs-progress-bar","verdocs-select-input","verdocs-send","verdocs-spinner","verdocs-template-attachments","verdocs-template-build-tabs","verdocs-template-document-page","verdocs-template-field-properties","verdocs-template-fields","verdocs-template-role-properties","verdocs-template-roles","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-build":if(!customElements.get(i(e))){customElements.define(i(e),F)}break;case"verdocs-button":if(!customElements.get(i(e))){n()}break;case"verdocs-checkbox":if(!customElements.get(i(e))){m()}break;case"verdocs-component-error":if(!customElements.get(i(e))){p()}break;case"verdocs-contact-picker":if(!customElements.get(i(e))){f()}break;case"verdocs-dialog":if(!customElements.get(i(e))){v()}break;case"verdocs-field-attachment":if(!customElements.get(i(e))){h()}break;case"verdocs-field-checkbox":if(!customElements.get(i(e))){u()}break;case"verdocs-field-date":if(!customElements.get(i(e))){b()}break;case"verdocs-field-dropdown":if(!customElements.get(i(e))){x()}break;case"verdocs-field-initial":if(!customElements.get(i(e))){k()}break;case"verdocs-field-radio":if(!customElements.get(i(e))){w()}break;case"verdocs-field-signature":if(!customElements.get(i(e))){E()}break;case"verdocs-field-textarea":if(!customElements.get(i(e))){g()}break;case"verdocs-field-textbox":if(!customElements.get(i(e))){j()}break;case"verdocs-field-timestamp":if(!customElements.get(i(e))){y()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){D()}break;case"verdocs-flag":if(!customElements.get(i(e))){B()}break;case"verdocs-help-icon":if(!customElements.get(i(e))){I()}break;case"verdocs-loader":if(!customElements.get(i(e))){C()}break;case"verdocs-menu-panel":if(!customElements.get(i(e))){U()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){T()}break;case"verdocs-portal":if(!customElements.get(i(e))){L()}break;case"verdocs-preview":if(!customElements.get(i(e))){S()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){N()}break;case"verdocs-select-input":if(!customElements.get(i(e))){R()}break;case"verdocs-send":if(!customElements.get(i(e))){A()}break;case"verdocs-spinner":if(!customElements.get(i(e))){G()}break;case"verdocs-template-attachments":if(!customElements.get(i(e))){Q()}break;case"verdocs-template-build-tabs":if(!customElements.get(i(e))){W()}break;case"verdocs-template-document-page":if(!customElements.get(i(e))){O()}break;case"verdocs-template-field-properties":if(!customElements.get(i(e))){M()}break;case"verdocs-template-fields":if(!customElements.get(i(e))){V()}break;case"verdocs-template-role-properties":if(!customElements.get(i(e))){X()}break;case"verdocs-template-roles":if(!customElements.get(i(e))){Y()}break;case"verdocs-text-input":if(!customElements.get(i(e))){z()}break;case"verdocs-toolbar-icon":if(!customElements.get(i(e))){P()}break;case"verdocs-upload-dialog":if(!customElements.get(i(e))){Z()}break}}))}const K=F;const _=J;export{K as VerdocsBuild,_ as defineCustomElement};
|
|
1
|
+
import{p as e,H as s,c as t,h as o,d as r,t as i}from"./p-yZBlG3YQ.js";import{VerdocsEndpoint as d,getTemplate as a}from"@verdocs/js-sdk";import{S as l}from"./p-C1sRVZWv.js";import{S as c}from"./p-C7hFgM52.js";import{d as n}from"./p-Bdf8pPWm.js";import{d as m}from"./p-REnrt0JM.js";import{d as p}from"./p-CyDWJAOZ.js";import{d as f}from"./p-CPYFXW2q.js";import{d as v}from"./p-DT0LGcPi.js";import{d as h}from"./p-BT8wzCXz.js";import{d as u}from"./p-BasWFMeN.js";import{d as b}from"./p-DwPH0TQ4.js";import{d as x}from"./p-BwEGkh_6.js";import{d as k}from"./p-DXLcCG08.js";import{d as w}from"./p-B845hxhl.js";import{d as E}from"./p-5E7bNT3k.js";import{d as g}from"./p-Cfiprngx.js";import{d as j}from"./p-pyA5cdVX.js";import{d as y}from"./p-DhO1wfh-.js";import{d as C}from"./p-CLxwSMOV.js";import{d as D}from"./p-wUsR0Dpa.js";import{d as I}from"./p-CioaaWeS.js";import{d as U}from"./p-B-_kYJtC.js";import{d as B}from"./p-BhtYCb5T.js";import{d as T}from"./p-D3qUITiS.js";import{d as L}from"./p-DQTI8vRX.js";import{d as S}from"./p-DjOTs59Z.js";import{d as N}from"./p-2bW-AL6b.js";import{d as W}from"./p-BXGNkmyr.js";import{d as O}from"./p-CnoHN1S8.js";import{d as R}from"./p-BXQO5Vza.js";import{d as X}from"./p-CFEw4Xbi.js";import{d as Y}from"./p-Dm9oOnhq.js";import{d as G}from"./p-DVGumEtx.js";import{d as V}from"./p-D3ohABOv.js";import{d as z}from"./p-Yxa93LOl.js";import{d as A}from"./p-Dtndevf4.js";import{d as M}from"./p-CDMCVJys.js";import{d as F}from"./p-DYtSnUj9.js";import{d as J}from"./p-Bxmki12o.js";import{d as P}from"./p-u16vefxk.js";const Q=()=>`verdocs-build{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-family:var(--verdocs-primary-font, "Inter", "Barlow", sans-serif)}verdocs-build .content{-ms-flex:1;flex:1;gap:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column}verdocs-build verdocs-template-attachments,verdocs-build verdocs-template-roles{display:block;width:500px;max-width:95%;-webkit-box-sizing:border-box;box-sizing:border-box;margin:20px}verdocs-build verdocs-template-fields{border-top:1px solid #777777}verdocs-build verdocs-template-attachments{padding:20px;background:#ffffff}verdocs-build verdocs-template-fields{width:100%}verdocs-build verdocs-preview{-ms-flex:1;flex:1}verdocs-build .preview-container{-ms-flex-direction:row;flex-direction:row;display:-ms-flexbox;display:flex;width:100%;background-color:#eeeeee;max-height:100%}@media all and (max-width: 450px){verdocs-build .preview-container{-ms-flex-direction:column;flex-direction:column}}verdocs-build .preview-send-wrapper{display:-ms-flexbox;display:flex;-ms-flex:0 0 300px;flex:0 0 300px;background-color:#ffffff;-webkit-box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157);box-shadow:1px 1px 6px -2px rgba(0, 0, 0, 0.4980392157)}@media all and (max-width: 450px){verdocs-build .preview-send-wrapper{-ms-flex:0;flex:0}}verdocs-build .preview-preview-wrapper{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;overflow-y:scroll}`;const Z=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.cancel=t(this,"cancel");this.sdkError=t(this,"sdkError");this.stepChanged=t(this,"stepChanged");this.send=t(this,"send");this.templateUpdated=t(this,"templateUpdated");this.templateCreated=t(this,"templateCreated");this.rolesUpdated=t(this,"rolesUpdated");this.templateListenerId=null;this.endpoint=d.getDefault();this.templateId=null;this.step="preview";this.loading=true;this.template=null}onTemplateIdChanged(e,s){if(!s&&e&&this.step==="attachments"){this.step="preview"}this.loadTemplate(e).catch((e=>console.log("Unknown Error",e)))}onStepChanged(){this.loadTemplate(this.templateId).catch((e=>console.log("Unknown Error",e)))}async componentWillLoad(){var e,s,t,o,r,i;try{this.endpoint.loadSession();if(!this.endpoint.session){console.log("[BUILD] Unable to start builder session, must be authenticated");return}if(!this.templateId){console.log(`[BUILD] No template ID, activating upload mode`);this.step="attachments";this.loading=false;return}try{this.loadTemplate(this.templateId).catch((e=>console.log("[BUILD] Unable to load template",e)))}catch(o){console.log("[BUILD] Error loading template",o);(e=this.sdkError)===null||e===void 0?void 0:e.emit(new l(o.message,(s=o.response)===null||s===void 0?void 0:s.status,(t=o.response)===null||t===void 0?void 0:t.data))}}catch(e){console.log("[BUILD] Error with builder session",e);(o=this.sdkError)===null||o===void 0?void 0:o.emit(new l(e.message,(r=e.response)===null||r===void 0?void 0:r.status,(i=e.response)===null||i===void 0?void 0:i.data))}}async loadTemplate(e){if(e){c.subscribe("templates",this.templateId,(()=>a(this.endpoint,this.templateId)),false,(e=>{this.template=e;this.loading=false}))}}disconnectedCallback(){console.log("[BUILD] Disconnected");this.unlistenToTemplate()}unlistenToTemplate(){if(this.templateListenerId){c.store.delListener(this.templateListenerId);this.templateListenerId=null}}handleCancel(){var e;this.step="preview";(e=this.cancel)===null||e===void 0?void 0:e.emit()}async handleTemplateCreated(e){var s;await this.loadTemplate(e);this.templateId=e;this.step="roles";(s=this.stepChanged)===null||s===void 0?void 0:s.emit("roles")}async handleRolesUpdated(e){var s;console.log("[BUILD] Roloes updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}async handleTemplateUpdated(e){var s;console.log("[BUILD] Template updated",e);(s=this.templateUpdated)===null||s===void 0?void 0:s.emit(e.detail)}handleAttachmentsNext(){var e;this.step="roles";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("roles")}handleRolesNext(){var e;this.step="fields";(e=this.stepChanged)===null||e===void 0?void 0:e.emit("fields")}handleStepChanged(e){var s;this.step=e;(s=this.stepChanged)===null||s===void 0?void 0:s.emit(e)}render(){if(this.loading){return o(r,{class:"loading"},o("verdocs-loader",null))}if(!this.endpoint.session){return o(r,null,o("verdocs-component-error",{message:"You must be authenticated to use this module."}))}return o(r,null,o("div",{class:"content"},o("verdocs-template-build-tabs",{endpoint:this.endpoint,templateId:this.templateId,step:this.step,onSdkError:e=>{var s;return(s=this.sdkError)===null||s===void 0?void 0:s.emit(e.detail)},onStepChanged:e=>this.handleStepChanged(e.detail)}),this.step==="attachments"&&o("verdocs-template-attachments",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleAttachmentsNext(),onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="roles"&&o("verdocs-template-roles",{templateId:this.templateId,endpoint:this.endpoint,onExit:()=>this.handleCancel(),onNext:()=>this.handleRolesNext(),onRolesUpdated:e=>this.handleRolesUpdated(e)}),this.step==="fields"&&o("verdocs-template-fields",{templateId:this.templateId,endpoint:this.endpoint,onTemplateUpdated:e=>this.handleTemplateUpdated(e)}),this.step==="preview"&&o("div",{class:"preview-container"},o("div",{class:"preview-send-wrapper"},o("verdocs-send",{templateId:this.templateId,endpoint:this.endpoint,onSend:e=>{var s;return(s=this.send)===null||s===void 0?void 0:s.emit(e.detail)},style:{width:"100%"}})),o("div",{class:"preview-preview-wrapper"},o("verdocs-preview",{templateId:this.templateId,endpoint:this.endpoint,style:{display:"flex",flex:"1",maxWidth:"1000px"}})))))}get el(){return this}static get watchers(){return{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}}static get style(){return Q()}},[0,"verdocs-build",{endpoint:[16],templateId:[1537,"template-id"],step:[1537],loading:[32],template:[32]},undefined,{templateId:[{onTemplateIdChanged:0}],step:[{onStepChanged:0}]}]);function q(){if(typeof customElements==="undefined"){return}const e=["verdocs-build","verdocs-button","verdocs-checkbox","verdocs-component-error","verdocs-contact-picker","verdocs-dialog","verdocs-field-attachment","verdocs-field-checkbox","verdocs-field-date","verdocs-field-dropdown","verdocs-field-initial","verdocs-field-radio","verdocs-field-signature","verdocs-field-textarea","verdocs-field-textbox","verdocs-field-timestamp","verdocs-file-chooser","verdocs-flag","verdocs-help-icon","verdocs-loader","verdocs-menu-panel","verdocs-ok-dialog","verdocs-portal","verdocs-preview","verdocs-progress-bar","verdocs-select-input","verdocs-send","verdocs-spinner","verdocs-template-attachments","verdocs-template-build-tabs","verdocs-template-document-page","verdocs-template-field-properties","verdocs-template-fields","verdocs-template-role-properties","verdocs-template-roles","verdocs-text-input","verdocs-toolbar-icon","verdocs-upload-dialog"];e.forEach((e=>{switch(e){case"verdocs-build":if(!customElements.get(i(e))){customElements.define(i(e),Z)}break;case"verdocs-button":if(!customElements.get(i(e))){n()}break;case"verdocs-checkbox":if(!customElements.get(i(e))){m()}break;case"verdocs-component-error":if(!customElements.get(i(e))){p()}break;case"verdocs-contact-picker":if(!customElements.get(i(e))){f()}break;case"verdocs-dialog":if(!customElements.get(i(e))){v()}break;case"verdocs-field-attachment":if(!customElements.get(i(e))){h()}break;case"verdocs-field-checkbox":if(!customElements.get(i(e))){u()}break;case"verdocs-field-date":if(!customElements.get(i(e))){b()}break;case"verdocs-field-dropdown":if(!customElements.get(i(e))){x()}break;case"verdocs-field-initial":if(!customElements.get(i(e))){k()}break;case"verdocs-field-radio":if(!customElements.get(i(e))){w()}break;case"verdocs-field-signature":if(!customElements.get(i(e))){E()}break;case"verdocs-field-textarea":if(!customElements.get(i(e))){g()}break;case"verdocs-field-textbox":if(!customElements.get(i(e))){j()}break;case"verdocs-field-timestamp":if(!customElements.get(i(e))){y()}break;case"verdocs-file-chooser":if(!customElements.get(i(e))){C()}break;case"verdocs-flag":if(!customElements.get(i(e))){D()}break;case"verdocs-help-icon":if(!customElements.get(i(e))){I()}break;case"verdocs-loader":if(!customElements.get(i(e))){U()}break;case"verdocs-menu-panel":if(!customElements.get(i(e))){B()}break;case"verdocs-ok-dialog":if(!customElements.get(i(e))){T()}break;case"verdocs-portal":if(!customElements.get(i(e))){L()}break;case"verdocs-preview":if(!customElements.get(i(e))){S()}break;case"verdocs-progress-bar":if(!customElements.get(i(e))){N()}break;case"verdocs-select-input":if(!customElements.get(i(e))){W()}break;case"verdocs-send":if(!customElements.get(i(e))){O()}break;case"verdocs-spinner":if(!customElements.get(i(e))){R()}break;case"verdocs-template-attachments":if(!customElements.get(i(e))){X()}break;case"verdocs-template-build-tabs":if(!customElements.get(i(e))){Y()}break;case"verdocs-template-document-page":if(!customElements.get(i(e))){G()}break;case"verdocs-template-field-properties":if(!customElements.get(i(e))){V()}break;case"verdocs-template-fields":if(!customElements.get(i(e))){z()}break;case"verdocs-template-role-properties":if(!customElements.get(i(e))){A()}break;case"verdocs-template-roles":if(!customElements.get(i(e))){M()}break;case"verdocs-text-input":if(!customElements.get(i(e))){F()}break;case"verdocs-toolbar-icon":if(!customElements.get(i(e))){J()}break;case"verdocs-upload-dialog":if(!customElements.get(i(e))){P()}break}}))}const H=Z;const _=q;export{H as VerdocsBuild,_ as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-build.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as
|
|
1
|
+
import{V as o,d as s}from"./p-CPYFXW2q.js";const t=o;const p=s;export{t as VerdocsContactPicker,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-contact-picker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as o,d as s}from"./p-
|
|
1
|
+
import{V as o,d as s}from"./p-DfaM_cug.js";const t=o;const a=s;export{t as VerdocsDownloadDialog,a as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-download-dialog.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{V as o,d as s}from"./p-
|
|
1
|
+
import{V as o,d as s}from"./p-DIOVejyL.js";const t=o;const p=s;export{t as VerdocsEnvelopeDocumentPage,p as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=verdocs-envelope-document-page.js.map
|