@blockchyp/blockchyp-ts 2.30.0 → 2.30.3

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.
@@ -29603,6 +29603,12 @@ class BlockChypClient {
29603
29603
  surchargeReview(request) {
29604
29604
  return this._gatewayRequest('post', '/api/surcharge-review', request);
29605
29605
  }
29606
+ /**
29607
+ * Generates a short-lived API key scoped to terminal and payment operations.
29608
+ */
29609
+ transientKey(request) {
29610
+ return this._gatewayRequest('post', '/api/transient-credentials', request);
29611
+ }
29606
29612
  /**
29607
29613
  * Captures a preauthorization.
29608
29614
  */
@@ -30373,8 +30379,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
30373
30379
  exports.TransactionStatus = exports.PaymentLinkStatusResponse = exports.PaymentLinkStatusRequest = exports.TransactionStatusRequest = exports.AuthorizationResponse = exports.TermsAndConditionsResponse = exports.TermsAndConditionsRequest = exports.CloseBatchResponse = exports.CloseBatchRequest = exports.GiftActivateResponse = exports.GiftActivateRequest = exports.ClearTerminalRequest = exports.EnrollResponse = exports.EnrollRequest = exports.VoidResponse = exports.VoidRequest = exports.CaptureResponse = exports.CaptureRequest = exports.RefundRequest = exports.BalanceResponse = exports.BalanceRequest = exports.CardMetadataResponse = exports.CardMetadataRequest = exports.CardMetadata = exports.AuthorizationRequest = exports.WhiteListedCard = exports.BooleanPromptResponse = exports.TextPromptResponse = exports.CustomerToken = exports.UpdateTokenResponse = exports.UpdateTokenRequest = exports.TokenMetadataResponse = exports.TokenMetadataRequest = exports.Customer = exports.CustomerSearchResponse = exports.UpdateCustomerRequest = exports.CustomerSearchRequest = exports.CustomerResponse = exports.CustomerRequest = exports.TextPromptRequest = exports.BooleanPromptRequest = exports.MessageRequest = exports.LocateResponse = exports.LocateRequest = exports.PingResponse = exports.PingRequest = exports.CaptureSignatureResponse = exports.CaptureSignatureRequest = exports.Acknowledgement = exports.ReceiptSuggestions = void 0;
30374
30380
  exports.UpdateMerchantPlatformRequest = exports.MerchantPlatformsResponse = exports.MerchantUser = exports.MerchantUsersResponse = exports.GetMerchantsResponse = exports.GetMerchantsRequest = exports.HealthcareGroup = exports.HealthcareMetadata = exports.UnlinkTokenRequest = exports.LinkTokenRequest = exports.DeleteTokenResponse = exports.DeleteTokenRequest = exports.DeleteCustomerResponse = exports.DeleteCustomerRequest = exports.DeleteQueuedTransactionResponse = exports.DeleteQueuedTransactionRequest = exports.ListQueuedTransactionsResponse = exports.ListQueuedTransactionsRequest = exports.BankAccount = exports.MerchantProfileResponse = exports.MerchantProfile = exports.Address = exports.InviteMerchantUserRequest = exports.MerchantPlatformRequest = exports.MerchantProfileRequest = exports.AddGatewayMerchantRequest = exports.AddTestMerchantRequest = exports.TerminalVolume = exports.BatchDetailsResponse = exports.BatchDetailsRequest = exports.BatchSummary = exports.BatchHistoryResponse = exports.BatchHistoryRequest = exports.TransactionHistoryResponse = exports.TransactionHistoryRequest = exports.CashDiscountResponse = exports.CashDiscountRequest = exports.ResendPaymentLinkResponse = exports.ResendPaymentLinkRequest = exports.CancelPaymentLinkResponse = exports.CancelPaymentLinkRequest = exports.PaymentLinkResponse = exports.PaymentLinkRequest = exports.TerminalStatusResponse = exports.TerminalStatusRequest = exports.HeartbeatResponse = exports.TransactionDisplayRequest = exports.TransactionDisplayTransaction = exports.TransactionDisplayItem = exports.TransactionDisplayDiscount = void 0;
30375
30381
  exports.StatementDeposit = exports.InvoicePayment = exports.InvoiceLineItem = exports.MerchantInvoiceDetailResponse = exports.MerchantInvoiceDetailRequest = exports.MerchantInvoiceSummary = exports.MerchantInvoiceListResponse = exports.MerchantInvoiceListRequest = exports.PartnerStatementAdjustment = exports.PartnerStatementDisbursement = exports.PartnerStatementLineItem = exports.PartnerStatementDetailResponse = exports.PartnerStatementDetailRequest = exports.PartnerStatementListResponse = exports.PartnerStatementSummary = exports.PartnerStatementListRequest = exports.PricingPolicyResponse = exports.PricePoint = exports.PricingPolicyRequest = exports.BrandingAssetResponse = exports.BrandingAsset = exports.BrandingAssetRequest = exports.SlideShowRequest = exports.SlideShowResponse = exports.SlideShow = exports.Slide = exports.MediaLibraryResponse = exports.MediaRequest = exports.UploadStatusRequest = exports.UploadStatus = exports.UploadMetadata = exports.MediaMetadata = exports.SurveyResultsRequest = exports.SurveyDataPoint = exports.SurveyQuestionResponse = exports.SurveyQuestionRequest = exports.SurveyQuestion = exports.TermsAndConditionsLogEntry = exports.TermsAndConditionsLogResponse = exports.TermsAndConditionsLogRequest = exports.TermsAndConditionsTemplateResponse = exports.TermsAndConditionsTemplateRequest = exports.TermsAndConditionsTemplate = exports.TerminalProfile = exports.TerminalActivationRequest = exports.TerminalDeactivationRequest = exports.TerminalProfileResponse = exports.TerminalProfileRequest = exports.MerchantPlatform = exports.UpdateMerchantPlatformResponse = void 0;
30376
- exports.PaymentMethod = exports.PaymentAmounts = exports.CryptocurrencyResponse = exports.PaymentMethodResponse = exports.CoreRequest = exports.TimeoutRequest = exports.ApprovalResponse = exports.SignatureRequest = exports.SignatureResponse = exports.TerminalReference = exports.AbstractAcknowledgement = exports.TerminalDeleteQueuedTransactionRequest = exports.TerminalListQueuedTransactionsRequest = exports.TerminalTerminalStatusRequest = exports.TerminalTransactionDisplayRequest = exports.TerminalTermsAndConditionsResponse = exports.TerminalTermsAndConditionsRequest = exports.TerminalGiftActivateRequest = exports.TerminalClearTerminalRequest = exports.TerminalEnrollRequest = exports.TerminalRefundRequest = exports.TerminalBalanceRequest = exports.TerminalCardMetadataRequest = exports.TerminalAuthorizationRequest = exports.TerminalTextPromptRequest = exports.TerminalBooleanPromptRequest = exports.TerminalMessageRequest = exports.TerminalLocateRequest = exports.TerminalPingRequest = exports.TerminalCaptureSignatureRequest = exports.PricingResponse = exports.ErrorType = exports.PricingResponseData = exports.PricingResponseAttributes = exports.PricingRequest = exports.PricingRequestData = exports.PricingRequestAttributes = exports.PricingMerchantSettings = exports.StateCheckSettings = exports.SubmitApplicationRequest = exports.MerchantApplication = exports.ApplicationAccount = exports.Owner = exports.AggregateBillingLineItemStats = exports.AggregateBillingLineItem = exports.BuyRateLineItem = exports.MerchantCredentialGenerationResponse = exports.MerchantCredentialGenerationRequest = exports.PartnerCommissionBreakdownResponse = exports.PartnerCommissionBreakdownRequest = void 0;
30377
- exports.CoreResponse = exports.PreviousTransaction = exports.Subtotals = exports.RequestAmount = void 0;
30382
+ exports.PreviousTransaction = exports.Subtotals = exports.RequestAmount = exports.PaymentMethod = exports.PaymentAmounts = exports.CryptocurrencyResponse = exports.PaymentMethodResponse = exports.CoreRequest = exports.TimeoutRequest = exports.ApprovalResponse = exports.SignatureRequest = exports.SignatureResponse = exports.TerminalReference = exports.AbstractAcknowledgement = exports.TerminalDeleteQueuedTransactionRequest = exports.TerminalListQueuedTransactionsRequest = exports.TerminalTerminalStatusRequest = exports.TerminalTransactionDisplayRequest = exports.TerminalTermsAndConditionsResponse = exports.TerminalTermsAndConditionsRequest = exports.TerminalGiftActivateRequest = exports.TerminalClearTerminalRequest = exports.TerminalEnrollRequest = exports.TerminalRefundRequest = exports.TerminalBalanceRequest = exports.TerminalCardMetadataRequest = exports.TerminalAuthorizationRequest = exports.TerminalTextPromptRequest = exports.TerminalBooleanPromptRequest = exports.TerminalMessageRequest = exports.TerminalLocateRequest = exports.TerminalPingRequest = exports.TerminalCaptureSignatureRequest = exports.TransientKeyResponse = exports.TransientKeyRequest = exports.SurchargeReviewResponse = exports.SurchargeAttributeResponseData = exports.SurchargeReviewResponseData = exports.SurchargeReviewRequest = exports.SubmitApplicationRequest = exports.MerchantApplication = exports.ApplicationAccount = exports.Owner = exports.AggregateBillingLineItemStats = exports.AggregateBillingLineItem = exports.BuyRateLineItem = exports.MerchantCredentialGenerationResponse = exports.MerchantCredentialGenerationRequest = exports.PartnerCommissionBreakdownResponse = exports.PartnerCommissionBreakdownRequest = void 0;
30383
+ exports.CoreResponse = void 0;
30378
30384
  // CardType is used to differentiate credit, debit, and EBT.
30379
30385
  var CardType;
30380
30386
  (function (CardType) {
@@ -31522,7 +31528,7 @@ exports.WhiteListedCard = WhiteListedCard;
31522
31528
  */
31523
31529
  class AuthorizationRequest {
31524
31530
  // Constructor with default values for optional fields
31525
- constructor(timeout = null, test = null, transactionRef = undefined, autogeneratedRef = null, async = null, queue = null, waitForRemovedCard = false, force = false, orderRef = undefined, destinationAccount = undefined, testCase = undefined, token = undefined, track1 = undefined, track2 = undefined, pan = undefined, routingNumber = undefined, cardholderName = undefined, expMonth = undefined, expYear = undefined, cvv = undefined, address = undefined, postalCode = undefined, country = undefined, manualEntry = false, ksn = undefined, pinBlock = undefined, cardType = undefined, paymentType = undefined, currencyCode = null, amount = null, taxExempt = null, surcharge = null, cashDiscount = null, sigFile = undefined, sigFormat = undefined, sigWidth = 0, disableSignature = false, tipAmount = undefined, taxAmount = undefined, terminalName = undefined, resetConnection = null, transactionId = undefined, onlineAuthCode = undefined, enroll = false, bypassDupeFilter = false, description = undefined, promptForTip = false, cashBackEnabled = false, cardOnFile = false, recurring = false, cit = false, mit = false, subscription = false, purchaseOrderNumber = undefined, supplierReferenceNumber = undefined, lineItems = null, altPrices = undefined, customer = undefined, roundingMode = undefined, healthcareMetadata = undefined, cryptocurrency = undefined, cryptoNetwork = undefined, cryptoReceiveAddress = undefined, paymentRequestLabel = undefined, paymentRequestMessage = undefined, simulateChipRejection = false, simulateOutOfOrderReversal = false, asyncReversals = false, passthroughSurcharge = undefined, healthcare = false, healthcareTotal = undefined, ebtTotal = undefined, cardMetadataLookup = false, totalDiscountAmount = undefined, shippingAmount = undefined, dutyAmount = undefined, processorId = undefined, externalCustomerId = undefined, destinationCountryCode = undefined, shipFromPostalCode = undefined, shipToPostalCode = undefined, orderDate = undefined) {
31531
+ constructor(timeout = null, test = null, transactionRef = undefined, autogeneratedRef = null, async = null, queue = null, waitForRemovedCard = false, force = false, orderRef = undefined, destinationAccount = undefined, testCase = undefined, token = undefined, track1 = undefined, track2 = undefined, pan = undefined, routingNumber = undefined, cardholderName = undefined, expMonth = undefined, expYear = undefined, cvv = undefined, address = undefined, postalCode = undefined, country = undefined, manualEntry = false, ksn = undefined, pinBlock = undefined, cardType = undefined, paymentType = undefined, currencyCode = null, amount = null, taxExempt = null, surcharge = null, cashDiscount = null, sigFile = undefined, sigFormat = undefined, sigWidth = 0, disableSignature = false, tipAmount = undefined, taxAmount = undefined, terminalName = undefined, resetConnection = null, transactionId = undefined, onlineAuthCode = undefined, enroll = false, bypassDupeFilter = false, description = undefined, promptForTip = false, cashBackEnabled = false, cardOnFile = false, recurring = false, cit = false, mit = false, subscription = false, purchaseOrderNumber = undefined, supplierReferenceNumber = undefined, lineItems = null, altPrices = undefined, customer = undefined, roundingMode = undefined, healthcareMetadata = undefined, cryptocurrency = undefined, cryptoNetwork = undefined, cryptoReceiveAddress = undefined, paymentRequestLabel = undefined, paymentRequestMessage = undefined, simulateChipRejection = false, simulateOutOfOrderReversal = false, asyncReversals = false, passthroughSurcharge = undefined, healthcare = false, healthcareTotal = undefined, ebtTotal = undefined, cardMetadataLookup = false, totalDiscountAmount = undefined, shippingAmount = undefined, dutyAmount = undefined, processorId = undefined, externalCustomerId = undefined, destinationCountryCode = undefined, shipFromPostalCode = undefined, shipToPostalCode = undefined, orderDate = undefined, shipmentCount = null, shipmentNumber = null, externalPartnerMetadata = undefined) {
31526
31532
  /**
31527
31533
  * The request timeout in seconds.
31528
31534
  */
@@ -31576,6 +31582,14 @@ class AuthorizationRequest {
31576
31582
  * An item to display. Can be overwritten or appended, based on the request type.
31577
31583
  */
31578
31584
  this.lineItems = null;
31585
+ /**
31586
+ * The number of shipments the original authorization will be broken into.
31587
+ */
31588
+ this.shipmentCount = null;
31589
+ /**
31590
+ * Which shipment this particular capture is for.
31591
+ */
31592
+ this.shipmentNumber = null;
31579
31593
  this.timeout = timeout;
31580
31594
  this.test = test;
31581
31595
  this.transactionRef = transactionRef;
@@ -31658,6 +31672,9 @@ class AuthorizationRequest {
31658
31672
  this.shipFromPostalCode = shipFromPostalCode;
31659
31673
  this.shipToPostalCode = shipToPostalCode;
31660
31674
  this.orderDate = orderDate;
31675
+ this.shipmentCount = shipmentCount;
31676
+ this.shipmentNumber = shipmentNumber;
31677
+ this.externalPartnerMetadata = externalPartnerMetadata;
31661
31678
  }
31662
31679
  }
31663
31680
  exports.AuthorizationRequest = AuthorizationRequest;
@@ -32209,7 +32226,7 @@ exports.CaptureRequest = CaptureRequest;
32209
32226
  */
32210
32227
  class CaptureResponse {
32211
32228
  // Constructor with default values for optional fields
32212
- constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null) {
32229
+ constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null, enhancedDataPassed = false) {
32213
32230
  /**
32214
32231
  * Whether or not the request succeeded.
32215
32232
  */
@@ -32349,6 +32366,7 @@ class CaptureResponse {
32349
32366
  this.receiptSuggestions = receiptSuggestions;
32350
32367
  this.customer = customer;
32351
32368
  this.customers = customers;
32369
+ this.enhancedDataPassed = enhancedDataPassed;
32352
32370
  }
32353
32371
  }
32354
32372
  exports.CaptureResponse = CaptureResponse;
@@ -33119,7 +33137,7 @@ exports.TermsAndConditionsResponse = TermsAndConditionsResponse;
33119
33137
  */
33120
33138
  class AuthorizationResponse {
33121
33139
  // Constructor with default values for optional fields
33122
- constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, confirmed = null, cryptoAuthorizedAmount = null, cryptoNetworkFee = null, cryptocurrency = null, cryptoNetwork = null, cryptoReceiveAddress = null, cryptoBlock = null, cryptoTransactionId = null, cryptoPaymentRequest = null, cryptoStatus = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null, sigFile = undefined, whiteListedCard = undefined, storeAndForward = null, status = null, cardMetadata = undefined) {
33140
+ constructor(success = null, error = null, responseDescription = null, approved = null, authCode = undefined, authResponseCode = undefined, transactionId = null, batchId = undefined, transactionRef = undefined, transactionType = null, timestamp = null, tickBlock = null, test = null, destinationAccount = undefined, sig = undefined, partialAuth = null, altCurrency = null, fsaAuth = null, currencyCode = null, requestedAmount = null, authorizedAmount = null, remainingBalance = null, tipAmount = null, taxAmount = null, requestedCashBackAmount = null, authorizedCashBackAmount = null, confirmed = null, cryptoAuthorizedAmount = null, cryptoNetworkFee = null, cryptocurrency = null, cryptoNetwork = null, cryptoReceiveAddress = null, cryptoBlock = null, cryptoTransactionId = null, cryptoPaymentRequest = null, cryptoStatus = null, token = undefined, entryMethod = undefined, paymentType = undefined, network = undefined, logo = undefined, maskedPan = undefined, publicKey = undefined, ScopeAlert = false, cardHolder = undefined, expMonth = undefined, expYear = undefined, postalCode = undefined, address = undefined, country = undefined, avsResponse = null, cvvResponse = undefined, receiptSuggestions = null, customer = undefined, customers = null, sigFile = undefined, whiteListedCard = undefined, storeAndForward = null, status = null, cardMetadata = undefined, enhancedDataPassed = false) {
33123
33141
  /**
33124
33142
  * Whether or not the request succeeded.
33125
33143
  */
@@ -33326,6 +33344,7 @@ class AuthorizationResponse {
33326
33344
  this.storeAndForward = storeAndForward;
33327
33345
  this.status = status;
33328
33346
  this.cardMetadata = cardMetadata;
33347
+ this.enhancedDataPassed = enhancedDataPassed;
33329
33348
  }
33330
33349
  }
33331
33350
  exports.AuthorizationResponse = AuthorizationResponse;
@@ -40384,133 +40403,102 @@ class SubmitApplicationRequest {
40384
40403
  }
40385
40404
  exports.SubmitApplicationRequest = SubmitApplicationRequest;
40386
40405
  /**
40387
- * Models settings related to state checks for a merchant.
40406
+ * Models a surcharge review request.
40388
40407
  */
40389
- class StateCheckSettings {
40408
+ class SurchargeReviewRequest {
40390
40409
  // Constructor with default values for optional fields
40391
- constructor(enabled = null, surchargeExemptStates = null) {
40410
+ constructor(timeout = null, test = null, cardNumber = undefined, token = undefined, amount = undefined, surchargeRate = undefined, debitTransFee = undefined, debitDiscountRate = undefined, surchargePolicy = null, excludedMerchantStates = null, zip = null, state = null, exemptForeignCards = null, surchargingMode = null, pricingPlan = null) {
40392
40411
  /**
40393
- * If state checks are enabled for the merchant.
40412
+ * The request timeout in seconds.
40394
40413
  */
40395
- this.enabled = null;
40414
+ this.timeout = null;
40396
40415
  /**
40397
- * The list of states that are exempt from surcharges.
40416
+ * Whether or not to route transaction to the test gateway.
40398
40417
  */
40399
- this.surchargeExemptStates = null;
40400
- this.enabled = enabled;
40401
- this.surchargeExemptStates = surchargeExemptStates;
40402
- }
40403
- }
40404
- exports.StateCheckSettings = StateCheckSettings;
40405
- /**
40406
- * Models merchant settings and configuration.
40407
- */
40408
- class PricingMerchantSettings {
40409
- // Constructor with default values for optional fields
40410
- constructor(account = null, gateway = null, surchargingEnabled = null, customSurchargePercent = 0, reducedRate = false, inversePricingEnabled = false, creditDiscountRate = 0, acquiringSolution = null, acceptDebit = false, stateCheckSettings = undefined) {
40418
+ this.test = null;
40411
40419
  /**
40412
- * The merchant account identifier.
40420
+ * The surcharge policy.
40413
40421
  */
40414
- this.account = null;
40422
+ this.surchargePolicy = null;
40415
40423
  /**
40416
- * The gateway identifier.
40424
+ * The list of excluded merchant states.
40417
40425
  */
40418
- this.gateway = null;
40426
+ this.excludedMerchantStates = null;
40419
40427
  /**
40420
- * Whether surcharging is enabled for the merchant.
40428
+ * The zip code.
40421
40429
  */
40422
- this.surchargingEnabled = null;
40430
+ this.zip = null;
40423
40431
  /**
40424
- * The acquiring solution identifier.
40432
+ * The state or province.
40425
40433
  */
40426
- this.acquiringSolution = null;
40427
- this.account = account;
40428
- this.gateway = gateway;
40429
- this.surchargingEnabled = surchargingEnabled;
40430
- this.customSurchargePercent = customSurchargePercent;
40431
- this.reducedRate = reducedRate;
40432
- this.inversePricingEnabled = inversePricingEnabled;
40433
- this.creditDiscountRate = creditDiscountRate;
40434
- this.acquiringSolution = acquiringSolution;
40435
- this.acceptDebit = acceptDebit;
40436
- this.stateCheckSettings = stateCheckSettings;
40437
- }
40438
- }
40439
- exports.PricingMerchantSettings = PricingMerchantSettings;
40440
- /**
40441
- * Models the attributes for a pricing request.
40442
- */
40443
- class PricingRequestAttributes {
40444
- // Constructor with default values for optional fields
40445
- constructor(cardNumber = undefined, token = null, merchantIdentifier = undefined, amount = null, country = undefined, postalCode = undefined, state = undefined, merchantSettings = undefined) {
40434
+ this.state = null;
40446
40435
  /**
40447
- * The payment token.
40436
+ * If foreign cards are exempt.
40448
40437
  */
40449
- this.token = null;
40438
+ this.exemptForeignCards = null;
40450
40439
  /**
40451
- * The transaction amount.
40440
+ * The surcharging mode.
40452
40441
  */
40453
- this.amount = null;
40442
+ this.surchargingMode = null;
40443
+ /**
40444
+ * The pricing plan.
40445
+ */
40446
+ this.pricingPlan = null;
40447
+ this.timeout = timeout;
40448
+ this.test = test;
40454
40449
  this.cardNumber = cardNumber;
40455
40450
  this.token = token;
40456
- this.merchantIdentifier = merchantIdentifier;
40457
40451
  this.amount = amount;
40458
- this.country = country;
40459
- this.postalCode = postalCode;
40452
+ this.surchargeRate = surchargeRate;
40453
+ this.debitTransFee = debitTransFee;
40454
+ this.debitDiscountRate = debitDiscountRate;
40455
+ this.surchargePolicy = surchargePolicy;
40456
+ this.excludedMerchantStates = excludedMerchantStates;
40457
+ this.zip = zip;
40460
40458
  this.state = state;
40461
- this.merchantSettings = merchantSettings;
40459
+ this.exemptForeignCards = exemptForeignCards;
40460
+ this.surchargingMode = surchargingMode;
40461
+ this.pricingPlan = pricingPlan;
40462
40462
  }
40463
40463
  }
40464
- exports.PricingRequestAttributes = PricingRequestAttributes;
40464
+ exports.SurchargeReviewRequest = SurchargeReviewRequest;
40465
40465
  /**
40466
- * Models the data wrapper for a pricing request.
40466
+ * Models the data included in a surcharge review response.
40467
40467
  */
40468
- class PricingRequestData {
40468
+ class SurchargeReviewResponseData {
40469
40469
  // Constructor with default values for optional fields
40470
40470
  constructor(type = null, attributes = null) {
40471
40471
  /**
40472
- * The type of the request.
40472
+ * The type of the response.
40473
40473
  */
40474
40474
  this.type = null;
40475
40475
  /**
40476
- * The pricing request attributes.
40476
+ * The attributes of the response.
40477
40477
  */
40478
40478
  this.attributes = null;
40479
40479
  this.type = type;
40480
40480
  this.attributes = attributes;
40481
40481
  }
40482
40482
  }
40483
- exports.PricingRequestData = PricingRequestData;
40483
+ exports.SurchargeReviewResponseData = SurchargeReviewResponseData;
40484
40484
  /**
40485
- * Models a pricing request.
40485
+ * Models the surcharge attributes included in a surcharge review response.
40486
40486
  */
40487
- class PricingRequest {
40487
+ class SurchargeAttributeResponseData {
40488
40488
  // Constructor with default values for optional fields
40489
- constructor(timeout = null, test = null, data = null) {
40489
+ constructor(totalWithSurchargeAmount = null, success = null, type = null, surchargePercent = null, surchargeAmount = null, surchargeExempt = null, cardType = null, cardToken = undefined, brand = null, bin = null, commercialIndicator = undefined, isCommercial = null, isRegulated = null, exemptionReason = undefined, debitFeeAmount = undefined, disclosure = undefined, debitCategory = undefined, countryCode = null, state = undefined, uuid = null, expirationDate = undefined, disclosureAdditional = undefined, cardholderInfo = undefined) {
40490
40490
  /**
40491
- * The request timeout in seconds.
40491
+ * The total amount including surcharge.
40492
40492
  */
40493
- this.timeout = null;
40493
+ this.totalWithSurchargeAmount = null;
40494
40494
  /**
40495
- * Whether or not to route transaction to the test gateway.
40495
+ * If the surcharge review was successful.
40496
40496
  */
40497
- this.test = null;
40497
+ this.success = null;
40498
40498
  /**
40499
- * The pricing request data.
40499
+ * The type of the response.
40500
40500
  */
40501
- this.data = null;
40502
- this.timeout = timeout;
40503
- this.test = test;
40504
- this.data = data;
40505
- }
40506
- }
40507
- exports.PricingRequest = PricingRequest;
40508
- /**
40509
- * Models pricing response data for new handler for pricing api responses.
40510
- */
40511
- class PricingResponseAttributes {
40512
- // Constructor with default values for optional fields
40513
- constructor(surchargePercent = null, surchargeAmount = null, surchargeExempt = null, cardType = null, cardToken = undefined, brand = null, bin = null, commercialIndicator = null, disclosure = undefined, debitCategory = null, countryIssued = null, uuid = null) {
40501
+ this.type = null;
40514
40502
  /**
40515
40503
  * The surcharge percentage.
40516
40504
  */
@@ -40536,21 +40524,24 @@ class PricingResponseAttributes {
40536
40524
  */
40537
40525
  this.bin = null;
40538
40526
  /**
40539
- * The commercial card indicator.
40527
+ * If the card is commercial.
40540
40528
  */
40541
- this.commercialIndicator = null;
40529
+ this.isCommercial = null;
40542
40530
  /**
40543
- * The debit card category.
40531
+ * If the card is Durbin-regulated (US debit).
40544
40532
  */
40545
- this.debitCategory = null;
40533
+ this.isRegulated = null;
40546
40534
  /**
40547
40535
  * The country where the card was issued.
40548
40536
  */
40549
- this.countryIssued = null;
40537
+ this.countryCode = null;
40550
40538
  /**
40551
40539
  * The unique identifier for the pricing response.
40552
40540
  */
40553
40541
  this.uuid = null;
40542
+ this.totalWithSurchargeAmount = totalWithSurchargeAmount;
40543
+ this.success = success;
40544
+ this.type = type;
40554
40545
  this.surchargePercent = surchargePercent;
40555
40546
  this.surchargeAmount = surchargeAmount;
40556
40547
  this.surchargeExempt = surchargeExempt;
@@ -40559,62 +40550,76 @@ class PricingResponseAttributes {
40559
40550
  this.brand = brand;
40560
40551
  this.bin = bin;
40561
40552
  this.commercialIndicator = commercialIndicator;
40553
+ this.isCommercial = isCommercial;
40554
+ this.isRegulated = isRegulated;
40555
+ this.exemptionReason = exemptionReason;
40556
+ this.debitFeeAmount = debitFeeAmount;
40562
40557
  this.disclosure = disclosure;
40563
40558
  this.debitCategory = debitCategory;
40564
- this.countryIssued = countryIssued;
40559
+ this.countryCode = countryCode;
40560
+ this.state = state;
40565
40561
  this.uuid = uuid;
40562
+ this.expirationDate = expirationDate;
40563
+ this.disclosureAdditional = disclosureAdditional;
40564
+ this.cardholderInfo = cardholderInfo;
40566
40565
  }
40567
40566
  }
40568
- exports.PricingResponseAttributes = PricingResponseAttributes;
40567
+ exports.SurchargeAttributeResponseData = SurchargeAttributeResponseData;
40569
40568
  /**
40570
- * Models the data wrapper for a pricing response.
40569
+ * Models a surcharge review response.
40571
40570
  */
40572
- class PricingResponseData {
40571
+ class SurchargeReviewResponse {
40573
40572
  // Constructor with default values for optional fields
40574
- constructor(type = null, attributes = null) {
40573
+ constructor(success = null, error = null, responseDescription = null, data = null) {
40575
40574
  /**
40576
- * The type of the response.
40575
+ * Whether or not the request succeeded.
40577
40576
  */
40578
- this.type = null;
40577
+ this.success = null;
40579
40578
  /**
40580
- * The pricing response attributes.
40579
+ * The error, if an error occurred.
40581
40580
  */
40582
- this.attributes = null;
40583
- this.type = type;
40584
- this.attributes = attributes;
40581
+ this.error = null;
40582
+ /**
40583
+ * A narrative description of the transaction result.
40584
+ */
40585
+ this.responseDescription = null;
40586
+ /**
40587
+ * The data included in the surcharge review response.
40588
+ */
40589
+ this.data = null;
40590
+ this.success = success;
40591
+ this.error = error;
40592
+ this.responseDescription = responseDescription;
40593
+ this.data = data;
40585
40594
  }
40586
40595
  }
40587
- exports.PricingResponseData = PricingResponseData;
40596
+ exports.SurchargeReviewResponse = SurchargeReviewResponse;
40588
40597
  /**
40589
- * Models an error response.
40598
+ * Models a request for short-lived API credentials.
40590
40599
  */
40591
- class ErrorType {
40600
+ class TransientKeyRequest {
40592
40601
  // Constructor with default values for optional fields
40593
- constructor(status = null, title = null, detail = null) {
40594
- /**
40595
- * The HTTP status code.
40596
- */
40597
- this.status = null;
40602
+ constructor(timeout = null, test = null, oneTime = false) {
40598
40603
  /**
40599
- * The error title.
40604
+ * The request timeout in seconds.
40600
40605
  */
40601
- this.title = null;
40606
+ this.timeout = null;
40602
40607
  /**
40603
- * The detailed error message.
40608
+ * Whether or not to route transaction to the test gateway.
40604
40609
  */
40605
- this.detail = null;
40606
- this.status = status;
40607
- this.title = title;
40608
- this.detail = detail;
40610
+ this.test = null;
40611
+ this.timeout = timeout;
40612
+ this.test = test;
40613
+ this.oneTime = oneTime;
40609
40614
  }
40610
40615
  }
40611
- exports.ErrorType = ErrorType;
40616
+ exports.TransientKeyRequest = TransientKeyRequest;
40612
40617
  /**
40613
- * Models a pricing response.
40618
+ * Models a response containing short-lived API credentials.
40614
40619
  */
40615
- class PricingResponse {
40620
+ class TransientKeyResponse {
40616
40621
  // Constructor with default values for optional fields
40617
- constructor(success = null, error = null, responseDescription = null, data = null) {
40622
+ constructor(success = null, error = null, responseDescription = null, apiKey = null, bearerToken = null, signingKey = null) {
40618
40623
  /**
40619
40624
  * Whether or not the request succeeded.
40620
40625
  */
@@ -40628,16 +40633,26 @@ class PricingResponse {
40628
40633
  */
40629
40634
  this.responseDescription = null;
40630
40635
  /**
40631
- * The pricing response data.
40636
+ * The transient API key.
40632
40637
  */
40633
- this.data = null;
40638
+ this.apiKey = null;
40639
+ /**
40640
+ * The transient bearer token.
40641
+ */
40642
+ this.bearerToken = null;
40643
+ /**
40644
+ * The transient signing key.
40645
+ */
40646
+ this.signingKey = null;
40634
40647
  this.success = success;
40635
40648
  this.error = error;
40636
40649
  this.responseDescription = responseDescription;
40637
- this.data = data;
40650
+ this.apiKey = apiKey;
40651
+ this.bearerToken = bearerToken;
40652
+ this.signingKey = signingKey;
40638
40653
  }
40639
40654
  }
40640
- exports.PricingResponse = PricingResponse;
40655
+ exports.TransientKeyResponse = TransientKeyResponse;
40641
40656
  /**
40642
40657
  * A request for customer signature data.
40643
40658
  */
@@ -41281,7 +41296,7 @@ exports.CoreResponse = CoreResponse;
41281
41296
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
41282
41297
 
41283
41298
  "use strict";
41284
- /*! Axios v1.13.4 Copyright (c) 2026 Matt Zabriskie and contributors */
41299
+ /*! Axios v1.15.2 Copyright (c) 2026 Matt Zabriskie and contributors */
41285
41300
 
41286
41301
 
41287
41302
  /**
@@ -41299,30 +41314,30 @@ function bind(fn, thisArg) {
41299
41314
 
41300
41315
  // utils is a library of generic helper functions non-specific to axios
41301
41316
 
41302
- const {toString} = Object.prototype;
41303
- const {getPrototypeOf} = Object;
41304
- const {iterator, toStringTag} = Symbol;
41317
+ const { toString } = Object.prototype;
41318
+ const { getPrototypeOf } = Object;
41319
+ const { iterator, toStringTag } = Symbol;
41305
41320
 
41306
- const kindOf = (cache => thing => {
41307
- const str = toString.call(thing);
41308
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
41321
+ const kindOf = ((cache) => (thing) => {
41322
+ const str = toString.call(thing);
41323
+ return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
41309
41324
  })(Object.create(null));
41310
41325
 
41311
41326
  const kindOfTest = (type) => {
41312
41327
  type = type.toLowerCase();
41313
- return (thing) => kindOf(thing) === type
41328
+ return (thing) => kindOf(thing) === type;
41314
41329
  };
41315
41330
 
41316
- const typeOfTest = type => thing => typeof thing === type;
41331
+ const typeOfTest = (type) => (thing) => typeof thing === type;
41317
41332
 
41318
41333
  /**
41319
- * Determine if a value is an Array
41334
+ * Determine if a value is a non-null object
41320
41335
  *
41321
41336
  * @param {Object} val The value to test
41322
41337
  *
41323
41338
  * @returns {boolean} True if value is an Array, otherwise false
41324
41339
  */
41325
- const {isArray} = Array;
41340
+ const { isArray } = Array;
41326
41341
 
41327
41342
  /**
41328
41343
  * Determine if a value is undefined
@@ -41341,8 +41356,14 @@ const isUndefined = typeOfTest('undefined');
41341
41356
  * @returns {boolean} True if value is a Buffer, otherwise false
41342
41357
  */
41343
41358
  function isBuffer(val) {
41344
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
41345
- && isFunction$1(val.constructor.isBuffer) && val.constructor.isBuffer(val);
41359
+ return (
41360
+ val !== null &&
41361
+ !isUndefined(val) &&
41362
+ val.constructor !== null &&
41363
+ !isUndefined(val.constructor) &&
41364
+ isFunction$1(val.constructor.isBuffer) &&
41365
+ val.constructor.isBuffer(val)
41366
+ );
41346
41367
  }
41347
41368
 
41348
41369
  /**
@@ -41354,7 +41375,6 @@ function isBuffer(val) {
41354
41375
  */
41355
41376
  const isArrayBuffer = kindOfTest('ArrayBuffer');
41356
41377
 
41357
-
41358
41378
  /**
41359
41379
  * Determine if a value is a view on an ArrayBuffer
41360
41380
  *
@@ -41364,10 +41384,10 @@ const isArrayBuffer = kindOfTest('ArrayBuffer');
41364
41384
  */
41365
41385
  function isArrayBufferView(val) {
41366
41386
  let result;
41367
- if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
41387
+ if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) {
41368
41388
  result = ArrayBuffer.isView(val);
41369
41389
  } else {
41370
- result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));
41390
+ result = val && val.buffer && isArrayBuffer(val.buffer);
41371
41391
  }
41372
41392
  return result;
41373
41393
  }
@@ -41413,7 +41433,7 @@ const isObject = (thing) => thing !== null && typeof thing === 'object';
41413
41433
  * @param {*} thing The value to test
41414
41434
  * @returns {boolean} True if value is a Boolean, otherwise false
41415
41435
  */
41416
- const isBoolean = thing => thing === true || thing === false;
41436
+ const isBoolean = (thing) => thing === true || thing === false;
41417
41437
 
41418
41438
  /**
41419
41439
  * Determine if a value is a plain Object
@@ -41428,7 +41448,13 @@ const isPlainObject = (val) => {
41428
41448
  }
41429
41449
 
41430
41450
  const prototype = getPrototypeOf(val);
41431
- return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
41451
+ return (
41452
+ (prototype === null ||
41453
+ prototype === Object.prototype ||
41454
+ Object.getPrototypeOf(prototype) === null) &&
41455
+ !(toStringTag in val) &&
41456
+ !(iterator in val)
41457
+ );
41432
41458
  };
41433
41459
 
41434
41460
  /**
@@ -41470,6 +41496,31 @@ const isDate = kindOfTest('Date');
41470
41496
  */
41471
41497
  const isFile = kindOfTest('File');
41472
41498
 
41499
+ /**
41500
+ * Determine if a value is a React Native Blob
41501
+ * React Native "blob": an object with a `uri` attribute. Optionally, it can
41502
+ * also have a `name` and `type` attribute to specify filename and content type
41503
+ *
41504
+ * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
41505
+ *
41506
+ * @param {*} value The value to test
41507
+ *
41508
+ * @returns {boolean} True if value is a React Native Blob, otherwise false
41509
+ */
41510
+ const isReactNativeBlob = (value) => {
41511
+ return !!(value && typeof value.uri !== 'undefined');
41512
+ };
41513
+
41514
+ /**
41515
+ * Determine if environment is React Native
41516
+ * ReactNative `FormData` has a non-standard `getParts()` method
41517
+ *
41518
+ * @param {*} formData The formData to test
41519
+ *
41520
+ * @returns {boolean} True if environment is React Native, otherwise false
41521
+ */
41522
+ const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
41523
+
41473
41524
  /**
41474
41525
  * Determine if a value is a Blob
41475
41526
  *
@@ -41504,17 +41555,28 @@ const isStream = (val) => isObject(val) && isFunction$1(val.pipe);
41504
41555
  *
41505
41556
  * @returns {boolean} True if value is an FormData, otherwise false
41506
41557
  */
41558
+ function getGlobal() {
41559
+ if (typeof globalThis !== 'undefined') return globalThis;
41560
+ if (typeof self !== 'undefined') return self;
41561
+ if (typeof window !== 'undefined') return window;
41562
+ if (typeof __webpack_require__.g !== 'undefined') return __webpack_require__.g;
41563
+ return {};
41564
+ }
41565
+
41566
+ const G = getGlobal();
41567
+ const FormDataCtor = typeof G.FormData !== 'undefined' ? G.FormData : undefined;
41568
+
41507
41569
  const isFormData = (thing) => {
41508
- let kind;
41509
- return thing && (
41510
- (typeof FormData === 'function' && thing instanceof FormData) || (
41511
- isFunction$1(thing.append) && (
41512
- (kind = kindOf(thing)) === 'formdata' ||
41513
- // detect form-data instance
41514
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
41515
- )
41516
- )
41517
- )
41570
+ if (!thing) return false;
41571
+ if (FormDataCtor && thing instanceof FormDataCtor) return true;
41572
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
41573
+ const proto = getPrototypeOf(thing);
41574
+ if (!proto || proto === Object.prototype) return false;
41575
+ if (!isFunction$1(thing.append)) return false;
41576
+ const kind = kindOf(thing);
41577
+ return kind === 'formdata' ||
41578
+ // detect form-data instance
41579
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
41518
41580
  };
41519
41581
 
41520
41582
  /**
@@ -41526,7 +41588,12 @@ const isFormData = (thing) => {
41526
41588
  */
41527
41589
  const isURLSearchParams = kindOfTest('URLSearchParams');
41528
41590
 
41529
- const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);
41591
+ const [isReadableStream, isRequest, isResponse, isHeaders] = [
41592
+ 'ReadableStream',
41593
+ 'Request',
41594
+ 'Response',
41595
+ 'Headers',
41596
+ ].map(kindOfTest);
41530
41597
 
41531
41598
  /**
41532
41599
  * Trim excess whitespace off the beginning and end of a string
@@ -41535,9 +41602,9 @@ const [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream',
41535
41602
  *
41536
41603
  * @returns {String} The String freed of excess whitespace
41537
41604
  */
41538
- const trim = (str) => str.trim ?
41539
- str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
41540
-
41605
+ const trim = (str) => {
41606
+ return str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, '');
41607
+ };
41541
41608
  /**
41542
41609
  * Iterate over an Array or an Object invoking a function for each item.
41543
41610
  *
@@ -41554,7 +41621,7 @@ const trim = (str) => str.trim ?
41554
41621
  * @param {Boolean} [options.allOwnKeys = false]
41555
41622
  * @returns {any}
41556
41623
  */
41557
- function forEach(obj, fn, {allOwnKeys = false} = {}) {
41624
+ function forEach(obj, fn, { allOwnKeys = false } = {}) {
41558
41625
  // Don't bother if no value provided
41559
41626
  if (obj === null || typeof obj === 'undefined') {
41560
41627
  return;
@@ -41592,8 +41659,16 @@ function forEach(obj, fn, {allOwnKeys = false} = {}) {
41592
41659
  }
41593
41660
  }
41594
41661
 
41662
+ /**
41663
+ * Finds a key in an object, case-insensitive, returning the actual key name.
41664
+ * Returns null if the object is a Buffer or if no match is found.
41665
+ *
41666
+ * @param {Object} obj - The object to search.
41667
+ * @param {string} key - The key to find (case-insensitive).
41668
+ * @returns {?string} The actual key name if found, otherwise null.
41669
+ */
41595
41670
  function findKey(obj, key) {
41596
- if (isBuffer(obj)){
41671
+ if (isBuffer(obj)) {
41597
41672
  return null;
41598
41673
  }
41599
41674
 
@@ -41612,8 +41687,8 @@ function findKey(obj, key) {
41612
41687
 
41613
41688
  const _global = (() => {
41614
41689
  /*eslint no-undef:0*/
41615
- if (typeof globalThis !== "undefined") return globalThis;
41616
- return typeof self !== "undefined" ? self : (typeof window !== 'undefined' ? window : __webpack_require__.g)
41690
+ if (typeof globalThis !== 'undefined') return globalThis;
41691
+ return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : __webpack_require__.g;
41617
41692
  })();
41618
41693
 
41619
41694
  const isContextDefined = (context) => !isUndefined(context) && context !== _global;
@@ -41637,10 +41712,15 @@ const isContextDefined = (context) => !isUndefined(context) && context !== _glob
41637
41712
  * @returns {Object} Result of all merge properties
41638
41713
  */
41639
41714
  function merge(/* obj1, obj2, obj3, ... */) {
41640
- const {caseless, skipUndefined} = isContextDefined(this) && this || {};
41715
+ const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
41641
41716
  const result = {};
41642
41717
  const assignValue = (val, key) => {
41643
- const targetKey = caseless && findKey(result, key) || key;
41718
+ // Skip dangerous property names to prevent prototype pollution
41719
+ if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
41720
+ return;
41721
+ }
41722
+
41723
+ const targetKey = (caseless && findKey(result, key)) || key;
41644
41724
  if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
41645
41725
  result[targetKey] = merge(result[targetKey], val);
41646
41726
  } else if (isPlainObject(val)) {
@@ -41669,24 +41749,28 @@ function merge(/* obj1, obj2, obj3, ... */) {
41669
41749
  * @param {Boolean} [options.allOwnKeys]
41670
41750
  * @returns {Object} The resulting value of object a
41671
41751
  */
41672
- const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
41673
- forEach(b, (val, key) => {
41674
- if (thisArg && isFunction$1(val)) {
41675
- Object.defineProperty(a, key, {
41676
- value: bind(val, thisArg),
41677
- writable: true,
41678
- enumerable: true,
41679
- configurable: true
41680
- });
41681
- } else {
41682
- Object.defineProperty(a, key, {
41683
- value: val,
41684
- writable: true,
41685
- enumerable: true,
41686
- configurable: true
41687
- });
41688
- }
41689
- }, {allOwnKeys});
41752
+ const extend = (a, b, thisArg, { allOwnKeys } = {}) => {
41753
+ forEach(
41754
+ b,
41755
+ (val, key) => {
41756
+ if (thisArg && isFunction$1(val)) {
41757
+ Object.defineProperty(a, key, {
41758
+ value: bind(val, thisArg),
41759
+ writable: true,
41760
+ enumerable: true,
41761
+ configurable: true,
41762
+ });
41763
+ } else {
41764
+ Object.defineProperty(a, key, {
41765
+ value: val,
41766
+ writable: true,
41767
+ enumerable: true,
41768
+ configurable: true,
41769
+ });
41770
+ }
41771
+ },
41772
+ { allOwnKeys }
41773
+ );
41690
41774
  return a;
41691
41775
  };
41692
41776
 
@@ -41698,7 +41782,7 @@ const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
41698
41782
  * @returns {string} content value without BOM
41699
41783
  */
41700
41784
  const stripBOM = (content) => {
41701
- if (content.charCodeAt(0) === 0xFEFF) {
41785
+ if (content.charCodeAt(0) === 0xfeff) {
41702
41786
  content = content.slice(1);
41703
41787
  }
41704
41788
  return content;
@@ -41719,10 +41803,10 @@ const inherits = (constructor, superConstructor, props, descriptors) => {
41719
41803
  value: constructor,
41720
41804
  writable: true,
41721
41805
  enumerable: false,
41722
- configurable: true
41806
+ configurable: true,
41723
41807
  });
41724
41808
  Object.defineProperty(constructor, 'super', {
41725
- value: superConstructor.prototype
41809
+ value: superConstructor.prototype,
41726
41810
  });
41727
41811
  props && Object.assign(constructor.prototype, props);
41728
41812
  };
@@ -41781,7 +41865,6 @@ const endsWith = (str, searchString, position) => {
41781
41865
  return lastIndex !== -1 && lastIndex === position;
41782
41866
  };
41783
41867
 
41784
-
41785
41868
  /**
41786
41869
  * Returns new array from array like object or null if failed
41787
41870
  *
@@ -41810,9 +41893,9 @@ const toArray = (thing) => {
41810
41893
  * @returns {Array}
41811
41894
  */
41812
41895
  // eslint-disable-next-line func-names
41813
- const isTypedArray = (TypedArray => {
41896
+ const isTypedArray = ((TypedArray) => {
41814
41897
  // eslint-disable-next-line func-names
41815
- return thing => {
41898
+ return (thing) => {
41816
41899
  return TypedArray && thing instanceof TypedArray;
41817
41900
  };
41818
41901
  })(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));
@@ -41860,16 +41943,18 @@ const matchAll = (regExp, str) => {
41860
41943
  /* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */
41861
41944
  const isHTMLForm = kindOfTest('HTMLFormElement');
41862
41945
 
41863
- const toCamelCase = str => {
41864
- return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,
41865
- function replacer(m, p1, p2) {
41866
- return p1.toUpperCase() + p2;
41867
- }
41868
- );
41946
+ const toCamelCase = (str) => {
41947
+ return str.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function replacer(m, p1, p2) {
41948
+ return p1.toUpperCase() + p2;
41949
+ });
41869
41950
  };
41870
41951
 
41871
41952
  /* Creating a function that will check if an object has a property. */
41872
- const hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);
41953
+ const hasOwnProperty = (
41954
+ ({ hasOwnProperty }) =>
41955
+ (obj, prop) =>
41956
+ hasOwnProperty.call(obj, prop)
41957
+ )(Object.prototype);
41873
41958
 
41874
41959
  /**
41875
41960
  * Determine if a value is a RegExp object
@@ -41919,17 +42004,25 @@ const freezeMethods = (obj) => {
41919
42004
 
41920
42005
  if (!descriptor.set) {
41921
42006
  descriptor.set = () => {
41922
- throw Error('Can not rewrite read-only method \'' + name + '\'');
42007
+ throw Error("Can not rewrite read-only method '" + name + "'");
41923
42008
  };
41924
42009
  }
41925
42010
  });
41926
42011
  };
41927
42012
 
42013
+ /**
42014
+ * Converts an array or a delimited string into an object set with values as keys and true as values.
42015
+ * Useful for fast membership checks.
42016
+ *
42017
+ * @param {Array|string} arrayOrString - The array or string to convert.
42018
+ * @param {string} delimiter - The delimiter to use if input is a string.
42019
+ * @returns {Object} An object with keys from the array or string, values set to true.
42020
+ */
41928
42021
  const toObjectSet = (arrayOrString, delimiter) => {
41929
42022
  const obj = {};
41930
42023
 
41931
42024
  const define = (arr) => {
41932
- arr.forEach(value => {
42025
+ arr.forEach((value) => {
41933
42026
  obj[value] = true;
41934
42027
  });
41935
42028
  };
@@ -41942,11 +42035,9 @@ const toObjectSet = (arrayOrString, delimiter) => {
41942
42035
  const noop = () => {};
41943
42036
 
41944
42037
  const toFiniteNumber = (value, defaultValue) => {
41945
- return value != null && Number.isFinite(value = +value) ? value : defaultValue;
42038
+ return value != null && Number.isFinite((value = +value)) ? value : defaultValue;
41946
42039
  };
41947
42040
 
41948
-
41949
-
41950
42041
  /**
41951
42042
  * If the thing is a FormData object, return true, otherwise return false.
41952
42043
  *
@@ -41955,14 +42046,24 @@ const toFiniteNumber = (value, defaultValue) => {
41955
42046
  * @returns {boolean}
41956
42047
  */
41957
42048
  function isSpecCompliantForm(thing) {
41958
- return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
42049
+ return !!(
42050
+ thing &&
42051
+ isFunction$1(thing.append) &&
42052
+ thing[toStringTag] === 'FormData' &&
42053
+ thing[iterator]
42054
+ );
41959
42055
  }
41960
42056
 
42057
+ /**
42058
+ * Recursively converts an object to a JSON-compatible object, handling circular references and Buffers.
42059
+ *
42060
+ * @param {Object} obj - The object to convert.
42061
+ * @returns {Object} The JSON-compatible object.
42062
+ */
41961
42063
  const toJSONObject = (obj) => {
41962
42064
  const stack = new Array(10);
41963
42065
 
41964
42066
  const visit = (source, i) => {
41965
-
41966
42067
  if (isObject(source)) {
41967
42068
  if (stack.indexOf(source) >= 0) {
41968
42069
  return;
@@ -41973,7 +42074,7 @@ const toJSONObject = (obj) => {
41973
42074
  return source;
41974
42075
  }
41975
42076
 
41976
- if(!('toJSON' in source)) {
42077
+ if (!('toJSON' in source)) {
41977
42078
  stack[i] = source;
41978
42079
  const target = isArray(source) ? [] : {};
41979
42080
 
@@ -41994,45 +42095,77 @@ const toJSONObject = (obj) => {
41994
42095
  return visit(obj, 0);
41995
42096
  };
41996
42097
 
42098
+ /**
42099
+ * Determines if a value is an async function.
42100
+ *
42101
+ * @param {*} thing - The value to test.
42102
+ * @returns {boolean} True if value is an async function, otherwise false.
42103
+ */
41997
42104
  const isAsyncFn = kindOfTest('AsyncFunction');
41998
42105
 
42106
+ /**
42107
+ * Determines if a value is thenable (has then and catch methods).
42108
+ *
42109
+ * @param {*} thing - The value to test.
42110
+ * @returns {boolean} True if value is thenable, otherwise false.
42111
+ */
41999
42112
  const isThenable = (thing) =>
42000
- thing && (isObject(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
42113
+ thing &&
42114
+ (isObject(thing) || isFunction$1(thing)) &&
42115
+ isFunction$1(thing.then) &&
42116
+ isFunction$1(thing.catch);
42001
42117
 
42002
42118
  // original code
42003
42119
  // https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34
42004
42120
 
42121
+ /**
42122
+ * Provides a cross-platform setImmediate implementation.
42123
+ * Uses native setImmediate if available, otherwise falls back to postMessage or setTimeout.
42124
+ *
42125
+ * @param {boolean} setImmediateSupported - Whether setImmediate is supported.
42126
+ * @param {boolean} postMessageSupported - Whether postMessage is supported.
42127
+ * @returns {Function} A function to schedule a callback asynchronously.
42128
+ */
42005
42129
  const _setImmediate = ((setImmediateSupported, postMessageSupported) => {
42006
42130
  if (setImmediateSupported) {
42007
42131
  return setImmediate;
42008
42132
  }
42009
42133
 
42010
- return postMessageSupported ? ((token, callbacks) => {
42011
- _global.addEventListener("message", ({source, data}) => {
42012
- if (source === _global && data === token) {
42013
- callbacks.length && callbacks.shift()();
42014
- }
42015
- }, false);
42134
+ return postMessageSupported
42135
+ ? ((token, callbacks) => {
42136
+ _global.addEventListener(
42137
+ 'message',
42138
+ ({ source, data }) => {
42139
+ if (source === _global && data === token) {
42140
+ callbacks.length && callbacks.shift()();
42141
+ }
42142
+ },
42143
+ false
42144
+ );
42016
42145
 
42017
- return (cb) => {
42018
- callbacks.push(cb);
42019
- _global.postMessage(token, "*");
42020
- }
42021
- })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);
42022
- })(
42023
- typeof setImmediate === 'function',
42024
- isFunction$1(_global.postMessage)
42025
- );
42146
+ return (cb) => {
42147
+ callbacks.push(cb);
42148
+ _global.postMessage(token, '*');
42149
+ };
42150
+ })(`axios@${Math.random()}`, [])
42151
+ : (cb) => setTimeout(cb);
42152
+ })(typeof setImmediate === 'function', isFunction$1(_global.postMessage));
42026
42153
 
42027
- const asap = typeof queueMicrotask !== 'undefined' ?
42028
- queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);
42154
+ /**
42155
+ * Schedules a microtask or asynchronous callback as soon as possible.
42156
+ * Uses queueMicrotask if available, otherwise falls back to process.nextTick or _setImmediate.
42157
+ *
42158
+ * @type {Function}
42159
+ */
42160
+ const asap =
42161
+ typeof queueMicrotask !== 'undefined'
42162
+ ? queueMicrotask.bind(_global)
42163
+ : (typeof process !== 'undefined' && process.nextTick) || _setImmediate;
42029
42164
 
42030
42165
  // *********************
42031
42166
 
42032
-
42033
42167
  const isIterable = (thing) => thing != null && isFunction$1(thing[iterator]);
42034
42168
 
42035
-
42036
42169
  var utils$1 = {
42037
42170
  isArray,
42038
42171
  isArrayBuffer,
@@ -42052,6 +42185,8 @@ var utils$1 = {
42052
42185
  isUndefined,
42053
42186
  isDate,
42054
42187
  isFile,
42188
+ isReactNativeBlob,
42189
+ isReactNative,
42055
42190
  isBlob,
42056
42191
  isRegExp,
42057
42192
  isFunction: isFunction$1,
@@ -42090,61 +42225,78 @@ var utils$1 = {
42090
42225
  isThenable,
42091
42226
  setImmediate: _setImmediate,
42092
42227
  asap,
42093
- isIterable
42228
+ isIterable,
42094
42229
  };
42095
42230
 
42096
42231
  class AxiosError extends Error {
42097
- static from(error, code, config, request, response, customProps) {
42098
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
42099
- axiosError.cause = error;
42100
- axiosError.name = error.name;
42101
- customProps && Object.assign(axiosError, customProps);
42102
- return axiosError;
42103
- }
42232
+ static from(error, code, config, request, response, customProps) {
42233
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
42234
+ axiosError.cause = error;
42235
+ axiosError.name = error.name;
42104
42236
 
42105
- /**
42106
- * Create an Error with the specified message, config, error code, request and response.
42107
- *
42108
- * @param {string} message The error message.
42109
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
42110
- * @param {Object} [config] The config.
42111
- * @param {Object} [request] The request.
42112
- * @param {Object} [response] The response.
42113
- *
42114
- * @returns {Error} The created error.
42115
- */
42116
- constructor(message, code, config, request, response) {
42117
- super(message);
42118
- this.name = 'AxiosError';
42119
- this.isAxiosError = true;
42120
- code && (this.code = code);
42121
- config && (this.config = config);
42122
- request && (this.request = request);
42123
- if (response) {
42124
- this.response = response;
42125
- this.status = response.status;
42126
- }
42237
+ // Preserve status from the original error if not already set from response
42238
+ if (error.status != null && axiosError.status == null) {
42239
+ axiosError.status = error.status;
42127
42240
  }
42128
42241
 
42129
- toJSON() {
42130
- return {
42131
- // Standard
42132
- message: this.message,
42133
- name: this.name,
42134
- // Microsoft
42135
- description: this.description,
42136
- number: this.number,
42137
- // Mozilla
42138
- fileName: this.fileName,
42139
- lineNumber: this.lineNumber,
42140
- columnNumber: this.columnNumber,
42141
- stack: this.stack,
42142
- // Axios
42143
- config: utils$1.toJSONObject(this.config),
42144
- code: this.code,
42145
- status: this.status,
42146
- };
42242
+ customProps && Object.assign(axiosError, customProps);
42243
+ return axiosError;
42244
+ }
42245
+
42246
+ /**
42247
+ * Create an Error with the specified message, config, error code, request and response.
42248
+ *
42249
+ * @param {string} message The error message.
42250
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
42251
+ * @param {Object} [config] The config.
42252
+ * @param {Object} [request] The request.
42253
+ * @param {Object} [response] The response.
42254
+ *
42255
+ * @returns {Error} The created error.
42256
+ */
42257
+ constructor(message, code, config, request, response) {
42258
+ super(message);
42259
+
42260
+ // Make message enumerable to maintain backward compatibility
42261
+ // The native Error constructor sets message as non-enumerable,
42262
+ // but axios < v1.13.3 had it as enumerable
42263
+ Object.defineProperty(this, 'message', {
42264
+ value: message,
42265
+ enumerable: true,
42266
+ writable: true,
42267
+ configurable: true,
42268
+ });
42269
+
42270
+ this.name = 'AxiosError';
42271
+ this.isAxiosError = true;
42272
+ code && (this.code = code);
42273
+ config && (this.config = config);
42274
+ request && (this.request = request);
42275
+ if (response) {
42276
+ this.response = response;
42277
+ this.status = response.status;
42147
42278
  }
42279
+ }
42280
+
42281
+ toJSON() {
42282
+ return {
42283
+ // Standard
42284
+ message: this.message,
42285
+ name: this.name,
42286
+ // Microsoft
42287
+ description: this.description,
42288
+ number: this.number,
42289
+ // Mozilla
42290
+ fileName: this.fileName,
42291
+ lineNumber: this.lineNumber,
42292
+ columnNumber: this.columnNumber,
42293
+ stack: this.stack,
42294
+ // Axios
42295
+ config: utils$1.toJSONObject(this.config),
42296
+ code: this.code,
42297
+ status: this.status,
42298
+ };
42299
+ }
42148
42300
  }
42149
42301
 
42150
42302
  // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
@@ -42160,8 +42312,7 @@ AxiosError.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
42160
42312
  AxiosError.ERR_CANCELED = 'ERR_CANCELED';
42161
42313
  AxiosError.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
42162
42314
  AxiosError.ERR_INVALID_URL = 'ERR_INVALID_URL';
42163
-
42164
- var AxiosError$1 = AxiosError;
42315
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
42165
42316
 
42166
42317
  // eslint-disable-next-line strict
42167
42318
  var httpAdapter = null;
@@ -42199,11 +42350,14 @@ function removeBrackets(key) {
42199
42350
  */
42200
42351
  function renderKey(path, key, dots) {
42201
42352
  if (!path) return key;
42202
- return path.concat(key).map(function each(token, i) {
42203
- // eslint-disable-next-line no-param-reassign
42204
- token = removeBrackets(token);
42205
- return !dots && i ? '[' + token + ']' : token;
42206
- }).join(dots ? '.' : '');
42353
+ return path
42354
+ .concat(key)
42355
+ .map(function each(token, i) {
42356
+ // eslint-disable-next-line no-param-reassign
42357
+ token = removeBrackets(token);
42358
+ return !dots && i ? '[' + token + ']' : token;
42359
+ })
42360
+ .join(dots ? '.' : '');
42207
42361
  }
42208
42362
 
42209
42363
  /**
@@ -42253,21 +42407,27 @@ function toFormData(obj, formData, options) {
42253
42407
  formData = formData || new (FormData)();
42254
42408
 
42255
42409
  // eslint-disable-next-line no-param-reassign
42256
- options = utils$1.toFlatObject(options, {
42257
- metaTokens: true,
42258
- dots: false,
42259
- indexes: false
42260
- }, false, function defined(option, source) {
42261
- // eslint-disable-next-line no-eq-null,eqeqeq
42262
- return !utils$1.isUndefined(source[option]);
42263
- });
42410
+ options = utils$1.toFlatObject(
42411
+ options,
42412
+ {
42413
+ metaTokens: true,
42414
+ dots: false,
42415
+ indexes: false,
42416
+ },
42417
+ false,
42418
+ function defined(option, source) {
42419
+ // eslint-disable-next-line no-eq-null,eqeqeq
42420
+ return !utils$1.isUndefined(source[option]);
42421
+ }
42422
+ );
42264
42423
 
42265
42424
  const metaTokens = options.metaTokens;
42266
42425
  // eslint-disable-next-line no-use-before-define
42267
42426
  const visitor = options.visitor || defaultVisitor;
42268
42427
  const dots = options.dots;
42269
42428
  const indexes = options.indexes;
42270
- const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;
42429
+ const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
42430
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
42271
42431
  const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
42272
42432
 
42273
42433
  if (!utils$1.isFunction(visitor)) {
@@ -42286,7 +42446,7 @@ function toFormData(obj, formData, options) {
42286
42446
  }
42287
42447
 
42288
42448
  if (!useBlob && utils$1.isBlob(value)) {
42289
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
42449
+ throw new AxiosError('Blob is not supported. Use a Buffer instead.');
42290
42450
  }
42291
42451
 
42292
42452
  if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
@@ -42309,6 +42469,11 @@ function toFormData(obj, formData, options) {
42309
42469
  function defaultVisitor(value, key, path) {
42310
42470
  let arr = value;
42311
42471
 
42472
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
42473
+ formData.append(renderKey(path, key, dots), convertValue(value));
42474
+ return false;
42475
+ }
42476
+
42312
42477
  if (value && !path && typeof value === 'object') {
42313
42478
  if (utils$1.endsWith(key, '{}')) {
42314
42479
  // eslint-disable-next-line no-param-reassign
@@ -42317,17 +42482,22 @@ function toFormData(obj, formData, options) {
42317
42482
  value = JSON.stringify(value);
42318
42483
  } else if (
42319
42484
  (utils$1.isArray(value) && isFlatArray(value)) ||
42320
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value))
42321
- )) {
42485
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
42486
+ ) {
42322
42487
  // eslint-disable-next-line no-param-reassign
42323
42488
  key = removeBrackets(key);
42324
42489
 
42325
42490
  arr.forEach(function each(el, index) {
42326
- !(utils$1.isUndefined(el) || el === null) && formData.append(
42327
- // eslint-disable-next-line no-nested-ternary
42328
- indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),
42329
- convertValue(el)
42330
- );
42491
+ !(utils$1.isUndefined(el) || el === null) &&
42492
+ formData.append(
42493
+ // eslint-disable-next-line no-nested-ternary
42494
+ indexes === true
42495
+ ? renderKey([key], index, dots)
42496
+ : indexes === null
42497
+ ? key
42498
+ : key + '[]',
42499
+ convertValue(el)
42500
+ );
42331
42501
  });
42332
42502
  return false;
42333
42503
  }
@@ -42347,12 +42517,19 @@ function toFormData(obj, formData, options) {
42347
42517
  const exposedHelpers = Object.assign(predicates, {
42348
42518
  defaultVisitor,
42349
42519
  convertValue,
42350
- isVisitable
42520
+ isVisitable,
42351
42521
  });
42352
42522
 
42353
- function build(value, path) {
42523
+ function build(value, path, depth = 0) {
42354
42524
  if (utils$1.isUndefined(value)) return;
42355
42525
 
42526
+ if (depth > maxDepth) {
42527
+ throw new AxiosError(
42528
+ 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
42529
+ AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
42530
+ );
42531
+ }
42532
+
42356
42533
  if (stack.indexOf(value) !== -1) {
42357
42534
  throw Error('Circular reference detected in ' + path.join('.'));
42358
42535
  }
@@ -42360,12 +42537,12 @@ function toFormData(obj, formData, options) {
42360
42537
  stack.push(value);
42361
42538
 
42362
42539
  utils$1.forEach(value, function each(el, key) {
42363
- const result = !(utils$1.isUndefined(el) || el === null) && visitor.call(
42364
- formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers
42365
- );
42540
+ const result =
42541
+ !(utils$1.isUndefined(el) || el === null) &&
42542
+ visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
42366
42543
 
42367
42544
  if (result === true) {
42368
- build(el, path ? path.concat(key) : [key]);
42545
+ build(el, path ? path.concat(key) : [key], depth + 1);
42369
42546
  }
42370
42547
  });
42371
42548
 
@@ -42397,9 +42574,8 @@ function encode$1(str) {
42397
42574
  ')': '%29',
42398
42575
  '~': '%7E',
42399
42576
  '%20': '+',
42400
- '%00': '\x00'
42401
42577
  };
42402
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
42578
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
42403
42579
  return charMap[match];
42404
42580
  });
42405
42581
  }
@@ -42425,29 +42601,33 @@ prototype.append = function append(name, value) {
42425
42601
  };
42426
42602
 
42427
42603
  prototype.toString = function toString(encoder) {
42428
- const _encode = encoder ? function(value) {
42429
- return encoder.call(this, value, encode$1);
42430
- } : encode$1;
42604
+ const _encode = encoder
42605
+ ? function (value) {
42606
+ return encoder.call(this, value, encode$1);
42607
+ }
42608
+ : encode$1;
42431
42609
 
42432
- return this._pairs.map(function each(pair) {
42433
- return _encode(pair[0]) + '=' + _encode(pair[1]);
42434
- }, '').join('&');
42610
+ return this._pairs
42611
+ .map(function each(pair) {
42612
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
42613
+ }, '')
42614
+ .join('&');
42435
42615
  };
42436
42616
 
42437
42617
  /**
42438
- * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their
42439
- * URI encoded counterparts
42618
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
42619
+ * their plain counterparts (`:`, `$`, `,`, `+`).
42440
42620
  *
42441
42621
  * @param {string} val The value to be encoded.
42442
42622
  *
42443
42623
  * @returns {string} The encoded value.
42444
42624
  */
42445
42625
  function encode(val) {
42446
- return encodeURIComponent(val).
42447
- replace(/%3A/gi, ':').
42448
- replace(/%24/g, '$').
42449
- replace(/%2C/gi, ',').
42450
- replace(/%20/g, '+');
42626
+ return encodeURIComponent(val)
42627
+ .replace(/%3A/gi, ':')
42628
+ .replace(/%24/g, '$')
42629
+ .replace(/%2C/gi, ',')
42630
+ .replace(/%20/g, '+');
42451
42631
  }
42452
42632
 
42453
42633
  /**
@@ -42464,11 +42644,13 @@ function buildURL(url, params, options) {
42464
42644
  return url;
42465
42645
  }
42466
42646
 
42467
- const _encode = options && options.encode || encode;
42647
+ const _encode = (options && options.encode) || encode;
42468
42648
 
42469
- const _options = utils$1.isFunction(options) ? {
42470
- serialize: options
42471
- } : options;
42649
+ const _options = utils$1.isFunction(options)
42650
+ ? {
42651
+ serialize: options,
42652
+ }
42653
+ : options;
42472
42654
 
42473
42655
  const serializeFn = _options && _options.serialize;
42474
42656
 
@@ -42477,13 +42659,13 @@ function buildURL(url, params, options) {
42477
42659
  if (serializeFn) {
42478
42660
  serializedParams = serializeFn(params, _options);
42479
42661
  } else {
42480
- serializedParams = utils$1.isURLSearchParams(params) ?
42481
- params.toString() :
42482
- new AxiosURLSearchParams(params, _options).toString(_encode);
42662
+ serializedParams = utils$1.isURLSearchParams(params)
42663
+ ? params.toString()
42664
+ : new AxiosURLSearchParams(params, _options).toString(_encode);
42483
42665
  }
42484
42666
 
42485
42667
  if (serializedParams) {
42486
- const hashmarkIndex = url.indexOf("#");
42668
+ const hashmarkIndex = url.indexOf('#');
42487
42669
 
42488
42670
  if (hashmarkIndex !== -1) {
42489
42671
  url = url.slice(0, hashmarkIndex);
@@ -42513,7 +42695,7 @@ class InterceptorManager {
42513
42695
  fulfilled,
42514
42696
  rejected,
42515
42697
  synchronous: options ? options.synchronous : false,
42516
- runWhen: options ? options.runWhen : null
42698
+ runWhen: options ? options.runWhen : null,
42517
42699
  });
42518
42700
  return this.handlers.length - 1;
42519
42701
  }
@@ -42561,12 +42743,11 @@ class InterceptorManager {
42561
42743
  }
42562
42744
  }
42563
42745
 
42564
- var InterceptorManager$1 = InterceptorManager;
42565
-
42566
42746
  var transitionalDefaults = {
42567
42747
  silentJSONParsing: true,
42568
42748
  forcedJSONParsing: true,
42569
- clarifyTimeoutError: false
42749
+ clarifyTimeoutError: false,
42750
+ legacyInterceptorReqResOrdering: true,
42570
42751
  };
42571
42752
 
42572
42753
  var URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
@@ -42580,14 +42761,14 @@ var platform$1 = {
42580
42761
  classes: {
42581
42762
  URLSearchParams: URLSearchParams$1,
42582
42763
  FormData: FormData$1,
42583
- Blob: Blob$1
42764
+ Blob: Blob$1,
42584
42765
  },
42585
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data']
42766
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
42586
42767
  };
42587
42768
 
42588
42769
  const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
42589
42770
 
42590
- const _navigator = typeof navigator === 'object' && navigator || undefined;
42771
+ const _navigator = (typeof navigator === 'object' && navigator) || undefined;
42591
42772
 
42592
42773
  /**
42593
42774
  * Determine if we're running in a standard browser environment
@@ -42606,7 +42787,8 @@ const _navigator = typeof navigator === 'object' && navigator || undefined;
42606
42787
  *
42607
42788
  * @returns {boolean}
42608
42789
  */
42609
- const hasStandardBrowserEnv = hasBrowserEnv &&
42790
+ const hasStandardBrowserEnv =
42791
+ hasBrowserEnv &&
42610
42792
  (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
42611
42793
 
42612
42794
  /**
@@ -42627,25 +42809,25 @@ const hasStandardBrowserWebWorkerEnv = (() => {
42627
42809
  );
42628
42810
  })();
42629
42811
 
42630
- const origin = hasBrowserEnv && window.location.href || 'http://localhost';
42812
+ const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
42631
42813
 
42632
42814
  var utils = /*#__PURE__*/Object.freeze({
42633
42815
  __proto__: null,
42634
42816
  hasBrowserEnv: hasBrowserEnv,
42635
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
42636
42817
  hasStandardBrowserEnv: hasStandardBrowserEnv,
42818
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
42637
42819
  navigator: _navigator,
42638
42820
  origin: origin
42639
42821
  });
42640
42822
 
42641
42823
  var platform = {
42642
42824
  ...utils,
42643
- ...platform$1
42825
+ ...platform$1,
42644
42826
  };
42645
42827
 
42646
42828
  function toURLEncodedForm(data, options) {
42647
42829
  return toFormData(data, new platform.classes.URLSearchParams(), {
42648
- visitor: function(value, key, path, helpers) {
42830
+ visitor: function (value, key, path, helpers) {
42649
42831
  if (platform.isNode && utils$1.isBuffer(value)) {
42650
42832
  this.append(key, value.toString('base64'));
42651
42833
  return false;
@@ -42653,7 +42835,7 @@ function toURLEncodedForm(data, options) {
42653
42835
 
42654
42836
  return helpers.defaultVisitor.apply(this, arguments);
42655
42837
  },
42656
- ...options
42838
+ ...options,
42657
42839
  });
42658
42840
  }
42659
42841
 
@@ -42669,7 +42851,7 @@ function parsePropPath(name) {
42669
42851
  // foo.x.y.z
42670
42852
  // foo-x-y-z
42671
42853
  // foo x y z
42672
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map(match => {
42854
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
42673
42855
  return match[0] === '[]' ? '' : match[1] || match[0];
42674
42856
  });
42675
42857
  }
@@ -42713,7 +42895,9 @@ function formDataToJSON(formData) {
42713
42895
 
42714
42896
  if (isLast) {
42715
42897
  if (utils$1.hasOwnProp(target, name)) {
42716
- target[name] = [target[name], value];
42898
+ target[name] = utils$1.isArray(target[name])
42899
+ ? target[name].concat(value)
42900
+ : [target[name], value];
42717
42901
  } else {
42718
42902
  target[name] = value;
42719
42903
  }
@@ -42747,6 +42931,8 @@ function formDataToJSON(formData) {
42747
42931
  return null;
42748
42932
  }
42749
42933
 
42934
+ const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
42935
+
42750
42936
  /**
42751
42937
  * It takes a string, tries to parse it, and if it fails, it returns the stringified version
42752
42938
  * of the input
@@ -42773,96 +42959,110 @@ function stringifySafely(rawValue, parser, encoder) {
42773
42959
  }
42774
42960
 
42775
42961
  const defaults = {
42776
-
42777
42962
  transitional: transitionalDefaults,
42778
42963
 
42779
42964
  adapter: ['xhr', 'http', 'fetch'],
42780
42965
 
42781
- transformRequest: [function transformRequest(data, headers) {
42782
- const contentType = headers.getContentType() || '';
42783
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
42784
- const isObjectPayload = utils$1.isObject(data);
42966
+ transformRequest: [
42967
+ function transformRequest(data, headers) {
42968
+ const contentType = headers.getContentType() || '';
42969
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
42970
+ const isObjectPayload = utils$1.isObject(data);
42785
42971
 
42786
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
42787
- data = new FormData(data);
42788
- }
42972
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
42973
+ data = new FormData(data);
42974
+ }
42789
42975
 
42790
- const isFormData = utils$1.isFormData(data);
42976
+ const isFormData = utils$1.isFormData(data);
42791
42977
 
42792
- if (isFormData) {
42793
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
42794
- }
42978
+ if (isFormData) {
42979
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
42980
+ }
42795
42981
 
42796
- if (utils$1.isArrayBuffer(data) ||
42797
- utils$1.isBuffer(data) ||
42798
- utils$1.isStream(data) ||
42799
- utils$1.isFile(data) ||
42800
- utils$1.isBlob(data) ||
42801
- utils$1.isReadableStream(data)
42802
- ) {
42803
- return data;
42804
- }
42805
- if (utils$1.isArrayBufferView(data)) {
42806
- return data.buffer;
42807
- }
42808
- if (utils$1.isURLSearchParams(data)) {
42809
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
42810
- return data.toString();
42811
- }
42982
+ if (
42983
+ utils$1.isArrayBuffer(data) ||
42984
+ utils$1.isBuffer(data) ||
42985
+ utils$1.isStream(data) ||
42986
+ utils$1.isFile(data) ||
42987
+ utils$1.isBlob(data) ||
42988
+ utils$1.isReadableStream(data)
42989
+ ) {
42990
+ return data;
42991
+ }
42992
+ if (utils$1.isArrayBufferView(data)) {
42993
+ return data.buffer;
42994
+ }
42995
+ if (utils$1.isURLSearchParams(data)) {
42996
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
42997
+ return data.toString();
42998
+ }
42812
42999
 
42813
- let isFileList;
43000
+ let isFileList;
42814
43001
 
42815
- if (isObjectPayload) {
42816
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
42817
- return toURLEncodedForm(data, this.formSerializer).toString();
42818
- }
43002
+ if (isObjectPayload) {
43003
+ const formSerializer = own(this, 'formSerializer');
43004
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
43005
+ return toURLEncodedForm(data, formSerializer).toString();
43006
+ }
42819
43007
 
42820
- if ((isFileList = utils$1.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {
42821
- const _FormData = this.env && this.env.FormData;
43008
+ if (
43009
+ (isFileList = utils$1.isFileList(data)) ||
43010
+ contentType.indexOf('multipart/form-data') > -1
43011
+ ) {
43012
+ const env = own(this, 'env');
43013
+ const _FormData = env && env.FormData;
42822
43014
 
42823
- return toFormData(
42824
- isFileList ? {'files[]': data} : data,
42825
- _FormData && new _FormData(),
42826
- this.formSerializer
42827
- );
43015
+ return toFormData(
43016
+ isFileList ? { 'files[]': data } : data,
43017
+ _FormData && new _FormData(),
43018
+ formSerializer
43019
+ );
43020
+ }
42828
43021
  }
42829
- }
42830
43022
 
42831
- if (isObjectPayload || hasJSONContentType ) {
42832
- headers.setContentType('application/json', false);
42833
- return stringifySafely(data);
42834
- }
43023
+ if (isObjectPayload || hasJSONContentType) {
43024
+ headers.setContentType('application/json', false);
43025
+ return stringifySafely(data);
43026
+ }
42835
43027
 
42836
- return data;
42837
- }],
43028
+ return data;
43029
+ },
43030
+ ],
42838
43031
 
42839
- transformResponse: [function transformResponse(data) {
42840
- const transitional = this.transitional || defaults.transitional;
42841
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
42842
- const JSONRequested = this.responseType === 'json';
43032
+ transformResponse: [
43033
+ function transformResponse(data) {
43034
+ const transitional = own(this, 'transitional') || defaults.transitional;
43035
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
43036
+ const responseType = own(this, 'responseType');
43037
+ const JSONRequested = responseType === 'json';
42843
43038
 
42844
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
42845
- return data;
42846
- }
43039
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
43040
+ return data;
43041
+ }
42847
43042
 
42848
- if (data && utils$1.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
42849
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
42850
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
43043
+ if (
43044
+ data &&
43045
+ utils$1.isString(data) &&
43046
+ ((forcedJSONParsing && !responseType) || JSONRequested)
43047
+ ) {
43048
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
43049
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
42851
43050
 
42852
- try {
42853
- return JSON.parse(data, this.parseReviver);
42854
- } catch (e) {
42855
- if (strictJSONParsing) {
42856
- if (e.name === 'SyntaxError') {
42857
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, this.response);
43051
+ try {
43052
+ return JSON.parse(data, own(this, 'parseReviver'));
43053
+ } catch (e) {
43054
+ if (strictJSONParsing) {
43055
+ if (e.name === 'SyntaxError') {
43056
+ throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
43057
+ }
43058
+ throw e;
42858
43059
  }
42859
- throw e;
42860
43060
  }
42861
43061
  }
42862
- }
42863
43062
 
42864
- return data;
42865
- }],
43063
+ return data;
43064
+ },
43065
+ ],
42866
43066
 
42867
43067
  /**
42868
43068
  * A timeout in milliseconds to abort a request. If set to 0 (default) a
@@ -42878,7 +43078,7 @@ const defaults = {
42878
43078
 
42879
43079
  env: {
42880
43080
  FormData: platform.classes.FormData,
42881
- Blob: platform.classes.Blob
43081
+ Blob: platform.classes.Blob,
42882
43082
  },
42883
43083
 
42884
43084
  validateStatus: function validateStatus(status) {
@@ -42887,25 +43087,36 @@ const defaults = {
42887
43087
 
42888
43088
  headers: {
42889
43089
  common: {
42890
- 'Accept': 'application/json, text/plain, */*',
42891
- 'Content-Type': undefined
42892
- }
42893
- }
43090
+ Accept: 'application/json, text/plain, */*',
43091
+ 'Content-Type': undefined,
43092
+ },
43093
+ },
42894
43094
  };
42895
43095
 
42896
43096
  utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
42897
43097
  defaults.headers[method] = {};
42898
43098
  });
42899
43099
 
42900
- var defaults$1 = defaults;
42901
-
42902
43100
  // RawAxiosHeaders whose duplicates are ignored by node
42903
43101
  // c.f. https://nodejs.org/api/http.html#http_message_headers
42904
43102
  const ignoreDuplicateOf = utils$1.toObjectSet([
42905
- 'age', 'authorization', 'content-length', 'content-type', 'etag',
42906
- 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
42907
- 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
42908
- 'referer', 'retry-after', 'user-agent'
43103
+ 'age',
43104
+ 'authorization',
43105
+ 'content-length',
43106
+ 'content-type',
43107
+ 'etag',
43108
+ 'expires',
43109
+ 'from',
43110
+ 'host',
43111
+ 'if-modified-since',
43112
+ 'if-unmodified-since',
43113
+ 'last-modified',
43114
+ 'location',
43115
+ 'max-forwards',
43116
+ 'proxy-authorization',
43117
+ 'referer',
43118
+ 'retry-after',
43119
+ 'user-agent',
42909
43120
  ]);
42910
43121
 
42911
43122
  /**
@@ -42922,47 +43133,81 @@ const ignoreDuplicateOf = utils$1.toObjectSet([
42922
43133
  *
42923
43134
  * @returns {Object} Headers parsed into an object
42924
43135
  */
42925
- var parseHeaders = rawHeaders => {
43136
+ var parseHeaders = (rawHeaders) => {
42926
43137
  const parsed = {};
42927
43138
  let key;
42928
43139
  let val;
42929
43140
  let i;
42930
43141
 
42931
- rawHeaders && rawHeaders.split('\n').forEach(function parser(line) {
42932
- i = line.indexOf(':');
42933
- key = line.substring(0, i).trim().toLowerCase();
42934
- val = line.substring(i + 1).trim();
43142
+ rawHeaders &&
43143
+ rawHeaders.split('\n').forEach(function parser(line) {
43144
+ i = line.indexOf(':');
43145
+ key = line.substring(0, i).trim().toLowerCase();
43146
+ val = line.substring(i + 1).trim();
42935
43147
 
42936
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
42937
- return;
42938
- }
43148
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
43149
+ return;
43150
+ }
42939
43151
 
42940
- if (key === 'set-cookie') {
42941
- if (parsed[key]) {
42942
- parsed[key].push(val);
43152
+ if (key === 'set-cookie') {
43153
+ if (parsed[key]) {
43154
+ parsed[key].push(val);
43155
+ } else {
43156
+ parsed[key] = [val];
43157
+ }
42943
43158
  } else {
42944
- parsed[key] = [val];
43159
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
42945
43160
  }
42946
- } else {
42947
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
42948
- }
42949
- });
43161
+ });
42950
43162
 
42951
43163
  return parsed;
42952
43164
  };
42953
43165
 
42954
43166
  const $internals = Symbol('internals');
42955
43167
 
43168
+ const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
43169
+
43170
+ function trimSPorHTAB(str) {
43171
+ let start = 0;
43172
+ let end = str.length;
43173
+
43174
+ while (start < end) {
43175
+ const code = str.charCodeAt(start);
43176
+
43177
+ if (code !== 0x09 && code !== 0x20) {
43178
+ break;
43179
+ }
43180
+
43181
+ start += 1;
43182
+ }
43183
+
43184
+ while (end > start) {
43185
+ const code = str.charCodeAt(end - 1);
43186
+
43187
+ if (code !== 0x09 && code !== 0x20) {
43188
+ break;
43189
+ }
43190
+
43191
+ end -= 1;
43192
+ }
43193
+
43194
+ return start === 0 && end === str.length ? str : str.slice(start, end);
43195
+ }
43196
+
42956
43197
  function normalizeHeader(header) {
42957
43198
  return header && String(header).trim().toLowerCase();
42958
43199
  }
42959
43200
 
43201
+ function sanitizeHeaderValue(str) {
43202
+ return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
43203
+ }
43204
+
42960
43205
  function normalizeValue(value) {
42961
43206
  if (value === false || value == null) {
42962
43207
  return value;
42963
43208
  }
42964
43209
 
42965
- return utils$1.isArray(value) ? value.map(normalizeValue) : String(value);
43210
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
42966
43211
  }
42967
43212
 
42968
43213
  function parseTokens(str) {
@@ -43000,8 +43245,10 @@ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
43000
43245
  }
43001
43246
 
43002
43247
  function formatHeader(header) {
43003
- return header.trim()
43004
- .toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
43248
+ return header
43249
+ .trim()
43250
+ .toLowerCase()
43251
+ .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
43005
43252
  return char.toUpperCase() + str;
43006
43253
  });
43007
43254
  }
@@ -43009,12 +43256,12 @@ function formatHeader(header) {
43009
43256
  function buildAccessors(obj, header) {
43010
43257
  const accessorName = utils$1.toCamelCase(' ' + header);
43011
43258
 
43012
- ['get', 'set', 'has'].forEach(methodName => {
43259
+ ['get', 'set', 'has'].forEach((methodName) => {
43013
43260
  Object.defineProperty(obj, methodName + accessorName, {
43014
- value: function(arg1, arg2, arg3) {
43261
+ value: function (arg1, arg2, arg3) {
43015
43262
  return this[methodName].call(this, header, arg1, arg2, arg3);
43016
43263
  },
43017
- configurable: true
43264
+ configurable: true,
43018
43265
  });
43019
43266
  });
43020
43267
  }
@@ -43036,7 +43283,12 @@ class AxiosHeaders {
43036
43283
 
43037
43284
  const key = utils$1.findKey(self, lHeader);
43038
43285
 
43039
- if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
43286
+ if (
43287
+ !key ||
43288
+ self[key] === undefined ||
43289
+ _rewrite === true ||
43290
+ (_rewrite === undefined && self[key] !== false)
43291
+ ) {
43040
43292
  self[key || _header] = normalizeValue(_value);
43041
43293
  }
43042
43294
  }
@@ -43046,17 +43298,22 @@ class AxiosHeaders {
43046
43298
 
43047
43299
  if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
43048
43300
  setHeaders(header, valueOrRewrite);
43049
- } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
43301
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
43050
43302
  setHeaders(parseHeaders(header), valueOrRewrite);
43051
43303
  } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
43052
- let obj = {}, dest, key;
43304
+ let obj = {},
43305
+ dest,
43306
+ key;
43053
43307
  for (const entry of header) {
43054
43308
  if (!utils$1.isArray(entry)) {
43055
43309
  throw TypeError('Object iterator must return a key-value pair');
43056
43310
  }
43057
43311
 
43058
- obj[key = entry[0]] = (dest = obj[key]) ?
43059
- (utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
43312
+ obj[(key = entry[0])] = (dest = obj[key])
43313
+ ? utils$1.isArray(dest)
43314
+ ? [...dest, entry[1]]
43315
+ : [dest, entry[1]]
43316
+ : entry[1];
43060
43317
  }
43061
43318
 
43062
43319
  setHeaders(obj, valueOrRewrite);
@@ -43103,7 +43360,11 @@ class AxiosHeaders {
43103
43360
  if (header) {
43104
43361
  const key = utils$1.findKey(this, header);
43105
43362
 
43106
- return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
43363
+ return !!(
43364
+ key &&
43365
+ this[key] !== undefined &&
43366
+ (!matcher || matchHeaderValue(this, this[key], key, matcher))
43367
+ );
43107
43368
  }
43108
43369
 
43109
43370
  return false;
@@ -43143,7 +43404,7 @@ class AxiosHeaders {
43143
43404
 
43144
43405
  while (i--) {
43145
43406
  const key = keys[i];
43146
- if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
43407
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
43147
43408
  delete this[key];
43148
43409
  deleted = true;
43149
43410
  }
@@ -43187,7 +43448,9 @@ class AxiosHeaders {
43187
43448
  const obj = Object.create(null);
43188
43449
 
43189
43450
  utils$1.forEach(this, (value, header) => {
43190
- value != null && value !== false && (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
43451
+ value != null &&
43452
+ value !== false &&
43453
+ (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
43191
43454
  });
43192
43455
 
43193
43456
  return obj;
@@ -43198,11 +43461,13 @@ class AxiosHeaders {
43198
43461
  }
43199
43462
 
43200
43463
  toString() {
43201
- return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
43464
+ return Object.entries(this.toJSON())
43465
+ .map(([header, value]) => header + ': ' + value)
43466
+ .join('\n');
43202
43467
  }
43203
43468
 
43204
43469
  getSetCookie() {
43205
- return this.get("set-cookie") || [];
43470
+ return this.get('set-cookie') || [];
43206
43471
  }
43207
43472
 
43208
43473
  get [Symbol.toStringTag]() {
@@ -43222,9 +43487,12 @@ class AxiosHeaders {
43222
43487
  }
43223
43488
 
43224
43489
  static accessor(header) {
43225
- const internals = this[$internals] = (this[$internals] = {
43226
- accessors: {}
43227
- });
43490
+ const internals =
43491
+ (this[$internals] =
43492
+ this[$internals] =
43493
+ {
43494
+ accessors: {},
43495
+ });
43228
43496
 
43229
43497
  const accessors = internals.accessors;
43230
43498
  const prototype = this.prototype;
@@ -43244,23 +43512,28 @@ class AxiosHeaders {
43244
43512
  }
43245
43513
  }
43246
43514
 
43247
- AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
43515
+ AxiosHeaders.accessor([
43516
+ 'Content-Type',
43517
+ 'Content-Length',
43518
+ 'Accept',
43519
+ 'Accept-Encoding',
43520
+ 'User-Agent',
43521
+ 'Authorization',
43522
+ ]);
43248
43523
 
43249
43524
  // reserved names hotfix
43250
- utils$1.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
43525
+ utils$1.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
43251
43526
  let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
43252
43527
  return {
43253
43528
  get: () => value,
43254
43529
  set(headerValue) {
43255
43530
  this[mapped] = headerValue;
43256
- }
43257
- }
43531
+ },
43532
+ };
43258
43533
  });
43259
43534
 
43260
43535
  utils$1.freezeMethods(AxiosHeaders);
43261
43536
 
43262
- var AxiosHeaders$1 = AxiosHeaders;
43263
-
43264
43537
  /**
43265
43538
  * Transform the data for a request or a response
43266
43539
  *
@@ -43270,9 +43543,9 @@ var AxiosHeaders$1 = AxiosHeaders;
43270
43543
  * @returns {*} The resulting transformed data
43271
43544
  */
43272
43545
  function transformData(fns, response) {
43273
- const config = this || defaults$1;
43546
+ const config = this || defaults;
43274
43547
  const context = response || config;
43275
- const headers = AxiosHeaders$1.from(context.headers);
43548
+ const headers = AxiosHeaders.from(context.headers);
43276
43549
  let data = context.data;
43277
43550
 
43278
43551
  utils$1.forEach(fns, function transform(fn) {
@@ -43288,7 +43561,7 @@ function isCancel(value) {
43288
43561
  return !!(value && value.__CANCEL__);
43289
43562
  }
43290
43563
 
43291
- class CanceledError extends AxiosError$1 {
43564
+ class CanceledError extends AxiosError {
43292
43565
  /**
43293
43566
  * A `CanceledError` is an object that is thrown when an operation is canceled.
43294
43567
  *
@@ -43299,14 +43572,12 @@ class CanceledError extends AxiosError$1 {
43299
43572
  * @returns {CanceledError} The created error.
43300
43573
  */
43301
43574
  constructor(message, config, request) {
43302
- super(message == null ? 'canceled' : message, AxiosError$1.ERR_CANCELED, config, request);
43575
+ super(message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
43303
43576
  this.name = 'CanceledError';
43304
43577
  this.__CANCEL__ = true;
43305
43578
  }
43306
43579
  }
43307
43580
 
43308
- var CanceledError$1 = CanceledError;
43309
-
43310
43581
  /**
43311
43582
  * Resolve or reject a Promise based on response status.
43312
43583
  *
@@ -43321,19 +43592,23 @@ function settle(resolve, reject, response) {
43321
43592
  if (!response.status || !validateStatus || validateStatus(response.status)) {
43322
43593
  resolve(response);
43323
43594
  } else {
43324
- reject(new AxiosError$1(
43325
- 'Request failed with status code ' + response.status,
43326
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
43327
- response.config,
43328
- response.request,
43329
- response
43330
- ));
43595
+ reject(
43596
+ new AxiosError(
43597
+ 'Request failed with status code ' + response.status,
43598
+ [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][
43599
+ Math.floor(response.status / 100) - 4
43600
+ ],
43601
+ response.config,
43602
+ response.request,
43603
+ response
43604
+ )
43605
+ );
43331
43606
  }
43332
43607
  }
43333
43608
 
43334
43609
  function parseProtocol(url) {
43335
43610
  const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
43336
- return match && match[1] || '';
43611
+ return (match && match[1]) || '';
43337
43612
  }
43338
43613
 
43339
43614
  /**
@@ -43384,7 +43659,7 @@ function speedometer(samplesCount, min) {
43384
43659
 
43385
43660
  const passed = startedAt && now - startedAt;
43386
43661
 
43387
- return passed ? Math.round(bytesCount * 1000 / passed) : undefined;
43662
+ return passed ? Math.round((bytesCount * 1000) / passed) : undefined;
43388
43663
  };
43389
43664
  }
43390
43665
 
@@ -43413,7 +43688,7 @@ function throttle(fn, freq) {
43413
43688
  const throttled = (...args) => {
43414
43689
  const now = Date.now();
43415
43690
  const passed = now - timestamp;
43416
- if ( passed >= threshold) {
43691
+ if (passed >= threshold) {
43417
43692
  invoke(args, now);
43418
43693
  } else {
43419
43694
  lastArgs = args;
@@ -43435,25 +43710,25 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
43435
43710
  let bytesNotified = 0;
43436
43711
  const _speedometer = speedometer(50, 250);
43437
43712
 
43438
- return throttle(e => {
43439
- const loaded = e.loaded;
43713
+ return throttle((e) => {
43714
+ const rawLoaded = e.loaded;
43440
43715
  const total = e.lengthComputable ? e.total : undefined;
43441
- const progressBytes = loaded - bytesNotified;
43716
+ const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
43717
+ const progressBytes = Math.max(0, loaded - bytesNotified);
43442
43718
  const rate = _speedometer(progressBytes);
43443
- const inRange = loaded <= total;
43444
43719
 
43445
- bytesNotified = loaded;
43720
+ bytesNotified = Math.max(bytesNotified, loaded);
43446
43721
 
43447
43722
  const data = {
43448
43723
  loaded,
43449
43724
  total,
43450
- progress: total ? (loaded / total) : undefined,
43725
+ progress: total ? loaded / total : undefined,
43451
43726
  bytes: progressBytes,
43452
43727
  rate: rate ? rate : undefined,
43453
- estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
43728
+ estimated: rate && total ? (total - loaded) / rate : undefined,
43454
43729
  event: e,
43455
43730
  lengthComputable: total != null,
43456
- [isDownloadStream ? 'download' : 'upload']: true
43731
+ [isDownloadStream ? 'download' : 'upload']: true,
43457
43732
  };
43458
43733
 
43459
43734
  listener(data);
@@ -43463,77 +43738,82 @@ const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
43463
43738
  const progressEventDecorator = (total, throttled) => {
43464
43739
  const lengthComputable = total != null;
43465
43740
 
43466
- return [(loaded) => throttled[0]({
43467
- lengthComputable,
43468
- total,
43469
- loaded
43470
- }), throttled[1]];
43741
+ return [
43742
+ (loaded) =>
43743
+ throttled[0]({
43744
+ lengthComputable,
43745
+ total,
43746
+ loaded,
43747
+ }),
43748
+ throttled[1],
43749
+ ];
43471
43750
  };
43472
43751
 
43473
- const asyncDecorator = (fn) => (...args) => utils$1.asap(() => fn(...args));
43752
+ const asyncDecorator =
43753
+ (fn) =>
43754
+ (...args) =>
43755
+ utils$1.asap(() => fn(...args));
43474
43756
 
43475
- var isURLSameOrigin = platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {
43476
- url = new URL(url, platform.origin);
43757
+ var isURLSameOrigin = platform.hasStandardBrowserEnv
43758
+ ? ((origin, isMSIE) => (url) => {
43759
+ url = new URL(url, platform.origin);
43477
43760
 
43478
- return (
43479
- origin.protocol === url.protocol &&
43480
- origin.host === url.host &&
43481
- (isMSIE || origin.port === url.port)
43482
- );
43483
- })(
43484
- new URL(platform.origin),
43485
- platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
43486
- ) : () => true;
43487
-
43488
- var cookies = platform.hasStandardBrowserEnv ?
43761
+ return (
43762
+ origin.protocol === url.protocol &&
43763
+ origin.host === url.host &&
43764
+ (isMSIE || origin.port === url.port)
43765
+ );
43766
+ })(
43767
+ new URL(platform.origin),
43768
+ platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)
43769
+ )
43770
+ : () => true;
43489
43771
 
43490
- // Standard browser envs support document.cookie
43491
- {
43492
- write(name, value, expires, path, domain, secure, sameSite) {
43493
- if (typeof document === 'undefined') return;
43772
+ var cookies = platform.hasStandardBrowserEnv
43773
+ ? // Standard browser envs support document.cookie
43774
+ {
43775
+ write(name, value, expires, path, domain, secure, sameSite) {
43776
+ if (typeof document === 'undefined') return;
43494
43777
 
43495
- const cookie = [`${name}=${encodeURIComponent(value)}`];
43778
+ const cookie = [`${name}=${encodeURIComponent(value)}`];
43496
43779
 
43497
- if (utils$1.isNumber(expires)) {
43498
- cookie.push(`expires=${new Date(expires).toUTCString()}`);
43499
- }
43500
- if (utils$1.isString(path)) {
43501
- cookie.push(`path=${path}`);
43502
- }
43503
- if (utils$1.isString(domain)) {
43504
- cookie.push(`domain=${domain}`);
43505
- }
43506
- if (secure === true) {
43507
- cookie.push('secure');
43508
- }
43509
- if (utils$1.isString(sameSite)) {
43510
- cookie.push(`SameSite=${sameSite}`);
43511
- }
43780
+ if (utils$1.isNumber(expires)) {
43781
+ cookie.push(`expires=${new Date(expires).toUTCString()}`);
43782
+ }
43783
+ if (utils$1.isString(path)) {
43784
+ cookie.push(`path=${path}`);
43785
+ }
43786
+ if (utils$1.isString(domain)) {
43787
+ cookie.push(`domain=${domain}`);
43788
+ }
43789
+ if (secure === true) {
43790
+ cookie.push('secure');
43791
+ }
43792
+ if (utils$1.isString(sameSite)) {
43793
+ cookie.push(`SameSite=${sameSite}`);
43794
+ }
43512
43795
 
43513
- document.cookie = cookie.join('; ');
43514
- },
43796
+ document.cookie = cookie.join('; ');
43797
+ },
43515
43798
 
43516
- read(name) {
43517
- if (typeof document === 'undefined') return null;
43518
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
43519
- return match ? decodeURIComponent(match[1]) : null;
43520
- },
43799
+ read(name) {
43800
+ if (typeof document === 'undefined') return null;
43801
+ const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
43802
+ return match ? decodeURIComponent(match[1]) : null;
43803
+ },
43521
43804
 
43522
- remove(name) {
43523
- this.write(name, '', Date.now() - 86400000, '/');
43805
+ remove(name) {
43806
+ this.write(name, '', Date.now() - 86400000, '/');
43807
+ },
43524
43808
  }
43525
- }
43526
-
43527
- :
43528
-
43529
- // Non-standard browser env (web workers, react-native) lack needed support.
43530
- {
43531
- write() {},
43532
- read() {
43533
- return null;
43534
- },
43535
- remove() {}
43536
- };
43809
+ : // Non-standard browser env (web workers, react-native) lack needed support.
43810
+ {
43811
+ write() {},
43812
+ read() {
43813
+ return null;
43814
+ },
43815
+ remove() {},
43816
+ };
43537
43817
 
43538
43818
  /**
43539
43819
  * Determines whether the specified URL is absolute
@@ -43546,6 +43826,10 @@ function isAbsoluteURL(url) {
43546
43826
  // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
43547
43827
  // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
43548
43828
  // by any combination of letters, digits, plus, period, or hyphen.
43829
+ if (typeof url !== 'string') {
43830
+ return false;
43831
+ }
43832
+
43549
43833
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
43550
43834
  }
43551
43835
 
@@ -43575,13 +43859,13 @@ function combineURLs(baseURL, relativeURL) {
43575
43859
  */
43576
43860
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
43577
43861
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
43578
- if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
43862
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls === false)) {
43579
43863
  return combineURLs(baseURL, requestedURL);
43580
43864
  }
43581
43865
  return requestedURL;
43582
43866
  }
43583
43867
 
43584
- const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing } : thing;
43868
+ const headersToObject = (thing) => (thing instanceof AxiosHeaders ? { ...thing } : thing);
43585
43869
 
43586
43870
  /**
43587
43871
  * Config-specific merge-function which creates a new config-object
@@ -43595,7 +43879,18 @@ const headersToObject = (thing) => thing instanceof AxiosHeaders$1 ? { ...thing
43595
43879
  function mergeConfig(config1, config2) {
43596
43880
  // eslint-disable-next-line no-param-reassign
43597
43881
  config2 = config2 || {};
43598
- const config = {};
43882
+
43883
+ // Use a null-prototype object so that downstream reads such as `config.auth`
43884
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype
43885
+ // (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
43886
+ // own slot to preserve ergonomics for user code that relies on it.
43887
+ const config = Object.create(null);
43888
+ Object.defineProperty(config, 'hasOwnProperty', {
43889
+ value: Object.prototype.hasOwnProperty,
43890
+ enumerable: false,
43891
+ writable: true,
43892
+ configurable: true,
43893
+ });
43599
43894
 
43600
43895
  function getMergedValue(target, source, prop, caseless) {
43601
43896
  if (utils$1.isPlainObject(target) && utils$1.isPlainObject(source)) {
@@ -43634,9 +43929,9 @@ function mergeConfig(config1, config2) {
43634
43929
 
43635
43930
  // eslint-disable-next-line consistent-return
43636
43931
  function mergeDirectKeys(a, b, prop) {
43637
- if (prop in config2) {
43932
+ if (utils$1.hasOwnProp(config2, prop)) {
43638
43933
  return getMergedValue(a, b);
43639
- } else if (prop in config1) {
43934
+ } else if (utils$1.hasOwnProp(config1, prop)) {
43640
43935
  return getMergedValue(undefined, a);
43641
43936
  }
43642
43937
  }
@@ -43668,14 +43963,19 @@ function mergeConfig(config1, config2) {
43668
43963
  httpsAgent: defaultToConfig2,
43669
43964
  cancelToken: defaultToConfig2,
43670
43965
  socketPath: defaultToConfig2,
43966
+ allowedSocketPaths: defaultToConfig2,
43671
43967
  responseEncoding: defaultToConfig2,
43672
43968
  validateStatus: mergeDirectKeys,
43673
- headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true)
43969
+ headers: (a, b, prop) =>
43970
+ mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true),
43674
43971
  };
43675
43972
 
43676
43973
  utils$1.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
43677
- const merge = mergeMap[prop] || mergeDeepProperties;
43678
- const configValue = merge(config1[prop], config2[prop], prop);
43974
+ if (prop === '__proto__' || prop === 'constructor' || prop === 'prototype') return;
43975
+ const merge = utils$1.hasOwnProp(mergeMap, prop) ? mergeMap[prop] : mergeDeepProperties;
43976
+ const a = utils$1.hasOwnProp(config1, prop) ? config1[prop] : undefined;
43977
+ const b = utils$1.hasOwnProp(config2, prop) ? config2[prop] : undefined;
43978
+ const configValue = merge(a, b, prop);
43679
43979
  (utils$1.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
43680
43980
  });
43681
43981
 
@@ -43685,16 +43985,38 @@ function mergeConfig(config1, config2) {
43685
43985
  var resolveConfig = (config) => {
43686
43986
  const newConfig = mergeConfig({}, config);
43687
43987
 
43688
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
43689
-
43690
- newConfig.headers = headers = AxiosHeaders$1.from(headers);
43691
-
43692
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
43988
+ // Read only own properties to prevent prototype pollution gadgets
43989
+ // (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
43990
+ const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
43991
+
43992
+ const data = own('data');
43993
+ let withXSRFToken = own('withXSRFToken');
43994
+ const xsrfHeaderName = own('xsrfHeaderName');
43995
+ const xsrfCookieName = own('xsrfCookieName');
43996
+ let headers = own('headers');
43997
+ const auth = own('auth');
43998
+ const baseURL = own('baseURL');
43999
+ const allowAbsoluteUrls = own('allowAbsoluteUrls');
44000
+ const url = own('url');
44001
+
44002
+ newConfig.headers = headers = AxiosHeaders.from(headers);
44003
+
44004
+ newConfig.url = buildURL(
44005
+ buildFullPath(baseURL, url, allowAbsoluteUrls),
44006
+ config.params,
44007
+ config.paramsSerializer
44008
+ );
43693
44009
 
43694
44010
  // HTTP basic authentication
43695
44011
  if (auth) {
43696
- headers.set('Authorization', 'Basic ' +
43697
- btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))
44012
+ headers.set(
44013
+ 'Authorization',
44014
+ 'Basic ' +
44015
+ btoa(
44016
+ (auth.username || '') +
44017
+ ':' +
44018
+ (auth.password ? unescape(encodeURIComponent(auth.password)) : '')
44019
+ )
43698
44020
  );
43699
44021
  }
43700
44022
 
@@ -43712,17 +44034,25 @@ var resolveConfig = (config) => {
43712
44034
  }
43713
44035
  });
43714
44036
  }
43715
- }
44037
+ }
43716
44038
 
43717
44039
  // Add xsrf header
43718
44040
  // This is only done if running in a standard browser environment.
43719
44041
  // Specifically not if we're in a web worker, or react-native.
43720
44042
 
43721
44043
  if (platform.hasStandardBrowserEnv) {
43722
- withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
44044
+ if (utils$1.isFunction(withXSRFToken)) {
44045
+ withXSRFToken = withXSRFToken(newConfig);
44046
+ }
43723
44047
 
43724
- if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {
43725
- // Add xsrf header
44048
+ // Strict boolean check prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
44049
+ // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
44050
+ // the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
44051
+ const shouldSendXSRF =
44052
+ withXSRFToken === true ||
44053
+ (withXSRFToken == null && isURLSameOrigin(newConfig.url));
44054
+
44055
+ if (shouldSendXSRF) {
43726
44056
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
43727
44057
 
43728
44058
  if (xsrfValue) {
@@ -43736,196 +44066,218 @@ var resolveConfig = (config) => {
43736
44066
 
43737
44067
  const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
43738
44068
 
43739
- var xhrAdapter = isXHRAdapterSupported && function (config) {
43740
- return new Promise(function dispatchXhrRequest(resolve, reject) {
43741
- const _config = resolveConfig(config);
43742
- let requestData = _config.data;
43743
- const requestHeaders = AxiosHeaders$1.from(_config.headers).normalize();
43744
- let {responseType, onUploadProgress, onDownloadProgress} = _config;
43745
- let onCanceled;
43746
- let uploadThrottled, downloadThrottled;
43747
- let flushUpload, flushDownload;
44069
+ var xhrAdapter = isXHRAdapterSupported &&
44070
+ function (config) {
44071
+ return new Promise(function dispatchXhrRequest(resolve, reject) {
44072
+ const _config = resolveConfig(config);
44073
+ let requestData = _config.data;
44074
+ const requestHeaders = AxiosHeaders.from(_config.headers).normalize();
44075
+ let { responseType, onUploadProgress, onDownloadProgress } = _config;
44076
+ let onCanceled;
44077
+ let uploadThrottled, downloadThrottled;
44078
+ let flushUpload, flushDownload;
43748
44079
 
43749
- function done() {
43750
- flushUpload && flushUpload(); // flush events
43751
- flushDownload && flushDownload(); // flush events
44080
+ function done() {
44081
+ flushUpload && flushUpload(); // flush events
44082
+ flushDownload && flushDownload(); // flush events
43752
44083
 
43753
- _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
44084
+ _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);
43754
44085
 
43755
- _config.signal && _config.signal.removeEventListener('abort', onCanceled);
43756
- }
44086
+ _config.signal && _config.signal.removeEventListener('abort', onCanceled);
44087
+ }
43757
44088
 
43758
- let request = new XMLHttpRequest();
44089
+ let request = new XMLHttpRequest();
43759
44090
 
43760
- request.open(_config.method.toUpperCase(), _config.url, true);
44091
+ request.open(_config.method.toUpperCase(), _config.url, true);
43761
44092
 
43762
- // Set the request timeout in MS
43763
- request.timeout = _config.timeout;
44093
+ // Set the request timeout in MS
44094
+ request.timeout = _config.timeout;
43764
44095
 
43765
- function onloadend() {
43766
- if (!request) {
43767
- return;
44096
+ function onloadend() {
44097
+ if (!request) {
44098
+ return;
44099
+ }
44100
+ // Prepare the response
44101
+ const responseHeaders = AxiosHeaders.from(
44102
+ 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
44103
+ );
44104
+ const responseData =
44105
+ !responseType || responseType === 'text' || responseType === 'json'
44106
+ ? request.responseText
44107
+ : request.response;
44108
+ const response = {
44109
+ data: responseData,
44110
+ status: request.status,
44111
+ statusText: request.statusText,
44112
+ headers: responseHeaders,
44113
+ config,
44114
+ request,
44115
+ };
44116
+
44117
+ settle(
44118
+ function _resolve(value) {
44119
+ resolve(value);
44120
+ done();
44121
+ },
44122
+ function _reject(err) {
44123
+ reject(err);
44124
+ done();
44125
+ },
44126
+ response
44127
+ );
44128
+
44129
+ // Clean up request
44130
+ request = null;
43768
44131
  }
43769
- // Prepare the response
43770
- const responseHeaders = AxiosHeaders$1.from(
43771
- 'getAllResponseHeaders' in request && request.getAllResponseHeaders()
43772
- );
43773
- const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
43774
- request.responseText : request.response;
43775
- const response = {
43776
- data: responseData,
43777
- status: request.status,
43778
- statusText: request.statusText,
43779
- headers: responseHeaders,
43780
- config,
43781
- request
43782
- };
43783
44132
 
43784
- settle(function _resolve(value) {
43785
- resolve(value);
43786
- done();
43787
- }, function _reject(err) {
43788
- reject(err);
43789
- done();
43790
- }, response);
44133
+ if ('onloadend' in request) {
44134
+ // Use onloadend if available
44135
+ request.onloadend = onloadend;
44136
+ } else {
44137
+ // Listen for ready state to emulate onloadend
44138
+ request.onreadystatechange = function handleLoad() {
44139
+ if (!request || request.readyState !== 4) {
44140
+ return;
44141
+ }
43791
44142
 
43792
- // Clean up request
43793
- request = null;
43794
- }
44143
+ // The request errored out and we didn't get a response, this will be
44144
+ // handled by onerror instead
44145
+ // With one exception: request that using file: protocol, most browsers
44146
+ // will return status as 0 even though it's a successful request
44147
+ if (
44148
+ request.status === 0 &&
44149
+ !(request.responseURL && request.responseURL.indexOf('file:') === 0)
44150
+ ) {
44151
+ return;
44152
+ }
44153
+ // readystate handler is calling before onerror or ontimeout handlers,
44154
+ // so we should call onloadend on the next 'tick'
44155
+ setTimeout(onloadend);
44156
+ };
44157
+ }
43795
44158
 
43796
- if ('onloadend' in request) {
43797
- // Use onloadend if available
43798
- request.onloadend = onloadend;
43799
- } else {
43800
- // Listen for ready state to emulate onloadend
43801
- request.onreadystatechange = function handleLoad() {
43802
- if (!request || request.readyState !== 4) {
44159
+ // Handle browser request cancellation (as opposed to a manual cancellation)
44160
+ request.onabort = function handleAbort() {
44161
+ if (!request) {
43803
44162
  return;
43804
44163
  }
43805
44164
 
43806
- // The request errored out and we didn't get a response, this will be
43807
- // handled by onerror instead
43808
- // With one exception: request that using file: protocol, most browsers
43809
- // will return status as 0 even though it's a successful request
43810
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
43811
- return;
43812
- }
43813
- // readystate handler is calling before onerror or ontimeout handlers,
43814
- // so we should call onloadend on the next 'tick'
43815
- setTimeout(onloadend);
44165
+ reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
44166
+
44167
+ // Clean up request
44168
+ request = null;
43816
44169
  };
43817
- }
43818
44170
 
43819
- // Handle browser request cancellation (as opposed to a manual cancellation)
43820
- request.onabort = function handleAbort() {
43821
- if (!request) {
43822
- return;
43823
- }
44171
+ // Handle low level network errors
44172
+ request.onerror = function handleError(event) {
44173
+ // Browsers deliver a ProgressEvent in XHR onerror
44174
+ // (message may be empty; when present, surface it)
44175
+ // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
44176
+ const msg = event && event.message ? event.message : 'Network Error';
44177
+ const err = new AxiosError(msg, AxiosError.ERR_NETWORK, config, request);
44178
+ // attach the underlying event for consumers who want details
44179
+ err.event = event || null;
44180
+ reject(err);
44181
+ request = null;
44182
+ };
43824
44183
 
43825
- reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
44184
+ // Handle timeout
44185
+ request.ontimeout = function handleTimeout() {
44186
+ let timeoutErrorMessage = _config.timeout
44187
+ ? 'timeout of ' + _config.timeout + 'ms exceeded'
44188
+ : 'timeout exceeded';
44189
+ const transitional = _config.transitional || transitionalDefaults;
44190
+ if (_config.timeoutErrorMessage) {
44191
+ timeoutErrorMessage = _config.timeoutErrorMessage;
44192
+ }
44193
+ reject(
44194
+ new AxiosError(
44195
+ timeoutErrorMessage,
44196
+ transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
44197
+ config,
44198
+ request
44199
+ )
44200
+ );
43826
44201
 
43827
- // Clean up request
43828
- request = null;
43829
- };
44202
+ // Clean up request
44203
+ request = null;
44204
+ };
43830
44205
 
43831
- // Handle low level network errors
43832
- request.onerror = function handleError(event) {
43833
- // Browsers deliver a ProgressEvent in XHR onerror
43834
- // (message may be empty; when present, surface it)
43835
- // See https://developer.mozilla.org/docs/Web/API/XMLHttpRequest/error_event
43836
- const msg = event && event.message ? event.message : 'Network Error';
43837
- const err = new AxiosError$1(msg, AxiosError$1.ERR_NETWORK, config, request);
43838
- // attach the underlying event for consumers who want details
43839
- err.event = event || null;
43840
- reject(err);
43841
- request = null;
43842
- };
43843
-
43844
- // Handle timeout
43845
- request.ontimeout = function handleTimeout() {
43846
- let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';
43847
- const transitional = _config.transitional || transitionalDefaults;
43848
- if (_config.timeoutErrorMessage) {
43849
- timeoutErrorMessage = _config.timeoutErrorMessage;
43850
- }
43851
- reject(new AxiosError$1(
43852
- timeoutErrorMessage,
43853
- transitional.clarifyTimeoutError ? AxiosError$1.ETIMEDOUT : AxiosError$1.ECONNABORTED,
43854
- config,
43855
- request));
43856
-
43857
- // Clean up request
43858
- request = null;
43859
- };
44206
+ // Remove Content-Type if data is undefined
44207
+ requestData === undefined && requestHeaders.setContentType(null);
43860
44208
 
43861
- // Remove Content-Type if data is undefined
43862
- requestData === undefined && requestHeaders.setContentType(null);
44209
+ // Add headers to the request
44210
+ if ('setRequestHeader' in request) {
44211
+ utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
44212
+ request.setRequestHeader(key, val);
44213
+ });
44214
+ }
43863
44215
 
43864
- // Add headers to the request
43865
- if ('setRequestHeader' in request) {
43866
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
43867
- request.setRequestHeader(key, val);
43868
- });
43869
- }
44216
+ // Add withCredentials to request if needed
44217
+ if (!utils$1.isUndefined(_config.withCredentials)) {
44218
+ request.withCredentials = !!_config.withCredentials;
44219
+ }
43870
44220
 
43871
- // Add withCredentials to request if needed
43872
- if (!utils$1.isUndefined(_config.withCredentials)) {
43873
- request.withCredentials = !!_config.withCredentials;
43874
- }
44221
+ // Add responseType to request if needed
44222
+ if (responseType && responseType !== 'json') {
44223
+ request.responseType = _config.responseType;
44224
+ }
43875
44225
 
43876
- // Add responseType to request if needed
43877
- if (responseType && responseType !== 'json') {
43878
- request.responseType = _config.responseType;
43879
- }
44226
+ // Handle progress if needed
44227
+ if (onDownloadProgress) {
44228
+ [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true);
44229
+ request.addEventListener('progress', downloadThrottled);
44230
+ }
43880
44231
 
43881
- // Handle progress if needed
43882
- if (onDownloadProgress) {
43883
- ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));
43884
- request.addEventListener('progress', downloadThrottled);
43885
- }
44232
+ // Not all browsers support upload events
44233
+ if (onUploadProgress && request.upload) {
44234
+ [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress);
43886
44235
 
43887
- // Not all browsers support upload events
43888
- if (onUploadProgress && request.upload) {
43889
- ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));
44236
+ request.upload.addEventListener('progress', uploadThrottled);
43890
44237
 
43891
- request.upload.addEventListener('progress', uploadThrottled);
44238
+ request.upload.addEventListener('loadend', flushUpload);
44239
+ }
43892
44240
 
43893
- request.upload.addEventListener('loadend', flushUpload);
43894
- }
44241
+ if (_config.cancelToken || _config.signal) {
44242
+ // Handle cancellation
44243
+ // eslint-disable-next-line func-names
44244
+ onCanceled = (cancel) => {
44245
+ if (!request) {
44246
+ return;
44247
+ }
44248
+ reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
44249
+ request.abort();
44250
+ request = null;
44251
+ };
43895
44252
 
43896
- if (_config.cancelToken || _config.signal) {
43897
- // Handle cancellation
43898
- // eslint-disable-next-line func-names
43899
- onCanceled = cancel => {
43900
- if (!request) {
43901
- return;
44253
+ _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
44254
+ if (_config.signal) {
44255
+ _config.signal.aborted
44256
+ ? onCanceled()
44257
+ : _config.signal.addEventListener('abort', onCanceled);
43902
44258
  }
43903
- reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
43904
- request.abort();
43905
- request = null;
43906
- };
43907
-
43908
- _config.cancelToken && _config.cancelToken.subscribe(onCanceled);
43909
- if (_config.signal) {
43910
- _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);
43911
44259
  }
43912
- }
43913
44260
 
43914
- const protocol = parseProtocol(_config.url);
43915
-
43916
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
43917
- reject(new AxiosError$1('Unsupported protocol ' + protocol + ':', AxiosError$1.ERR_BAD_REQUEST, config));
43918
- return;
43919
- }
44261
+ const protocol = parseProtocol(_config.url);
43920
44262
 
44263
+ if (protocol && platform.protocols.indexOf(protocol) === -1) {
44264
+ reject(
44265
+ new AxiosError(
44266
+ 'Unsupported protocol ' + protocol + ':',
44267
+ AxiosError.ERR_BAD_REQUEST,
44268
+ config
44269
+ )
44270
+ );
44271
+ return;
44272
+ }
43921
44273
 
43922
- // Send the request
43923
- request.send(requestData || null);
43924
- });
43925
- };
44274
+ // Send the request
44275
+ request.send(requestData || null);
44276
+ });
44277
+ };
43926
44278
 
43927
44279
  const composeSignals = (signals, timeout) => {
43928
- const {length} = (signals = signals ? signals.filter(Boolean) : []);
44280
+ const { length } = (signals = signals ? signals.filter(Boolean) : []);
43929
44281
 
43930
44282
  if (timeout || length) {
43931
44283
  let controller = new AbortController();
@@ -43937,21 +44289,29 @@ const composeSignals = (signals, timeout) => {
43937
44289
  aborted = true;
43938
44290
  unsubscribe();
43939
44291
  const err = reason instanceof Error ? reason : this.reason;
43940
- controller.abort(err instanceof AxiosError$1 ? err : new CanceledError$1(err instanceof Error ? err.message : err));
44292
+ controller.abort(
44293
+ err instanceof AxiosError
44294
+ ? err
44295
+ : new CanceledError(err instanceof Error ? err.message : err)
44296
+ );
43941
44297
  }
43942
44298
  };
43943
44299
 
43944
- let timer = timeout && setTimeout(() => {
43945
- timer = null;
43946
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
43947
- }, timeout);
44300
+ let timer =
44301
+ timeout &&
44302
+ setTimeout(() => {
44303
+ timer = null;
44304
+ onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
44305
+ }, timeout);
43948
44306
 
43949
44307
  const unsubscribe = () => {
43950
44308
  if (signals) {
43951
44309
  timer && clearTimeout(timer);
43952
44310
  timer = null;
43953
- signals.forEach(signal => {
43954
- signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);
44311
+ signals.forEach((signal) => {
44312
+ signal.unsubscribe
44313
+ ? signal.unsubscribe(onabort)
44314
+ : signal.removeEventListener('abort', onabort);
43955
44315
  });
43956
44316
  signals = null;
43957
44317
  }
@@ -43959,7 +44319,7 @@ const composeSignals = (signals, timeout) => {
43959
44319
 
43960
44320
  signals.forEach((signal) => signal.addEventListener('abort', onabort));
43961
44321
 
43962
- const {signal} = controller;
44322
+ const { signal } = controller;
43963
44323
 
43964
44324
  signal.unsubscribe = () => utils$1.asap(unsubscribe);
43965
44325
 
@@ -43967,12 +44327,10 @@ const composeSignals = (signals, timeout) => {
43967
44327
  }
43968
44328
  };
43969
44329
 
43970
- var composeSignals$1 = composeSignals;
43971
-
43972
44330
  const streamChunk = function* (chunk, chunkSize) {
43973
44331
  let len = chunk.byteLength;
43974
44332
 
43975
- if (!chunkSize || len < chunkSize) {
44333
+ if (len < chunkSize) {
43976
44334
  yield chunk;
43977
44335
  return;
43978
44336
  }
@@ -44002,7 +44360,7 @@ const readStream = async function* (stream) {
44002
44360
  const reader = stream.getReader();
44003
44361
  try {
44004
44362
  for (;;) {
44005
- const {done, value} = await reader.read();
44363
+ const { done, value } = await reader.read();
44006
44364
  if (done) {
44007
44365
  break;
44008
44366
  }
@@ -44025,64 +44383,69 @@ const trackStream = (stream, chunkSize, onProgress, onFinish) => {
44025
44383
  }
44026
44384
  };
44027
44385
 
44028
- return new ReadableStream({
44029
- async pull(controller) {
44030
- try {
44031
- const {done, value} = await iterator.next();
44386
+ return new ReadableStream(
44387
+ {
44388
+ async pull(controller) {
44389
+ try {
44390
+ const { done, value } = await iterator.next();
44032
44391
 
44033
- if (done) {
44034
- _onFinish();
44035
- controller.close();
44036
- return;
44037
- }
44392
+ if (done) {
44393
+ _onFinish();
44394
+ controller.close();
44395
+ return;
44396
+ }
44038
44397
 
44039
- let len = value.byteLength;
44040
- if (onProgress) {
44041
- let loadedBytes = bytes += len;
44042
- onProgress(loadedBytes);
44398
+ let len = value.byteLength;
44399
+ if (onProgress) {
44400
+ let loadedBytes = (bytes += len);
44401
+ onProgress(loadedBytes);
44402
+ }
44403
+ controller.enqueue(new Uint8Array(value));
44404
+ } catch (err) {
44405
+ _onFinish(err);
44406
+ throw err;
44043
44407
  }
44044
- controller.enqueue(new Uint8Array(value));
44045
- } catch (err) {
44046
- _onFinish(err);
44047
- throw err;
44048
- }
44408
+ },
44409
+ cancel(reason) {
44410
+ _onFinish(reason);
44411
+ return iterator.return();
44412
+ },
44049
44413
  },
44050
- cancel(reason) {
44051
- _onFinish(reason);
44052
- return iterator.return();
44414
+ {
44415
+ highWaterMark: 2,
44053
44416
  }
44054
- }, {
44055
- highWaterMark: 2
44056
- })
44417
+ );
44057
44418
  };
44058
44419
 
44059
44420
  const DEFAULT_CHUNK_SIZE = 64 * 1024;
44060
44421
 
44061
- const {isFunction} = utils$1;
44422
+ const { isFunction } = utils$1;
44062
44423
 
44063
- const globalFetchAPI = (({Request, Response}) => ({
44064
- Request, Response
44424
+ const globalFetchAPI = (({ Request, Response }) => ({
44425
+ Request,
44426
+ Response,
44065
44427
  }))(utils$1.global);
44066
44428
 
44067
- const {
44068
- ReadableStream: ReadableStream$1, TextEncoder
44069
- } = utils$1.global;
44070
-
44429
+ const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
44071
44430
 
44072
44431
  const test = (fn, ...args) => {
44073
44432
  try {
44074
44433
  return !!fn(...args);
44075
44434
  } catch (e) {
44076
- return false
44435
+ return false;
44077
44436
  }
44078
44437
  };
44079
44438
 
44080
44439
  const factory = (env) => {
44081
- env = utils$1.merge.call({
44082
- skipUndefined: true
44083
- }, globalFetchAPI, env);
44440
+ env = utils$1.merge.call(
44441
+ {
44442
+ skipUndefined: true,
44443
+ },
44444
+ globalFetchAPI,
44445
+ env
44446
+ );
44084
44447
 
44085
- const {fetch: envFetch, Request, Response} = env;
44448
+ const { fetch: envFetch, Request, Response } = env;
44086
44449
  const isFetchSupported = envFetch ? isFunction(envFetch) : typeof fetch === 'function';
44087
44450
  const isRequestSupported = isFunction(Request);
44088
44451
  const isResponseSupported = isFunction(Response);
@@ -44093,46 +44456,67 @@ const factory = (env) => {
44093
44456
 
44094
44457
  const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
44095
44458
 
44096
- const encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?
44097
- ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :
44098
- async (str) => new Uint8Array(await new Request(str).arrayBuffer())
44099
- );
44459
+ const encodeText =
44460
+ isFetchSupported &&
44461
+ (typeof TextEncoder === 'function'
44462
+ ? (
44463
+ (encoder) => (str) =>
44464
+ encoder.encode(str)
44465
+ )(new TextEncoder())
44466
+ : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
44467
+
44468
+ const supportsRequestStream =
44469
+ isRequestSupported &&
44470
+ isReadableStreamSupported &&
44471
+ test(() => {
44472
+ let duplexAccessed = false;
44473
+
44474
+ const request = new Request(platform.origin, {
44475
+ body: new ReadableStream$1(),
44476
+ method: 'POST',
44477
+ get duplex() {
44478
+ duplexAccessed = true;
44479
+ return 'half';
44480
+ },
44481
+ });
44100
44482
 
44101
- const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => {
44102
- let duplexAccessed = false;
44483
+ const hasContentType = request.headers.has('Content-Type');
44103
44484
 
44104
- const hasContentType = new Request(platform.origin, {
44105
- body: new ReadableStream$1(),
44106
- method: 'POST',
44107
- get duplex() {
44108
- duplexAccessed = true;
44109
- return 'half';
44110
- },
44111
- }).headers.has('Content-Type');
44485
+ if (request.body != null) {
44486
+ request.body.cancel();
44487
+ }
44112
44488
 
44113
- return duplexAccessed && !hasContentType;
44114
- });
44489
+ return duplexAccessed && !hasContentType;
44490
+ });
44115
44491
 
44116
- const supportsResponseStream = isResponseSupported && isReadableStreamSupported &&
44492
+ const supportsResponseStream =
44493
+ isResponseSupported &&
44494
+ isReadableStreamSupported &&
44117
44495
  test(() => utils$1.isReadableStream(new Response('').body));
44118
44496
 
44119
44497
  const resolvers = {
44120
- stream: supportsResponseStream && ((res) => res.body)
44498
+ stream: supportsResponseStream && ((res) => res.body),
44121
44499
  };
44122
44500
 
44123
- isFetchSupported && ((() => {
44124
- ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {
44125
- !resolvers[type] && (resolvers[type] = (res, config) => {
44126
- let method = res && res[type];
44501
+ isFetchSupported &&
44502
+ (() => {
44503
+ ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach((type) => {
44504
+ !resolvers[type] &&
44505
+ (resolvers[type] = (res, config) => {
44506
+ let method = res && res[type];
44127
44507
 
44128
- if (method) {
44129
- return method.call(res);
44130
- }
44508
+ if (method) {
44509
+ return method.call(res);
44510
+ }
44131
44511
 
44132
- throw new AxiosError$1(`Response type '${type}' is not supported`, AxiosError$1.ERR_NOT_SUPPORT, config);
44512
+ throw new AxiosError(
44513
+ `Response type '${type}' is not supported`,
44514
+ AxiosError.ERR_NOT_SUPPORT,
44515
+ config
44516
+ );
44517
+ });
44133
44518
  });
44134
- });
44135
- })());
44519
+ })();
44136
44520
 
44137
44521
  const getBodyLength = async (body) => {
44138
44522
  if (body == null) {
@@ -44183,32 +44567,41 @@ const factory = (env) => {
44183
44567
  responseType,
44184
44568
  headers,
44185
44569
  withCredentials = 'same-origin',
44186
- fetchOptions
44570
+ fetchOptions,
44187
44571
  } = resolveConfig(config);
44188
44572
 
44189
44573
  let _fetch = envFetch || fetch;
44190
44574
 
44191
44575
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
44192
44576
 
44193
- let composedSignal = composeSignals$1([signal, cancelToken && cancelToken.toAbortSignal()], timeout);
44577
+ let composedSignal = composeSignals(
44578
+ [signal, cancelToken && cancelToken.toAbortSignal()],
44579
+ timeout
44580
+ );
44194
44581
 
44195
44582
  let request = null;
44196
44583
 
44197
- const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {
44198
- composedSignal.unsubscribe();
44199
- });
44584
+ const unsubscribe =
44585
+ composedSignal &&
44586
+ composedSignal.unsubscribe &&
44587
+ (() => {
44588
+ composedSignal.unsubscribe();
44589
+ });
44200
44590
 
44201
44591
  let requestContentLength;
44202
44592
 
44203
44593
  try {
44204
44594
  if (
44205
- onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&
44595
+ onUploadProgress &&
44596
+ supportsRequestStream &&
44597
+ method !== 'get' &&
44598
+ method !== 'head' &&
44206
44599
  (requestContentLength = await resolveBodyLength(headers, data)) !== 0
44207
44600
  ) {
44208
44601
  let _request = new Request(url, {
44209
44602
  method: 'POST',
44210
44603
  body: data,
44211
- duplex: "half"
44604
+ duplex: 'half',
44212
44605
  });
44213
44606
 
44214
44607
  let contentTypeHeader;
@@ -44233,7 +44626,20 @@ const factory = (env) => {
44233
44626
 
44234
44627
  // Cloudflare Workers throws when credentials are defined
44235
44628
  // see https://github.com/cloudflare/workerd/issues/902
44236
- const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype;
44629
+ const isCredentialsSupported = isRequestSupported && 'credentials' in Request.prototype;
44630
+
44631
+ // If data is FormData and Content-Type is multipart/form-data without boundary,
44632
+ // delete it so fetch can set it correctly with the boundary
44633
+ if (utils$1.isFormData(data)) {
44634
+ const contentType = headers.getContentType();
44635
+ if (
44636
+ contentType &&
44637
+ /^multipart\/form-data/i.test(contentType) &&
44638
+ !/boundary=/i.test(contentType)
44639
+ ) {
44640
+ headers.delete('content-type');
44641
+ }
44642
+ }
44237
44643
 
44238
44644
  const resolvedOptions = {
44239
44645
  ...fetchOptions,
@@ -44241,29 +44647,35 @@ const factory = (env) => {
44241
44647
  method: method.toUpperCase(),
44242
44648
  headers: headers.normalize().toJSON(),
44243
44649
  body: data,
44244
- duplex: "half",
44245
- credentials: isCredentialsSupported ? withCredentials : undefined
44650
+ duplex: 'half',
44651
+ credentials: isCredentialsSupported ? withCredentials : undefined,
44246
44652
  };
44247
44653
 
44248
44654
  request = isRequestSupported && new Request(url, resolvedOptions);
44249
44655
 
44250
- let response = await (isRequestSupported ? _fetch(request, fetchOptions) : _fetch(url, resolvedOptions));
44656
+ let response = await (isRequestSupported
44657
+ ? _fetch(request, fetchOptions)
44658
+ : _fetch(url, resolvedOptions));
44251
44659
 
44252
- const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');
44660
+ const isStreamResponse =
44661
+ supportsResponseStream && (responseType === 'stream' || responseType === 'response');
44253
44662
 
44254
44663
  if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
44255
44664
  const options = {};
44256
44665
 
44257
- ['status', 'statusText', 'headers'].forEach(prop => {
44666
+ ['status', 'statusText', 'headers'].forEach((prop) => {
44258
44667
  options[prop] = response[prop];
44259
44668
  });
44260
44669
 
44261
44670
  const responseContentLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
44262
44671
 
44263
- const [onProgress, flush] = onDownloadProgress && progressEventDecorator(
44264
- responseContentLength,
44265
- progressEventReducer(asyncDecorator(onDownloadProgress), true)
44266
- ) || [];
44672
+ const [onProgress, flush] =
44673
+ (onDownloadProgress &&
44674
+ progressEventDecorator(
44675
+ responseContentLength,
44676
+ progressEventReducer(asyncDecorator(onDownloadProgress), true)
44677
+ )) ||
44678
+ [];
44267
44679
 
44268
44680
  response = new Response(
44269
44681
  trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
@@ -44276,54 +44688,64 @@ const factory = (env) => {
44276
44688
 
44277
44689
  responseType = responseType || 'text';
44278
44690
 
44279
- let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](response, config);
44691
+ let responseData = await resolvers[utils$1.findKey(resolvers, responseType) || 'text'](
44692
+ response,
44693
+ config
44694
+ );
44280
44695
 
44281
44696
  !isStreamResponse && unsubscribe && unsubscribe();
44282
44697
 
44283
44698
  return await new Promise((resolve, reject) => {
44284
44699
  settle(resolve, reject, {
44285
44700
  data: responseData,
44286
- headers: AxiosHeaders$1.from(response.headers),
44701
+ headers: AxiosHeaders.from(response.headers),
44287
44702
  status: response.status,
44288
44703
  statusText: response.statusText,
44289
44704
  config,
44290
- request
44705
+ request,
44291
44706
  });
44292
- })
44707
+ });
44293
44708
  } catch (err) {
44294
44709
  unsubscribe && unsubscribe();
44295
44710
 
44296
44711
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
44297
44712
  throw Object.assign(
44298
- new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
44713
+ new AxiosError(
44714
+ 'Network Error',
44715
+ AxiosError.ERR_NETWORK,
44716
+ config,
44717
+ request,
44718
+ err && err.response
44719
+ ),
44299
44720
  {
44300
- cause: err.cause || err
44721
+ cause: err.cause || err,
44301
44722
  }
44302
- )
44723
+ );
44303
44724
  }
44304
44725
 
44305
- throw AxiosError$1.from(err, err && err.code, config, request);
44726
+ throw AxiosError.from(err, err && err.code, config, request, err && err.response);
44306
44727
  }
44307
- }
44728
+ };
44308
44729
  };
44309
44730
 
44310
44731
  const seedCache = new Map();
44311
44732
 
44312
44733
  const getFetch = (config) => {
44313
44734
  let env = (config && config.env) || {};
44314
- const {fetch, Request, Response} = env;
44315
- const seeds = [
44316
- Request, Response, fetch
44317
- ];
44735
+ const { fetch, Request, Response } = env;
44736
+ const seeds = [Request, Response, fetch];
44318
44737
 
44319
- let len = seeds.length, i = len,
44320
- seed, target, map = seedCache;
44738
+ let len = seeds.length,
44739
+ i = len,
44740
+ seed,
44741
+ target,
44742
+ map = seedCache;
44321
44743
 
44322
44744
  while (i--) {
44323
44745
  seed = seeds[i];
44324
44746
  target = map.get(seed);
44325
44747
 
44326
- target === undefined && map.set(seed, target = (i ? new Map() : factory(env)));
44748
+ target === undefined && map.set(seed, (target = i ? new Map() : factory(env)));
44327
44749
 
44328
44750
  map = target;
44329
44751
  }
@@ -44339,7 +44761,7 @@ getFetch();
44339
44761
  * - `http` for Node.js
44340
44762
  * - `xhr` for browsers
44341
44763
  * - `fetch` for fetch API-based requests
44342
- *
44764
+ *
44343
44765
  * @type {Object<string, Function|Object>}
44344
44766
  */
44345
44767
  const knownAdapters = {
@@ -44347,7 +44769,7 @@ const knownAdapters = {
44347
44769
  xhr: xhrAdapter,
44348
44770
  fetch: {
44349
44771
  get: getFetch,
44350
- }
44772
+ },
44351
44773
  };
44352
44774
 
44353
44775
  // Assign adapter names for easier debugging and identification
@@ -44364,7 +44786,7 @@ utils$1.forEach(knownAdapters, (fn, value) => {
44364
44786
 
44365
44787
  /**
44366
44788
  * Render a rejection reason string for unknown or unsupported adapters
44367
- *
44789
+ *
44368
44790
  * @param {string} reason
44369
44791
  * @returns {string}
44370
44792
  */
@@ -44372,17 +44794,18 @@ const renderReason = (reason) => `- ${reason}`;
44372
44794
 
44373
44795
  /**
44374
44796
  * Check if the adapter is resolved (function, null, or false)
44375
- *
44797
+ *
44376
44798
  * @param {Function|null|false} adapter
44377
44799
  * @returns {boolean}
44378
44800
  */
44379
- const isResolvedHandle = (adapter) => utils$1.isFunction(adapter) || adapter === null || adapter === false;
44801
+ const isResolvedHandle = (adapter) =>
44802
+ utils$1.isFunction(adapter) || adapter === null || adapter === false;
44380
44803
 
44381
44804
  /**
44382
44805
  * Get the first suitable adapter from the provided list.
44383
44806
  * Tries each adapter in order until a supported one is found.
44384
44807
  * Throws an AxiosError if no adapter is suitable.
44385
- *
44808
+ *
44386
44809
  * @param {Array<string|Function>|string|Function} adapters - Adapter(s) by name or function.
44387
44810
  * @param {Object} config - Axios request configuration
44388
44811
  * @throws {AxiosError} If no suitable adapter is available
@@ -44407,7 +44830,7 @@ function getAdapter(adapters, config) {
44407
44830
  adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
44408
44831
 
44409
44832
  if (adapter === undefined) {
44410
- throw new AxiosError$1(`Unknown adapter '${id}'`);
44833
+ throw new AxiosError(`Unknown adapter '${id}'`);
44411
44834
  }
44412
44835
  }
44413
44836
 
@@ -44419,16 +44842,19 @@ function getAdapter(adapters, config) {
44419
44842
  }
44420
44843
 
44421
44844
  if (!adapter) {
44422
- const reasons = Object.entries(rejectedReasons)
44423
- .map(([id, state]) => `adapter ${id} ` +
44845
+ const reasons = Object.entries(rejectedReasons).map(
44846
+ ([id, state]) =>
44847
+ `adapter ${id} ` +
44424
44848
  (state === false ? 'is not supported by the environment' : 'is not available in the build')
44425
- );
44849
+ );
44426
44850
 
44427
- let s = length ?
44428
- (reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
44429
- 'as no adapter specified';
44851
+ let s = length
44852
+ ? reasons.length > 1
44853
+ ? 'since :\n' + reasons.map(renderReason).join('\n')
44854
+ : ' ' + renderReason(reasons[0])
44855
+ : 'as no adapter specified';
44430
44856
 
44431
- throw new AxiosError$1(
44857
+ throw new AxiosError(
44432
44858
  `There is no suitable adapter to dispatch the request ` + s,
44433
44859
  'ERR_NOT_SUPPORT'
44434
44860
  );
@@ -44451,7 +44877,7 @@ var adapters = {
44451
44877
  * Exposes all known adapters
44452
44878
  * @type {Object<string, Function|Object>}
44453
44879
  */
44454
- adapters: knownAdapters
44880
+ adapters: knownAdapters,
44455
44881
  };
44456
44882
 
44457
44883
  /**
@@ -44467,7 +44893,7 @@ function throwIfCancellationRequested(config) {
44467
44893
  }
44468
44894
 
44469
44895
  if (config.signal && config.signal.aborted) {
44470
- throw new CanceledError$1(null, config);
44896
+ throw new CanceledError(null, config);
44471
44897
  }
44472
44898
  }
44473
44899
 
@@ -44481,53 +44907,49 @@ function throwIfCancellationRequested(config) {
44481
44907
  function dispatchRequest(config) {
44482
44908
  throwIfCancellationRequested(config);
44483
44909
 
44484
- config.headers = AxiosHeaders$1.from(config.headers);
44910
+ config.headers = AxiosHeaders.from(config.headers);
44485
44911
 
44486
44912
  // Transform request data
44487
- config.data = transformData.call(
44488
- config,
44489
- config.transformRequest
44490
- );
44913
+ config.data = transformData.call(config, config.transformRequest);
44491
44914
 
44492
44915
  if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {
44493
44916
  config.headers.setContentType('application/x-www-form-urlencoded', false);
44494
44917
  }
44495
44918
 
44496
- const adapter = adapters.getAdapter(config.adapter || defaults$1.adapter, config);
44497
-
44498
- return adapter(config).then(function onAdapterResolution(response) {
44499
- throwIfCancellationRequested(config);
44919
+ const adapter = adapters.getAdapter(config.adapter || defaults.adapter, config);
44500
44920
 
44501
- // Transform response data
44502
- response.data = transformData.call(
44503
- config,
44504
- config.transformResponse,
44505
- response
44506
- );
44507
-
44508
- response.headers = AxiosHeaders$1.from(response.headers);
44509
-
44510
- return response;
44511
- }, function onAdapterRejection(reason) {
44512
- if (!isCancel(reason)) {
44921
+ return adapter(config).then(
44922
+ function onAdapterResolution(response) {
44513
44923
  throwIfCancellationRequested(config);
44514
44924
 
44515
44925
  // Transform response data
44516
- if (reason && reason.response) {
44517
- reason.response.data = transformData.call(
44518
- config,
44519
- config.transformResponse,
44520
- reason.response
44521
- );
44522
- reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
44926
+ response.data = transformData.call(config, config.transformResponse, response);
44927
+
44928
+ response.headers = AxiosHeaders.from(response.headers);
44929
+
44930
+ return response;
44931
+ },
44932
+ function onAdapterRejection(reason) {
44933
+ if (!isCancel(reason)) {
44934
+ throwIfCancellationRequested(config);
44935
+
44936
+ // Transform response data
44937
+ if (reason && reason.response) {
44938
+ reason.response.data = transformData.call(
44939
+ config,
44940
+ config.transformResponse,
44941
+ reason.response
44942
+ );
44943
+ reason.response.headers = AxiosHeaders.from(reason.response.headers);
44944
+ }
44523
44945
  }
44524
- }
44525
44946
 
44526
- return Promise.reject(reason);
44527
- });
44947
+ return Promise.reject(reason);
44948
+ }
44949
+ );
44528
44950
  }
44529
44951
 
44530
- const VERSION = "1.13.4";
44952
+ const VERSION = "1.15.2";
44531
44953
 
44532
44954
  const validators$1 = {};
44533
44955
 
@@ -44551,15 +44973,23 @@ const deprecatedWarnings = {};
44551
44973
  */
44552
44974
  validators$1.transitional = function transitional(validator, version, message) {
44553
44975
  function formatMessage(opt, desc) {
44554
- return '[Axios v' + VERSION + '] Transitional option \'' + opt + '\'' + desc + (message ? '. ' + message : '');
44976
+ return (
44977
+ '[Axios v' +
44978
+ VERSION +
44979
+ "] Transitional option '" +
44980
+ opt +
44981
+ "'" +
44982
+ desc +
44983
+ (message ? '. ' + message : '')
44984
+ );
44555
44985
  }
44556
44986
 
44557
44987
  // eslint-disable-next-line func-names
44558
44988
  return (value, opt, opts) => {
44559
44989
  if (validator === false) {
44560
- throw new AxiosError$1(
44990
+ throw new AxiosError(
44561
44991
  formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),
44562
- AxiosError$1.ERR_DEPRECATED
44992
+ AxiosError.ERR_DEPRECATED
44563
44993
  );
44564
44994
  }
44565
44995
 
@@ -44583,7 +45013,7 @@ validators$1.spelling = function spelling(correctSpelling) {
44583
45013
  // eslint-disable-next-line no-console
44584
45014
  console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);
44585
45015
  return true;
44586
- }
45016
+ };
44587
45017
  };
44588
45018
 
44589
45019
  /**
@@ -44598,30 +45028,35 @@ validators$1.spelling = function spelling(correctSpelling) {
44598
45028
 
44599
45029
  function assertOptions(options, schema, allowUnknown) {
44600
45030
  if (typeof options !== 'object') {
44601
- throw new AxiosError$1('options must be an object', AxiosError$1.ERR_BAD_OPTION_VALUE);
45031
+ throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);
44602
45032
  }
44603
45033
  const keys = Object.keys(options);
44604
45034
  let i = keys.length;
44605
45035
  while (i-- > 0) {
44606
45036
  const opt = keys[i];
44607
- const validator = schema[opt];
45037
+ // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
45038
+ // a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
45039
+ const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
44608
45040
  if (validator) {
44609
45041
  const value = options[opt];
44610
45042
  const result = value === undefined || validator(value, opt, options);
44611
45043
  if (result !== true) {
44612
- throw new AxiosError$1('option ' + opt + ' must be ' + result, AxiosError$1.ERR_BAD_OPTION_VALUE);
45044
+ throw new AxiosError(
45045
+ 'option ' + opt + ' must be ' + result,
45046
+ AxiosError.ERR_BAD_OPTION_VALUE
45047
+ );
44613
45048
  }
44614
45049
  continue;
44615
45050
  }
44616
45051
  if (allowUnknown !== true) {
44617
- throw new AxiosError$1('Unknown option ' + opt, AxiosError$1.ERR_BAD_OPTION);
45052
+ throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);
44618
45053
  }
44619
45054
  }
44620
45055
  }
44621
45056
 
44622
45057
  var validator = {
44623
45058
  assertOptions,
44624
- validators: validators$1
45059
+ validators: validators$1,
44625
45060
  };
44626
45061
 
44627
45062
  const validators = validator.validators;
@@ -44637,8 +45072,8 @@ class Axios {
44637
45072
  constructor(instanceConfig) {
44638
45073
  this.defaults = instanceConfig || {};
44639
45074
  this.interceptors = {
44640
- request: new InterceptorManager$1(),
44641
- response: new InterceptorManager$1()
45075
+ request: new InterceptorManager(),
45076
+ response: new InterceptorManager(),
44642
45077
  };
44643
45078
  }
44644
45079
 
@@ -44660,13 +45095,29 @@ class Axios {
44660
45095
  Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());
44661
45096
 
44662
45097
  // slice off the Error: ... line
44663
- const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, '') : '';
45098
+ const stack = (() => {
45099
+ if (!dummy.stack) {
45100
+ return '';
45101
+ }
45102
+
45103
+ const firstNewlineIndex = dummy.stack.indexOf('\n');
45104
+
45105
+ return firstNewlineIndex === -1 ? '' : dummy.stack.slice(firstNewlineIndex + 1);
45106
+ })();
44664
45107
  try {
44665
45108
  if (!err.stack) {
44666
45109
  err.stack = stack;
44667
45110
  // match without the 2 top stack lines
44668
- } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ''))) {
44669
- err.stack += '\n' + stack;
45111
+ } else if (stack) {
45112
+ const firstNewlineIndex = stack.indexOf('\n');
45113
+ const secondNewlineIndex =
45114
+ firstNewlineIndex === -1 ? -1 : stack.indexOf('\n', firstNewlineIndex + 1);
45115
+ const stackWithoutTwoTopLines =
45116
+ secondNewlineIndex === -1 ? '' : stack.slice(secondNewlineIndex + 1);
45117
+
45118
+ if (!String(err.stack).endsWith(stackWithoutTwoTopLines)) {
45119
+ err.stack += '\n' + stack;
45120
+ }
44670
45121
  }
44671
45122
  } catch (e) {
44672
45123
  // ignore the case where "stack" is an un-writable property
@@ -44689,26 +45140,35 @@ class Axios {
44689
45140
 
44690
45141
  config = mergeConfig(this.defaults, config);
44691
45142
 
44692
- const {transitional, paramsSerializer, headers} = config;
45143
+ const { transitional, paramsSerializer, headers } = config;
44693
45144
 
44694
45145
  if (transitional !== undefined) {
44695
- validator.assertOptions(transitional, {
44696
- silentJSONParsing: validators.transitional(validators.boolean),
44697
- forcedJSONParsing: validators.transitional(validators.boolean),
44698
- clarifyTimeoutError: validators.transitional(validators.boolean)
44699
- }, false);
45146
+ validator.assertOptions(
45147
+ transitional,
45148
+ {
45149
+ silentJSONParsing: validators.transitional(validators.boolean),
45150
+ forcedJSONParsing: validators.transitional(validators.boolean),
45151
+ clarifyTimeoutError: validators.transitional(validators.boolean),
45152
+ legacyInterceptorReqResOrdering: validators.transitional(validators.boolean),
45153
+ },
45154
+ false
45155
+ );
44700
45156
  }
44701
45157
 
44702
45158
  if (paramsSerializer != null) {
44703
45159
  if (utils$1.isFunction(paramsSerializer)) {
44704
45160
  config.paramsSerializer = {
44705
- serialize: paramsSerializer
45161
+ serialize: paramsSerializer,
44706
45162
  };
44707
45163
  } else {
44708
- validator.assertOptions(paramsSerializer, {
44709
- encode: validators.function,
44710
- serialize: validators.function
44711
- }, true);
45164
+ validator.assertOptions(
45165
+ paramsSerializer,
45166
+ {
45167
+ encode: validators.function,
45168
+ serialize: validators.function,
45169
+ },
45170
+ true
45171
+ );
44712
45172
  }
44713
45173
  }
44714
45174
 
@@ -44719,28 +45179,27 @@ class Axios {
44719
45179
  config.allowAbsoluteUrls = true;
44720
45180
  }
44721
45181
 
44722
- validator.assertOptions(config, {
44723
- baseUrl: validators.spelling('baseURL'),
44724
- withXsrfToken: validators.spelling('withXSRFToken')
44725
- }, true);
45182
+ validator.assertOptions(
45183
+ config,
45184
+ {
45185
+ baseUrl: validators.spelling('baseURL'),
45186
+ withXsrfToken: validators.spelling('withXSRFToken'),
45187
+ },
45188
+ true
45189
+ );
44726
45190
 
44727
45191
  // Set config.method
44728
45192
  config.method = (config.method || this.defaults.method || 'get').toLowerCase();
44729
45193
 
44730
45194
  // Flatten headers
44731
- let contextHeaders = headers && utils$1.merge(
44732
- headers.common,
44733
- headers[config.method]
44734
- );
45195
+ let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
44735
45196
 
44736
- headers && utils$1.forEach(
44737
- ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
44738
- (method) => {
45197
+ headers &&
45198
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
44739
45199
  delete headers[method];
44740
- }
44741
- );
45200
+ });
44742
45201
 
44743
- config.headers = AxiosHeaders$1.concat(contextHeaders, headers);
45202
+ config.headers = AxiosHeaders.concat(contextHeaders, headers);
44744
45203
 
44745
45204
  // filter out skipped interceptors
44746
45205
  const requestInterceptorChain = [];
@@ -44752,7 +45211,15 @@ class Axios {
44752
45211
 
44753
45212
  synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
44754
45213
 
44755
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
45214
+ const transitional = config.transitional || transitionalDefaults;
45215
+ const legacyInterceptorReqResOrdering =
45216
+ transitional && transitional.legacyInterceptorReqResOrdering;
45217
+
45218
+ if (legacyInterceptorReqResOrdering) {
45219
+ requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
45220
+ } else {
45221
+ requestInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
45222
+ }
44756
45223
  });
44757
45224
 
44758
45225
  const responseInterceptorChain = [];
@@ -44820,28 +45287,32 @@ class Axios {
44820
45287
  // Provide aliases for supported request methods
44821
45288
  utils$1.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
44822
45289
  /*eslint func-names:0*/
44823
- Axios.prototype[method] = function(url, config) {
44824
- return this.request(mergeConfig(config || {}, {
44825
- method,
44826
- url,
44827
- data: (config || {}).data
44828
- }));
45290
+ Axios.prototype[method] = function (url, config) {
45291
+ return this.request(
45292
+ mergeConfig(config || {}, {
45293
+ method,
45294
+ url,
45295
+ data: (config || {}).data,
45296
+ })
45297
+ );
44829
45298
  };
44830
45299
  });
44831
45300
 
44832
45301
  utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
44833
- /*eslint func-names:0*/
44834
-
44835
45302
  function generateHTTPMethod(isForm) {
44836
45303
  return function httpMethod(url, data, config) {
44837
- return this.request(mergeConfig(config || {}, {
44838
- method,
44839
- headers: isForm ? {
44840
- 'Content-Type': 'multipart/form-data'
44841
- } : {},
44842
- url,
44843
- data
44844
- }));
45304
+ return this.request(
45305
+ mergeConfig(config || {}, {
45306
+ method,
45307
+ headers: isForm
45308
+ ? {
45309
+ 'Content-Type': 'multipart/form-data',
45310
+ }
45311
+ : {},
45312
+ url,
45313
+ data,
45314
+ })
45315
+ );
44845
45316
  };
44846
45317
  }
44847
45318
 
@@ -44850,8 +45321,6 @@ utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method)
44850
45321
  Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
44851
45322
  });
44852
45323
 
44853
- var Axios$1 = Axios;
44854
-
44855
45324
  /**
44856
45325
  * A `CancelToken` is an object that can be used to request cancellation of an operation.
44857
45326
  *
@@ -44874,7 +45343,7 @@ class CancelToken {
44874
45343
  const token = this;
44875
45344
 
44876
45345
  // eslint-disable-next-line func-names
44877
- this.promise.then(cancel => {
45346
+ this.promise.then((cancel) => {
44878
45347
  if (!token._listeners) return;
44879
45348
 
44880
45349
  let i = token._listeners.length;
@@ -44886,10 +45355,10 @@ class CancelToken {
44886
45355
  });
44887
45356
 
44888
45357
  // eslint-disable-next-line func-names
44889
- this.promise.then = onfulfilled => {
45358
+ this.promise.then = (onfulfilled) => {
44890
45359
  let _resolve;
44891
45360
  // eslint-disable-next-line func-names
44892
- const promise = new Promise(resolve => {
45361
+ const promise = new Promise((resolve) => {
44893
45362
  token.subscribe(resolve);
44894
45363
  _resolve = resolve;
44895
45364
  }).then(onfulfilled);
@@ -44907,7 +45376,7 @@ class CancelToken {
44907
45376
  return;
44908
45377
  }
44909
45378
 
44910
- token.reason = new CanceledError$1(message, config, request);
45379
+ token.reason = new CanceledError(message, config, request);
44911
45380
  resolvePromise(token.reason);
44912
45381
  });
44913
45382
  }
@@ -44977,13 +45446,11 @@ class CancelToken {
44977
45446
  });
44978
45447
  return {
44979
45448
  token,
44980
- cancel
45449
+ cancel,
44981
45450
  };
44982
45451
  }
44983
45452
  }
44984
45453
 
44985
- var CancelToken$1 = CancelToken;
44986
-
44987
45454
  /**
44988
45455
  * Syntactic sugar for invoking a function and expanding an array for arguments.
44989
45456
  *
@@ -45019,7 +45486,7 @@ function spread(callback) {
45019
45486
  * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
45020
45487
  */
45021
45488
  function isAxiosError(payload) {
45022
- return utils$1.isObject(payload) && (payload.isAxiosError === true);
45489
+ return utils$1.isObject(payload) && payload.isAxiosError === true;
45023
45490
  }
45024
45491
 
45025
45492
  const HttpStatusCode = {
@@ -45098,8 +45565,6 @@ Object.entries(HttpStatusCode).forEach(([key, value]) => {
45098
45565
  HttpStatusCode[value] = key;
45099
45566
  });
45100
45567
 
45101
- var HttpStatusCode$1 = HttpStatusCode;
45102
-
45103
45568
  /**
45104
45569
  * Create an instance of Axios
45105
45570
  *
@@ -45108,14 +45573,14 @@ var HttpStatusCode$1 = HttpStatusCode;
45108
45573
  * @returns {Axios} A new instance of Axios
45109
45574
  */
45110
45575
  function createInstance(defaultConfig) {
45111
- const context = new Axios$1(defaultConfig);
45112
- const instance = bind(Axios$1.prototype.request, context);
45576
+ const context = new Axios(defaultConfig);
45577
+ const instance = bind(Axios.prototype.request, context);
45113
45578
 
45114
45579
  // Copy axios.prototype to instance
45115
- utils$1.extend(instance, Axios$1.prototype, context, {allOwnKeys: true});
45580
+ utils$1.extend(instance, Axios.prototype, context, { allOwnKeys: true });
45116
45581
 
45117
45582
  // Copy context to instance
45118
- utils$1.extend(instance, context, null, {allOwnKeys: true});
45583
+ utils$1.extend(instance, context, null, { allOwnKeys: true });
45119
45584
 
45120
45585
  // Factory for creating new instances
45121
45586
  instance.create = function create(instanceConfig) {
@@ -45126,20 +45591,20 @@ function createInstance(defaultConfig) {
45126
45591
  }
45127
45592
 
45128
45593
  // Create the default instance to be exported
45129
- const axios = createInstance(defaults$1);
45594
+ const axios = createInstance(defaults);
45130
45595
 
45131
45596
  // Expose Axios class to allow class inheritance
45132
- axios.Axios = Axios$1;
45597
+ axios.Axios = Axios;
45133
45598
 
45134
45599
  // Expose Cancel & CancelToken
45135
- axios.CanceledError = CanceledError$1;
45136
- axios.CancelToken = CancelToken$1;
45600
+ axios.CanceledError = CanceledError;
45601
+ axios.CancelToken = CancelToken;
45137
45602
  axios.isCancel = isCancel;
45138
45603
  axios.VERSION = VERSION;
45139
45604
  axios.toFormData = toFormData;
45140
45605
 
45141
45606
  // Expose AxiosError class
45142
- axios.AxiosError = AxiosError$1;
45607
+ axios.AxiosError = AxiosError;
45143
45608
 
45144
45609
  // alias for CanceledError for backward compatibility
45145
45610
  axios.Cancel = axios.CanceledError;
@@ -45157,13 +45622,13 @@ axios.isAxiosError = isAxiosError;
45157
45622
  // Expose mergeConfig
45158
45623
  axios.mergeConfig = mergeConfig;
45159
45624
 
45160
- axios.AxiosHeaders = AxiosHeaders$1;
45625
+ axios.AxiosHeaders = AxiosHeaders;
45161
45626
 
45162
- axios.formToJSON = thing => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
45627
+ axios.formToJSON = (thing) => formDataToJSON(utils$1.isHTMLForm(thing) ? new FormData(thing) : thing);
45163
45628
 
45164
45629
  axios.getAdapter = adapters.getAdapter;
45165
45630
 
45166
- axios.HttpStatusCode = HttpStatusCode$1;
45631
+ axios.HttpStatusCode = HttpStatusCode;
45167
45632
 
45168
45633
  axios.default = axios;
45169
45634