@verdocs/web-sdk 4.2.58 → 4.2.61

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.
Files changed (34) hide show
  1. package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +10 -8
  2. package/dist/cjs/verdocs-preview_10.cjs.entry.js +15 -7
  3. package/dist/cjs/verdocs-view.cjs.entry.js +11 -19
  4. package/dist/collection/components/embeds/verdocs-send/verdocs-send.js +16 -8
  5. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +11 -19
  6. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.css +7 -4
  7. package/dist/collection/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.js +13 -16
  8. package/dist/components/verdocs-contact-picker2.js +10 -8
  9. package/dist/components/verdocs-send2.js +16 -8
  10. package/dist/components/verdocs-view2.js +11 -19
  11. package/dist/esm/verdocs-contact-picker_2.entry.js +10 -8
  12. package/dist/esm/verdocs-preview_10.entry.js +16 -8
  13. package/dist/esm/verdocs-view.entry.js +11 -19
  14. package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
  15. package/dist/esm-es5/verdocs-preview_10.entry.js +1 -1
  16. package/dist/esm-es5/verdocs-view.entry.js +1 -1
  17. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +1 -3
  18. package/dist/types/components/envelopes/verdocs-contact-picker/verdocs-contact-picker.d.ts +4 -23
  19. package/dist/types/components.d.ts +4 -4
  20. package/dist/verdocs-web-sdk/p-03a228e4.system.js +1 -1
  21. package/dist/verdocs-web-sdk/p-17f27f15.system.entry.js +1 -0
  22. package/dist/verdocs-web-sdk/p-7c014649.system.entry.js +1 -0
  23. package/dist/verdocs-web-sdk/p-b7d033d1.entry.js +1 -0
  24. package/dist/verdocs-web-sdk/p-ee92a1fc.entry.js +1 -0
  25. package/dist/verdocs-web-sdk/p-f50e73e6.system.entry.js +1 -0
  26. package/dist/verdocs-web-sdk/p-f98562a7.entry.js +1 -0
  27. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  28. package/package.json +2 -2
  29. package/dist/verdocs-web-sdk/p-338fcdf4.entry.js +0 -1
  30. package/dist/verdocs-web-sdk/p-33fc5994.system.entry.js +0 -1
  31. package/dist/verdocs-web-sdk/p-362c6d47.system.entry.js +0 -1
  32. package/dist/verdocs-web-sdk/p-a84f9767.entry.js +0 -1
  33. package/dist/verdocs-web-sdk/p-dd4b01d3.entry.js +0 -1
  34. package/dist/verdocs-web-sdk/p-f403fe1c.system.entry.js +0 -1
@@ -5,14 +5,14 @@ import './_commonjsHelpers-bdec4bbd.js';
5
5
  import './Types-e4a6eba5.js';
6
6
  import './index-0329eed3.js';
7
7
 
8
- const verdocsContactPickerCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .names-row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px}verdocs-contact-picker form .names-row>input{min-width:0}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form .label-with-icon{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-contact-picker form .label-with-icon verdocs-help-icon svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}";
8
+ const verdocsContactPickerCss = "@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .names-row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px}verdocs-contact-picker form .names-row>input{min-width:0}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form .label-with-icon{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-contact-picker form .label-with-icon verdocs-help-icon svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;max-height:225px;overflow-y:scroll;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{width:32px;height:32px}verdocs-contact-picker form .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}";
9
9
  const VerdocsContactPickerStyle0 = verdocsContactPickerCss;
10
10
 
11
11
  const messageIcon = '<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';
12
12
  // const delegateIcon =
13
13
  // '<svg focusable="false" viewBox="0 0 24 24"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm0 4c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3zm6 12H6v-1.4c0-2 4-3.1 6-3.1s6 1.1 6 3.1V19z"></path></svg>';
14
14
  const kbaIcon = '<svg focusable="false" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z" clip-rule="evenodd" /></svg>';
