@verdocs/web-sdk 2.3.76 → 2.3.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{TemplateStore-ae59084b.js → TemplateStore-9a87282d.js} +1 -1
- package/dist/cjs/{VerdocsEndpoint-f4ef9333.js → VerdocsEndpoint-38bcb409.js} +1 -1
- package/dist/cjs/ipc-test.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-activity-box.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-auth.cjs.entry.js +4 -4
- package/dist/cjs/verdocs-build.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-checkbox_5.cjs.entry.js +2 -2
- package/dist/cjs/verdocs-contact-picker_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-document-page.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-recipient-link_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelope-sidebar.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-envelopes-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-field-attachment_15.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-file-chooser_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-preview_8.cjs.entry.js +3 -3
- package/dist/cjs/verdocs-quick-functions_2.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-search.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings-api-keys_4.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-settings.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-sign.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-template-fields_4.cjs.entry.js +2 -3
- package/dist/cjs/verdocs-template-star.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-templates-list.cjs.entry.js +1 -1
- package/dist/cjs/verdocs-view.cjs.entry.js +1 -1
- package/dist/collection/components/embeds/verdocs-auth/verdocs-auth.js +3 -3
- package/dist/collection/components/embeds/verdocs-preview/verdocs-preview.js +1 -1
- package/dist/collection/components/templates/verdocs-template-fields/verdocs-template-fields.js +0 -1
- package/dist/components/VerdocsEndpoint.js +1 -1
- package/dist/components/verdocs-auth.js +3 -3
- package/dist/components/verdocs-preview2.js +1 -1
- package/dist/components/verdocs-template-fields2.js +0 -1
- package/dist/custom-elements.json +2147 -0
- package/dist/docs.json +1 -1
- package/dist/esm/{TemplateStore-99bf97f0.js → TemplateStore-6a7d7297.js} +1 -1
- package/dist/esm/{VerdocsEndpoint-eab308f6.js → VerdocsEndpoint-9a11e843.js} +1 -1
- package/dist/esm/ipc-test.entry.js +2 -2
- package/dist/esm/verdocs-activity-box.entry.js +1 -1
- package/dist/esm/verdocs-auth.entry.js +4 -4
- package/dist/esm/verdocs-build.entry.js +2 -2
- package/dist/esm/verdocs-checkbox_5.entry.js +2 -2
- package/dist/esm/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm/verdocs-field-attachment_15.entry.js +1 -1
- package/dist/esm/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm/verdocs-preview_8.entry.js +3 -3
- package/dist/esm/verdocs-quick-functions_2.entry.js +1 -1
- package/dist/esm/verdocs-search.entry.js +1 -1
- package/dist/esm/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm/verdocs-settings.entry.js +1 -1
- package/dist/esm/verdocs-sign.entry.js +1 -1
- package/dist/esm/verdocs-template-fields_4.entry.js +2 -3
- package/dist/esm/verdocs-template-star.entry.js +1 -1
- package/dist/esm/verdocs-templates-list.entry.js +1 -1
- package/dist/esm/verdocs-view.entry.js +1 -1
- package/dist/esm-es5/{TemplateStore-99bf97f0.js → TemplateStore-6a7d7297.js} +1 -1
- package/dist/esm-es5/{VerdocsEndpoint-eab308f6.js → VerdocsEndpoint-9a11e843.js} +1 -1
- package/dist/esm-es5/ipc-test.entry.js +1 -1
- package/dist/esm-es5/verdocs-activity-box.entry.js +1 -1
- package/dist/esm-es5/verdocs-auth.entry.js +1 -1
- package/dist/esm-es5/verdocs-build.entry.js +1 -1
- package/dist/esm-es5/verdocs-checkbox_5.entry.js +1 -1
- package/dist/esm-es5/verdocs-contact-picker_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-document-page.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-recipient-link_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelope-sidebar.entry.js +1 -1
- package/dist/esm-es5/verdocs-envelopes-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-field-attachment_15.entry.js +1 -1
- package/dist/esm-es5/verdocs-file-chooser_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-preview_8.entry.js +1 -1
- package/dist/esm-es5/verdocs-quick-functions_2.entry.js +1 -1
- package/dist/esm-es5/verdocs-search.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings-api-keys_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-settings.entry.js +1 -1
- package/dist/esm-es5/verdocs-sign.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-fields_4.entry.js +1 -1
- package/dist/esm-es5/verdocs-template-star.entry.js +1 -1
- package/dist/esm-es5/verdocs-templates-list.entry.js +1 -1
- package/dist/esm-es5/verdocs-view.entry.js +1 -1
- package/dist/verdocs-web-sdk/{p-f246348c.system.js → p-034bd59e.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b0e0084b.system.entry.js → p-05026d67.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bbf52926.entry.js → p-07cf78e3.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e7d7bcae.system.entry.js → p-094ea4ba.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-15c88a05.system.entry.js → p-0d1f4272.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-1978c7bd.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-58e85310.system.entry.js → p-1a29b57f.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a12b2c26.system.entry.js → p-24742737.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-6a93295c.entry.js → p-283d935e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ef99042b.entry.js → p-2bcd953d.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8f36c42a.system.entry.js → p-337466c7.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ea2211d7.system.entry.js → p-340d2daa.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d61bf72b.system.entry.js → p-4618665e.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7e5a1766.system.entry.js → p-48c14014.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d0d9ac6d.system.js → p-49139f23.system.js} +1 -1
- package/dist/verdocs-web-sdk/{p-8a7324b6.entry.js → p-5059ff08.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-159aeaf2.entry.js → p-55403539.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a7907ccf.entry.js → p-6dad60bb.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a9da16c6.entry.js → p-6ec51b4b.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-1d5f10f4.entry.js → p-70137c9e.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e3623a0c.system.entry.js → p-786725d0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-91e94910.entry.js → p-812d7568.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-06618569.entry.js → p-8b46dcc3.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-baf16d17.system.entry.js → p-8b78ee37.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-7b3dfc4b.system.entry.js → p-90734d54.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-92a6f625.entry.js +1 -0
- package/dist/verdocs-web-sdk/p-9b306355.system.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-40f5b1c5.entry.js → p-a15e1a57.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-9d748d04.entry.js → p-a87f2e56.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-bf8e6ba1.system.entry.js → p-b1e92d11.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-77c145b3.system.entry.js → p-b293e7d0.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c73e78c8.system.entry.js → p-b9376079.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-bc6ce10f.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-9a816526.system.entry.js → p-bf2fd0eb.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-a9b80271.system.entry.js → p-cb48d6b9.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-ccac4998.entry.js +1 -0
- package/dist/verdocs-web-sdk/{p-45ecd6eb.js → p-cda8b816.js} +1 -1
- package/dist/verdocs-web-sdk/{p-84679597.entry.js → p-d075b6e8.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-c179b3e4.entry.js → p-d522f008.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-28c93a3a.system.entry.js → p-d524266d.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-e04d8f5d.js → p-d77962af.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ac042888.entry.js → p-daebba0a.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-de5b9b23.system.entry.js → p-e3bfe2de.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d1c52218.entry.js → p-e93796e2.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-b8063124.entry.js → p-ed319550.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-ac07d476.entry.js → p-ee9336c4.entry.js} +1 -1
- package/dist/verdocs-web-sdk/p-f04bf956.system.js +1 -1
- package/dist/verdocs-web-sdk/{p-5e8e5761.system.entry.js → p-f15263ff.system.entry.js} +1 -1
- package/dist/verdocs-web-sdk/{p-d11ffc76.entry.js → p-f6b75e4c.entry.js} +1 -1
- package/dist/verdocs-web-sdk/verdocs-web-sdk.esm.js +1 -1
- package/package.json +2 -2
- package/dist/verdocs-web-sdk/p-30492f83.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-332141f2.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-7519fe6e.system.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-755b5223.entry.js +0 -1
- package/dist/verdocs-web-sdk/p-b2d3ac44.entry.js +0 -1
package/dist/docs.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { c as createStore } from './index-4439b0d1.js';
|
2
|
-
import { g as getTemplate, T as TemplateSenderTypes } from './VerdocsEndpoint-
|
2
|
+
import { g as getTemplate, T as TemplateSenderTypes } from './VerdocsEndpoint-9a11e843.js';
|
3
3
|
import { c as createTemplateRoleStore, g as getTemplateRoleStore } from './TemplateRoleStore-447f2cb6.js';
|
4
4
|
import { c as createTemplateFieldStore, g as getTemplateFieldStore } from './TemplateFieldStore-6e67e86b.js';
|
5
5
|
|
@@ -3673,7 +3673,7 @@ var VerdocsEndpoint = /** @class */ (function () {
|
|
3673
3673
|
function VerdocsEndpoint(options) {
|
3674
3674
|
this.environment = 'verdocs';
|
3675
3675
|
this.sessionType = 'user';
|
3676
|
-
this.baseURL = (window.location.origin === 'https://beta.verdocs.com'
|
3676
|
+
this.baseURL = (window.location.origin === 'https://beta.verdocs.com' || window.location.origin === 'https://stage.verdocs.com'
|
3677
3677
|
? 'https://stage-api.verdocs.com'
|
3678
3678
|
: 'https://api.verdocs.com');
|
3679
3679
|
this.clientID = 'not-set';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
-
import { g as getTemplateStore } from './TemplateStore-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
4
|
+
import { g as getTemplateStore } from './TemplateStore-6a7d7297.js';
|
5
5
|
import './index-4439b0d1.js';
|
6
6
|
import './TemplateRoleStore-447f2cb6.js';
|
7
7
|
import './TemplateFieldStore-6e67e86b.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import { g as getSummary } from './Envelopes-627c5239.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
5
5
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
7
7
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-172625c5.js';
|
2
2
|
import { d as decodeAccessTokenBody } from './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
4
4
|
import { c as createBusinessAccount } from './Profiles-d4df4d1c.js';
|
5
5
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -188,13 +188,13 @@ const VerdocsAuth = class {
|
|
188
188
|
this.loginAndCheckVerification();
|
189
189
|
})
|
190
190
|
.catch(e => {
|
191
|
-
var _a, _b, _c, _d, _e;
|
192
|
-
console.log('[AUTH] Signup error', e.response
|
191
|
+
var _a, _b, _c, _d, _e, _f;
|
192
|
+
console.log('[AUTH] Signup error', e.response);
|
193
193
|
this.submitting = false;
|
194
194
|
this.activeSession = null;
|
195
195
|
(_a = this.authenticated) === null || _a === void 0 ? void 0 : _a.emit({ authenticated: false, session: null });
|
196
196
|
(_b = this.sdkError) === null || _b === void 0 ? void 0 : _b.emit(new SDKError(e.message, (_c = e.response) === null || _c === void 0 ? void 0 : _c.status, (_d = e.response) === null || _d === void 0 ? void 0 : _d.data));
|
197
|
-
VerdocsToast('Signup failed: ' + ((_e = e.response) === null || _e === void 0 ? void 0 : _e.data), { style: 'error' });
|
197
|
+
VerdocsToast('Signup failed: ' + ((_f = (_e = e.response) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.message) || 'Unknown Error', { style: 'error' });
|
198
198
|
});
|
199
199
|
}
|
200
200
|
loginAndCheckVerification() {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
-
import { g as getTemplateStore } from './TemplateStore-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
4
|
+
import { g as getTemplateStore } from './TemplateStore-6a7d7297.js';
|
5
5
|
import { S as SDKError } from './errors-9b5498c8.js';
|
6
6
|
import './index-4439b0d1.js';
|
7
7
|
import './TemplateRoleStore-447f2cb6.js';
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, c as createEvent, a as getElement } from './index-172625c5.js';
|
2
2
|
import { a as commonjsGlobal } from './_commonjsHelpers-5ec8f9b7.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
5
5
|
import { u as updateField, d as deleteField } from './Fields-c82e6df3.js';
|
6
6
|
import { g as getTemplateFieldStore, u as updateStoreField } from './TemplateFieldStore-6e67e86b.js';
|
7
7
|
import { g as getTemplateRoleStore } from './TemplateRoleStore-447f2cb6.js';
|
8
|
-
import { g as getTemplateStore } from './TemplateStore-
|
8
|
+
import { g as getTemplateStore } from './TemplateStore-6a7d7297.js';
|
9
9
|
import { S as SDKError } from './errors-9b5498c8.js';
|
10
10
|
import './index-4439b0d1.js';
|
11
11
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
4
4
|
import { c as convertToE164 } from './utils-a56ee5e9.js';
|
5
5
|
import './_commonjsHelpers-5ec8f9b7.js';
|
6
6
|
import './Envelopes-627c5239.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-172625c5.js';
|
2
2
|
import { m as getEnvelopeDocumentPageDisplayUri } from './Envelopes-627c5239.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
5
5
|
import { t as throttle } from './utils-a56ee5e9.js';
|
6
6
|
import './_commonjsHelpers-5ec8f9b7.js';
|
7
7
|
import './Types-086facf7.js';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
3
|
import { g as getInPersonLink } from './Recipients-4ec2138c.js';
|
4
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
5
5
|
import { g as getEnvelopeStore } from './EnvelopeStore-24a1f38f.js';
|
6
6
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
7
7
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -3,7 +3,7 @@ import { c as cancelEnvelope } from './Envelopes-627c5239.js';
|
|
3
3
|
import { u as userIsEnvelopeOwner } from './Permissions-f2eb0421.js';
|
4
4
|
import { r as resendInvitation } from './Recipients-4ec2138c.js';
|
5
5
|
import './Types-5f31149e.js';
|
6
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
6
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
7
7
|
import { g as getEnvelopeStore } from './EnvelopeStore-24a1f38f.js';
|
8
8
|
import { F as FORMAT_TIMESTAMP } from './Types-086facf7.js';
|
9
9
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host } from './index-1
|
|
2
2
|
import { l as listEnvelopes, c as cancelEnvelope } from './Envelopes-627c5239.js';
|
3
3
|
import { g as getRecipientsWithActions, a as userCanAct, b as userCanCancelEnvelope } from './Permissions-f2eb0421.js';
|
4
4
|
import './Types-5f31149e.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
6
6
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
7
7
|
import { s as saveEnvelopesAsZip } from './utils-a56ee5e9.js';
|
8
8
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
@@ -9,7 +9,7 @@ import { a as FORMAT_DATE, F as FORMAT_TIMESTAMP } from './Types-086facf7.js';
|
|
9
9
|
import { f as format } from './index-914ed6f7.js';
|
10
10
|
import { i as interact_min } from './interact.min-ef12935a.js';
|
11
11
|
import './Types-5f31149e.js';
|
12
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
12
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
13
13
|
import { u as updateField } from './Fields-c82e6df3.js';
|
14
14
|
import { g as getTemplateDocumentPageDisplayUri } from './TemplateDocuments-6fd2f4e2.js';
|
15
15
|
import { c as createPopper } from './popper-15e448b4.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
4
4
|
import { u as unicodeNBSP } from './Icons-ddea87bf.js';
|
5
5
|
|
6
6
|
const verdocsFileChooserCss = "verdocs-file-chooser{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;background-color:#ffffff;font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-file-chooser .upload-box{text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:40px 15px;color:rgba(0, 0, 0, 0.54)}verdocs-file-chooser .upload-box svg{width:64px;height:64px;fill:#5c6575}verdocs-file-chooser .selected-filename{font-size:20px;font-weight:bold;overflow-wrap:anywhere}verdocs-file-chooser .or-prefer{height:20px;margin:20px 0;font-size:16px}";
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint, b as createTemplatev2, u as updateTemplate } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint, b as createTemplatev2, u as updateTemplate } from './VerdocsEndpoint-9a11e843.js';
|
4
4
|
import { g as getTemplateFieldStore } from './TemplateFieldStore-6e67e86b.js';
|
5
5
|
import { g as getTemplateRoleStore, b as getRoleNames, a as getRoleIndex } from './TemplateRoleStore-447f2cb6.js';
|
6
|
-
import { g as getTemplateStore } from './TemplateStore-
|
6
|
+
import { g as getTemplateStore } from './TemplateStore-6a7d7297.js';
|
7
7
|
import { r as renderDocumentField } from './utils-a56ee5e9.js';
|
8
8
|
import { S as SDKError } from './errors-9b5498c8.js';
|
9
9
|
import { j as createEnvelope } from './Envelopes-627c5239.js';
|
@@ -104,7 +104,7 @@ const VerdocsPreview = class {
|
|
104
104
|
const pages = [...(_b = (_a = this.templateStore) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.pages];
|
105
105
|
pages.sort((a, b) => a.sequence - b.sequence);
|
106
106
|
return (h(Host, null, pages.map(page => {
|
107
|
-
return (h("verdocs-template-document-page", { templateId: page.template_id, documentId: page.document_id, pageNumber: page.sequence, virtualWidth: 612, virtualHeight: 792, onPageRendered: e => this.handlePageRendered(e), layers: [
|
107
|
+
return (h("verdocs-template-document-page", { templateId: page.template_id, documentId: page.document_id, pageNumber: page.sequence, disabled: true, editable: true, done: false, virtualWidth: 612, virtualHeight: 792, onPageRendered: e => this.handlePageRendered(e), layers: [
|
108
108
|
{ name: 'page', type: 'canvas' },
|
109
109
|
{ name: 'controls', type: 'div' },
|
110
110
|
] }));
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
4
4
|
|
5
5
|
const verdocsQuickFunctionsCss = "verdocs-quick-functions{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif}verdocs-quick-functions .container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;width:240px;background-color:#1e2031;text-transform:uppercase;padding:10px 10px 20px 10px;font-family:sans-serif;color:#ffffff}verdocs-quick-functions .title{font-size:22px;font-weight:700;line-height:30px;margin:1em 0 40px 0}verdocs-quick-functions button{width:140px;height:40px;border:none;display:-ms-flexbox;display:flex;color:#ffffff;cursor:pointer;font-size:14px;font-weight:700;line-height:25px;-ms-flex-align:center;align-items:center;margin-bottom:20px;border-radius:5px;text-transform:uppercase;-ms-flex-pack:space-evenly;justify-content:space-evenly;background-color:#55bc81}verdocs-quick-functions button svg{fill:#ffffff}";
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, h } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
4
4
|
|
5
5
|
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}";
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
4
4
|
import { a as formatFullName, c as capitalize, b as formatInitials } from './Primitives-8fe93caf.js';
|
5
5
|
import { V as VerdocsToast } from './Toast-f3b8fd46.js';
|
6
6
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
4
4
|
import { S as SDKError } from './errors-9b5498c8.js';
|
5
5
|
|
6
6
|
const verdocsSettingsCss = "verdocs-settings{font-family:\"Inter\", -apple-system, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", sans-serif;display:-ms-flexbox;display:flex;padding:15px;row-gap:15px;min-height:200px;position:relative;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-direction:column;flex-direction:column}verdocs-settings .tabs{gap:4px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-direction:row;flex-direction:row;border-bottom:1px solid #654dcb}verdocs-settings .tabs .tab{cursor:pointer;padding:5px 10px;color:#ffffff;background-color:#777777}verdocs-settings .tabs .tab.active{color:#ffffff;background-color:#654dcb}";
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment }
|
|
2
2
|
import { e as getSigningSession, a as getEnvelope, u as updateEnvelopeField, f as updateEnvelopeFieldSignature, h as updateEnvelopeFieldInitials, i as uploadEnvelopeFieldAttachment } from './Envelopes-627c5239.js';
|
3
3
|
import { R as RecipientStates } from './Types-5f31149e.js';
|
4
4
|
import { e as envelopeRecipientAgree, a as envelopeRecipientDecline, b as envelopeRecipientSubmit } from './Recipients-4ec2138c.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
6
6
|
import { i as isValidPhone, a as isValidEmail } from './Validators-16a2a43b.js';
|
7
7
|
import { f as fullNameToInitials, i as integerSequence } from './Primitives-8fe93caf.js';
|
8
8
|
import { a as saveAttachment, u as updateDocumentFieldValue, r as renderDocumentField, b as getFieldId } from './utils-a56ee5e9.js';
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment, a as getElement } from './index-172625c5.js';
|
2
2
|
import { i as interact_min } from './interact.min-ef12935a.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
|
-
import { V as VerdocsEndpoint, T as TemplateSenderTypes, u as updateTemplate } from './VerdocsEndpoint-
|
4
|
+
import { V as VerdocsEndpoint, T as TemplateSenderTypes, u as updateTemplate } from './VerdocsEndpoint-9a11e843.js';
|
5
5
|
import { u as updateField, c as createField } from './Fields-c82e6df3.js';
|
6
6
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
7
7
|
import { g as getTemplateFieldStore, u as updateStoreField } from './TemplateFieldStore-6e67e86b.js';
|
8
8
|
import { e as updateCssTransform, f as removeCssTransform, b as getFieldId, h as getFieldOptionId, i as defaultWidth, j as defaultHeight } from './utils-a56ee5e9.js';
|
9
9
|
import { g as getTemplateRoleStore, c as createTemplateRoleStore, u as updateStoreRole, d as deleteStoreRole, a as getRoleIndex } from './TemplateRoleStore-447f2cb6.js';
|
10
|
-
import { g as getTemplateStore } from './TemplateStore-
|
10
|
+
import { g as getTemplateStore } from './TemplateStore-6a7d7297.js';
|
11
11
|
import { S as SDKError } from './errors-9b5498c8.js';
|
12
12
|
import { g as getRGBA } from './Colors-1b298092.js';
|
13
13
|
import './_commonjsHelpers-5ec8f9b7.js';
|
@@ -389,7 +389,6 @@ const VerdocsTemplateFields = class {
|
|
389
389
|
console.log('[FIELDS] Saved field', saved);
|
390
390
|
this.fieldStore.set('fields', [...this.fieldStore.get('fields'), saved]);
|
391
391
|
this.placing = null;
|
392
|
-
// this.reRenderField(saved, pageNumber);
|
393
392
|
(_a = this.templateUpdated) === null || _a === void 0 ? void 0 : _a.emit({ endpoint: this.endpoint, template: (_b = this.templateStore) === null || _b === void 0 ? void 0 : _b.state, event: 'added-field' });
|
394
393
|
}
|
395
394
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
2
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
3
3
|
import './Types-5f31149e.js';
|
4
4
|
|
5
5
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-172625c5.js';
|
2
2
|
import './Types-5f31149e.js';
|
3
|
-
import { V as VerdocsEndpoint, l as listTemplates, d as deleteTemplate, c as canPerformTemplateAction, a as TemplateActions } from './VerdocsEndpoint-
|
3
|
+
import { V as VerdocsEndpoint, l as listTemplates, d as deleteTemplate, c as canPerformTemplateAction, a as TemplateActions } from './VerdocsEndpoint-9a11e843.js';
|
4
4
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
5
5
|
import { S as SDKError } from './errors-9b5498c8.js';
|
6
6
|
import { f as format } from './index-914ed6f7.js';
|
@@ -2,7 +2,7 @@ import { r as registerInstance, c as createEvent, h, H as Host, F as Fragment, a
|
|
2
2
|
import { t as throttledGetEnvelope, k as getDocumentDownloadLink, c as cancelEnvelope } from './Envelopes-627c5239.js';
|
3
3
|
import { b as userCanCancelEnvelope } from './Permissions-f2eb0421.js';
|
4
4
|
import './Types-5f31149e.js';
|
5
|
-
import { V as VerdocsEndpoint } from './VerdocsEndpoint-
|
5
|
+
import { V as VerdocsEndpoint } from './VerdocsEndpoint-9a11e843.js';
|
6
6
|
import { i as integerSequence } from './Primitives-8fe93caf.js';
|
7
7
|
import { s as saveEnvelopesAsZip } from './utils-a56ee5e9.js';
|
8
8
|
import { S as SDKError } from './errors-9b5498c8.js';
|
@@ -1 +1 @@
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,a){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function s(e){try{l(a.next(e))}catch(e){n(e)}}function i(e){try{l(a["throw"](e))}catch(e){n(e)}}function l(e){e.done?r(e.value):o(e.value).then(s,i)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},a,o,n,s;return s={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function i(e){return function(t){return l([e,t])}}function l(s){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,o&&(n=s[0]&2?o["return"]:s[0]?o["throw"]||((n=o["return"])&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;if(o=0,n)s=[s[0]&2,n.value];switch(s[0]){case 0:case 1:n=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;o=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!n||s[1]>n[0]&&s[1]<n[3])){r.label=s[1];break}if(s[0]===6&&r.label<n[1]){r.label=n[1];n=s;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(s);break}if(n[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];o=0}finally{a=n=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{c as createStore}from"./index-4439b0d1.js";import{g as getTemplate,T as TemplateSenderTypes}from"./VerdocsEndpoint-
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,a){function o(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function s(e){try{l(a.next(e))}catch(e){n(e)}}function i(e){try{l(a["throw"](e))}catch(e){n(e)}}function l(e){e.done?r(e.value):o(e.value).then(s,i)}l((a=a.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},a,o,n,s;return s={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function i(e){return function(t){return l([e,t])}}function l(s){if(a)throw new TypeError("Generator is already executing.");while(r)try{if(a=1,o&&(n=s[0]&2?o["return"]:s[0]?o["throw"]||((n=o["return"])&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;if(o=0,n)s=[s[0]&2,n.value];switch(s[0]){case 0:case 1:n=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;o=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!n||s[1]>n[0]&&s[1]<n[3])){r.label=s[1];break}if(s[0]===6&&r.label<n[1]){r.label=n[1];n=s;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(s);break}if(n[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];o=0}finally{a=n=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{c as createStore}from"./index-4439b0d1.js";import{g as getTemplate,T as TemplateSenderTypes}from"./VerdocsEndpoint-9a11e843.js";import{c as createTemplateRoleStore,g as getTemplateRoleStore}from"./TemplateRoleStore-447f2cb6.js";import{c as createTemplateFieldStore,g as getTemplateFieldStore}from"./TemplateFieldStore-6e67e86b.js";var createTemplateStore=function(e){var t=(new Date).toISOString();return createStore({isLoading:true,isLoaded:false,isError:false,error:null,roleNames:[],id:e,name:"",description:"",sender:TemplateSenderTypes.CREATOR,profile_id:"",organization_id:"",counter:0,star_counter:0,is_sendable:false,is_personal:true,is_public:false,created_at:t,updated_at:t,last_used_at:t,token:"",reminder_id:"",reminder:undefined,processed:false,organization:undefined,roles:[],pages:[],template_document:undefined,template_documents:[]})};var templateStores={};var getTemplateStore=function(e,t,r){if(r===void 0){r=false}return __awaiter(void 0,void 0,void 0,(function(){var a,o,n,s;return __generator(this,(function(i){switch(i.label){case 0:a=false;if(!templateStores[t]){console.debug("[TEMPLATES] No template store found for ID, creating",t);templateStores[t]=createTemplateStore(t);a=true}o=templateStores[t];if(!(a||r))return[3,5];console.debug("[TEMPLATES] Loading template",{templateId:t,created:a,forceReload:r});o.state.isLoading=true;o.state.isLoaded=false;o.state.isError=false;o.state.error=undefined;i.label=1;case 1:i.trys.push([1,3,,4]);return[4,getTemplate(e,t)];case 2:n=i.sent();console.debug("[TEMPLATES] Got template",n);Object.assign(o.state,n);o.state.isLoaded=true;o.state.isError=false;o.state.error=undefined;createTemplateRoleStore(n);createTemplateFieldStore(n);return[3,4];case 3:s=i.sent();console.error("[TEMPLATES] Error loading template",s);o.state.isLoaded=false;o.state.isError=true;o.state.error=s;throw s;case 4:o.state.isLoading=false;return[3,6];case 5:getTemplateRoleStore(t);getTemplateFieldStore(t);i.label=6;case 6:return[2,o]}}))}))};export{getTemplateStore as g};
|
@@ -1 +1 @@
|
|
1
|
-
var __assign=this&&this.__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 __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};import{d as decodeAccessTokenBody}from"./Types-5f31149e.js";var TemplateSenderTypes$1;(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$1||(TemplateSenderTypes$1={}));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 canPerformTemplateAction=function(e,t,r){var n,i;if(!r&&!t.includes("create")){return{canPerform:false,message:"Missing required template object"}}var o=(e===null||e===void 0?void 0:e.profile_id)||"BOGUS";var s=(e===null||e===void 0?void 0:e.organization_id)||"BOGUS";if(!o){return{canPerform:false,message:"Active session required"}}var a=(r===null||r===void 0?void 0:r.profile_id)===o;var u=(r===null||r===void 0?void 0:r.organization_id)===s;var l=(n=r===null||r===void 0?void 0:r.is_personal)!==null&&n!==void 0?n:false;var c=(i=r===null||r===void 0?void 0:r.is_public)!==null&&i!==void 0?i:false;var f=[];switch(t){case"create_personal":f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PERSONAL);break;case"create_org":f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_ORG);break;case"create_public":f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PUBLIC);break;case"read":if(!a){if(!l&&u||!c){f.push(TemplatePermissions.TEMPLATE_MEMBER_READ)}}break;case"write":if(!a){f.push(TemplatePermissions.TEMPLATE_MEMBER_READ);f.push(TemplatePermissions.TEMPLATE_MEMBER_WRITE)}break;case"change_visibility_personal":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PERSONAL)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_org":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_ORG)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_public":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PUBLIC);f.push(TemplatePermissions.TEMPLATE_CREATOR_VISIBILITY)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY)}break;case"delete":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_DELETE)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_DELETE)}break;default:return{canPerform:false,message:"Action is not defined"}}if(hasRequiredPermissions(e,f)){return{canPerform:true,message:""}}return{canPerform:false,message:"Insufficient access to perform '".concat(t,"'. Needed permissions: ").concat(f.toString())}};var hasRequiredPermissions=function(e,t){return t.every((function(t){return((e===null||e===void 0?void 0:e.permissions)||[]).includes(t)}))};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{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n["throw"](e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(s,a)}u((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 u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(r=0)),r)try{if(n=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var getTemplate=function(e,t){return e.api.get("/templates/".concat(t)).then((function(e){return e.data}))};var ALLOWED_CREATE_FIELDS=["name","is_personal","is_public","sender","description","roles","fields"];var createTemplatev2=function(e,t,r){var n={timeout:12e4,onUploadProgress:function(e){var t=e.total||1;var n=e.loaded||0;r===null||r===void 0?void 0:r(Math.floor(n*100/(t||1)),n,t||1)}};if(t.documents&&t.documents[0]instanceof File){var i=new FormData;ALLOWED_CREATE_FIELDS.forEach((function(e){if(t[e]!==undefined){i.append(e,t[e])}}));t.documents.forEach((function(e){i.append("documents",e,e.name)}));return e.api.post("/v2/templates",i,n).then((function(e){return e.data}))}else{return e.api.post("/v2/templates",t,n).then((function(e){return e.data}))}};var updateTemplate=function(e,t,r){return e.api.put("/templates/".concat(t),r).then((function(e){return e.data}))};var deleteTemplate=function(e,t){return e.api.delete("/templates/".concat(t)).then((function(e){return e.data}))};var SortOptions$1;(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$1||(SortOptions$1={}));var listTemplates=function(e,t){if(t===void 0){t={}}return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,e.api.post("/templates/list",t).then((function(e){return e.data}))]}))}))};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 Permissions;(function(e){e["RCOMMON"]="rcommon:access";e["RFORM_ACCESS"]="rform:access";e["ORG_CREATE"]="org:create";e["ORG_VIEW"]="org:view";e["ORG_UPDATE"]="org:update";e["ORG_DELETE"]="org:delete";e["ORG_TRANSFER"]="org:transfer";e["ORG_LIST"]="org:list";e["OWNER_ADD"]="owner:add";e["OWNER_REMOVE"]="owner:remove";e["ADMIN_ADD"]="admin:add";e["ADMIN_REMOVE"]="admin:remove";e["MEMBER_VIEW"]="member:view";e["MEMBER_ADD"]="member:add";e["MEMBER_REMOVE"]="member:remove";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";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"})(Permissions||(Permissions={}));var Plans;(function(e){e["ENV_ESSENTIAL"]="env:essential";e["ORG_STANDARD"]="org:standard"})(Plans||(Plans={}));var Roles;(function(e){e["OWNER"]="owner";e["BASIC_USER"]="basic_user";e["MEMBER"]="member"})(Roles||(Roles={}));function bind(e,t){return function r(){return e.apply(t,arguments)}}var toString=Object.prototype.toString;var getPrototypeOf=Object.getPrototypeOf;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));var kindOfTest=function(e){e=e.toLowerCase();return function(t){return kindOf(t)===e}};var typeOfTest=function(e){return function(t){return typeof t===e}};var isArray=Array.isArray;var isUndefined=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction(e.constructor.isBuffer)&&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}var isString=typeOfTest("string");var isFunction=typeOfTest("function");var isNumber=typeOfTest("number");var isObject=function(e){return e!==null&&typeof e==="object"};var isBoolean=function(e){return e===true||e===false};var isPlainObject=function(e){if(kindOf(e)!=="object"){return false}var t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var isDate=kindOfTest("Date");var isFile=kindOfTest("File");var isBlob=kindOfTest("Blob");var isFileList=kindOfTest("FileList");var isStream=function(e){return isObject(e)&&isFunction(e.pipe)};var isFormData=function(e){var t;return e&&(typeof FormData==="function"&&e instanceof FormData||isFunction(e.append)&&((t=kindOf(e))==="formdata"||t==="object"&&isFunction(e.toString)&&e.toString()==="[object FormData]"))};var isURLSearchParams=kindOfTest("URLSearchParams");var trim=function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function forEach(e,t,r){var n=r===void 0?{}:r,i=n.allOwnKeys,o=i===void 0?false:i;if(e===null||typeof e==="undefined"){return}var s;var a;if(typeof e!=="object"){e=[e]}if(isArray(e)){for(s=0,a=e.length;s<a;s++){t.call(null,e[s],s,e)}}else{var u=o?Object.getOwnPropertyNames(e):Object.keys(e);var l=u.length;var c=void 0;for(s=0;s<l;s++){c=u[s];t.call(null,e[c],c,e)}}}function findKey(e,t){t=t.toLowerCase();var r=Object.keys(e);var n=r.length;var i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}var _global=function(){if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global}();var isContextDefined=function(e){return!isUndefined(e)&&e!==_global};function merge(){var e=(isContextDefined(this)&&this||{}).caseless;var t={};var r=function(r,n){var i=e&&findKey(t,n)||n;if(isPlainObject(t[i])&&isPlainObject(r)){t[i]=merge(t[i],r)}else if(isPlainObject(r)){t[i]=merge({},r)}else if(isArray(r)){t[i]=r.slice()}else{t[i]=r}};for(var n=0,i=arguments.length;n<i;n++){arguments[n]&&forEach(arguments[n],r)}return t}var extend=function(e,t,r,n){var i=n===void 0?{}:n,o=i.allOwnKeys;forEach(t,(function(t,n){if(r&&isFunction(t)){e[n]=bind(t,r)}else{e[n]=t}}),{allOwnKeys:o});return e};var stripBOM=function(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e};var inherits=function(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)};var toFlatObject=function(e,t,r,n){var i;var o;var s;var a={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);o=i.length;while(o-- >0){s=i[o];if((!n||n(s,e,t))&&!a[s]){t[s]=e[s];a[s]=true}}e=r!==false&&getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t};var endsWith=function(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};var toArray=function(e){if(!e)return null;if(isArray(e))return e;var t=e.length;if(!isNumber(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"&&getPrototypeOf(Uint8Array));var forEachEntry=function(e,t){var r=e&&e[Symbol.iterator];var n=r.call(e);var i;while((i=n.next())&&!i.done){var o=i.value;t.call(e,o[0],o[1])}};var matchAll=function(e,t){var r;var n=[];while((r=e.exec(t))!==null){n.push(r)}return n};var isHTMLForm=kindOfTest("HTMLFormElement");var toCamelCase=function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function e(t,r,n){return r.toUpperCase()+n}))};var hasOwnProperty=function(e){var t=e.hasOwnProperty;return function(e,r){return t.call(e,r)}}(Object.prototype);var isRegExp=kindOfTest("RegExp");var reduceDescriptors=function(e,t){var r=Object.getOwnPropertyDescriptors(e);var n={};forEach(r,(function(r,i){var o;if((o=t(r,i,e))!==false){n[i]=o||r}}));Object.defineProperties(e,n)};var freezeMethods=function(e){reduceDescriptors(e,(function(t,r){if(isFunction(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}var n=e[r];if(!isFunction(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}}}))};var toObjectSet=function(e,t){var r={};var n=function(e){e.forEach((function(e){r[e]=true}))};isArray(e)?n(e):n(String(e).split(t));return r};var noop=function(){};var toFiniteNumber=function(e,t){e=+e;return Number.isFinite(e)?e:t};var ALPHA="abcdefghijklmnopqrstuvwxyz";var DIGIT="0123456789";var ALPHABET={DIGIT:DIGIT,ALPHA:ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT};var generateString=function(e,t){if(e===void 0){e=16}if(t===void 0){t=ALPHABET.ALPHA_DIGIT}var r="";var n=t.length;while(e--){r+=t[Math.random()*n|0]}return r};function isSpecCompliantForm(e){return!!(e&&isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var toJSONObject=function(e){var t=new Array(10);var r=function(e,n){if(isObject(e)){if(t.indexOf(e)>=0){return}if(!("toJSON"in e)){t[n]=e;var i=isArray(e)?[]:{};forEach(e,(function(e,t){var o=r(e,n+1);!isUndefined(o)&&(i[t]=o)}));t[n]=undefined;return i}}return e};return r(e,0)};var isAsyncFn=kindOfTest("AsyncFunction");var isThenable=function(e){return e&&(isObject(e)||isFunction(e))&&isFunction(e.then)&&isFunction(e.catch)};var utils$1={isArray:isArray,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString,isNumber:isNumber,isBoolean:isBoolean,isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isRegExp:isRegExp,isFunction:isFunction,isStream:isStream,isURLSearchParams:isURLSearchParams,isTypedArray:isTypedArray,isFileList:isFileList,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,forEachEntry:forEachEntry,matchAll:matchAll,isHTMLForm:isHTMLForm,hasOwnProperty:hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors:reduceDescriptors,freezeMethods:freezeMethods,toObjectSet:toObjectSet,toCamelCase:toCamelCase,noop:noop,toFiniteNumber:toFiniteNumber,findKey:findKey,global:_global,isContextDefined:isContextDefined,ALPHABET:ALPHABET,generateString:generateString,isSpecCompliantForm:isSpecCompliantForm,toJSONObject:toJSONObject,isAsyncFn:isAsyncFn,isThenable:isThenable};function AxiosError(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}utils$1.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:utils$1.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype$1=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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){descriptors[e]={value:e}}));Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:true});AxiosError.from=function(e,t,r,n,i,o){var s=Object.create(prototype$1);utils$1.toFlatObject(e,s,(function e(t){return t!==Error.prototype}),(function(e){return e!=="isAxiosError"}));AxiosError.call(s,e.message,t,r,n,i);s.cause=e;s.name=e.name;o&&Object.assign(s,o);return s};var httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,r){if(!e)return t;return e.concat(t).map((function e(t,n){t=removeBrackets(t);return!r&&n?"["+t+"]":t})).join(r?".":"")}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}var predicates=utils$1.toFlatObject(utils$1,{},null,(function e(t){return/^is[A-Z]/.test(t)}));function toFormData(e,t,r){if(!utils$1.isObject(e)){throw new TypeError("target must be an object")}t=t||new FormData;r=utils$1.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,(function e(t,r){return!utils$1.isUndefined(r[t])}));var n=r.metaTokens;var i=r.visitor||c;var o=r.dots;var s=r.indexes;var a=r.Blob||typeof Blob!=="undefined"&&Blob;var u=a&&utils$1.isSpecCompliantForm(t);if(!utils$1.isFunction(i)){throw new TypeError("visitor must be a function")}function l(e){if(e===null)return"";if(utils$1.isDate(e)){return e.toISOString()}if(!u&&utils$1.isBlob(e)){throw new AxiosError("Blob is not supported. Use a Buffer instead.")}if(utils$1.isArrayBuffer(e)||utils$1.isTypedArray(e)){return u&&typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function c(e,r,i){var a=e;if(e&&!i&&typeof e==="object"){if(utils$1.endsWith(r,"{}")){r=n?r:r.slice(0,-2);e=JSON.stringify(e)}else if(utils$1.isArray(e)&&isFlatArray(e)||(utils$1.isFileList(e)||utils$1.endsWith(r,"[]"))&&(a=utils$1.toArray(e))){r=removeBrackets(r);a.forEach((function e(n,i){!(utils$1.isUndefined(n)||n===null)&&t.append(s===true?renderKey([r],i,o):s===null?r:r+"[]",l(n))}));return false}}if(isVisitable(e)){return true}t.append(renderKey(i,r,o),l(e));return false}var f=[];var d=Object.assign(predicates,{defaultVisitor:c,convertValue:l,isVisitable:isVisitable});function p(e,r){if(utils$1.isUndefined(e))return;if(f.indexOf(e)!==-1){throw Error("Circular reference detected in "+r.join("."))}f.push(e);utils$1.forEach(e,(function e(n,o){var s=!(utils$1.isUndefined(n)||n===null)&&i.call(t,n,utils$1.isString(o)?o.trim():o,r,d);if(s===true){p(n,r?r.concat(o):[o])}}));f.pop()}if(!utils$1.isObject(e)){throw new TypeError("data must be an object")}p(e);return t}function encode$1(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function e(r){return t[r]}))}function AxiosURLSearchParams(e,t){this._pairs=[];e&&toFormData(e,this,t)}var prototype=AxiosURLSearchParams.prototype;prototype.append=function e(t,r){this._pairs.push([t,r])};prototype.toString=function e(t){var r=t?function(e){return t.call(this,e,encode$1)}:encode$1;return this._pairs.map((function e(t){return r(t[0])+"="+r(t[1])}),"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,r){if(!t){return e}var n=r&&r.encode||encode;var i=r&&r.serialize;var o;if(i){o=i(t,r)}else{o=utils$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,r).toString(n)}if(o){var s=e.indexOf("#");if(s!==-1){e=e.slice(0,s)}e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var InterceptorManager=function(){function e(){this.handlers=[]}e.prototype.use=function(e,t,r){this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:false,runWhen:r?r.runWhen:null});return this.handlers.length-1};e.prototype.eject=function(e){if(this.handlers[e]){this.handlers[e]=null}};e.prototype.clear=function(){if(this.handlers){this.handlers=[]}};e.prototype.forEach=function(e){utils$1.forEach(this.handlers,(function t(r){if(r!==null){e(r)}}))};return e}();var transitionalDefaults={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var URLSearchParams$1=typeof URLSearchParams!=="undefined"?URLSearchParams:AxiosURLSearchParams;var FormData$1=typeof FormData!=="undefined"?FormData:null;var Blob$1=typeof Blob!=="undefined"?Blob:null;var platform$1={isBrowser:true,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]};var hasBrowserEnv=typeof window!=="undefined"&&typeof document!=="undefined";var hasStandardBrowserEnv=function(e){return hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(e)<0}(typeof navigator!=="undefined"&&navigator.product);var hasStandardBrowserWebWorkerEnv=function(){return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"}();var utils=Object.freeze({__proto__:null,hasBrowserEnv:hasBrowserEnv,hasStandardBrowserWebWorkerEnv:hasStandardBrowserWebWorkerEnv,hasStandardBrowserEnv:hasStandardBrowserEnv});var platform=__assign(__assign({},utils),platform$1);function toURLEncodedForm(e,t){return toFormData(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){if(platform.isNode&&utils$1.isBuffer(e)){this.append(t,e.toString("base64"));return false}return n.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return e[0]==="[]"?"":e[1]||e[0]}))}function arrayToObject(e){var t={};var r=Object.keys(e);var n;var i=r.length;var o;for(n=0;n<i;n++){o=r[n];t[o]=e[o]}return t}function formDataToJSON(e){function t(e,r,n,i){var o=e[i++];if(o==="__proto__")return true;var s=Number.isFinite(+o);var a=i>=e.length;o=!o&&utils$1.isArray(n)?n.length:o;if(a){if(utils$1.hasOwnProp(n,o)){n[o]=[n[o],r]}else{n[o]=r}return!s}if(!n[o]||!utils$1.isObject(n[o])){n[o]=[]}var u=t(e,r,n[o],i);if(u&&utils$1.isArray(n[o])){n[o]=arrayToObject(n[o])}return!s}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){var r={};utils$1.forEachEntry(e,(function(e,n){t(parsePropPath(e),n,r,0)}));return r}return null}function stringifySafely(e,t,r){if(utils$1.isString(e)){try{(t||JSON.parse)(e);return utils$1.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var defaults={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function e(t,r){var n=r.getContentType()||"";var i=n.indexOf("application/json")>-1;var o=utils$1.isObject(t);if(o&&utils$1.isHTMLForm(t)){t=new FormData(t)}var s=utils$1.isFormData(t);if(s){if(!i){return t}return i?JSON.stringify(formDataToJSON(t)):t}if(utils$1.isArrayBuffer(t)||utils$1.isBuffer(t)||utils$1.isStream(t)||utils$1.isFile(t)||utils$1.isBlob(t)){return t}if(utils$1.isArrayBufferView(t)){return t.buffer}if(utils$1.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}var a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1){return toURLEncodedForm(t,this.formSerializer).toString()}if((a=utils$1.isFileList(t))||n.indexOf("multipart/form-data")>-1){var u=this.env&&this.env.FormData;return toFormData(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}if(o||i){r.setContentType("application/json",false);return stringifySafely(t)}return t}],transformResponse:[function e(t){var r=this.transitional||defaults.transitional;var n=r&&r.forcedJSONParsing;var i=this.responseType==="json";if(t&&utils$1.isString(t)&&(n&&!this.responseType||i)){var o=r&&r.silentJSONParsing;var s=!o&&i;try{return JSON.parse(t)}catch(e){if(s){if(e.name==="SyntaxError"){throw AxiosError.from(e,AxiosError.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:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};utils$1.forEach(["delete","get","head","post","put","patch"],(function(e){defaults.headers[e]={}}));var ignoreDuplicateOf=utils$1.toObjectSet(["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){var t={};var r;var n;var i;e&&e.split("\n").forEach((function e(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&ignoreDuplicateOf[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}}));return t};var $internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){if(e===false||e==null){return e}return utils$1.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){var t=Object.create(null);var r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;var n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}var isValidHeaderName=function(e){return/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())};function matchHeaderValue(e,t,r,n,i){if(utils$1.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!utils$1.isString(t))return;if(utils$1.isString(n)){return t.indexOf(n)!==-1}if(utils$1.isRegExp(n)){return n.test(t)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}function buildAccessors(e,t){var r=utils$1.toCamelCase(" "+t);["get","set","has"].forEach((function(n){Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:true})}))}var AxiosHeaders=function(){function e(e){e&&this.set(e)}e.prototype.set=function(e,t,r){var n=this;function i(e,t,r){var i=normalizeHeader(t);if(!i){throw new Error("header name must be a non-empty string")}var o=utils$1.findKey(n,i);if(!o||n[o]===undefined||r===true||r===undefined&&n[o]!==false){n[o||t]=normalizeValue(e)}}var o=function(e,t){return utils$1.forEach(e,(function(e,r){return i(e,r,t)}))};if(utils$1.isPlainObject(e)||e instanceof this.constructor){o(e,t)}else if(utils$1.isString(e)&&(e=e.trim())&&!isValidHeaderName(e)){o(parseHeaders(e),t)}else{e!=null&&i(t,e,r)}return this};e.prototype.get=function(e,t){e=normalizeHeader(e);if(e){var r=utils$1.findKey(this,e);if(r){var n=this[r];if(!t){return n}if(t===true){return parseTokens(n)}if(utils$1.isFunction(t)){return t.call(this,n,r)}if(utils$1.isRegExp(t)){return t.exec(n)}throw new TypeError("parser must be boolean|regexp|function")}}};e.prototype.has=function(e,t){e=normalizeHeader(e);if(e){var r=utils$1.findKey(this,e);return!!(r&&this[r]!==undefined&&(!t||matchHeaderValue(this,this[r],r,t)))}return false};e.prototype.delete=function(e,t){var r=this;var n=false;function i(e){e=normalizeHeader(e);if(e){var i=utils$1.findKey(r,e);if(i&&(!t||matchHeaderValue(r,r[i],i,t))){delete r[i];n=true}}}if(utils$1.isArray(e)){e.forEach(i)}else{i(e)}return n};e.prototype.clear=function(e){var t=Object.keys(this);var r=t.length;var n=false;while(r--){var i=t[r];if(!e||matchHeaderValue(this,this[i],i,e,true)){delete this[i];n=true}}return n};e.prototype.normalize=function(e){var t=this;var r={};utils$1.forEach(this,(function(n,i){var o=utils$1.findKey(r,i);if(o){t[o]=normalizeValue(n);delete t[i];return}var s=e?formatHeader(i):String(i).trim();if(s!==i){delete t[i]}t[s]=normalizeValue(n);r[s]=true}));return this};e.prototype.concat=function(){var e;var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}return(e=this.constructor).concat.apply(e,__spreadArray([this],t,false))};e.prototype.toJSON=function(e){var t=Object.create(null);utils$1.forEach(this,(function(r,n){r!=null&&r!==false&&(t[n]=e&&utils$1.isArray(r)?r.join(", "):r)}));return t};e.prototype[Symbol.iterator]=function(){return Object.entries(this.toJSON())[Symbol.iterator]()};e.prototype.toString=function(){return Object.entries(this.toJSON()).map((function(e){var t=e[0],r=e[1];return t+": "+r})).join("\n")};Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"AxiosHeaders"},enumerable:false,configurable:true});e.from=function(e){return e instanceof this?e:new this(e)};e.concat=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}var n=new this(e);t.forEach((function(e){return n.set(e)}));return n};e.accessor=function(e){var t=this[$internals]=this[$internals]={accessors:{}};var r=t.accessors;var n=this.prototype;function i(e){var t=normalizeHeader(e);if(!r[t]){buildAccessors(n,e);r[t]=true}}utils$1.isArray(e)?e.forEach(i):i(e);return this};return e}();AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders.prototype,(function(e,t){var r=e.value;var n=t[0].toUpperCase()+t.slice(1);return{get:function(){return r},set:function(e){this[n]=e}}}));utils$1.freezeMethods(AxiosHeaders);function transformData(e,t){var r=this||defaults;var n=t||r;var i=AxiosHeaders.from(n.headers);var o=n.data;utils$1.forEach(e,(function e(n){o=n.call(r,o,i.normalize(),t?t.status:undefined)}));i.normalize();return o}function isCancel(e){return!!(e&&e.__CANCEL__)}function CanceledError(e,t,r){AxiosError.call(this,e==null?"canceled":e,AxiosError.ERR_CANCELED,t,r);this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:true});function settle(e,t,r){var n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new AxiosError("Request failed with status code "+r.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}var cookies=platform.hasStandardBrowserEnv?{write:function(e,t,r,n,i,o){var s=[e+"="+encodeURIComponent(t)];utils$1.isNumber(r)&&s.push("expires="+new Date(r).toGMTString());utils$1.isString(n)&&s.push("path="+n);utils$1.isString(i)&&s.push("domain="+i);o===true&&s.push("secure");document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t){if(e&&!isAbsoluteURL(t)){return combineURLs(e,t)}return t}var isURLSameOrigin=platform.hasStandardBrowserEnv?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$1.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function parseProtocol(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;var r=new Array(e);var n=new Array(e);var i=0;var o=0;var s;t=t!==undefined?t:1e3;return function a(u){var l=Date.now();var c=n[o];if(!s){s=l}r[i]=u;n[i]=l;var f=o;var d=0;while(f!==i){d+=r[f++];f=f%e}i=(i+1)%e;if(i===o){o=(o+1)%e}if(l-s<t){return}var p=c&&l-c;return p?Math.round(d*1e3/p):undefined}}function progressEventReducer(e,t){var r=0;var n=speedometer(50,250);return function(i){var o=i.loaded;var s=i.lengthComputable?i.total:undefined;var a=o-r;var u=n(a);var l=o<=s;r=o;var c={loaded:o,total:s,progress:s?o/s:undefined,bytes:a,rate:u?u:undefined,estimated:u&&s&&l?(s-o)/u:undefined,event:i};c[t?"download":"upload"]=true;e(c)}}var isXHRAdapterSupported=typeof XMLHttpRequest!=="undefined";var xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise((function t(r,n){var i=e.data;var o=AxiosHeaders.from(e.headers).normalize();var s=e.responseType,a=e.withXSRFToken;var u;function l(){if(e.cancelToken){e.cancelToken.unsubscribe(u)}if(e.signal){e.signal.removeEventListener("abort",u)}}var c;if(utils$1.isFormData(i)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv){o.setContentType(false)}else if((c=o.getContentType())!==false){var f=c?c.split(";").map((function(e){return e.trim()})).filter(Boolean):[],d=f[0],p=f.slice(1);o.setContentType(__spreadArray([d||"multipart/form-data"],p,true).join("; "))}}var h=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"";var v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+v))}var E=buildFullPath(e.baseURL,e.url);h.open(e.method.toUpperCase(),buildURL(E,e.params,e.paramsSerializer),true);h.timeout=e.timeout;function T(){if(!h){return}var t=AxiosHeaders.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());var i=!s||s==="text"||s==="json"?h.responseText:h.response;var o={data:i,status:h.status,statusText:h.statusText,headers:t,config:e,request:h};settle((function e(t){r(t);l()}),(function e(t){n(t);l()}),o);h=null}if("onloadend"in h){h.onloadend=T}else{h.onreadystatechange=function e(){if(!h||h.readyState!==4){return}if(h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)){return}setTimeout(T)}}h.onabort=function t(){if(!h){return}n(new AxiosError("Request aborted",AxiosError.ECONNABORTED,e,h));h=null};h.onerror=function t(){n(new AxiosError("Network Error",AxiosError.ERR_NETWORK,e,h));h=null};h.ontimeout=function t(){var r=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";var i=e.transitional||transitionalDefaults;if(e.timeoutErrorMessage){r=e.timeoutErrorMessage}n(new AxiosError(r,i.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,e,h));h=null};if(platform.hasStandardBrowserEnv){a&&utils$1.isFunction(a)&&(a=a(e));if(a||a!==false&&isURLSameOrigin(E)){var y=e.xsrfHeaderName&&e.xsrfCookieName&&cookies.read(e.xsrfCookieName);if(y){o.set(e.xsrfHeaderName,y)}}}i===undefined&&o.setContentType(null);if("setRequestHeader"in h){utils$1.forEach(o.toJSON(),(function e(t,r){h.setRequestHeader(r,t)}))}if(!utils$1.isUndefined(e.withCredentials)){h.withCredentials=!!e.withCredentials}if(s&&s!=="json"){h.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){h.addEventListener("progress",progressEventReducer(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&h.upload){h.upload.addEventListener("progress",progressEventReducer(e.onUploadProgress))}if(e.cancelToken||e.signal){u=function(t){if(!h){return}n(!t||t.type?new CanceledError(null,e,h):t);h.abort();h=null};e.cancelToken&&e.cancelToken.subscribe(u);if(e.signal){e.signal.aborted?u():e.signal.addEventListener("abort",u)}}var A=parseProtocol(E);if(A&&platform.protocols.indexOf(A)===-1){n(new AxiosError("Unsupported protocol "+A+":",AxiosError.ERR_BAD_REQUEST,e));return}h.send(i||null)}))};var knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils$1.forEach(knownAdapters,(function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var renderReason=function(e){return"- ".concat(e)};var isResolvedHandle=function(e){return utils$1.isFunction(e)||e===null||e===false};var adapters={getAdapter:function(e){e=utils$1.isArray(e)?e:[e];var t=e.length;var r;var n;var i={};for(var o=0;o<t;o++){r=e[o];var s=void 0;n=r;if(!isResolvedHandle(r)){n=knownAdapters[(s=String(r)).toLowerCase()];if(n===undefined){throw new AxiosError("Unknown adapter '".concat(s,"'"))}}if(n){break}i[s||"#"+o]=n}if(!n){var a=Object.entries(i).map((function(e){var t=e[0],r=e[1];return"adapter ".concat(t," ")+(r===false?"is not supported by the environment":"is not available in the build")}));var u=t?a.length>1?"since :\n"+a.map(renderReason).join("\n"):" "+renderReason(a[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return n},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new CanceledError(null,e)}}function dispatchRequest(e){throwIfCancellationRequested(e);e.headers=AxiosHeaders.from(e.headers);e.data=transformData.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}var t=adapters.getAdapter(e.adapter||defaults.adapter);return t(e).then((function t(r){throwIfCancellationRequested(e);r.data=transformData.call(e,e.transformResponse,r);r.headers=AxiosHeaders.from(r.headers);return r}),(function t(r){if(!isCancel(r)){throwIfCancellationRequested(e);if(r&&r.response){r.response.data=transformData.call(e,e.transformResponse,r.response);r.response.headers=AxiosHeaders.from(r.response.headers)}}return Promise.reject(r)}))}var headersToObject=function(e){return e instanceof AxiosHeaders?e.toJSON():e};function mergeConfig(e,t){t=t||{};var r={};function n(e,t,r){if(utils$1.isPlainObject(e)&&utils$1.isPlainObject(t)){return utils$1.merge.call({caseless:r},e,t)}else if(utils$1.isPlainObject(t)){return utils$1.merge({},t)}else if(utils$1.isArray(t)){return t.slice()}return t}function i(e,t,r){if(!utils$1.isUndefined(t)){return n(e,t,r)}else if(!utils$1.isUndefined(e)){return n(undefined,e,r)}}function o(e,t){if(!utils$1.isUndefined(t)){return n(undefined,t)}}function s(e,t){if(!utils$1.isUndefined(t)){return n(undefined,t)}else if(!utils$1.isUndefined(e)){return n(undefined,e)}}function a(r,i,o){if(o in t){return n(r,i)}else if(o in e){return n(undefined,r)}}var u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:function(e,t){return i(headersToObject(e),headersToObject(t),true)}};utils$1.forEach(Object.keys(Object.assign({},e,t)),(function n(o){var s=u[o]||i;var l=s(e[o],t[o],o);utils$1.isUndefined(l)&&s!==a||(r[o]=l)}));return r}var VERSION="1.6.5";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(i(n," has been removed"+(r?" in "+r:"")),AxiosError.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("options must be an object",AxiosError.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 u=a===undefined||s(a,o,e);if(u!==true){throw new AxiosError("option "+o+" must be "+u,AxiosError.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new AxiosError("Unknown option "+o,AxiosError.ERR_BAD_OPTION)}}}var validator={assertOptions:assertOptions,validators:validators$1};var validators=validator.validators;var Axios=function(){function e(e){this.defaults=e;this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}e.prototype.request=function(e,t){if(typeof e==="string"){t=t||{};t.url=e}else{t=e||{}}t=mergeConfig(this.defaults,t);var r=t.transitional,n=t.paramsSerializer,i=t.headers;if(r!==undefined){validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},false)}if(n!=null){if(utils$1.isFunction(n)){t.paramsSerializer={serialize:n}}else{validator.assertOptions(n,{encode:validators.function,serialize:validators.function},true)}}t.method=(t.method||this.defaults.method||"get").toLowerCase();var o=i&&utils$1.merge(i.common,i[t.method]);i&&utils$1.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]}));t.headers=AxiosHeaders.concat(o,i);var s=[];var a=true;this.interceptors.request.forEach((function e(r){if(typeof r.runWhen==="function"&&r.runWhen(t)===false){return}a=a&&r.synchronous;s.unshift(r.fulfilled,r.rejected)}));var u=[];this.interceptors.response.forEach((function e(t){u.push(t.fulfilled,t.rejected)}));var l;var c=0;var f;if(!a){var d=[dispatchRequest.bind(this),undefined];d.unshift.apply(d,s);d.push.apply(d,u);f=d.length;l=Promise.resolve(t);while(c<f){l=l.then(d[c++],d[c++])}return l}f=s.length;var p=t;c=0;while(c<f){var h=s[c++];var m=s[c++];try{p=h(p)}catch(e){m.call(this,e);break}}try{l=dispatchRequest.call(this,p)}catch(e){return Promise.reject(e)}c=0;f=u.length;while(c<f){l=l.then(u[c++],u[c++])}return l};e.prototype.getUri=function(e){e=mergeConfig(this.defaults,e);var t=buildFullPath(e.baseURL,e.url);return buildURL(t,e.params,e.paramsSerializer)};return e}();utils$1.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$1.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 CancelToken=function(){function e(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=r._listeners.length;while(t-- >0){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,i,o){if(r.reason){return}r.reason=new CanceledError(n,i,o);t(r.reason)}))}e.prototype.throwIfRequested=function(){if(this.reason){throw this.reason}};e.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}};e.prototype.unsubscribe=function(e){if(!this._listeners){return}var t=this._listeners.indexOf(e);if(t!==-1){this._listeners.splice(t,1)}};e.source=function(){var t;var r=new e((function e(r){t=r}));return{token:r,cancel:t}};return e}();function spread(e){return function t(r){return e.apply(null,r)}}function isAxiosError(e){return utils$1.isObject(e)&&e.isAxiosError===true}var HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach((function(e){var t=e[0],r=e[1];HttpStatusCode[r]=t}));function createInstance(e){var t=new Axios(e);var r=bind(Axios.prototype.request,t);utils$1.extend(r,Axios.prototype,t,{allOwnKeys:true});utils$1.extend(r,t,null,{allOwnKeys:true});r.create=function t(r){return createInstance(mergeConfig(e,r))};return r}var axios=createInstance(defaults);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function e(t){return Promise.all(t)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=function(e){return formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e)};axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;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 ENDPOINT_KEY=Symbol.for("verdocs-default-endpoint");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=window.location.origin==="https://beta.verdocs.com"?"https://stage-api.verdocs.com":"https://api.verdocs.com";this.clientID="not-set";this.timeout=6e4;this.token=null;this.nextListenerId=0;this.sessionListeners=new Map;this.requestLoggerId=null;this.session=null;this.baseURL=(e===null||e===void 0?void 0:e.baseURL)||this.baseURL;this.timeout=(e===null||e===void 0?void 0:e.timeout)||this.timeout;this.environment=(e===null||e===void 0?void 0:e.environment)||this.environment;this.sessionType=(e===null||e===void 0?void 0:e.sessionType)||this.sessionType;this.clientID=(e===null||e===void 0?void 0:e.clientID)||this.clientID;this.api=axios.create({baseURL:this.baseURL,timeout:this.timeout})}e.prototype.setDefault=function(){globalThis_1[ENDPOINT_KEY]=this};e.getDefault=function(){if(!globalThis_1[ENDPOINT_KEY]){globalThis_1[ENDPOINT_KEY]=new e;window.console.debug("[JS_SDK] Created default endpoint",globalThis_1[ENDPOINT_KEY].baseURL)}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.baseURL=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()){window.console.warn("[JS_SDK] Ignoring attempt to use expired session token");return this.clearSession()}this.token=e;this.session=t;if(this.sessionType==="user"){this.api.defaults.headers.common.Authorization="Bearer ".concat(e)}else{this.api.defaults.headers.common.signer="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;delete this.api.defaults.headers.common.signer;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.clearSignerSession=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}();export{TemplateSenderTypes as T,VerdocsEndpoint as V,TemplateActions as a,createTemplatev2 as b,canPerformTemplateAction as c,deleteTemplate as d,getTemplate as g,listTemplates as l,updateTemplate as u};
|
1
|
+
var __assign=this&&this.__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 __spreadArray=this&&this.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++){if(o||!(n in t)){if(!o)o=Array.prototype.slice.call(t,0,n);o[n]=t[n]}}return e.concat(o||Array.prototype.slice.call(t))};import{d as decodeAccessTokenBody}from"./Types-5f31149e.js";var TemplateSenderTypes$1;(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$1||(TemplateSenderTypes$1={}));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 canPerformTemplateAction=function(e,t,r){var n,i;if(!r&&!t.includes("create")){return{canPerform:false,message:"Missing required template object"}}var o=(e===null||e===void 0?void 0:e.profile_id)||"BOGUS";var s=(e===null||e===void 0?void 0:e.organization_id)||"BOGUS";if(!o){return{canPerform:false,message:"Active session required"}}var a=(r===null||r===void 0?void 0:r.profile_id)===o;var u=(r===null||r===void 0?void 0:r.organization_id)===s;var l=(n=r===null||r===void 0?void 0:r.is_personal)!==null&&n!==void 0?n:false;var c=(i=r===null||r===void 0?void 0:r.is_public)!==null&&i!==void 0?i:false;var f=[];switch(t){case"create_personal":f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PERSONAL);break;case"create_org":f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_ORG);break;case"create_public":f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PUBLIC);break;case"read":if(!a){if(!l&&u||!c){f.push(TemplatePermissions.TEMPLATE_MEMBER_READ)}}break;case"write":if(!a){f.push(TemplatePermissions.TEMPLATE_MEMBER_READ);f.push(TemplatePermissions.TEMPLATE_MEMBER_WRITE)}break;case"change_visibility_personal":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PERSONAL)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_org":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_ORG)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY)}break;case"change_visibility_public":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_CREATE_PUBLIC);f.push(TemplatePermissions.TEMPLATE_CREATOR_VISIBILITY)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_VISIBILITY)}break;case"delete":if(a){f.push(TemplatePermissions.TEMPLATE_CREATOR_DELETE)}else{f.push(TemplatePermissions.TEMPLATE_MEMBER_DELETE)}break;default:return{canPerform:false,message:"Action is not defined"}}if(hasRequiredPermissions(e,f)){return{canPerform:true,message:""}}return{canPerform:false,message:"Insufficient access to perform '".concat(t,"'. Needed permissions: ").concat(f.toString())}};var hasRequiredPermissions=function(e,t){return t.every((function(t){return((e===null||e===void 0?void 0:e.permissions)||[]).includes(t)}))};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{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n["throw"](e))}catch(e){o(e)}}function u(e){e.done?r(e.value):i(e.value).then(s,a)}u((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 u([e,t])}}function u(a){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,a[0]&&(r=0)),r)try{if(n=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var getTemplate=function(e,t){return e.api.get("/templates/".concat(t)).then((function(e){return e.data}))};var ALLOWED_CREATE_FIELDS=["name","is_personal","is_public","sender","description","roles","fields"];var createTemplatev2=function(e,t,r){var n={timeout:12e4,onUploadProgress:function(e){var t=e.total||1;var n=e.loaded||0;r===null||r===void 0?void 0:r(Math.floor(n*100/(t||1)),n,t||1)}};if(t.documents&&t.documents[0]instanceof File){var i=new FormData;ALLOWED_CREATE_FIELDS.forEach((function(e){if(t[e]!==undefined){i.append(e,t[e])}}));t.documents.forEach((function(e){i.append("documents",e,e.name)}));return e.api.post("/v2/templates",i,n).then((function(e){return e.data}))}else{return e.api.post("/v2/templates",t,n).then((function(e){return e.data}))}};var updateTemplate=function(e,t,r){return e.api.put("/templates/".concat(t),r).then((function(e){return e.data}))};var deleteTemplate=function(e,t){return e.api.delete("/templates/".concat(t)).then((function(e){return e.data}))};var SortOptions$1;(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$1||(SortOptions$1={}));var listTemplates=function(e,t){if(t===void 0){t={}}return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return[2,e.api.post("/templates/list",t).then((function(e){return e.data}))]}))}))};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 Permissions;(function(e){e["RCOMMON"]="rcommon:access";e["RFORM_ACCESS"]="rform:access";e["ORG_CREATE"]="org:create";e["ORG_VIEW"]="org:view";e["ORG_UPDATE"]="org:update";e["ORG_DELETE"]="org:delete";e["ORG_TRANSFER"]="org:transfer";e["ORG_LIST"]="org:list";e["OWNER_ADD"]="owner:add";e["OWNER_REMOVE"]="owner:remove";e["ADMIN_ADD"]="admin:add";e["ADMIN_REMOVE"]="admin:remove";e["MEMBER_VIEW"]="member:view";e["MEMBER_ADD"]="member:add";e["MEMBER_REMOVE"]="member:remove";e["TEMPLATE_CREATOR_DELETE"]="template:creator:delete";e["TEMPLATE_CREATOR_VISIBILITY"]="template:creator:visibility";e["TEMPLATE_CREATOR_CREATE_ORG"]="template:creator:create:org";e["TEMPLATE_CREATOR_CREATE_PUBLIC"]="template:creator:create:public";e["TEMPLATE_CREATOR_CREATE_PERSONAL"]="template:creator:create:personal";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"})(Permissions||(Permissions={}));var Plans;(function(e){e["ENV_ESSENTIAL"]="env:essential";e["ORG_STANDARD"]="org:standard"})(Plans||(Plans={}));var Roles;(function(e){e["OWNER"]="owner";e["BASIC_USER"]="basic_user";e["MEMBER"]="member"})(Roles||(Roles={}));function bind(e,t){return function r(){return e.apply(t,arguments)}}var toString=Object.prototype.toString;var getPrototypeOf=Object.getPrototypeOf;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));var kindOfTest=function(e){e=e.toLowerCase();return function(t){return kindOf(t)===e}};var typeOfTest=function(e){return function(t){return typeof t===e}};var isArray=Array.isArray;var isUndefined=typeOfTest("undefined");function isBuffer(e){return e!==null&&!isUndefined(e)&&e.constructor!==null&&!isUndefined(e.constructor)&&isFunction(e.constructor.isBuffer)&&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}var isString=typeOfTest("string");var isFunction=typeOfTest("function");var isNumber=typeOfTest("number");var isObject=function(e){return e!==null&&typeof e==="object"};var isBoolean=function(e){return e===true||e===false};var isPlainObject=function(e){if(kindOf(e)!=="object"){return false}var t=getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var isDate=kindOfTest("Date");var isFile=kindOfTest("File");var isBlob=kindOfTest("Blob");var isFileList=kindOfTest("FileList");var isStream=function(e){return isObject(e)&&isFunction(e.pipe)};var isFormData=function(e){var t;return e&&(typeof FormData==="function"&&e instanceof FormData||isFunction(e.append)&&((t=kindOf(e))==="formdata"||t==="object"&&isFunction(e.toString)&&e.toString()==="[object FormData]"))};var isURLSearchParams=kindOfTest("URLSearchParams");var trim=function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function forEach(e,t,r){var n=r===void 0?{}:r,i=n.allOwnKeys,o=i===void 0?false:i;if(e===null||typeof e==="undefined"){return}var s;var a;if(typeof e!=="object"){e=[e]}if(isArray(e)){for(s=0,a=e.length;s<a;s++){t.call(null,e[s],s,e)}}else{var u=o?Object.getOwnPropertyNames(e):Object.keys(e);var l=u.length;var c=void 0;for(s=0;s<l;s++){c=u[s];t.call(null,e[c],c,e)}}}function findKey(e,t){t=t.toLowerCase();var r=Object.keys(e);var n=r.length;var i;while(n-- >0){i=r[n];if(t===i.toLowerCase()){return i}}return null}var _global=function(){if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global}();var isContextDefined=function(e){return!isUndefined(e)&&e!==_global};function merge(){var e=(isContextDefined(this)&&this||{}).caseless;var t={};var r=function(r,n){var i=e&&findKey(t,n)||n;if(isPlainObject(t[i])&&isPlainObject(r)){t[i]=merge(t[i],r)}else if(isPlainObject(r)){t[i]=merge({},r)}else if(isArray(r)){t[i]=r.slice()}else{t[i]=r}};for(var n=0,i=arguments.length;n<i;n++){arguments[n]&&forEach(arguments[n],r)}return t}var extend=function(e,t,r,n){var i=n===void 0?{}:n,o=i.allOwnKeys;forEach(t,(function(t,n){if(r&&isFunction(t)){e[n]=bind(t,r)}else{e[n]=t}}),{allOwnKeys:o});return e};var stripBOM=function(e){if(e.charCodeAt(0)===65279){e=e.slice(1)}return e};var inherits=function(e,t,r,n){e.prototype=Object.create(t.prototype,n);e.prototype.constructor=e;Object.defineProperty(e,"super",{value:t.prototype});r&&Object.assign(e.prototype,r)};var toFlatObject=function(e,t,r,n){var i;var o;var s;var a={};t=t||{};if(e==null)return t;do{i=Object.getOwnPropertyNames(e);o=i.length;while(o-- >0){s=i[o];if((!n||n(s,e,t))&&!a[s]){t[s]=e[s];a[s]=true}}e=r!==false&&getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t};var endsWith=function(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};var toArray=function(e){if(!e)return null;if(isArray(e))return e;var t=e.length;if(!isNumber(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"&&getPrototypeOf(Uint8Array));var forEachEntry=function(e,t){var r=e&&e[Symbol.iterator];var n=r.call(e);var i;while((i=n.next())&&!i.done){var o=i.value;t.call(e,o[0],o[1])}};var matchAll=function(e,t){var r;var n=[];while((r=e.exec(t))!==null){n.push(r)}return n};var isHTMLForm=kindOfTest("HTMLFormElement");var toCamelCase=function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function e(t,r,n){return r.toUpperCase()+n}))};var hasOwnProperty=function(e){var t=e.hasOwnProperty;return function(e,r){return t.call(e,r)}}(Object.prototype);var isRegExp=kindOfTest("RegExp");var reduceDescriptors=function(e,t){var r=Object.getOwnPropertyDescriptors(e);var n={};forEach(r,(function(r,i){var o;if((o=t(r,i,e))!==false){n[i]=o||r}}));Object.defineProperties(e,n)};var freezeMethods=function(e){reduceDescriptors(e,(function(t,r){if(isFunction(e)&&["arguments","caller","callee"].indexOf(r)!==-1){return false}var n=e[r];if(!isFunction(n))return;t.enumerable=false;if("writable"in t){t.writable=false;return}if(!t.set){t.set=function(){throw Error("Can not rewrite read-only method '"+r+"'")}}}))};var toObjectSet=function(e,t){var r={};var n=function(e){e.forEach((function(e){r[e]=true}))};isArray(e)?n(e):n(String(e).split(t));return r};var noop=function(){};var toFiniteNumber=function(e,t){e=+e;return Number.isFinite(e)?e:t};var ALPHA="abcdefghijklmnopqrstuvwxyz";var DIGIT="0123456789";var ALPHABET={DIGIT:DIGIT,ALPHA:ALPHA,ALPHA_DIGIT:ALPHA+ALPHA.toUpperCase()+DIGIT};var generateString=function(e,t){if(e===void 0){e=16}if(t===void 0){t=ALPHABET.ALPHA_DIGIT}var r="";var n=t.length;while(e--){r+=t[Math.random()*n|0]}return r};function isSpecCompliantForm(e){return!!(e&&isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var toJSONObject=function(e){var t=new Array(10);var r=function(e,n){if(isObject(e)){if(t.indexOf(e)>=0){return}if(!("toJSON"in e)){t[n]=e;var i=isArray(e)?[]:{};forEach(e,(function(e,t){var o=r(e,n+1);!isUndefined(o)&&(i[t]=o)}));t[n]=undefined;return i}}return e};return r(e,0)};var isAsyncFn=kindOfTest("AsyncFunction");var isThenable=function(e){return e&&(isObject(e)||isFunction(e))&&isFunction(e.then)&&isFunction(e.catch)};var utils$1={isArray:isArray,isArrayBuffer:isArrayBuffer,isBuffer:isBuffer,isFormData:isFormData,isArrayBufferView:isArrayBufferView,isString:isString,isNumber:isNumber,isBoolean:isBoolean,isObject:isObject,isPlainObject:isPlainObject,isUndefined:isUndefined,isDate:isDate,isFile:isFile,isBlob:isBlob,isRegExp:isRegExp,isFunction:isFunction,isStream:isStream,isURLSearchParams:isURLSearchParams,isTypedArray:isTypedArray,isFileList:isFileList,forEach:forEach,merge:merge,extend:extend,trim:trim,stripBOM:stripBOM,inherits:inherits,toFlatObject:toFlatObject,kindOf:kindOf,kindOfTest:kindOfTest,endsWith:endsWith,toArray:toArray,forEachEntry:forEachEntry,matchAll:matchAll,isHTMLForm:isHTMLForm,hasOwnProperty:hasOwnProperty,hasOwnProp:hasOwnProperty,reduceDescriptors:reduceDescriptors,freezeMethods:freezeMethods,toObjectSet:toObjectSet,toCamelCase:toCamelCase,noop:noop,toFiniteNumber:toFiniteNumber,findKey:findKey,global:_global,isContextDefined:isContextDefined,ALPHABET:ALPHABET,generateString:generateString,isSpecCompliantForm:isSpecCompliantForm,toJSONObject:toJSONObject,isAsyncFn:isAsyncFn,isThenable:isThenable};function AxiosError(e,t,r,n,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=e;this.name="AxiosError";t&&(this.code=t);r&&(this.config=r);n&&(this.request=n);i&&(this.response=i)}utils$1.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:utils$1.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var prototype$1=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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){descriptors[e]={value:e}}));Object.defineProperties(AxiosError,descriptors);Object.defineProperty(prototype$1,"isAxiosError",{value:true});AxiosError.from=function(e,t,r,n,i,o){var s=Object.create(prototype$1);utils$1.toFlatObject(e,s,(function e(t){return t!==Error.prototype}),(function(e){return e!=="isAxiosError"}));AxiosError.call(s,e.message,t,r,n,i);s.cause=e;s.name=e.name;o&&Object.assign(s,o);return s};var httpAdapter=null;function isVisitable(e){return utils$1.isPlainObject(e)||utils$1.isArray(e)}function removeBrackets(e){return utils$1.endsWith(e,"[]")?e.slice(0,-2):e}function renderKey(e,t,r){if(!e)return t;return e.concat(t).map((function e(t,n){t=removeBrackets(t);return!r&&n?"["+t+"]":t})).join(r?".":"")}function isFlatArray(e){return utils$1.isArray(e)&&!e.some(isVisitable)}var predicates=utils$1.toFlatObject(utils$1,{},null,(function e(t){return/^is[A-Z]/.test(t)}));function toFormData(e,t,r){if(!utils$1.isObject(e)){throw new TypeError("target must be an object")}t=t||new FormData;r=utils$1.toFlatObject(r,{metaTokens:true,dots:false,indexes:false},false,(function e(t,r){return!utils$1.isUndefined(r[t])}));var n=r.metaTokens;var i=r.visitor||c;var o=r.dots;var s=r.indexes;var a=r.Blob||typeof Blob!=="undefined"&&Blob;var u=a&&utils$1.isSpecCompliantForm(t);if(!utils$1.isFunction(i)){throw new TypeError("visitor must be a function")}function l(e){if(e===null)return"";if(utils$1.isDate(e)){return e.toISOString()}if(!u&&utils$1.isBlob(e)){throw new AxiosError("Blob is not supported. Use a Buffer instead.")}if(utils$1.isArrayBuffer(e)||utils$1.isTypedArray(e)){return u&&typeof Blob==="function"?new Blob([e]):Buffer.from(e)}return e}function c(e,r,i){var a=e;if(e&&!i&&typeof e==="object"){if(utils$1.endsWith(r,"{}")){r=n?r:r.slice(0,-2);e=JSON.stringify(e)}else if(utils$1.isArray(e)&&isFlatArray(e)||(utils$1.isFileList(e)||utils$1.endsWith(r,"[]"))&&(a=utils$1.toArray(e))){r=removeBrackets(r);a.forEach((function e(n,i){!(utils$1.isUndefined(n)||n===null)&&t.append(s===true?renderKey([r],i,o):s===null?r:r+"[]",l(n))}));return false}}if(isVisitable(e)){return true}t.append(renderKey(i,r,o),l(e));return false}var f=[];var d=Object.assign(predicates,{defaultVisitor:c,convertValue:l,isVisitable:isVisitable});function p(e,r){if(utils$1.isUndefined(e))return;if(f.indexOf(e)!==-1){throw Error("Circular reference detected in "+r.join("."))}f.push(e);utils$1.forEach(e,(function e(n,o){var s=!(utils$1.isUndefined(n)||n===null)&&i.call(t,n,utils$1.isString(o)?o.trim():o,r,d);if(s===true){p(n,r?r.concat(o):[o])}}));f.pop()}if(!utils$1.isObject(e)){throw new TypeError("data must be an object")}p(e);return t}function encode$1(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function e(r){return t[r]}))}function AxiosURLSearchParams(e,t){this._pairs=[];e&&toFormData(e,this,t)}var prototype=AxiosURLSearchParams.prototype;prototype.append=function e(t,r){this._pairs.push([t,r])};prototype.toString=function e(t){var r=t?function(e){return t.call(this,e,encode$1)}:encode$1;return this._pairs.map((function e(t){return r(t[0])+"="+r(t[1])}),"").join("&")};function encode(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function buildURL(e,t,r){if(!t){return e}var n=r&&r.encode||encode;var i=r&&r.serialize;var o;if(i){o=i(t,r)}else{o=utils$1.isURLSearchParams(t)?t.toString():new AxiosURLSearchParams(t,r).toString(n)}if(o){var s=e.indexOf("#");if(s!==-1){e=e.slice(0,s)}e+=(e.indexOf("?")===-1?"?":"&")+o}return e}var InterceptorManager=function(){function e(){this.handlers=[]}e.prototype.use=function(e,t,r){this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:false,runWhen:r?r.runWhen:null});return this.handlers.length-1};e.prototype.eject=function(e){if(this.handlers[e]){this.handlers[e]=null}};e.prototype.clear=function(){if(this.handlers){this.handlers=[]}};e.prototype.forEach=function(e){utils$1.forEach(this.handlers,(function t(r){if(r!==null){e(r)}}))};return e}();var transitionalDefaults={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};var URLSearchParams$1=typeof URLSearchParams!=="undefined"?URLSearchParams:AxiosURLSearchParams;var FormData$1=typeof FormData!=="undefined"?FormData:null;var Blob$1=typeof Blob!=="undefined"?Blob:null;var platform$1={isBrowser:true,classes:{URLSearchParams:URLSearchParams$1,FormData:FormData$1,Blob:Blob$1},protocols:["http","https","file","blob","url","data"]};var hasBrowserEnv=typeof window!=="undefined"&&typeof document!=="undefined";var hasStandardBrowserEnv=function(e){return hasBrowserEnv&&["ReactNative","NativeScript","NS"].indexOf(e)<0}(typeof navigator!=="undefined"&&navigator.product);var hasStandardBrowserWebWorkerEnv=function(){return typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"}();var utils=Object.freeze({__proto__:null,hasBrowserEnv:hasBrowserEnv,hasStandardBrowserWebWorkerEnv:hasStandardBrowserWebWorkerEnv,hasStandardBrowserEnv:hasStandardBrowserEnv});var platform=__assign(__assign({},utils),platform$1);function toURLEncodedForm(e,t){return toFormData(e,new platform.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){if(platform.isNode&&utils$1.isBuffer(e)){this.append(t,e.toString("base64"));return false}return n.defaultVisitor.apply(this,arguments)}},t))}function parsePropPath(e){return utils$1.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return e[0]==="[]"?"":e[1]||e[0]}))}function arrayToObject(e){var t={};var r=Object.keys(e);var n;var i=r.length;var o;for(n=0;n<i;n++){o=r[n];t[o]=e[o]}return t}function formDataToJSON(e){function t(e,r,n,i){var o=e[i++];if(o==="__proto__")return true;var s=Number.isFinite(+o);var a=i>=e.length;o=!o&&utils$1.isArray(n)?n.length:o;if(a){if(utils$1.hasOwnProp(n,o)){n[o]=[n[o],r]}else{n[o]=r}return!s}if(!n[o]||!utils$1.isObject(n[o])){n[o]=[]}var u=t(e,r,n[o],i);if(u&&utils$1.isArray(n[o])){n[o]=arrayToObject(n[o])}return!s}if(utils$1.isFormData(e)&&utils$1.isFunction(e.entries)){var r={};utils$1.forEachEntry(e,(function(e,n){t(parsePropPath(e),n,r,0)}));return r}return null}function stringifySafely(e,t,r){if(utils$1.isString(e)){try{(t||JSON.parse)(e);return utils$1.trim(e)}catch(e){if(e.name!=="SyntaxError"){throw e}}}return(r||JSON.stringify)(e)}var defaults={transitional:transitionalDefaults,adapter:["xhr","http"],transformRequest:[function e(t,r){var n=r.getContentType()||"";var i=n.indexOf("application/json")>-1;var o=utils$1.isObject(t);if(o&&utils$1.isHTMLForm(t)){t=new FormData(t)}var s=utils$1.isFormData(t);if(s){if(!i){return t}return i?JSON.stringify(formDataToJSON(t)):t}if(utils$1.isArrayBuffer(t)||utils$1.isBuffer(t)||utils$1.isStream(t)||utils$1.isFile(t)||utils$1.isBlob(t)){return t}if(utils$1.isArrayBufferView(t)){return t.buffer}if(utils$1.isURLSearchParams(t)){r.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return t.toString()}var a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1){return toURLEncodedForm(t,this.formSerializer).toString()}if((a=utils$1.isFileList(t))||n.indexOf("multipart/form-data")>-1){var u=this.env&&this.env.FormData;return toFormData(a?{"files[]":t}:t,u&&new u,this.formSerializer)}}if(o||i){r.setContentType("application/json",false);return stringifySafely(t)}return t}],transformResponse:[function e(t){var r=this.transitional||defaults.transitional;var n=r&&r.forcedJSONParsing;var i=this.responseType==="json";if(t&&utils$1.isString(t)&&(n&&!this.responseType||i)){var o=r&&r.silentJSONParsing;var s=!o&&i;try{return JSON.parse(t)}catch(e){if(s){if(e.name==="SyntaxError"){throw AxiosError.from(e,AxiosError.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:platform.classes.FormData,Blob:platform.classes.Blob},validateStatus:function e(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};utils$1.forEach(["delete","get","head","post","put","patch"],(function(e){defaults.headers[e]={}}));var ignoreDuplicateOf=utils$1.toObjectSet(["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){var t={};var r;var n;var i;e&&e.split("\n").forEach((function e(o){i=o.indexOf(":");r=o.substring(0,i).trim().toLowerCase();n=o.substring(i+1).trim();if(!r||t[r]&&ignoreDuplicateOf[r]){return}if(r==="set-cookie"){if(t[r]){t[r].push(n)}else{t[r]=[n]}}else{t[r]=t[r]?t[r]+", "+n:n}}));return t};var $internals=Symbol("internals");function normalizeHeader(e){return e&&String(e).trim().toLowerCase()}function normalizeValue(e){if(e===false||e==null){return e}return utils$1.isArray(e)?e.map(normalizeValue):String(e)}function parseTokens(e){var t=Object.create(null);var r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;var n;while(n=r.exec(e)){t[n[1]]=n[2]}return t}var isValidHeaderName=function(e){return/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())};function matchHeaderValue(e,t,r,n,i){if(utils$1.isFunction(n)){return n.call(this,t,r)}if(i){t=r}if(!utils$1.isString(t))return;if(utils$1.isString(n)){return t.indexOf(n)!==-1}if(utils$1.isRegExp(n)){return n.test(t)}}function formatHeader(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r}))}function buildAccessors(e,t){var r=utils$1.toCamelCase(" "+t);["get","set","has"].forEach((function(n){Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:true})}))}var AxiosHeaders=function(){function e(e){e&&this.set(e)}e.prototype.set=function(e,t,r){var n=this;function i(e,t,r){var i=normalizeHeader(t);if(!i){throw new Error("header name must be a non-empty string")}var o=utils$1.findKey(n,i);if(!o||n[o]===undefined||r===true||r===undefined&&n[o]!==false){n[o||t]=normalizeValue(e)}}var o=function(e,t){return utils$1.forEach(e,(function(e,r){return i(e,r,t)}))};if(utils$1.isPlainObject(e)||e instanceof this.constructor){o(e,t)}else if(utils$1.isString(e)&&(e=e.trim())&&!isValidHeaderName(e)){o(parseHeaders(e),t)}else{e!=null&&i(t,e,r)}return this};e.prototype.get=function(e,t){e=normalizeHeader(e);if(e){var r=utils$1.findKey(this,e);if(r){var n=this[r];if(!t){return n}if(t===true){return parseTokens(n)}if(utils$1.isFunction(t)){return t.call(this,n,r)}if(utils$1.isRegExp(t)){return t.exec(n)}throw new TypeError("parser must be boolean|regexp|function")}}};e.prototype.has=function(e,t){e=normalizeHeader(e);if(e){var r=utils$1.findKey(this,e);return!!(r&&this[r]!==undefined&&(!t||matchHeaderValue(this,this[r],r,t)))}return false};e.prototype.delete=function(e,t){var r=this;var n=false;function i(e){e=normalizeHeader(e);if(e){var i=utils$1.findKey(r,e);if(i&&(!t||matchHeaderValue(r,r[i],i,t))){delete r[i];n=true}}}if(utils$1.isArray(e)){e.forEach(i)}else{i(e)}return n};e.prototype.clear=function(e){var t=Object.keys(this);var r=t.length;var n=false;while(r--){var i=t[r];if(!e||matchHeaderValue(this,this[i],i,e,true)){delete this[i];n=true}}return n};e.prototype.normalize=function(e){var t=this;var r={};utils$1.forEach(this,(function(n,i){var o=utils$1.findKey(r,i);if(o){t[o]=normalizeValue(n);delete t[i];return}var s=e?formatHeader(i):String(i).trim();if(s!==i){delete t[i]}t[s]=normalizeValue(n);r[s]=true}));return this};e.prototype.concat=function(){var e;var t=[];for(var r=0;r<arguments.length;r++){t[r]=arguments[r]}return(e=this.constructor).concat.apply(e,__spreadArray([this],t,false))};e.prototype.toJSON=function(e){var t=Object.create(null);utils$1.forEach(this,(function(r,n){r!=null&&r!==false&&(t[n]=e&&utils$1.isArray(r)?r.join(", "):r)}));return t};e.prototype[Symbol.iterator]=function(){return Object.entries(this.toJSON())[Symbol.iterator]()};e.prototype.toString=function(){return Object.entries(this.toJSON()).map((function(e){var t=e[0],r=e[1];return t+": "+r})).join("\n")};Object.defineProperty(e.prototype,Symbol.toStringTag,{get:function(){return"AxiosHeaders"},enumerable:false,configurable:true});e.from=function(e){return e instanceof this?e:new this(e)};e.concat=function(e){var t=[];for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}var n=new this(e);t.forEach((function(e){return n.set(e)}));return n};e.accessor=function(e){var t=this[$internals]=this[$internals]={accessors:{}};var r=t.accessors;var n=this.prototype;function i(e){var t=normalizeHeader(e);if(!r[t]){buildAccessors(n,e);r[t]=true}}utils$1.isArray(e)?e.forEach(i):i(e);return this};return e}();AxiosHeaders.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$1.reduceDescriptors(AxiosHeaders.prototype,(function(e,t){var r=e.value;var n=t[0].toUpperCase()+t.slice(1);return{get:function(){return r},set:function(e){this[n]=e}}}));utils$1.freezeMethods(AxiosHeaders);function transformData(e,t){var r=this||defaults;var n=t||r;var i=AxiosHeaders.from(n.headers);var o=n.data;utils$1.forEach(e,(function e(n){o=n.call(r,o,i.normalize(),t?t.status:undefined)}));i.normalize();return o}function isCancel(e){return!!(e&&e.__CANCEL__)}function CanceledError(e,t,r){AxiosError.call(this,e==null?"canceled":e,AxiosError.ERR_CANCELED,t,r);this.name="CanceledError"}utils$1.inherits(CanceledError,AxiosError,{__CANCEL__:true});function settle(e,t,r){var n=r.config.validateStatus;if(!r.status||!n||n(r.status)){e(r)}else{t(new AxiosError("Request failed with status code "+r.status,[AxiosError.ERR_BAD_REQUEST,AxiosError.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}}var cookies=platform.hasStandardBrowserEnv?{write:function(e,t,r,n,i,o){var s=[e+"="+encodeURIComponent(t)];utils$1.isNumber(r)&&s.push("expires="+new Date(r).toGMTString());utils$1.isString(n)&&s.push("path="+n);utils$1.isString(i)&&s.push("domain="+i);o===true&&s.push("secure");document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function isAbsoluteURL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function combineURLs(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function buildFullPath(e,t){if(e&&!isAbsoluteURL(t)){return combineURLs(e,t)}return t}var isURLSameOrigin=platform.hasStandardBrowserEnv?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$1.isString(t)?i(t):t;return r.protocol===n.protocol&&r.host===n.host}}():function e(){return function e(){return true}}();function parseProtocol(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function speedometer(e,t){e=e||10;var r=new Array(e);var n=new Array(e);var i=0;var o=0;var s;t=t!==undefined?t:1e3;return function a(u){var l=Date.now();var c=n[o];if(!s){s=l}r[i]=u;n[i]=l;var f=o;var d=0;while(f!==i){d+=r[f++];f=f%e}i=(i+1)%e;if(i===o){o=(o+1)%e}if(l-s<t){return}var p=c&&l-c;return p?Math.round(d*1e3/p):undefined}}function progressEventReducer(e,t){var r=0;var n=speedometer(50,250);return function(i){var o=i.loaded;var s=i.lengthComputable?i.total:undefined;var a=o-r;var u=n(a);var l=o<=s;r=o;var c={loaded:o,total:s,progress:s?o/s:undefined,bytes:a,rate:u?u:undefined,estimated:u&&s&&l?(s-o)/u:undefined,event:i};c[t?"download":"upload"]=true;e(c)}}var isXHRAdapterSupported=typeof XMLHttpRequest!=="undefined";var xhrAdapter=isXHRAdapterSupported&&function(e){return new Promise((function t(r,n){var i=e.data;var o=AxiosHeaders.from(e.headers).normalize();var s=e.responseType,a=e.withXSRFToken;var u;function l(){if(e.cancelToken){e.cancelToken.unsubscribe(u)}if(e.signal){e.signal.removeEventListener("abort",u)}}var c;if(utils$1.isFormData(i)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv){o.setContentType(false)}else if((c=o.getContentType())!==false){var f=c?c.split(";").map((function(e){return e.trim()})).filter(Boolean):[],d=f[0],p=f.slice(1);o.setContentType(__spreadArray([d||"multipart/form-data"],p,true).join("; "))}}var h=new XMLHttpRequest;if(e.auth){var m=e.auth.username||"";var v=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(m+":"+v))}var E=buildFullPath(e.baseURL,e.url);h.open(e.method.toUpperCase(),buildURL(E,e.params,e.paramsSerializer),true);h.timeout=e.timeout;function T(){if(!h){return}var t=AxiosHeaders.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders());var i=!s||s==="text"||s==="json"?h.responseText:h.response;var o={data:i,status:h.status,statusText:h.statusText,headers:t,config:e,request:h};settle((function e(t){r(t);l()}),(function e(t){n(t);l()}),o);h=null}if("onloadend"in h){h.onloadend=T}else{h.onreadystatechange=function e(){if(!h||h.readyState!==4){return}if(h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)){return}setTimeout(T)}}h.onabort=function t(){if(!h){return}n(new AxiosError("Request aborted",AxiosError.ECONNABORTED,e,h));h=null};h.onerror=function t(){n(new AxiosError("Network Error",AxiosError.ERR_NETWORK,e,h));h=null};h.ontimeout=function t(){var r=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";var i=e.transitional||transitionalDefaults;if(e.timeoutErrorMessage){r=e.timeoutErrorMessage}n(new AxiosError(r,i.clarifyTimeoutError?AxiosError.ETIMEDOUT:AxiosError.ECONNABORTED,e,h));h=null};if(platform.hasStandardBrowserEnv){a&&utils$1.isFunction(a)&&(a=a(e));if(a||a!==false&&isURLSameOrigin(E)){var y=e.xsrfHeaderName&&e.xsrfCookieName&&cookies.read(e.xsrfCookieName);if(y){o.set(e.xsrfHeaderName,y)}}}i===undefined&&o.setContentType(null);if("setRequestHeader"in h){utils$1.forEach(o.toJSON(),(function e(t,r){h.setRequestHeader(r,t)}))}if(!utils$1.isUndefined(e.withCredentials)){h.withCredentials=!!e.withCredentials}if(s&&s!=="json"){h.responseType=e.responseType}if(typeof e.onDownloadProgress==="function"){h.addEventListener("progress",progressEventReducer(e.onDownloadProgress,true))}if(typeof e.onUploadProgress==="function"&&h.upload){h.upload.addEventListener("progress",progressEventReducer(e.onUploadProgress))}if(e.cancelToken||e.signal){u=function(t){if(!h){return}n(!t||t.type?new CanceledError(null,e,h):t);h.abort();h=null};e.cancelToken&&e.cancelToken.subscribe(u);if(e.signal){e.signal.aborted?u():e.signal.addEventListener("abort",u)}}var A=parseProtocol(E);if(A&&platform.protocols.indexOf(A)===-1){n(new AxiosError("Unsupported protocol "+A+":",AxiosError.ERR_BAD_REQUEST,e));return}h.send(i||null)}))};var knownAdapters={http:httpAdapter,xhr:xhrAdapter};utils$1.forEach(knownAdapters,(function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var renderReason=function(e){return"- ".concat(e)};var isResolvedHandle=function(e){return utils$1.isFunction(e)||e===null||e===false};var adapters={getAdapter:function(e){e=utils$1.isArray(e)?e:[e];var t=e.length;var r;var n;var i={};for(var o=0;o<t;o++){r=e[o];var s=void 0;n=r;if(!isResolvedHandle(r)){n=knownAdapters[(s=String(r)).toLowerCase()];if(n===undefined){throw new AxiosError("Unknown adapter '".concat(s,"'"))}}if(n){break}i[s||"#"+o]=n}if(!n){var a=Object.entries(i).map((function(e){var t=e[0],r=e[1];return"adapter ".concat(t," ")+(r===false?"is not supported by the environment":"is not available in the build")}));var u=t?a.length>1?"since :\n"+a.map(renderReason).join("\n"):" "+renderReason(a[0]):"as no adapter specified";throw new AxiosError("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return n},adapters:knownAdapters};function throwIfCancellationRequested(e){if(e.cancelToken){e.cancelToken.throwIfRequested()}if(e.signal&&e.signal.aborted){throw new CanceledError(null,e)}}function dispatchRequest(e){throwIfCancellationRequested(e);e.headers=AxiosHeaders.from(e.headers);e.data=transformData.call(e,e.transformRequest);if(["post","put","patch"].indexOf(e.method)!==-1){e.headers.setContentType("application/x-www-form-urlencoded",false)}var t=adapters.getAdapter(e.adapter||defaults.adapter);return t(e).then((function t(r){throwIfCancellationRequested(e);r.data=transformData.call(e,e.transformResponse,r);r.headers=AxiosHeaders.from(r.headers);return r}),(function t(r){if(!isCancel(r)){throwIfCancellationRequested(e);if(r&&r.response){r.response.data=transformData.call(e,e.transformResponse,r.response);r.response.headers=AxiosHeaders.from(r.response.headers)}}return Promise.reject(r)}))}var headersToObject=function(e){return e instanceof AxiosHeaders?e.toJSON():e};function mergeConfig(e,t){t=t||{};var r={};function n(e,t,r){if(utils$1.isPlainObject(e)&&utils$1.isPlainObject(t)){return utils$1.merge.call({caseless:r},e,t)}else if(utils$1.isPlainObject(t)){return utils$1.merge({},t)}else if(utils$1.isArray(t)){return t.slice()}return t}function i(e,t,r){if(!utils$1.isUndefined(t)){return n(e,t,r)}else if(!utils$1.isUndefined(e)){return n(undefined,e,r)}}function o(e,t){if(!utils$1.isUndefined(t)){return n(undefined,t)}}function s(e,t){if(!utils$1.isUndefined(t)){return n(undefined,t)}else if(!utils$1.isUndefined(e)){return n(undefined,e)}}function a(r,i,o){if(o in t){return n(r,i)}else if(o in e){return n(undefined,r)}}var u={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:function(e,t){return i(headersToObject(e),headersToObject(t),true)}};utils$1.forEach(Object.keys(Object.assign({},e,t)),(function n(o){var s=u[o]||i;var l=s(e[o],t[o],o);utils$1.isUndefined(l)&&s!==a||(r[o]=l)}));return r}var VERSION="1.6.5";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(i(n," has been removed"+(r?" in "+r:"")),AxiosError.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("options must be an object",AxiosError.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 u=a===undefined||s(a,o,e);if(u!==true){throw new AxiosError("option "+o+" must be "+u,AxiosError.ERR_BAD_OPTION_VALUE)}continue}if(r!==true){throw new AxiosError("Unknown option "+o,AxiosError.ERR_BAD_OPTION)}}}var validator={assertOptions:assertOptions,validators:validators$1};var validators=validator.validators;var Axios=function(){function e(e){this.defaults=e;this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}e.prototype.request=function(e,t){if(typeof e==="string"){t=t||{};t.url=e}else{t=e||{}}t=mergeConfig(this.defaults,t);var r=t.transitional,n=t.paramsSerializer,i=t.headers;if(r!==undefined){validator.assertOptions(r,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},false)}if(n!=null){if(utils$1.isFunction(n)){t.paramsSerializer={serialize:n}}else{validator.assertOptions(n,{encode:validators.function,serialize:validators.function},true)}}t.method=(t.method||this.defaults.method||"get").toLowerCase();var o=i&&utils$1.merge(i.common,i[t.method]);i&&utils$1.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete i[e]}));t.headers=AxiosHeaders.concat(o,i);var s=[];var a=true;this.interceptors.request.forEach((function e(r){if(typeof r.runWhen==="function"&&r.runWhen(t)===false){return}a=a&&r.synchronous;s.unshift(r.fulfilled,r.rejected)}));var u=[];this.interceptors.response.forEach((function e(t){u.push(t.fulfilled,t.rejected)}));var l;var c=0;var f;if(!a){var d=[dispatchRequest.bind(this),undefined];d.unshift.apply(d,s);d.push.apply(d,u);f=d.length;l=Promise.resolve(t);while(c<f){l=l.then(d[c++],d[c++])}return l}f=s.length;var p=t;c=0;while(c<f){var h=s[c++];var m=s[c++];try{p=h(p)}catch(e){m.call(this,e);break}}try{l=dispatchRequest.call(this,p)}catch(e){return Promise.reject(e)}c=0;f=u.length;while(c<f){l=l.then(u[c++],u[c++])}return l};e.prototype.getUri=function(e){e=mergeConfig(this.defaults,e);var t=buildFullPath(e.baseURL,e.url);return buildURL(t,e.params,e.paramsSerializer)};return e}();utils$1.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$1.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 CancelToken=function(){function e(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=r._listeners.length;while(t-- >0){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,i,o){if(r.reason){return}r.reason=new CanceledError(n,i,o);t(r.reason)}))}e.prototype.throwIfRequested=function(){if(this.reason){throw this.reason}};e.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}if(this._listeners){this._listeners.push(e)}else{this._listeners=[e]}};e.prototype.unsubscribe=function(e){if(!this._listeners){return}var t=this._listeners.indexOf(e);if(t!==-1){this._listeners.splice(t,1)}};e.source=function(){var t;var r=new e((function e(r){t=r}));return{token:r,cancel:t}};return e}();function spread(e){return function t(r){return e.apply(null,r)}}function isAxiosError(e){return utils$1.isObject(e)&&e.isAxiosError===true}var HttpStatusCode={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(HttpStatusCode).forEach((function(e){var t=e[0],r=e[1];HttpStatusCode[r]=t}));function createInstance(e){var t=new Axios(e);var r=bind(Axios.prototype.request,t);utils$1.extend(r,Axios.prototype,t,{allOwnKeys:true});utils$1.extend(r,t,null,{allOwnKeys:true});r.create=function t(r){return createInstance(mergeConfig(e,r))};return r}var axios=createInstance(defaults);axios.Axios=Axios;axios.CanceledError=CanceledError;axios.CancelToken=CancelToken;axios.isCancel=isCancel;axios.VERSION=VERSION;axios.toFormData=toFormData;axios.AxiosError=AxiosError;axios.Cancel=axios.CanceledError;axios.all=function e(t){return Promise.all(t)};axios.spread=spread;axios.isAxiosError=isAxiosError;axios.mergeConfig=mergeConfig;axios.AxiosHeaders=AxiosHeaders;axios.formToJSON=function(e){return formDataToJSON(utils$1.isHTMLForm(e)?new FormData(e):e)};axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode;axios.default=axios;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 ENDPOINT_KEY=Symbol.for("verdocs-default-endpoint");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=window.location.origin==="https://beta.verdocs.com"||window.location.origin==="https://stage.verdocs.com"?"https://stage-api.verdocs.com":"https://api.verdocs.com";this.clientID="not-set";this.timeout=6e4;this.token=null;this.nextListenerId=0;this.sessionListeners=new Map;this.requestLoggerId=null;this.session=null;this.baseURL=(e===null||e===void 0?void 0:e.baseURL)||this.baseURL;this.timeout=(e===null||e===void 0?void 0:e.timeout)||this.timeout;this.environment=(e===null||e===void 0?void 0:e.environment)||this.environment;this.sessionType=(e===null||e===void 0?void 0:e.sessionType)||this.sessionType;this.clientID=(e===null||e===void 0?void 0:e.clientID)||this.clientID;this.api=axios.create({baseURL:this.baseURL,timeout:this.timeout})}e.prototype.setDefault=function(){globalThis_1[ENDPOINT_KEY]=this};e.getDefault=function(){if(!globalThis_1[ENDPOINT_KEY]){globalThis_1[ENDPOINT_KEY]=new e;window.console.debug("[JS_SDK] Created default endpoint",globalThis_1[ENDPOINT_KEY].baseURL)}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.baseURL=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()){window.console.warn("[JS_SDK] Ignoring attempt to use expired session token");return this.clearSession()}this.token=e;this.session=t;if(this.sessionType==="user"){this.api.defaults.headers.common.Authorization="Bearer ".concat(e)}else{this.api.defaults.headers.common.signer="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;delete this.api.defaults.headers.common.signer;this.session=null;this.token=null;this.notifySessionListeners();return this};e.prototype.clearSignerSession=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}();export{TemplateSenderTypes as T,VerdocsEndpoint as V,TemplateActions as a,createTemplatev2 as b,canPerformTemplateAction as c,deleteTemplate as d,getTemplate as g,listTemplates as l,updateTemplate as u};
|