@verdocs/web-sdk 1.5.1 → 1.5.5

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 (53) hide show
  1. package/dist/cjs/{VerdocsEndpoint-5e6dd8ef.js → VerdocsEndpoint-2c7ecda8.js} +7 -0
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/verdocs-auth.cjs.entry.js +1 -1
  4. package/dist/cjs/verdocs-dropdown_12.cjs.entry.js +3 -7
  5. package/dist/cjs/verdocs-quick-functions.cjs.entry.js +1 -1
  6. package/dist/cjs/verdocs-search-activity_2.cjs.entry.js +1 -1
  7. package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
  8. package/dist/cjs/verdocs-sign.cjs.entry.js +2 -2
  9. package/dist/cjs/verdocs-web-sdk.cjs.js +1 -1
  10. package/dist/collection/components/embeds/verdocs-sign/verdocs-sign.js +1 -1
  11. package/dist/collection/components/embeds/verdocs-view/verdocs-view.js +2 -24
  12. package/dist/components/VerdocsEndpoint.js +7 -0
  13. package/dist/components/verdocs-sign.js +1 -1
  14. package/dist/components/verdocs-view2.js +2 -7
  15. package/dist/custom-elements.json +826 -0
  16. package/dist/docs.json +1 -18
  17. package/dist/esm/{VerdocsEndpoint-30e1b6ec.js → VerdocsEndpoint-1dbbd8e2.js} +7 -0
  18. package/dist/esm/loader.js +1 -1
  19. package/dist/esm/verdocs-auth.entry.js +1 -1
  20. package/dist/esm/verdocs-dropdown_12.entry.js +3 -7
  21. package/dist/esm/verdocs-quick-functions.entry.js +1 -1
  22. package/dist/esm/verdocs-search-activity_2.entry.js +1 -1
  23. package/dist/esm/verdocs-search.entry.js +1 -1
  24. package/dist/esm/verdocs-sign.entry.js +2 -2
  25. package/dist/esm/verdocs-web-sdk.js +1 -1
  26. package/dist/esm-es5/{VerdocsEndpoint-30e1b6ec.js → VerdocsEndpoint-1dbbd8e2.js} +1 -1
  27. package/dist/esm-es5/loader.js +1 -1
  28. package/dist/esm-es5/verdocs-auth.entry.js +1 -1
  29. package/dist/esm-es5/verdocs-dropdown_12.entry.js +2 -2
  30. package/dist/esm-es5/verdocs-quick-functions.entry.js +1 -1
  31. package/dist/esm-es5/verdocs-search-activity_2.entry.js +1 -1
  32. package/dist/esm-es5/verdocs-search.entry.js +1 -1
  33. package/dist/esm-es5/verdocs-sign.entry.js +1 -1
  34. package/dist/esm-es5/verdocs-web-sdk.js +1 -1
  35. package/dist/types/components/embeds/verdocs-view/verdocs-view.d.ts +0 -5
  36. package/dist/types/components.d.ts +0 -8
  37. package/dist/verdocs-web-sdk/{p-d522de7d.entry.js → p-4cfc0f04.entry.js} +2 -2
  38. package/dist/verdocs-web-sdk/{p-f6a53928.system.entry.js → p-4e98796c.system.entry.js} +1 -1
  39. package/dist/verdocs-web-sdk/{p-1b4e04b7.system.entry.js → p-5bd83ddc.system.entry.js} +1 -1
  40. package/dist/verdocs-web-sdk/{p-c29c2cf8.entry.js → p-6b8bc6f4.entry.js} +1 -1
  41. package/dist/verdocs-web-sdk/{p-4d80d044.system.js → p-6fd6ae35.system.js} +1 -1
  42. package/dist/verdocs-web-sdk/{p-16d62a51.system.entry.js → p-7adcb52c.system.entry.js} +1 -1
  43. package/dist/verdocs-web-sdk/p-88a300c5.system.js +1 -1
  44. package/dist/verdocs-web-sdk/{p-8276345a.entry.js → p-9e3a842c.entry.js} +1 -1
  45. package/dist/verdocs-web-sdk/{p-aa9fc574.entry.js → p-a55ed8ce.entry.js} +1 -1
  46. package/dist/verdocs-web-sdk/{p-06f38046.js → p-c34360d3.js} +1 -1
  47. package/dist/verdocs-web-sdk/{p-9139a76d.system.entry.js → p-cc12ccaa.system.entry.js} +1 -1
  48. package/dist/verdocs-web-sdk/{p-30cc8818.entry.js → p-e3229752.entry.js} +1 -1
  49. package/dist/verdocs-web-sdk/{p-1ea3b9d3.entry.js → p-f74862f7.entry.js} +1 -1
  50. package/dist/verdocs-web-sdk/{p-c4d03ff9.system.entry.js → p-f76721d3.system.entry.js} +2 -2
  51. package/dist/verdocs-web-sdk/{p-a87069d5.system.entry.js → p-fdf34ca6.system.entry.js} +1 -1
  52. package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
  53. package/package.json +2 -2
package/dist/docs.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2022-08-09T16:36:50",
2
+ "timestamp": "2022-08-12T13:49:19",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "2.17.1",
@@ -3485,23 +3485,6 @@
3485
3485
  ],
3486
3486
  "optional": false,
3487
3487
  "required": false
3488
- },
3489
- {
3490
- "name": "token",
3491
- "type": "string",
3492
- "mutable": false,
3493
- "attr": "token",
3494
- "reflectToAttr": false,
3495
- "docs": "Access token to use. This component is a wrapper for PDF.js which does not use a VerdocsEndpoint, so the token must be supplied\ndirectly.",
3496
- "docsTags": [],
3497
- "default": "null",
3498
- "values": [
3499
- {
3500
- "type": "string"
3501
- }
3502
- ],
3503
- "optional": false,
3504
- "required": false
3505
3488
  }
3506
3489
  ],
3507
3490
  "methods": [],