15
- const placeholderIcon = '<svg focusable="false" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z"></path></svg>';
15
+ const addrBookIcon = `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>`;
16
16
  const VerdocsContactPicker = class {
17
17
  constructor(hostRef) {
18
18
  registerInstance(this, hostRef);
@@ -109,24 +109,26 @@ const VerdocsContactPicker = class {
109
109
  // The reason for the random names/IDs is to disable browser autocomplete. We set the autocomplete tags but many browsers ignore them
110
110
  // and show a duplicate autocomplete picker on top of our own.
111
111
  render() {
112
- return (h("form", { key: 'eaf9f3ce3f5d435a0fc2ff9b2ee10275c5bb65d4', onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off" }, h("div", { key: '16041c43395714ac4853849149b9ef09ed8b3a8b', class: "row" }, h("label", { key: 'd25085f7277cd11de5dafa15f628a983f35bbb93', htmlFor: this.nameFieldId }, "Name:"), h("div", { key: '64863ec682dc90555992f99c3d23cb297e72a335', class: "names-row" }, h("input", { key: 'b3f70dd283ddddeb3a003e53430a5bb155882022', id: this.firstNameFieldId, name: this.firstNameFieldId, type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.first_name, placeholder: "First Name...", onFocus: () => { var _a; return (this.showSuggestions = ((_a = this.contactSuggestions) === null || _a === void 0 ? void 0 : _a.length) > 0); }, onInput: e => this.handleFirstNameChange(e) }), h("input", { key: '8567b897b4ff2241e896d9b1fc18bd376dfb3ba7', id: this.lastNameFieldId, name: this.lastNameFieldId, type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.last_name, placeholder: "Last Name...", onFocus: () => { var _a; return (this.showSuggestions = ((_a = this.contactSuggestions) === null || _a === void 0 ? void 0 : _a.length) > 0); }, onInput: e => this.handleLastNameChange(e) })), this.showSuggestions && (h("div", { key: 'e1b968a478ba6c5e8683dd47b33febdf179b8cc8', class: "dropdown" }, this.contactSuggestions.map(suggestion => {
112
+ return (h("form", { key: '77d4a7a5740dc9afc0adf90a9370a8df7f7e57db', onSubmit: e => e.preventDefault(), onClick: e => e.stopPropagation(), autocomplete: "off" }, h("div", { key: 'c98cfc773ed6c59202b9752ce4386ba877839902', class: "row" }, h("label", { key: '831913a57ad8de80d3e234ca8aee38c9293be25a', htmlFor: this.nameFieldId }, "Name:"), h("div", { key: '856ff7e946194f61a918af19150043ab5914128d', class: "names-row" }, h("input", { key: '861a16cf88c5e79bc85ae9ba62e0aab5d7bedb34', id: this.firstNameFieldId, name: this.firstNameFieldId, type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.first_name, placeholder: "First Name...", onFocus: () => { var _a; return (this.showSuggestions = ((_a = this.contactSuggestions) === null || _a === void 0 ? void 0 : _a.length) > 0); }, onInput: e => this.handleFirstNameChange(e) }), h("input", { key: 'cbc821b96e4241745fbb655e540fe9e0699170b3', id: this.lastNameFieldId, name: this.lastNameFieldId, type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.last_name, placeholder: "Last Name...", onFocus: () => (this.showSuggestions = false), onInput: e => this.handleLastNameChange(e) })), this.showSuggestions && (h("div", { key: 'b6d7c93ac96ae383000d549244993ce3e9473b07', class: "dropdown" }, this.contactSuggestions
113
+ .filter(suggestion => !this.first_name || suggestion.first_name.toLowerCase().includes(this.first_name.toLowerCase()))
114
+ .map(suggestion => {
113
115
  var _a;
114
- return (h("div", { key: (_a = suggestion.id) !== null && _a !== void 0 ? _a : suggestion.name, class: "suggestion", onClick: e => this.handleSelectSuggestion(e, suggestion) }, suggestion.avatar ? h("img", { alt: "Avatar", class: "avatar", src: suggestion.avatar }) : h("div", { class: "avatar", innerHTML: placeholderIcon }), h("div", { class: "details" }, h("div", { class: "name" }, suggestion.name), suggestion.email && h("div", { class: "destination" }, suggestion.email), suggestion.phone && h("div", { class: "destination" }, suggestion.phone))));
115
- })))), h("div", { key: 'a10b105c1b4b39f555dca754570624ee4cf1fa3a', class: "row" }, h("label", { key: 'c17158644af04aed1f57ad9592a1c86ce839b304', htmlFor: this.emailFieldId }, "Email:"), h("input", { key: '31de4d700141c32dc073d9842f111f0f5d087869', id: this.emailFieldId, name: this.emailFieldId, type: "text", "data-lpignore": "true", autoComplete: "blocked", value: this.email, placeholder: "Email Address...", onFocus: () => (this.showSuggestions = false), onInput: e => this.handleEmailChange(e) })), h("div", { key: '178f5e239279e98c5f7e7b8e7d74e01b029cd575', class: "row" }, h("label", { key: 'be1381774c82ec9ac1d34bfd0fed8b09703ef722', htmlFor: this.phoneFieldId }, "Phone:"), h("input", { key: '20bbeee5c02793a302324ce1c3da3ba0423a886d', id: this.phoneFieldId, name: this.phoneFieldId, type: "text", "data-lpignore": "true", autoComplete: "blocked", value: this.phone, placeholder: "Phone Number...", onFocus: () => (this.showSuggestions = false), onInput: e => this.handlePhoneChange(e) })), this.showKba && (h("div", { key: '2114ba18ca47e1ddb3a0242862a3a7a489f9cac3', class: "row" }, h("div", { key: '8805ad508c881764373dc0b2731d09f7d64ed51f', class: "label-with-icon" }, h("label", { key: '7f8aa6458dfe937e7b17b98ca5ea8457bd13d330' }, "KBA:"), h("verdocs-help-icon", { key: 'b5d979a6799f47760c6f4b7caecbbcf04f4be07d', text: "Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature." })), h("verdocs-select-input", { key: 'a8074ec42c02edffb9141f0efab39d55c88f84a8', value: this.kbaMethod, onInput: (e) => (this.kbaMethod = e.target.value), options: [
116
+ return (h("div", { key: (_a = suggestion.id) !== null && _a !== void 0 ? _a : suggestion.email, class: "suggestion", onClick: e => this.handleSelectSuggestion(e, suggestion) }, suggestion.picture ? h("img", { alt: "Avatar", class: "avatar", src: suggestion.picture }) : h("div", { class: "avatar", innerHTML: addrBookIcon }), h("div", { class: "details" }, h("div", { class: "name" }, suggestion.first_name, " ", suggestion.last_name), suggestion.email && h("div", { class: "destination" }, suggestion.email), suggestion.phone && h("div", { class: "destination" }, suggestion.phone))));
117
+ })))), h("div", { key: '7b750d3f7ab27c0b5feea0ebf322aaa21273f6cf', class: "row" }, h("label", { key: '31a8e0dfd76cc0dd2cd6299c97ac57c3b626de10', htmlFor: this.emailFieldId }, "Email:"), h("input", { key: 'e42b4e3d34d399de6fea837d3257ee50244d690c', id: this.emailFieldId, name: this.emailFieldId, type: "text", "data-lpignore": "true", autoComplete: "blocked", value: this.email, placeholder: "Email Address...", onFocus: () => (this.showSuggestions = false), onInput: e => this.handleEmailChange(e) })), h("div", { key: '192985b0f48fcdf781e9ef4ff64d393da11df2ab', class: "row" }, h("label", { key: 'e0ceef244fc561b2d488b7f5228d31a78ab3e415', htmlFor: this.phoneFieldId }, "Phone:"), h("input", { key: 'b9bcaa6a282bdd853ff237fb80d93adb765b80d3', id: this.phoneFieldId, name: this.phoneFieldId, type: "text", "data-lpignore": "true", autoComplete: "blocked", value: this.phone, placeholder: "Phone Number...", onFocus: () => (this.showSuggestions = false), onInput: e => this.handlePhoneChange(e) })), this.showKba && (h("div", { key: '9c8e31b692e62901886104f27a5beb56312196a2', class: "row" }, h("div", { key: 'd8f17ff86c0a3a994db391df8a71ad6ddd81735f', class: "label-with-icon" }, h("label", { key: '82263fb743f8ff6809d33cdf5ae964bdc28ea661' }, "KBA:"), h("verdocs-help-icon", { key: '5eaa626c45ce5d0cbb3cc34f07d686099ea7bf83', text: "Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature." })), h("verdocs-select-input", { key: 'f1f5ebac6f6b5ec68232d71bc9f116f077348e30', value: this.kbaMethod, onInput: (e) => (this.kbaMethod = e.target.value), options: [
116
118
  { label: 'None', value: '' },
117
119
  { label: 'PIN Code', value: 'pin' },
118
120
  { label: 'Full Verification', value: 'kba' },
119
- ] }), this.kbaMethod === 'pin' && (h("input", { key: '2bf19c40e5b2e1a4fb13002b78719cef04d9a80c', id: "verdocs-pin-code", name: "verdocs-pin-code", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.pinCode, placeholder: "KBA PIN Code...", onFocus: () => (this.showSuggestions = false), onInput: e => this.handleMessageChange(e) })))), this.showMessage && (h("div", { key: '422e5484637d0d8bb5c75135440e749c8d61762c', class: "row" }, h("label", { key: '14a30145cbfe95e9506e6158653043ad514ebfcc', htmlFor: "verdocs-contact-picker-message" }, "Message:"), h("input", { key: '6f185da10b418d83924be637c8761656c57ee9d5', id: "verdocs-contact-picker-message", name: "verdocs-contact-picker-message", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.message, placeholder: "Invitation Message...", onFocus: () => (this.showSuggestions = false), onInput: e => this.handleMessageChange(e) }))), h("div", { key: '1783766a39890c1df677e64e64a43d8a2b2acf70', class: "buttons" }, h("verdocs-toggle-button", { key: '6728bee193c128e218d1e672915cc90e3563ef61', icon: kbaIcon, size: "small", active: this.showKba, onToggle: e => {
121
+ ] }), this.kbaMethod === 'pin' && (h("input", { key: 'fe87947c167f926ad49bf082df02c8eab1fc9b3a', id: "verdocs-pin-code", name: "verdocs-pin-code", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.pinCode, placeholder: "KBA PIN Code...", onFocus: () => (this.showSuggestions = false), onInput: e => this.handleMessageChange(e) })))), this.showMessage && (h("div", { key: 'b202f9482e1d58748bf389036ea5707bf9edc1ae', class: "row" }, h("label", { key: 'b9a25c63c47aa3e3201b3a221f5d26bb56ca0154', htmlFor: "verdocs-contact-picker-message" }, "Message:"), h("input", { key: '607ab3f44f08c30d5e2a44ca26db1afce6b82313', id: "verdocs-contact-picker-message", name: "verdocs-contact-picker-message", type: "text", "data-lpignore": "true", autocomplete: "blocked", value: this.message, placeholder: "Invitation Message...", onFocus: () => (this.showSuggestions = false), onInput: e => this.handleMessageChange(e) }))), h("div", { key: '8c0295589fb39514d9da534bc57d18e35e2b77bb', class: "buttons" }, h("verdocs-toggle-button", { key: '2fa1df450fa7c66b8fd70a83bff4967dde6a100e', icon: kbaIcon, size: "small", active: this.showKba, onToggle: e => {
120
122
  this.showKba = e.detail.active;
121
123
  if (!e.detail.active) {
122
124
  this.pinCode = '';
123
125
  this.kbaMethod = '';
124
126
  }
125
127
  this.showSuggestions = false;
126
- } }), h("verdocs-toggle-button", { key: 'a981d7f6385fbfcfb1de11a9a228080bd7480650', icon: messageIcon, size: "small", active: this.showMessage, onToggle: e => {
128
+ } }), h("verdocs-toggle-button", { key: '4d9e6bb2b64b3c9c6e9f7a74ce5631189ef9b358', icon: messageIcon, size: "small", active: this.showMessage, onToggle: e => {
127
129
  this.showMessage = e.detail.active;
128
130
  this.showSuggestions = false;
129
- } }), h("div", { key: 'ec7885eb818035917f71cc100d6316896c0c435b', class: "flex-fill" }), h("verdocs-button", { key: 'edfe1ae05b3bc87b2bc86b61f768e56ad70b5c7f', variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { key: 'ab7405721d454dbb4db3e936cf36337e60f2051f', label: "OK", size: "small", onClick: e => this.handleSubmit(e) }))));
131
+ } }), h("div", { key: '5686aed5c1b33e96d945de8bb467935fc51f09d0', class: "flex-fill" }), h("verdocs-button", { key: '74d6bcc7f14a79e381adfb89c6fb196fb749cae3', variant: "outline", label: "Cancel", size: "small", onClick: e => this.handleCancel(e) }), h("verdocs-button", { key: 'dc734de21e10ff2f17511dff743196abd18fd533', label: "OK", size: "small", onClick: e => this.handleSubmit(e) }))));
130
132
  }
