totalum-api-sdk 2.0.40 → 2.0.42
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/README.MD +103 -0
- package/dist/common/endpoints.d.ts +4 -0
- package/dist/common/endpoints.js +5 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +2 -0
- package/dist/services/EmailService.d.ts +33 -0
- package/dist/services/EmailService.js +63 -0
- package/dist/services/FilesService.d.ts +4 -0
- package/dist/services/FilesService.js +8 -0
- package/dist/services/StatisticService.d.ts +1 -9
- package/dist/services/StatisticService.js +0 -14
- package/dist/totalum-sdk.min.js +1 -1
- package/package.json +2 -2
package/README.MD
CHANGED
|
@@ -783,6 +783,109 @@ const documentResult = result.data.data;
|
|
|
783
783
|
|
|
784
784
|
```
|
|
785
785
|
|
|
786
|
+
### Create PDF from HTML
|
|
787
|
+
|
|
788
|
+
Create a PDF directly from custom HTML:
|
|
789
|
+
|
|
790
|
+
```javascript
|
|
791
|
+
|
|
792
|
+
const htmlContent = '<html><body><h1>Hello World</h1><p>This is a PDF created from HTML</p></body></html>';
|
|
793
|
+
const fileName = 'my-generated-pdf.pdf'; // replace with your desired file name
|
|
794
|
+
|
|
795
|
+
const result = await totalumClient.files.createPdfFromHtml({
|
|
796
|
+
html: htmlContent,
|
|
797
|
+
name: fileName
|
|
798
|
+
});
|
|
799
|
+
|
|
800
|
+
const fileResult = result.data.data;
|
|
801
|
+
// fileResult contains the generated PDF file information
|
|
802
|
+
|
|
803
|
+
// if you want to link this pdf to an item, you need to add the fileName to the item property of type file
|
|
804
|
+
const result2 = await totalumClient.crud.editItemById('your_element_table_name', 'your_item_id', {'your_pdf_property_name': {name: fileResult.fileName}});
|
|
805
|
+
|
|
806
|
+
```
|
|
807
|
+
|
|
808
|
+
**Note:** The HTML is automatically encoded to base64 by the SDK before sending it to the API.
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
## Functions for send emails
|
|
812
|
+
|
|
813
|
+
### Send a basic email
|
|
814
|
+
|
|
815
|
+
```javascript
|
|
816
|
+
|
|
817
|
+
const emailPayload = {
|
|
818
|
+
to: ['recipient@example.com'],
|
|
819
|
+
subject: 'Your email subject',
|
|
820
|
+
html: '<h1>Hello</h1><p>This is the email content in HTML</p>',
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
const result = await totalumClient.email.sendEmail(emailPayload);
|
|
824
|
+
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
### Send an email with all options
|
|
828
|
+
|
|
829
|
+
```javascript
|
|
830
|
+
|
|
831
|
+
const emailPayload = {
|
|
832
|
+
to: ['recipient1@example.com', 'recipient2@example.com'], // array of recipients
|
|
833
|
+
subject: 'Your email subject',
|
|
834
|
+
html: '<h1>Hello</h1><p>This is the email content in HTML</p>',
|
|
835
|
+
fromName: 'Your Company Name', // optional: custom sender name
|
|
836
|
+
cc: ['cc@example.com'], // optional: carbon copy recipients
|
|
837
|
+
bcc: ['bcc@example.com'], // optional: blind carbon copy recipients
|
|
838
|
+
replyTo: 'reply@example.com', // optional: reply-to address
|
|
839
|
+
attachments: [ // optional: array of attachments (max 10, each up to 15MB)
|
|
840
|
+
{
|
|
841
|
+
filename: 'document.pdf',
|
|
842
|
+
url: 'https://example.com/path/to/document.pdf',
|
|
843
|
+
contentType: 'application/pdf' // optional
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
filename: 'image.png',
|
|
847
|
+
url: 'https://example.com/path/to/image.png',
|
|
848
|
+
contentType: 'image/png' // optional
|
|
849
|
+
}
|
|
850
|
+
]
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
const result = await totalumClient.email.sendEmail(emailPayload);
|
|
854
|
+
|
|
855
|
+
```
|
|
856
|
+
|
|
857
|
+
### Send an email with files from Totalum storage
|
|
858
|
+
|
|
859
|
+
```javascript
|
|
860
|
+
|
|
861
|
+
// First, get the download URL of the file uploaded to Totalum
|
|
862
|
+
const fileNameId = 'your_file_name.pdf';
|
|
863
|
+
const fileUrlResult = await totalumClient.files.getDownloadUrl(fileNameId);
|
|
864
|
+
const [fileUrl] = fileUrlResult.data.data;
|
|
865
|
+
|
|
866
|
+
// Then, send the email with the attachment
|
|
867
|
+
const emailPayload = {
|
|
868
|
+
to: ['recipient@example.com'],
|
|
869
|
+
subject: 'Email with attachment from Totalum',
|
|
870
|
+
html: '<h1>Hello</h1><p>Please find the attached document</p>',
|
|
871
|
+
attachments: [
|
|
872
|
+
{
|
|
873
|
+
filename: 'document.pdf',
|
|
874
|
+
url: fileUrl,
|
|
875
|
+
contentType: 'application/pdf'
|
|
876
|
+
}
|
|
877
|
+
]
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
const result = await totalumClient.email.sendEmail(emailPayload);
|
|
881
|
+
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
**Important notes:**
|
|
885
|
+
- Maximum attachments: 10 per email
|
|
886
|
+
- Maximum size per attachment: 15MB
|
|
887
|
+
- All attachments must be provided as valid HTTP/HTTPS URLs
|
|
888
|
+
|
|
786
889
|
|
|
787
890
|
## Functions for call OpenAI API without need to have an OpenAI account
|
|
788
891
|
|
|
@@ -31,6 +31,7 @@ export declare const endpoints: {
|
|
|
31
31
|
};
|
|
32
32
|
pdfTemplate: {
|
|
33
33
|
generatePdfByTemplate: string;
|
|
34
|
+
createPdfFromHtml: string;
|
|
34
35
|
};
|
|
35
36
|
googleIntegration: {
|
|
36
37
|
getEmails: string;
|
|
@@ -49,4 +50,7 @@ export declare const endpoints: {
|
|
|
49
50
|
statistics: {
|
|
50
51
|
getStatistic: string;
|
|
51
52
|
};
|
|
53
|
+
email: {
|
|
54
|
+
sendEmail: string;
|
|
55
|
+
};
|
|
52
56
|
};
|
package/dist/common/endpoints.js
CHANGED
|
@@ -34,7 +34,8 @@ exports.endpoints = {
|
|
|
34
34
|
runCustomAggregationQuery: 'api/v1/filter/custom-mongo-aggregation-query'
|
|
35
35
|
},
|
|
36
36
|
pdfTemplate: {
|
|
37
|
-
generatePdfByTemplate: 'api/v1/pdf-template/generatePdfByTemplate/:id'
|
|
37
|
+
generatePdfByTemplate: 'api/v1/pdf-template/generatePdfByTemplate/:id',
|
|
38
|
+
createPdfFromHtml: 'api/v1/pdf-template/createPdfFromHtml'
|
|
38
39
|
},
|
|
39
40
|
googleIntegration: {
|
|
40
41
|
getEmails: 'api/v1/google-integration/get-emails',
|
|
@@ -53,4 +54,7 @@ exports.endpoints = {
|
|
|
53
54
|
statistics: {
|
|
54
55
|
getStatistic: 'api/v1/statistics/get-statistic'
|
|
55
56
|
},
|
|
57
|
+
email: {
|
|
58
|
+
sendEmail: 'api/v1/startum/send-email-with-default-domain'
|
|
59
|
+
}
|
|
56
60
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,9 @@ import { FilesService } from './services/FilesService';
|
|
|
5
5
|
import { CrudService } from './services/CrudService';
|
|
6
6
|
import { NotificationService } from './services/NotificationService';
|
|
7
7
|
import { StatisticService } from './services/StatisticService';
|
|
8
|
+
import { EmailService } from './services/EmailService';
|
|
8
9
|
export * from './common/interfaces';
|
|
10
|
+
export { EmailPayloadI } from './services/EmailService';
|
|
9
11
|
export declare class TotalumApiSdk {
|
|
10
12
|
private authOptions;
|
|
11
13
|
private _baseUrl;
|
|
@@ -16,6 +18,7 @@ export declare class TotalumApiSdk {
|
|
|
16
18
|
crud: CrudService;
|
|
17
19
|
notification: NotificationService;
|
|
18
20
|
statistic: StatisticService;
|
|
21
|
+
email: EmailService;
|
|
19
22
|
constructor(authOptions: AuthOptions);
|
|
20
23
|
changeBaseUrl(newBaseUrl: string): void;
|
|
21
24
|
private setRequestData;
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ const FilesService_1 = require("./services/FilesService");
|
|
|
21
21
|
const CrudService_1 = require("./services/CrudService");
|
|
22
22
|
const NotificationService_1 = require("./services/NotificationService");
|
|
23
23
|
const StatisticService_1 = require("./services/StatisticService");
|
|
24
|
+
const EmailService_1 = require("./services/EmailService");
|
|
24
25
|
__exportStar(require("./common/interfaces"), exports);
|
|
25
26
|
class TotalumApiSdk {
|
|
26
27
|
constructor(authOptions) {
|
|
@@ -61,6 +62,7 @@ class TotalumApiSdk {
|
|
|
61
62
|
this.filter = new FilterService_1.FilterService(this._baseUrl, this._headers);
|
|
62
63
|
this.notification = new NotificationService_1.NotificationService(this._baseUrl, this._headers);
|
|
63
64
|
this.statistic = new StatisticService_1.StatisticService(this._baseUrl, this._headers);
|
|
65
|
+
this.email = new EmailService_1.EmailService(this._baseUrl, this._headers);
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
exports.TotalumApiSdk = TotalumApiSdk;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface EmailPayloadI {
|
|
2
|
+
to: string[];
|
|
3
|
+
subject: string;
|
|
4
|
+
html: string;
|
|
5
|
+
fromName?: string;
|
|
6
|
+
cc?: string[];
|
|
7
|
+
bcc?: string[];
|
|
8
|
+
replyTo?: string;
|
|
9
|
+
attachments?: {
|
|
10
|
+
filename: string;
|
|
11
|
+
url: string;
|
|
12
|
+
contentType?: string;
|
|
13
|
+
}[];
|
|
14
|
+
}
|
|
15
|
+
export declare class EmailService {
|
|
16
|
+
private headers;
|
|
17
|
+
private baseUrl;
|
|
18
|
+
constructor(baseUrl: string, headers: any);
|
|
19
|
+
/**
|
|
20
|
+
* Sends an email with custom validation and attachment processing.
|
|
21
|
+
* All attachments must be provided as URLs.
|
|
22
|
+
* Maximum 10 attachments, each up to 15MB.
|
|
23
|
+
* @param {EmailPayloadI} emailPayload - The email configuration.
|
|
24
|
+
* @returns {Promise<any>} - A promise that resolves to the email send response.
|
|
25
|
+
*/
|
|
26
|
+
sendEmail(emailPayload: EmailPayloadI): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Sends an email using the Resend service with the default domain.
|
|
29
|
+
* @param {EmailPayloadI} emailPayload - The email configuration including recipients, subject, content, etc.
|
|
30
|
+
* @returns {Promise<any>} - A promise that resolves to the email send response.
|
|
31
|
+
*/
|
|
32
|
+
private sendEmailWithDefaultDomain;
|
|
33
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.EmailService = void 0;
|
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
const endpoints_1 = require("../common/endpoints");
|
|
18
|
+
const utils_1 = require("../utils");
|
|
19
|
+
class EmailService {
|
|
20
|
+
constructor(baseUrl, headers) {
|
|
21
|
+
this.headers = headers;
|
|
22
|
+
this.baseUrl = baseUrl;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Sends an email with custom validation and attachment processing.
|
|
26
|
+
* All attachments must be provided as URLs.
|
|
27
|
+
* Maximum 10 attachments, each up to 15MB.
|
|
28
|
+
* @param {EmailPayloadI} emailPayload - The email configuration.
|
|
29
|
+
* @returns {Promise<any>} - A promise that resolves to the email send response.
|
|
30
|
+
*/
|
|
31
|
+
sendEmail(emailPayload) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
// Validate attachments count
|
|
34
|
+
if (emailPayload.attachments && emailPayload.attachments.length > 10) {
|
|
35
|
+
throw new Error(`Maximum number of attachments is 10. Received ${emailPayload.attachments.length}.`);
|
|
36
|
+
}
|
|
37
|
+
// Validate attachment URLs
|
|
38
|
+
if (emailPayload.attachments) {
|
|
39
|
+
for (const attachment of emailPayload.attachments) {
|
|
40
|
+
if (!attachment.url || typeof attachment.url !== 'string') {
|
|
41
|
+
throw new Error(`Attachment ${attachment.filename} must have a valid URL`);
|
|
42
|
+
}
|
|
43
|
+
if (!attachment.url.startsWith('http://') && !attachment.url.startsWith('https://')) {
|
|
44
|
+
throw new Error(`Attachment ${attachment.filename} must have a valid HTTP/HTTPS URL`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return this.sendEmailWithDefaultDomain(emailPayload);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Sends an email using the Resend service with the default domain.
|
|
53
|
+
* @param {EmailPayloadI} emailPayload - The email configuration including recipients, subject, content, etc.
|
|
54
|
+
* @returns {Promise<any>} - A promise that resolves to the email send response.
|
|
55
|
+
*/
|
|
56
|
+
sendEmailWithDefaultDomain(emailPayload) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.email.sendEmail, {});
|
|
59
|
+
return axios_1.default.post(url, emailPayload, { headers: this.headers });
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.EmailService = EmailService;
|
|
@@ -26,6 +26,10 @@ export declare class FilesService {
|
|
|
26
26
|
generatePdfByTemplate(id: string, variables: {
|
|
27
27
|
[variableName: string]: any;
|
|
28
28
|
}, name: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
29
|
+
createPdfFromHtml(data: {
|
|
30
|
+
html: string;
|
|
31
|
+
name: string;
|
|
32
|
+
}): Promise<import("axios").AxiosResponse<any, any>>;
|
|
29
33
|
ocrOfImage(fileName: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
30
34
|
ocrOfPdf(fileName: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
31
35
|
scanInvoice(fileName: string, options?: any): Promise<import("axios").AxiosResponse<any, any>>;
|
|
@@ -61,6 +61,14 @@ class FilesService {
|
|
|
61
61
|
return axios_1.default.post(url, { templateId: id, variables, name }, { headers: this.headers });
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
+
createPdfFromHtml(data) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.pdfTemplate.createPdfFromHtml);
|
|
67
|
+
// Encode HTML to base64
|
|
68
|
+
const base64HtmlString = Buffer.from(data.html, 'utf-8').toString('base64');
|
|
69
|
+
return axios_1.default.post(url, { base64HtmlString, name: data.name }, { headers: this.headers });
|
|
70
|
+
});
|
|
71
|
+
}
|
|
64
72
|
ocrOfImage(fileName) {
|
|
65
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
66
74
|
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.files.ocrOfImage);
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FiltersArrayI, NestedQueryFilterI, StatisticOptionsI } from "../common/interfaces";
|
|
2
2
|
export declare class StatisticService {
|
|
3
3
|
private headers;
|
|
4
4
|
private baseUrl;
|
|
5
5
|
constructor(baseUrl: string, headers: any);
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param nestedQuery the nested query to filter by
|
|
9
|
-
* @param tableNameToGetResults the table that you want to get the results that match the nested query
|
|
10
|
-
* @param filterOptions extra options for the filter like the pagination and sort
|
|
11
|
-
* @returns
|
|
12
|
-
*/
|
|
13
|
-
nestedFilter(nestedQuery: NestedQueryFilterI, tableNameToGetResults: string, filterOptions?: filterNestedOptionsI): Promise<import("axios").AxiosResponse<any, any>>;
|
|
14
6
|
getStatistic(query: FiltersArrayI | NestedQueryFilterI, options: StatisticOptionsI): Promise<import("axios").AxiosResponse<any, any>>;
|
|
15
7
|
}
|
|
@@ -21,20 +21,6 @@ class StatisticService {
|
|
|
21
21
|
this.headers = headers;
|
|
22
22
|
this.baseUrl = baseUrl;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @param nestedQuery the nested query to filter by
|
|
27
|
-
* @param tableNameToGetResults the table that you want to get the results that match the nested query
|
|
28
|
-
* @param filterOptions extra options for the filter like the pagination and sort
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
nestedFilter(nestedQuery, tableNameToGetResults, filterOptions) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.filter.nestedFilter, {});
|
|
34
|
-
const body = { nestedFilter: nestedQuery, tableNameToGetResults: tableNameToGetResults, filterOptions: filterOptions };
|
|
35
|
-
return axios_1.default.post(url, body, { headers: this.headers });
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
24
|
getStatistic(query, options) {
|
|
39
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
26
|
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.statistics.getStatistic, {});
|
package/dist/totalum-sdk.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.totalumSdk=t():e.totalumSdk=t()}(this,(()=>(()=>{"use strict";var e={429:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.endpoints=void 0,t.endpoints={crud:{getObjectById:"api/v1/crud/:typeId/:id",getObjects:"api/v1/crud/query/:typeId",getNestedData:"api/v1/crud/nested",createObject:"api/v1/crud/:typeId",editObjectProperties:"api/v1/crud/:typeId/:id",deleteObject:"api/v1/crud/:typeId/:id",deleteObjectAndSubElements:"api/v1/crud/:typeId/:id/:pageId/subelements",updateLastUsersActions:"api/v1/crud/:typeId/:id/lastUsersActions",addManyToManyReference:"api/v1/crud/:typeId/:id/add-many-to-many-reference",dropManyToManyReference:"api/v1/crud/:typeId/:id/drop-many-to-many-reference",getManyToManyReferencesItems:"api/v1/crud/:typeId/:id/:propertyName"},updatesRecord:{getUpdateRecordByObjectId:"api/v1/updates-record/:objectId"},files:{uploadFile:"api/v1/files/upload",getDownloadUrl:"api/v1/files/download/:fileName",deleteFile:"api/v1/files/:fileName",ocrOfImage:"api/v1/files/ocr/image",ocrOfPdf:"api/v1/files/ocr/pdf",scanInvoice:"api/v1/files/scan-invoice",scanDocument:"api/v1/files/scan-document"},filter:{lookUpFilter:"api/v1/filter/:idPage",nestedFilter:"api/v1/filter/nested-filter",runCustomAggregationQuery:"api/v1/filter/custom-mongo-aggregation-query"},pdfTemplate:{generatePdfByTemplate:"api/v1/pdf-template/generatePdfByTemplate/:id"},googleIntegration:{getEmails:"api/v1/google-integration/get-emails",sendEmail:"api/v1/google-integration/send-email",getCalendarEvents:"api/v1/google-integration/get-calendar-events",createCalendarEvent:"api/v1/google-integration/create-calendar-event"},openai:{createCompletion:"api/v1/openai/completion",createChatCompletion:"api/v1/openai/chat-completion",generateImage:"api/v1/openai/image"},notifications:{createNotification:"api/v1/notifications"},statistics:{getStatistic:"api/v1/statistics/get-statistic"}}},999:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},492:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.TotalumApiSdk=void 0;const o=n(730),s=n(675),a=n(589),c=n(882),u=n(386),l=n(706);i(n(999),t),t.TotalumApiSdk=class{constructor(e){var t,n;if(this._baseUrl="https://api.totalum.app/",this.authOptions=e,null===(t=this.authOptions.token)||void 0===t?void 0:t.accessToken)this._headers={authorization:this.authOptions.token.accessToken};else{if(!(null===(n=this.authOptions.apiKey)||void 0===n?void 0:n["api-key"]))throw new Error("Error: invalid auth options");this._headers={"api-key":this.authOptions.apiKey["api-key"]}}this.authOptions.baseUrl&&(this._baseUrl=this.authOptions.baseUrl),this.authOptions.fromEvent&&(this._headers.fromEvent="true"),this.setRequestData()}changeBaseUrl(e){this._baseUrl=e,this.setRequestData()}setRequestData(){this.crud=new c.CrudService(this._baseUrl,this._headers),this.openai=new o.OpenaiService(this._baseUrl,this._headers),this.files=new a.FilesService(this._baseUrl,this._headers),this.filter=new s.FilterService(this._baseUrl,this._headers),this.notification=new u.NotificationService(this._baseUrl,this._headers),this.statistic=new l.StatisticService(this._baseUrl,this._headers)}}},882:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CrudService=void 0;const o=i(n(218)),s=n(591),a=n(429);t.CrudService=class{constructor(e,t){this.headers=t,this.baseUrl=e}getItemById(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.getObjectById,{typeId:e,id:t});return o.default.get(n,{headers:this.headers})}))}getHistoricRecordUpdatesById(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.updatesRecord.getUpdateRecordByObjectId,{objectId:e});return o.default.get(t,{headers:this.headers})}))}getItems(e,t){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.getObjects,{typeId:e});return o.default.post(n,t,{headers:this.headers})}getNestedData(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.getNestedData);return o.default.post(n,{nestedQuery:e,options:t},{headers:this.headers})}))}deleteItemById(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.deleteObject,{typeId:e,id:t});return o.default.delete(n,{headers:this.headers})}))}editItemById(e,t,n){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.editObjectProperties,{typeId:e,id:t});return o.default.patch(r,n,{headers:this.headers})}))}createItem(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.createObject,{typeId:e});return o.default.post(n,t,{headers:this.headers})}))}addManyToManyReferenceItem(e,t,n,i){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.addManyToManyReference,{typeId:e,id:t});return o.default.patch(r,{propertyId:n,referenceId:i},{headers:this.headers})}))}dropManyToManyReferenceItem(e,t,n,i){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.dropManyToManyReference,{typeId:e,id:t});return o.default.patch(r,{propertyId:n,referenceId:i},{headers:this.headers})}))}getManyToManyReferencesItems(e,t,n,i){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.getManyToManyReferencesItems,{typeId:e,id:t,propertyName:n});return o.default.get(r,{params:i,headers:this.headers})}))}}},589:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FilesService=void 0;const o=i(n(218)),s=n(591),a=n(429);t.FilesService=class{constructor(e,t){this.headers=t,this.baseUrl=e}uploadFile(e,t){return r(this,void 0,void 0,(function*(){let n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.uploadFile);return(null==t?void 0:t.compressFile)&&(n+="?compressFile=true"),o.default.post(n,e,{headers:this.headers})}))}deleteFile(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.deleteFile,{fileName:e});return o.default.delete(t,{headers:this.headers})}))}getDownloadUrl(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.getDownloadUrl,{fileName:e});return o.default.get(n,{headers:this.headers,params:t})}))}generatePdfByTemplate(e,t,n){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.pdfTemplate.generatePdfByTemplate,{id:e});return o.default.post(r,{templateId:e,variables:t,name:n},{headers:this.headers})}))}ocrOfImage(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.ocrOfImage);return o.default.post(t,{fileName:e},{headers:this.headers})}))}ocrOfPdf(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.ocrOfPdf);return o.default.post(t,{fileName:e},{headers:this.headers})}))}scanInvoice(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.scanInvoice);return o.default.post(n,{fileName:e,options:t},{headers:this.headers})}))}scanDocument(e,t,n){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.scanDocument);return o.default.post(r,{fileName:e,properties:t,options:n},{headers:this.headers})}))}}},675:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FilterService=void 0;const o=i(n(218)),s=n(429),a=n(591);t.FilterService=class{constructor(e,t){this.headers=t,this.baseUrl=e}lookUpFilter(e,t,n,i){return r(this,void 0,void 0,(function*(){const r=a.UtilsService.getUrl(this.baseUrl,s.endpoints.filter.lookUpFilter,{idPage:e}),c={query:encodeURIComponent(JSON.stringify(t)),idsOfMultipleNodesToSearch:encodeURIComponent(JSON.stringify(n)),returnCount:i};return o.default.get(r,{params:c,headers:this.headers})}))}nestedFilter(e,t,n){return r(this,void 0,void 0,(function*(){const r=a.UtilsService.getUrl(this.baseUrl,s.endpoints.filter.nestedFilter,{}),i={nestedFilter:e,tableNameToGetResults:t,filterOptions:n};return o.default.post(r,i,{headers:this.headers})}))}runCustomMongoAggregationQuery(e,t){return r(this,void 0,void 0,(function*(){const n=a.UtilsService.getUrl(this.baseUrl,s.endpoints.filter.runCustomAggregationQuery),r={customMongoQuery:t,type:e};return o.default.post(n,r,{headers:this.headers})}))}}},386:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationService=void 0;const o=i(n(218)),s=n(429),a=n(591);t.NotificationService=class{constructor(e,t){this.headers=t,this.baseUrl=e}createNotification(e){return r(this,void 0,void 0,(function*(){const t=a.UtilsService.getUrl(this.baseUrl,s.endpoints.notifications.createNotification,{});return o.default.post(t,{notification:e},{headers:this.headers})}))}}},730:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.OpenaiService=void 0;const o=i(n(218)),s=n(591),a=n(429);t.OpenaiService=class{constructor(e,t){this.headers=t,this.baseUrl=e}createCompletion(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.openai.createCompletion),n=e;return o.default.post(t,n,{headers:this.headers})}))}createChatCompletion(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.openai.createChatCompletion),n=e;return o.default.post(t,n,{headers:this.headers})}))}generateImage(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.openai.generateImage),n=e;return o.default.post(t,n,{headers:this.headers})}))}}},706:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.StatisticService=void 0;const o=i(n(218)),s=n(429),a=n(591);t.StatisticService=class{constructor(e,t){this.headers=t,this.baseUrl=e}nestedFilter(e,t,n){return r(this,void 0,void 0,(function*(){const r=a.UtilsService.getUrl(this.baseUrl,s.endpoints.filter.nestedFilter,{}),i={nestedFilter:e,tableNameToGetResults:t,filterOptions:n};return o.default.post(r,i,{headers:this.headers})}))}getStatistic(e,t){return r(this,void 0,void 0,(function*(){const n=a.UtilsService.getUrl(this.baseUrl,s.endpoints.statistics.getStatistic,{}),r={query:e,options:t};return o.default.post(n,r,{headers:this.headers})}))}}},591:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UtilsService=void 0,t.UtilsService=class{static getUrl(e,t,n){let r=e+t;for(const e in n)r=r.replace(`:${e}`,n[e]);return r}}},218:(e,t,n)=>{function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,s=(a=Object.create(null),e=>{const t=i.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>s(t)===e),u=e=>t=>typeof t===e,{isArray:l}=Array,d=u("undefined"),f=c("ArrayBuffer"),h=u("string"),p=u("function"),m=u("number"),y=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},v=c("Date"),b=c("File"),w=c("Blob"),O=c("FileList"),S=c("URLSearchParams");function U(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function E(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,R=e=>!d(e)&&e!==_,T=(j="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>j&&e instanceof j);var j;const A=c("HTMLFormElement"),N=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),P=c("RegExp"),x=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};U(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},C="abcdefghijklmnopqrstuvwxyz",F="0123456789",I={DIGIT:F,ALPHA:C,ALPHA_DIGIT:C+C.toUpperCase()+F},D=c("AsyncFunction");var B={isArray:l,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=s(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:h,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:g,isUndefined:d,isDate:v,isFile:b,isBlob:w,isRegExp:P,isFunction:p,isStream:e=>y(e)&&p(e.pipe),isURLSearchParams:S,isTypedArray:T,isFileList:O,forEach:U,merge:function e(){const{caseless:t}=R(this)&&this||{},n={},r=(r,i)=>{const o=t&&E(n,i)||i;g(n[o])&&g(r)?n[o]=e(n[o],r):g(r)?n[o]=e({},r):l(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&U(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:i}={})=>(U(t,((t,i)=>{n&&p(t)?e[i]=r(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,s,a;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)a=i[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:c,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:A,hasOwnProperty:N,hasOwnProp:N,reduceDescriptors:x,freezeMethods:e=>{x(e,((t,n)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];p(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:E,global:_,isContextDefined:R,ALPHABET:I,generateString:(e=16,t=I.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=l(e)?[]:{};return U(e,((e,t)=>{const o=n(e,r+1);!d(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:D,isThenable:e=>e&&(y(e)||p(e))&&p(e.then)&&p(e.catch)};function M(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}B.inherits(M,Error,{toJSON:function(){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:B.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const L=M.prototype,k={};function q(e){return B.isPlainObject(e)||B.isArray(e)}function z(e){return B.endsWith(e,"[]")?e.slice(0,-2):e}function H(e,t,n){return e?e.concat(t).map((function(e,t){return e=z(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["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((e=>{k[e]={value:e}})),Object.defineProperties(M,k),Object.defineProperty(L,"isAxiosError",{value:!0}),M.from=(e,t,n,r,i,o)=>{const s=Object.create(L);return B.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),M.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const J=B.toFlatObject(B,{},null,(function(e){return/^is[A-Z]/.test(e)}));function K(e,t,n){if(!B.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!B.isUndefined(t[e])}))).metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&B.isSpecCompliantForm(t);if(!B.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(B.isDate(e))return e.toISOString();if(!a&&B.isBlob(e))throw new M("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(e)||B.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(B.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(B.isArray(e)&&function(e){return B.isArray(e)&&!e.some(q)}(e)||(B.isFileList(e)||B.endsWith(n,"[]"))&&(a=B.toArray(e)))return n=z(n),a.forEach((function(e,r){!B.isUndefined(e)&&null!==e&&t.append(!0===s?H([n],r,o):null===s?n:n+"[]",c(e))})),!1;return!!q(e)||(t.append(H(i,n,o),c(e)),!1)}const l=[],d=Object.assign(J,{defaultVisitor:u,convertValue:c,isVisitable:q});if(!B.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!B.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),B.forEach(n,(function(n,o){!0===(!(B.isUndefined(n)||null===n)&&i.call(t,n,B.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o])})),l.pop()}}(e),t}function W(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function V(e,t){this._pairs=[],e&&K(e,this,t)}const G=V.prototype;function $(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(e,t,n){if(!t)return e;const r=n&&n.encode||$,i=n&&n.serialize;let o;if(o=i?i(t,n):B.isURLSearchParams(t)?t.toString():new V(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}G.append=function(e,t){this._pairs.push([e,t])},G.toString=function(e){const t=e?function(t){return e.call(this,t,W)}:W;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var X=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){B.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Y={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:V,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,n,r,i){let o=e[i++];const s=Number.isFinite(+o),a=i>=e.length;return o=!o&&B.isArray(r)?r.length:o,a?(B.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s):(r[o]&&B.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&B.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s)}if(B.isFormData(e)&&B.isFunction(e.entries)){const n={};return B.forEachEntry(e,((e,r)=>{t(function(e){return B.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const te={"Content-Type":void 0},ne={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=B.isObject(e);if(i&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return r&&r?JSON.stringify(ee(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return K(e,new Y.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Y.isNode&&B.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=B.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return K(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(B.isString(e))try{return(0,JSON.parse)(e),B.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ne.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&B.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw M.from(e,M.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Y.classes.FormData,Blob:Y.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};B.forEach(["delete","get","head"],(function(e){ne.headers[e]={}})),B.forEach(["post","put","patch"],(function(e){ne.headers[e]=B.merge(te)}));var re=ne;const ie=B.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"]),oe=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:B.isArray(e)?e.map(ae):String(e)}function ce(e,t,n,r,i){return B.isFunction(r)?r.call(this,t,n):(i&&(t=n),B.isString(t)?B.isString(r)?-1!==t.indexOf(r):B.isRegExp(r)?r.test(t):void 0:void 0)}class ue{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=se(t);if(!i)throw new Error("header name must be a non-empty string");const o=B.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=ae(e))}const o=(e,t)=>B.forEach(e,((e,n)=>i(e,n,t)));return B.isPlainObject(e)||e instanceof this.constructor?o(e,t):B.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ie[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=se(e)){const n=B.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(B.isFunction(t))return t.call(this,e,n);if(B.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=B.findKey(this,e);return!(!n||void 0===this[n]||t&&!ce(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=se(e)){const i=B.findKey(n,e);!i||t&&!ce(0,n[i],i,t)||(delete n[i],r=!0)}}return B.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!ce(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return B.forEach(this,((r,i)=>{const o=B.findKey(n,i);if(o)return t[o]=ae(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();s!==i&&delete t[i],t[s]=ae(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return B.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&B.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(function(e,t){const n=B.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return B.isArray(e)?e.forEach(r):r(e),this}}ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),B.freezeMethods(ue.prototype),B.freezeMethods(ue);var le=ue;function de(e,t){const n=this||re,r=t||n,i=le.from(r.headers);let o=r.data;return B.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function fe(e){return!(!e||!e.__CANCEL__)}function he(e,t,n){M.call(this,null==e?"canceled":e,M.ERR_CANCELED,t,n),this.name="CanceledError"}B.inherits(he,M,{__CANCEL__:!0});var pe=Y.isStandardBrowserEnv?{write:function(e,t,n,r,i,o){const s=[];s.push(e+"="+encodeURIComponent(t)),B.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),B.isString(r)&&s.push("path="+r),B.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const 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 me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ye=Y.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=B.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ge(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];i||(i=c),n[o]=a,r[o]=c;let l=s,d=0;for(;l!==o;)d+=n[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,c=r(a);n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const ve={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=le.from(e.headers).normalize(),o=e.responseType;let s;function a(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}B.isFormData(r)&&(Y.isStandardBrowserEnv||Y.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const u=me(e.baseURL,e.url);function l(){if(!c)return;const r=le.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new M("Request failed with status code "+n.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Q(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(n(new M("Request aborted",M.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new M("Network Error",M.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new M(t,r.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,e,c)),c=null},Y.isStandardBrowserEnv){const t=(e.withCredentials||ye(u))&&e.xsrfCookieName&&pe.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&B.forEach(i.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),B.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ge(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ge(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{c&&(n(!t||t.type?new he(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===Y.protocols.indexOf(d)?n(new M("Unsupported protocol "+d+":",M.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};B.forEach(ve,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function be(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he(null,e)}function we(e){return be(e),e.headers=le.from(e.headers),e.data=de.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=B.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=B.isString(n)?ve[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new M(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(B.hasOwnProp(ve,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!B.isFunction(r))throw new TypeError("adapter is not a function");return r})(e.adapter||re.adapter)(e).then((function(t){return be(e),t.data=de.call(e,e.transformResponse,t),t.headers=le.from(t.headers),t}),(function(t){return fe(t)||(be(e),t&&t.response&&(t.response.data=de.call(e,e.transformResponse,t.response),t.response.headers=le.from(t.response.headers))),Promise.reject(t)}))}const Oe=e=>e instanceof le?e.toJSON():e;function Se(e,t){t=t||{};const n={};function r(e,t,n){return B.isPlainObject(e)&&B.isPlainObject(t)?B.merge.call({caseless:n},e,t):B.isPlainObject(t)?B.merge({},t):B.isArray(t)?t.slice():t}function i(e,t,n){return B.isUndefined(t)?B.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function o(e,t){if(!B.isUndefined(t))return r(void 0,t)}function s(e,t){return B.isUndefined(t)?B.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials: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:(e,t)=>i(Oe(e),Oe(t),!0)};return B.forEach(Object.keys(Object.assign({},e,t)),(function(r){const o=c[r]||i,s=o(e[r],t[r],r);B.isUndefined(s)&&o!==a||(n[r]=s)})),n}const Ue={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ue[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ee={};Ue.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new M(r(i," has been removed"+(t?" in "+t:"")),M.ERR_DEPRECATED);return t&&!Ee[i]&&(Ee[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};var _e={assertOptions:function(e,t,n){if("object"!=typeof e)throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new M("option "+o+" must be "+n,M.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new M("Unknown option "+o,M.ERR_BAD_OPTION)}},validators:Ue};const Re=_e.validators;class Te{constructor(e){this.defaults=e,this.interceptors={request:new X,response:new X}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Se(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let o;void 0!==n&&_e.assertOptions(n,{silentJSONParsing:Re.transitional(Re.boolean),forcedJSONParsing:Re.transitional(Re.boolean),clarifyTimeoutError:Re.transitional(Re.boolean)},!1),null!=r&&(B.isFunction(r)?t.paramsSerializer={serialize:r}:_e.assertOptions(r,{encode:Re.function,serialize:Re.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),o=i&&B.merge(i.common,i[t.method]),o&&B.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=le.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[we.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=s.length;let f=t;for(d=0;d<l;){const e=s[d++],t=s[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=we.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return Q(me((e=Se(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}B.forEach(["delete","get","head","options"],(function(e){Te.prototype[e]=function(t,n){return this.request(Se(n||{},{method:e,url:t,data:(n||{}).data}))}})),B.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Se(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Te.prototype[e]=t(),Te.prototype[e+"Form"]=t(!0)}));var je=Te;class Ae{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new he(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ae((function(t){e=t})),cancel:e}}}var Ne=Ae;const Pe={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(Pe).forEach((([e,t])=>{Pe[t]=e}));var xe=Pe;const Ce=function e(t){const n=new je(t),i=r(je.prototype.request,n);return B.extend(i,je.prototype,n,{allOwnKeys:!0}),B.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(Se(t,n))},i}(re);Ce.Axios=je,Ce.CanceledError=he,Ce.CancelToken=Ne,Ce.isCancel=fe,Ce.VERSION="1.4.0",Ce.toFormData=K,Ce.AxiosError=M,Ce.Cancel=Ce.CanceledError,Ce.all=function(e){return Promise.all(e)},Ce.spread=function(e){return function(t){return e.apply(null,t)}},Ce.isAxiosError=function(e){return B.isObject(e)&&!0===e.isAxiosError},Ce.mergeConfig=Se,Ce.AxiosHeaders=le,Ce.formToJSON=e=>ee(B.isHTMLForm(e)?new FormData(e):e),Ce.HttpStatusCode=xe,Ce.default=Ce,e.exports=Ce}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(492)})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.totalumSdk=t():e.totalumSdk=t()}(this,(()=>(()=>{"use strict";var e={429:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.endpoints=void 0,t.endpoints={crud:{getObjectById:"api/v1/crud/:typeId/:id",getObjects:"api/v1/crud/query/:typeId",getNestedData:"api/v1/crud/nested",createObject:"api/v1/crud/:typeId",editObjectProperties:"api/v1/crud/:typeId/:id",deleteObject:"api/v1/crud/:typeId/:id",deleteObjectAndSubElements:"api/v1/crud/:typeId/:id/:pageId/subelements",updateLastUsersActions:"api/v1/crud/:typeId/:id/lastUsersActions",addManyToManyReference:"api/v1/crud/:typeId/:id/add-many-to-many-reference",dropManyToManyReference:"api/v1/crud/:typeId/:id/drop-many-to-many-reference",getManyToManyReferencesItems:"api/v1/crud/:typeId/:id/:propertyName"},updatesRecord:{getUpdateRecordByObjectId:"api/v1/updates-record/:objectId"},files:{uploadFile:"api/v1/files/upload",getDownloadUrl:"api/v1/files/download/:fileName",deleteFile:"api/v1/files/:fileName",ocrOfImage:"api/v1/files/ocr/image",ocrOfPdf:"api/v1/files/ocr/pdf",scanInvoice:"api/v1/files/scan-invoice",scanDocument:"api/v1/files/scan-document"},filter:{lookUpFilter:"api/v1/filter/:idPage",nestedFilter:"api/v1/filter/nested-filter",runCustomAggregationQuery:"api/v1/filter/custom-mongo-aggregation-query"},pdfTemplate:{generatePdfByTemplate:"api/v1/pdf-template/generatePdfByTemplate/:id",createPdfFromHtml:"api/v1/pdf-template/createPdfFromHtml"},googleIntegration:{getEmails:"api/v1/google-integration/get-emails",sendEmail:"api/v1/google-integration/send-email",getCalendarEvents:"api/v1/google-integration/get-calendar-events",createCalendarEvent:"api/v1/google-integration/create-calendar-event"},openai:{createCompletion:"api/v1/openai/completion",createChatCompletion:"api/v1/openai/chat-completion",generateImage:"api/v1/openai/image"},notifications:{createNotification:"api/v1/notifications"},statistics:{getStatistic:"api/v1/statistics/get-statistic"},email:{sendEmail:"api/v1/startum/send-email-with-default-domain"}}},999:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},492:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.TotalumApiSdk=void 0;const o=n(730),s=n(675),a=n(589),c=n(882),u=n(386),l=n(706),d=n(279);i(n(999),t),t.TotalumApiSdk=class{constructor(e){var t,n;if(this._baseUrl="https://api.totalum.app/",this.authOptions=e,null===(t=this.authOptions.token)||void 0===t?void 0:t.accessToken)this._headers={authorization:this.authOptions.token.accessToken};else{if(!(null===(n=this.authOptions.apiKey)||void 0===n?void 0:n["api-key"]))throw new Error("Error: invalid auth options");this._headers={"api-key":this.authOptions.apiKey["api-key"]}}this.authOptions.baseUrl&&(this._baseUrl=this.authOptions.baseUrl),this.authOptions.fromEvent&&(this._headers.fromEvent="true"),this.setRequestData()}changeBaseUrl(e){this._baseUrl=e,this.setRequestData()}setRequestData(){this.crud=new c.CrudService(this._baseUrl,this._headers),this.openai=new o.OpenaiService(this._baseUrl,this._headers),this.files=new a.FilesService(this._baseUrl,this._headers),this.filter=new s.FilterService(this._baseUrl,this._headers),this.notification=new u.NotificationService(this._baseUrl,this._headers),this.statistic=new l.StatisticService(this._baseUrl,this._headers),this.email=new d.EmailService(this._baseUrl,this._headers)}}},882:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CrudService=void 0;const o=i(n(218)),s=n(591),a=n(429);t.CrudService=class{constructor(e,t){this.headers=t,this.baseUrl=e}getItemById(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.getObjectById,{typeId:e,id:t});return o.default.get(n,{headers:this.headers})}))}getHistoricRecordUpdatesById(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.updatesRecord.getUpdateRecordByObjectId,{objectId:e});return o.default.get(t,{headers:this.headers})}))}getItems(e,t){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.getObjects,{typeId:e});return o.default.post(n,t,{headers:this.headers})}getNestedData(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.getNestedData);return o.default.post(n,{nestedQuery:e,options:t},{headers:this.headers})}))}deleteItemById(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.deleteObject,{typeId:e,id:t});return o.default.delete(n,{headers:this.headers})}))}editItemById(e,t,n){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.editObjectProperties,{typeId:e,id:t});return o.default.patch(r,n,{headers:this.headers})}))}createItem(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.createObject,{typeId:e});return o.default.post(n,t,{headers:this.headers})}))}addManyToManyReferenceItem(e,t,n,i){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.addManyToManyReference,{typeId:e,id:t});return o.default.patch(r,{propertyId:n,referenceId:i},{headers:this.headers})}))}dropManyToManyReferenceItem(e,t,n,i){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.dropManyToManyReference,{typeId:e,id:t});return o.default.patch(r,{propertyId:n,referenceId:i},{headers:this.headers})}))}getManyToManyReferencesItems(e,t,n,i){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.crud.getManyToManyReferencesItems,{typeId:e,id:t,propertyName:n});return o.default.get(r,{params:i,headers:this.headers})}))}}},279:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.EmailService=void 0;const o=i(n(218)),s=n(429),a=n(591);t.EmailService=class{constructor(e,t){this.headers=t,this.baseUrl=e}sendEmail(e){return r(this,void 0,void 0,(function*(){if(e.attachments&&e.attachments.length>10)throw new Error(`Maximum number of attachments is 10. Received ${e.attachments.length}.`);if(e.attachments)for(const t of e.attachments){if(!t.url||"string"!=typeof t.url)throw new Error(`Attachment ${t.filename} must have a valid URL`);if(!t.url.startsWith("http://")&&!t.url.startsWith("https://"))throw new Error(`Attachment ${t.filename} must have a valid HTTP/HTTPS URL`)}return this.sendEmailWithDefaultDomain(e)}))}sendEmailWithDefaultDomain(e){return r(this,void 0,void 0,(function*(){const t=a.UtilsService.getUrl(this.baseUrl,s.endpoints.email.sendEmail,{});return o.default.post(t,e,{headers:this.headers})}))}}},589:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FilesService=void 0;const o=i(n(218)),s=n(591),a=n(429);t.FilesService=class{constructor(e,t){this.headers=t,this.baseUrl=e}uploadFile(e,t){return r(this,void 0,void 0,(function*(){let n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.uploadFile);return(null==t?void 0:t.compressFile)&&(n+="?compressFile=true"),o.default.post(n,e,{headers:this.headers})}))}deleteFile(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.deleteFile,{fileName:e});return o.default.delete(t,{headers:this.headers})}))}getDownloadUrl(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.getDownloadUrl,{fileName:e});return o.default.get(n,{headers:this.headers,params:t})}))}generatePdfByTemplate(e,t,n){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.pdfTemplate.generatePdfByTemplate,{id:e});return o.default.post(r,{templateId:e,variables:t,name:n},{headers:this.headers})}))}createPdfFromHtml(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.pdfTemplate.createPdfFromHtml),n=Buffer.from(e.html,"utf-8").toString("base64");return o.default.post(t,{base64HtmlString:n,name:e.name},{headers:this.headers})}))}ocrOfImage(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.ocrOfImage);return o.default.post(t,{fileName:e},{headers:this.headers})}))}ocrOfPdf(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.ocrOfPdf);return o.default.post(t,{fileName:e},{headers:this.headers})}))}scanInvoice(e,t){return r(this,void 0,void 0,(function*(){const n=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.scanInvoice);return o.default.post(n,{fileName:e,options:t},{headers:this.headers})}))}scanDocument(e,t,n){return r(this,void 0,void 0,(function*(){const r=s.UtilsService.getUrl(this.baseUrl,a.endpoints.files.scanDocument);return o.default.post(r,{fileName:e,properties:t,options:n},{headers:this.headers})}))}}},675:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FilterService=void 0;const o=i(n(218)),s=n(429),a=n(591);t.FilterService=class{constructor(e,t){this.headers=t,this.baseUrl=e}lookUpFilter(e,t,n,i){return r(this,void 0,void 0,(function*(){const r=a.UtilsService.getUrl(this.baseUrl,s.endpoints.filter.lookUpFilter,{idPage:e}),c={query:encodeURIComponent(JSON.stringify(t)),idsOfMultipleNodesToSearch:encodeURIComponent(JSON.stringify(n)),returnCount:i};return o.default.get(r,{params:c,headers:this.headers})}))}nestedFilter(e,t,n){return r(this,void 0,void 0,(function*(){const r=a.UtilsService.getUrl(this.baseUrl,s.endpoints.filter.nestedFilter,{}),i={nestedFilter:e,tableNameToGetResults:t,filterOptions:n};return o.default.post(r,i,{headers:this.headers})}))}runCustomMongoAggregationQuery(e,t){return r(this,void 0,void 0,(function*(){const n=a.UtilsService.getUrl(this.baseUrl,s.endpoints.filter.runCustomAggregationQuery),r={customMongoQuery:t,type:e};return o.default.post(n,r,{headers:this.headers})}))}}},386:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationService=void 0;const o=i(n(218)),s=n(429),a=n(591);t.NotificationService=class{constructor(e,t){this.headers=t,this.baseUrl=e}createNotification(e){return r(this,void 0,void 0,(function*(){const t=a.UtilsService.getUrl(this.baseUrl,s.endpoints.notifications.createNotification,{});return o.default.post(t,{notification:e},{headers:this.headers})}))}}},730:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.OpenaiService=void 0;const o=i(n(218)),s=n(591),a=n(429);t.OpenaiService=class{constructor(e,t){this.headers=t,this.baseUrl=e}createCompletion(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.openai.createCompletion),n=e;return o.default.post(t,n,{headers:this.headers})}))}createChatCompletion(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.openai.createChatCompletion),n=e;return o.default.post(t,n,{headers:this.headers})}))}generateImage(e){return r(this,void 0,void 0,(function*(){const t=s.UtilsService.getUrl(this.baseUrl,a.endpoints.openai.generateImage),n=e;return o.default.post(t,n,{headers:this.headers})}))}}},706:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.StatisticService=void 0;const o=i(n(218)),s=n(429),a=n(591);t.StatisticService=class{constructor(e,t){this.headers=t,this.baseUrl=e}getStatistic(e,t){return r(this,void 0,void 0,(function*(){const n=a.UtilsService.getUrl(this.baseUrl,s.endpoints.statistics.getStatistic,{}),r={query:e,options:t};return o.default.post(n,r,{headers:this.headers})}))}}},591:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UtilsService=void 0,t.UtilsService=class{static getUrl(e,t,n){let r=e+t;for(const e in n)r=r.replace(`:${e}`,n[e]);return r}}},218:(e,t,n)=>{function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:i}=Object.prototype,{getPrototypeOf:o}=Object,s=(a=Object.create(null),e=>{const t=i.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())});var a;const c=e=>(e=e.toLowerCase(),t=>s(t)===e),u=e=>t=>typeof t===e,{isArray:l}=Array,d=u("undefined"),f=c("ArrayBuffer"),h=u("string"),p=u("function"),m=u("number"),v=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==s(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},g=c("Date"),b=c("File"),w=c("Blob"),O=c("FileList"),S=c("URLSearchParams");function U(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),l(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let s;for(r=0;r<o;r++)s=i[r],t.call(null,e[s],s,e)}}function E(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,R=e=>!d(e)&&e!==_,T=(A="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>A&&e instanceof A);var A;const j=c("HTMLFormElement"),P=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),N=c("RegExp"),x=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};U(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},C="abcdefghijklmnopqrstuvwxyz",F="0123456789",I={DIGIT:F,ALPHA:C,ALPHA_DIGIT:C+C.toUpperCase()+F},D=c("AsyncFunction");var B={isArray:l,isArrayBuffer:f,isBuffer:function(e){return null!==e&&!d(e)&&null!==e.constructor&&!d(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=s(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&f(e.buffer),t},isString:h,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:y,isUndefined:d,isDate:g,isFile:b,isBlob:w,isRegExp:N,isFunction:p,isStream:e=>v(e)&&p(e.pipe),isURLSearchParams:S,isTypedArray:T,isFileList:O,forEach:U,merge:function e(){const{caseless:t}=R(this)&&this||{},n={},r=(r,i)=>{const o=t&&E(n,i)||i;y(n[o])&&y(r)?n[o]=e(n[o],r):y(r)?n[o]=e({},r):l(r)?n[o]=r.slice():n[o]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&U(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:i}={})=>(U(t,((t,i)=>{n&&p(t)?e[i]=r(t,n):e[i]=t}),{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,s,a;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)a=i[s],r&&!r(a,e,t)||c[a]||(t[a]=e[a],c[a]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:c,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(l(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:j,hasOwnProperty:P,hasOwnProp:P,reduceDescriptors:x,freezeMethods:e=>{x(e,((t,n)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];p(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return l(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:E,global:_,isContextDefined:R,ALPHABET:I,generateString:(e=16,t=I.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=l(e)?[]:{};return U(e,((e,t)=>{const o=n(e,r+1);!d(o)&&(i[t]=o)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:D,isThenable:e=>e&&(v(e)||p(e))&&p(e.then)&&p(e.catch)};function M(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}B.inherits(M,Error,{toJSON:function(){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:B.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const L=M.prototype,k={};function q(e){return B.isPlainObject(e)||B.isArray(e)}function H(e){return B.endsWith(e,"[]")?e.slice(0,-2):e}function z(e,t,n){return e?e.concat(t).map((function(e,t){return e=H(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["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((e=>{k[e]={value:e}})),Object.defineProperties(M,k),Object.defineProperty(L,"isAxiosError",{value:!0}),M.from=(e,t,n,r,i,o)=>{const s=Object.create(L);return B.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),M.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const J=B.toFlatObject(B,{},null,(function(e){return/^is[A-Z]/.test(e)}));function W(e,t,n){if(!B.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=B.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!B.isUndefined(t[e])}))).metaTokens,i=n.visitor||u,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&B.isSpecCompliantForm(t);if(!B.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(B.isDate(e))return e.toISOString();if(!a&&B.isBlob(e))throw new M("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(e)||B.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(B.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(B.isArray(e)&&function(e){return B.isArray(e)&&!e.some(q)}(e)||(B.isFileList(e)||B.endsWith(n,"[]"))&&(a=B.toArray(e)))return n=H(n),a.forEach((function(e,r){!B.isUndefined(e)&&null!==e&&t.append(!0===s?z([n],r,o):null===s?n:n+"[]",c(e))})),!1;return!!q(e)||(t.append(z(i,n,o),c(e)),!1)}const l=[],d=Object.assign(J,{defaultVisitor:u,convertValue:c,isVisitable:q});if(!B.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!B.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),B.forEach(n,(function(n,o){!0===(!(B.isUndefined(n)||null===n)&&i.call(t,n,B.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o])})),l.pop()}}(e),t}function K(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function V(e,t){this._pairs=[],e&&W(e,this,t)}const $=V.prototype;function G(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Q(e,t,n){if(!t)return e;const r=n&&n.encode||G,i=n&&n.serialize;let o;if(o=i?i(t,n):B.isURLSearchParams(t)?t.toString():new V(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}$.append=function(e,t){this._pairs.push([e,t])},$.toString=function(e){const t=e?function(t){return e.call(this,t,K)}:K;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var X=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){B.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Y={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:V,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&"undefined"!=typeof window&&"undefined"!=typeof document})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function ee(e){function t(e,n,r,i){let o=e[i++];const s=Number.isFinite(+o),a=i>=e.length;return o=!o&&B.isArray(r)?r.length:o,a?(B.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s):(r[o]&&B.isObject(r[o])||(r[o]=[]),t(e,n,r[o],i)&&B.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r<i;r++)o=n[r],t[o]=e[o];return t}(r[o])),!s)}if(B.isFormData(e)&&B.isFunction(e.entries)){const n={};return B.forEachEntry(e,((e,r)=>{t(function(e){return B.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const te={"Content-Type":void 0},ne={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=B.isObject(e);if(i&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return r&&r?JSON.stringify(ee(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return W(e,new Y.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return Y.isNode&&B.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=B.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return W(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(B.isString(e))try{return(0,JSON.parse)(e),B.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ne.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&B.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw M.from(e,M.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Y.classes.FormData,Blob:Y.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};B.forEach(["delete","get","head"],(function(e){ne.headers[e]={}})),B.forEach(["post","put","patch"],(function(e){ne.headers[e]=B.merge(te)}));var re=ne;const ie=B.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"]),oe=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ae(e){return!1===e||null==e?e:B.isArray(e)?e.map(ae):String(e)}function ce(e,t,n,r,i){return B.isFunction(r)?r.call(this,t,n):(i&&(t=n),B.isString(t)?B.isString(r)?-1!==t.indexOf(r):B.isRegExp(r)?r.test(t):void 0:void 0)}class ue{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=se(t);if(!i)throw new Error("header name must be a non-empty string");const o=B.findKey(r,i);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=ae(e))}const o=(e,t)=>B.forEach(e,((e,n)=>i(e,n,t)));return B.isPlainObject(e)||e instanceof this.constructor?o(e,t):B.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?o((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ie[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=se(e)){const n=B.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(B.isFunction(t))return t.call(this,e,n);if(B.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=B.findKey(this,e);return!(!n||void 0===this[n]||t&&!ce(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=se(e)){const i=B.findKey(n,e);!i||t&&!ce(0,n[i],i,t)||(delete n[i],r=!0)}}return B.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!ce(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return B.forEach(this,((r,i)=>{const o=B.findKey(n,i);if(o)return t[o]=ae(r),void delete t[i];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();s!==i&&delete t[i],t[s]=ae(r),n[s]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return B.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&B.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(function(e,t){const n=B.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return B.isArray(e)?e.forEach(r):r(e),this}}ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),B.freezeMethods(ue.prototype),B.freezeMethods(ue);var le=ue;function de(e,t){const n=this||re,r=t||n,i=le.from(r.headers);let o=r.data;return B.forEach(e,(function(e){o=e.call(n,o,i.normalize(),t?t.status:void 0)})),i.normalize(),o}function fe(e){return!(!e||!e.__CANCEL__)}function he(e,t,n){M.call(this,null==e?"canceled":e,M.ERR_CANCELED,t,n),this.name="CanceledError"}B.inherits(he,M,{__CANCEL__:!0});var pe=Y.isStandardBrowserEnv?{write:function(e,t,n,r,i,o){const s=[];s.push(e+"="+encodeURIComponent(t)),B.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),B.isString(r)&&s.push("path="+r),B.isString(i)&&s.push("domain="+i),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){const 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 me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ve=Y.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=B.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ye(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[s];i||(i=c),n[o]=a,r[o]=c;let l=s,d=0;for(;l!==o;)d+=n[l++],l%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i<t)return;const f=u&&c-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return i=>{const o=i.loaded,s=i.lengthComputable?i.total:void 0,a=o-n,c=r(a);n=o;const u={loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const ge={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=le.from(e.headers).normalize(),o=e.responseType;let s;function a(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}B.isFormData(r)&&(Y.isStandardBrowserEnv||Y.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const u=me(e.baseURL,e.url);function l(){if(!c)return;const r=le.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new M("Request failed with status code "+n.status,[M.ERR_BAD_REQUEST,M.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),a()}),(function(e){n(e),a()}),{data:o&&"text"!==o&&"json"!==o?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Q(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(n(new M("Request aborted",M.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new M("Network Error",M.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new M(t,r.clarifyTimeoutError?M.ETIMEDOUT:M.ECONNABORTED,e,c)),c=null},Y.isStandardBrowserEnv){const t=(e.withCredentials||ve(u))&&e.xsrfCookieName&&pe.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&B.forEach(i.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),B.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&"json"!==o&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ye(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ye(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{c&&(n(!t||t.type?new he(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===Y.protocols.indexOf(d)?n(new M("Unsupported protocol "+d+":",M.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};B.forEach(ge,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));function be(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he(null,e)}function we(e){return be(e),e.headers=le.from(e.headers),e.data=de.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),(e=>{e=B.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=B.isString(n)?ge[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new M(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(B.hasOwnProp(ge,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!B.isFunction(r))throw new TypeError("adapter is not a function");return r})(e.adapter||re.adapter)(e).then((function(t){return be(e),t.data=de.call(e,e.transformResponse,t),t.headers=le.from(t.headers),t}),(function(t){return fe(t)||(be(e),t&&t.response&&(t.response.data=de.call(e,e.transformResponse,t.response),t.response.headers=le.from(t.response.headers))),Promise.reject(t)}))}const Oe=e=>e instanceof le?e.toJSON():e;function Se(e,t){t=t||{};const n={};function r(e,t,n){return B.isPlainObject(e)&&B.isPlainObject(t)?B.merge.call({caseless:n},e,t):B.isPlainObject(t)?B.merge({},t):B.isArray(t)?t.slice():t}function i(e,t,n){return B.isUndefined(t)?B.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function o(e,t){if(!B.isUndefined(t))return r(void 0,t)}function s(e,t){return B.isUndefined(t)?B.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,o){return o in t?r(n,i):o in e?r(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials: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:(e,t)=>i(Oe(e),Oe(t),!0)};return B.forEach(Object.keys(Object.assign({},e,t)),(function(r){const o=c[r]||i,s=o(e[r],t[r],r);B.isUndefined(s)&&o!==a||(n[r]=s)})),n}const Ue={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Ue[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ee={};Ue.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,o)=>{if(!1===e)throw new M(r(i," has been removed"+(t?" in "+t:"")),M.ERR_DEPRECATED);return t&&!Ee[i]&&(Ee[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,o)}};var _e={assertOptions:function(e,t,n){if("object"!=typeof e)throw new M("options must be an object",M.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new M("option "+o+" must be "+n,M.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new M("Unknown option "+o,M.ERR_BAD_OPTION)}},validators:Ue};const Re=_e.validators;class Te{constructor(e){this.defaults=e,this.interceptors={request:new X,response:new X}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Se(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let o;void 0!==n&&_e.assertOptions(n,{silentJSONParsing:Re.transitional(Re.boolean),forcedJSONParsing:Re.transitional(Re.boolean),clarifyTimeoutError:Re.transitional(Re.boolean)},!1),null!=r&&(B.isFunction(r)?t.paramsSerializer={serialize:r}:_e.assertOptions(r,{encode:Re.function,serialize:Re.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),o=i&&B.merge(i.common,i[t.method]),o&&B.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=le.concat(o,i);const s=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,d=0;if(!a){const e=[we.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);d<l;)u=u.then(e[d++],e[d++]);return u}l=s.length;let f=t;for(d=0;d<l;){const e=s[d++],t=s[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=we.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,l=c.length;d<l;)u=u.then(c[d++],c[d++]);return u}getUri(e){return Q(me((e=Se(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}B.forEach(["delete","get","head","options"],(function(e){Te.prototype[e]=function(t,n){return this.request(Se(n||{},{method:e,url:t,data:(n||{}).data}))}})),B.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Se(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Te.prototype[e]=t(),Te.prototype[e+"Form"]=t(!0)}));var Ae=Te;class je{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new he(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new je((function(t){e=t})),cancel:e}}}var Pe=je;const Ne={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(Ne).forEach((([e,t])=>{Ne[t]=e}));var xe=Ne;const Ce=function e(t){const n=new Ae(t),i=r(Ae.prototype.request,n);return B.extend(i,Ae.prototype,n,{allOwnKeys:!0}),B.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(Se(t,n))},i}(re);Ce.Axios=Ae,Ce.CanceledError=he,Ce.CancelToken=Pe,Ce.isCancel=fe,Ce.VERSION="1.4.0",Ce.toFormData=W,Ce.AxiosError=M,Ce.Cancel=Ce.CanceledError,Ce.all=function(e){return Promise.all(e)},Ce.spread=function(e){return function(t){return e.apply(null,t)}},Ce.isAxiosError=function(e){return B.isObject(e)&&!0===e.isAxiosError},Ce.mergeConfig=Se,Ce.AxiosHeaders=le,Ce.formToJSON=e=>ee(B.isHTMLForm(e)?new FormData(e):e),Ce.HttpStatusCode=xe,Ce.default=Ce,e.exports=Ce}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(492)})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "totalum-api-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.42",
|
|
4
4
|
"description": "Totalum sdk wrapper and utils of totalum api",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/qs": "^6.9.7",
|
|
17
17
|
"ts-loader": "^9.5.0",
|
|
18
|
-
"typescript": "^5.
|
|
18
|
+
"typescript": "^5.9.2",
|
|
19
19
|
"webpack": "^5.89.0",
|
|
20
20
|
"webpack-cli": "^5.1.4"
|
|
21
21
|
},
|