@fuul/sdk 7.19.0 → 7.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/affiliate-portal/AffiliatePortalService.d.ts +2 -1
- package/dist/affiliate-portal/AffiliatePortalService.d.ts.map +1 -1
- package/dist/affiliate-portal/types/index.d.ts +16 -0
- package/dist/affiliate-portal/types/index.d.ts.map +1 -1
- package/dist/core.d.ts +12 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +160 -146
- package/dist/index.umd.js +5 -5
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from '../HttpClient';
|
|
2
|
-
import { GetAffiliateStatsParams, GetAffiliateStatsResponse, GetNewTradersParams, NewTraderResponse } from './types';
|
|
2
|
+
import { GetAffiliateStatsParams, GetAffiliateStatsResponse, GetAffiliateTotalStatsParams, GetAffiliateTotalStatsResponse, GetNewTradersParams, NewTraderResponse } from './types';
|
|
3
3
|
export type AffiliatePortalServiceSettings = {
|
|
4
4
|
httpClient: HttpClient;
|
|
5
5
|
};
|
|
@@ -7,6 +7,7 @@ export declare class AffiliatePortalService {
|
|
|
7
7
|
private readonly httpClient;
|
|
8
8
|
constructor(settings: AffiliatePortalServiceSettings);
|
|
9
9
|
getAffiliateStats(params: GetAffiliateStatsParams): Promise<GetAffiliateStatsResponse>;
|
|
10
|
+
getAffiliateTotalStats(params: GetAffiliateTotalStatsParams): Promise<GetAffiliateTotalStatsResponse>;
|
|
10
11
|
getAffiliateNewTraders(params: GetNewTradersParams): Promise<NewTraderResponse[]>;
|
|
11
12
|
}
|
|
12
13
|
//# sourceMappingURL=AffiliatePortalService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AffiliatePortalService.d.ts","sourceRoot":"","sources":["../../src/affiliate-portal/AffiliatePortalService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"AffiliatePortalService.d.ts","sourceRoot":"","sources":["../../src/affiliate-portal/AffiliatePortalService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,4BAA4B,EAC5B,8BAA8B,EAC9B,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,8BAA8B,GAAG;IAC3C,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAIF,qBAAa,sBAAsB;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;gBAE5B,QAAQ,EAAE,8BAA8B;IAIvC,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAetF,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,8BAA8B,CAAC;IAYrG,sBAAsB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAY/F"}
|
|
@@ -31,4 +31,20 @@ export interface NewTraderResponse {
|
|
|
31
31
|
referrer_identifier: string;
|
|
32
32
|
total_new_traders: string;
|
|
33
33
|
}
|
|
34
|
+
export interface GetAffiliateTotalStatsParams {
|
|
35
|
+
statuses?: string[];
|
|
36
|
+
regions?: string[];
|
|
37
|
+
audiences?: string[];
|
|
38
|
+
}
|
|
39
|
+
export interface GetAffiliateTotalStatsResponse {
|
|
40
|
+
total_affiliates: number;
|
|
41
|
+
active_affiliates: number;
|
|
42
|
+
suspended_affiliates: number;
|
|
43
|
+
total_regions: number;
|
|
44
|
+
total_volume: number;
|
|
45
|
+
total_revenue: number;
|
|
46
|
+
total_attributions: number;
|
|
47
|
+
total_referred_users: number;
|
|
48
|
+
total_earnings: AffiliateEarning[];
|
|
49
|
+
}
|
|
34
50
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/affiliate-portal/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,oBAAoB,CAAC,EAAE,kBAAkB,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,kBAAkB,CAAC;IACzC,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;CAC3B"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/affiliate-portal/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,WAAW,uBAAuB;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,oBAAoB,CAAC,EAAE,kBAAkB,CAAC;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAAyB;IACxC,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,kBAAkB,CAAC;IACzC,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,8BAA8B;IAC7C,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,gBAAgB,EAAE,CAAC;CACpC"}
|
package/dist/core.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UserIdentifierType } from '.';
|
|
2
|
-
import { GetAffiliateStatsParams, GetAffiliateStatsResponse, GetNewTradersParams, NewTraderResponse } from './affiliate-portal/types';
|
|
2
|
+
import { GetAffiliateStatsParams, GetAffiliateStatsResponse, GetAffiliateTotalStatsParams, GetAffiliateTotalStatsResponse, GetNewTradersParams, NewTraderResponse } from './affiliate-portal/types';
|
|
3
3
|
import { GetClaimableChecksParams, GetClaimableChecksResponse, GetClaimCheckTotalsParams, GetClaimCheckTotalsResponse } from './claim-checks/types';
|
|
4
4
|
import { Affiliate, Conversion, CreateAffiliateResponse, DeleteReferralParams, GenerateReferralCodesParams, GenerateReferralCodesResponse, GetConversionsParams, GetPayoutsByReferrerParams, GetPayoutsLeaderboardParams, GetPointsLeaderboardParams, GetReferralCodeParams, GetReferralCodeResponse, GetReferralStatusParams, GetReferralStatusResponse, GetReferredUsersLeaderboardParams, GetReferredVolumeParams, GetRevenueLeaderboardParams, GetUserAudiencesParams, GetUserAudiencesResponse, GetUserPayoutMovementsParams, GetUserPayoutsByConversionParams, GetUserPointsByConversionParams, GetUserPointsMovementsParams, GetVolumeLeaderboardParams, LeaderboardResponse, ListUserReferralCodesParams, ListUserReferralCodesResponse, PayoutsByReferrerResponse, PayoutsLeaderboard, PointsLeaderboard, ReferredUsersLeaderboard, ReferredVolumeResponse, RevenueLeaderboard, UpdateReferralCodeParams, UseReferralCodeParams, UserPayoutMovementsResponse, UserPayoutsByConversionResponse, UserPointsByConversionResponse, UserPointsMovementsResponse, VolumeLeaderboard } from './types/api';
|
|
5
5
|
import { AffiliateCodeParams, AffiliateLinkParams, EventArgs, FuulSettings, IdentifyUserParams, UpdateRebateRateParams } from './types/sdk';
|
|
@@ -466,6 +466,16 @@ export declare function getAffiliateStats(params: GetAffiliateStatsParams): Prom
|
|
|
466
466
|
* ```
|
|
467
467
|
*/
|
|
468
468
|
export declare function getAffiliateNewTraders(params: GetNewTradersParams): Promise<NewTraderResponse[]>;
|
|
469
|
+
/**
|
|
470
|
+
* Gets total stats for the project's affiliate portal
|
|
471
|
+
* @param {GetAffiliateTotalStatsParams} params Optional filters (statuses, regions, audiences)
|
|
472
|
+
* @returns {Promise<GetAffiliateTotalStatsResponse>} Project total stats
|
|
473
|
+
* @example
|
|
474
|
+
* ```typescript
|
|
475
|
+
* const totalStats = await Fuul.getAffiliateTotalStats({});
|
|
476
|
+
* ```
|
|
477
|
+
*/
|
|
478
|
+
export declare function getAffiliateTotalStats(params: GetAffiliateTotalStatsParams): Promise<GetAffiliateTotalStatsResponse>;
|
|
469
479
|
/**
|
|
470
480
|
* Gets all claimable claim checks for a user within a project
|
|
471
481
|
* Returns only unclaimed checks with valid (non-expired) deadlines
|
|
@@ -538,6 +548,7 @@ declare const _default: {
|
|
|
538
548
|
deleteReferral: typeof deleteReferral;
|
|
539
549
|
getAffiliateStats: typeof getAffiliateStats;
|
|
540
550
|
getAffiliateNewTraders: typeof getAffiliateNewTraders;
|
|
551
|
+
getAffiliateTotalStats: typeof getAffiliateTotalStats;
|
|
541
552
|
getClaimableChecks: typeof getClaimableChecks;
|
|
542
553
|
getClaimCheckTotals: typeof getClaimCheckTotals;
|
|
543
554
|
};
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAEvC,OAAO,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAEvC,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,4BAA4B,EAC5B,8BAA8B,EAC9B,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAQpJ,OAAO,EACL,SAAS,EACT,UAAU,EACV,uBAAuB,EACvB,oBAAoB,EAEpB,2BAA2B,EAC3B,6BAA6B,EAC7B,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,iCAAiC,EACjC,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,gCAAgC,EAChC,+BAA+B,EAC/B,4BAA4B,EAC5B,0BAA0B,EAC1B,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,EAC9B,2BAA2B,EAC3B,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC5I,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAoB9E,wBAAgB,IAAI,CAAC,QAAQ,EAAE,YAAY,QAyB1C;AAQD;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAc7E;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB1F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,kBAAkB,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAkCnG;AAED;;;;;;;;;;;;;;;;;;;;IAoBI;AACJ,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAWvG;AAED;;;;;;;;;;;;;;;;;;;IAmBI;AACJ,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAUpF;AAED;;;;;;;;;;;;;;;;;;;;;IAqBI;AACJ,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAYpF;AAED;;;;;;;;;IASI;AACJ,wBAAsB,gBAAgB,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAG5H;AAED;;;;;;;;;;IAUI;AACJ,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGxE;AAED;;;;;;;;;;IAUI;AACJ,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAG7E;AAED;;;;;;;;;;;;;IAaI;AACJ,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,kBAAkB,EAClC,MAAM,CAAC,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,CAkBjB;AAED;;;;;;;;IAQI;AACJ,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAE3H;AAED;;;;;;;;IAQI;AACJ,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAExH;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,iCAAiC,GAAG,OAAO,CAAC,mBAAmB,CAAC,wBAAwB,CAAC,CAAC,CAE7I;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAGlG;AAED;;;;;;;;IAQI;AACJ,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC,CAGxH;AAED;;;;;;;;IAQI;AACJ,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC,CAG3H;AAED;;;;;;;;IAQI;AACJ,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,gCAAgC,GAAG,OAAO,CAAC,+BAA+B,CAAC,CAE7H;AAED;;;;;;;;IAQI;AACJ,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,+BAA+B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAE1H;AAED;;;;;;;;IAQI;AACJ,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAEjH;AAED;;;;;;;;IAQI;AACJ,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAEjH;AAED;;;;;;;;IAQI;AACJ,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAG3G;AAED;;;;;;;;IAQI;AACJ,wBAAsB,cAAc,CAAC,MAAM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAGzF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAGrG;AAED;;;;;;;;;GASG;AACH,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAGxG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAGvH;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,EAAE,CAAC,CAGzH;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAG3G;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAGrG;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGlF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGhF;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAG3G;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAGtG;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,4BAA4B,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAG1H;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAG9G;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAGjH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,wBAsCE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as Fuul } from './core';
|
|
2
|
-
export type { AffiliateEarning, GetAffiliateStatsParams, GetAffiliateStatsResponse, GetNewTradersParams, NewTraderResponse, } from './affiliate-portal/types';
|
|
2
|
+
export type { AffiliateEarning, GetAffiliateStatsParams, GetAffiliateStatsResponse, GetAffiliateTotalStatsParams, GetAffiliateTotalStatsResponse, GetNewTradersParams, NewTraderResponse, } from './affiliate-portal/types';
|
|
3
3
|
export * from './affiliates/errors';
|
|
4
4
|
export type { ClaimCheckReason, ClaimCheckTotalItem, ClaimResponse, GetClaimableChecksParams, GetClaimableChecksResponse, GetClaimCheckTotalsParams, GetClaimCheckTotalsResponse, } from './claim-checks/types';
|
|
5
5
|
export type { Affiliate, Conversion, CreateAffiliateResponse, DeleteReferralParams, EarningItem, GenerateReferralCodesParams, GenerateReferralCodesResponse, GetPayoutsByReferrerParams, GetReferralCodeParams, GetReferralCodeResponse, GetReferralStatusParams, GetReferralStatusResponse, GetReferredVolumeParams, GetRevenueLeaderboardParams, LeaderboardResponse, ListUserReferralCodesParams, ListUserReferralCodesResponse, PayoutsByReferrerResponse, ReferredVolumeItem, ReferredVolumeResponse, ReferrerPayoutData, RevenueLeaderboard, UpdateReferralCodeParams, UseReferralCodeParams, UserReferralCode, } from './types/api';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,SAAS,EACT,UAAU,EACV,uBAAuB,EACvB,oBAAoB,EACpB,WAAW,EACX,2BAA2B,EAC3B,6BAA6B,EAC7B,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACvG,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEnF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,yBAAyB,EACzB,4BAA4B,EAC5B,8BAA8B,EAC9B,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,GAC5B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,SAAS,EACT,UAAU,EACV,uBAAuB,EACvB,oBAAoB,EACpB,WAAW,EACX,2BAA2B,EAC3B,6BAA6B,EAC7B,0BAA0B,EAC1B,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACvG,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAEnF,OAAO,EAAE,IAAI,EAAE,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var zt = Object.defineProperty;
|
|
2
2
|
var Jt = (t, e, r) => e in t ? zt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var b = (t, e, r) => Jt(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
const
|
|
4
|
+
const Ce = "/affiliate-portal";
|
|
5
5
|
class Wt {
|
|
6
6
|
constructor(e) {
|
|
7
7
|
b(this, "httpClient");
|
|
@@ -9,7 +9,7 @@ class Wt {
|
|
|
9
9
|
}
|
|
10
10
|
async getAffiliateStats(e) {
|
|
11
11
|
return (await this.httpClient.get({
|
|
12
|
-
path: `${
|
|
12
|
+
path: `${Ce}/stats`,
|
|
13
13
|
queryParams: {
|
|
14
14
|
user_identifier: e.user_identifier,
|
|
15
15
|
from: e.from,
|
|
@@ -20,9 +20,19 @@ class Wt {
|
|
|
20
20
|
}
|
|
21
21
|
})).data;
|
|
22
22
|
}
|
|
23
|
+
async getAffiliateTotalStats(e) {
|
|
24
|
+
return (await this.httpClient.get({
|
|
25
|
+
path: `${Ce}/total-stats`,
|
|
26
|
+
queryParams: {
|
|
27
|
+
statuses: e.statuses,
|
|
28
|
+
regions: e.regions,
|
|
29
|
+
audiences: e.audiences
|
|
30
|
+
}
|
|
31
|
+
})).data;
|
|
32
|
+
}
|
|
23
33
|
async getAffiliateNewTraders(e) {
|
|
24
34
|
return (await this.httpClient.get({
|
|
25
|
-
path: `${
|
|
35
|
+
path: `${Ce}/new-traders`,
|
|
26
36
|
queryParams: {
|
|
27
37
|
user_identifier: e.user_identifier,
|
|
28
38
|
from: e.from,
|
|
@@ -37,7 +47,7 @@ function _t(t, e) {
|
|
|
37
47
|
return t.apply(e, arguments);
|
|
38
48
|
};
|
|
39
49
|
}
|
|
40
|
-
const { toString: Qt } = Object.prototype, { getPrototypeOf:
|
|
50
|
+
const { toString: Qt } = Object.prototype, { getPrototypeOf: ke } = Object, { iterator: pe, toStringTag: Et } = Symbol, ye = /* @__PURE__ */ ((t) => (e) => {
|
|
41
51
|
const r = Qt.call(e);
|
|
42
52
|
return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
|
|
43
53
|
})(/* @__PURE__ */ Object.create(null)), F = (t) => (t = t.toLowerCase(), (e) => ye(e) === t), me = (t) => (e) => typeof e === t, { isArray: Q } = Array, J = me("undefined");
|
|
@@ -52,7 +62,7 @@ function Xt(t) {
|
|
|
52
62
|
const Yt = me("string"), P = me("function"), Ct = me("number"), te = (t) => t !== null && typeof t == "object", Gt = (t) => t === !0 || t === !1, le = (t) => {
|
|
53
63
|
if (ye(t) !== "object")
|
|
54
64
|
return !1;
|
|
55
|
-
const e =
|
|
65
|
+
const e = ke(t);
|
|
56
66
|
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(Et in t) && !(pe in t);
|
|
57
67
|
}, Zt = (t) => {
|
|
58
68
|
if (!te(t) || ee(t))
|
|
@@ -104,12 +114,12 @@ function St(t, e) {
|
|
|
104
114
|
return null;
|
|
105
115
|
}
|
|
106
116
|
const M = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, At = (t) => !J(t) && t !== M;
|
|
107
|
-
function
|
|
117
|
+
function xe() {
|
|
108
118
|
const { caseless: t, skipUndefined: e } = At(this) && this || {}, r = {}, n = (s, i) => {
|
|
109
119
|
if (i === "__proto__" || i === "constructor" || i === "prototype")
|
|
110
120
|
return;
|
|
111
121
|
const o = t && St(r, i) || i;
|
|
112
|
-
le(r[o]) && le(s) ? r[o] =
|
|
122
|
+
le(r[o]) && le(s) ? r[o] = xe(r[o], s) : le(s) ? r[o] = xe({}, s) : Q(s) ? r[o] = s.slice() : (!e || !J(s)) && (r[o] = s);
|
|
113
123
|
};
|
|
114
124
|
for (let s = 0, i = arguments.length; s < i; s++)
|
|
115
125
|
arguments[s] && re(arguments[s], n);
|
|
@@ -147,7 +157,7 @@ const yr = (t, e, r, { allOwnKeys: n } = {}) => (re(
|
|
|
147
157
|
do {
|
|
148
158
|
for (s = Object.getOwnPropertyNames(t), i = s.length; i-- > 0; )
|
|
149
159
|
o = s[i], (!n || n(o, t, e)) && !c[o] && (e[o] = t[o], c[o] = !0);
|
|
150
|
-
t = r !== !1 &&
|
|
160
|
+
t = r !== !1 && ke(t);
|
|
151
161
|
} while (t && (!r || r(t, e)) && t !== Object.prototype);
|
|
152
162
|
return e;
|
|
153
163
|
}, br = (t, e, r) => {
|
|
@@ -163,7 +173,7 @@ const yr = (t, e, r, { allOwnKeys: n } = {}) => (re(
|
|
|
163
173
|
for (; e-- > 0; )
|
|
164
174
|
r[e] = t[e];
|
|
165
175
|
return r;
|
|
166
|
-
}, Er = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" &&
|
|
176
|
+
}, Er = /* @__PURE__ */ ((t) => (e) => t && e instanceof t)(typeof Uint8Array < "u" && ke(Uint8Array)), Rr = (t, e) => {
|
|
167
177
|
const n = (t && t[pe]).call(t);
|
|
168
178
|
let s;
|
|
169
179
|
for (; (s = n.next()) && !s.done; ) {
|
|
@@ -267,7 +277,7 @@ const Dr = (t) => {
|
|
|
267
277
|
isTypedArray: Er,
|
|
268
278
|
isFileList: ir,
|
|
269
279
|
forEach: re,
|
|
270
|
-
merge:
|
|
280
|
+
merge: xe,
|
|
271
281
|
extend: yr,
|
|
272
282
|
trim: pr,
|
|
273
283
|
stripBOM: mr,
|
|
@@ -357,21 +367,21 @@ m.ERR_CANCELED = "ERR_CANCELED";
|
|
|
357
367
|
m.ERR_NOT_SUPPORT = "ERR_NOT_SUPPORT";
|
|
358
368
|
m.ERR_INVALID_URL = "ERR_INVALID_URL";
|
|
359
369
|
const Br = null;
|
|
360
|
-
function
|
|
370
|
+
function Ue(t) {
|
|
361
371
|
return a.isPlainObject(t) || a.isArray(t);
|
|
362
372
|
}
|
|
363
373
|
function Nt(t) {
|
|
364
374
|
return a.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
365
375
|
}
|
|
366
|
-
function
|
|
376
|
+
function Se(t, e, r) {
|
|
367
377
|
return t ? t.concat(e).map(function(s, i) {
|
|
368
378
|
return s = Nt(s), !r && i ? "[" + s + "]" : s;
|
|
369
379
|
}).join(r ? "." : "") : e;
|
|
370
380
|
}
|
|
371
|
-
function
|
|
372
|
-
return a.isArray(t) && !t.some(
|
|
381
|
+
function qr(t) {
|
|
382
|
+
return a.isArray(t) && !t.some(Ue);
|
|
373
383
|
}
|
|
374
|
-
const
|
|
384
|
+
const Ir = a.toFlatObject(a, {}, null, function(e) {
|
|
375
385
|
return /^is[A-Z]/.test(e);
|
|
376
386
|
});
|
|
377
387
|
function ge(t, e, r) {
|
|
@@ -405,25 +415,25 @@ function ge(t, e, r) {
|
|
|
405
415
|
function u(d, y, p) {
|
|
406
416
|
let E = d;
|
|
407
417
|
if (a.isReactNative(e) && a.isReactNativeBlob(d))
|
|
408
|
-
return e.append(
|
|
418
|
+
return e.append(Se(p, y, i), l(d)), !1;
|
|
409
419
|
if (d && !p && typeof d == "object") {
|
|
410
420
|
if (a.endsWith(y, "{}"))
|
|
411
421
|
y = n ? y : y.slice(0, -2), d = JSON.stringify(d);
|
|
412
|
-
else if (a.isArray(d) &&
|
|
422
|
+
else if (a.isArray(d) && qr(d) || (a.isFileList(d) || a.endsWith(y, "[]")) && (E = a.toArray(d)))
|
|
413
423
|
return y = Nt(y), E.forEach(function(C, A) {
|
|
414
424
|
!(a.isUndefined(C) || C === null) && e.append(
|
|
415
425
|
// eslint-disable-next-line no-nested-ternary
|
|
416
|
-
o === !0 ?
|
|
426
|
+
o === !0 ? Se([y], A, i) : o === null ? y : y + "[]",
|
|
417
427
|
l(C)
|
|
418
428
|
);
|
|
419
429
|
}), !1;
|
|
420
430
|
}
|
|
421
|
-
return
|
|
431
|
+
return Ue(d) ? !0 : (e.append(Se(p, y, i), l(d)), !1);
|
|
422
432
|
}
|
|
423
|
-
const h = [], g = Object.assign(
|
|
433
|
+
const h = [], g = Object.assign(Ir, {
|
|
424
434
|
defaultVisitor: u,
|
|
425
435
|
convertValue: l,
|
|
426
|
-
isVisitable:
|
|
436
|
+
isVisitable: Ue
|
|
427
437
|
});
|
|
428
438
|
function R(d, y) {
|
|
429
439
|
if (!a.isUndefined(d)) {
|
|
@@ -452,10 +462,10 @@ function et(t) {
|
|
|
452
462
|
return e[n];
|
|
453
463
|
});
|
|
454
464
|
}
|
|
455
|
-
function
|
|
465
|
+
function ve(t, e) {
|
|
456
466
|
this._pairs = [], t && ge(t, this, e);
|
|
457
467
|
}
|
|
458
|
-
const xt =
|
|
468
|
+
const xt = ve.prototype;
|
|
459
469
|
xt.append = function(e, r) {
|
|
460
470
|
this._pairs.push([e, r]);
|
|
461
471
|
};
|
|
@@ -477,7 +487,7 @@ function Ut(t, e, r) {
|
|
|
477
487
|
serialize: r
|
|
478
488
|
} : r, i = s && s.serialize;
|
|
479
489
|
let o;
|
|
480
|
-
if (i ? o = i(e, s) : o = a.isURLSearchParams(e) ? e.toString() : new
|
|
490
|
+
if (i ? o = i(e, s) : o = a.isURLSearchParams(e) ? e.toString() : new ve(e, s).toString(n), o) {
|
|
481
491
|
const c = t.indexOf("#");
|
|
482
492
|
c !== -1 && (t = t.slice(0, c)), t += (t.indexOf("?") === -1 ? "?" : "&") + o;
|
|
483
493
|
}
|
|
@@ -538,12 +548,12 @@ class tt {
|
|
|
538
548
|
});
|
|
539
549
|
}
|
|
540
550
|
}
|
|
541
|
-
const
|
|
551
|
+
const Be = {
|
|
542
552
|
silentJSONParsing: !0,
|
|
543
553
|
forcedJSONParsing: !0,
|
|
544
554
|
clarifyTimeoutError: !1,
|
|
545
555
|
legacyInterceptorReqResOrdering: !0
|
|
546
|
-
}, $r = typeof URLSearchParams < "u" ? URLSearchParams :
|
|
556
|
+
}, $r = typeof URLSearchParams < "u" ? URLSearchParams : ve, Mr = typeof FormData < "u" ? FormData : null, Hr = typeof Blob < "u" ? Blob : null, Vr = {
|
|
547
557
|
isBrowser: !0,
|
|
548
558
|
classes: {
|
|
549
559
|
URLSearchParams: $r,
|
|
@@ -551,13 +561,13 @@ const ke = {
|
|
|
551
561
|
Blob: Hr
|
|
552
562
|
},
|
|
553
563
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
554
|
-
},
|
|
555
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Jr =
|
|
564
|
+
}, qe = typeof window < "u" && typeof document < "u", De = typeof navigator == "object" && navigator || void 0, Kr = qe && (!De || ["ReactNative", "NativeScript", "NS"].indexOf(De.product) < 0), zr = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
565
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Jr = qe && window.location.href || "http://localhost", Wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
556
566
|
__proto__: null,
|
|
557
|
-
hasBrowserEnv:
|
|
567
|
+
hasBrowserEnv: qe,
|
|
558
568
|
hasStandardBrowserEnv: Kr,
|
|
559
569
|
hasStandardBrowserWebWorkerEnv: zr,
|
|
560
|
-
navigator:
|
|
570
|
+
navigator: De,
|
|
561
571
|
origin: Jr
|
|
562
572
|
}, Symbol.toStringTag, { value: "Module" })), S = {
|
|
563
573
|
...Wr,
|
|
@@ -609,7 +619,7 @@ function Gr(t, e, r) {
|
|
|
609
619
|
return (r || JSON.stringify)(t);
|
|
610
620
|
}
|
|
611
621
|
const ne = {
|
|
612
|
-
transitional:
|
|
622
|
+
transitional: Be,
|
|
613
623
|
adapter: ["xhr", "http", "fetch"],
|
|
614
624
|
transformRequest: [
|
|
615
625
|
function(e, r) {
|
|
@@ -721,7 +731,7 @@ function tn(t) {
|
|
|
721
731
|
return e;
|
|
722
732
|
}
|
|
723
733
|
const rn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
724
|
-
function
|
|
734
|
+
function Ae(t, e, r, n, s) {
|
|
725
735
|
if (a.isFunction(n))
|
|
726
736
|
return n.call(this, e, r);
|
|
727
737
|
if (s && (e = r), !!a.isString(e)) {
|
|
@@ -795,7 +805,7 @@ let O = class {
|
|
|
795
805
|
has(e, r) {
|
|
796
806
|
if (e = G(e), e) {
|
|
797
807
|
const n = a.findKey(this, e);
|
|
798
|
-
return !!(n && this[n] !== void 0 && (!r ||
|
|
808
|
+
return !!(n && this[n] !== void 0 && (!r || Ae(this, this[n], n, r)));
|
|
799
809
|
}
|
|
800
810
|
return !1;
|
|
801
811
|
}
|
|
@@ -805,7 +815,7 @@ let O = class {
|
|
|
805
815
|
function i(o) {
|
|
806
816
|
if (o = G(o), o) {
|
|
807
817
|
const c = a.findKey(n, o);
|
|
808
|
-
c && (!r ||
|
|
818
|
+
c && (!r || Ae(n, n[c], c, r)) && (delete n[c], s = !0);
|
|
809
819
|
}
|
|
810
820
|
}
|
|
811
821
|
return a.isArray(e) ? e.forEach(i) : i(e), s;
|
|
@@ -815,7 +825,7 @@ let O = class {
|
|
|
815
825
|
let n = r.length, s = !1;
|
|
816
826
|
for (; n--; ) {
|
|
817
827
|
const i = r[n];
|
|
818
|
-
(!e ||
|
|
828
|
+
(!e || Ae(this, this[i], i, e, !0)) && (delete this[i], s = !0);
|
|
819
829
|
}
|
|
820
830
|
return s;
|
|
821
831
|
}
|
|
@@ -889,7 +899,7 @@ a.reduceDescriptors(O.prototype, ({ value: t }, e) => {
|
|
|
889
899
|
};
|
|
890
900
|
});
|
|
891
901
|
a.freezeMethods(O);
|
|
892
|
-
function
|
|
902
|
+
function Te(t, e) {
|
|
893
903
|
const r = this || ne, n = e || r, s = O.from(n.headers);
|
|
894
904
|
let i = n.data;
|
|
895
905
|
return a.forEach(t, function(c) {
|
|
@@ -1164,7 +1174,7 @@ const vt = (t) => {
|
|
|
1164
1174
|
j.event = A || null, n(j), p = null;
|
|
1165
1175
|
}, p.ontimeout = function() {
|
|
1166
1176
|
let A = s.timeout ? "timeout of " + s.timeout + "ms exceeded" : "timeout exceeded";
|
|
1167
|
-
const D = s.transitional ||
|
|
1177
|
+
const D = s.transitional || Be;
|
|
1168
1178
|
s.timeoutErrorMessage && (A = s.timeoutErrorMessage), n(
|
|
1169
1179
|
new m(
|
|
1170
1180
|
A,
|
|
@@ -1350,10 +1360,10 @@ const vt = (t) => {
|
|
|
1350
1360
|
onDownloadProgress: D,
|
|
1351
1361
|
onUploadProgress: j,
|
|
1352
1362
|
responseType: x,
|
|
1353
|
-
headers:
|
|
1363
|
+
headers: Ee,
|
|
1354
1364
|
withCredentials: ie = "same-origin",
|
|
1355
|
-
fetchOptions:
|
|
1356
|
-
} = vt(d),
|
|
1365
|
+
fetchOptions: Ke
|
|
1366
|
+
} = vt(d), ze = e || fetch;
|
|
1357
1367
|
x = x ? (x + "").toLowerCase() : "text";
|
|
1358
1368
|
let oe = yn(
|
|
1359
1369
|
[N, C && C.toAbortSignal()],
|
|
@@ -1362,46 +1372,46 @@ const vt = (t) => {
|
|
|
1362
1372
|
const $ = oe && oe.unsubscribe && (() => {
|
|
1363
1373
|
oe.unsubscribe();
|
|
1364
1374
|
});
|
|
1365
|
-
let
|
|
1375
|
+
let Je;
|
|
1366
1376
|
try {
|
|
1367
|
-
if (j && l && p !== "get" && p !== "head" && (
|
|
1377
|
+
if (j && l && p !== "get" && p !== "head" && (Je = await R(Ee, E)) !== 0) {
|
|
1368
1378
|
let B = new r(y, {
|
|
1369
1379
|
method: "POST",
|
|
1370
1380
|
body: E,
|
|
1371
1381
|
duplex: "half"
|
|
1372
1382
|
}), z;
|
|
1373
|
-
if (a.isFormData(E) && (z = B.headers.get("content-type")) &&
|
|
1374
|
-
const [
|
|
1375
|
-
|
|
1383
|
+
if (a.isFormData(E) && (z = B.headers.get("content-type")) && Ee.setContentType(z), B.body) {
|
|
1384
|
+
const [Re, ae] = nt(
|
|
1385
|
+
Je,
|
|
1376
1386
|
he(st(j))
|
|
1377
1387
|
);
|
|
1378
|
-
E = ot(B.body, at,
|
|
1388
|
+
E = ot(B.body, at, Re, ae);
|
|
1379
1389
|
}
|
|
1380
1390
|
}
|
|
1381
1391
|
a.isString(ie) || (ie = ie ? "include" : "omit");
|
|
1382
|
-
const T = i && "credentials" in r.prototype,
|
|
1383
|
-
...
|
|
1392
|
+
const T = i && "credentials" in r.prototype, We = {
|
|
1393
|
+
...Ke,
|
|
1384
1394
|
signal: oe,
|
|
1385
1395
|
method: p.toUpperCase(),
|
|
1386
|
-
headers:
|
|
1396
|
+
headers: Ee.normalize().toJSON(),
|
|
1387
1397
|
body: E,
|
|
1388
1398
|
duplex: "half",
|
|
1389
1399
|
credentials: T ? ie : void 0
|
|
1390
1400
|
};
|
|
1391
|
-
Y = i && new r(y,
|
|
1392
|
-
let v = await (i ?
|
|
1393
|
-
const
|
|
1394
|
-
if (u && (D ||
|
|
1401
|
+
Y = i && new r(y, We);
|
|
1402
|
+
let v = await (i ? ze(Y, Ke) : ze(y, We));
|
|
1403
|
+
const Qe = u && (x === "stream" || x === "response");
|
|
1404
|
+
if (u && (D || Qe && $)) {
|
|
1395
1405
|
const B = {};
|
|
1396
|
-
["status", "statusText", "headers"].forEach((
|
|
1397
|
-
B[
|
|
1406
|
+
["status", "statusText", "headers"].forEach((Xe) => {
|
|
1407
|
+
B[Xe] = v[Xe];
|
|
1398
1408
|
});
|
|
1399
|
-
const z = a.toFiniteNumber(v.headers.get("content-length")), [
|
|
1409
|
+
const z = a.toFiniteNumber(v.headers.get("content-length")), [Re, ae] = D && nt(
|
|
1400
1410
|
z,
|
|
1401
1411
|
he(st(D), !0)
|
|
1402
1412
|
) || [];
|
|
1403
1413
|
v = new n(
|
|
1404
|
-
ot(v.body, at,
|
|
1414
|
+
ot(v.body, at, Re, () => {
|
|
1405
1415
|
ae && ae(), $ && $();
|
|
1406
1416
|
}),
|
|
1407
1417
|
B
|
|
@@ -1412,7 +1422,7 @@ const vt = (t) => {
|
|
|
1412
1422
|
v,
|
|
1413
1423
|
d
|
|
1414
1424
|
);
|
|
1415
|
-
return !
|
|
1425
|
+
return !Qe && $ && $(), await new Promise((B, z) => {
|
|
1416
1426
|
Ft(B, z, {
|
|
1417
1427
|
data: Kt,
|
|
1418
1428
|
headers: O.from(v.headers),
|
|
@@ -1446,14 +1456,14 @@ const vt = (t) => {
|
|
|
1446
1456
|
return l;
|
|
1447
1457
|
};
|
|
1448
1458
|
Bt();
|
|
1449
|
-
const
|
|
1459
|
+
const Ie = {
|
|
1450
1460
|
http: Br,
|
|
1451
1461
|
xhr: pn,
|
|
1452
1462
|
fetch: {
|
|
1453
1463
|
get: Bt
|
|
1454
1464
|
}
|
|
1455
1465
|
};
|
|
1456
|
-
a.forEach(
|
|
1466
|
+
a.forEach(Ie, (t, e) => {
|
|
1457
1467
|
if (t) {
|
|
1458
1468
|
try {
|
|
1459
1469
|
Object.defineProperty(t, "name", { value: e });
|
|
@@ -1471,7 +1481,7 @@ function Cn(t, e) {
|
|
|
1471
1481
|
for (let o = 0; o < r; o++) {
|
|
1472
1482
|
n = t[o];
|
|
1473
1483
|
let c;
|
|
1474
|
-
if (s = n, !Rn(n) && (s =
|
|
1484
|
+
if (s = n, !Rn(n) && (s = Ie[(c = String(n)).toLowerCase()], s === void 0))
|
|
1475
1485
|
throw new m(`Unknown adapter '${c}'`);
|
|
1476
1486
|
if (s && (a.isFunction(s) || (s = s.get(e))))
|
|
1477
1487
|
break;
|
|
@@ -1491,7 +1501,7 @@ function Cn(t, e) {
|
|
|
1491
1501
|
}
|
|
1492
1502
|
return s;
|
|
1493
1503
|
}
|
|
1494
|
-
const
|
|
1504
|
+
const qt = {
|
|
1495
1505
|
/**
|
|
1496
1506
|
* Resolve an adapter from a list of adapter names or functions.
|
|
1497
1507
|
* @type {Function}
|
|
@@ -1501,19 +1511,19 @@ const It = {
|
|
|
1501
1511
|
* Exposes all known adapters
|
|
1502
1512
|
* @type {Object<string, Function|Object>}
|
|
1503
1513
|
*/
|
|
1504
|
-
adapters:
|
|
1514
|
+
adapters: Ie
|
|
1505
1515
|
};
|
|
1506
|
-
function
|
|
1516
|
+
function Pe(t) {
|
|
1507
1517
|
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1508
1518
|
throw new se(null, t);
|
|
1509
1519
|
}
|
|
1510
1520
|
function ft(t) {
|
|
1511
|
-
return
|
|
1521
|
+
return Pe(t), t.headers = O.from(t.headers), t.data = Te.call(t, t.transformRequest), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), qt.getAdapter(t.adapter || ne.adapter, t)(t).then(
|
|
1512
1522
|
function(n) {
|
|
1513
|
-
return
|
|
1523
|
+
return Pe(t), n.data = Te.call(t, t.transformResponse, n), n.headers = O.from(n.headers), n;
|
|
1514
1524
|
},
|
|
1515
1525
|
function(n) {
|
|
1516
|
-
return Lt(n) || (
|
|
1526
|
+
return Lt(n) || (Pe(t), n && n.response && (n.response.data = Te.call(
|
|
1517
1527
|
t,
|
|
1518
1528
|
t.transformResponse,
|
|
1519
1529
|
n.response
|
|
@@ -1521,7 +1531,7 @@ function ft(t) {
|
|
|
1521
1531
|
}
|
|
1522
1532
|
);
|
|
1523
1533
|
}
|
|
1524
|
-
const
|
|
1534
|
+
const It = "1.13.6", we = {};
|
|
1525
1535
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => {
|
|
1526
1536
|
we[t] = function(n) {
|
|
1527
1537
|
return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
@@ -1530,7 +1540,7 @@ const qt = "1.13.6", we = {};
|
|
|
1530
1540
|
const ht = {};
|
|
1531
1541
|
we.transitional = function(e, r, n) {
|
|
1532
1542
|
function s(i, o) {
|
|
1533
|
-
return "[Axios v" +
|
|
1543
|
+
return "[Axios v" + It + "] Transitional option '" + i + "'" + o + (n ? ". " + n : "");
|
|
1534
1544
|
}
|
|
1535
1545
|
return (i, o, c) => {
|
|
1536
1546
|
if (e === !1)
|
|
@@ -1644,7 +1654,7 @@ let H = class {
|
|
|
1644
1654
|
if (typeof y.runWhen == "function" && y.runWhen(r) === !1)
|
|
1645
1655
|
return;
|
|
1646
1656
|
f = f && y.synchronous;
|
|
1647
|
-
const p = r.transitional ||
|
|
1657
|
+
const p = r.transitional || Be;
|
|
1648
1658
|
p && p.legacyInterceptorReqResOrdering ? c.unshift(y.fulfilled, y.rejected) : c.push(y.fulfilled, y.rejected);
|
|
1649
1659
|
});
|
|
1650
1660
|
const l = [];
|
|
@@ -1793,7 +1803,7 @@ function Tn(t) {
|
|
|
1793
1803
|
function Pn(t) {
|
|
1794
1804
|
return a.isObject(t) && t.isAxiosError === !0;
|
|
1795
1805
|
}
|
|
1796
|
-
const
|
|
1806
|
+
const Le = {
|
|
1797
1807
|
Continue: 100,
|
|
1798
1808
|
SwitchingProtocols: 101,
|
|
1799
1809
|
Processing: 102,
|
|
@@ -1864,8 +1874,8 @@ const Ue = {
|
|
|
1864
1874
|
SslHandshakeFailed: 525,
|
|
1865
1875
|
InvalidSslCertificate: 526
|
|
1866
1876
|
};
|
|
1867
|
-
Object.entries(
|
|
1868
|
-
|
|
1877
|
+
Object.entries(Le).forEach(([t, e]) => {
|
|
1878
|
+
Le[e] = t;
|
|
1869
1879
|
});
|
|
1870
1880
|
function $t(t) {
|
|
1871
1881
|
const e = new H(t), r = _t(H.prototype.request, e);
|
|
@@ -1878,7 +1888,7 @@ _.Axios = H;
|
|
|
1878
1888
|
_.CanceledError = se;
|
|
1879
1889
|
_.CancelToken = An;
|
|
1880
1890
|
_.isCancel = Lt;
|
|
1881
|
-
_.VERSION =
|
|
1891
|
+
_.VERSION = It;
|
|
1882
1892
|
_.toFormData = ge;
|
|
1883
1893
|
_.AxiosError = m;
|
|
1884
1894
|
_.Cancel = _.CanceledError;
|
|
@@ -1890,28 +1900,28 @@ _.isAxiosError = Pn;
|
|
|
1890
1900
|
_.mergeConfig = V;
|
|
1891
1901
|
_.AxiosHeaders = O;
|
|
1892
1902
|
_.formToJSON = (t) => Dt(a.isHTMLForm(t) ? new FormData(t) : t);
|
|
1893
|
-
_.getAdapter =
|
|
1894
|
-
_.HttpStatusCode =
|
|
1903
|
+
_.getAdapter = qt.getAdapter;
|
|
1904
|
+
_.HttpStatusCode = Le;
|
|
1895
1905
|
_.default = _;
|
|
1896
1906
|
const {
|
|
1897
|
-
Axios:
|
|
1907
|
+
Axios: Ks,
|
|
1898
1908
|
AxiosError: ue,
|
|
1899
|
-
CanceledError:
|
|
1900
|
-
isCancel:
|
|
1901
|
-
CancelToken:
|
|
1902
|
-
VERSION:
|
|
1903
|
-
all:
|
|
1904
|
-
Cancel:
|
|
1905
|
-
isAxiosError:
|
|
1906
|
-
spread:
|
|
1907
|
-
toFormData:
|
|
1908
|
-
AxiosHeaders:
|
|
1909
|
-
HttpStatusCode:
|
|
1910
|
-
formToJSON:
|
|
1911
|
-
getAdapter:
|
|
1912
|
-
mergeConfig:
|
|
1909
|
+
CanceledError: zs,
|
|
1910
|
+
isCancel: Js,
|
|
1911
|
+
CancelToken: Ws,
|
|
1912
|
+
VERSION: Qs,
|
|
1913
|
+
all: Xs,
|
|
1914
|
+
Cancel: Ys,
|
|
1915
|
+
isAxiosError: Gs,
|
|
1916
|
+
spread: Zs,
|
|
1917
|
+
toFormData: ei,
|
|
1918
|
+
AxiosHeaders: ti,
|
|
1919
|
+
HttpStatusCode: ri,
|
|
1920
|
+
formToJSON: ni,
|
|
1921
|
+
getAdapter: si,
|
|
1922
|
+
mergeConfig: ii
|
|
1913
1923
|
} = _;
|
|
1914
|
-
class
|
|
1924
|
+
class Oe extends Error {
|
|
1915
1925
|
constructor(r) {
|
|
1916
1926
|
super(r.join(", "));
|
|
1917
1927
|
b(this, "errors");
|
|
@@ -1932,7 +1942,7 @@ class yt extends Error {
|
|
|
1932
1942
|
this.name = "CodeInUseError", this.code = r;
|
|
1933
1943
|
}
|
|
1934
1944
|
}
|
|
1935
|
-
class
|
|
1945
|
+
class Ne extends Error {
|
|
1936
1946
|
constructor() {
|
|
1937
1947
|
super("Invalid signature provided"), this.name = "InvalidSignatureError";
|
|
1938
1948
|
}
|
|
@@ -1964,9 +1974,9 @@ class On {
|
|
|
1964
1974
|
const u = (f = l.response) == null ? void 0 : f.data;
|
|
1965
1975
|
if (typeof (u == null ? void 0 : u.message) == "string") {
|
|
1966
1976
|
const h = u.message.toLowerCase();
|
|
1967
|
-
throw h == "invalid signature" ? new
|
|
1977
|
+
throw h == "invalid signature" ? new Ne() : h == "address in use" ? new pt(e) : h == "code in use" ? new yt(n) : new Error(h);
|
|
1968
1978
|
} else if ((u == null ? void 0 : u.message) instanceof Array)
|
|
1969
|
-
throw new
|
|
1979
|
+
throw new Oe(u.message);
|
|
1970
1980
|
}
|
|
1971
1981
|
throw l;
|
|
1972
1982
|
}
|
|
@@ -1990,9 +2000,9 @@ class On {
|
|
|
1990
2000
|
const l = (c = f.response) == null ? void 0 : c.data;
|
|
1991
2001
|
if (typeof (l == null ? void 0 : l.message) == "string") {
|
|
1992
2002
|
const u = l.message.toLowerCase();
|
|
1993
|
-
throw u == "invalid signature" ? new
|
|
2003
|
+
throw u == "invalid signature" ? new Ne() : u == "address in use" ? new pt(e) : u == "code in use" ? new yt(n) : new Error(u);
|
|
1994
2004
|
} else if ((l == null ? void 0 : l.message) instanceof Array)
|
|
1995
|
-
throw new
|
|
2005
|
+
throw new Oe(l.message);
|
|
1996
2006
|
}
|
|
1997
2007
|
throw f;
|
|
1998
2008
|
}
|
|
@@ -2017,9 +2027,9 @@ class On {
|
|
|
2017
2027
|
const h = (l = u.response) == null ? void 0 : l.data;
|
|
2018
2028
|
if (typeof (h == null ? void 0 : h.message) == "string") {
|
|
2019
2029
|
const g = h.message.toLowerCase();
|
|
2020
|
-
throw g == "invalid signature" ? new
|
|
2030
|
+
throw g == "invalid signature" ? new Ne() : new Error(g);
|
|
2021
2031
|
} else if ((h == null ? void 0 : h.message) instanceof Array)
|
|
2022
|
-
throw new
|
|
2032
|
+
throw new Oe(h.message);
|
|
2023
2033
|
}
|
|
2024
2034
|
throw u;
|
|
2025
2035
|
}
|
|
@@ -2172,7 +2182,7 @@ class kn {
|
|
|
2172
2182
|
const vn = "0.0.0", Bn = {
|
|
2173
2183
|
version: vn
|
|
2174
2184
|
};
|
|
2175
|
-
class
|
|
2185
|
+
class qn {
|
|
2176
2186
|
constructor(e) {
|
|
2177
2187
|
b(this, "client");
|
|
2178
2188
|
b(this, "defaultQueryParams");
|
|
@@ -2227,7 +2237,7 @@ class In {
|
|
|
2227
2237
|
});
|
|
2228
2238
|
}
|
|
2229
2239
|
}
|
|
2230
|
-
class
|
|
2240
|
+
class In {
|
|
2231
2241
|
constructor(e) {
|
|
2232
2242
|
b(this, "httpClient");
|
|
2233
2243
|
this.httpClient = e.httpClient;
|
|
@@ -2420,7 +2430,7 @@ let Hn = (t = 21) => {
|
|
|
2420
2430
|
e += Mn[r[t] & 63];
|
|
2421
2431
|
return e;
|
|
2422
2432
|
};
|
|
2423
|
-
const Vn = "fuul.tracking_id",
|
|
2433
|
+
const Vn = "fuul.tracking_id", je = () => Xn(Vn, () => Hn()), bt = () => W("af") || W("referrer"), Kn = () => document.referrer, zn = () => Yn(), Jn = () => W("category"), Wn = () => W("title"), Qn = () => W("tag"), Xn = (t, e) => {
|
|
2424
2434
|
const r = localStorage.getItem(t);
|
|
2425
2435
|
if (r)
|
|
2426
2436
|
return r;
|
|
@@ -2443,27 +2453,27 @@ class Zn {
|
|
|
2443
2453
|
}
|
|
2444
2454
|
}
|
|
2445
2455
|
const es = "https://api.fuul.xyz/api/v1/";
|
|
2446
|
-
let k = !1,
|
|
2456
|
+
let k = !1, Fe = !1, $e, L, Mt, Ht, q, be, _e, X, Vt, K, I, Me;
|
|
2447
2457
|
function ts(t) {
|
|
2448
|
-
k = !!t.debug, !
|
|
2458
|
+
k = !!t.debug, !Fe && ($e = t.apiKey, qs(), L = Is(t.baseApiUrl ?? es, t.defaultQueryParams ?? {}), Mt = new Dn({ httpClient: L, debug: k }), _e = new kn({ httpClient: L, debug: k }), q = new On({ httpClient: L, debug: k }), be = new Wt({ httpClient: L }), X = new jn({ httpClient: L, debug: k }), Ht = new Zn({ httpClient: L }), Vt = new xn({ httpClient: L, debug: k }), K = new In({ httpClient: L }), I = new $n({ httpClient: L, debug: k }), Me = new Un({ httpClient: L, debug: k }), Fe = !0, k && console.debug("Fuul SDK: init() complete"));
|
|
2449
2459
|
}
|
|
2450
2460
|
function w() {
|
|
2451
|
-
if (!
|
|
2461
|
+
if (!Fe)
|
|
2452
2462
|
throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods");
|
|
2453
2463
|
}
|
|
2454
2464
|
async function rs(t, e) {
|
|
2455
|
-
w(),
|
|
2465
|
+
w(), He(), Ve();
|
|
2456
2466
|
const r = {
|
|
2457
2467
|
name: t,
|
|
2458
2468
|
args: e ?? {},
|
|
2459
2469
|
metadata: {
|
|
2460
|
-
tracking_id:
|
|
2470
|
+
tracking_id: je()
|
|
2461
2471
|
}
|
|
2462
2472
|
};
|
|
2463
|
-
await
|
|
2473
|
+
await _e.sendEvent(r);
|
|
2464
2474
|
}
|
|
2465
2475
|
async function ns(t, e) {
|
|
2466
|
-
w(),
|
|
2476
|
+
w(), He(), Ve();
|
|
2467
2477
|
const r = {
|
|
2468
2478
|
name: "pageview",
|
|
2469
2479
|
args: {
|
|
@@ -2471,7 +2481,7 @@ async function ns(t, e) {
|
|
|
2471
2481
|
locationOrigin: document.location.origin
|
|
2472
2482
|
},
|
|
2473
2483
|
metadata: {
|
|
2474
|
-
tracking_id:
|
|
2484
|
+
tracking_id: je(),
|
|
2475
2485
|
referrer_url: Kn(),
|
|
2476
2486
|
source: zn(),
|
|
2477
2487
|
affiliate_id: bt() ?? void 0,
|
|
@@ -2481,10 +2491,10 @@ async function ns(t, e) {
|
|
|
2481
2491
|
tag: Qn() ?? void 0
|
|
2482
2492
|
}
|
|
2483
2493
|
};
|
|
2484
|
-
await
|
|
2494
|
+
await _e.sendEvent(r, e);
|
|
2485
2495
|
}
|
|
2486
2496
|
async function ss(t, e) {
|
|
2487
|
-
w(),
|
|
2497
|
+
w(), He(), Ve();
|
|
2488
2498
|
const r = {
|
|
2489
2499
|
name: "connect_wallet",
|
|
2490
2500
|
user: {
|
|
@@ -2496,13 +2506,13 @@ async function ss(t, e) {
|
|
|
2496
2506
|
locationOrigin: document.location.origin
|
|
2497
2507
|
},
|
|
2498
2508
|
metadata: {
|
|
2499
|
-
tracking_id:
|
|
2509
|
+
tracking_id: je()
|
|
2500
2510
|
}
|
|
2501
2511
|
};
|
|
2502
|
-
t != null && t.signature && (r.signature = t == null ? void 0 : t.signature, r.signature_message = t == null ? void 0 : t.message), t != null && t.signaturePublicKey && (r.signature_public_key = t.signaturePublicKey), t != null && t.accountChainId && (r.account_chain_id = t.accountChainId), await
|
|
2512
|
+
t != null && t.signature && (r.signature = t == null ? void 0 : t.signature, r.signature_message = t == null ? void 0 : t.message), t != null && t.signaturePublicKey && (r.signature_public_key = t.signaturePublicKey), t != null && t.accountChainId && (r.account_chain_id = t.accountChainId), await _e.sendEvent(r, e);
|
|
2503
2513
|
}
|
|
2504
2514
|
async function is(t) {
|
|
2505
|
-
return w(),
|
|
2515
|
+
return w(), q.create(
|
|
2506
2516
|
t.userIdentifier,
|
|
2507
2517
|
t.identifierType,
|
|
2508
2518
|
t.code,
|
|
@@ -2513,7 +2523,7 @@ async function is(t) {
|
|
|
2513
2523
|
);
|
|
2514
2524
|
}
|
|
2515
2525
|
async function os(t) {
|
|
2516
|
-
w(), await
|
|
2526
|
+
w(), await q.update(
|
|
2517
2527
|
t.userIdentifier,
|
|
2518
2528
|
t.identifierType,
|
|
2519
2529
|
t.code,
|
|
@@ -2523,7 +2533,7 @@ async function os(t) {
|
|
|
2523
2533
|
);
|
|
2524
2534
|
}
|
|
2525
2535
|
async function as(t) {
|
|
2526
|
-
w(), await
|
|
2536
|
+
w(), await q.updateRebateRate(
|
|
2527
2537
|
t.userIdentifier,
|
|
2528
2538
|
t.identifierType,
|
|
2529
2539
|
t.code,
|
|
@@ -2535,17 +2545,17 @@ async function as(t) {
|
|
|
2535
2545
|
);
|
|
2536
2546
|
}
|
|
2537
2547
|
async function cs(t, e) {
|
|
2538
|
-
return w(), await
|
|
2548
|
+
return w(), await q.getCode(t, e);
|
|
2539
2549
|
}
|
|
2540
2550
|
async function us(t) {
|
|
2541
|
-
return w(), await
|
|
2551
|
+
return w(), await q.isCodeFree(t);
|
|
2542
2552
|
}
|
|
2543
2553
|
async function ls(t) {
|
|
2544
|
-
return w(), await
|
|
2554
|
+
return w(), await q.isCodeAvailable(t);
|
|
2545
2555
|
}
|
|
2546
2556
|
async function ds(t, e, r, n) {
|
|
2547
2557
|
w();
|
|
2548
|
-
const s = await
|
|
2558
|
+
const s = await q.getCode(e, r), i = new URLSearchParams({
|
|
2549
2559
|
af: (s == null ? void 0 : s.code) ?? e
|
|
2550
2560
|
});
|
|
2551
2561
|
return n != null && n.title && i.append("af_title", n.title), n != null && n.format && i.append("af_format", n.format), n != null && n.place && i.append("af_place", n.place), `${t}?${i.toString()}`;
|
|
@@ -2593,59 +2603,62 @@ async function As(t) {
|
|
|
2593
2603
|
return w(), Vt.getUserAudiences(t);
|
|
2594
2604
|
}
|
|
2595
2605
|
async function Ts(t) {
|
|
2596
|
-
return w(),
|
|
2606
|
+
return w(), I.listUserReferralCodes(t);
|
|
2597
2607
|
}
|
|
2598
2608
|
async function Ps(t) {
|
|
2599
|
-
return w(),
|
|
2609
|
+
return w(), I.generateReferralCodes(t);
|
|
2600
2610
|
}
|
|
2601
2611
|
async function Os(t) {
|
|
2602
|
-
return w(),
|
|
2612
|
+
return w(), I.getReferralStatus(t);
|
|
2603
2613
|
}
|
|
2604
2614
|
async function Ns(t) {
|
|
2605
|
-
return w(),
|
|
2615
|
+
return w(), I.getReferralCode(t);
|
|
2606
2616
|
}
|
|
2607
2617
|
async function xs(t) {
|
|
2608
|
-
return w(),
|
|
2618
|
+
return w(), I.useReferralCode(t);
|
|
2609
2619
|
}
|
|
2610
2620
|
async function Us(t) {
|
|
2611
|
-
return w(),
|
|
2621
|
+
return w(), I.updateReferralCode(t);
|
|
2612
2622
|
}
|
|
2613
2623
|
async function Ds(t) {
|
|
2614
|
-
return w(),
|
|
2624
|
+
return w(), I.deleteReferral(t);
|
|
2615
2625
|
}
|
|
2616
2626
|
async function Ls(t) {
|
|
2617
|
-
return w(),
|
|
2627
|
+
return w(), be.getAffiliateStats(t);
|
|
2618
2628
|
}
|
|
2619
2629
|
async function Fs(t) {
|
|
2620
|
-
return w(),
|
|
2630
|
+
return w(), be.getAffiliateNewTraders(t);
|
|
2621
2631
|
}
|
|
2622
2632
|
async function ks(t) {
|
|
2623
|
-
return w(),
|
|
2633
|
+
return w(), be.getAffiliateTotalStats(t);
|
|
2624
2634
|
}
|
|
2625
2635
|
async function vs(t) {
|
|
2626
|
-
return w(),
|
|
2636
|
+
return w(), Me.getClaimableChecks(t);
|
|
2627
2637
|
}
|
|
2628
|
-
function
|
|
2638
|
+
async function Bs(t) {
|
|
2639
|
+
return w(), Me.getClaimCheckTotals(t);
|
|
2640
|
+
}
|
|
2641
|
+
function He() {
|
|
2629
2642
|
if (typeof window > "u" || typeof document > "u")
|
|
2630
2643
|
throw new Error("Fuul SDK: Browser context required");
|
|
2631
2644
|
}
|
|
2632
|
-
function
|
|
2645
|
+
function Ve() {
|
|
2633
2646
|
if (navigator.webdriver)
|
|
2634
2647
|
throw new Error("Fuul SDK: Error");
|
|
2635
2648
|
}
|
|
2636
|
-
function
|
|
2637
|
-
if (
|
|
2649
|
+
function qs() {
|
|
2650
|
+
if (!$e)
|
|
2638
2651
|
throw new Error("Fuul SDK: Invalid API key");
|
|
2639
2652
|
}
|
|
2640
2653
|
function Is(t, e) {
|
|
2641
|
-
return new
|
|
2654
|
+
return new qn({
|
|
2642
2655
|
baseURL: t,
|
|
2643
2656
|
timeout: 3e4,
|
|
2644
|
-
apiKey:
|
|
2657
|
+
apiKey: $e,
|
|
2645
2658
|
queryParams: e
|
|
2646
2659
|
});
|
|
2647
2660
|
}
|
|
2648
|
-
const
|
|
2661
|
+
const oi = {
|
|
2649
2662
|
init: ts,
|
|
2650
2663
|
sendEvent: rs,
|
|
2651
2664
|
sendPageview: ns,
|
|
@@ -2680,15 +2693,16 @@ const ii = {
|
|
|
2680
2693
|
deleteReferral: Ds,
|
|
2681
2694
|
getAffiliateStats: Ls,
|
|
2682
2695
|
getAffiliateNewTraders: Fs,
|
|
2683
|
-
|
|
2684
|
-
|
|
2696
|
+
getAffiliateTotalStats: ks,
|
|
2697
|
+
getClaimableChecks: vs,
|
|
2698
|
+
getClaimCheckTotals: Bs
|
|
2685
2699
|
};
|
|
2686
|
-
var
|
|
2700
|
+
var js = /* @__PURE__ */ ((t) => (t.EvmAddress = "evm_address", t.SolanaAddress = "solana_address", t.XRPLAddress = "xrpl_address", t.SuiAddress = "sui_address", t.Email = "email", t))(js || {});
|
|
2687
2701
|
export {
|
|
2688
2702
|
pt as AddressInUseError,
|
|
2689
2703
|
yt as CodeInUseError,
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
|
|
2704
|
+
oi as Fuul,
|
|
2705
|
+
Ne as InvalidSignatureError,
|
|
2706
|
+
js as UserIdentifierType,
|
|
2707
|
+
Oe as ValidationError
|
|
2694
2708
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(S,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(S=typeof globalThis<"u"?globalThis:S||self,T(S.Fuul={}))})(this,(function(S){"use strict";var Ls=Object.defineProperty;var Fs=(S,T,W)=>T in S?Ls(S,T,{enumerable:!0,configurable:!0,writable:!0,value:W}):S[T]=W;var b=(S,T,W)=>Fs(S,typeof T!="symbol"?T+"":T,W);const T="/affiliate-portal";class W{constructor(e){b(this,"httpClient");this.httpClient=e.httpClient}async getAffiliateStats(e){return(await this.httpClient.get({path:`${T}/stats`,queryParams:{user_identifier:e.user_identifier,from:e.from,to:e.to,this_month:e.this_month,conversion_id:e.conversion_id,conversion_name:e.conversion_name}})).data}async getAffiliateNewTraders(e){return(await this.httpClient.get({path:`${T}/new-traders`,queryParams:{user_identifier:e.user_identifier,from:e.from,to:e.to,this_month:e.this_month}})).data}}function Qe(t,e){return function(){return t.apply(e,arguments)}}const{toString:Wt}=Object.prototype,{getPrototypeOf:Ae}=Object,{iterator:ce,toStringTag:Xe}=Symbol,ue=(t=>e=>{const r=Wt.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),F=t=>(t=t.toLowerCase(),e=>ue(e)===t),le=t=>e=>typeof e===t,{isArray:Q}=Array,X=le("undefined");function ee(t){return t!==null&&!X(t)&&t.constructor!==null&&!X(t.constructor)&&P(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ye=F("ArrayBuffer");function Qt(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ye(t.buffer),e}const Xt=le("string"),P=le("function"),Ge=le("number"),te=t=>t!==null&&typeof t=="object",Yt=t=>t===!0||t===!1,de=t=>{if(ue(t)!=="object")return!1;const e=Ae(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Xe in t)&&!(ce in t)},Gt=t=>{if(!te(t)||ee(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Zt=F("Date"),er=F("File"),tr=t=>!!(t&&typeof t.uri<"u"),rr=t=>t&&typeof t.getParts<"u",nr=F("Blob"),sr=F("FileList"),ir=t=>te(t)&&P(t.pipe);function or(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ze=or(),et=typeof Ze.FormData<"u"?Ze.FormData:void 0,ar=t=>{let e;return t&&(et&&t instanceof et||P(t.append)&&((e=ue(t))==="formdata"||e==="object"&&P(t.toString)&&t.toString()==="[object FormData]"))},cr=F("URLSearchParams"),[ur,lr,dr,fr]=["ReadableStream","Request","Response","Headers"].map(F),hr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function re(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,s;if(typeof t!="object"&&(t=[t]),Q(t))for(n=0,s=t.length;n<s;n++)e.call(null,t[n],n,t);else{if(ee(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let c;for(n=0;n<o;n++)c=i[n],e.call(null,t[c],c,t)}}function tt(t,e){if(ee(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n=r.length,s;for(;n-- >0;)if(s=r[n],e===s.toLowerCase())return s;return null}const M=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,rt=t=>!X(t)&&t!==M;function Te(){const{caseless:t,skipUndefined:e}=rt(this)&&this||{},r={},n=(s,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const o=t&&tt(r,i)||i;de(r[o])&&de(s)?r[o]=Te(r[o],s):de(s)?r[o]=Te({},s):Q(s)?r[o]=s.slice():(!e||!X(s))&&(r[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&re(arguments[s],n);return r}const pr=(t,e,r,{allOwnKeys:n}={})=>(re(e,(s,i)=>{r&&P(s)?Object.defineProperty(t,i,{value:Qe(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),t),yr=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),mr=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},gr=(t,e,r,n)=>{let s,i,o;const c={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)o=s[i],(!n||n(o,t,e))&&!c[o]&&(e[o]=t[o],c[o]=!0);t=r!==!1&&Ae(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},wr=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},br=t=>{if(!t)return null;if(Q(t))return t;let e=t.length;if(!Ge(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},_r=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Ae(Uint8Array)),Er=(t,e)=>{const n=(t&&t[ce]).call(t);let s;for(;(s=n.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Rr=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Cr=F("HTMLFormElement"),Sr=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),nt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ar=F("RegExp"),st=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};re(r,(s,i)=>{let o;(o=e(s,i,t))!==!1&&(n[i]=o||s)}),Object.defineProperties(t,n)},Tr=t=>{st(t,(e,r)=>{if(P(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(P(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Pr=(t,e)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return Q(t)?n(t):n(String(t).split(e)),r},Or=()=>{},Nr=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Ur(t){return!!(t&&P(t.append)&&t[Xe]==="FormData"&&t[ce])}const xr=t=>{const e=new Array(10),r=(n,s)=>{if(te(n)){if(e.indexOf(n)>=0)return;if(ee(n))return n;if(!("toJSON"in n)){e[s]=n;const i=Q(n)?[]:{};return re(n,(o,c)=>{const f=r(o,s+1);!X(f)&&(i[c]=f)}),e[s]=void 0,i}}return n};return r(t,0)},Dr=F("AsyncFunction"),Lr=t=>t&&(te(t)||P(t))&&P(t.then)&&P(t.catch),it=((t,e)=>t?setImmediate:e?((r,n)=>(M.addEventListener("message",({source:s,data:i})=>{s===M&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),M.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",P(M.postMessage)),Fr=typeof queueMicrotask<"u"?queueMicrotask.bind(M):typeof process<"u"&&process.nextTick||it,a={isArray:Q,isArrayBuffer:Ye,isBuffer:ee,isFormData:ar,isArrayBufferView:Qt,isString:Xt,isNumber:Ge,isBoolean:Yt,isObject:te,isPlainObject:de,isEmptyObject:Gt,isReadableStream:ur,isRequest:lr,isResponse:dr,isHeaders:fr,isUndefined:X,isDate:Zt,isFile:er,isReactNativeBlob:tr,isReactNative:rr,isBlob:nr,isRegExp:Ar,isFunction:P,isStream:ir,isURLSearchParams:cr,isTypedArray:_r,isFileList:sr,forEach:re,merge:Te,extend:pr,trim:hr,stripBOM:yr,inherits:mr,toFlatObject:gr,kindOf:ue,kindOfTest:F,endsWith:wr,toArray:br,forEachEntry:Er,matchAll:Rr,isHTMLForm:Cr,hasOwnProperty:nt,hasOwnProp:nt,reduceDescriptors:st,freezeMethods:Tr,toObjectSet:Pr,toCamelCase:Sr,noop:Or,toFiniteNumber:Nr,findKey:tt,global:M,isContextDefined:rt,isSpecCompliantForm:Ur,toJSONObject:xr,isAsyncFn:Dr,isThenable:Lr,setImmediate:it,asap:Fr,isIterable:t=>t!=null&&P(t[ce])};let m=class zt extends Error{static from(e,r,n,s,i,o){const c=new zt(e.message,r||e.code,n,s,i);return c.cause=e,c.name=e.name,e.status!=null&&c.status==null&&(c.status=e.status),o&&Object.assign(c,o),c}constructor(e,r,n,s,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){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:a.toJSONObject(this.config),code:this.code,status:this.status}}};m.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",m.ERR_BAD_OPTION="ERR_BAD_OPTION",m.ECONNABORTED="ECONNABORTED",m.ETIMEDOUT="ETIMEDOUT",m.ERR_NETWORK="ERR_NETWORK",m.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",m.ERR_DEPRECATED="ERR_DEPRECATED",m.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",m.ERR_BAD_REQUEST="ERR_BAD_REQUEST",m.ERR_CANCELED="ERR_CANCELED",m.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",m.ERR_INVALID_URL="ERR_INVALID_URL";const kr=null;function Pe(t){return a.isPlainObject(t)||a.isArray(t)}function ot(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function Oe(t,e,r){return t?t.concat(e).map(function(s,i){return s=ot(s),!r&&i?"["+s+"]":s}).join(r?".":""):e}function vr(t){return a.isArray(t)&&!t.some(Pe)}const Ir=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function fe(t,e,r){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const n=r.metaTokens,s=r.visitor||u,i=r.dots,o=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,y,p){let E=d;if(a.isReactNative(e)&&a.isReactNativeBlob(d))return e.append(Oe(p,y,i),l(d)),!1;if(d&&!p&&typeof d=="object"){if(a.endsWith(y,"{}"))y=n?y:y.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&vr(d)||(a.isFileList(d)||a.endsWith(y,"[]"))&&(E=a.toArray(d)))return y=ot(y),E.forEach(function(C,N){!(a.isUndefined(C)||C===null)&&e.append(o===!0?Oe([y],N,i):o===null?y:y+"[]",l(C))}),!1}return Pe(d)?!0:(e.append(Oe(p,y,i),l(d)),!1)}const h=[],g=Object.assign(Ir,{defaultVisitor:u,convertValue:l,isVisitable:Pe});function R(d,y){if(!a.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(d),a.forEach(d,function(E,D){(!(a.isUndefined(E)||E===null)&&s.call(e,E,a.isString(D)?D.trim():D,y,g))===!0&&R(E,y?y.concat(D):[D])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return R(t),e}function at(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Ne(t,e){this._pairs=[],t&&fe(t,this,e)}const ct=Ne.prototype;ct.append=function(e,r){this._pairs.push([e,r])},ct.toString=function(e){const r=e?function(n){return e.call(this,n,at)}:at;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Br(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ut(t,e,r){if(!e)return t;const n=r&&r.encode||Br,s=a.isFunction(r)?{serialize:r}:r,i=s&&s.serialize;let o;if(i?o=i(e,s):o=a.isURLSearchParams(e)?e.toString():new Ne(e,s).toString(n),o){const c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class lt{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,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){a.forEach(this.handlers,function(n){n!==null&&e(n)})}}const Ue={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},qr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ne,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},xe=typeof window<"u"&&typeof document<"u",De=typeof navigator=="object"&&navigator||void 0,jr=xe&&(!De||["ReactNative","NativeScript","NS"].indexOf(De.product)<0),$r=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Mr=xe&&window.location.href||"http://localhost",A={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:xe,hasStandardBrowserEnv:jr,hasStandardBrowserWebWorkerEnv:$r,navigator:De,origin:Mr},Symbol.toStringTag,{value:"Module"})),...qr};function Hr(t,e){return fe(t,new A.classes.URLSearchParams,{visitor:function(r,n,s,i){return A.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Vr(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Kr(t){const e={},r=Object.keys(t);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],e[i]=t[i];return e}function dt(t){function e(r,n,s,i){let o=r[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=r.length;return o=!o&&a.isArray(s)?s.length:o,f?(a.hasOwnProp(s,o)?s[o]=[s[o],n]:s[o]=n,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),e(r,n,s[o],i)&&a.isArray(s[o])&&(s[o]=Kr(s[o])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const r={};return a.forEachEntry(t,(n,s)=>{e(Vr(n),s,r,0)}),r}return null}function zr(t,e,r){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const ne={transitional:Ue,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=a.isObject(e);if(i&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return s?JSON.stringify(dt(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Hr(e,this.formSerializer).toString();if((c=a.isFileList(e))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return fe(c?{"files[]":e}:e,f&&new f,this.formSerializer)}}return i||s?(r.setContentType("application/json",!1),zr(e)):e}],transformResponse:[function(e){const r=this.transitional||ne.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(n&&!this.responseType||s)){const o=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{ne.headers[t]={}});const Jr=a.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"]),Wr=t=>{const e={};let r,n,s;return t&&t.split(`
|
|
2
|
-
`).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||e[r]&&Jr[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},ft=Symbol("internals");function se(t){return t&&String(t).trim().toLowerCase()}function he(t){return t===!1||t==null?t:a.isArray(t)?t.map(he):String(t)}function Qr(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const Xr=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function
|
|
3
|
-
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(s=>n.set(s)),n}static accessor(e){const n=(this[ft]=this[ft]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=se(o);n[c]||(Gr(s,o),n[c]=!0)}return a.isArray(e)?e.forEach(i):i(e),this}};O.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(O.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}}),a.freezeMethods(O);function Fe(t,e){const r=this||ne,n=e||r,s=O.from(n.headers);let i=n.data;return a.forEach(t,function(c){i=c.call(r,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function ht(t){return!!(t&&t.__CANCEL__)}let ie=class extends m{constructor(e,r,n){super(e??"canceled",m.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function pt(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new m("Request failed with status code "+r.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Zr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function en(t,e){t=t||10;const r=new Array(t),n=new Array(t);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(f){const l=Date.now(),u=n[i];o||(o=l),r[s]=f,n[s]=l;let h=i,g=0;for(;h!==s;)g+=r[h++],h=h%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),l-o<e)return;const R=u&&l-u;return R?Math.round(g*1e3/R):void 0}}function tn(t,e){let r=0,n=1e3/e,s,i;const o=(l,u=Date.now())=>{r=u,s=null,i&&(clearTimeout(i),i=null),t(...l)};return[(...l)=>{const u=Date.now(),h=u-r;h>=n?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},n-h)))},()=>s&&o(s)]}const pe=(t,e,r=3)=>{let n=0;const s=en(50,250);return tn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-n,l=s(f),u=o<=c;n=o;const h={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(h)},r)},yt=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},mt=t=>(...e)=>a.asap(()=>t(...e)),rn=A.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,A.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(A.origin),A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent)):()=>!0,nn=A.hasStandardBrowserEnv?{write(t,e,r,n,s,i,o){if(typeof document>"u")return;const c=[`${t}=${encodeURIComponent(e)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(n)&&c.push(`path=${n}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function sn(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function on(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function gt(t,e,r){let n=!sn(e);return t&&(n||r==!1)?on(t,e):e}const wt=t=>t instanceof O?{...t}:t;function H(t,e){e=e||{};const r={};function n(l,u,h,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,h,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l,h,g)}else return n(l,u,h,g)}function i(l,u){if(!a.isUndefined(u))return n(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function c(l,u,h){if(h in e)return n(l,u);if(h in t)return n(void 0,l)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,h)=>s(wt(l),wt(u),h,!0)};return a.forEach(Object.keys({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=a.hasOwnProp(f,u)?f[u]:s,g=h(t[u],e[u],u);a.isUndefined(g)&&h!==c||(r[u]=g)}),r}const bt=t=>{const e=H({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=e;if(e.headers=o=O.from(o),e.url=ut(gt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(r.getHeaders)){const f=r.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([u,h])=>{l.includes(u.toLowerCase())&&o.set(u,h)})}}if(A.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(e)),n||n!==!1&&rn(e.url))){const f=s&&i&&nn.read(i);f&&o.set(s,f)}return e},an=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){const s=bt(t);let i=s.data;const o=O.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:l}=s,u,h,g,R,d;function y(){R&&R(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function E(){if(!p)return;const C=O.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),v={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:C,config:t,request:p};pt(function(L){r(L),y()},function(L){n(L),y()},v),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(n(new m("Request aborted",m.ECONNABORTED,t,p)),p=null)},p.onerror=function(N){const v=N&&N.message?N.message:"Network Error",z=new m(v,m.ERR_NETWORK,t,p);z.event=N||null,n(z),p=null},p.ontimeout=function(){let N=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const v=s.transitional||Ue;s.timeoutErrorMessage&&(N=s.timeoutErrorMessage),n(new m(N,v.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,p)),p=null},i===void 0&&o.setContentType(null),"setRequestHeader"in p&&a.forEach(o.toJSON(),function(N,v){p.setRequestHeader(v,N)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),l&&([g,d]=pe(l,!0),p.addEventListener("progress",g)),f&&p.upload&&([h,R]=pe(f),p.upload.addEventListener("progress",h),p.upload.addEventListener("loadend",R)),(s.cancelToken||s.signal)&&(u=C=>{p&&(n(!C||C.type?new ie(null,t,p):C),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const D=Zr(s.url);if(D&&A.protocols.indexOf(D)===-1){n(new m("Unsupported protocol "+D+":",m.ERR_BAD_REQUEST,t));return}p.send(i||null)})},cn=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;n.abort(u instanceof m?u:new ie(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,i(new m(`timeout of ${e}ms exceeded`,m.ETIMEDOUT))},e);const c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),t=null)};t.forEach(l=>l.addEventListener("abort",i));const{signal:f}=n;return f.unsubscribe=()=>a.asap(c),f}},un=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let n=0,s;for(;n<r;)s=n+e,yield t.slice(n,s),n=s},ln=async function*(t,e){for await(const r of dn(t))yield*un(r,e)},dn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},_t=(t,e,r,n)=>{const s=ln(t,e);let i=0,o,c=f=>{o||(o=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await s.next();if(l){c(),f.close();return}let h=u.byteLength;if(r){let g=i+=h;r(g)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Et=64*1024,{isFunction:ye}=a,fn=(({Request:t,Response:e})=>({Request:t,Response:e}))(a.global),{ReadableStream:Rt,TextEncoder:Ct}=a.global,St=(t,...e)=>{try{return!!t(...e)}catch{return!1}},hn=t=>{t=a.merge.call({skipUndefined:!0},fn,t);const{fetch:e,Request:r,Response:n}=t,s=e?ye(e):typeof fetch=="function",i=ye(r),o=ye(n);if(!s)return!1;const c=s&&ye(Rt),f=s&&(typeof Ct=="function"?(d=>y=>d.encode(y))(new Ct):async d=>new Uint8Array(await new r(d).arrayBuffer())),l=i&&c&&St(()=>{let d=!1;const y=new r(A.origin,{body:new Rt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!y}),u=o&&c&&St(()=>a.isReadableStream(new n("").body)),h={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(y,p)=>{let E=y&&y[d];if(E)return E.call(y);throw new m(`Response type '${d}' is not supported`,m.ERR_NOT_SUPPORT,p)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new r(A.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},R=async(d,y)=>{const p=a.toFiniteNumber(d.getContentLength());return p??g(y)};return async d=>{let{url:y,method:p,data:E,signal:D,cancelToken:C,timeout:N,onDownloadProgress:v,onUploadProgress:z,responseType:L,headers:Je,withCredentials:Re="same-origin",fetchOptions:jt}=bt(d),$t=e||fetch;L=L?(L+"").toLowerCase():"text";let Ce=cn([D,C&&C.toAbortSignal()],N),ae=null;const J=Ce&&Ce.unsubscribe&&(()=>{Ce.unsubscribe()});let Mt;try{if(z&&l&&p!=="get"&&p!=="head"&&(Mt=await R(Je,E))!==0){let $=new r(y,{method:"POST",body:E,duplex:"half"}),Z;if(a.isFormData(E)&&(Z=$.headers.get("content-type"))&&Je.setContentType(Z),$.body){const[We,Se]=yt(Mt,pe(mt(z)));E=_t($.body,Et,We,Se)}}a.isString(Re)||(Re=Re?"include":"omit");const U=i&&"credentials"in r.prototype,Ht={...jt,signal:Ce,method:p.toUpperCase(),headers:Je.normalize().toJSON(),body:E,duplex:"half",credentials:U?Re:void 0};ae=i&&new r(y,Ht);let j=await(i?$t(ae,jt):$t(y,Ht));const Vt=u&&(L==="stream"||L==="response");if(u&&(v||Vt&&J)){const $={};["status","statusText","headers"].forEach(Kt=>{$[Kt]=j[Kt]});const Z=a.toFiniteNumber(j.headers.get("content-length")),[We,Se]=v&&yt(Z,pe(mt(v),!0))||[];j=new n(_t(j.body,Et,We,()=>{Se&&Se(),J&&J()}),$)}L=L||"text";let Ds=await h[a.findKey(h,L)||"text"](j,d);return!Vt&&J&&J(),await new Promise(($,Z)=>{pt($,Z,{data:Ds,headers:O.from(j.headers),status:j.status,statusText:j.statusText,config:d,request:ae})})}catch(U){throw J&&J(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,d,ae,U&&U.response),{cause:U.cause||U}):m.from(U,U&&U.code,d,ae,U&&U.response)}}},pn=new Map,At=t=>{let e=t&&t.env||{};const{fetch:r,Request:n,Response:s}=e,i=[n,s,r];let o=i.length,c=o,f,l,u=pn;for(;c--;)f=i[c],l=u.get(f),l===void 0&&u.set(f,l=c?new Map:hn(e)),u=l;return l};At();const ke={http:kr,xhr:an,fetch:{get:At}};a.forEach(ke,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Tt=t=>`- ${t}`,yn=t=>a.isFunction(t)||t===null||t===!1;function mn(t,e){t=a.isArray(t)?t:[t];const{length:r}=t;let n,s;const i={};for(let o=0;o<r;o++){n=t[o];let c;if(s=n,!yn(n)&&(s=ke[(c=String(n)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(e))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=r?o.length>1?`since :
|
|
1
|
+
(function(S,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(S=typeof globalThis<"u"?globalThis:S||self,T(S.Fuul={}))})(this,(function(S){"use strict";var Fs=Object.defineProperty;var ks=(S,T,W)=>T in S?Fs(S,T,{enumerable:!0,configurable:!0,writable:!0,value:W}):S[T]=W;var b=(S,T,W)=>ks(S,typeof T!="symbol"?T+"":T,W);const T="/affiliate-portal";class W{constructor(e){b(this,"httpClient");this.httpClient=e.httpClient}async getAffiliateStats(e){return(await this.httpClient.get({path:`${T}/stats`,queryParams:{user_identifier:e.user_identifier,from:e.from,to:e.to,this_month:e.this_month,conversion_id:e.conversion_id,conversion_name:e.conversion_name}})).data}async getAffiliateTotalStats(e){return(await this.httpClient.get({path:`${T}/total-stats`,queryParams:{statuses:e.statuses,regions:e.regions,audiences:e.audiences}})).data}async getAffiliateNewTraders(e){return(await this.httpClient.get({path:`${T}/new-traders`,queryParams:{user_identifier:e.user_identifier,from:e.from,to:e.to,this_month:e.this_month}})).data}}function Qe(t,e){return function(){return t.apply(e,arguments)}}const{toString:Wt}=Object.prototype,{getPrototypeOf:Te}=Object,{iterator:ce,toStringTag:Xe}=Symbol,ue=(t=>e=>{const r=Wt.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),F=t=>(t=t.toLowerCase(),e=>ue(e)===t),le=t=>e=>typeof e===t,{isArray:Q}=Array,X=le("undefined");function ee(t){return t!==null&&!X(t)&&t.constructor!==null&&!X(t.constructor)&&P(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ye=F("ArrayBuffer");function Qt(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Ye(t.buffer),e}const Xt=le("string"),P=le("function"),Ge=le("number"),te=t=>t!==null&&typeof t=="object",Yt=t=>t===!0||t===!1,de=t=>{if(ue(t)!=="object")return!1;const e=Te(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Xe in t)&&!(ce in t)},Gt=t=>{if(!te(t)||ee(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Zt=F("Date"),er=F("File"),tr=t=>!!(t&&typeof t.uri<"u"),rr=t=>t&&typeof t.getParts<"u",nr=F("Blob"),sr=F("FileList"),ir=t=>te(t)&&P(t.pipe);function or(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const Ze=or(),et=typeof Ze.FormData<"u"?Ze.FormData:void 0,ar=t=>{let e;return t&&(et&&t instanceof et||P(t.append)&&((e=ue(t))==="formdata"||e==="object"&&P(t.toString)&&t.toString()==="[object FormData]"))},cr=F("URLSearchParams"),[ur,lr,dr,fr]=["ReadableStream","Request","Response","Headers"].map(F),hr=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function re(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let n,s;if(typeof t!="object"&&(t=[t]),Q(t))for(n=0,s=t.length;n<s;n++)e.call(null,t[n],n,t);else{if(ee(t))return;const i=r?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let c;for(n=0;n<o;n++)c=i[n],e.call(null,t[c],c,t)}}function tt(t,e){if(ee(t))return null;e=e.toLowerCase();const r=Object.keys(t);let n=r.length,s;for(;n-- >0;)if(s=r[n],e===s.toLowerCase())return s;return null}const M=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,rt=t=>!X(t)&&t!==M;function Pe(){const{caseless:t,skipUndefined:e}=rt(this)&&this||{},r={},n=(s,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const o=t&&tt(r,i)||i;de(r[o])&&de(s)?r[o]=Pe(r[o],s):de(s)?r[o]=Pe({},s):Q(s)?r[o]=s.slice():(!e||!X(s))&&(r[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&re(arguments[s],n);return r}const pr=(t,e,r,{allOwnKeys:n}={})=>(re(e,(s,i)=>{r&&P(s)?Object.defineProperty(t,i,{value:Qe(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),t),yr=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),mr=(t,e,r,n)=>{t.prototype=Object.create(e.prototype,n),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},gr=(t,e,r,n)=>{let s,i,o;const c={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)o=s[i],(!n||n(o,t,e))&&!c[o]&&(e[o]=t[o],c[o]=!0);t=r!==!1&&Te(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},wr=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const n=t.indexOf(e,r);return n!==-1&&n===r},br=t=>{if(!t)return null;if(Q(t))return t;let e=t.length;if(!Ge(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},_r=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Te(Uint8Array)),Er=(t,e)=>{const n=(t&&t[ce]).call(t);let s;for(;(s=n.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Rr=(t,e)=>{let r;const n=[];for(;(r=t.exec(e))!==null;)n.push(r);return n},Cr=F("HTMLFormElement"),Sr=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),nt=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),Ar=F("RegExp"),st=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),n={};re(r,(s,i)=>{let o;(o=e(s,i,t))!==!1&&(n[i]=o||s)}),Object.defineProperties(t,n)},Tr=t=>{st(t,(e,r)=>{if(P(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=t[r];if(P(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},Pr=(t,e)=>{const r={},n=s=>{s.forEach(i=>{r[i]=!0})};return Q(t)?n(t):n(String(t).split(e)),r},Or=()=>{},Nr=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function Ur(t){return!!(t&&P(t.append)&&t[Xe]==="FormData"&&t[ce])}const xr=t=>{const e=new Array(10),r=(n,s)=>{if(te(n)){if(e.indexOf(n)>=0)return;if(ee(n))return n;if(!("toJSON"in n)){e[s]=n;const i=Q(n)?[]:{};return re(n,(o,c)=>{const f=r(o,s+1);!X(f)&&(i[c]=f)}),e[s]=void 0,i}}return n};return r(t,0)},Dr=F("AsyncFunction"),Lr=t=>t&&(te(t)||P(t))&&P(t.then)&&P(t.catch),it=((t,e)=>t?setImmediate:e?((r,n)=>(M.addEventListener("message",({source:s,data:i})=>{s===M&&i===r&&n.length&&n.shift()()},!1),s=>{n.push(s),M.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",P(M.postMessage)),Fr=typeof queueMicrotask<"u"?queueMicrotask.bind(M):typeof process<"u"&&process.nextTick||it,a={isArray:Q,isArrayBuffer:Ye,isBuffer:ee,isFormData:ar,isArrayBufferView:Qt,isString:Xt,isNumber:Ge,isBoolean:Yt,isObject:te,isPlainObject:de,isEmptyObject:Gt,isReadableStream:ur,isRequest:lr,isResponse:dr,isHeaders:fr,isUndefined:X,isDate:Zt,isFile:er,isReactNativeBlob:tr,isReactNative:rr,isBlob:nr,isRegExp:Ar,isFunction:P,isStream:ir,isURLSearchParams:cr,isTypedArray:_r,isFileList:sr,forEach:re,merge:Pe,extend:pr,trim:hr,stripBOM:yr,inherits:mr,toFlatObject:gr,kindOf:ue,kindOfTest:F,endsWith:wr,toArray:br,forEachEntry:Er,matchAll:Rr,isHTMLForm:Cr,hasOwnProperty:nt,hasOwnProp:nt,reduceDescriptors:st,freezeMethods:Tr,toObjectSet:Pr,toCamelCase:Sr,noop:Or,toFiniteNumber:Nr,findKey:tt,global:M,isContextDefined:rt,isSpecCompliantForm:Ur,toJSONObject:xr,isAsyncFn:Dr,isThenable:Lr,setImmediate:it,asap:Fr,isIterable:t=>t!=null&&P(t[ce])};let m=class zt extends Error{static from(e,r,n,s,i,o){const c=new zt(e.message,r||e.code,n,s,i);return c.cause=e,c.name=e.name,e.status!=null&&c.status==null&&(c.status=e.status),o&&Object.assign(c,o),c}constructor(e,r,n,s,i){super(e),Object.defineProperty(this,"message",{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),i&&(this.response=i,this.status=i.status)}toJSON(){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:a.toJSONObject(this.config),code:this.code,status:this.status}}};m.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",m.ERR_BAD_OPTION="ERR_BAD_OPTION",m.ECONNABORTED="ECONNABORTED",m.ETIMEDOUT="ETIMEDOUT",m.ERR_NETWORK="ERR_NETWORK",m.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",m.ERR_DEPRECATED="ERR_DEPRECATED",m.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",m.ERR_BAD_REQUEST="ERR_BAD_REQUEST",m.ERR_CANCELED="ERR_CANCELED",m.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",m.ERR_INVALID_URL="ERR_INVALID_URL";const kr=null;function Oe(t){return a.isPlainObject(t)||a.isArray(t)}function ot(t){return a.endsWith(t,"[]")?t.slice(0,-2):t}function Ne(t,e,r){return t?t.concat(e).map(function(s,i){return s=ot(s),!r&&i?"["+s+"]":s}).join(r?".":""):e}function vr(t){return a.isArray(t)&&!t.some(Oe)}const Ir=a.toFlatObject(a,{},null,function(e){return/^is[A-Z]/.test(e)});function fe(t,e,r){if(!a.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=a.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,p){return!a.isUndefined(p[y])});const n=r.metaTokens,s=r.visitor||u,i=r.dots,o=r.indexes,f=(r.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(e);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(a.isDate(d))return d.toISOString();if(a.isBoolean(d))return d.toString();if(!f&&a.isBlob(d))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(d)||a.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,y,p){let E=d;if(a.isReactNative(e)&&a.isReactNativeBlob(d))return e.append(Ne(p,y,i),l(d)),!1;if(d&&!p&&typeof d=="object"){if(a.endsWith(y,"{}"))y=n?y:y.slice(0,-2),d=JSON.stringify(d);else if(a.isArray(d)&&vr(d)||(a.isFileList(d)||a.endsWith(y,"[]"))&&(E=a.toArray(d)))return y=ot(y),E.forEach(function(C,N){!(a.isUndefined(C)||C===null)&&e.append(o===!0?Ne([y],N,i):o===null?y:y+"[]",l(C))}),!1}return Oe(d)?!0:(e.append(Ne(p,y,i),l(d)),!1)}const h=[],g=Object.assign(Ir,{defaultVisitor:u,convertValue:l,isVisitable:Oe});function R(d,y){if(!a.isUndefined(d)){if(h.indexOf(d)!==-1)throw Error("Circular reference detected in "+y.join("."));h.push(d),a.forEach(d,function(E,D){(!(a.isUndefined(E)||E===null)&&s.call(e,E,a.isString(D)?D.trim():D,y,g))===!0&&R(E,y?y.concat(D):[D])}),h.pop()}}if(!a.isObject(t))throw new TypeError("data must be an object");return R(t),e}function at(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Ue(t,e){this._pairs=[],t&&fe(t,this,e)}const ct=Ue.prototype;ct.append=function(e,r){this._pairs.push([e,r])},ct.toString=function(e){const r=e?function(n){return e.call(this,n,at)}:at;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Br(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function ut(t,e,r){if(!e)return t;const n=r&&r.encode||Br,s=a.isFunction(r)?{serialize:r}:r,i=s&&s.serialize;let o;if(i?o=i(e,s):o=a.isURLSearchParams(e)?e.toString():new Ue(e,s).toString(n),o){const c=t.indexOf("#");c!==-1&&(t=t.slice(0,c)),t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class lt{constructor(){this.handlers=[]}use(e,r,n){return this.handlers.push({fulfilled:e,rejected:r,synchronous:n?n.synchronous:!1,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){a.forEach(this.handlers,function(n){n!==null&&e(n)})}}const xe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},qr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ue,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},De=typeof window<"u"&&typeof document<"u",Le=typeof navigator=="object"&&navigator||void 0,jr=De&&(!Le||["ReactNative","NativeScript","NS"].indexOf(Le.product)<0),$r=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Mr=De&&window.location.href||"http://localhost",A={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:De,hasStandardBrowserEnv:jr,hasStandardBrowserWebWorkerEnv:$r,navigator:Le,origin:Mr},Symbol.toStringTag,{value:"Module"})),...qr};function Hr(t,e){return fe(t,new A.classes.URLSearchParams,{visitor:function(r,n,s,i){return A.isNode&&a.isBuffer(r)?(this.append(n,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function Vr(t){return a.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Kr(t){const e={},r=Object.keys(t);let n;const s=r.length;let i;for(n=0;n<s;n++)i=r[n],e[i]=t[i];return e}function dt(t){function e(r,n,s,i){let o=r[i++];if(o==="__proto__")return!0;const c=Number.isFinite(+o),f=i>=r.length;return o=!o&&a.isArray(s)?s.length:o,f?(a.hasOwnProp(s,o)?s[o]=[s[o],n]:s[o]=n,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),e(r,n,s[o],i)&&a.isArray(s[o])&&(s[o]=Kr(s[o])),!c)}if(a.isFormData(t)&&a.isFunction(t.entries)){const r={};return a.forEachEntry(t,(n,s)=>{e(Vr(n),s,r,0)}),r}return null}function zr(t,e,r){if(a.isString(t))try{return(e||JSON.parse)(t),a.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}const ne={transitional:xe,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,i=a.isObject(e);if(i&&a.isHTMLForm(e)&&(e=new FormData(e)),a.isFormData(e))return s?JSON.stringify(dt(e)):e;if(a.isArrayBuffer(e)||a.isBuffer(e)||a.isStream(e)||a.isFile(e)||a.isBlob(e)||a.isReadableStream(e))return e;if(a.isArrayBufferView(e))return e.buffer;if(a.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let c;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Hr(e,this.formSerializer).toString();if((c=a.isFileList(e))||n.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return fe(c?{"files[]":e}:e,f&&new f,this.formSerializer)}}return i||s?(r.setContentType("application/json",!1),zr(e)):e}],transformResponse:[function(e){const r=this.transitional||ne.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(e)||a.isReadableStream(e))return e;if(e&&a.isString(e)&&(n&&!this.responseType||s)){const o=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:A.classes.FormData,Blob:A.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],t=>{ne.headers[t]={}});const Jr=a.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"]),Wr=t=>{const e={};let r,n,s;return t&&t.split(`
|
|
2
|
+
`).forEach(function(o){s=o.indexOf(":"),r=o.substring(0,s).trim().toLowerCase(),n=o.substring(s+1).trim(),!(!r||e[r]&&Jr[r])&&(r==="set-cookie"?e[r]?e[r].push(n):e[r]=[n]:e[r]=e[r]?e[r]+", "+n:n)}),e},ft=Symbol("internals");function se(t){return t&&String(t).trim().toLowerCase()}function he(t){return t===!1||t==null?t:a.isArray(t)?t.map(he):String(t)}function Qr(t){const e=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(t);)e[n[1]]=n[2];return e}const Xr=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Fe(t,e,r,n,s){if(a.isFunction(n))return n.call(this,e,r);if(s&&(e=r),!!a.isString(e)){if(a.isString(n))return e.indexOf(n)!==-1;if(a.isRegExp(n))return n.test(e)}}function Yr(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,n)=>r.toUpperCase()+n)}function Gr(t,e){const r=a.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+r,{value:function(s,i,o){return this[n].call(this,e,s,i,o)},configurable:!0})})}let O=class{constructor(e){e&&this.set(e)}set(e,r,n){const s=this;function i(c,f,l){const u=se(f);if(!u)throw new Error("header name must be a non-empty string");const h=a.findKey(s,u);(!h||s[h]===void 0||l===!0||l===void 0&&s[h]!==!1)&&(s[h||f]=he(c))}const o=(c,f)=>a.forEach(c,(l,u)=>i(l,u,f));if(a.isPlainObject(e)||e instanceof this.constructor)o(e,r);else if(a.isString(e)&&(e=e.trim())&&!Xr(e))o(Wr(e),r);else if(a.isObject(e)&&a.isIterable(e)){let c={},f,l;for(const u of e){if(!a.isArray(u))throw TypeError("Object iterator must return a key-value pair");c[l=u[0]]=(f=c[l])?a.isArray(f)?[...f,u[1]]:[f,u[1]]:u[1]}o(c,r)}else e!=null&&i(r,e,n);return this}get(e,r){if(e=se(e),e){const n=a.findKey(this,e);if(n){const s=this[n];if(!r)return s;if(r===!0)return Qr(s);if(a.isFunction(r))return r.call(this,s,n);if(a.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=se(e),e){const n=a.findKey(this,e);return!!(n&&this[n]!==void 0&&(!r||Fe(this,this[n],n,r)))}return!1}delete(e,r){const n=this;let s=!1;function i(o){if(o=se(o),o){const c=a.findKey(n,o);c&&(!r||Fe(n,n[c],c,r))&&(delete n[c],s=!0)}}return a.isArray(e)?e.forEach(i):i(e),s}clear(e){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const i=r[n];(!e||Fe(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const r=this,n={};return a.forEach(this,(s,i)=>{const o=a.findKey(n,i);if(o){r[o]=he(s),delete r[i];return}const c=e?Yr(i):String(i).trim();c!==i&&delete r[i],r[c]=he(s),n[c]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return a.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=e&&a.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const n=new this(e);return r.forEach(s=>n.set(s)),n}static accessor(e){const n=(this[ft]=this[ft]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=se(o);n[c]||(Gr(s,o),n[c]=!0)}return a.isArray(e)?e.forEach(i):i(e),this}};O.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(O.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[r]=n}}}),a.freezeMethods(O);function ke(t,e){const r=this||ne,n=e||r,s=O.from(n.headers);let i=n.data;return a.forEach(t,function(c){i=c.call(r,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function ht(t){return!!(t&&t.__CANCEL__)}let ie=class extends m{constructor(e,r,n){super(e??"canceled",m.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function pt(t,e,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?t(r):e(new m("Request failed with status code "+r.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Zr(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function en(t,e){t=t||10;const r=new Array(t),n=new Array(t);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(f){const l=Date.now(),u=n[i];o||(o=l),r[s]=f,n[s]=l;let h=i,g=0;for(;h!==s;)g+=r[h++],h=h%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),l-o<e)return;const R=u&&l-u;return R?Math.round(g*1e3/R):void 0}}function tn(t,e){let r=0,n=1e3/e,s,i;const o=(l,u=Date.now())=>{r=u,s=null,i&&(clearTimeout(i),i=null),t(...l)};return[(...l)=>{const u=Date.now(),h=u-r;h>=n?o(l,u):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},n-h)))},()=>s&&o(s)]}const pe=(t,e,r=3)=>{let n=0;const s=en(50,250);return tn(i=>{const o=i.loaded,c=i.lengthComputable?i.total:void 0,f=o-n,l=s(f),u=o<=c;n=o;const h={loaded:o,total:c,progress:c?o/c:void 0,bytes:f,rate:l||void 0,estimated:l&&c&&u?(c-o)/l:void 0,event:i,lengthComputable:c!=null,[e?"download":"upload"]:!0};t(h)},r)},yt=(t,e)=>{const r=t!=null;return[n=>e[0]({lengthComputable:r,total:t,loaded:n}),e[1]]},mt=t=>(...e)=>a.asap(()=>t(...e)),rn=A.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,A.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(A.origin),A.navigator&&/(msie|trident)/i.test(A.navigator.userAgent)):()=>!0,nn=A.hasStandardBrowserEnv?{write(t,e,r,n,s,i,o){if(typeof document>"u")return;const c=[`${t}=${encodeURIComponent(e)}`];a.isNumber(r)&&c.push(`expires=${new Date(r).toUTCString()}`),a.isString(n)&&c.push(`path=${n}`),a.isString(s)&&c.push(`domain=${s}`),i===!0&&c.push("secure"),a.isString(o)&&c.push(`SameSite=${o}`),document.cookie=c.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function sn(t){return typeof t!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function on(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function gt(t,e,r){let n=!sn(e);return t&&(n||r==!1)?on(t,e):e}const wt=t=>t instanceof O?{...t}:t;function H(t,e){e=e||{};const r={};function n(l,u,h,g){return a.isPlainObject(l)&&a.isPlainObject(u)?a.merge.call({caseless:g},l,u):a.isPlainObject(u)?a.merge({},u):a.isArray(u)?u.slice():u}function s(l,u,h,g){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l,h,g)}else return n(l,u,h,g)}function i(l,u){if(!a.isUndefined(u))return n(void 0,u)}function o(l,u){if(a.isUndefined(u)){if(!a.isUndefined(l))return n(void 0,l)}else return n(void 0,u)}function c(l,u,h){if(h in e)return n(l,u);if(h in t)return n(void 0,l)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:c,headers:(l,u,h)=>s(wt(l),wt(u),h,!0)};return a.forEach(Object.keys({...t,...e}),function(u){if(u==="__proto__"||u==="constructor"||u==="prototype")return;const h=a.hasOwnProp(f,u)?f[u]:s,g=h(t[u],e[u],u);a.isUndefined(g)&&h!==c||(r[u]=g)}),r}const bt=t=>{const e=H({},t);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:c}=e;if(e.headers=o=O.from(o),e.url=ut(gt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),c&&o.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(r)){if(A.hasStandardBrowserEnv||A.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(a.isFunction(r.getHeaders)){const f=r.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([u,h])=>{l.includes(u.toLowerCase())&&o.set(u,h)})}}if(A.hasStandardBrowserEnv&&(n&&a.isFunction(n)&&(n=n(e)),n||n!==!1&&rn(e.url))){const f=s&&i&&nn.read(i);f&&o.set(s,f)}return e},an=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(r,n){const s=bt(t);let i=s.data;const o=O.from(s.headers).normalize();let{responseType:c,onUploadProgress:f,onDownloadProgress:l}=s,u,h,g,R,d;function y(){R&&R(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function E(){if(!p)return;const C=O.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),v={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:C,config:t,request:p};pt(function(L){r(L),y()},function(L){n(L),y()},v),p=null}"onloadend"in p?p.onloadend=E:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(E)},p.onabort=function(){p&&(n(new m("Request aborted",m.ECONNABORTED,t,p)),p=null)},p.onerror=function(N){const v=N&&N.message?N.message:"Network Error",z=new m(v,m.ERR_NETWORK,t,p);z.event=N||null,n(z),p=null},p.ontimeout=function(){let N=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const v=s.transitional||xe;s.timeoutErrorMessage&&(N=s.timeoutErrorMessage),n(new m(N,v.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,t,p)),p=null},i===void 0&&o.setContentType(null),"setRequestHeader"in p&&a.forEach(o.toJSON(),function(N,v){p.setRequestHeader(v,N)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),l&&([g,d]=pe(l,!0),p.addEventListener("progress",g)),f&&p.upload&&([h,R]=pe(f),p.upload.addEventListener("progress",h),p.upload.addEventListener("loadend",R)),(s.cancelToken||s.signal)&&(u=C=>{p&&(n(!C||C.type?new ie(null,t,p):C),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const D=Zr(s.url);if(D&&A.protocols.indexOf(D)===-1){n(new m("Unsupported protocol "+D+":",m.ERR_BAD_REQUEST,t));return}p.send(i||null)})},cn=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let n=new AbortController,s;const i=function(l){if(!s){s=!0,c();const u=l instanceof Error?l:this.reason;n.abort(u instanceof m?u:new ie(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,i(new m(`timeout of ${e}ms exceeded`,m.ETIMEDOUT))},e);const c=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),t=null)};t.forEach(l=>l.addEventListener("abort",i));const{signal:f}=n;return f.unsubscribe=()=>a.asap(c),f}},un=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let n=0,s;for(;n<r;)s=n+e,yield t.slice(n,s),n=s},ln=async function*(t,e){for await(const r of dn(t))yield*un(r,e)},dn=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:n}=await e.read();if(r)break;yield n}}finally{await e.cancel()}},_t=(t,e,r,n)=>{const s=ln(t,e);let i=0,o,c=f=>{o||(o=!0,n&&n(f))};return new ReadableStream({async pull(f){try{const{done:l,value:u}=await s.next();if(l){c(),f.close();return}let h=u.byteLength;if(r){let g=i+=h;r(g)}f.enqueue(new Uint8Array(u))}catch(l){throw c(l),l}},cancel(f){return c(f),s.return()}},{highWaterMark:2})},Et=64*1024,{isFunction:ye}=a,fn=(({Request:t,Response:e})=>({Request:t,Response:e}))(a.global),{ReadableStream:Rt,TextEncoder:Ct}=a.global,St=(t,...e)=>{try{return!!t(...e)}catch{return!1}},hn=t=>{t=a.merge.call({skipUndefined:!0},fn,t);const{fetch:e,Request:r,Response:n}=t,s=e?ye(e):typeof fetch=="function",i=ye(r),o=ye(n);if(!s)return!1;const c=s&&ye(Rt),f=s&&(typeof Ct=="function"?(d=>y=>d.encode(y))(new Ct):async d=>new Uint8Array(await new r(d).arrayBuffer())),l=i&&c&&St(()=>{let d=!1;const y=new r(A.origin,{body:new Rt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!y}),u=o&&c&&St(()=>a.isReadableStream(new n("").body)),h={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(y,p)=>{let E=y&&y[d];if(E)return E.call(y);throw new m(`Response type '${d}' is not supported`,m.ERR_NOT_SUPPORT,p)})});const g=async d=>{if(d==null)return 0;if(a.isBlob(d))return d.size;if(a.isSpecCompliantForm(d))return(await new r(A.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(a.isArrayBufferView(d)||a.isArrayBuffer(d))return d.byteLength;if(a.isURLSearchParams(d)&&(d=d+""),a.isString(d))return(await f(d)).byteLength},R=async(d,y)=>{const p=a.toFiniteNumber(d.getContentLength());return p??g(y)};return async d=>{let{url:y,method:p,data:E,signal:D,cancelToken:C,timeout:N,onDownloadProgress:v,onUploadProgress:z,responseType:L,headers:Je,withCredentials:Ce="same-origin",fetchOptions:jt}=bt(d),$t=e||fetch;L=L?(L+"").toLowerCase():"text";let Se=cn([D,C&&C.toAbortSignal()],N),ae=null;const J=Se&&Se.unsubscribe&&(()=>{Se.unsubscribe()});let Mt;try{if(z&&l&&p!=="get"&&p!=="head"&&(Mt=await R(Je,E))!==0){let $=new r(y,{method:"POST",body:E,duplex:"half"}),Z;if(a.isFormData(E)&&(Z=$.headers.get("content-type"))&&Je.setContentType(Z),$.body){const[We,Ae]=yt(Mt,pe(mt(z)));E=_t($.body,Et,We,Ae)}}a.isString(Ce)||(Ce=Ce?"include":"omit");const U=i&&"credentials"in r.prototype,Ht={...jt,signal:Se,method:p.toUpperCase(),headers:Je.normalize().toJSON(),body:E,duplex:"half",credentials:U?Ce:void 0};ae=i&&new r(y,Ht);let j=await(i?$t(ae,jt):$t(y,Ht));const Vt=u&&(L==="stream"||L==="response");if(u&&(v||Vt&&J)){const $={};["status","statusText","headers"].forEach(Kt=>{$[Kt]=j[Kt]});const Z=a.toFiniteNumber(j.headers.get("content-length")),[We,Ae]=v&&yt(Z,pe(mt(v),!0))||[];j=new n(_t(j.body,Et,We,()=>{Ae&&Ae(),J&&J()}),$)}L=L||"text";let Ls=await h[a.findKey(h,L)||"text"](j,d);return!Vt&&J&&J(),await new Promise(($,Z)=>{pt($,Z,{data:Ls,headers:O.from(j.headers),status:j.status,statusText:j.statusText,config:d,request:ae})})}catch(U){throw J&&J(),U&&U.name==="TypeError"&&/Load failed|fetch/i.test(U.message)?Object.assign(new m("Network Error",m.ERR_NETWORK,d,ae,U&&U.response),{cause:U.cause||U}):m.from(U,U&&U.code,d,ae,U&&U.response)}}},pn=new Map,At=t=>{let e=t&&t.env||{};const{fetch:r,Request:n,Response:s}=e,i=[n,s,r];let o=i.length,c=o,f,l,u=pn;for(;c--;)f=i[c],l=u.get(f),l===void 0&&u.set(f,l=c?new Map:hn(e)),u=l;return l};At();const ve={http:kr,xhr:an,fetch:{get:At}};a.forEach(ve,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const Tt=t=>`- ${t}`,yn=t=>a.isFunction(t)||t===null||t===!1;function mn(t,e){t=a.isArray(t)?t:[t];const{length:r}=t;let n,s;const i={};for(let o=0;o<r;o++){n=t[o];let c;if(s=n,!yn(n)&&(s=ve[(c=String(n)).toLowerCase()],s===void 0))throw new m(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(e))))break;i[c||"#"+o]=s}if(!s){const o=Object.entries(i).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let c=r?o.length>1?`since :
|
|
4
4
|
`+o.map(Tt).join(`
|
|
5
|
-
`):" "+Tt(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Pt={getAdapter:mn,adapters:
|
|
6
|
-
`+i):n.stack=i}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=H(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&ge.assertOptions(n,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean),legacyInterceptorReqResOrdering:x.transitional(x.boolean)},!1),s!=null&&(a.isFunction(s)?r.paramsSerializer={serialize:s}:ge.assertOptions(s,{encode:x.function,serialize:x.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ge.assertOptions(r,{baseUrl:x.spelling("baseURL"),withXsrfToken:x.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[r.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=O.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(r)===!1)return;f=f&&y.synchronous;const p=r.transitional||Ue;p&&p.legacyInterceptorReqResOrdering?c.unshift(y.fulfilled,y.rejected):c.push(y.fulfilled,y.rejected)});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let u,h=0,g;if(!f){const d=[Ot.bind(this),void 0];for(d.unshift(...c),d.push(...l),g=d.length,u=Promise.resolve(r);h<g;)u=u.then(d[h++],d[h++]);return u}g=c.length;let R=r;for(;h<g;){const d=c[h++],y=c[h++];try{R=d(R)}catch(p){y.call(this,p);break}}try{u=Ot.call(this,R)}catch(d){return Promise.reject(d)}for(h=0,g=l.length;h<g;)u=u.then(l[h++],l[h++]);return u}getUri(e){e=H(this.defaults,e);const r=gt(e.baseURL,e.url,e.allowAbsoluteUrls);return ut(r,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){V.prototype[e]=function(r,n){return this.request(H(n||{},{method:e,url:r,data:(n||{}).data}))}}),a.forEach(["post","put","patch"],function(e){function r(n){return function(i,o,c){return this.request(H(c||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}V.prototype[e]=r(),V.prototype[e+"Form"]=r(!0)});let wn=class Jt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{n.subscribe(c),i=c}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,c){n.reason||(n.reason=new ie(i,o,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Jt(function(s){e=s}),cancel:e}}};function bn(t){return function(r){return t.apply(null,r)}}function _n(t){return a.isObject(t)&&t.isAxiosError===!0}const Ie={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ie).forEach(([t,e])=>{Ie[e]=t});function xt(t){const e=new V(t),r=Qe(V.prototype.request,e);return a.extend(r,V.prototype,e,{allOwnKeys:!0}),a.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return xt(H(t,s))},r}const _=xt(ne);_.Axios=V,_.CanceledError=ie,_.CancelToken=wn,_.isCancel=ht,_.VERSION=Nt,_.toFormData=fe,_.AxiosError=m,_.Cancel=_.CanceledError,_.all=function(e){return Promise.all(e)},_.spread=bn,_.isAxiosError=_n,_.mergeConfig=H,_.AxiosHeaders=O,_.formToJSON=t=>dt(a.isHTMLForm(t)?new FormData(t):t),_.getAdapter=Pt.getAdapter,_.HttpStatusCode=Ie,_.default=_;const{Axios:$s,AxiosError:we,CanceledError:Ms,isCancel:Hs,CancelToken:Vs,VERSION:Ks,all:zs,Cancel:Js,isAxiosError:Ws,spread:Qs,toFormData:Xs,AxiosHeaders:Ys,HttpStatusCode:Gs,formToJSON:Zs,getAdapter:ei,mergeConfig:ti}=_;class be extends Error{constructor(r){super(r.join(", "));b(this,"errors");this.name="ValidationError",this.errors=r}}class Be extends Error{constructor(r){super("Address already registered.");b(this,"address");this.name="AddressInUseError",this.address=r}}class qe extends Error{constructor(r){super("Code already registered.");b(this,"code");this.name="CodeInUseError",this.code=r}}class _e extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class En{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async create(e,r,n,s,i,o,c){var f;try{return(await this.httpClient.post({path:"/affiliates",postData:{address:e,identifier_type:r,name:n,code:n,signature:s,signature_public_key:i,account_chain_id:o,user_rebate_rate:c}})).data}catch(l){if(l instanceof we){const u=(f=l.response)==null?void 0:f.data;if(typeof(u==null?void 0:u.message)=="string"){const h=u.message.toLowerCase();throw h=="invalid signature"?new _e:h=="address in use"?new Be(e):h=="code in use"?new qe(n):new Error(h)}else if((u==null?void 0:u.message)instanceof Array)throw new be(u.message)}throw l}}async update(e,r,n,s,i,o){var c;try{await this.httpClient.post({path:`/affiliates/${e}`,postData:{code:n,user_identifier:e,identifier_type:r,signature:s,signature_public_key:i,account_chain_id:o}})}catch(f){if(f instanceof we){const l=(c=f.response)==null?void 0:c.data;if(typeof(l==null?void 0:l.message)=="string"){const u=l.message.toLowerCase();throw u=="invalid signature"?new _e:u=="address in use"?new Be(e):u=="code in use"?new qe(n):new Error(u)}else if((l==null?void 0:l.message)instanceof Array)throw new be(l.message)}throw f}}async updateRebateRate(e,r,n,s,i,o,c,f){var l;try{await this.httpClient.post({path:`/affiliates/${e}/rebate-rate`,postData:{identifier_type:r,code:n,signature:s,signature_public_key:o,account_chain_id:c,source_project_id:f,rebate_rate:i}})}catch(u){if(u instanceof we){const h=(l=u.response)==null?void 0:l.data;if(typeof(h==null?void 0:h.message)=="string"){const g=h.message.toLowerCase();throw g=="invalid signature"?new _e:new Error(g)}else if((h==null?void 0:h.message)instanceof Array)throw new be(h.message)}throw u}}async isCodeFree(e){try{return(await this.httpClient.get({path:`/affiliates/codes/${e}`})).data.free}catch(r){throw console.error("Fuul SDK: Could not check affiliate code",r),r}}async isCodeAvailable(e){try{return(await this.httpClient.get({path:`/affiliates/codes/${e}/availability`})).data.available}catch(r){throw console.error("Fuul SDK: Could not check affiliate code availability",r),r}}async getCode(e,r){var n;try{return(await this.httpClient.get({path:`/affiliates/${e}`,queryParams:{identifier_type:r}})).data}catch(s){if(s instanceof we&&((n=s.response)==null?void 0:n.status)===404)return null;throw console.error("Fuul SDK: Could not get affiliate code",s),s}}}const Rn="/audiences";class Cn{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getUserAudiences(e){return(await this.httpClient.get({path:`${Rn}/audience-segments/user`,queryParams:{...e}})).data}}const Dt="/claim-checks";class Sn{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getClaimableChecks(e){return(await this.httpClient.post({path:`${Dt}/claim`,postData:{userIdentifier:e.user_identifier,userIdentifierType:e.user_identifier_type}})).data}async getClaimCheckTotals(e){return(await this.httpClient.get({path:`${Dt}/totals`,queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}}class An{constructor(e){b(this,"httpClient");this.httpClient=e.httpClient}async getAll(e){const{data:r}=await this.httpClient.get({path:"conversions",queryParams:{...e}});return r}}const Lt="fuul.sent",Tn=60,Pn="connect_wallet",Ft=10;class On{constructor(e){b(this,"debug");b(this,"httpClient");this.httpClient=e.httpClient,this.debug=!!e.debug}async sendEvent(e,r){if(this.isDuplicate(e)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}if(!r||!Array.isArray(r)||r.length===0)await this.httpClient.post({path:"events",postData:e});else for(const n of r){const s=structuredClone({...e,project_id:n});s.metadata.project_id=n,await this.httpClient.post({path:"events",postData:s,queryParams:{project_id:n}})}this.debug&&console.debug(`Fuul SDK: Sent '${e.name}' event`),this.saveSentEvent(e)}isDuplicate(e){var u,h,g,R;const r=`${Lt}_${e.name}`,n=localStorage.getItem(r);if(!n)return!1;const s=JSON.parse(n);if(this.getCurrentTimestamp()-s.timestamp>Tn)return!1;let f=!1;e.metadata&&(f=s.metadata.tracking_id===e.metadata.tracking_id&&s.metadata.project_id===e.metadata.project_id&&s.metadata.referrer===e.metadata.referrer&&s.metadata.source===e.metadata.source&&s.metadata.category===e.metadata.category&&s.metadata.title===e.metadata.title&&s.metadata.tag===e.metadata.tag&&s.user_address===e.user_address&&((u=s.user)==null?void 0:u.identifier)===((h=e.user)==null?void 0:h.identifier)&&((g=s.user)==null?void 0:g.identifier_type)===((R=e.user)==null?void 0:R.identifier_type)&&s.signature===e.signature&&s.signature_message===e.signature_message);let l=!1;return e.args&&s.args&&(l=s.args.page===e.args.page),l&&f}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(e){var o,c,f,l;const r=`${Lt}_${e.name}`,n=`${r}_all`,s=this.getCurrentTimestamp(),i={...e,timestamp:s};if(localStorage.setItem(r,JSON.stringify(i)),e.name===Pn){const u=JSON.parse(localStorage.getItem(n)||"[]"),h={name:e.name,user:{identifier:(o=e.user)==null?void 0:o.identifier,identifier_type:(c=e.user)==null?void 0:c.identifier_type},tracking_id:(f=e.metadata)==null?void 0:f.tracking_id,page:(l=e.args)==null?void 0:l.page};"user_address"in e&&(h.user_address=e.user_address);const g=[...u,h];g.length>Ft&&g.splice(0,g.length-Ft),localStorage.setItem(n,JSON.stringify(g))}}}const Nn={version:"0.0.0"};class Un{constructor(e){b(this,"client");b(this,"defaultQueryParams");this.client=_.create({...e,headers:{Authorization:`Bearer ${e.apiKey}`,"X-Fuul-Sdk-Version":Nn.version}}),this.defaultQueryParams=e.queryParams||{}}makeQueryParams(e){return Object.assign({},this.defaultQueryParams||{},e||{})}async get(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),method:"GET"})}async post(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"POST"})}async put(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"PUT"})}async patch(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"PATCH"})}async delete(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"DELETE"})}}class xn{constructor(e){b(this,"httpClient");this.httpClient=e.httpClient}async getPayoutsLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,user_identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/payouts",queryParams:i})).data}async getPointsLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,user_identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/points",queryParams:i})).data}async getVolumeLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/volume",queryParams:i})).data}async getReferredUsersLeaderboard(e){return(await this.httpClient.get({path:"/leaderboard/referred",queryParams:{...e}})).data}async getReferredVolume(e){const{user_identifiers:r,...n}=e;return(await this.httpClient.get({path:"/payouts/leaderboard/referred-volume",queryParams:{...n,user_identifiers:r.join(",")}})).data}async getRevenueLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/revenue",queryParams:i})).data}}const oe="/payouts";class Dn{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getUserPayoutsByConversion(e){return(await this.httpClient.get({path:oe,queryParams:{...e,type:"onchain-currency"}})).data}async getUserPointsByConversion(e){return(await this.httpClient.get({path:oe,queryParams:{...e,type:"point"}})).data}async getUserPayoutMovements(e){return(await this.httpClient.get({path:`${oe}/movements`,queryParams:{...e,type:"onchain-currency"}})).data}async getUserPointsMovements(e){return(await this.httpClient.get({path:`${oe}/movements`,queryParams:{...e,type:"point"}})).data}async getPayoutsByReferrer(e){return(await this.httpClient.get({path:`${oe}/by-referrer`,queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}}class Ln{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async listUserReferralCodes(e){return(await this.httpClient.get({path:"/referral_codes",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type,page:e.page,page_size:e.page_size}})).data}async generateReferralCodes(e){return(await this.httpClient.post({path:"/referral_codes",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type,quantity:e.quantity,max_uses:e.max_uses}})).data}async getReferralStatus(e){return(await this.httpClient.get({path:"/referral_codes/status",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}async getReferralCode(e){return(await this.httpClient.get({path:`/referral_codes/${e.code}`})).data}async useReferralCode(e){const{code:r,user_identifier:n,user_identifier_type:s,signature:i,signature_message:o,chain_id:c}=e;await this.httpClient.patch({path:`/referral_codes/${r}/use`,queryParams:{user_identifier:n,user_identifier_type:s},postData:{signature:i,signature_message:o,chain_id:c}})}async updateReferralCode(e){await this.httpClient.patch({path:`/referral_codes/${e.code}`,postData:{max_uses:e.max_uses}})}async deleteReferral(e){const{code:r,user_identifier:n,user_identifier_type:s,referrer_identifier:i,referrer_identifier_type:o,signature:c,signature_message:f,chain_id:l}=e;await this.httpClient.delete({path:`/referral_codes/${r}/referrals`,queryParams:{user_identifier:n,user_identifier_type:s,referrer_identifier:i,referrer_identifier_type:o},postData:{signature:c,signature_message:f,chain_id:l}})}}const Fn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let kn=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Fn[r[t]&63];return e};const vn="fuul.tracking_id",je=()=>Mn(vn,()=>kn()),kt=()=>Y("af")||Y("referrer"),In=()=>document.referrer,Bn=()=>Hn(),qn=()=>Y("category"),jn=()=>Y("title"),$n=()=>Y("tag"),Mn=(t,e)=>{const r=localStorage.getItem(t);if(r)return r;{const n=e();return n?localStorage.setItem(t,n):localStorage.removeItem(t),n}},Y=t=>new URLSearchParams(window.location.search).get(t),Hn=()=>{const t=Y("source");if(t)return t},Vn="/user";class Kn{constructor(e){b(this,"httpClient");this.httpClient=e.httpClient}async getUserReferrer(e){return(await this.httpClient.get({path:`${Vn}/referrer`,queryParams:{...e}})).data}}const zn="https://api.fuul.xyz/api/v1/";let I=!1,$e=!1,Me,k,vt,It,B,He,Ee,G,Bt,K,q,Ve;function Jn(t){I=!!t.debug,!$e&&(Me=t.apiKey,Ns(),k=Us(t.baseApiUrl??zn,t.defaultQueryParams??{}),vt=new An({httpClient:k,debug:I}),Ee=new On({httpClient:k,debug:I}),B=new En({httpClient:k,debug:I}),He=new W({httpClient:k}),G=new Dn({httpClient:k,debug:I}),It=new Kn({httpClient:k}),Bt=new Cn({httpClient:k,debug:I}),K=new xn({httpClient:k}),q=new Ln({httpClient:k,debug:I}),Ve=new Sn({httpClient:k,debug:I}),$e=!0,I&&console.debug("Fuul SDK: init() complete"))}function w(){if(!$e)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Wn(t,e){w(),Ke(),ze();const r={name:t,args:e??{},metadata:{tracking_id:je()}};await Ee.sendEvent(r)}async function Qn(t,e){w(),Ke(),ze();const r={name:"pageview",args:{page:t??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:je(),referrer_url:In(),source:Bn(),affiliate_id:kt()??void 0,referrer:kt()??void 0,category:qn()??void 0,title:jn()??void 0,tag:$n()??void 0}};await Ee.sendEvent(r,e)}async function Xn(t,e){w(),Ke(),ze();const r={name:"connect_wallet",user:{identifier:t.identifier,identifier_type:t.identifierType},args:{page:document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:je()}};t!=null&&t.signature&&(r.signature=t==null?void 0:t.signature,r.signature_message=t==null?void 0:t.message),t!=null&&t.signaturePublicKey&&(r.signature_public_key=t.signaturePublicKey),t!=null&&t.accountChainId&&(r.account_chain_id=t.accountChainId),await Ee.sendEvent(r,e)}async function Yn(t){return w(),B.create(t.userIdentifier,t.identifierType,t.code,t.signature,t.signaturePublicKey,t.accountChainId,t.userRebateRate)}async function Gn(t){w(),await B.update(t.userIdentifier,t.identifierType,t.code,t.signature,t.signaturePublicKey,t.accountChainId)}async function Zn(t){w(),await B.updateRebateRate(t.userIdentifier,t.identifierType,t.code,t.signature,t.rebateRate,t.signaturePublicKey,t.accountChainId,t.sourceProjectId)}async function es(t,e){return w(),await B.getCode(t,e)}async function ts(t){return w(),await B.isCodeFree(t)}async function rs(t){return w(),await B.isCodeAvailable(t)}async function ns(t,e,r,n){w();const s=await B.getCode(e,r),i=new URLSearchParams({af:(s==null?void 0:s.code)??e});return n!=null&&n.title&&i.append("af_title",n.title),n!=null&&n.format&&i.append("af_format",n.format),n!=null&&n.place&&i.append("af_place",n.place),`${t}?${i.toString()}`}function ss(t){return K.getPayoutsLeaderboard(t)}function is(t){return K.getPointsLeaderboard(t)}function os(t){return K.getReferredUsersLeaderboard(t)}function as(t){return w(),K.getReferredVolume(t)}function cs(t){return w(),K.getVolumeLeaderboard(t)}function us(t){return w(),K.getRevenueLeaderboard(t)}function ls(t){return G.getUserPayoutsByConversion(t)}function ds(t){return G.getUserPointsByConversion(t)}function fs(t){return G.getUserPayoutMovements(t)}function hs(t){return G.getUserPointsMovements(t)}function ps(t){return w(),G.getPayoutsByReferrer(t)}async function ys(t){return w(),vt.getAll(t)}async function ms(t){return w(),It.getUserReferrer(t)}async function gs(t){return w(),Bt.getUserAudiences(t)}async function ws(t){return w(),q.listUserReferralCodes(t)}async function bs(t){return w(),q.generateReferralCodes(t)}async function _s(t){return w(),q.getReferralStatus(t)}async function Es(t){return w(),q.getReferralCode(t)}async function Rs(t){return w(),q.useReferralCode(t)}async function Cs(t){return w(),q.updateReferralCode(t)}async function Ss(t){return w(),q.deleteReferral(t)}async function As(t){return w(),He.getAffiliateStats(t)}async function Ts(t){return w(),He.getAffiliateNewTraders(t)}async function Ps(t){return w(),Ve.getClaimableChecks(t)}async function Os(t){return w(),Ve.getClaimCheckTotals(t)}function Ke(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function ze(){if(navigator.webdriver)throw new Error("Fuul SDK: Error")}function Ns(){if(!Me)throw new Error("Fuul SDK: Invalid API key")}function Us(t,e){return new Un({baseURL:t,timeout:3e4,apiKey:Me,queryParams:e})}const xs={init:Jn,sendEvent:Wn,sendPageview:Qn,identifyUser:Xn,generateTrackingLink:ns,getConversions:ys,createAffiliateCode:Yn,updateAffiliateCode:Gn,updateRebateRate:Zn,getAffiliateCode:es,isAffiliateCodeFree:ts,isAffiliateCodeAvailable:rs,getPayoutsLeaderboard:ss,getPointsLeaderboard:is,getReferredUsersLeaderboard:os,getReferredVolume:as,getUserAudiences:gs,getUserPayoutsByConversion:ls,getUserPointsByConversion:ds,getUserPointsMovements:hs,getUserPayoutMovements:fs,getPayoutsByReferrer:ps,getUserReferrer:ms,getVolumeLeaderboard:cs,getRevenueLeaderboard:us,listUserReferralCodes:ws,generateReferralCodes:bs,getReferralStatus:_s,getReferralCode:Es,useReferralCode:Rs,updateReferralCode:Cs,deleteReferral:Ss,getAffiliateStats:As,getAffiliateNewTraders:Ts,getClaimableChecks:Ps,getClaimCheckTotals:Os};var qt=(t=>(t.EvmAddress="evm_address",t.SolanaAddress="solana_address",t.XRPLAddress="xrpl_address",t.SuiAddress="sui_address",t.Email="email",t))(qt||{});S.AddressInUseError=Be,S.CodeInUseError=qe,S.Fuul=xs,S.InvalidSignatureError=_e,S.UserIdentifierType=qt,S.ValidationError=be,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})}));
|
|
5
|
+
`):" "+Tt(o[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const Pt={getAdapter:mn,adapters:ve};function Ie(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ie(null,t)}function Ot(t){return Ie(t),t.headers=O.from(t.headers),t.data=ke.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Pt.getAdapter(t.adapter||ne.adapter,t)(t).then(function(n){return Ie(t),n.data=ke.call(t,t.transformResponse,n),n.headers=O.from(n.headers),n},function(n){return ht(n)||(Ie(t),n&&n.response&&(n.response.data=ke.call(t,t.transformResponse,n.response),n.response.headers=O.from(n.response.headers))),Promise.reject(n)})}const Nt="1.13.6",me={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{me[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Ut={};me.transitional=function(e,r,n){function s(i,o){return"[Axios v"+Nt+"] Transitional option '"+i+"'"+o+(n?". "+n:"")}return(i,o,c)=>{if(e===!1)throw new m(s(o," has been removed"+(r?" in "+r:"")),m.ERR_DEPRECATED);return r&&!Ut[o]&&(Ut[o]=!0,console.warn(s(o," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(i,o,c):!0}},me.spelling=function(e){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function gn(t,e,r){if(typeof t!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let s=n.length;for(;s-- >0;){const i=n[s],o=e[i];if(o){const c=t[i],f=c===void 0||o(c,i,t);if(f!==!0)throw new m("option "+i+" must be "+f,m.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const ge={assertOptions:gn,validators:me},x=ge.validators;let V=class{constructor(e){this.defaults=e||{},this.interceptors={request:new lt,response:new lt}}async request(e,r){try{return await this._request(e,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
+
`+i):n.stack=i}catch{}}throw n}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=H(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:i}=r;n!==void 0&&ge.assertOptions(n,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean),legacyInterceptorReqResOrdering:x.transitional(x.boolean)},!1),s!=null&&(a.isFunction(s)?r.paramsSerializer={serialize:s}:ge.assertOptions(s,{encode:x.function,serialize:x.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),ge.assertOptions(r,{baseUrl:x.spelling("baseURL"),withXsrfToken:x.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[r.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=O.concat(o,i);const c=[];let f=!0;this.interceptors.request.forEach(function(y){if(typeof y.runWhen=="function"&&y.runWhen(r)===!1)return;f=f&&y.synchronous;const p=r.transitional||xe;p&&p.legacyInterceptorReqResOrdering?c.unshift(y.fulfilled,y.rejected):c.push(y.fulfilled,y.rejected)});const l=[];this.interceptors.response.forEach(function(y){l.push(y.fulfilled,y.rejected)});let u,h=0,g;if(!f){const d=[Ot.bind(this),void 0];for(d.unshift(...c),d.push(...l),g=d.length,u=Promise.resolve(r);h<g;)u=u.then(d[h++],d[h++]);return u}g=c.length;let R=r;for(;h<g;){const d=c[h++],y=c[h++];try{R=d(R)}catch(p){y.call(this,p);break}}try{u=Ot.call(this,R)}catch(d){return Promise.reject(d)}for(h=0,g=l.length;h<g;)u=u.then(l[h++],l[h++]);return u}getUri(e){e=H(this.defaults,e);const r=gt(e.baseURL,e.url,e.allowAbsoluteUrls);return ut(r,e.params,e.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(e){V.prototype[e]=function(r,n){return this.request(H(n||{},{method:e,url:r,data:(n||{}).data}))}}),a.forEach(["post","put","patch"],function(e){function r(n){return function(i,o,c){return this.request(H(c||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}V.prototype[e]=r(),V.prototype[e+"Form"]=r(!0)});let wn=class Jt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(s=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](s);n._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{n.subscribe(c),i=c}).then(s);return o.cancel=function(){n.unsubscribe(i)},o},e(function(i,o,c){n.reason||(n.reason=new ie(i,o,c),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=n=>{e.abort(n)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new Jt(function(s){e=s}),cancel:e}}};function bn(t){return function(r){return t.apply(null,r)}}function _n(t){return a.isObject(t)&&t.isAxiosError===!0}const Be={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Be).forEach(([t,e])=>{Be[e]=t});function xt(t){const e=new V(t),r=Qe(V.prototype.request,e);return a.extend(r,V.prototype,e,{allOwnKeys:!0}),a.extend(r,e,null,{allOwnKeys:!0}),r.create=function(s){return xt(H(t,s))},r}const _=xt(ne);_.Axios=V,_.CanceledError=ie,_.CancelToken=wn,_.isCancel=ht,_.VERSION=Nt,_.toFormData=fe,_.AxiosError=m,_.Cancel=_.CanceledError,_.all=function(e){return Promise.all(e)},_.spread=bn,_.isAxiosError=_n,_.mergeConfig=H,_.AxiosHeaders=O,_.formToJSON=t=>dt(a.isHTMLForm(t)?new FormData(t):t),_.getAdapter=Pt.getAdapter,_.HttpStatusCode=Be,_.default=_;const{Axios:Ms,AxiosError:we,CanceledError:Hs,isCancel:Vs,CancelToken:Ks,VERSION:zs,all:Js,Cancel:Ws,isAxiosError:Qs,spread:Xs,toFormData:Ys,AxiosHeaders:Gs,HttpStatusCode:Zs,formToJSON:ei,getAdapter:ti,mergeConfig:ri}=_;class be extends Error{constructor(r){super(r.join(", "));b(this,"errors");this.name="ValidationError",this.errors=r}}class qe extends Error{constructor(r){super("Address already registered.");b(this,"address");this.name="AddressInUseError",this.address=r}}class je extends Error{constructor(r){super("Code already registered.");b(this,"code");this.name="CodeInUseError",this.code=r}}class _e extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class En{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async create(e,r,n,s,i,o,c){var f;try{return(await this.httpClient.post({path:"/affiliates",postData:{address:e,identifier_type:r,name:n,code:n,signature:s,signature_public_key:i,account_chain_id:o,user_rebate_rate:c}})).data}catch(l){if(l instanceof we){const u=(f=l.response)==null?void 0:f.data;if(typeof(u==null?void 0:u.message)=="string"){const h=u.message.toLowerCase();throw h=="invalid signature"?new _e:h=="address in use"?new qe(e):h=="code in use"?new je(n):new Error(h)}else if((u==null?void 0:u.message)instanceof Array)throw new be(u.message)}throw l}}async update(e,r,n,s,i,o){var c;try{await this.httpClient.post({path:`/affiliates/${e}`,postData:{code:n,user_identifier:e,identifier_type:r,signature:s,signature_public_key:i,account_chain_id:o}})}catch(f){if(f instanceof we){const l=(c=f.response)==null?void 0:c.data;if(typeof(l==null?void 0:l.message)=="string"){const u=l.message.toLowerCase();throw u=="invalid signature"?new _e:u=="address in use"?new qe(e):u=="code in use"?new je(n):new Error(u)}else if((l==null?void 0:l.message)instanceof Array)throw new be(l.message)}throw f}}async updateRebateRate(e,r,n,s,i,o,c,f){var l;try{await this.httpClient.post({path:`/affiliates/${e}/rebate-rate`,postData:{identifier_type:r,code:n,signature:s,signature_public_key:o,account_chain_id:c,source_project_id:f,rebate_rate:i}})}catch(u){if(u instanceof we){const h=(l=u.response)==null?void 0:l.data;if(typeof(h==null?void 0:h.message)=="string"){const g=h.message.toLowerCase();throw g=="invalid signature"?new _e:new Error(g)}else if((h==null?void 0:h.message)instanceof Array)throw new be(h.message)}throw u}}async isCodeFree(e){try{return(await this.httpClient.get({path:`/affiliates/codes/${e}`})).data.free}catch(r){throw console.error("Fuul SDK: Could not check affiliate code",r),r}}async isCodeAvailable(e){try{return(await this.httpClient.get({path:`/affiliates/codes/${e}/availability`})).data.available}catch(r){throw console.error("Fuul SDK: Could not check affiliate code availability",r),r}}async getCode(e,r){var n;try{return(await this.httpClient.get({path:`/affiliates/${e}`,queryParams:{identifier_type:r}})).data}catch(s){if(s instanceof we&&((n=s.response)==null?void 0:n.status)===404)return null;throw console.error("Fuul SDK: Could not get affiliate code",s),s}}}const Rn="/audiences";class Cn{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getUserAudiences(e){return(await this.httpClient.get({path:`${Rn}/audience-segments/user`,queryParams:{...e}})).data}}const Dt="/claim-checks";class Sn{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getClaimableChecks(e){return(await this.httpClient.post({path:`${Dt}/claim`,postData:{userIdentifier:e.user_identifier,userIdentifierType:e.user_identifier_type}})).data}async getClaimCheckTotals(e){return(await this.httpClient.get({path:`${Dt}/totals`,queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}}class An{constructor(e){b(this,"httpClient");this.httpClient=e.httpClient}async getAll(e){const{data:r}=await this.httpClient.get({path:"conversions",queryParams:{...e}});return r}}const Lt="fuul.sent",Tn=60,Pn="connect_wallet",Ft=10;class On{constructor(e){b(this,"debug");b(this,"httpClient");this.httpClient=e.httpClient,this.debug=!!e.debug}async sendEvent(e,r){if(this.isDuplicate(e)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}if(!r||!Array.isArray(r)||r.length===0)await this.httpClient.post({path:"events",postData:e});else for(const n of r){const s=structuredClone({...e,project_id:n});s.metadata.project_id=n,await this.httpClient.post({path:"events",postData:s,queryParams:{project_id:n}})}this.debug&&console.debug(`Fuul SDK: Sent '${e.name}' event`),this.saveSentEvent(e)}isDuplicate(e){var u,h,g,R;const r=`${Lt}_${e.name}`,n=localStorage.getItem(r);if(!n)return!1;const s=JSON.parse(n);if(this.getCurrentTimestamp()-s.timestamp>Tn)return!1;let f=!1;e.metadata&&(f=s.metadata.tracking_id===e.metadata.tracking_id&&s.metadata.project_id===e.metadata.project_id&&s.metadata.referrer===e.metadata.referrer&&s.metadata.source===e.metadata.source&&s.metadata.category===e.metadata.category&&s.metadata.title===e.metadata.title&&s.metadata.tag===e.metadata.tag&&s.user_address===e.user_address&&((u=s.user)==null?void 0:u.identifier)===((h=e.user)==null?void 0:h.identifier)&&((g=s.user)==null?void 0:g.identifier_type)===((R=e.user)==null?void 0:R.identifier_type)&&s.signature===e.signature&&s.signature_message===e.signature_message);let l=!1;return e.args&&s.args&&(l=s.args.page===e.args.page),l&&f}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(e){var o,c,f,l;const r=`${Lt}_${e.name}`,n=`${r}_all`,s=this.getCurrentTimestamp(),i={...e,timestamp:s};if(localStorage.setItem(r,JSON.stringify(i)),e.name===Pn){const u=JSON.parse(localStorage.getItem(n)||"[]"),h={name:e.name,user:{identifier:(o=e.user)==null?void 0:o.identifier,identifier_type:(c=e.user)==null?void 0:c.identifier_type},tracking_id:(f=e.metadata)==null?void 0:f.tracking_id,page:(l=e.args)==null?void 0:l.page};"user_address"in e&&(h.user_address=e.user_address);const g=[...u,h];g.length>Ft&&g.splice(0,g.length-Ft),localStorage.setItem(n,JSON.stringify(g))}}}const Nn={version:"0.0.0"};class Un{constructor(e){b(this,"client");b(this,"defaultQueryParams");this.client=_.create({...e,headers:{Authorization:`Bearer ${e.apiKey}`,"X-Fuul-Sdk-Version":Nn.version}}),this.defaultQueryParams=e.queryParams||{}}makeQueryParams(e){return Object.assign({},this.defaultQueryParams||{},e||{})}async get(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),method:"GET"})}async post(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"POST"})}async put(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"PUT"})}async patch(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"PATCH"})}async delete(e){return this.client.request({url:e.path,params:this.makeQueryParams(e.queryParams),data:e.postData,method:"DELETE"})}}class xn{constructor(e){b(this,"httpClient");this.httpClient=e.httpClient}async getPayoutsLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,user_identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/payouts",queryParams:i})).data}async getPointsLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,user_identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/points",queryParams:i})).data}async getVolumeLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/volume",queryParams:i})).data}async getReferredUsersLeaderboard(e){return(await this.httpClient.get({path:"/leaderboard/referred",queryParams:{...e}})).data}async getReferredVolume(e){const{user_identifiers:r,...n}=e;return(await this.httpClient.get({path:"/payouts/leaderboard/referred-volume",queryParams:{...n,user_identifiers:r.join(",")}})).data}async getRevenueLeaderboard(e){const{identifier_type:r,user_identifier_type:n,...s}=e,i={...s,identifier_type:r??n};return(await this.httpClient.get({path:"/payouts/leaderboard/revenue",queryParams:i})).data}}const oe="/payouts";class Dn{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async getUserPayoutsByConversion(e){return(await this.httpClient.get({path:oe,queryParams:{...e,type:"onchain-currency"}})).data}async getUserPointsByConversion(e){return(await this.httpClient.get({path:oe,queryParams:{...e,type:"point"}})).data}async getUserPayoutMovements(e){return(await this.httpClient.get({path:`${oe}/movements`,queryParams:{...e,type:"onchain-currency"}})).data}async getUserPointsMovements(e){return(await this.httpClient.get({path:`${oe}/movements`,queryParams:{...e,type:"point"}})).data}async getPayoutsByReferrer(e){return(await this.httpClient.get({path:`${oe}/by-referrer`,queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}}class Ln{constructor(e){b(this,"httpClient");b(this,"_debug");this.httpClient=e.httpClient,this._debug=e.debug}async listUserReferralCodes(e){return(await this.httpClient.get({path:"/referral_codes",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type,page:e.page,page_size:e.page_size}})).data}async generateReferralCodes(e){return(await this.httpClient.post({path:"/referral_codes",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type,quantity:e.quantity,max_uses:e.max_uses}})).data}async getReferralStatus(e){return(await this.httpClient.get({path:"/referral_codes/status",queryParams:{user_identifier:e.user_identifier,user_identifier_type:e.user_identifier_type}})).data}async getReferralCode(e){return(await this.httpClient.get({path:`/referral_codes/${e.code}`})).data}async useReferralCode(e){const{code:r,user_identifier:n,user_identifier_type:s,signature:i,signature_message:o,chain_id:c}=e;await this.httpClient.patch({path:`/referral_codes/${r}/use`,queryParams:{user_identifier:n,user_identifier_type:s},postData:{signature:i,signature_message:o,chain_id:c}})}async updateReferralCode(e){await this.httpClient.patch({path:`/referral_codes/${e.code}`,postData:{max_uses:e.max_uses}})}async deleteReferral(e){const{code:r,user_identifier:n,user_identifier_type:s,referrer_identifier:i,referrer_identifier_type:o,signature:c,signature_message:f,chain_id:l}=e;await this.httpClient.delete({path:`/referral_codes/${r}/referrals`,queryParams:{user_identifier:n,user_identifier_type:s,referrer_identifier:i,referrer_identifier_type:o},postData:{signature:c,signature_message:f,chain_id:l}})}}const Fn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let kn=(t=21)=>{let e="",r=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Fn[r[t]&63];return e};const vn="fuul.tracking_id",$e=()=>Mn(vn,()=>kn()),kt=()=>Y("af")||Y("referrer"),In=()=>document.referrer,Bn=()=>Hn(),qn=()=>Y("category"),jn=()=>Y("title"),$n=()=>Y("tag"),Mn=(t,e)=>{const r=localStorage.getItem(t);if(r)return r;{const n=e();return n?localStorage.setItem(t,n):localStorage.removeItem(t),n}},Y=t=>new URLSearchParams(window.location.search).get(t),Hn=()=>{const t=Y("source");if(t)return t},Vn="/user";class Kn{constructor(e){b(this,"httpClient");this.httpClient=e.httpClient}async getUserReferrer(e){return(await this.httpClient.get({path:`${Vn}/referrer`,queryParams:{...e}})).data}}const zn="https://api.fuul.xyz/api/v1/";let I=!1,Me=!1,He,k,vt,It,B,Ee,Re,G,Bt,K,q,Ve;function Jn(t){I=!!t.debug,!Me&&(He=t.apiKey,Us(),k=xs(t.baseApiUrl??zn,t.defaultQueryParams??{}),vt=new An({httpClient:k,debug:I}),Re=new On({httpClient:k,debug:I}),B=new En({httpClient:k,debug:I}),Ee=new W({httpClient:k}),G=new Dn({httpClient:k,debug:I}),It=new Kn({httpClient:k}),Bt=new Cn({httpClient:k,debug:I}),K=new xn({httpClient:k}),q=new Ln({httpClient:k,debug:I}),Ve=new Sn({httpClient:k,debug:I}),Me=!0,I&&console.debug("Fuul SDK: init() complete"))}function w(){if(!Me)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Wn(t,e){w(),Ke(),ze();const r={name:t,args:e??{},metadata:{tracking_id:$e()}};await Re.sendEvent(r)}async function Qn(t,e){w(),Ke(),ze();const r={name:"pageview",args:{page:t??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:$e(),referrer_url:In(),source:Bn(),affiliate_id:kt()??void 0,referrer:kt()??void 0,category:qn()??void 0,title:jn()??void 0,tag:$n()??void 0}};await Re.sendEvent(r,e)}async function Xn(t,e){w(),Ke(),ze();const r={name:"connect_wallet",user:{identifier:t.identifier,identifier_type:t.identifierType},args:{page:document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:$e()}};t!=null&&t.signature&&(r.signature=t==null?void 0:t.signature,r.signature_message=t==null?void 0:t.message),t!=null&&t.signaturePublicKey&&(r.signature_public_key=t.signaturePublicKey),t!=null&&t.accountChainId&&(r.account_chain_id=t.accountChainId),await Re.sendEvent(r,e)}async function Yn(t){return w(),B.create(t.userIdentifier,t.identifierType,t.code,t.signature,t.signaturePublicKey,t.accountChainId,t.userRebateRate)}async function Gn(t){w(),await B.update(t.userIdentifier,t.identifierType,t.code,t.signature,t.signaturePublicKey,t.accountChainId)}async function Zn(t){w(),await B.updateRebateRate(t.userIdentifier,t.identifierType,t.code,t.signature,t.rebateRate,t.signaturePublicKey,t.accountChainId,t.sourceProjectId)}async function es(t,e){return w(),await B.getCode(t,e)}async function ts(t){return w(),await B.isCodeFree(t)}async function rs(t){return w(),await B.isCodeAvailable(t)}async function ns(t,e,r,n){w();const s=await B.getCode(e,r),i=new URLSearchParams({af:(s==null?void 0:s.code)??e});return n!=null&&n.title&&i.append("af_title",n.title),n!=null&&n.format&&i.append("af_format",n.format),n!=null&&n.place&&i.append("af_place",n.place),`${t}?${i.toString()}`}function ss(t){return K.getPayoutsLeaderboard(t)}function is(t){return K.getPointsLeaderboard(t)}function os(t){return K.getReferredUsersLeaderboard(t)}function as(t){return w(),K.getReferredVolume(t)}function cs(t){return w(),K.getVolumeLeaderboard(t)}function us(t){return w(),K.getRevenueLeaderboard(t)}function ls(t){return G.getUserPayoutsByConversion(t)}function ds(t){return G.getUserPointsByConversion(t)}function fs(t){return G.getUserPayoutMovements(t)}function hs(t){return G.getUserPointsMovements(t)}function ps(t){return w(),G.getPayoutsByReferrer(t)}async function ys(t){return w(),vt.getAll(t)}async function ms(t){return w(),It.getUserReferrer(t)}async function gs(t){return w(),Bt.getUserAudiences(t)}async function ws(t){return w(),q.listUserReferralCodes(t)}async function bs(t){return w(),q.generateReferralCodes(t)}async function _s(t){return w(),q.getReferralStatus(t)}async function Es(t){return w(),q.getReferralCode(t)}async function Rs(t){return w(),q.useReferralCode(t)}async function Cs(t){return w(),q.updateReferralCode(t)}async function Ss(t){return w(),q.deleteReferral(t)}async function As(t){return w(),Ee.getAffiliateStats(t)}async function Ts(t){return w(),Ee.getAffiliateNewTraders(t)}async function Ps(t){return w(),Ee.getAffiliateTotalStats(t)}async function Os(t){return w(),Ve.getClaimableChecks(t)}async function Ns(t){return w(),Ve.getClaimCheckTotals(t)}function Ke(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function ze(){if(navigator.webdriver)throw new Error("Fuul SDK: Error")}function Us(){if(!He)throw new Error("Fuul SDK: Invalid API key")}function xs(t,e){return new Un({baseURL:t,timeout:3e4,apiKey:He,queryParams:e})}const Ds={init:Jn,sendEvent:Wn,sendPageview:Qn,identifyUser:Xn,generateTrackingLink:ns,getConversions:ys,createAffiliateCode:Yn,updateAffiliateCode:Gn,updateRebateRate:Zn,getAffiliateCode:es,isAffiliateCodeFree:ts,isAffiliateCodeAvailable:rs,getPayoutsLeaderboard:ss,getPointsLeaderboard:is,getReferredUsersLeaderboard:os,getReferredVolume:as,getUserAudiences:gs,getUserPayoutsByConversion:ls,getUserPointsByConversion:ds,getUserPointsMovements:hs,getUserPayoutMovements:fs,getPayoutsByReferrer:ps,getUserReferrer:ms,getVolumeLeaderboard:cs,getRevenueLeaderboard:us,listUserReferralCodes:ws,generateReferralCodes:bs,getReferralStatus:_s,getReferralCode:Es,useReferralCode:Rs,updateReferralCode:Cs,deleteReferral:Ss,getAffiliateStats:As,getAffiliateNewTraders:Ts,getAffiliateTotalStats:Ps,getClaimableChecks:Os,getClaimCheckTotals:Ns};var qt=(t=>(t.EvmAddress="evm_address",t.SolanaAddress="solana_address",t.XRPLAddress="xrpl_address",t.SuiAddress="sui_address",t.Email="email",t))(qt||{});S.AddressInUseError=qe,S.CodeInUseError=je,S.Fuul=Ds,S.InvalidSignatureError=_e,S.UserIdentifierType=qt,S.ValidationError=be,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})}));
|