131
133
  };
132
134
  VerdocsContactPicker.style = VerdocsContactPickerStyle0;
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment, g as getElement } from './index-3476681c.js';
2
- import { VerdocsEndpoint, integerSequence, createEnvelope, isValidEmail, isValidPhone, getRGBA, createTemplateDocument, deleteTemplateDocument, createTemplate, updateField, createField, updateTemplate, createTemplateReminder, updateTemplateReminder, deleteTemplateReminder, updateTemplateRole, createTemplateRole } from '@verdocs/js-sdk';
2
+ import { VerdocsEndpoint, integerSequence, getOrganizationContacts, createEnvelope, isValidEmail, isValidPhone, getRGBA, createTemplateDocument, deleteTemplateDocument, createTemplate, updateField, createField, updateTemplate, createTemplateReminder, updateTemplateReminder, deleteTemplateReminder, updateTemplateRole, createTemplateRole } from '@verdocs/js-sdk';
3
3
  import { g as getTemplateFieldStore, u as updateStoreField } from './TemplateFieldStore-002f3d4c.js';
4
4
  import { g as getTemplateRoleStore, b as getRoleNames, a as getRoleIndex, u as updateStoreRole } from './TemplateRoleStore-39555cd8.js';
5
5
  import { g as getTemplateStore } from './TemplateStore-ebd8f5f6.js';