@@ -4705,6 +4705,13 @@ var VerdocsEndpoint = /** @class */ (function () {
4705
4705
  this.notifySessionListeners();
4706
4706
  return this;
4707
4707
  };
4708
+ /**
4709
+ * Retrieves the current session token, if any. Tokens should rarely be used for direct actions, but this is
4710
+ * required by the `<VerdocsView>` and other components to authorize requests to raw PDF files.
4711
+ */
4712
+ VerdocsEndpoint.prototype.getToken = function () {
4713
+ return this.token;
4714
+ };
4708
4715
  VerdocsEndpoint.prototype.sessionStorageKey = function () {
4709
4716
  return "verdocs-session-".concat(this.getSessionType(), "-").concat(this.getEnvironment());
4710
4717
  };
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["verdocs-sign",[[0,"verdocs-sign",{"endpoint":[16],"documentid":[1],"roleid":[1],"invitecode":[1],"recipient":[32],"signerToken":[32],"pdfUrl":[32],"recipientIndex":[32],"document":[32],"fields":[32],"pdfPageInfo":[32],"hasSignature":[32],"nextButtonLabel":[32],"focusedField":[32]}]]],["verdocs-auth",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"debug":[4],"isAuthenticated":[32],"displayMode":[32],"username":[32],"password":[32],"loggingIn":[32],"activeSession":[32],"loginError":[32]}]]],["verdocs-search",[[0,"verdocs-search",{"endpoint":[16]}]]],["verdocs-kba-dialog",[[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"choices":[16],"open":[4],"response":[32]}]]],["verdocs-organization-card",[[0,"verdocs-organization-card",{"organization":[16]}]]],["verdocs-quick-functions",[[0,"verdocs-quick-functions",{"endpoint":[16]}]]],["verdocs-search-tabs",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["verdocs-status-indicator",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"document":[16],"isOpen":[32],"recipientStatusIcons":[32]}]]],["verdocs-template-card",[[0,"verdocs-template-card",{"template":[16]}]]],["verdocs-template-tags",[[0,"verdocs-template-tags",{"tags":[16]}]]],["verdocs-toggle",[[0,"verdocs-toggle",{"options":[16],"theme":[1]},[[6,"click","handleClick"]]]]],["verdocs-button_2",[[0,"verdocs-text-input",{"value":[1],"label":[1],"placeholder":[1],"autocomplete":[1],"type":[1],"disabled":[4],"_value":[32]}],[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["verdocs-ok-dialog",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"open":[4],"cancel":[4]}]]],["verdocs-initial-dialog",[[0,"verdocs-initial-dialog",{"fullname":[1],"open":[4],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["verdocs-signature-dialog",[[0,"verdocs-signature-dialog",{"fullname":[1],"open":[4],"fontLoaded":[32],"enteredName":[32],"mode":[32]}]]],["verdocs-upload-dialog",[[0,"verdocs-upload-dialog",{"open":[4],"draggingOver":[32],"decodedFiles":[32]}]]],["verdocs-search-activity_2",[[0,"verdocs-search-activity",{"endpoint":[16],"type":[1],"options":[8],"emptyMessage":[32],"authFailure":[32],"title":[32],"recent":[32],"saved":[32],"starred":[32]}],[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1]}]]],["verdocs-loader",[[0,"verdocs-loader"]]],["verdocs-dropdown_12",[[0,"verdocs-field-initial",{"required":[4],"fullName":[1,"full-name"],"value":[1],"focusField":[64]}],[0,"verdocs-field-signature",{"required":[4],"fullName":[1,"full-name"],"value":[1],"focusField":[64]}],[0,"verdocs-field-attachment",{"order":[2],"value":[1],"required":[4],"disabled":[4],"focusField":[64]}],[0,"verdocs-view",{"endpoint":[16],"rotation":[2],"source":[1],"token":[1],"loadProgress":[32]}],[0,"verdocs-dropdown",{"options":[16],"open":[4],"isOpen":[32]}],[0,"verdocs-field-checkbox",{"order":[2],"value":[4],"required":[4],"disabled":[4]}],[0,"verdocs-field-date",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}],[0,"verdocs-field-dropdown",{"options":[16],"required":[4],"order":[2],"disabled":[4],"value":[1],"focused":[32],"focusField":[64]}],[0,"verdocs-field-payment",{"field":[16],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"focused":[4],"signed":[4],"preparedMessage":[32],"signatureUrl":[32]}],[0,"verdocs-field-radio-button",{"order":[2],"checked":[4],"value":[1],"name":[1],"required":[4],"disabled":[4]}],[0,"verdocs-field-textarea",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}],[0,"verdocs-field-textbox",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}]]]], options);
13
+ return bootstrapLazy([["verdocs-sign",[[0,"verdocs-sign",{"endpoint":[16],"documentid":[1],"roleid":[1],"invitecode":[1],"recipient":[32],"signerToken":[32],"pdfUrl":[32],"recipientIndex":[32],"document":[32],"fields":[32],"pdfPageInfo":[32],"hasSignature":[32],"nextButtonLabel":[32],"focusedField":[32]}]]],["verdocs-auth",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"debug":[4],"isAuthenticated":[32],"displayMode":[32],"username":[32],"password":[32],"loggingIn":[32],"activeSession":[32],"loginError":[32]}]]],["verdocs-search",[[0,"verdocs-search",{"endpoint":[16]}]]],["verdocs-kba-dialog",[[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"choices":[16],"open":[4],"response":[32]}]]],["verdocs-organization-card",[[0,"verdocs-organization-card",{"organization":[16]}]]],["verdocs-quick-functions",[[0,"verdocs-quick-functions",{"endpoint":[16]}]]],["verdocs-search-tabs",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["verdocs-status-indicator",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"document":[16],"isOpen":[32],"recipientStatusIcons":[32]}]]],["verdocs-template-card",[[0,"verdocs-template-card",{"template":[16]}]]],["verdocs-template-tags",[[0,"verdocs-template-tags",{"tags":[16]}]]],["verdocs-toggle",[[0,"verdocs-toggle",{"options":[16],"theme":[1]},[[6,"click","handleClick"]]]]],["verdocs-button_2",[[0,"verdocs-text-input",{"value":[1],"label":[1],"placeholder":[1],"autocomplete":[1],"type":[1],"disabled":[4],"_value":[32]}],[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["verdocs-ok-dialog",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"open":[4],"cancel":[4]}]]],["verdocs-initial-dialog",[[0,"verdocs-initial-dialog",{"fullname":[1],"open":[4],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["verdocs-signature-dialog",[[0,"verdocs-signature-dialog",{"fullname":[1],"open":[4],"fontLoaded":[32],"enteredName":[32],"mode":[32]}]]],["verdocs-upload-dialog",[[0,"verdocs-upload-dialog",{"open":[4],"draggingOver":[32],"decodedFiles":[32]}]]],["verdocs-search-activity_2",[[0,"verdocs-search-activity",{"endpoint":[16],"type":[1],"options":[8],"emptyMessage":[32],"authFailure":[32],"title":[32],"recent":[32],"saved":[32],"starred":[32]}],[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1]}]]],["verdocs-loader",[[0,"verdocs-loader"]]],["verdocs-dropdown_12",[[0,"verdocs-field-initial",{"required":[4],"fullName":[1,"full-name"],"value":[1],"focusField":[64]}],[0,"verdocs-field-signature",{"required":[4],"fullName":[1,"full-name"],"value":[1],"focusField":[64]}],[0,"verdocs-field-attachment",{"order":[2],"value":[1],"required":[4],"disabled":[4],"focusField":[64]}],[0,"verdocs-view",{"endpoint":[16],"rotation":[2],"source":[1],"loadProgress":[32]}],[0,"verdocs-dropdown",{"options":[16],"open":[4],"isOpen":[32]}],[0,"verdocs-field-checkbox",{"order":[2],"value":[4],"required":[4],"disabled":[4]}],[0,"verdocs-field-date",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}],[0,"verdocs-field-dropdown",{"options":[16],"required":[4],"order":[2],"disabled":[4],"value":[1],"focused":[32],"focusField":[64]}],[0,"verdocs-field-payment",{"field":[16],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"focused":[4],"signed":[4],"preparedMessage":[32],"signatureUrl":[32]}],[0,"verdocs-field-radio-button",{"order":[2],"checked":[4],"value":[1],"name":[1],"required":[4],"disabled":[4]}],[0,"verdocs-field-textarea",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}],[0,"verdocs-field-textbox",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-859bc689.js';
2
- import { V as VerdocsEndpoint } from './VerdocsEndpoint-30e1b6ec.js';
2
+ import { V as VerdocsEndpoint } from './VerdocsEndpoint-1dbbd8e2.js';
3
3
 
4
4
  /**
5
5
  * Authenticate to Verdocs via user/password authentication
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-859bc689.js';
2
2
  import { c as createPopper } from './popper-93ecb064.js';
3
- import { d as getAugmentedNamespace, e as createCommonjsModule, f as getDefaultExportFromCjs, h as commonjsGlobal, B as Buffer, i as commonjsRequire, p as process_1, V as VerdocsEndpoint } from './VerdocsEndpoint-30e1b6ec.js';
3
+ import { d as getAugmentedNamespace, e as createCommonjsModule, f as getDefaultExportFromCjs, h as commonjsGlobal, B as Buffer, i as commonjsRequire, p as process_1, V as VerdocsEndpoint } from './VerdocsEndpoint-1dbbd8e2.js';
4
4
 
5
5
  const SortDown = `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="#50BE80"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>
6
6
  `;
@@ -19258,11 +19258,6 @@ const VerdocsView = class {
19258
19258
  * Rotate the PDF in degrees
19259
19259
  */
19260
19260
  this.rotation = 0;
19261
- /**
19262
- * Access token to use. This component is a wrapper for PDF.js which does not use a VerdocsEndpoint, so the token must be supplied
19263
- * directly.
19264
- */
19265
- this.token = null;
19266
19261
  this.loadProgress = 0;
19267
19262
  this.pagesRendered = [];
19268
19263
  }
@@ -19340,7 +19335,8 @@ const VerdocsView = class {
19340
19335
  }
19341
19336
  loadAndRender(src) {
19342
19337
  console.log('[VIEW] Loading', src);
19343
- const httpHeaders = this.token ? { Authorization: `Bearer ${this.token}` } : {};
19338
+ const token = this.endpoint.getToken();
19339
+ const httpHeaders = token ? { Authorization: `Bearer ${token}` } : {};
19344
19340
  const source = {
19345
19341
  url: src,
19346
19342
  withCredentials: true,
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-859bc689.js';
2
- import { V as VerdocsEndpoint } from './VerdocsEndpoint-30e1b6ec.js';
2
+ import { V as VerdocsEndpoint } from './VerdocsEndpoint-1dbbd8e2.js';
3
3
 
4
4
  const TemplateIcon = `<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/><g><path d="M19,5v14H5V5H19 M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3L19,3z"/></g><path d="M14,17H7v-2h7V17z M17,13H7v-2h10V13z M17,9H7V7h10V9z"/></g></svg>`;
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h } from './index-859bc689.js';
2
- import { V as VerdocsEndpoint } from './VerdocsEndpoint-30e1b6ec.js';
2
+ import { V as VerdocsEndpoint } from './VerdocsEndpoint-1dbbd8e2.js';
3
3
 
4
4
  /**
5
5
  * A Template defines how a Verdocs signing flow will be performed, including attachments, signing fields, and
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-859bc689.js';
2
- import { V as VerdocsEndpoint } from './VerdocsEndpoint-30e1b6ec.js';
2
+ import { V as VerdocsEndpoint } from './VerdocsEndpoint-1dbbd8e2.js';
3
3
 
4
4
  const verdocsSearchCss = "verdocs-search{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;display:-ms-flexbox;display:flex;background-color:#1e2031}verdocs-search search-box{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:20px 10px}verdocs-search .boxes{-ms-flex-wrap:wrap;flex-wrap:wrap;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;margin:20px 0}verdocs-search search-recent,verdocs-search search-saved,verdocs-search search-quick-functions,verdocs-search search-starred{display:-ms-flexbox;display:flex;margin:0 20px 20px 0}";
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-859bc689.js';
2
- import { V as VerdocsEndpoint, g as getSigningSession, a as getDocument, u as updateRecipientStatus, b as getDocumentFile, c as updateDocumentField } from './VerdocsEndpoint-30e1b6ec.js';
2
+ import { V as VerdocsEndpoint, g as getSigningSession, a as getDocument, u as updateRecipientStatus, b as getDocumentFile, c as updateDocumentField } from './VerdocsEndpoint-1dbbd8e2.js';
3
3
 
4
4
  var e164Regex = new RegExp(/\+[1-9]\d{6,14}/g);
5
5
  function simpleE164Validator(code) {
@@ -341,7 +341,7 @@ const VerdocsSign = class {
341
341
  { id: 'print', label: 'Print Without Signing' },
342
342
  { id: 'download', label: 'Download' },
343
343
  ];
344
- return (h(Host, { class: { storybook: !!(window === null || window === void 0 ? void 0 : window['STORYBOOK_ENV']), agreed: (_a = this.recipient) === null || _a === void 0 ? void 0 : _a.agreed } }, h("div", { class: "header" }, h("div", { class: "intro" }, "Please review and act on these documents."), h("div", { class: "toolbar" }, h("div", { class: "tools" }, h("verdocs-dropdown", { options: menuOptions, onOptionSelected: e => this.handleOptionSelected(e) }), !((_b = this.recipient) === null || _b === void 0 ? void 0 : _b.agreed) ? (h("div", { class: "agree" }, h("div", { class: "agree-checkbox" }, h("input", { type: "checkbox", value: "None", id: "agree-checkbox-element", name: "agree", onChange: () => this.handleClickAgree() }), h("label", { htmlFor: "agree-checkbox-element" })), h("span", null, "I agree to use electronic records and signatures."))) : (h("div", { style: { flex: '1' } })), h("verdocs-button", { size: "small", label: this.nextButtonLabel, disabled: !((_c = this.recipient) === null || _c === void 0 ? void 0 : _c.agreed), onClick: () => this.handleNext() })))), !((_d = this.recipient) === null || _d === void 0 ? void 0 : _d.agreed) ? h("div", { class: "cover" }) : h("div", { style: { display: 'none' } }), h("div", { class: "document" }, this.pdfUrl ? h("verdocs-view", { source: this.pdfUrl, token: this.signerToken, onDocumentRendered: e => this.handleDocumentRendered(e) }) : h("verdocs-loader", null), (((_e = this.pdfPageInfo) === null || _e === void 0 ? void 0 : _e.pages) || []).map(page => {
344
+ return (h(Host, { class: { storybook: !!(window === null || window === void 0 ? void 0 : window['STORYBOOK_ENV']), agreed: (_a = this.recipient) === null || _a === void 0 ? void 0 : _a.agreed } }, h("div", { class: "header" }, h("div", { class: "intro" }, "Please review and act on these documents."), h("div", { class: "toolbar" }, h("div", { class: "tools" }, h("verdocs-dropdown", { options: menuOptions, onOptionSelected: e => this.handleOptionSelected(e) }), !((_b = this.recipient) === null || _b === void 0 ? void 0 : _b.agreed) ? (h("div", { class: "agree" }, h("div", { class: "agree-checkbox" }, h("input", { type: "checkbox", value: "None", id: "agree-checkbox-element", name: "agree", onChange: () => this.handleClickAgree() }), h("label", { htmlFor: "agree-checkbox-element" })), h("span", null, "I agree to use electronic records and signatures."))) : (h("div", { style: { flex: '1' } })), h("verdocs-button", { size: "small", label: this.nextButtonLabel, disabled: !((_c = this.recipient) === null || _c === void 0 ? void 0 : _c.agreed), onClick: () => this.handleNext() })))), !((_d = this.recipient) === null || _d === void 0 ? void 0 : _d.agreed) ? h("div", { class: "cover" }) : h("div", { style: { display: 'none' } }), h("div", { class: "document" }, this.pdfUrl ? h("verdocs-view", { source: this.pdfUrl, endpoint: this.endpoint, onDocumentRendered: e => this.handleDocumentRendered(e) }) : h("verdocs-loader", null), (((_e = this.pdfPageInfo) === null || _e === void 0 ? void 0 : _e.pages) || []).map(page => {
345
345
  var _a;
346
346
  return (h("div", { class: "page-controls", style: { height: `${page.height}px`, width: `${page.width}px`, top: `${page.canvasTop}px`, margin: '0 auto' } }, ((_a = this.pdfPageInfo) === null || _a === void 0 ? void 0 : _a.numRendered) > 0 ? (this.fields.filter(field => field.page === page.pageNumber).map((field, index) => this.renderField(field, index))) : (h("div", { style: { display: 'none' } }, "Waiting for PDF to render..."))));
347
347
  }))));
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["verdocs-sign",[[0,"verdocs-sign",{"endpoint":[16],"documentid":[1],"roleid":[1],"invitecode":[1],"recipient":[32],"signerToken":[32],"pdfUrl":[32],"recipientIndex":[32],"document":[32],"fields":[32],"pdfPageInfo":[32],"hasSignature":[32],"nextButtonLabel":[32],"focusedField":[32]}]]],["verdocs-auth",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"debug":[4],"isAuthenticated":[32],"displayMode":[32],"username":[32],"password":[32],"loggingIn":[32],"activeSession":[32],"loginError":[32]}]]],["verdocs-search",[[0,"verdocs-search",{"endpoint":[16]}]]],["verdocs-kba-dialog",[[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"choices":[16],"open":[4],"response":[32]}]]],["verdocs-organization-card",[[0,"verdocs-organization-card",{"organization":[16]}]]],["verdocs-quick-functions",[[0,"verdocs-quick-functions",{"endpoint":[16]}]]],["verdocs-search-tabs",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["verdocs-status-indicator",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"document":[16],"isOpen":[32],"recipientStatusIcons":[32]}]]],["verdocs-template-card",[[0,"verdocs-template-card",{"template":[16]}]]],["verdocs-template-tags",[[0,"verdocs-template-tags",{"tags":[16]}]]],["verdocs-toggle",[[0,"verdocs-toggle",{"options":[16],"theme":[1]},[[6,"click","handleClick"]]]]],["verdocs-button_2",[[0,"verdocs-text-input",{"value":[1],"label":[1],"placeholder":[1],"autocomplete":[1],"type":[1],"disabled":[4],"_value":[32]}],[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["verdocs-ok-dialog",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"open":[4],"cancel":[4]}]]],["verdocs-initial-dialog",[[0,"verdocs-initial-dialog",{"fullname":[1],"open":[4],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["verdocs-signature-dialog",[[0,"verdocs-signature-dialog",{"fullname":[1],"open":[4],"fontLoaded":[32],"enteredName":[32],"mode":[32]}]]],["verdocs-upload-dialog",[[0,"verdocs-upload-dialog",{"open":[4],"draggingOver":[32],"decodedFiles":[32]}]]],["verdocs-search-activity_2",[[0,"verdocs-search-activity",{"endpoint":[16],"type":[1],"options":[8],"emptyMessage":[32],"authFailure":[32],"title":[32],"recent":[32],"saved":[32],"starred":[32]}],[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1]}]]],["verdocs-loader",[[0,"verdocs-loader"]]],["verdocs-dropdown_12",[[0,"verdocs-field-initial",{"required":[4],"fullName":[1,"full-name"],"value":[1],"focusField":[64]}],[0,"verdocs-field-signature",{"required":[4],"fullName":[1,"full-name"],"value":[1],"focusField":[64]}],[0,"verdocs-field-attachment",{"order":[2],"value":[1],"required":[4],"disabled":[4],"focusField":[64]}],[0,"verdocs-view",{"endpoint":[16],"rotation":[2],"source":[1],"token":[1],"loadProgress":[32]}],[0,"verdocs-dropdown",{"options":[16],"open":[4],"isOpen":[32]}],[0,"verdocs-field-checkbox",{"order":[2],"value":[4],"required":[4],"disabled":[4]}],[0,"verdocs-field-date",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}],[0,"verdocs-field-dropdown",{"options":[16],"required":[4],"order":[2],"disabled":[4],"value":[1],"focused":[32],"focusField":[64]}],[0,"verdocs-field-payment",{"field":[16],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"focused":[4],"signed":[4],"preparedMessage":[32],"signatureUrl":[32]}],[0,"verdocs-field-radio-button",{"order":[2],"checked":[4],"value":[1],"name":[1],"required":[4],"disabled":[4]}],[0,"verdocs-field-textarea",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}],[0,"verdocs-field-textbox",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}]]]], options);
16
+ return bootstrapLazy([["verdocs-sign",[[0,"verdocs-sign",{"endpoint":[16],"documentid":[1],"roleid":[1],"invitecode":[1],"recipient":[32],"signerToken":[32],"pdfUrl":[32],"recipientIndex":[32],"document":[32],"fields":[32],"pdfPageInfo":[32],"hasSignature":[32],"nextButtonLabel":[32],"focusedField":[32]}]]],["verdocs-auth",[[0,"verdocs-auth",{"endpoint":[16],"visible":[4],"logo":[1],"debug":[4],"isAuthenticated":[32],"displayMode":[32],"username":[32],"password":[32],"loggingIn":[32],"activeSession":[32],"loginError":[32]}]]],["verdocs-search",[[0,"verdocs-search",{"endpoint":[16]}]]],["verdocs-kba-dialog",[[0,"verdocs-kba-dialog",{"step":[2],"steps":[2],"helptitle":[1],"helptext":[1],"mode":[1],"label":[1],"placeholder":[1],"choices":[16],"open":[4],"response":[32]}]]],["verdocs-organization-card",[[0,"verdocs-organization-card",{"organization":[16]}]]],["verdocs-quick-functions",[[0,"verdocs-quick-functions",{"endpoint":[16]}]]],["verdocs-search-tabs",[[0,"verdocs-search-tabs",{"selected":[32]}]]],["verdocs-status-indicator",[[0,"verdocs-status-indicator",{"size":[1],"theme":[1],"status":[1],"document":[16],"isOpen":[32],"recipientStatusIcons":[32]}]]],["verdocs-template-card",[[0,"verdocs-template-card",{"template":[16]}]]],["verdocs-template-tags",[[0,"verdocs-template-tags",{"tags":[16]}]]],["verdocs-toggle",[[0,"verdocs-toggle",{"options":[16],"theme":[1]},[[6,"click","handleClick"]]]]],["verdocs-button_2",[[0,"verdocs-text-input",{"value":[1],"label":[1],"placeholder":[1],"autocomplete":[1],"type":[1],"disabled":[4],"_value":[32]}],[0,"verdocs-button",{"label":[1],"startIcon":[1,"start-icon"],"endIcon":[1,"end-icon"],"size":[1],"type":[1],"variant":[1],"disabled":[4]}]]],["verdocs-ok-dialog",[[0,"verdocs-ok-dialog",{"heading":[1],"message":[1],"open":[4],"cancel":[4]}]]],["verdocs-initial-dialog",[[0,"verdocs-initial-dialog",{"fullname":[1],"open":[4],"fontLoaded":[32],"enteredInitials":[32],"mode":[32]}]]],["verdocs-signature-dialog",[[0,"verdocs-signature-dialog",{"fullname":[1],"open":[4],"fontLoaded":[32],"enteredName":[32],"mode":[32]}]]],["verdocs-upload-dialog",[[0,"verdocs-upload-dialog",{"open":[4],"draggingOver":[32],"decodedFiles":[32]}]]],["verdocs-search-activity_2",[[0,"verdocs-search-activity",{"endpoint":[16],"type":[1],"options":[8],"emptyMessage":[32],"authFailure":[32],"title":[32],"recent":[32],"saved":[32],"starred":[32]}],[0,"verdocs-search-box",{"endpoint":[16],"placeholder":[1],"type":[1],"query":[1]}]]],["verdocs-loader",[[0,"verdocs-loader"]]],["verdocs-dropdown_12",[[0,"verdocs-field-initial",{"required":[4],"fullName":[1,"full-name"],"value":[1],"focusField":[64]}],[0,"verdocs-field-signature",{"required":[4],"fullName":[1,"full-name"],"value":[1],"focusField":[64]}],[0,"verdocs-field-attachment",{"order":[2],"value":[1],"required":[4],"disabled":[4],"focusField":[64]}],[0,"verdocs-view",{"endpoint":[16],"rotation":[2],"source":[1],"loadProgress":[32]}],[0,"verdocs-dropdown",{"options":[16],"open":[4],"isOpen":[32]}],[0,"verdocs-field-checkbox",{"order":[2],"value":[4],"required":[4],"disabled":[4]}],[0,"verdocs-field-date",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}],[0,"verdocs-field-dropdown",{"options":[16],"required":[4],"order":[2],"disabled":[4],"value":[1],"focused":[32],"focusField":[64]}],[0,"verdocs-field-payment",{"field":[16],"fields":[16],"pageNum":[2,"page-num"],"roleName":[1,"role-name"],"fieldId":[1,"field-id"],"recipients":[8],"selectedRoleName":[1,"selected-role-name"],"pdfPages":[16],"currentSignature":[1,"current-signature"],"currentSignatureId":[1,"current-signature-id"],"currentInitial":[1,"current-initial"],"currentInitialId":[1,"current-initial-id"],"focused":[4],"signed":[4],"preparedMessage":[32],"signatureUrl":[32]}],[0,"verdocs-field-radio-button",{"order":[2],"checked":[4],"value":[1],"name":[1],"required":[4],"disabled":[4]}],[0,"verdocs-field-textarea",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}],[0,"verdocs-field-textbox",{"placeholder":[1],"order":[2],"value":[1],"required":[4],"disabled":[4],"focused":[32],"focusField":[64]}]]]], options);
17
17
  });
@@ -4,4 +4,4 @@ var global$1=typeof global!=="undefined"?global:typeof self!=="undefined"?self:t
4
4
  *
5
5
  * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
6
6
  * @license MIT
7
- */var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==undefined?global$1.TYPED_ARRAY_SUPPORT:true;function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t){throw new RangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=Buffer.prototype}else{if(e===null){e=new Buffer(t)}e.length=t}return e}function Buffer(e,t,r){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(e,t,r)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return allocUnsafe(this,e)}return from(this,e,t,r)}Buffer.poolSize=8192;Buffer._augment=function(e){e.__proto__=Buffer.prototype;return e};function from(e,t,r,n){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return fromArrayBuffer(e,t,r,n)}if(typeof t==="string"){return fromString(e,t,r)}return fromObject(e,t)}Buffer.from=function(e,t,r){return from(null,e,t,r)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array}function assertSize(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function alloc(e,t,r,n){assertSize(t);if(t<=0){return createBuffer(e,t)}if(r!==undefined){return typeof n==="string"?createBuffer(e,t).fill(r,n):createBuffer(e,t).fill(r)}return createBuffer(e,t)}Buffer.alloc=function(e,t,r){return alloc(null,e,t,r)};function allocUnsafe(e,t){assertSize(t);e=createBuffer(e,t<0?0:checked(t)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;++r){e[r]=0}}return e}Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)};Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)};function fromString(e,t,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}var n=byteLength(t,r)|0;e=createBuffer(e,n);var i=e.write(t,r);if(i!==n){e=e.slice(0,i)}return e}function fromArrayLike(e,t){var r=t.length<0?0:checked(t.length)|0;e=createBuffer(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function fromArrayBuffer(e,t,r,n){if(r<0||t.byteLength<r){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<r+(n||0)){throw new RangeError("'length' is out of bounds")}if(r===undefined&&n===undefined){t=new Uint8Array(t)}else if(n===undefined){t=new Uint8Array(t,r)}else{t=new Uint8Array(t,r,n)}if(Buffer.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=Buffer.prototype}else{e=fromArrayLike(e,t)}return e}function fromObject(e,t){if(internalIsBuffer(t)){var r=checked(t.length)|0;e=createBuffer(e,r);if(e.length===0){return e}t.copy(e,0,0,r);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||isnan(t.length)){return createBuffer(e,0)}return fromArrayLike(e,t)}if(t.type==="Buffer"&&isArray$1(t.data)){return fromArrayLike(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes")}return e|0}Buffer.isBuffer=isBuffer$1;function internalIsBuffer(e){return!!(e!=null&&e._isBuffer)}Buffer.compare=function e(t,r){if(!internalIsBuffer(t)||!internalIsBuffer(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var n=t.length;var i=r.length;for(var o=0,s=Math.min(n,i);o<s;++o){if(t[o]!==r[o]){n=t[o];i=r[o];break}}if(n<i)return-1;if(i<n)return 1;return 0};Buffer.isEncoding=function e(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function e(t,r){if(!isArray$1(t)){throw new TypeError('"list" argument must be an Array of Buffers')}if(t.length===0){return Buffer.alloc(0)}var n;if(r===undefined){r=0;for(n=0;n<t.length;++n){r+=t[n].length}}var i=Buffer.allocUnsafe(r);var o=0;for(n=0;n<t.length;++n){var s=t[n];if(!internalIsBuffer(s)){throw new TypeError('"list" argument must be an Array of Buffers')}s.copy(i,o);o+=s.length}return i};function byteLength(e,t){if(internalIsBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var r=e.length;if(r===0)return 0;var n=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case undefined:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase();n=true}}}Buffer.byteLength=byteLength;function slowToString(e,t,r){var n=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;t>>>=0;if(r<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}Buffer.prototype._isBuffer=true;function swap(e,t,r){var n=e[t];e[t]=e[r];e[r]=n}Buffer.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<t;r+=2){swap(this,r,r+1)}return this};Buffer.prototype.swap32=function e(){var t=this.length;if(t%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<t;r+=4){swap(this,r,r+3);swap(this,r+1,r+2)}return this};Buffer.prototype.swap64=function e(){var t=this.length;if(t%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<t;r+=8){swap(this,r,r+7);swap(this,r+1,r+6);swap(this,r+2,r+5);swap(this,r+3,r+4)}return this};Buffer.prototype.toString=function e(){var t=this.length|0;if(t===0)return"";if(arguments.length===0)return utf8Slice(this,0,t);return slowToString.apply(this,arguments)};Buffer.prototype.equals=function e(t){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");if(this===t)return true;return Buffer.compare(this,t)===0};Buffer.prototype.inspect=function e(){var t="";var r=INSPECT_MAX_BYTES;if(this.length>0){t=this.toString("hex",0,r).match(/.{2}/g).join(" ");if(this.length>r)t+=" ... "}return"<Buffer "+t+">"};Buffer.prototype.compare=function e(t,r,n,i,o){if(!internalIsBuffer(t)){throw new TypeError("Argument must be a Buffer")}if(r===undefined){r=0}if(n===undefined){n=t?t.length:0}if(i===undefined){i=0}if(o===undefined){o=this.length}if(r<0||n>t.length||i<0||o>this.length){throw new RangeError("out of range index")}if(i>=o&&r>=n){return 0}if(i>=o){return-1}if(r>=n){return 1}r>>>=0;n>>>=0;i>>>=0;o>>>=0;if(this===t)return 0;var s=o-i;var a=n-r;var f=Math.min(s,a);var u=this.slice(i,o);var c=t.slice(r,n);for(var l=0;l<f;++l){if(u[l]!==c[l]){s=u[l];a=c[l];break}}if(s<a)return-1;if(a<s)return 1;return 0};function bidirectionalIndexOf(e,t,r,n,i){if(e.length===0)return-1;if(typeof r==="string"){n=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=i?0:e.length-1}if(r<0)r=e.length+r;if(r>=e.length){if(i)return-1;else r=e.length-1}else if(r<0){if(i)r=0;else return-1}if(typeof t==="string"){t=Buffer.from(t,n)}if(internalIsBuffer(t)){if(t.length===0){return-1}return arrayIndexOf(e,t,r,n,i)}else if(typeof t==="number"){t=t&255;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(e,t,r)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,r)}}return arrayIndexOf(e,[t],r,n,i)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,i){var o=1;var s=e.length;var a=t.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(e.length<2||t.length<2){return-1}o=2;s/=2;a/=2;r/=2}}function f(e,t){if(o===1){return e[t]}else{return e.readUInt16BE(t*o)}}var u;if(i){var c=-1;for(u=r;u<s;u++){if(f(e,u)===f(t,c===-1?0:u-c)){if(c===-1)c=u;if(u-c+1===a)return c*o}else{if(c!==-1)u-=u-c;c=-1}}}else{if(r+a>s)r=s-a;for(u=r;u>=0;u--){var l=true;for(var h=0;h<a;h++){if(f(e,u+h)!==f(t,h)){l=false;break}}if(l)return u}}return-1}Buffer.prototype.includes=function e(t,r,n){return this.indexOf(t,r,n)!==-1};Buffer.prototype.indexOf=function e(t,r,n){return bidirectionalIndexOf(this,t,r,n,true)};Buffer.prototype.lastIndexOf=function e(t,r,n){return bidirectionalIndexOf(this,t,r,n,false)};function hexWrite(e,t,r,n){r=Number(r)||0;var i=e.length-r;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");if(n>o/2){n=o/2}for(var s=0;s<n;++s){var a=parseInt(t.substr(s*2,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(asciiToBytes(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,n)}Buffer.prototype.write=function e(t,r,n,i){if(r===undefined){i="utf8";n=this.length;r=0}else if(n===undefined&&typeof r==="string"){i=r;n=this.length;r=0}else if(isFinite(r)){r=r|0;if(isFinite(n)){n=n|0;if(i===undefined)i="utf8"}else{i=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var o=this.length-r;if(n===undefined||n>o)n=o;if(t.length>0&&(n<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return hexWrite(this,t,r,n);case"utf8":case"utf-8":return utf8Write(this,t,r,n);case"ascii":return asciiWrite(this,t,r,n);case"latin1":case"binary":return latin1Write(this,t,r,n);case"base64":return base64Write(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};Buffer.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(e,t,r){if(t===0&&r===e.length){return fromByteArray(e)}else{return fromByteArray(e.slice(t,r))}}function utf8Slice(e,t,r){r=Math.min(e.length,r);var n=[];var i=t;while(i<r){var o=e[i];var s=null;var a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){var f,u,c,l;switch(a){case 1:if(o<128){s=o}break;case 2:f=e[i+1];if((f&192)===128){l=(o&31)<<6|f&63;if(l>127){s=l}}break;case 3:f=e[i+1];u=e[i+2];if((f&192)===128&&(u&192)===128){l=(o&15)<<12|(f&63)<<6|u&63;if(l>2047&&(l<55296||l>57343)){s=l}}break;case 4:f=e[i+1];u=e[i+2];c=e[i+3];if((f&192)===128&&(u&192)===128&&(c&192)===128){l=(o&15)<<18|(f&63)<<12|(u&63)<<6|c&63;if(l>65535&&l<1114112){s=l}}}}if(s===null){s=65533;a=1}else if(s>65535){s-=65536;n.push(s>>>10&1023|55296);s=56320|s&1023}n.push(s);i+=a}return decodeCodePointsArray(n)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,e)}var r="";var n=0;while(n<t){r+=String.fromCharCode.apply(String,e.slice(n,n+=MAX_ARGUMENTS_LENGTH))}return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i]&127)}return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i])}return n}function hexSlice(e,t,r){var n=e.length;if(!t||t<0)t=0;if(!r||r<0||r>n)r=n;var i="";for(var o=t;o<r;++o){i+=toHex(e[o])}return i}function utf16leSlice(e,t,r){var n=e.slice(t,r);var i="";for(var o=0;o<n.length;o+=2){i+=String.fromCharCode(n[o]+n[o+1]*256)}return i}Buffer.prototype.slice=function e(t,r){var n=this.length;t=~~t;r=r===undefined?n:~~r;if(t<0){t+=n;if(t<0)t=0}else if(t>n){t=n}if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(r<t)r=t;var i;if(Buffer.TYPED_ARRAY_SUPPORT){i=this.subarray(t,r);i.__proto__=Buffer.prototype}else{var o=r-t;i=new Buffer(o,undefined);for(var s=0;s<o;++s){i[s]=this[s+t]}}return i};function checkOffset(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)checkOffset(t,r,this.length);var i=this[t];var o=1;var s=0;while(++s<r&&(o*=256)){i+=this[t+s]*o}return i};Buffer.prototype.readUIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n){checkOffset(t,r,this.length)}var i=this[t+--r];var o=1;while(r>0&&(o*=256)){i+=this[t+--r]*o}return i};Buffer.prototype.readUInt8=function e(t,r){if(!r)checkOffset(t,1,this.length);return this[t]};Buffer.prototype.readUInt16LE=function e(t,r){if(!r)checkOffset(t,2,this.length);return this[t]|this[t+1]<<8};Buffer.prototype.readUInt16BE=function e(t,r){if(!r)checkOffset(t,2,this.length);return this[t]<<8|this[t+1]};Buffer.prototype.readUInt32LE=function e(t,r){if(!r)checkOffset(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};Buffer.prototype.readUInt32BE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};Buffer.prototype.readIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)checkOffset(t,r,this.length);var i=this[t];var o=1;var s=0;while(++s<r&&(o*=256)){i+=this[t+s]*o}o*=128;if(i>=o)i-=Math.pow(2,8*r);return i};Buffer.prototype.readIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n)checkOffset(t,r,this.length);var i=r;var o=1;var s=this[t+--i];while(i>0&&(o*=256)){s+=this[t+--i]*o}o*=128;if(s>=o)s-=Math.pow(2,8*r);return s};Buffer.prototype.readInt8=function e(t,r){if(!r)checkOffset(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};Buffer.prototype.readInt16LE=function e(t,r){if(!r)checkOffset(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};Buffer.prototype.readInt16BE=function e(t,r){if(!r)checkOffset(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};Buffer.prototype.readInt32LE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};Buffer.prototype.readInt32BE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};Buffer.prototype.readFloatLE=function e(t,r){if(!r)checkOffset(t,4,this.length);return read(this,t,true,23,4)};Buffer.prototype.readFloatBE=function e(t,r){if(!r)checkOffset(t,4,this.length);return read(this,t,false,23,4)};Buffer.prototype.readDoubleLE=function e(t,r){if(!r)checkOffset(t,8,this.length);return read(this,t,true,52,8)};Buffer.prototype.readDoubleBE=function e(t,r){if(!r)checkOffset(t,8,this.length);return read(this,t,false,52,8)};function checkInt(e,t,r,n,i,o){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var o=Math.pow(2,8*n)-1;checkInt(this,t,r,n,o,0)}var s=1;var a=0;this[r]=t&255;while(++a<n&&(s*=256)){this[r+a]=t/s&255}return r+n};Buffer.prototype.writeUIntBE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var o=Math.pow(2,8*n)-1;checkInt(this,t,r,n,o,0)}var s=n-1;var a=1;this[r+s]=t&255;while(--s>=0&&(a*=256)){this[r+s]=t/a&255}return r+n};Buffer.prototype.writeUInt8=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[r]=t&255;return r+1};function objectWriteUInt16(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,o=Math.min(e.length-r,2);i<o;++i){e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{objectWriteUInt16(this,t,r,true)}return r+2};Buffer.prototype.writeUInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{objectWriteUInt16(this,t,r,false)}return r+2};function objectWriteUInt32(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,o=Math.min(e.length-r,4);i<o;++i){e[r+i]=t>>>(n?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r+3]=t>>>24;this[r+2]=t>>>16;this[r+1]=t>>>8;this[r]=t&255}else{objectWriteUInt32(this,t,r,true)}return r+4};Buffer.prototype.writeUInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{objectWriteUInt32(this,t,r,false)}return r+4};Buffer.prototype.writeIntLE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var o=Math.pow(2,8*n-1);checkInt(this,t,r,n,o-1,-o)}var s=0;var a=1;var f=0;this[r]=t&255;while(++s<n&&(a*=256)){if(t<0&&f===0&&this[r+s-1]!==0){f=1}this[r+s]=(t/a>>0)-f&255}return r+n};Buffer.prototype.writeIntBE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var o=Math.pow(2,8*n-1);checkInt(this,t,r,n,o-1,-o)}var s=n-1;var a=1;var f=0;this[r+s]=t&255;while(--s>=0&&(a*=256)){if(t<0&&f===0&&this[r+s+1]!==0){f=1}this[r+s]=(t/a>>0)-f&255}return r+n};Buffer.prototype.writeInt8=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[r]=t&255;return r+1};Buffer.prototype.writeInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{objectWriteUInt16(this,t,r,true)}return r+2};Buffer.prototype.writeInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{objectWriteUInt16(this,t,r,false)}return r+2};Buffer.prototype.writeInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8;this[r+2]=t>>>16;this[r+3]=t>>>24}else{objectWriteUInt32(this,t,r,true)}return r+4};Buffer.prototype.writeInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{objectWriteUInt32(this,t,r,false)}return r+4};function checkIEEE754(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,i){if(!i){checkIEEE754(e,t,r,4)}write(e,t,r,n,23,4);return r+4}Buffer.prototype.writeFloatLE=function e(t,r,n){return writeFloat(this,t,r,true,n)};Buffer.prototype.writeFloatBE=function e(t,r,n){return writeFloat(this,t,r,false,n)};function writeDouble(e,t,r,n,i){if(!i){checkIEEE754(e,t,r,8)}write(e,t,r,n,52,8);return r+8}Buffer.prototype.writeDoubleLE=function e(t,r,n){return writeDouble(this,t,r,true,n)};Buffer.prototype.writeDoubleBE=function e(t,r,n){return writeDouble(this,t,r,false,n)};Buffer.prototype.copy=function e(t,r,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(r>=t.length)r=t.length;if(!r)r=0;if(i>0&&i<n)i=n;if(i===n)return 0;if(t.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(t.length-r<i-n){i=t.length-r+n}var o=i-n;var s;if(this===t&&n<r&&r<i){for(s=o-1;s>=0;--s){t[s+r]=this[s+n]}}else if(o<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(s=0;s<o;++s){t[s+r]=this[s+n]}}else{Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r)}return o};Buffer.prototype.fill=function e(t,r,n,i){if(typeof t==="string"){if(typeof r==="string"){i=r;r=0;n=this.length}else if(typeof n==="string"){i=n;n=this.length}if(t.length===1){var o=t.charCodeAt(0);if(o<256){t=o}}if(i!==undefined&&typeof i!=="string"){throw new TypeError("encoding must be a string")}if(typeof i==="string"&&!Buffer.isEncoding(i)){throw new TypeError("Unknown encoding: "+i)}}else if(typeof t==="number"){t=t&255}if(r<0||this.length<r||this.length<n){throw new RangeError("Out of range index")}if(n<=r){return this}r=r>>>0;n=n===undefined?this.length:n>>>0;if(!t)t=0;var s;if(typeof t==="number"){for(s=r;s<n;++s){this[s]=t}}else{var a=internalIsBuffer(t)?t:utf8ToBytes(new Buffer(t,i).toString());var f=a.length;for(s=0;s<n-r;++s){this[s+r]=a[s%f]}}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){e=stringtrim(e).replace(INVALID_BASE64_RE,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function stringtrim(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function toHex(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function utf8ToBytes(e,t){t=t||Infinity;var r;var n=e.length;var i=null;var o=[];for(var s=0;s<n;++s){r=e.charCodeAt(s);if(r>55295&&r<57344){if(!i){if(r>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)o.push(239,191,189);continue}i=r;continue}if(r<56320){if((t-=3)>-1)o.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((t-=3)>-1)o.push(239,191,189)}i=null;if(r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return o}function asciiToBytes(e){var t=[];for(var r=0;r<e.length;++r){t.push(e.charCodeAt(r)&255)}return t}function utf16leToBytes(e,t){var r,n,i;var o=[];for(var s=0;s<e.length;++s){if((t-=2)<0)break;r=e.charCodeAt(s);n=r>>8;i=r%256;o.push(i);o.push(n)}return o}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var i=0;i<n;++i){if(i+r>=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function isnan(e){return e!==e}function isBuffer$1(e){return e!=null&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&isFastBuffer(e.slice(0,0))}var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;var AtoB=function(e){e=String(e).replace(/[\t\n\f\r ]+/g,"");if(!b64re.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");e+="==".slice(2-(e.length&3));var t;var r="";var n;var i;var o=0;for(;o<e.length;){t=b64.indexOf(e.charAt(o++))<<18|b64.indexOf(e.charAt(o++))<<12|(n=b64.indexOf(e.charAt(o++)))<<6|(i=b64.indexOf(e.charAt(o++)));r+=n===64?String.fromCharCode(t>>16&255):i===64?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,t&255)}return r};var decodeJWTBody=function(e){return JSON.parse(AtoB((e||"").split(".")[1]||""))};var decodeAccessTokenBody=function(e){var t;try{t=decodeJWTBody(e);if(t===null){return null}}catch(e){return null}Object.keys(t).forEach((function(e){if(typeof e==="string"&&e.startsWith("https://verdocs.com/")){t[e.replace("https://verdocs.com/","")]=t[e];delete t[e]}}));return t};var __awaiter$1=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{f(n.next(e))}catch(e){o(e)}}function a(e){try{f(n["throw"](e))}catch(e){o(e)}}function f(e){e.done?r(e.value):i(e.value).then(s,a)}f((n=n.apply(e,t||[])).next())}))};var __generator$1=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return f([e,t])}}function f(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var getSummary=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.post("/documents/summary",{page:t}).then((function(e){return e.data}))]}))}))};var searchDocuments=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.post("/documents/search",t).then((function(e){return e.data}))]}))}))};var getSigningSession=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.get("/documents/".concat(t.documentId,"/recipients/").concat(encodeURIComponent(t.roleId),"/invitation/").concat(t.inviteCode)).then((function(t){var r,n;var i=((r=t.headers)===null||r===void 0?void 0:r.signer_token)||"";var o=decodeAccessTokenBody(i);e.setToken((n=t.headers)===null||n===void 0?void 0:n.signer_token);return{recipient:t.data,session:o,signerToken:i}}))]}))}))};var getDocumentRecipients=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.get("/documents/".concat(t,"/recipients")).then((function(e){return e.data}))]}))}))};var getDocument=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.get("/documents/".concat(t)).then((function(e){return e.data}))]}))}))};var getDocumentFile=function(e,t,r){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(n){return[2,e.api.get("/documents/".concat(t,"/envelope_documents/").concat(r,"?file=true"),{responseType:"arraybuffer"}).then((function(e){return Buffer.from(e.data,"binary").toString("base64")}))]}))}))};var updateDocumentField=function(e,t,r,n){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(i){return[2,e.api.put("/documents/".concat(t,"/fields/").concat(r),n).then((function(e){return e.data}))]}))}))};var updateDocumentFieldSignature=function(e,t,r,n){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(i){return[2,e.api.put("/documents/".concat(t,"/fields/").concat(r,"/signature/").concat(n)).then((function(e){return e.data}))]}))}))};var Documents$1=Object.freeze({__proto__:null,getSummary:getSummary,searchDocuments:searchDocuments,getSigningSession:getSigningSession,getDocumentRecipients:getDocumentRecipients,getDocument:getDocument,getDocumentFile:getDocumentFile,updateDocumentField:updateDocumentField,updateDocumentFieldSignature:updateDocumentFieldSignature});var __assign=undefined&&undefined.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};var __awaiter=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{f(n.next(e))}catch(e){o(e)}}function a(e){try{f(n["throw"](e))}catch(e){o(e)}}function f(e){e.done?r(e.value):i(e.value).then(s,a)}f((n=n.apply(e,t||[])).next())}))};var __generator=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return f([e,t])}}function f(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var updateRecipientStatus=function(e,t,r,n,i){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(o){return[2,e.api.put("/documents/".concat(t,"/recipients/").concat(r),__assign({role_name:r,action:n},i||{})).then((function(e){return e.data}))]}))}))};var Recipients=Object.freeze({__proto__:null,updateRecipientStatus:updateRecipientStatus});var createSignature=function(e,t,r){var n=new FormData;n.append("signature",r,t);return e.api.post("/signatures",n).then((function(e){return e.data}))};var getSignatures=function(e){return e.api.get("/signatures").then((function(e){return e.data}))};var getSignature=function(e,t){return e.api.get("/signatures/".concat(t)).then((function(e){return e.data}))};var deleteSignature=function(e,t){return e.api.delete("/signatures/".concat(t)).then((function(e){return e.data}))};var Signatures=Object.freeze({__proto__:null,createSignature:createSignature,getSignatures:getSignatures,getSignature:getSignature,deleteSignature:deleteSignature});var createInitials=function(e,t,r){var n=new FormData;n.append("initial",r,t);return e.api.post("/initials",n).then((function(e){return e.data}))};var Initials=Object.freeze({__proto__:null,createInitials:createInitials});var Types=Object.freeze({__proto__:null});var Documents=Object.freeze({__proto__:null,Documents:Documents$1,Recipients:Recipients,Signatures:Signatures,Initials:Initials,Types:Types});var TemplatePermissions;(function(e){e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(TemplatePermissions||(TemplatePermissions={}));var TemplateSenderTypes;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(TemplateSenderTypes||(TemplateSenderTypes={}));var TemplateActions;(function(e){e["CREATE_PERSONAL"]="create_personal";e["CREATE_ORG"]="create_org";e["CREATE_PUBLIC"]="create_public";e["READ"]="read";e["WRITE"]="write";e["DELETE"]="delete";e["CHANGE_VISIBILITY_PERSONAL"]="change_visibility_personal";e["CHANGE_VISIBILITY_ORG"]="change_visibility_org";e["CHANGE_VISIBILITY_PUBLIC"]="change_visibility_public"})(TemplateActions||(TemplateActions={}));var SortOptions;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(SortOptions||(SortOptions={}));var bind=function e(t,r){return function e(){var n=new Array(arguments.length);for(var i=0;i<n.length;i++){n[i]=arguments[i]}return t.apply(r,n)}};var toString=Object.prototype.toString;var kindOf=function(e){return function(t){var r=toString.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function kindOfTest(e){e=e.toLowerCase();return function t(r){return kindOf(r)===e}}function isArray(e){return Array.isArray(e)}function isUndefined(e){return typeof e==="undefined"}function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){var t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&isArrayBuffer(e.buffer)}return t}function isString(e){return typeof e==="string"}function isNumber(e){return typeof e==="number"}function isObject(e){return e!==null&&typeof e==="object"}function isPlainObject(e){if(kindOf(e)!=="object"){return false}var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var isDate=kindOfTest("Date");var isFile=kindOfTest("File");var isBlob=kindOfTest("Blob");var isFileList=kindOfTest("FileList");function isFunction(e){return toString.call(e)==="[object Function]"}function isStream(e){return isObject(e)&&isFunction(e.pipe)}function isFormData(e){var t="[object FormData]";return e&&(typeof FormData==="function"&&e instanceof FormData||toString.call(e)===t||isFunction(e.toString)&&e.toString()===t)}var isURLSearchParams=kindOfTest("URLSearchParams");function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){if(typeof navigator!=="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")){return false}return typeof window!=="undefined"&&typeof document!=="undefined"}function forEach(e,t){if(e===null||typeof e==="undefined"){return}if(typeof e!=="object"){e=[e]}if(isArray(e)){for(var r=0,n=e.length;r<n;r++){t.call(null,e[r],r,e)}}else{for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t.call(null,e[i],i,e)}}}}function merge(){var e={};function t(t,r){if(isPlainObject(e[r])&&isPlainObject(t)){e[r]=merge(e[r],t)}else if(isPlainObject(t)){e[r]=merge({},t)}else if(isArray(t)){e[r]=t.slice()}else{e[r]=t}}for(var r=0,n=arguments.length;r<n;r++){forEach(arguments[r],t)}return e}function extend(e,t,r){forEach(t,(function t(n,i){if(r&&typeof n==="function"){e[i]=bind(n,r)}else{e[i]=n}}));return e}function stripBOM(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e}function inherits(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;r&&Object.assign(e.prototype,r)}function toFlatObject(e,t,r){var n;var i;var o;var s={};t=t||{};do{n=Object.getOwnPropertyNames(e);i=n.length;while(i-- >0){o=n[i];if(!s[o]){t[o]=e[o];s[o]=true}}e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t}function endsWith(e,t,r){e=String(e);if(r===undefined||r>e.length){r=e.length}r-=t.length;var n=e.indexOf(t,r);return n!==-1&&n===r}function toArray(e){if(!e)return null;var t=e.length;if(isUndefined(t))return null;var r=new Array(t);while(t-- >0){r[t]=e[t]}return r}var isTypedArray=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array!=="undefined"&&Object.getPrototypeOf(Uint8Array));var utils={isArray:isArray,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString,isNumber:isNumber,isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isFunction:isFunction,isStream:isStream,isURLSearchParams:isURLSearchParams,isStandardBrowserEnv:isStandardBrowserEnv,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,isTypedArray:isTypedArray,isFileList:isFileList};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL=function e(t,r,n){if(!r){return t}var i;if(n){i=n(r)}else if(utils.isURLSearchParams(r)){i=r.toString()}else{var o=[];utils.forEach(r,(function e(t,r){if(t===null||typeof t==="undefined"){return}if(utils.isArray(t)){r=r+"[]"}else{t=[t]}utils.forEach(t,(function e(t){if(utils.isDate(t)){t=t.toISOString()}else if(utils.isObject(t)){t=JSON.stringify(t)}o.push(encode(r)+"="+encode(t))}))}));i=o.join("&")}if(i){var s=t.indexOf("#");if(s!==-1){t=t.slice(0,s)}t+=(t.indexOf("?")===-1?"?":"&")+i}return t};function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function e(t,r,n){this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1};InterceptorManager.prototype.eject=function e(t){if(this.handlers[t]){this.handlers[t]=null}};InterceptorManager.prototype.forEach=function e(t){utils.forEach(this.handlers,(function e(r){if(r!==null){t(r)}}))};var InterceptorManager_1=InterceptorManager;var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function createCommonjsModule(e,t,r){return r={path:t,exports:{},require:function(e,t){return commonjsRequire()}},e(r,r.exports),r.exports}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:true});Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}));return t}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var process_1=commonjsGlobal.process;var normalizeHeaderName=function e(t,r){utils.forEach(t,(function e(n,i){if(i!==r&&i.toUpperCase()===r.toUpperCase()){t[r]=n;delete t[i]}}))};function AxiosError(e,t,r,n,i){Error.call(this);this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}utils.inherits(AxiosError,Error,{toJSON:function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype=AxiosError.prototype;var descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){descriptors[e]={value:e}}));Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype,"isAxiosError",{value:true});AxiosError.from=function(e,t,r,n,i,o){var s=Object.create(prototype);utils.toFlatObject(e,s,(function e(t){return t!==Error.prototype}));AxiosError.call(s,e.message,t,r,n,i);s.name=e.name;o&&Object.assign(s,o);return s};var AxiosError_1=AxiosError;var transitional={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};function toFormData(e,t){t=t||new FormData;var r=[];function n(e){if(e===null)return"";if(utils.isDate(e)){return e.toISOString()}if(utils.isArrayBuffer(e)||utils.isTypedArray(e)){return typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function i(e,o){if(utils.isPlainObject(e)||utils.isArray(e)){if(r.indexOf(e)!==-1){throw Error("Circular reference detected in "+o)}r.push(e);utils.forEach(e,(function e(r,s){if(utils.isUndefined(r))return;var a=o?o+"."+s:s;var f;if(r&&!o&&typeof r==="object"){if(utils.endsWith(s,"{}")){r=JSON.stringify(r)}else if(utils.endsWith(s,"[]")&&(f=utils.toArray(r))){f.forEach((function(e){!utils.isUndefined(e)&&t.append(a,n(e))}));return}}i(r,a)}));r.pop()}else{t.append(o,n(e))}}i(e);return t}var toFormData_1=toFormData;var settle=function e(t,r,n){var i=n.config.validateStatus;if(!n.status||!i||i(n.status)){t(n)}else{r(new AxiosError_1("Request failed with status code "+n.status,[AxiosError_1.ERR_BAD_REQUEST,AxiosError_1.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}};var cookies=utils.isStandardBrowserEnv()?function e(){return{write:function e(t,r,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(r));if(utils.isNumber(n)){a.push("expires="+new Date(n).toGMTString())}if(utils.isString(i)){a.push("path="+i)}if(utils.isString(o)){a.push("domain="+o)}if(s===true){a.push("secure")}document.cookie=a.join("; ")},read:function e(t){var r=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function e(t){this.write(t,"",Date.now()-864e5)}}}():function e(){return{write:function e(){},read:function e(){return null},remove:function e(){}}}();var isAbsoluteURL=function e(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)};var combineURLs=function e(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t};var buildFullPath=function e(t,r){if(t&&!isAbsoluteURL(r)){return combineURLs(t,r)}return r};var ignoreDuplicateOf=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];var parseHeaders=function e(t){var r={};var n;var i;var o;if(!t){return r}utils.forEach(t.split("\n"),(function e(t){o=t.indexOf(":");n=utils.trim(t.substr(0,o)).toLowerCase();i=utils.trim(t.substr(o+1));if(n){if(r[n]&&ignoreDuplicateOf.indexOf(n)>=0){return}if(n==="set-cookie"){r[n]=(r[n]?r[n]:[]).concat([i])}else{r[n]=r[n]?r[n]+", "+i:i}}}));return r};var isURLSameOrigin=utils.isStandardBrowserEnv()?function e(){var t=/(msie|trident)/i.test(navigator.userAgent);var r=document.createElement("a");var n;function i(e){var n=e;if(t){r.setAttribute("href",n);n=r.href}r.setAttribute("href",n);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}n=i(window.location.href);return function e(t){var r=utils.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function CanceledError(e){AxiosError_1.call(this,e==null?"canceled":e,AxiosError_1.ERR_CANCELED);this.name="CanceledError"}utils.inherits(CanceledError,AxiosError_1,{__CANCEL__:true});var CanceledError_1=CanceledError;var parseProtocol=function e(t){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""};var xhr=function e(t){return new Promise((function e(r,n){var i=t.data;var o=t.headers;var s=t.responseType;var a;function f(){if(t.cancelToken){t.cancelToken.unsubscribe(a)}if(t.signal){t.signal.removeEventListener("abort",a)}}if(utils.isFormData(i)&&utils.isStandardBrowserEnv()){delete o["Content-Type"]}var u=new XMLHttpRequest;if(t.auth){var c=t.auth.username||"";var l=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(c+":"+l)}var h=buildFullPath(t.baseURL,t.url);u.open(t.method.toUpperCase(),buildURL(h,t.params,t.paramsSerializer),true);u.timeout=t.timeout;function p(){if(!u){return}var e="getAllResponseHeaders"in u?parseHeaders(u.getAllResponseHeaders()):null;var i=!s||s==="text"||s==="json"?u.responseText:u.response;var o={data:i,status:u.status,statusText:u.statusText,headers:e,config:t,request:u};settle((function e(t){r(t);f()}),(function e(t){n(t);f()}),o);u=null}if("onloadend"in u){u.onloadend=p}else{u.onreadystatechange=function e(){if(!u||u.readyState!==4){return}if(u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)){return}setTimeout(p)}}u.onabort=function e(){if(!u){return}n(new AxiosError_1("Request aborted",AxiosError_1.ECONNABORTED,t,u));u=null};u.onerror=function e(){n(new AxiosError_1("Network Error",AxiosError_1.ERR_NETWORK,t,u,u));u=null};u.ontimeout=function e(){var r=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";var i=t.transitional||transitional;if(t.timeoutErrorMessage){r=t.timeoutErrorMessage}n(new AxiosError_1(r,i.clarifyTimeoutError?AxiosError_1.ETIMEDOUT:AxiosError_1.ECONNABORTED,t,u));u=null};if(utils.isStandardBrowserEnv()){var d=(t.withCredentials||isURLSameOrigin(h))&&t.xsrfCookieName?cookies.read(t.xsrfCookieName):undefined;if(d){o[t.xsrfHeaderName]=d}}if("setRequestHeader"in u){utils.forEach(o,(function e(t,r){if(typeof i==="undefined"&&r.toLowerCase()==="content-type"){delete o[r]}else{u.setRequestHeader(r,t)}}))}if(!utils.isUndefined(t.withCredentials)){u.withCredentials=!!t.withCredentials}if(s&&s!=="json"){u.responseType=t.responseType}if(typeof t.onDownloadProgress==="function"){u.addEventListener("progress",t.onDownloadProgress)}if(typeof t.onUploadProgress==="function"&&u.upload){u.upload.addEventListener("progress",t.onUploadProgress)}if(t.cancelToken||t.signal){a=function(e){if(!u){return}n(!e||e&&e.type?new CanceledError_1:e);u.abort();u=null};t.cancelToken&&t.cancelToken.subscribe(a);if(t.signal){t.signal.aborted?a():t.signal.addEventListener("abort",a)}}if(!i){i=null}var g=parseProtocol(h);if(g&&["http","https","file"].indexOf(g)===-1){n(new AxiosError_1("Unsupported protocol "+g+":",AxiosError_1.ERR_BAD_REQUEST,t));return}u.send(i)}))};var _null=null;var DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){if(!utils.isUndefined(e)&&utils.isUndefined(e["Content-Type"])){e["Content-Type"]=t}}function getDefaultAdapter(){var e;if(typeof XMLHttpRequest!=="undefined"){e=xhr}else if(typeof process_1!=="undefined"&&Object.prototype.toString.call(process_1)==="[object process]"){e=xhr}return e}function stringifySafely(e,t,r){if(utils.isString(e)){try{(t||JSON.parse)(e);return utils.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var defaults={transitional:transitional,adapter:getDefaultAdapter(),transformRequest:[function e(t,r){normalizeHeaderName(r,"Accept");normalizeHeaderName(r,"Content-Type");if(utils.isFormData(t)||utils.isArrayBuffer(t)||utils.isBuffer(t)||utils.isStream(t)||utils.isFile(t)||utils.isBlob(t)){return t}if(utils.isArrayBufferView(t)){return t.buffer}if(utils.isURLSearchParams(t)){setContentTypeIfUnset(r,"application/x-www-form-urlencoded;charset=utf-8");return t.toString()}var n=utils.isObject(t);var i=r&&r["Content-Type"];var o;if((o=utils.isFileList(t))||n&&i==="multipart/form-data"){var s=this.env&&this.env.FormData;return toFormData_1(o?{"files[]":t}:t,s&&new s)}else if(n||i==="application/json"){setContentTypeIfUnset(r,"application/json");return stringifySafely(t)}return t}],transformResponse:[function e(t){var r=this.transitional||defaults.transitional;var n=r&&r.silentJSONParsing;var i=r&&r.forcedJSONParsing;var o=!n&&this.responseType==="json";if(o||i&&utils.isString(t)&&t.length){try{return JSON.parse(t)}catch(e){if(o){if(e.name==="SyntaxError"){throw AxiosError_1.from(e,AxiosError_1.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_null},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils.forEach(["delete","get","head"],(function e(t){defaults.headers[t]={}}));utils.forEach(["post","put","patch"],(function e(t){defaults.headers[t]=utils.merge(DEFAULT_CONTENT_TYPE)}));var defaults_1=defaults;var transformData=function e(t,r,n){var i=this||defaults_1;utils.forEach(n,(function e(n){t=n.call(i,t,r)}));return t};var isCancel=function e(t){return!!(t&&t.__CANCEL__)};function throwIfCancellationRequested(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new CanceledError_1}}var dispatchRequest=function e(t){throwIfCancellationRequested(t);t.headers=t.headers||{};t.data=transformData.call(t,t.data,t.headers,t.transformRequest);t.headers=utils.merge(t.headers.common||{},t.headers[t.method]||{},t.headers);utils.forEach(["delete","get","head","post","put","patch","common"],(function e(r){delete t.headers[r]}));var r=t.adapter||defaults_1.adapter;return r(t).then((function e(r){throwIfCancellationRequested(t);r.data=transformData.call(t,r.data,r.headers,t.transformResponse);return r}),(function e(r){if(!isCancel(r)){throwIfCancellationRequested(t);if(r&&r.response){r.response.data=transformData.call(t,r.response.data,r.response.headers,t.transformResponse)}}return Promise.reject(r)}))};var mergeConfig=function e(t,r){r=r||{};var n={};function i(e,t){if(utils.isPlainObject(e)&&utils.isPlainObject(t)){return utils.merge(e,t)}else if(utils.isPlainObject(t)){return utils.merge({},t)}else if(utils.isArray(t)){return t.slice()}return t}function o(e){if(!utils.isUndefined(r[e])){return i(t[e],r[e])}else if(!utils.isUndefined(t[e])){return i(undefined,t[e])}}function s(e){if(!utils.isUndefined(r[e])){return i(undefined,r[e])}}function a(e){if(!utils.isUndefined(r[e])){return i(undefined,r[e])}else if(!utils.isUndefined(t[e])){return i(undefined,t[e])}}function f(e){if(e in r){return i(t[e],r[e])}else if(e in t){return i(undefined,t[e])}}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:f};utils.forEach(Object.keys(t).concat(Object.keys(r)),(function e(t){var r=u[t]||o;var i=r(t);utils.isUndefined(i)&&r!==f||(n[t]=i)}));return n};var data={version:"0.27.2"};var VERSION=data.version;var validators$1={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){validators$1[e]=function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var deprecatedWarnings={};validators$1.transitional=function e(t,r,n){function i(e,t){return"[Axios v"+VERSION+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,n,o){if(t===false){throw new AxiosError_1(i(n," has been removed"+(r?" in "+r:"")),AxiosError_1.ERR_DEPRECATED)}if(r&&!deprecatedWarnings[n]){deprecatedWarnings[n]=true;console.warn(i(n," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(e,n,o):true}};function assertOptions(e,t,r){if(typeof e!=="object"){throw new AxiosError_1("options must be an object",AxiosError_1.ERR_BAD_OPTION_VALUE)}var n=Object.keys(e);var i=n.length;while(i-- >0){var o=n[i];var s=t[o];if(s){var a=e[o];var f=a===undefined||s(a,o,e);if(f!==true){throw new AxiosError_1("option "+o+" must be "+f,AxiosError_1.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new AxiosError_1("Unknown option "+o,AxiosError_1.ERR_BAD_OPTION)}}}var validator={assertOptions:assertOptions,validators:validators$1};var validators=validator.validators;function Axios(e){this.defaults=e;this.interceptors={request:new InterceptorManager_1,response:new InterceptorManager_1}}Axios.prototype.request=function e(t,r){if(typeof t==="string"){r=r||{};r.url=t}else{r=t||{}}r=mergeConfig(this.defaults,r);if(r.method){r.method=r.method.toLowerCase()}else if(this.defaults.method){r.method=this.defaults.method.toLowerCase()}else{r.method="get"}var n=r.transitional;if(n!==undefined){validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},false)}var i=[];var o=true;this.interceptors.request.forEach((function e(t){if(typeof t.runWhen==="function"&&t.runWhen(r)===false){return}o=o&&t.synchronous;i.unshift(t.fulfilled,t.rejected)}));var s=[];this.interceptors.response.forEach((function e(t){s.push(t.fulfilled,t.rejected)}));var a;if(!o){var f=[dispatchRequest,undefined];Array.prototype.unshift.apply(f,i);f=f.concat(s);a=Promise.resolve(r);while(f.length){a=a.then(f.shift(),f.shift())}return a}var u=r;while(i.length){var c=i.shift();var l=i.shift();try{u=c(u)}catch(e){l(e);break}}try{a=dispatchRequest(u)}catch(e){return Promise.reject(e)}while(s.length){a=a.then(s.shift(),s.shift())}return a};Axios.prototype.getUri=function e(t){t=mergeConfig(this.defaults,t);var r=buildFullPath(t.baseURL,t.url);return buildURL(r,t.params,t.paramsSerializer)};utils.forEach(["delete","get","head","options"],(function e(t){Axios.prototype[t]=function(e,r){return this.request(mergeConfig(r||{},{method:t,url:e,data:(r||{}).data}))}}));utils.forEach(["post","put","patch"],(function e(t){function r(e){return function r(n,i,o){return this.request(mergeConfig(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Axios.prototype[t]=r();Axios.prototype[t+"Form"]=r(true)}));var Axios_1=Axios;function CancelToken(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}var t;this.promise=new Promise((function e(r){t=r}));var r=this;this.promise.then((function(e){if(!r._listeners)return;var t;var n=r._listeners.length;for(t=0;t<n;t++){r._listeners[t](e)}r._listeners=null}));this.promise.then=function(e){var t;var n=new Promise((function(e){r.subscribe(e);t=e})).then(e);n.cancel=function e(){r.unsubscribe(t)};return n};e((function e(n){if(r.reason){return}r.reason=new CanceledError_1(n);t(r.reason)}))}CancelToken.prototype.throwIfRequested=function e(){if(this.reason){throw this.reason}};CancelToken.prototype.subscribe=function e(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}};CancelToken.prototype.unsubscribe=function e(t){if(!this._listeners){return}var r=this._listeners.indexOf(t);if(r!==-1){this._listeners.splice(r,1)}};CancelToken.source=function e(){var t;var r=new CancelToken((function e(r){t=r}));return{token:r,cancel:t}};var CancelToken_1=CancelToken;var spread=function e(t){return function e(r){return t.apply(null,r)}};var isAxiosError=function e(t){return utils.isObject(t)&&t.isAxiosError===true};function createInstance(e){var t=new Axios_1(e);var r=bind(Axios_1.prototype.request,t);utils.extend(r,Axios_1.prototype,t);utils.extend(r,t);r.create=function t(r){return createInstance(mergeConfig(e,r))};return r}var axios$1=createInstance(defaults_1);axios$1.Axios=Axios_1;axios$1.CanceledError=CanceledError_1;axios$1.CancelToken=CancelToken_1;axios$1.isCancel=isCancel;axios$1.VERSION=data.version;axios$1.toFormData=toFormData_1;axios$1.AxiosError=AxiosError_1;axios$1.Cancel=axios$1.CanceledError;axios$1.all=function e(t){return Promise.all(t)};axios$1.spread=spread;axios$1.isAxiosError=isAxiosError;var axios_1=axios$1;var _default=axios$1;axios_1.default=_default;var axios=axios_1;var naiveFallback=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};var globalThis_1=function(){if(this)return this;if(typeof globalThis==="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return naiveFallback()}try{if(!__global__)return naiveFallback();return __global__}finally{delete Object.prototype.__global__}}();var requestLogger=function(e){console.debug("[JS-SDK] ".concat(e.method.toUpperCase()," ").concat(e.baseURL).concat(e.url),e.data?JSON.stringify(e.data):"");return e};var VerdocsEndpoint=function(){function e(e){this.environment="verdocs";this.sessionType="user";this.baseURL="https://api.verdocs.com";this.clientID="not-set";this.timeout=3e3;this.token=null;this.nextListenerId=0;this.sessionListeners=new Map;this.requestLoggerId=null;this.session=null;this.Documents=Documents;this.baseURL=(e===null||e===void 0?void 0:e.baseURL)||"https://api.verdocs.com";this.timeout=(e===null||e===void 0?void 0:e.timeout)||3e3;this.environment=(e===null||e===void 0?void 0:e.environment)||"verdocs";this.sessionType=(e===null||e===void 0?void 0:e.sessionType)||"user";this.clientID=(e===null||e===void 0?void 0:e.clientID)||"not-set";this.api=axios.create({baseURL:this.baseURL,timeout:this.timeout})}e.prototype.setDefault=function(){globalThis_1[ENDPOINT_KEY]=this};e.getDefault=function(){return globalThis_1[ENDPOINT_KEY]};e.prototype.getEnvironment=function(){return this.environment};e.prototype.getSessionType=function(){return this.sessionType};e.prototype.getBaseURL=function(){return this.baseURL};e.prototype.getClientID=function(){return this.clientID};e.prototype.getTimeout=function(){return this.timeout};e.prototype.getSession=function(){return this.session};e.prototype.setEnvironment=function(e){this.environment=e;return this};e.prototype.setSessionType=function(e){this.sessionType=e;return this};e.prototype.setBaseURL=function(e){this.api.defaults.baseURL=e;return this};e.prototype.setClientID=function(e){this.clientID=e;this.api.defaults.headers.common["X-Client-ID"]=e;return this};e.prototype.setTimeout=function(e){this.timeout=e;this.api.defaults.timeout=e;return this};e.prototype.logRequests=function(e){if(e&&this.requestLoggerId===null){this.requestLoggerId=this.api.interceptors.request.use(requestLogger)}else if(!e&&this.requestLoggerId!==null){this.api.interceptors.request.eject(this.requestLoggerId)}return this};e.prototype.setToken=function(e){if(!e){return this.clearSession()}var t=decodeAccessTokenBody(e);if(t===null||t.exp&&t.exp*1e3<(new Date).getTime()){return this.clearSession()}this.token=e;this.session=t;this.api.defaults.headers.common.Authorization="Bearer ".concat(e);localStorage.setItem(this.sessionStorageKey(),e);this.notifySessionListeners();return this};e.prototype.sessionStorageKey=function(){return"verdocs-session-".concat(this.getSessionType(),"-").concat(this.getEnvironment())};e.prototype.clearSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.notifySessionListeners=function(){var e=this;this.sessionListeners.forEach((function(t){try{t(e,e.session)}catch(e){}}))};e.prototype.onSessionChanged=function(e){var t=this;this.nextListenerId++;var r=Symbol.for(""+this.nextListenerId);this.sessionListeners.set(r,e);return function(){t.sessionListeners.delete(r)}};e.prototype.loadSession=function(){var e=localStorage.getItem(this.sessionStorageKey());if(!e){return this.clearSession()}return this.setToken(e)};return e}();var ENDPOINT_KEY=Symbol.for("verdocs-default-endpoint");if(!globalThis_1[ENDPOINT_KEY]){globalThis_1[ENDPOINT_KEY]=new VerdocsEndpoint}export{Buffer as B,VerdocsEndpoint as V,getDocument as a,getDocumentFile as b,updateDocumentField as c,getAugmentedNamespace as d,createCommonjsModule as e,getDefaultExportFromCjs as f,getSigningSession as g,commonjsGlobal as h,commonjsRequire as i,process_1 as p,updateRecipientStatus as u};
7
+ */var INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==undefined?global$1.TYPED_ARRAY_SUPPORT:true;function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t){throw new RangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=Buffer.prototype}else{if(e===null){e=new Buffer(t)}e.length=t}return e}function Buffer(e,t,r){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(e,t,r)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return allocUnsafe(this,e)}return from(this,e,t,r)}Buffer.poolSize=8192;Buffer._augment=function(e){e.__proto__=Buffer.prototype;return e};function from(e,t,r,n){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return fromArrayBuffer(e,t,r,n)}if(typeof t==="string"){return fromString(e,t,r)}return fromObject(e,t)}Buffer.from=function(e,t,r){return from(null,e,t,r)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array}function assertSize(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function alloc(e,t,r,n){assertSize(t);if(t<=0){return createBuffer(e,t)}if(r!==undefined){return typeof n==="string"?createBuffer(e,t).fill(r,n):createBuffer(e,t).fill(r)}return createBuffer(e,t)}Buffer.alloc=function(e,t,r){return alloc(null,e,t,r)};function allocUnsafe(e,t){assertSize(t);e=createBuffer(e,t<0?0:checked(t)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;++r){e[r]=0}}return e}Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)};Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)};function fromString(e,t,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}var n=byteLength(t,r)|0;e=createBuffer(e,n);var i=e.write(t,r);if(i!==n){e=e.slice(0,i)}return e}function fromArrayLike(e,t){var r=t.length<0?0:checked(t.length)|0;e=createBuffer(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function fromArrayBuffer(e,t,r,n){if(r<0||t.byteLength<r){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<r+(n||0)){throw new RangeError("'length' is out of bounds")}if(r===undefined&&n===undefined){t=new Uint8Array(t)}else if(n===undefined){t=new Uint8Array(t,r)}else{t=new Uint8Array(t,r,n)}if(Buffer.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=Buffer.prototype}else{e=fromArrayLike(e,t)}return e}function fromObject(e,t){if(internalIsBuffer(t)){var r=checked(t.length)|0;e=createBuffer(e,r);if(e.length===0){return e}t.copy(e,0,0,r);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||isnan(t.length)){return createBuffer(e,0)}return fromArrayLike(e,t)}if(t.type==="Buffer"&&isArray$1(t.data)){return fromArrayLike(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes")}return e|0}Buffer.isBuffer=isBuffer$1;function internalIsBuffer(e){return!!(e!=null&&e._isBuffer)}Buffer.compare=function e(t,r){if(!internalIsBuffer(t)||!internalIsBuffer(r)){throw new TypeError("Arguments must be Buffers")}if(t===r)return 0;var n=t.length;var i=r.length;for(var o=0,s=Math.min(n,i);o<s;++o){if(t[o]!==r[o]){n=t[o];i=r[o];break}}if(n<i)return-1;if(i<n)return 1;return 0};Buffer.isEncoding=function e(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function e(t,r){if(!isArray$1(t)){throw new TypeError('"list" argument must be an Array of Buffers')}if(t.length===0){return Buffer.alloc(0)}var n;if(r===undefined){r=0;for(n=0;n<t.length;++n){r+=t[n].length}}var i=Buffer.allocUnsafe(r);var o=0;for(n=0;n<t.length;++n){var s=t[n];if(!internalIsBuffer(s)){throw new TypeError('"list" argument must be an Array of Buffers')}s.copy(i,o);o+=s.length}return i};function byteLength(e,t){if(internalIsBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var r=e.length;if(r===0)return 0;var n=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case undefined:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase();n=true}}}Buffer.byteLength=byteLength;function slowToString(e,t,r){var n=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;t>>>=0;if(r<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}Buffer.prototype._isBuffer=true;function swap(e,t,r){var n=e[t];e[t]=e[r];e[r]=n}Buffer.prototype.swap16=function e(){var t=this.length;if(t%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<t;r+=2){swap(this,r,r+1)}return this};Buffer.prototype.swap32=function e(){var t=this.length;if(t%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<t;r+=4){swap(this,r,r+3);swap(this,r+1,r+2)}return this};Buffer.prototype.swap64=function e(){var t=this.length;if(t%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<t;r+=8){swap(this,r,r+7);swap(this,r+1,r+6);swap(this,r+2,r+5);swap(this,r+3,r+4)}return this};Buffer.prototype.toString=function e(){var t=this.length|0;if(t===0)return"";if(arguments.length===0)return utf8Slice(this,0,t);return slowToString.apply(this,arguments)};Buffer.prototype.equals=function e(t){if(!internalIsBuffer(t))throw new TypeError("Argument must be a Buffer");if(this===t)return true;return Buffer.compare(this,t)===0};Buffer.prototype.inspect=function e(){var t="";var r=INSPECT_MAX_BYTES;if(this.length>0){t=this.toString("hex",0,r).match(/.{2}/g).join(" ");if(this.length>r)t+=" ... "}return"<Buffer "+t+">"};Buffer.prototype.compare=function e(t,r,n,i,o){if(!internalIsBuffer(t)){throw new TypeError("Argument must be a Buffer")}if(r===undefined){r=0}if(n===undefined){n=t?t.length:0}if(i===undefined){i=0}if(o===undefined){o=this.length}if(r<0||n>t.length||i<0||o>this.length){throw new RangeError("out of range index")}if(i>=o&&r>=n){return 0}if(i>=o){return-1}if(r>=n){return 1}r>>>=0;n>>>=0;i>>>=0;o>>>=0;if(this===t)return 0;var s=o-i;var a=n-r;var f=Math.min(s,a);var u=this.slice(i,o);var c=t.slice(r,n);for(var l=0;l<f;++l){if(u[l]!==c[l]){s=u[l];a=c[l];break}}if(s<a)return-1;if(a<s)return 1;return 0};function bidirectionalIndexOf(e,t,r,n,i){if(e.length===0)return-1;if(typeof r==="string"){n=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=i?0:e.length-1}if(r<0)r=e.length+r;if(r>=e.length){if(i)return-1;else r=e.length-1}else if(r<0){if(i)r=0;else return-1}if(typeof t==="string"){t=Buffer.from(t,n)}if(internalIsBuffer(t)){if(t.length===0){return-1}return arrayIndexOf(e,t,r,n,i)}else if(typeof t==="number"){t=t&255;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(e,t,r)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,r)}}return arrayIndexOf(e,[t],r,n,i)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,i){var o=1;var s=e.length;var a=t.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(e.length<2||t.length<2){return-1}o=2;s/=2;a/=2;r/=2}}function f(e,t){if(o===1){return e[t]}else{return e.readUInt16BE(t*o)}}var u;if(i){var c=-1;for(u=r;u<s;u++){if(f(e,u)===f(t,c===-1?0:u-c)){if(c===-1)c=u;if(u-c+1===a)return c*o}else{if(c!==-1)u-=u-c;c=-1}}}else{if(r+a>s)r=s-a;for(u=r;u>=0;u--){var l=true;for(var h=0;h<a;h++){if(f(e,u+h)!==f(t,h)){l=false;break}}if(l)return u}}return-1}Buffer.prototype.includes=function e(t,r,n){return this.indexOf(t,r,n)!==-1};Buffer.prototype.indexOf=function e(t,r,n){return bidirectionalIndexOf(this,t,r,n,true)};Buffer.prototype.lastIndexOf=function e(t,r,n){return bidirectionalIndexOf(this,t,r,n,false)};function hexWrite(e,t,r,n){r=Number(r)||0;var i=e.length-r;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");if(n>o/2){n=o/2}for(var s=0;s<n;++s){var a=parseInt(t.substr(s*2,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(asciiToBytes(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,n)}Buffer.prototype.write=function e(t,r,n,i){if(r===undefined){i="utf8";n=this.length;r=0}else if(n===undefined&&typeof r==="string"){i=r;n=this.length;r=0}else if(isFinite(r)){r=r|0;if(isFinite(n)){n=n|0;if(i===undefined)i="utf8"}else{i=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var o=this.length-r;if(n===undefined||n>o)n=o;if(t.length>0&&(n<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return hexWrite(this,t,r,n);case"utf8":case"utf-8":return utf8Write(this,t,r,n);case"ascii":return asciiWrite(this,t,r,n);case"latin1":case"binary":return latin1Write(this,t,r,n);case"base64":return base64Write(this,t,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,t,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};Buffer.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(e,t,r){if(t===0&&r===e.length){return fromByteArray(e)}else{return fromByteArray(e.slice(t,r))}}function utf8Slice(e,t,r){r=Math.min(e.length,r);var n=[];var i=t;while(i<r){var o=e[i];var s=null;var a=o>239?4:o>223?3:o>191?2:1;if(i+a<=r){var f,u,c,l;switch(a){case 1:if(o<128){s=o}break;case 2:f=e[i+1];if((f&192)===128){l=(o&31)<<6|f&63;if(l>127){s=l}}break;case 3:f=e[i+1];u=e[i+2];if((f&192)===128&&(u&192)===128){l=(o&15)<<12|(f&63)<<6|u&63;if(l>2047&&(l<55296||l>57343)){s=l}}break;case 4:f=e[i+1];u=e[i+2];c=e[i+3];if((f&192)===128&&(u&192)===128&&(c&192)===128){l=(o&15)<<18|(f&63)<<12|(u&63)<<6|c&63;if(l>65535&&l<1114112){s=l}}}}if(s===null){s=65533;a=1}else if(s>65535){s-=65536;n.push(s>>>10&1023|55296);s=56320|s&1023}n.push(s);i+=a}return decodeCodePointsArray(n)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=MAX_ARGUMENTS_LENGTH){return String.fromCharCode.apply(String,e)}var r="";var n=0;while(n<t){r+=String.fromCharCode.apply(String,e.slice(n,n+=MAX_ARGUMENTS_LENGTH))}return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i]&127)}return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i])}return n}function hexSlice(e,t,r){var n=e.length;if(!t||t<0)t=0;if(!r||r<0||r>n)r=n;var i="";for(var o=t;o<r;++o){i+=toHex(e[o])}return i}function utf16leSlice(e,t,r){var n=e.slice(t,r);var i="";for(var o=0;o<n.length;o+=2){i+=String.fromCharCode(n[o]+n[o+1]*256)}return i}Buffer.prototype.slice=function e(t,r){var n=this.length;t=~~t;r=r===undefined?n:~~r;if(t<0){t+=n;if(t<0)t=0}else if(t>n){t=n}if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(r<t)r=t;var i;if(Buffer.TYPED_ARRAY_SUPPORT){i=this.subarray(t,r);i.__proto__=Buffer.prototype}else{var o=r-t;i=new Buffer(o,undefined);for(var s=0;s<o;++s){i[s]=this[s+t]}}return i};function checkOffset(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)checkOffset(t,r,this.length);var i=this[t];var o=1;var s=0;while(++s<r&&(o*=256)){i+=this[t+s]*o}return i};Buffer.prototype.readUIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n){checkOffset(t,r,this.length)}var i=this[t+--r];var o=1;while(r>0&&(o*=256)){i+=this[t+--r]*o}return i};Buffer.prototype.readUInt8=function e(t,r){if(!r)checkOffset(t,1,this.length);return this[t]};Buffer.prototype.readUInt16LE=function e(t,r){if(!r)checkOffset(t,2,this.length);return this[t]|this[t+1]<<8};Buffer.prototype.readUInt16BE=function e(t,r){if(!r)checkOffset(t,2,this.length);return this[t]<<8|this[t+1]};Buffer.prototype.readUInt32LE=function e(t,r){if(!r)checkOffset(t,4,this.length);return(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216};Buffer.prototype.readUInt32BE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])};Buffer.prototype.readIntLE=function e(t,r,n){t=t|0;r=r|0;if(!n)checkOffset(t,r,this.length);var i=this[t];var o=1;var s=0;while(++s<r&&(o*=256)){i+=this[t+s]*o}o*=128;if(i>=o)i-=Math.pow(2,8*r);return i};Buffer.prototype.readIntBE=function e(t,r,n){t=t|0;r=r|0;if(!n)checkOffset(t,r,this.length);var i=r;var o=1;var s=this[t+--i];while(i>0&&(o*=256)){s+=this[t+--i]*o}o*=128;if(s>=o)s-=Math.pow(2,8*r);return s};Buffer.prototype.readInt8=function e(t,r){if(!r)checkOffset(t,1,this.length);if(!(this[t]&128))return this[t];return(255-this[t]+1)*-1};Buffer.prototype.readInt16LE=function e(t,r){if(!r)checkOffset(t,2,this.length);var n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n};Buffer.prototype.readInt16BE=function e(t,r){if(!r)checkOffset(t,2,this.length);var n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n};Buffer.prototype.readInt32LE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24};Buffer.prototype.readInt32BE=function e(t,r){if(!r)checkOffset(t,4,this.length);return this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]};Buffer.prototype.readFloatLE=function e(t,r){if(!r)checkOffset(t,4,this.length);return read(this,t,true,23,4)};Buffer.prototype.readFloatBE=function e(t,r){if(!r)checkOffset(t,4,this.length);return read(this,t,false,23,4)};Buffer.prototype.readDoubleLE=function e(t,r){if(!r)checkOffset(t,8,this.length);return read(this,t,true,52,8)};Buffer.prototype.readDoubleBE=function e(t,r){if(!r)checkOffset(t,8,this.length);return read(this,t,false,52,8)};function checkInt(e,t,r,n,i,o){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var o=Math.pow(2,8*n)-1;checkInt(this,t,r,n,o,0)}var s=1;var a=0;this[r]=t&255;while(++a<n&&(s*=256)){this[r+a]=t/s&255}return r+n};Buffer.prototype.writeUIntBE=function e(t,r,n,i){t=+t;r=r|0;n=n|0;if(!i){var o=Math.pow(2,8*n)-1;checkInt(this,t,r,n,o,0)}var s=n-1;var a=1;this[r+s]=t&255;while(--s>=0&&(a*=256)){this[r+s]=t/a&255}return r+n};Buffer.prototype.writeUInt8=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)t=Math.floor(t);this[r]=t&255;return r+1};function objectWriteUInt16(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,o=Math.min(e.length-r,2);i<o;++i){e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{objectWriteUInt16(this,t,r,true)}return r+2};Buffer.prototype.writeUInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{objectWriteUInt16(this,t,r,false)}return r+2};function objectWriteUInt32(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,o=Math.min(e.length-r,4);i<o;++i){e[r+i]=t>>>(n?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r+3]=t>>>24;this[r+2]=t>>>16;this[r+1]=t>>>8;this[r]=t&255}else{objectWriteUInt32(this,t,r,true)}return r+4};Buffer.prototype.writeUInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{objectWriteUInt32(this,t,r,false)}return r+4};Buffer.prototype.writeIntLE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var o=Math.pow(2,8*n-1);checkInt(this,t,r,n,o-1,-o)}var s=0;var a=1;var f=0;this[r]=t&255;while(++s<n&&(a*=256)){if(t<0&&f===0&&this[r+s-1]!==0){f=1}this[r+s]=(t/a>>0)-f&255}return r+n};Buffer.prototype.writeIntBE=function e(t,r,n,i){t=+t;r=r|0;if(!i){var o=Math.pow(2,8*n-1);checkInt(this,t,r,n,o-1,-o)}var s=n-1;var a=1;var f=0;this[r+s]=t&255;while(--s>=0&&(a*=256)){if(t<0&&f===0&&this[r+s+1]!==0){f=1}this[r+s]=(t/a>>0)-f&255}return r+n};Buffer.prototype.writeInt8=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)t=Math.floor(t);if(t<0)t=255+t+1;this[r]=t&255;return r+1};Buffer.prototype.writeInt16LE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8}else{objectWriteUInt16(this,t,r,true)}return r+2};Buffer.prototype.writeInt16BE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>8;this[r+1]=t&255}else{objectWriteUInt16(this,t,r,false)}return r+2};Buffer.prototype.writeInt32LE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t&255;this[r+1]=t>>>8;this[r+2]=t>>>16;this[r+3]=t>>>24}else{objectWriteUInt32(this,t,r,true)}return r+4};Buffer.prototype.writeInt32BE=function e(t,r,n){t=+t;r=r|0;if(!n)checkInt(this,t,r,4,2147483647,-2147483648);if(t<0)t=4294967295+t+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[r]=t>>>24;this[r+1]=t>>>16;this[r+2]=t>>>8;this[r+3]=t&255}else{objectWriteUInt32(this,t,r,false)}return r+4};function checkIEEE754(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,i){if(!i){checkIEEE754(e,t,r,4)}write(e,t,r,n,23,4);return r+4}Buffer.prototype.writeFloatLE=function e(t,r,n){return writeFloat(this,t,r,true,n)};Buffer.prototype.writeFloatBE=function e(t,r,n){return writeFloat(this,t,r,false,n)};function writeDouble(e,t,r,n,i){if(!i){checkIEEE754(e,t,r,8)}write(e,t,r,n,52,8);return r+8}Buffer.prototype.writeDoubleLE=function e(t,r,n){return writeDouble(this,t,r,true,n)};Buffer.prototype.writeDoubleBE=function e(t,r,n){return writeDouble(this,t,r,false,n)};Buffer.prototype.copy=function e(t,r,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(r>=t.length)r=t.length;if(!r)r=0;if(i>0&&i<n)i=n;if(i===n)return 0;if(t.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(t.length-r<i-n){i=t.length-r+n}var o=i-n;var s;if(this===t&&n<r&&r<i){for(s=o-1;s>=0;--s){t[s+r]=this[s+n]}}else if(o<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(s=0;s<o;++s){t[s+r]=this[s+n]}}else{Uint8Array.prototype.set.call(t,this.subarray(n,n+o),r)}return o};Buffer.prototype.fill=function e(t,r,n,i){if(typeof t==="string"){if(typeof r==="string"){i=r;r=0;n=this.length}else if(typeof n==="string"){i=n;n=this.length}if(t.length===1){var o=t.charCodeAt(0);if(o<256){t=o}}if(i!==undefined&&typeof i!=="string"){throw new TypeError("encoding must be a string")}if(typeof i==="string"&&!Buffer.isEncoding(i)){throw new TypeError("Unknown encoding: "+i)}}else if(typeof t==="number"){t=t&255}if(r<0||this.length<r||this.length<n){throw new RangeError("Out of range index")}if(n<=r){return this}r=r>>>0;n=n===undefined?this.length:n>>>0;if(!t)t=0;var s;if(typeof t==="number"){for(s=r;s<n;++s){this[s]=t}}else{var a=internalIsBuffer(t)?t:utf8ToBytes(new Buffer(t,i).toString());var f=a.length;for(s=0;s<n-r;++s){this[s+r]=a[s%f]}}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){e=stringtrim(e).replace(INVALID_BASE64_RE,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function stringtrim(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function toHex(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function utf8ToBytes(e,t){t=t||Infinity;var r;var n=e.length;var i=null;var o=[];for(var s=0;s<n;++s){r=e.charCodeAt(s);if(r>55295&&r<57344){if(!i){if(r>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(s+1===n){if((t-=3)>-1)o.push(239,191,189);continue}i=r;continue}if(r<56320){if((t-=3)>-1)o.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((t-=3)>-1)o.push(239,191,189)}i=null;if(r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return o}function asciiToBytes(e){var t=[];for(var r=0;r<e.length;++r){t.push(e.charCodeAt(r)&255)}return t}function utf16leToBytes(e,t){var r,n,i;var o=[];for(var s=0;s<e.length;++s){if((t-=2)<0)break;r=e.charCodeAt(s);n=r>>8;i=r%256;o.push(i);o.push(n)}return o}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var i=0;i<n;++i){if(i+r>=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function isnan(e){return e!==e}function isBuffer$1(e){return e!=null&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&isFastBuffer(e.slice(0,0))}var b64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;var AtoB=function(e){e=String(e).replace(/[\t\n\f\r ]+/g,"");if(!b64re.test(e))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");e+="==".slice(2-(e.length&3));var t;var r="";var n;var i;var o=0;for(;o<e.length;){t=b64.indexOf(e.charAt(o++))<<18|b64.indexOf(e.charAt(o++))<<12|(n=b64.indexOf(e.charAt(o++)))<<6|(i=b64.indexOf(e.charAt(o++)));r+=n===64?String.fromCharCode(t>>16&255):i===64?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,t&255)}return r};var decodeJWTBody=function(e){return JSON.parse(AtoB((e||"").split(".")[1]||""))};var decodeAccessTokenBody=function(e){var t;try{t=decodeJWTBody(e);if(t===null){return null}}catch(e){return null}Object.keys(t).forEach((function(e){if(typeof e==="string"&&e.startsWith("https://verdocs.com/")){t[e.replace("https://verdocs.com/","")]=t[e];delete t[e]}}));return t};var __awaiter$1=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{f(n.next(e))}catch(e){o(e)}}function a(e){try{f(n["throw"](e))}catch(e){o(e)}}function f(e){e.done?r(e.value):i(e.value).then(s,a)}f((n=n.apply(e,t||[])).next())}))};var __generator$1=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return f([e,t])}}function f(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var getSummary=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.post("/documents/summary",{page:t}).then((function(e){return e.data}))]}))}))};var searchDocuments=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.post("/documents/search",t).then((function(e){return e.data}))]}))}))};var getSigningSession=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.get("/documents/".concat(t.documentId,"/recipients/").concat(encodeURIComponent(t.roleId),"/invitation/").concat(t.inviteCode)).then((function(t){var r,n;var i=((r=t.headers)===null||r===void 0?void 0:r.signer_token)||"";var o=decodeAccessTokenBody(i);e.setToken((n=t.headers)===null||n===void 0?void 0:n.signer_token);return{recipient:t.data,session:o,signerToken:i}}))]}))}))};var getDocumentRecipients=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.get("/documents/".concat(t,"/recipients")).then((function(e){return e.data}))]}))}))};var getDocument=function(e,t){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(r){return[2,e.api.get("/documents/".concat(t)).then((function(e){return e.data}))]}))}))};var getDocumentFile=function(e,t,r){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(n){return[2,e.api.get("/documents/".concat(t,"/envelope_documents/").concat(r,"?file=true"),{responseType:"arraybuffer"}).then((function(e){return Buffer.from(e.data,"binary").toString("base64")}))]}))}))};var updateDocumentField=function(e,t,r,n){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(i){return[2,e.api.put("/documents/".concat(t,"/fields/").concat(r),n).then((function(e){return e.data}))]}))}))};var updateDocumentFieldSignature=function(e,t,r,n){return __awaiter$1(void 0,void 0,void 0,(function(){return __generator$1(this,(function(i){return[2,e.api.put("/documents/".concat(t,"/fields/").concat(r,"/signature/").concat(n)).then((function(e){return e.data}))]}))}))};var Documents$1=Object.freeze({__proto__:null,getSummary:getSummary,searchDocuments:searchDocuments,getSigningSession:getSigningSession,getDocumentRecipients:getDocumentRecipients,getDocument:getDocument,getDocumentFile:getDocumentFile,updateDocumentField:updateDocumentField,updateDocumentFieldSignature:updateDocumentFieldSignature});var __assign=undefined&&undefined.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};var __awaiter=undefined&&undefined.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function s(e){try{f(n.next(e))}catch(e){o(e)}}function a(e){try{f(n["throw"](e))}catch(e){o(e)}}function f(e){e.done?r(e.value):i(e.value).then(s,a)}f((n=n.apply(e,t||[])).next())}))};var __generator=undefined&&undefined.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return f([e,t])}}function f(s){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;i=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var updateRecipientStatus=function(e,t,r,n,i){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(o){return[2,e.api.put("/documents/".concat(t,"/recipients/").concat(r),__assign({role_name:r,action:n},i||{})).then((function(e){return e.data}))]}))}))};var Recipients=Object.freeze({__proto__:null,updateRecipientStatus:updateRecipientStatus});var createSignature=function(e,t,r){var n=new FormData;n.append("signature",r,t);return e.api.post("/signatures",n).then((function(e){return e.data}))};var getSignatures=function(e){return e.api.get("/signatures").then((function(e){return e.data}))};var getSignature=function(e,t){return e.api.get("/signatures/".concat(t)).then((function(e){return e.data}))};var deleteSignature=function(e,t){return e.api.delete("/signatures/".concat(t)).then((function(e){return e.data}))};var Signatures=Object.freeze({__proto__:null,createSignature:createSignature,getSignatures:getSignatures,getSignature:getSignature,deleteSignature:deleteSignature});var createInitials=function(e,t,r){var n=new FormData;n.append("initial",r,t);return e.api.post("/initials",n).then((function(e){return e.data}))};var Initials=Object.freeze({__proto__:null,createInitials:createInitials});var Types=Object.freeze({__proto__:null});var Documents=Object.freeze({__proto__:null,Documents:Documents$1,Recipients:Recipients,Signatures:Signatures,Initials:Initials,Types:Types});var TemplatePermissions;(function(e){e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_MEMBER_READ"]="template:member:read";e["TEMPLATE_MEMBER_WRITE"]="template:member:write";e["TEMPLATE_MEMBER_DELETE"]="template:member:delete";e["TEMPLATE_MEMBER_VISIBILITY"]="template:member:visibility"})(TemplatePermissions||(TemplatePermissions={}));var TemplateSenderTypes;(function(e){e["CREATOR"]="creator";e["ORGANIZATION_MEMBER"]="organization_member";e["ORGANIZATION_MEMBER_AS_CREATOR"]="organization_member_as_creator";e["EVERYONE"]="everyone";e["EVERYONE_AS_CREATOR"]="everyone_as_creator"})(TemplateSenderTypes||(TemplateSenderTypes={}));var TemplateActions;(function(e){e["CREATE_PERSONAL"]="create_personal";e["CREATE_ORG"]="create_org";e["CREATE_PUBLIC"]="create_public";e["READ"]="read";e["WRITE"]="write";e["DELETE"]="delete";e["CHANGE_VISIBILITY_PERSONAL"]="change_visibility_personal";e["CHANGE_VISIBILITY_ORG"]="change_visibility_org";e["CHANGE_VISIBILITY_PUBLIC"]="change_visibility_public"})(TemplateActions||(TemplateActions={}));var SortOptions;(function(e){e["CREATED_AT"]="created_at";e["UPDATED_AT"]="updated_at";e["NAME"]="name";e["LAST_USED_AT"]="last_used_at";e["COUNTER"]="counter";e["STAR_COUNTER"]="star_counter"})(SortOptions||(SortOptions={}));var bind=function e(t,r){return function e(){var n=new Array(arguments.length);for(var i=0;i<n.length;i++){n[i]=arguments[i]}return t.apply(r,n)}};var toString=Object.prototype.toString;var kindOf=function(e){return function(t){var r=toString.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function kindOfTest(e){e=e.toLowerCase();return function t(r){return kindOf(r)===e}}function isArray(e){return Array.isArray(e)}function isUndefined(e){return typeof e==="undefined"}function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}var isArrayBuffer=kindOfTest("ArrayBuffer");function isArrayBufferView(e){var t;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){t=ArrayBuffer.isView(e)}else{t=e&&e.buffer&&isArrayBuffer(e.buffer)}return t}function isString(e){return typeof e==="string"}function isNumber(e){return typeof e==="number"}function isObject(e){return e!==null&&typeof e==="object"}function isPlainObject(e){if(kindOf(e)!=="object"){return false}var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var isDate=kindOfTest("Date");var isFile=kindOfTest("File");var isBlob=kindOfTest("Blob");var isFileList=kindOfTest("FileList");function isFunction(e){return toString.call(e)==="[object Function]"}function isStream(e){return isObject(e)&&isFunction(e.pipe)}function isFormData(e){var t="[object FormData]";return e&&(typeof FormData==="function"&&e instanceof FormData||toString.call(e)===t||isFunction(e.toString)&&e.toString()===t)}var isURLSearchParams=kindOfTest("URLSearchParams");function trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function isStandardBrowserEnv(){if(typeof navigator!=="undefined"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")){return false}return typeof window!=="undefined"&&typeof document!=="undefined"}function forEach(e,t){if(e===null||typeof e==="undefined"){return}if(typeof e!=="object"){e=[e]}if(isArray(e)){for(var r=0,n=e.length;r<n;r++){t.call(null,e[r],r,e)}}else{for(var i in e){if(Object.prototype.hasOwnProperty.call(e,i)){t.call(null,e[i],i,e)}}}}function merge(){var e={};function t(t,r){if(isPlainObject(e[r])&&isPlainObject(t)){e[r]=merge(e[r],t)}else if(isPlainObject(t)){e[r]=merge({},t)}else if(isArray(t)){e[r]=t.slice()}else{e[r]=t}}for(var r=0,n=arguments.length;r<n;r++){forEach(arguments[r],t)}return e}function extend(e,t,r){forEach(t,(function t(n,i){if(r&&typeof n==="function"){e[i]=bind(n,r)}else{e[i]=n}}));return e}function stripBOM(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e}function inherits(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;r&&Object.assign(e.prototype,r)}function toFlatObject(e,t,r){var n;var i;var o;var s={};t=t||{};do{n=Object.getOwnPropertyNames(e);i=n.length;while(i-- >0){o=n[i];if(!s[o]){t[o]=e[o];s[o]=true}}e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t}function endsWith(e,t,r){e=String(e);if(r===undefined||r>e.length){r=e.length}r-=t.length;var n=e.indexOf(t,r);return n!==-1&&n===r}function toArray(e){if(!e)return null;var t=e.length;if(isUndefined(t))return null;var r=new Array(t);while(t-- >0){r[t]=e[t]}return r}var isTypedArray=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array!=="undefined"&&Object.getPrototypeOf(Uint8Array));var utils={isArray:isArray,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString,isNumber:isNumber,isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isFunction:isFunction,isStream:isStream,isURLSearchParams:isURLSearchParams,isStandardBrowserEnv:isStandardBrowserEnv,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,isTypedArray:isTypedArray,isFileList:isFileList};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL=function e(t,r,n){if(!r){return t}var i;if(n){i=n(r)}else if(utils.isURLSearchParams(r)){i=r.toString()}else{var o=[];utils.forEach(r,(function e(t,r){if(t===null||typeof t==="undefined"){return}if(utils.isArray(t)){r=r+"[]"}else{t=[t]}utils.forEach(t,(function e(t){if(utils.isDate(t)){t=t.toISOString()}else if(utils.isObject(t)){t=JSON.stringify(t)}o.push(encode(r)+"="+encode(t))}))}));i=o.join("&")}if(i){var s=t.indexOf("#");if(s!==-1){t=t.slice(0,s)}t+=(t.indexOf("?")===-1?"?":"&")+i}return t};function InterceptorManager(){this.handlers=[]}InterceptorManager.prototype.use=function e(t,r,n){this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1};InterceptorManager.prototype.eject=function e(t){if(this.handlers[t]){this.handlers[t]=null}};InterceptorManager.prototype.forEach=function e(t){utils.forEach(this.handlers,(function e(r){if(r!==null){t(r)}}))};var InterceptorManager_1=InterceptorManager;var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function createCommonjsModule(e,t,r){return r={path:t,exports:{},require:function(e,t){return commonjsRequire()}},e(r,r.exports),r.exports}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:true});Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:true,get:function(){return e[r]}})}));return t}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var process_1=commonjsGlobal.process;var normalizeHeaderName=function e(t,r){utils.forEach(t,(function e(n,i){if(i!==r&&i.toUpperCase()===r.toUpperCase()){t[r]=n;delete t[i]}}))};function AxiosError(e,t,r,n,i){Error.call(this);this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}utils.inherits(AxiosError,Error,{toJSON:function e(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype=AxiosError.prototype;var descriptors={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){descriptors[e]={value:e}}));Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype,"isAxiosError",{value:true});AxiosError.from=function(e,t,r,n,i,o){var s=Object.create(prototype);utils.toFlatObject(e,s,(function e(t){return t!==Error.prototype}));AxiosError.call(s,e.message,t,r,n,i);s.name=e.name;o&&Object.assign(s,o);return s};var AxiosError_1=AxiosError;var transitional={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};function toFormData(e,t){t=t||new FormData;var r=[];function n(e){if(e===null)return"";if(utils.isDate(e)){return e.toISOString()}if(utils.isArrayBuffer(e)||utils.isTypedArray(e)){return typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function i(e,o){if(utils.isPlainObject(e)||utils.isArray(e)){if(r.indexOf(e)!==-1){throw Error("Circular reference detected in "+o)}r.push(e);utils.forEach(e,(function e(r,s){if(utils.isUndefined(r))return;var a=o?o+"."+s:s;var f;if(r&&!o&&typeof r==="object"){if(utils.endsWith(s,"{}")){r=JSON.stringify(r)}else if(utils.endsWith(s,"[]")&&(f=utils.toArray(r))){f.forEach((function(e){!utils.isUndefined(e)&&t.append(a,n(e))}));return}}i(r,a)}));r.pop()}else{t.append(o,n(e))}}i(e);return t}var toFormData_1=toFormData;var settle=function e(t,r,n){var i=n.config.validateStatus;if(!n.status||!i||i(n.status)){t(n)}else{r(new AxiosError_1("Request failed with status code "+n.status,[AxiosError_1.ERR_BAD_REQUEST,AxiosError_1.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}};var cookies=utils.isStandardBrowserEnv()?function e(){return{write:function e(t,r,n,i,o,s){var a=[];a.push(t+"="+encodeURIComponent(r));if(utils.isNumber(n)){a.push("expires="+new Date(n).toGMTString())}if(utils.isString(i)){a.push("path="+i)}if(utils.isString(o)){a.push("domain="+o)}if(s===true){a.push("secure")}document.cookie=a.join("; ")},read:function e(t){var r=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function e(t){this.write(t,"",Date.now()-864e5)}}}():function e(){return{write:function e(){},read:function e(){return null},remove:function e(){}}}();var isAbsoluteURL=function e(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)};var combineURLs=function e(t,r){return r?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t};var buildFullPath=function e(t,r){if(t&&!isAbsoluteURL(r)){return combineURLs(t,r)}return r};var ignoreDuplicateOf=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];var parseHeaders=function e(t){var r={};var n;var i;var o;if(!t){return r}utils.forEach(t.split("\n"),(function e(t){o=t.indexOf(":");n=utils.trim(t.substr(0,o)).toLowerCase();i=utils.trim(t.substr(o+1));if(n){if(r[n]&&ignoreDuplicateOf.indexOf(n)>=0){return}if(n==="set-cookie"){r[n]=(r[n]?r[n]:[]).concat([i])}else{r[n]=r[n]?r[n]+", "+i:i}}}));return r};var isURLSameOrigin=utils.isStandardBrowserEnv()?function e(){var t=/(msie|trident)/i.test(navigator.userAgent);var r=document.createElement("a");var n;function i(e){var n=e;if(t){r.setAttribute("href",n);n=r.href}r.setAttribute("href",n);return{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}n=i(window.location.href);return function e(t){var r=utils.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function CanceledError(e){AxiosError_1.call(this,e==null?"canceled":e,AxiosError_1.ERR_CANCELED);this.name="CanceledError"}utils.inherits(CanceledError,AxiosError_1,{__CANCEL__:true});var CanceledError_1=CanceledError;var parseProtocol=function e(t){var r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return r&&r[1]||""};var xhr=function e(t){return new Promise((function e(r,n){var i=t.data;var o=t.headers;var s=t.responseType;var a;function f(){if(t.cancelToken){t.cancelToken.unsubscribe(a)}if(t.signal){t.signal.removeEventListener("abort",a)}}if(utils.isFormData(i)&&utils.isStandardBrowserEnv()){delete o["Content-Type"]}var u=new XMLHttpRequest;if(t.auth){var c=t.auth.username||"";var l=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.Authorization="Basic "+btoa(c+":"+l)}var h=buildFullPath(t.baseURL,t.url);u.open(t.method.toUpperCase(),buildURL(h,t.params,t.paramsSerializer),true);u.timeout=t.timeout;function p(){if(!u){return}var e="getAllResponseHeaders"in u?parseHeaders(u.getAllResponseHeaders()):null;var i=!s||s==="text"||s==="json"?u.responseText:u.response;var o={data:i,status:u.status,statusText:u.statusText,headers:e,config:t,request:u};settle((function e(t){r(t);f()}),(function e(t){n(t);f()}),o);u=null}if("onloadend"in u){u.onloadend=p}else{u.onreadystatechange=function e(){if(!u||u.readyState!==4){return}if(u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)){return}setTimeout(p)}}u.onabort=function e(){if(!u){return}n(new AxiosError_1("Request aborted",AxiosError_1.ECONNABORTED,t,u));u=null};u.onerror=function e(){n(new AxiosError_1("Network Error",AxiosError_1.ERR_NETWORK,t,u,u));u=null};u.ontimeout=function e(){var r=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";var i=t.transitional||transitional;if(t.timeoutErrorMessage){r=t.timeoutErrorMessage}n(new AxiosError_1(r,i.clarifyTimeoutError?AxiosError_1.ETIMEDOUT:AxiosError_1.ECONNABORTED,t,u));u=null};if(utils.isStandardBrowserEnv()){var d=(t.withCredentials||isURLSameOrigin(h))&&t.xsrfCookieName?cookies.read(t.xsrfCookieName):undefined;if(d){o[t.xsrfHeaderName]=d}}if("setRequestHeader"in u){utils.forEach(o,(function e(t,r){if(typeof i==="undefined"&&r.toLowerCase()==="content-type"){delete o[r]}else{u.setRequestHeader(r,t)}}))}if(!utils.isUndefined(t.withCredentials)){u.withCredentials=!!t.withCredentials}if(s&&s!=="json"){u.responseType=t.responseType}if(typeof t.onDownloadProgress==="function"){u.addEventListener("progress",t.onDownloadProgress)}if(typeof t.onUploadProgress==="function"&&u.upload){u.upload.addEventListener("progress",t.onUploadProgress)}if(t.cancelToken||t.signal){a=function(e){if(!u){return}n(!e||e&&e.type?new CanceledError_1:e);u.abort();u=null};t.cancelToken&&t.cancelToken.subscribe(a);if(t.signal){t.signal.aborted?a():t.signal.addEventListener("abort",a)}}if(!i){i=null}var g=parseProtocol(h);if(g&&["http","https","file"].indexOf(g)===-1){n(new AxiosError_1("Unsupported protocol "+g+":",AxiosError_1.ERR_BAD_REQUEST,t));return}u.send(i)}))};var _null=null;var DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(e,t){if(!utils.isUndefined(e)&&utils.isUndefined(e["Content-Type"])){e["Content-Type"]=t}}function getDefaultAdapter(){var e;if(typeof XMLHttpRequest!=="undefined"){e=xhr}else if(typeof process_1!=="undefined"&&Object.prototype.toString.call(process_1)==="[object process]"){e=xhr}return e}function stringifySafely(e,t,r){if(utils.isString(e)){try{(t||JSON.parse)(e);return utils.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var defaults={transitional:transitional,adapter:getDefaultAdapter(),transformRequest:[function e(t,r){normalizeHeaderName(r,"Accept");normalizeHeaderName(r,"Content-Type");if(utils.isFormData(t)||utils.isArrayBuffer(t)||utils.isBuffer(t)||utils.isStream(t)||utils.isFile(t)||utils.isBlob(t)){return t}if(utils.isArrayBufferView(t)){return t.buffer}if(utils.isURLSearchParams(t)){setContentTypeIfUnset(r,"application/x-www-form-urlencoded;charset=utf-8");return t.toString()}var n=utils.isObject(t);var i=r&&r["Content-Type"];var o;if((o=utils.isFileList(t))||n&&i==="multipart/form-data"){var s=this.env&&this.env.FormData;return toFormData_1(o?{"files[]":t}:t,s&&new s)}else if(n||i==="application/json"){setContentTypeIfUnset(r,"application/json");return stringifySafely(t)}return t}],transformResponse:[function e(t){var r=this.transitional||defaults.transitional;var n=r&&r.silentJSONParsing;var i=r&&r.forcedJSONParsing;var o=!n&&this.responseType==="json";if(o||i&&utils.isString(t)&&t.length){try{return JSON.parse(t)}catch(e){if(o){if(e.name==="SyntaxError"){throw AxiosError_1.from(e,AxiosError_1.ERR_BAD_RESPONSE,this,null,this.response)}throw e}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:_null},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};utils.forEach(["delete","get","head"],(function e(t){defaults.headers[t]={}}));utils.forEach(["post","put","patch"],(function e(t){defaults.headers[t]=utils.merge(DEFAULT_CONTENT_TYPE)}));var defaults_1=defaults;var transformData=function e(t,r,n){var i=this||defaults_1;utils.forEach(n,(function e(n){t=n.call(i,t,r)}));return t};var isCancel=function e(t){return!!(t&&t.__CANCEL__)};function throwIfCancellationRequested(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new CanceledError_1}}var dispatchRequest=function e(t){throwIfCancellationRequested(t);t.headers=t.headers||{};t.data=transformData.call(t,t.data,t.headers,t.transformRequest);t.headers=utils.merge(t.headers.common||{},t.headers[t.method]||{},t.headers);utils.forEach(["delete","get","head","post","put","patch","common"],(function e(r){delete t.headers[r]}));var r=t.adapter||defaults_1.adapter;return r(t).then((function e(r){throwIfCancellationRequested(t);r.data=transformData.call(t,r.data,r.headers,t.transformResponse);return r}),(function e(r){if(!isCancel(r)){throwIfCancellationRequested(t);if(r&&r.response){r.response.data=transformData.call(t,r.response.data,r.response.headers,t.transformResponse)}}return Promise.reject(r)}))};var mergeConfig=function e(t,r){r=r||{};var n={};function i(e,t){if(utils.isPlainObject(e)&&utils.isPlainObject(t)){return utils.merge(e,t)}else if(utils.isPlainObject(t)){return utils.merge({},t)}else if(utils.isArray(t)){return t.slice()}return t}function o(e){if(!utils.isUndefined(r[e])){return i(t[e],r[e])}else if(!utils.isUndefined(t[e])){return i(undefined,t[e])}}function s(e){if(!utils.isUndefined(r[e])){return i(undefined,r[e])}}function a(e){if(!utils.isUndefined(r[e])){return i(undefined,r[e])}else if(!utils.isUndefined(t[e])){return i(undefined,t[e])}}function f(e){if(e in r){return i(t[e],r[e])}else if(e in t){return i(undefined,t[e])}}var u={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:f};utils.forEach(Object.keys(t).concat(Object.keys(r)),(function e(t){var r=u[t]||o;var i=r(t);utils.isUndefined(i)&&r!==f||(n[t]=i)}));return n};var data={version:"0.27.2"};var VERSION=data.version;var validators$1={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){validators$1[e]=function r(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));var deprecatedWarnings={};validators$1.transitional=function e(t,r,n){function i(e,t){return"[Axios v"+VERSION+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(e,n,o){if(t===false){throw new AxiosError_1(i(n," has been removed"+(r?" in "+r:"")),AxiosError_1.ERR_DEPRECATED)}if(r&&!deprecatedWarnings[n]){deprecatedWarnings[n]=true;console.warn(i(n," has been deprecated since v"+r+" and will be removed in the near future"))}return t?t(e,n,o):true}};function assertOptions(e,t,r){if(typeof e!=="object"){throw new AxiosError_1("options must be an object",AxiosError_1.ERR_BAD_OPTION_VALUE)}var n=Object.keys(e);var i=n.length;while(i-- >0){var o=n[i];var s=t[o];if(s){var a=e[o];var f=a===undefined||s(a,o,e);if(f!==true){throw new AxiosError_1("option "+o+" must be "+f,AxiosError_1.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new AxiosError_1("Unknown option "+o,AxiosError_1.ERR_BAD_OPTION)}}}var validator={assertOptions:assertOptions,validators:validators$1};var validators=validator.validators;function Axios(e){this.defaults=e;this.interceptors={request:new InterceptorManager_1,response:new InterceptorManager_1}}Axios.prototype.request=function e(t,r){if(typeof t==="string"){r=r||{};r.url=t}else{r=t||{}}r=mergeConfig(this.defaults,r);if(r.method){r.method=r.method.toLowerCase()}else if(this.defaults.method){r.method=this.defaults.method.toLowerCase()}else{r.method="get"}var n=r.transitional;if(n!==undefined){validator.assertOptions(n,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},false)}var i=[];var o=true;this.interceptors.request.forEach((function e(t){if(typeof t.runWhen==="function"&&t.runWhen(r)===false){return}o=o&&t.synchronous;i.unshift(t.fulfilled,t.rejected)}));var s=[];this.interceptors.response.forEach((function e(t){s.push(t.fulfilled,t.rejected)}));var a;if(!o){var f=[dispatchRequest,undefined];Array.prototype.unshift.apply(f,i);f=f.concat(s);a=Promise.resolve(r);while(f.length){a=a.then(f.shift(),f.shift())}return a}var u=r;while(i.length){var c=i.shift();var l=i.shift();try{u=c(u)}catch(e){l(e);break}}try{a=dispatchRequest(u)}catch(e){return Promise.reject(e)}while(s.length){a=a.then(s.shift(),s.shift())}return a};Axios.prototype.getUri=function e(t){t=mergeConfig(this.defaults,t);var r=buildFullPath(t.baseURL,t.url);return buildURL(r,t.params,t.paramsSerializer)};utils.forEach(["delete","get","head","options"],(function e(t){Axios.prototype[t]=function(e,r){return this.request(mergeConfig(r||{},{method:t,url:e,data:(r||{}).data}))}}));utils.forEach(["post","put","patch"],(function e(t){function r(e){return function r(n,i,o){return this.request(mergeConfig(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:i}))}}Axios.prototype[t]=r();Axios.prototype[t+"Form"]=r(true)}));var Axios_1=Axios;function CancelToken(e){if(typeof e!=="function"){throw new TypeError("executor must be a function.")}var t;this.promise=new Promise((function e(r){t=r}));var r=this;this.promise.then((function(e){if(!r._listeners)return;var t;var n=r._listeners.length;for(t=0;t<n;t++){r._listeners[t](e)}r._listeners=null}));this.promise.then=function(e){var t;var n=new Promise((function(e){r.subscribe(e);t=e})).then(e);n.cancel=function e(){r.unsubscribe(t)};return n};e((function e(n){if(r.reason){return}r.reason=new CanceledError_1(n);t(r.reason)}))}CancelToken.prototype.throwIfRequested=function e(){if(this.reason){throw this.reason}};CancelToken.prototype.subscribe=function e(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}};CancelToken.prototype.unsubscribe=function e(t){if(!this._listeners){return}var r=this._listeners.indexOf(t);if(r!==-1){this._listeners.splice(r,1)}};CancelToken.source=function e(){var t;var r=new CancelToken((function e(r){t=r}));return{token:r,cancel:t}};var CancelToken_1=CancelToken;var spread=function e(t){return function e(r){return t.apply(null,r)}};var isAxiosError=function e(t){return utils.isObject(t)&&t.isAxiosError===true};function createInstance(e){var t=new Axios_1(e);var r=bind(Axios_1.prototype.request,t);utils.extend(r,Axios_1.prototype,t);utils.extend(r,t);r.create=function t(r){return createInstance(mergeConfig(e,r))};return r}var axios$1=createInstance(defaults_1);axios$1.Axios=Axios_1;axios$1.CanceledError=CanceledError_1;axios$1.CancelToken=CancelToken_1;axios$1.isCancel=isCancel;axios$1.VERSION=data.version;axios$1.toFormData=toFormData_1;axios$1.AxiosError=AxiosError_1;axios$1.Cancel=axios$1.CanceledError;axios$1.all=function e(t){return Promise.all(t)};axios$1.spread=spread;axios$1.isAxiosError=isAxiosError;var axios_1=axios$1;var _default=axios$1;axios_1.default=_default;var axios=axios_1;var naiveFallback=function(){if(typeof self==="object"&&self)return self;if(typeof window==="object"&&window)return window;throw new Error("Unable to resolve global `this`")};var globalThis_1=function(){if(this)return this;if(typeof globalThis==="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:true})}catch(e){return naiveFallback()}try{if(!__global__)return naiveFallback();return __global__}finally{delete Object.prototype.__global__}}();var requestLogger=function(e){console.debug("[JS-SDK] ".concat(e.method.toUpperCase()," ").concat(e.baseURL).concat(e.url),e.data?JSON.stringify(e.data):"");return e};var VerdocsEndpoint=function(){function e(e){this.environment="verdocs";this.sessionType="user";this.baseURL="https://api.verdocs.com";this.clientID="not-set";this.timeout=3e3;this.token=null;this.nextListenerId=0;this.sessionListeners=new Map;this.requestLoggerId=null;this.session=null;this.Documents=Documents;this.baseURL=(e===null||e===void 0?void 0:e.baseURL)||"https://api.verdocs.com";this.timeout=(e===null||e===void 0?void 0:e.timeout)||3e3;this.environment=(e===null||e===void 0?void 0:e.environment)||"verdocs";this.sessionType=(e===null||e===void 0?void 0:e.sessionType)||"user";this.clientID=(e===null||e===void 0?void 0:e.clientID)||"not-set";this.api=axios.create({baseURL:this.baseURL,timeout:this.timeout})}e.prototype.setDefault=function(){globalThis_1[ENDPOINT_KEY]=this};e.getDefault=function(){return globalThis_1[ENDPOINT_KEY]};e.prototype.getEnvironment=function(){return this.environment};e.prototype.getSessionType=function(){return this.sessionType};e.prototype.getBaseURL=function(){return this.baseURL};e.prototype.getClientID=function(){return this.clientID};e.prototype.getTimeout=function(){return this.timeout};e.prototype.getSession=function(){return this.session};e.prototype.setEnvironment=function(e){this.environment=e;return this};e.prototype.setSessionType=function(e){this.sessionType=e;return this};e.prototype.setBaseURL=function(e){this.api.defaults.baseURL=e;return this};e.prototype.setClientID=function(e){this.clientID=e;this.api.defaults.headers.common["X-Client-ID"]=e;return this};e.prototype.setTimeout=function(e){this.timeout=e;this.api.defaults.timeout=e;return this};e.prototype.logRequests=function(e){if(e&&this.requestLoggerId===null){this.requestLoggerId=this.api.interceptors.request.use(requestLogger)}else if(!e&&this.requestLoggerId!==null){this.api.interceptors.request.eject(this.requestLoggerId)}return this};e.prototype.setToken=function(e){if(!e){return this.clearSession()}var t=decodeAccessTokenBody(e);if(t===null||t.exp&&t.exp*1e3<(new Date).getTime()){return this.clearSession()}this.token=e;this.session=t;this.api.defaults.headers.common.Authorization="Bearer ".concat(e);localStorage.setItem(this.sessionStorageKey(),e);this.notifySessionListeners();return this};e.prototype.getToken=function(){return this.token};e.prototype.sessionStorageKey=function(){return"verdocs-session-".concat(this.getSessionType(),"-").concat(this.getEnvironment())};e.prototype.clearSession=function(){localStorage.removeItem(this.sessionStorageKey());delete this.api.defaults.headers.common.Authorization;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.notifySessionListeners=function(){var e=this;this.sessionListeners.forEach((function(t){try{t(e,e.session)}catch(e){}}))};e.prototype.onSessionChanged=function(e){var t=this;this.nextListenerId++;var r=Symbol.for(""+this.nextListenerId);this.sessionListeners.set(r,e);return function(){t.sessionListeners.delete(r)}};e.prototype.loadSession=function(){var e=localStorage.getItem(this.sessionStorageKey());if(!e){return this.clearSession()}return this.setToken(e)};return e}();var ENDPOINT_KEY=Symbol.for("verdocs-default-endpoint");if(!globalThis_1[ENDPOINT_KEY]){globalThis_1[ENDPOINT_KEY]=new VerdocsEndpoint}export{Buffer as B,VerdocsEndpoint as V,getDocument as a,getDocumentFile as b,updateDocumentField as c,getAugmentedNamespace as d,createCommonjsModule as e,getDefaultExportFromCjs as f,getSigningSession as g,commonjsGlobal as h,commonjsRequire as i,process_1 as p,updateRecipientStatus as u};
@@ -1 +1 @@
1
- import{p as promiseResolve,b as bootstrapLazy}from"./index-859bc689.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(e,d){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["verdocs-sign",[[0,"verdocs-sign",{endpoint:[16],documentid:[1],roleid:[1],invitecode:[1],recipient:[32],signerToken:[32],pdfUrl:[32],recipientIndex:[32],document:[32],fields:[32],pdfPageInfo:[32],hasSignature:[32],nextButtonLabel:[32],focusedField:[32]}]]],["verdocs-auth",[[0,"verdocs-auth",{endpoint:[16],visible:[4],logo:[1],debug:[4],isAuthenticated:[32],displayMode:[32],username:[32],password:[32],loggingIn:[32],activeSession:[32],loginError:[32]}]]],["verdocs-search",[[0,"verdocs-search",{endpoint:[16]}]]],["verdocs-kba-dialog",[[0,"verdocs-kba-dialog",{step:[2],steps:[2],helptitle:[1],helptext:[1],mode:[1],label:[1],placeholder:[1],choices:[16],open:[4],response:[32]}]]],["verdocs-organization-card",[[0,"verdocs-organization-card",{organization:[16]}]]],["verdocs-quick-functions",[[0,"verdocs-quick-functions",{endpoint:[16]}]]],["verdocs-search-tabs",[[0,"verdocs-search-tabs",{selected:[32]}]]],["verdocs-status-indicator",[[0,"verdocs-status-indicator",{size:[1],theme:[1],status:[1],document:[16],isOpen:[32],recipientStatusIcons:[32]}]]],["verdocs-template-card",[[0,"verdocs-template-card",{template:[16]}]]],["verdocs-template-tags",[[0,"verdocs-template-tags",{tags:[16]}]]],["verdocs-toggle",[[0,"verdocs-toggle",{options:[16],theme:[1]},[[6,"click","handleClick"]]]]],["verdocs-button_2",[[0,"verdocs-text-input",{value:[1],label:[1],placeholder:[1],autocomplete:[1],type:[1],disabled:[4],_value:[32]}],[0,"verdocs-button",{label:[1],startIcon:[1,"start-icon"],endIcon:[1,"end-icon"],size:[1],type:[1],variant:[1],disabled:[4]}]]],["verdocs-ok-dialog",[[0,"verdocs-ok-dialog",{heading:[1],message:[1],open:[4],cancel:[4]}]]],["verdocs-initial-dialog",[[0,"verdocs-initial-dialog",{fullname:[1],open:[4],fontLoaded:[32],enteredInitials:[32],mode:[32]}]]],["verdocs-signature-dialog",[[0,"verdocs-signature-dialog",{fullname:[1],open:[4],fontLoaded:[32],enteredName:[32],mode:[32]}]]],["verdocs-upload-dialog",[[0,"verdocs-upload-dialog",{open:[4],draggingOver:[32],decodedFiles:[32]}]]],["verdocs-search-activity_2",[[0,"verdocs-search-activity",{endpoint:[16],type:[1],options:[8],emptyMessage:[32],authFailure:[32],title:[32],recent:[32],saved:[32],starred:[32]}],[0,"verdocs-search-box",{endpoint:[16],placeholder:[1],type:[1],query:[1]}]]],["verdocs-loader",[[0,"verdocs-loader"]]],["verdocs-dropdown_12",[[0,"verdocs-field-initial",{required:[4],fullName:[1,"full-name"],value:[1],focusField:[64]}],[0,"verdocs-field-signature",{required:[4],fullName:[1,"full-name"],value:[1],focusField:[64]}],[0,"verdocs-field-attachment",{order:[2],value:[1],required:[4],disabled:[4],focusField:[64]}],[0,"verdocs-view",{endpoint:[16],rotation:[2],source:[1],token:[1],loadProgress:[32]}],[0,"verdocs-dropdown",{options:[16],open:[4],isOpen:[32]}],[0,"verdocs-field-checkbox",{order:[2],value:[4],required:[4],disabled:[4]}],[0,"verdocs-field-date",{placeholder:[1],order:[2],value:[1],required:[4],disabled:[4],focused:[32],focusField:[64]}],[0,"verdocs-field-dropdown",{options:[16],required:[4],order:[2],disabled:[4],value:[1],focused:[32],focusField:[64]}],[0,"verdocs-field-payment",{field:[16],fields:[16],pageNum:[2,"page-num"],roleName:[1,"role-name"],fieldId:[1,"field-id"],recipients:[8],selectedRoleName:[1,"selected-role-name"],pdfPages:[16],currentSignature:[1,"current-signature"],currentSignatureId:[1,"current-signature-id"],currentInitial:[1,"current-initial"],currentInitialId:[1,"current-initial-id"],focused:[4],signed:[4],preparedMessage:[32],signatureUrl:[32]}],[0,"verdocs-field-radio-button",{order:[2],checked:[4],value:[1],name:[1],required:[4],disabled:[4]}],[0,"verdocs-field-textarea",{placeholder:[1],order:[2],value:[1],required:[4],disabled:[4],focused:[32],focusField:[64]}],[0,"verdocs-field-textbox",{placeholder:[1],order:[2],value:[1],required:[4],disabled:[4],focused:[32],focusField:[64]}]]]],d)}))};export{defineCustomElements};
1
+ import{p as promiseResolve,b as bootstrapLazy}from"./index-859bc689.js";var patchEsm=function(){return promiseResolve()};var defineCustomElements=function(e,d){if(typeof window==="undefined")return Promise.resolve();return patchEsm().then((function(){return bootstrapLazy([["verdocs-sign",[[0,"verdocs-sign",{endpoint:[16],documentid:[1],roleid:[1],invitecode:[1],recipient:[32],signerToken:[32],pdfUrl:[32],recipientIndex:[32],document:[32],fields:[32],pdfPageInfo:[32],hasSignature:[32],nextButtonLabel:[32],focusedField:[32]}]]],["verdocs-auth",[[0,"verdocs-auth",{endpoint:[16],visible:[4],logo:[1],debug:[4],isAuthenticated:[32],displayMode:[32],username:[32],password:[32],loggingIn:[32],activeSession:[32],loginError:[32]}]]],["verdocs-search",[[0,"verdocs-search",{endpoint:[16]}]]],["verdocs-kba-dialog",[[0,"verdocs-kba-dialog",{step:[2],steps:[2],helptitle:[1],helptext:[1],mode:[1],label:[1],placeholder:[1],choices:[16],open:[4],response:[32]}]]],["verdocs-organization-card",[[0,"verdocs-organization-card",{organization:[16]}]]],["verdocs-quick-functions",[[0,"verdocs-quick-functions",{endpoint:[16]}]]],["verdocs-search-tabs",[[0,"verdocs-search-tabs",{selected:[32]}]]],["verdocs-status-indicator",[[0,"verdocs-status-indicator",{size:[1],theme:[1],status:[1],document:[16],isOpen:[32],recipientStatusIcons:[32]}]]],["verdocs-template-card",[[0,"verdocs-template-card",{template:[16]}]]],["verdocs-template-tags",[[0,"verdocs-template-tags",{tags:[16]}]]],["verdocs-toggle",[[0,"verdocs-toggle",{options:[16],theme:[1]},[[6,"click","handleClick"]]]]],["verdocs-button_2",[[0,"verdocs-text-input",{value:[1],label:[1],placeholder:[1],autocomplete:[1],type:[1],disabled:[4],_value:[32]}],[0,"verdocs-button",{label:[1],startIcon:[1,"start-icon"],endIcon:[1,"end-icon"],size:[1],type:[1],variant:[1],disabled:[4]}]]],["verdocs-ok-dialog",[[0,"verdocs-ok-dialog",{heading:[1],message:[1],open:[4],cancel:[4]}]]],["verdocs-initial-dialog",[[0,"verdocs-initial-dialog",{fullname:[1],open:[4],fontLoaded:[32],enteredInitials:[32],mode:[32]}]]],["verdocs-signature-dialog",[[0,"verdocs-signature-dialog",{fullname:[1],open:[4],fontLoaded:[32],enteredName:[32],mode:[32]}]]],["verdocs-upload-dialog",[[0,"verdocs-upload-dialog",{open:[4],draggingOver:[32],decodedFiles:[32]}]]],["verdocs-search-activity_2",[[0,"verdocs-search-activity",{endpoint:[16],type:[1],options:[8],emptyMessage:[32],authFailure:[32],title:[32],recent:[32],saved:[32],starred:[32]}],[0,"verdocs-search-box",{endpoint:[16],placeholder:[1],type:[1],query:[1]}]]],["verdocs-loader",[[0,"verdocs-loader"]]],["verdocs-dropdown_12",[[0,"verdocs-field-initial",{required:[4],fullName:[1,"full-name"],value:[1],focusField:[64]}],[0,"verdocs-field-signature",{required:[4],fullName:[1,"full-name"],value:[1],focusField:[64]}],[0,"verdocs-field-attachment",{order:[2],value:[1],required:[4],disabled:[4],focusField:[64]}],[0,"verdocs-view",{endpoint:[16],rotation:[2],source:[1],loadProgress:[32]}],[0,"verdocs-dropdown",{options:[16],open:[4],isOpen:[32]}],[0,"verdocs-field-checkbox",{order:[2],value:[4],required:[4],disabled:[4]}],[0,"verdocs-field-date",{placeholder:[1],order:[2],value:[1],required:[4],disabled:[4],focused:[32],focusField:[64]}],[0,"verdocs-field-dropdown",{options:[16],required:[4],order:[2],disabled:[4],value:[1],focused:[32],focusField:[64]}],[0,"verdocs-field-payment",{field:[16],fields:[16],pageNum:[2,"page-num"],roleName:[1,"role-name"],fieldId:[1,"field-id"],recipients:[8],selectedRoleName:[1,"selected-role-name"],pdfPages:[16],currentSignature:[1,"current-signature"],currentSignatureId:[1,"current-signature-id"],currentInitial:[1,"current-initial"],currentInitialId:[1,"current-initial-id"],focused:[4],signed:[4],preparedMessage:[32],signatureUrl:[32]}],[0,"verdocs-field-radio-button",{order:[2],checked:[4],value:[1],name:[1],required:[4],disabled:[4]}],[0,"verdocs-field-textarea",{placeholder:[1],order:[2],value:[1],required:[4],disabled:[4],focused:[32],focusField:[64]}],[0,"verdocs-field-textbox",{placeholder:[1],order:[2],value:[1],required:[4],disabled:[4],focused:[32],focusField:[64]}]]]],d)}))};export{defineCustomElements};
@@ -1 +1 @@
1
- import{r as registerInstance,c as createEvent,h}from"./index-859bc689.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-30e1b6ec.js";var authenticateUser=function(t,e){return t.api.post("/authentication/login",e).then((function(t){return t.data}))};var verdocsAuthCss='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .login-form,verdocs-auth .signup-form{background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}';var VerdocsAuth=function(){function t(t){registerInstance(this,t);this.authenticated=createEvent(this,"authenticated",7);this.endpoint=VerdocsEndpoint.getDefault();this.visible=true;this.logo="https://verdocs.com/assets/blue-logo.svg";this.debug=false;this.isAuthenticated=false;this.displayMode="login";this.username="";this.password="";this.loggingIn=false;this.activeSession=null;this.loginError=null}t.prototype.componentDidLoad=function(){this.endpoint.loadSession();if(this.endpoint.session!==null){this.isAuthenticated=true;this.activeSession=this.endpoint.session;this.authenticated.emit({authenticated:true,session:this.endpoint.session})}else{this.authenticated.emit({authenticated:false,session:null})}};t.prototype.handleLogin=function(){var t=this;this.loggingIn=true;authenticateUser(this.endpoint,{username:this.username,password:this.password}).then((function(e){t.loggingIn=false;t.endpoint.setToken(e.accessToken);t.activeSession=t.endpoint.session;t.isAuthenticated=true;t.authenticated.emit({authenticated:true,session:t.endpoint.session})})).catch((function(e){var n;console.log("[VERDOCS] Login error",e.response,JSON.stringify(e));t.loggingIn=false;t.activeSession=null;t.authenticated.emit({authenticated:false,session:null});if(((n=e===null||e===void 0?void 0:e.response)===null||n===void 0?void 0:n.status)===403){t.loginError="Please check your username and password and try again."}}))};t.prototype.handleLogout=function(){this.endpoint.clearSession();this.isAuthenticated=false;this.authenticated.emit({authenticated:false,session:null})};t.prototype.handleClearError=function(){this.loginError=null};t.prototype.render=function(){var t=this;if(!this.visible){return h("div",{style:{display:"none"}},"Verdocs Auth Placeholder")}if(this.isAuthenticated){if(this.debug){return h("div",{class:"status-result debug"},h("verdocs-button",{label:"Logout",disabled:this.loggingIn,onPress:function(){return t.handleLogout()}}))}return h("div",{class:"status-result"},"Authenticated")}if(this.displayMode==="signup"){return h("div",{class:"signup-form"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),h("h3",null,"Sign up for an account"),h("h4",null,"Already have an account?",h("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return t.displayMode="login"},disabled:this.loggingIn})),h("form",{onSubmit:function(){return t.handleLogin()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:function(e){return t.username=e.detail},disabled:this.loggingIn}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:function(e){return t.password=e.detail},disabled:this.loggingIn}),h("verdocs-button",{label:"Signup",disabled:this.loggingIn,onPress:function(){return t.handleLogin()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})))}return h("div",{class:"login-form"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),h("h3",null,"Log in to your account"),h("h4",null,"Don't have an account?",h("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){return t.displayMode="signup"},disabled:this.loggingIn})),h("form",{onSubmit:function(){return t.handleLogin()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:function(e){return t.username=e.detail},disabled:this.loggingIn}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:function(e){return t.password=e.detail},disabled:this.loggingIn}),h("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return t.displayMode="signup"},disabled:this.loggingIn,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),h("verdocs-button",{label:"Login",disabled:this.loggingIn,onPress:function(){return t.handleLogin()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})),this.loginError?h("verdocs-ok-dialog",{open:true,heading:"Login Error",message:this.loginError,onClosed:function(){return t.handleClearError()}}):h("div",null))};return t}();VerdocsAuth.style=verdocsAuthCss;export{VerdocsAuth as verdocs_auth};
1
+ import{r as registerInstance,c as createEvent,h}from"./index-859bc689.js";import{V as VerdocsEndpoint}from"./VerdocsEndpoint-1dbbd8e2.js";var authenticateUser=function(t,e){return t.api.post("/authentication/login",e).then((function(t){return t.data}))};var verdocsAuthCss='verdocs-auth{font-family:"Inter", -apple-system, "Segoe UI", "Roboto", "Helvetica Neue", sans-serif;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}verdocs-auth .login-form,verdocs-auth .signup-form{background:#ffffff;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;display:-ms-flexbox;display:flex;padding:20px;width:300px;max-width:100%}verdocs-auth .logo{margin:20px 0 30px;width:128px;max-width:100%}verdocs-auth h3{text-align:center;font-weight:400;font-size:16px;line-height:1.75;margin:0}verdocs-auth h4{text-align:center;font-weight:400;font-size:14px;line-height:1.43;margin:0}verdocs-auth .status-result{display:none}verdocs-auth .status-result.debug{white-space:pre-wrap;font-size:14px;background:#fff;padding:10px;display:block;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:center;justify-content:center}verdocs-auth form{width:100%}verdocs-auth verdocs-text-input{margin-bottom:10px}';var VerdocsAuth=function(){function t(t){registerInstance(this,t);this.authenticated=createEvent(this,"authenticated",7);this.endpoint=VerdocsEndpoint.getDefault();this.visible=true;this.logo="https://verdocs.com/assets/blue-logo.svg";this.debug=false;this.isAuthenticated=false;this.displayMode="login";this.username="";this.password="";this.loggingIn=false;this.activeSession=null;this.loginError=null}t.prototype.componentDidLoad=function(){this.endpoint.loadSession();if(this.endpoint.session!==null){this.isAuthenticated=true;this.activeSession=this.endpoint.session;this.authenticated.emit({authenticated:true,session:this.endpoint.session})}else{this.authenticated.emit({authenticated:false,session:null})}};t.prototype.handleLogin=function(){var t=this;this.loggingIn=true;authenticateUser(this.endpoint,{username:this.username,password:this.password}).then((function(e){t.loggingIn=false;t.endpoint.setToken(e.accessToken);t.activeSession=t.endpoint.session;t.isAuthenticated=true;t.authenticated.emit({authenticated:true,session:t.endpoint.session})})).catch((function(e){var n;console.log("[VERDOCS] Login error",e.response,JSON.stringify(e));t.loggingIn=false;t.activeSession=null;t.authenticated.emit({authenticated:false,session:null});if(((n=e===null||e===void 0?void 0:e.response)===null||n===void 0?void 0:n.status)===403){t.loginError="Please check your username and password and try again."}}))};t.prototype.handleLogout=function(){this.endpoint.clearSession();this.isAuthenticated=false;this.authenticated.emit({authenticated:false,session:null})};t.prototype.handleClearError=function(){this.loginError=null};t.prototype.render=function(){var t=this;if(!this.visible){return h("div",{style:{display:"none"}},"Verdocs Auth Placeholder")}if(this.isAuthenticated){if(this.debug){return h("div",{class:"status-result debug"},h("verdocs-button",{label:"Logout",disabled:this.loggingIn,onPress:function(){return t.handleLogout()}}))}return h("div",{class:"status-result"},"Authenticated")}if(this.displayMode==="signup"){return h("div",{class:"signup-form"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),h("h3",null,"Sign up for an account"),h("h4",null,"Already have an account?",h("verdocs-button",{label:"Log In",variant:"text",onClick:function(){return t.displayMode="login"},disabled:this.loggingIn})),h("form",{onSubmit:function(){return t.handleLogin()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:function(e){return t.username=e.detail},disabled:this.loggingIn}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:function(e){return t.password=e.detail},disabled:this.loggingIn}),h("verdocs-button",{label:"Signup",disabled:this.loggingIn,onPress:function(){return t.handleLogin()},style:{display:"flex",justifyContent:"center",margin:"30px auto 0"}})))}return h("div",{class:"login-form"},h("img",{src:this.logo,alt:"Verdocs Logo",class:"logo"}),h("h3",null,"Log in to your account"),h("h4",null,"Don't have an account?",h("verdocs-button",{label:"Sign Up",variant:"text",onClick:function(){return t.displayMode="signup"},disabled:this.loggingIn})),h("form",{onSubmit:function(){return t.handleLogin()}},h("verdocs-text-input",{label:"Email",autocomplete:"username",value:this.username,onFieldInput:function(e){return t.username=e.detail},disabled:this.loggingIn}),h("verdocs-text-input",{label:"Password",type:"password",autocomplete:"current-password",value:this.password,onFieldInput:function(e){return t.password=e.detail},disabled:this.loggingIn}),h("verdocs-button",{label:"Forgot Your Password?",variant:"text",onClick:function(){return t.displayMode="signup"},disabled:this.loggingIn,style:{display:"flex",justifyContent:"center",margin:"10px auto 20px"}}),h("verdocs-button",{label:"Login",disabled:this.loggingIn,onPress:function(){return t.handleLogin()},style:{display:"flex",justifyContent:"center",margin:"10px auto 0"}})),this.loginError?h("verdocs-ok-dialog",{open:true,heading:"Login Error",message:this.loginError,onClosed:function(){return t.handleClearError()}}):h("div",null))};return t}();VerdocsAuth.style=verdocsAuthCss;export{VerdocsAuth as verdocs_auth};