@@ -128,14 +128,22 @@ const VerdocsSend = class {
128
128
  var _a, _b, _c;
129
129
  try {
130
130
  this.endpoint.onSessionChanged((_endpoint, _session, profile) => {
131
+ const me = {
132
+ id: profile.id,
133
+ first_name: profile.first_name,
134
+ last_name: profile.last_name,
135
+ email: profile.email,
136
+ phone: profile.phone,
137
+ };
131
138
  if (profile) {
132
- this.sessionContacts = [];
133
- this.sessionContacts.push({
134
- id: profile.id,
135
- first_name: profile.first_name,
136
- last_name: profile.last_name,
137
- email: profile.email,
138
- phone: profile.phone,
139
+ this.sessionContacts = [me];
140
+ getOrganizationContacts(this.endpoint)
141
+ .then(contacts => {
142
+ console.log('Got contacts', contacts);
143
+ this.sessionContacts = [...contacts, me];
144
+ })
145
+ .catch(e => {
146
+ console.log('Error getting contacts', e);
139
147
  });
140
148
  }
141
149
  });
@@ -25,30 +25,13 @@ const VerdocsView = class {
25
25
  this.roleNames = [];
26
26
  this.showCancelDone = false;
27
27
  }
28
- componentWillLoad() {
28
+ async componentWillLoad() {
29
+ var _a, _b, _c;
29
30
  this.endpoint.loadSession();
30
- }
31
- // TODO: Handling signing vs preview-as-user cases
32
- // TODO: Handle anonymous case and failure to load due to not being logged in
33
- async componentWillRender() {
34
31
  if (!this.envelopeId) {
35
32
  console.error(`[VIEW] Missing required envelopeId`);
36
33
  return;
37
34
  }
38
- return this.reloadEnvelope();
39
- }
40
- componentDidRender() {
41
- const headerTarget = this.headerTargetId ? document.getElementById(this.headerTargetId) : null;
42
- const headerEl = document.getElementById('verdocs-view-header');
43
- if (headerTarget && headerEl) {
44
- console.log('[VIEW] Moving header');
45
- headerEl.remove();
46
- headerTarget.append(headerEl);
47
- }
48
- }
49
- // TODO: Move this to the page renderer once the EnvelopePage model is deployed and envelope pages are individually processed
50
- async reloadEnvelope() {
51
- var _a, _b, _c;
52
35
  console.log('[VIEW] Loading envelope...');
53
36
  try {
54
37
  this.envelope = await getEnvelope(this.endpoint, this.envelopeId);
@@ -64,6 +47,15 @@ const VerdocsView = class {
64
47
  (_a = this.sdkError) === null || _a === void 0 ? void 0 : _a.emit(new SDKError(e.message, (_b = e.response) === null || _b === void 0 ? void 0 : _b.status, (_c = e.response) === null || _c === void 0 ? void 0 : _c.data));
65
48
  }
66
49
  }
50
+ componentDidRender() {
51
+ const headerTarget = this.headerTargetId ? document.getElementById(this.headerTargetId) : null;
52
+ const headerEl = document.getElementById('verdocs-view-header');
53
+ if (headerTarget && headerEl) {
54
+ console.log('[VIEW] Moving header');
55
+ headerEl.remove();
56
+ headerTarget.append(headerEl);
57
+ }
58
+ }
67
59
  handlePageRendered(e) {
68
60
  const pageInfo = e.detail;
69
61
  console.log('[VIEW] Page rendered', pageInfo);
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h,H as Host}from"./index-3476681c.js";import{VerdocsEndpoint}from"@verdocs/js-sdk";import{f as convertToE164}from"./utils-467fcc6a.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-e4a6eba5.js";import"./index-0329eed3.js";var verdocsContactPickerCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .names-row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px}verdocs-contact-picker form .names-row>input{min-width:0}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form .label-with-icon{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-contact-picker form .label-with-icon verdocs-help-icon svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{fill:#666666}verdocs-contact-picker form .dropdown .suggestion .avatar{width:48px;height:48px;-ms-flex:0 0 48px;flex:0 0 48px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var VerdocsContactPickerStyle0=verdocsContactPickerCss;var messageIcon='<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var kbaIcon='<svg focusable="false" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z" clip-rule="evenodd" /></svg>';var placeholderIcon='<svg focusable="false" viewBox="0 0 24 24"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z"></path></svg>';var VerdocsContactPicker=function(){function e(e){registerInstance(this,e);this.searchContacts=createEvent(this,"searchContacts",7);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateRole=null;this.contactSuggestions=[];this.first_name=undefined;this.last_name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.showKba=false;this.kbaMethod="";this.pinCode="";this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.firstNameFieldId="verdocs-contact-picker-firstname-".concat(Math.random().toString(36).substring(2,11));this.lastNameFieldId="verdocs-contact-picker-lastname-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){var e="".concat(this.templateRole.first_name||""," ").concat(this.templateRole.last_name||"").trim()||this.templateRole.full_name||"";var t=e.split(" ");var o=this.templateRole.first_name||t.shift()||"";var c=this.templateRole.last_name||t.join(" ")||"";this.first_name=o;this.last_name=c;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.kbaMethod=this.templateRole.kba_method||"";this.showKba=!!this.kbaMethod;this.pinCode=""}};e.prototype.handleFirstNameChange=function(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})};e.prototype.handleLastNameChange=function(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})};e.prototype.handleEmailChange=function(e){this.email=e.target.value};e.prototype.handlePhoneChange=function(e){this.phone=convertToE164(e.target.value)};e.prototype.handleMessageChange=function(e){this.message=e.target.value};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();console.log("Selected",t);this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;return h("form",{key:"eaf9f3ce3f5d435a0fc2ff9b2ee10275c5bb65d4",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{key:"16041c43395714ac4853849149b9ef09ed8b3a8b",class:"row"},h("label",{key:"d25085f7277cd11de5dafa15f628a983f35bbb93",htmlFor:this.nameFieldId},"Name:"),h("div",{key:"64863ec682dc90555992f99c3d23cb297e72a335",class:"names-row"},h("input",{key:"b3f70dd283ddddeb3a003e53430a5bb155882022",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.first_name,placeholder:"First Name...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleFirstNameChange(t)}}),h("input",{key:"8567b897b4ff2241e896d9b1fc18bd376dfb3ba7",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.last_name,placeholder:"Last Name...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleLastNameChange(t)}})),this.showSuggestions&&h("div",{key:"e1b968a478ba6c5e8683dd47b33febdf179b8cc8",class:"dropdown"},this.contactSuggestions.map((function(t){var o;return h("div",{key:(o=t.id)!==null&&o!==void 0?o:t.name,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.avatar?h("img",{alt:"Avatar",class:"avatar",src:t.avatar}):h("div",{class:"avatar",innerHTML:placeholderIcon}),h("div",{class:"details"},h("div",{class:"name"},t.name),t.email&&h("div",{class:"destination"},t.email),t.phone&&h("div",{class:"destination"},t.phone)))})))),h("div",{key:"a10b105c1b4b39f555dca754570624ee4cf1fa3a",class:"row"},h("label",{key:"c17158644af04aed1f57ad9592a1c86ce839b304",htmlFor:this.emailFieldId},"Email:"),h("input",{key:"31de4d700141c32dc073d9842f111f0f5d087869",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email Address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleEmailChange(t)}})),h("div",{key:"178f5e239279e98c5f7e7b8e7d74e01b029cd575",class:"row"},h("label",{key:"be1381774c82ec9ac1d34bfd0fed8b09703ef722",htmlFor:this.phoneFieldId},"Phone:"),h("input",{key:"20bbeee5c02793a302324ce1c3da3ba0423a886d",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone Number...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handlePhoneChange(t)}})),this.showKba&&h("div",{key:"2114ba18ca47e1ddb3a0242862a3a7a489f9cac3",class:"row"},h("div",{key:"8805ad508c881764373dc0b2731d09f7d64ed51f",class:"label-with-icon"},h("label",{key:"7f8aa6458dfe937e7b17b98ca5ea8457bd13d330"},"KBA:"),h("verdocs-help-icon",{key:"b5d979a6799f47760c6f4b7caecbbcf04f4be07d",text:"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature."})),h("verdocs-select-input",{key:"a8074ec42c02edffb9141f0efab39d55c88f84a8",value:this.kbaMethod,onInput:function(t){return e.kbaMethod=t.target.value},options:[{label:"None",value:""},{label:"PIN Code",value:"pin"},{label:"Full Verification",value:"kba"}]}),this.kbaMethod==="pin"&&h("input",{key:"2bf19c40e5b2e1a4fb13002b78719cef04d9a80c",id:"verdocs-pin-code",name:"verdocs-pin-code",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.pinCode,placeholder:"KBA PIN Code...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleMessageChange(t)}})),this.showMessage&&h("div",{key:"422e5484637d0d8bb5c75135440e749c8d61762c",class:"row"},h("label",{key:"14a30145cbfe95e9506e6158653043ad514ebfcc",htmlFor:"verdocs-contact-picker-message"},"Message:"),h("input",{key:"6f185da10b418d83924be637c8761656c57ee9d5",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Invitation Message...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleMessageChange(t)}})),h("div",{key:"1783766a39890c1df677e64e64a43d8a2b2acf70",class:"buttons"},h("verdocs-toggle-button",{key:"6728bee193c128e218d1e672915cc90e3563ef61",icon:kbaIcon,size:"small",active:this.showKba,onToggle:function(t){e.showKba=t.detail.active;if(!t.detail.active){e.pinCode="";e.kbaMethod=""}e.showSuggestions=false}}),h("verdocs-toggle-button",{key:"a981d7f6385fbfcfb1de11a9a228080bd7480650",icon:messageIcon,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),h("div",{key:"ec7885eb818035917f71cc100d6316896c0c435b",class:"flex-fill"}),h("verdocs-button",{key:"edfe1ae05b3bc87b2bc86b61f768e56ad70b5c7f",variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{key:"ab7405721d454dbb4db3e936cf36337e60f2051f",label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}();VerdocsContactPicker.style=VerdocsContactPickerStyle0;var verdocsToggleButtonCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var VerdocsToggleButtonStyle0=verdocsToggleButtonCss;var VerdocsToggleButton=function(){function e(e){registerInstance(this,e);this.toggle=createEvent(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}e.prototype.componentWillLoad=function(){this._active=this.active};e.prototype.handleToggle=function(e){var t;e.stopPropagation();var o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})};e.prototype.render=function(){var e=this;return h(Host,{key:"172f6a0d3eec15a7b97ed055125defe6d7e69fcb",class:"size-".concat(this.size)},this.icon?h("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(t){return e.handleToggle(t)}}):h("button",{class:{active:this._active},onClick:function(t){return e.handleToggle(t)}},this.label))};return e}();VerdocsToggleButton.style=VerdocsToggleButtonStyle0;export{VerdocsContactPicker as verdocs_contact_picker,VerdocsToggleButton as verdocs_toggle_button};
1
+ import{r as registerInstance,c as createEvent,h,H as Host}from"./index-3476681c.js";import{VerdocsEndpoint}from"@verdocs/js-sdk";import{f as convertToE164}from"./utils-467fcc6a.js";import"./_commonjsHelpers-bdec4bbd.js";import"./Types-e4a6eba5.js";import"./index-0329eed3.js";var verdocsContactPickerCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-contact-picker{display:block;border:1px solid #ebebeb;background-color:#ffffff;font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form{background-color:#f5f5fa;padding:12px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .row{width:300px;display:-ms-flexbox;display:flex;position:relative;margin:0 0 20px 0;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .names-row{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:8px}verdocs-contact-picker form .names-row>input{min-width:0}verdocs-contact-picker form label{display:block;font-size:14px;font-weight:500;margin:0 0 4px 0;color:#5c6575}verdocs-contact-picker form .label-with-icon{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:justify;justify-content:space-between}verdocs-contact-picker form .label-with-icon verdocs-help-icon svg{-webkit-transform:scale(0.8);transform:scale(0.8)}verdocs-contact-picker form input{border:none;font-size:18px;padding:3px 6px 3px 0;background:transparent;border-bottom:1px solid #33364b}verdocs-contact-picker form input:focus{outline:none}verdocs-contact-picker form .dropdown{left:0;right:0;top:49px;z-index:1000000;max-height:225px;overflow-y:scroll;position:absolute;background:#ffffff;-webkit-box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1);box-shadow:0 0 15px 0 rgba(0, 0, 0, 0.1)}verdocs-contact-picker form .dropdown .suggestion{display:-ms-flexbox;display:flex;padding:6px 12px;-ms-flex-align:center;align-items:center;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker form .dropdown .suggestion svg{width:32px;height:32px}verdocs-contact-picker form .dropdown .suggestion .avatar{width:32px;height:32px;-ms-flex:0 0 32px;flex:0 0 32px;margin-right:8px;border-radius:100%}verdocs-contact-picker form .dropdown .suggestion .details{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}verdocs-contact-picker form .dropdown .suggestion .name{font-size:16px;font-weight:500;margin-bottom:3px;color:#092c4c}verdocs-contact-picker form .dropdown .suggestion .destination{font-size:14px;margin-bottom:3px;color:#33364b}verdocs-contact-picker form .dropdown .suggestion:hover{background:#eee;cursor:pointer}verdocs-contact-picker .buttons{display:-ms-flexbox;display:flex;-webkit-column-gap:6px;-moz-column-gap:6px;column-gap:6px;margin-top:16px;-ms-flex-direction:row;flex-direction:row}verdocs-contact-picker .buttons .flex-fill{-ms-flex:1;flex:1}verdocs-contact-picker ::-webkit-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-moz-placeholder{color:#aaaaaa}verdocs-contact-picker :-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::-ms-input-placeholder{color:#aaaaaa}verdocs-contact-picker ::placeholder{color:#aaaaaa}verdocs-contact-picker [data-lastpass-icon-root]{display:none !important}';var VerdocsContactPickerStyle0=verdocsContactPickerCss;var messageIcon='<svg focusable="false" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"></path></svg>';var kbaIcon='<svg focusable="false" viewBox="0 0 24 24"><path fill-rule="evenodd" d="M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z" clip-rule="evenodd" /></svg>';var addrBookIcon='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-user"><path d="M15 13a3 3 0 1 0-6 0"/><path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20"/><circle cx="12" cy="8" r="2"/></svg>';var VerdocsContactPicker=function(){function e(e){registerInstance(this,e);this.searchContacts=createEvent(this,"searchContacts",7);this.exit=createEvent(this,"exit",7);this.next=createEvent(this,"next",7);this.endpoint=VerdocsEndpoint.getDefault();this.templateRole=null;this.contactSuggestions=[];this.first_name=undefined;this.last_name=undefined;this.email=undefined;this.phone=undefined;this.message=undefined;this.showSuggestions=false;this.showMessage=false;this.delegator=false;this.showKba=false;this.kbaMethod="";this.pinCode="";this.nameFieldId="verdocs-contact-picker-name-".concat(Math.random().toString(36).substring(2,11));this.firstNameFieldId="verdocs-contact-picker-firstname-".concat(Math.random().toString(36).substring(2,11));this.lastNameFieldId="verdocs-contact-picker-lastname-".concat(Math.random().toString(36).substring(2,11));this.emailFieldId="verdocs-contact-picker-email-".concat(Math.random().toString(36).substring(2,11));this.phoneFieldId="verdocs-contact-picker-phone-".concat(Math.random().toString(36).substring(2,11))}e.prototype.componentWillLoad=function(){if(this.templateRole){var e="".concat(this.templateRole.first_name||""," ").concat(this.templateRole.last_name||"").trim()||this.templateRole.full_name||"";var t=e.split(" ");var o=this.templateRole.first_name||t.shift()||"";var a=this.templateRole.last_name||t.join(" ")||"";this.first_name=o;this.last_name=a;this.email=this.templateRole.email||"";this.phone=this.templateRole.phone||"";this.delegator=this.templateRole.delegator||false;this.message=this.templateRole.message||"";this.showMessage=this.message!=="";this.kbaMethod=this.templateRole.kba_method||"";this.showKba=!!this.kbaMethod;this.pinCode=""}};e.prototype.handleFirstNameChange=function(e){var t;this.first_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.first_name})};e.prototype.handleLastNameChange=function(e){var t;this.last_name=e.target.value;(t=this.searchContacts)===null||t===void 0?void 0:t.emit({query:this.last_name})};e.prototype.handleEmailChange=function(e){this.email=e.target.value};e.prototype.handlePhoneChange=function(e){this.phone=convertToE164(e.target.value)};e.prototype.handleMessageChange=function(e){this.message=e.target.value};e.prototype.handleCancel=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.exit)===null||t===void 0?void 0:t.emit()};e.prototype.handleSubmit=function(e){var t;e.stopPropagation();this.showSuggestions=false;(t=this.next)===null||t===void 0?void 0:t.emit({first_name:this.first_name,last_name:this.last_name,email:this.email,phone:this.phone,message:this.message,delegator:this.delegator})};e.prototype.handleSelectSuggestion=function(e,t){e.stopPropagation();console.log("Selected",t);this.first_name=t.first_name;this.last_name=t.last_name;this.email=t.email;this.phone=t.phone;this.showSuggestions=false};e.prototype.render=function(){var e=this;return h("form",{key:"77d4a7a5740dc9afc0adf90a9370a8df7f7e57db",onSubmit:function(e){return e.preventDefault()},onClick:function(e){return e.stopPropagation()},autocomplete:"off"},h("div",{key:"c98cfc773ed6c59202b9752ce4386ba877839902",class:"row"},h("label",{key:"831913a57ad8de80d3e234ca8aee38c9293be25a",htmlFor:this.nameFieldId},"Name:"),h("div",{key:"856ff7e946194f61a918af19150043ab5914128d",class:"names-row"},h("input",{key:"861a16cf88c5e79bc85ae9ba62e0aab5d7bedb34",id:this.firstNameFieldId,name:this.firstNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.first_name,placeholder:"First Name...",onFocus:function(){var t;return e.showSuggestions=((t=e.contactSuggestions)===null||t===void 0?void 0:t.length)>0},onInput:function(t){return e.handleFirstNameChange(t)}}),h("input",{key:"cbc821b96e4241745fbb655e540fe9e0699170b3",id:this.lastNameFieldId,name:this.lastNameFieldId,type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.last_name,placeholder:"Last Name...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleLastNameChange(t)}})),this.showSuggestions&&h("div",{key:"b6d7c93ac96ae383000d549244993ce3e9473b07",class:"dropdown"},this.contactSuggestions.filter((function(t){return!e.first_name||t.first_name.toLowerCase().includes(e.first_name.toLowerCase())})).map((function(t){var o;return h("div",{key:(o=t.id)!==null&&o!==void 0?o:t.email,class:"suggestion",onClick:function(o){return e.handleSelectSuggestion(o,t)}},t.picture?h("img",{alt:"Avatar",class:"avatar",src:t.picture}):h("div",{class:"avatar",innerHTML:addrBookIcon}),h("div",{class:"details"},h("div",{class:"name"},t.first_name," ",t.last_name),t.email&&h("div",{class:"destination"},t.email),t.phone&&h("div",{class:"destination"},t.phone)))})))),h("div",{key:"7b750d3f7ab27c0b5feea0ebf322aaa21273f6cf",class:"row"},h("label",{key:"31a8e0dfd76cc0dd2cd6299c97ac57c3b626de10",htmlFor:this.emailFieldId},"Email:"),h("input",{key:"e42b4e3d34d399de6fea837d3257ee50244d690c",id:this.emailFieldId,name:this.emailFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.email,placeholder:"Email Address...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleEmailChange(t)}})),h("div",{key:"192985b0f48fcdf781e9ef4ff64d393da11df2ab",class:"row"},h("label",{key:"e0ceef244fc561b2d488b7f5228d31a78ab3e415",htmlFor:this.phoneFieldId},"Phone:"),h("input",{key:"b9bcaa6a282bdd853ff237fb80d93adb765b80d3",id:this.phoneFieldId,name:this.phoneFieldId,type:"text","data-lpignore":"true",autoComplete:"blocked",value:this.phone,placeholder:"Phone Number...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handlePhoneChange(t)}})),this.showKba&&h("div",{key:"9c8e31b692e62901886104f27a5beb56312196a2",class:"row"},h("div",{key:"d8f17ff86c0a3a994db391df8a71ad6ddd81735f",class:"label-with-icon"},h("label",{key:"82263fb743f8ff6809d33cdf5ae964bdc28ea661"},"KBA:"),h("verdocs-help-icon",{key:"5eaa626c45ce5d0cbb3cc34f07d686099ea7bf83",text:"Knowledge-Based Authentication adds additional authentication for this user either via a simple PIN code or full address validation. NOTE: There may be a fee for using this feature."})),h("verdocs-select-input",{key:"f1f5ebac6f6b5ec68232d71bc9f116f077348e30",value:this.kbaMethod,onInput:function(t){return e.kbaMethod=t.target.value},options:[{label:"None",value:""},{label:"PIN Code",value:"pin"},{label:"Full Verification",value:"kba"}]}),this.kbaMethod==="pin"&&h("input",{key:"fe87947c167f926ad49bf082df02c8eab1fc9b3a",id:"verdocs-pin-code",name:"verdocs-pin-code",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.pinCode,placeholder:"KBA PIN Code...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleMessageChange(t)}})),this.showMessage&&h("div",{key:"b202f9482e1d58748bf389036ea5707bf9edc1ae",class:"row"},h("label",{key:"b9a25c63c47aa3e3201b3a221f5d26bb56ca0154",htmlFor:"verdocs-contact-picker-message"},"Message:"),h("input",{key:"607ab3f44f08c30d5e2a44ca26db1afce6b82313",id:"verdocs-contact-picker-message",name:"verdocs-contact-picker-message",type:"text","data-lpignore":"true",autocomplete:"blocked",value:this.message,placeholder:"Invitation Message...",onFocus:function(){return e.showSuggestions=false},onInput:function(t){return e.handleMessageChange(t)}})),h("div",{key:"8c0295589fb39514d9da534bc57d18e35e2b77bb",class:"buttons"},h("verdocs-toggle-button",{key:"2fa1df450fa7c66b8fd70a83bff4967dde6a100e",icon:kbaIcon,size:"small",active:this.showKba,onToggle:function(t){e.showKba=t.detail.active;if(!t.detail.active){e.pinCode="";e.kbaMethod=""}e.showSuggestions=false}}),h("verdocs-toggle-button",{key:"4d9e6bb2b64b3c9c6e9f7a74ce5631189ef9b358",icon:messageIcon,size:"small",active:this.showMessage,onToggle:function(t){e.showMessage=t.detail.active;e.showSuggestions=false}}),h("div",{key:"5686aed5c1b33e96d945de8bb467935fc51f09d0",class:"flex-fill"}),h("verdocs-button",{key:"74d6bcc7f14a79e381adfb89c6fb196fb749cae3",variant:"outline",label:"Cancel",size:"small",onClick:function(t){return e.handleCancel(t)}}),h("verdocs-button",{key:"dc734de21e10ff2f17511dff743196abd18fd533",label:"OK",size:"small",onClick:function(t){return e.handleSubmit(t)}})))};return e}();VerdocsContactPicker.style=VerdocsContactPickerStyle0;var verdocsToggleButtonCss='@-webkit-keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}@keyframes verdocs-field-pulse{0%{background-color:rgba(0, 0, 0, 0.35)}50%{background-color:rgba(0, 0, 0, 0)}100%{background-color:rgba(0, 0, 0, 0.35)}}verdocs-toggle-button{font-family:"Inter", "Barlow", sans-serif}verdocs-toggle-button button{border:none;outline:none;cursor:pointer;-ms-flex-align:center;align-items:center;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;background:#cccccc;color:#33364b}verdocs-toggle-button button svg{max-width:100%;max-height:100%;fill:#33364b}verdocs-toggle-button button.active{background:#55bc81;color:#f5f5fa}verdocs-toggle-button button.active svg{fill:#f5f5fa}verdocs-toggle-button button:focus{border:none;outline:none}verdocs-toggle-button.size-normal button{width:40px;height:40px;padding:6px;border-radius:4px}verdocs-toggle-button.size-small button{width:34px;height:34px;padding:4px;border-radius:2px}';var VerdocsToggleButtonStyle0=verdocsToggleButtonCss;var VerdocsToggleButton=function(){function e(e){registerInstance(this,e);this.toggle=createEvent(this,"toggle",7);this.active=false;this.icon=null;this.label=null;this.size="normal";this._active=false}e.prototype.componentWillLoad=function(){this._active=this.active};e.prototype.handleToggle=function(e){var t;e.stopPropagation();var o=!this._active;this._active=o;(t=this.toggle)===null||t===void 0?void 0:t.emit({active:o})};e.prototype.render=function(){var e=this;return h(Host,{key:"172f6a0d3eec15a7b97ed055125defe6d7e69fcb",class:"size-".concat(this.size)},this.icon?h("button",{innerHTML:this.icon,class:{active:this._active},onClick:function(t){return e.handleToggle(t)}}):h("button",{class:{active:this._active},onClick:function(t){return e.handleToggle(t)}},this.label))};return e}();VerdocsToggleButton.style=VerdocsToggleButtonStyle0;export{VerdocsContactPicker as verdocs_contact_picker,VerdocsToggleButton as verdocs_toggle_button};