@bitrix24/b24jssdk 1.1.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/README-AI.md +15 -3
  2. package/dist/esm/_virtual/_commonjsHelpers.mjs +1 -1
  3. package/dist/esm/_virtual/protobuf.mjs +1 -1
  4. package/dist/esm/_virtual/protobuf2.mjs +1 -1
  5. package/dist/esm/core/abstract-b24.mjs +1 -1
  6. package/dist/esm/core/actions/abstract-action.mjs +1 -1
  7. package/dist/esm/core/actions/abstract-batch.mjs +1 -1
  8. package/dist/esm/core/actions/manager.mjs +1 -1
  9. package/dist/esm/core/actions/v2/batch-by-chunk.mjs +1 -1
  10. package/dist/esm/core/actions/v2/batch.mjs +4 -4
  11. package/dist/esm/core/actions/v2/batch.mjs.map +1 -1
  12. package/dist/esm/core/actions/v2/call-list.mjs +17 -10
  13. package/dist/esm/core/actions/v2/call-list.mjs.map +1 -1
  14. package/dist/esm/core/actions/v2/call.mjs +1 -1
  15. package/dist/esm/core/actions/v2/fetch-list.mjs +17 -10
  16. package/dist/esm/core/actions/v2/fetch-list.mjs.map +1 -1
  17. package/dist/esm/core/actions/v2/manager-v2.mjs +6 -6
  18. package/dist/esm/core/actions/v2/manager-v2.mjs.map +1 -1
  19. package/dist/esm/core/actions/v3/batch-by-chunk.mjs +1 -1
  20. package/dist/esm/core/actions/v3/batch.mjs +4 -4
  21. package/dist/esm/core/actions/v3/batch.mjs.map +1 -1
  22. package/dist/esm/core/actions/v3/call-list.mjs +16 -9
  23. package/dist/esm/core/actions/v3/call-list.mjs.map +1 -1
  24. package/dist/esm/core/actions/v3/call.mjs +1 -1
  25. package/dist/esm/core/actions/v3/fetch-list.mjs +16 -9
  26. package/dist/esm/core/actions/v3/fetch-list.mjs.map +1 -1
  27. package/dist/esm/core/actions/v3/manager-v3.mjs +6 -6
  28. package/dist/esm/core/actions/v3/manager-v3.mjs.map +1 -1
  29. package/dist/esm/core/http/abstract-http.mjs +30 -6
  30. package/dist/esm/core/http/abstract-http.mjs.map +1 -1
  31. package/dist/esm/core/http/ajax-error.mjs +1 -1
  32. package/dist/esm/core/http/ajax-result.mjs +1 -1
  33. package/dist/esm/core/http/limiters/adaptive-delayer.mjs +1 -1
  34. package/dist/esm/core/http/limiters/manager.mjs +31 -1
  35. package/dist/esm/core/http/limiters/manager.mjs.map +1 -1
  36. package/dist/esm/core/http/limiters/operating-limiter.mjs +1 -1
  37. package/dist/esm/core/http/limiters/params-factory.mjs +1 -1
  38. package/dist/esm/core/http/limiters/rate-limiter.mjs +1 -1
  39. package/dist/esm/core/http/redact.mjs +1 -1
  40. package/dist/esm/core/http/v2.mjs +2 -2
  41. package/dist/esm/core/http/v3.mjs +2 -2
  42. package/dist/esm/core/interaction/batch/abstract-interaction-batch.mjs +1 -1
  43. package/dist/esm/core/interaction/batch/parse-row.mjs +1 -1
  44. package/dist/esm/core/interaction/batch/processing/interface-strategy.mjs +1 -1
  45. package/dist/esm/core/interaction/batch/processing/v2/abstract-processing.mjs +1 -1
  46. package/dist/esm/core/interaction/batch/processing/v2/as-array.mjs +1 -1
  47. package/dist/esm/core/interaction/batch/processing/v2/as-object.mjs +1 -1
  48. package/dist/esm/core/interaction/batch/processing/v3/abstract-processing.mjs +1 -1
  49. package/dist/esm/core/interaction/batch/processing/v3/as-array.mjs +1 -1
  50. package/dist/esm/core/interaction/batch/processing/v3/as-object.mjs +1 -1
  51. package/dist/esm/core/interaction/batch/v2.mjs +1 -1
  52. package/dist/esm/core/interaction/batch/v3.mjs +1 -1
  53. package/dist/esm/core/language/list.mjs +1 -1
  54. package/dist/esm/core/request-id-generator.mjs +1 -1
  55. package/dist/esm/core/result.mjs +28 -1
  56. package/dist/esm/core/result.mjs.map +1 -1
  57. package/dist/esm/core/sdk-error.mjs +1 -1
  58. package/dist/esm/core/tools/abstract-tool.mjs +1 -1
  59. package/dist/esm/core/tools/healthcheck.mjs +1 -1
  60. package/dist/esm/core/tools/manager.mjs +3 -3
  61. package/dist/esm/core/tools/manager.mjs.map +1 -1
  62. package/dist/esm/core/tools/ping.mjs +1 -1
  63. package/dist/esm/core/version-manager.mjs +89 -12
  64. package/dist/esm/core/version-manager.mjs.map +1 -1
  65. package/dist/esm/frame/auth.mjs +1 -1
  66. package/dist/esm/frame/b24.mjs +1 -1
  67. package/dist/esm/frame/dialog.mjs +1 -1
  68. package/dist/esm/frame/frame.mjs +1 -1
  69. package/dist/esm/frame/message/commands.mjs +1 -1
  70. package/dist/esm/frame/message/controller.mjs +1 -1
  71. package/dist/esm/frame/options.mjs +1 -1
  72. package/dist/esm/frame/parent.mjs +6 -2
  73. package/dist/esm/frame/parent.mjs.map +1 -1
  74. package/dist/esm/frame/placement.mjs +1 -1
  75. package/dist/esm/frame/slider.mjs +5 -1
  76. package/dist/esm/frame/slider.mjs.map +1 -1
  77. package/dist/esm/helper/abstract-helper.mjs +1 -1
  78. package/dist/esm/helper/app-manager.mjs +1 -1
  79. package/dist/esm/helper/currency-manager.mjs +1 -1
  80. package/dist/esm/helper/helper-manager.mjs +1 -1
  81. package/dist/esm/helper/license-manager.mjs +1 -1
  82. package/dist/esm/helper/options-manager.mjs +1 -1
  83. package/dist/esm/helper/payment-manager.mjs +1 -1
  84. package/dist/esm/helper/profile-manager.mjs +1 -1
  85. package/dist/esm/helper/use-b24-helper.mjs +1 -1
  86. package/dist/esm/hook/auth.mjs +1 -1
  87. package/dist/esm/hook/b24.mjs +1 -1
  88. package/dist/esm/index.d.mts +101 -22
  89. package/dist/esm/index.d.ts +101 -22
  90. package/dist/esm/index.mjs +1 -1
  91. package/dist/esm/loader-b24frame.mjs +1 -1
  92. package/dist/esm/logger/abstract-logger.mjs +1 -1
  93. package/dist/esm/logger/browser.mjs +1 -1
  94. package/dist/esm/logger/formatter/abstract-formatter.mjs +1 -1
  95. package/dist/esm/logger/formatter/json-formatter.mjs +1 -1
  96. package/dist/esm/logger/formatter/line-formatter.mjs +1 -1
  97. package/dist/esm/logger/formatter/telegram-formatter.mjs +1 -1
  98. package/dist/esm/logger/handler/abstract-handler.mjs +1 -1
  99. package/dist/esm/logger/handler/consola-adapter.mjs +1 -1
  100. package/dist/esm/logger/handler/console-handler.mjs +1 -1
  101. package/dist/esm/logger/handler/console-v2-handler.mjs +1 -1
  102. package/dist/esm/logger/handler/memory-handler.mjs +1 -1
  103. package/dist/esm/logger/handler/stream-handler.mjs +1 -1
  104. package/dist/esm/logger/handler/telegram-handler.mjs +1 -1
  105. package/dist/esm/logger/handler/winston-adapter.mjs +1 -1
  106. package/dist/esm/logger/logger-factory.mjs +1 -1
  107. package/dist/esm/logger/logger.mjs +1 -1
  108. package/dist/esm/logger/null-logger.mjs +1 -1
  109. package/dist/esm/logger/processor/memory-usage-processor.mjs +1 -1
  110. package/dist/esm/logger/processor/pid-processor.mjs +1 -1
  111. package/dist/esm/oauth/auth.mjs +1 -1
  112. package/dist/esm/oauth/b24.mjs +1 -1
  113. package/dist/esm/oauth/refresh-token-error.mjs +1 -1
  114. package/dist/esm/pullClient/abstract-connector.mjs +1 -1
  115. package/dist/esm/pullClient/channel-manager.mjs +1 -1
  116. package/dist/esm/pullClient/client.mjs +1 -1
  117. package/dist/esm/pullClient/errors.mjs +1 -1
  118. package/dist/esm/pullClient/json-rpc.mjs +1 -1
  119. package/dist/esm/pullClient/long-polling-connector.mjs +1 -1
  120. package/dist/esm/pullClient/protobuf/index.mjs +1 -1
  121. package/dist/esm/pullClient/protobuf/model.mjs +1 -1
  122. package/dist/esm/pullClient/protobuf/protobuf.mjs +53 -53
  123. package/dist/esm/pullClient/protobuf/protobuf.mjs.map +1 -1
  124. package/dist/esm/pullClient/shared-config.mjs +1 -1
  125. package/dist/esm/pullClient/storage-manager.mjs +1 -1
  126. package/dist/esm/pullClient/web-socket-connector.mjs +1 -1
  127. package/dist/esm/tools/browser.mjs +1 -1
  128. package/dist/esm/tools/environment.mjs +1 -1
  129. package/dist/esm/tools/formatters/iban.mjs +1 -1
  130. package/dist/esm/tools/formatters/numbers.mjs +1 -1
  131. package/dist/esm/tools/index.mjs +1 -1
  132. package/dist/esm/tools/scroll-size.mjs +1 -1
  133. package/dist/esm/tools/text.mjs +1 -1
  134. package/dist/esm/tools/type.mjs +1 -1
  135. package/dist/esm/tools/use-formatters.mjs +1 -1
  136. package/dist/esm/tools/uuidv7.mjs +1 -1
  137. package/dist/esm/types/b24-helper.mjs +1 -1
  138. package/dist/esm/types/b24.mjs +1 -1
  139. package/dist/esm/types/bizproc/index.mjs +1 -1
  140. package/dist/esm/types/catalog/index.mjs +1 -1
  141. package/dist/esm/types/common.mjs +1 -1
  142. package/dist/esm/types/crm/entity-type.mjs +1 -1
  143. package/dist/esm/types/crm/productrow.mjs +1 -1
  144. package/dist/esm/types/logger.mjs +1 -1
  145. package/dist/esm/types/pull.mjs +1 -1
  146. package/dist/umd/index.js +1899 -1309
  147. package/dist/umd/index.js.map +1 -1
  148. package/dist/umd/index.min.js +28 -28
  149. package/dist/umd/index.min.js.map +1 -1
  150. package/package.json +1 -1
package/dist/umd/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @package @bitrix24/b24jssdk
3
- * @version 1.1.2
3
+ * @version 1.3.0
4
4
  * @copyright (c) 2026 Bitrix24
5
5
  * @license MIT
6
6
  * @see https://github.com/bitrix24/b24jssdk
@@ -10407,6 +10407,33 @@ If you need to send logs from browser, use a proxy server.`;
10407
10407
  getErrorMessages() {
10408
10408
  return Array.from(this._errors.values(), (e) => e.message);
10409
10409
  }
10410
+ /**
10411
+ * Retrieves all errors as a plain object (a snapshot copy) keyed by their
10412
+ * identifier, preserving which request produced each error. Unlike
10413
+ * {@link Result.getErrors}, the keys are not discarded — useful for batch
10414
+ * calls with `isHaltOnError: false`.
10415
+ *
10416
+ * Keys are meaningful only when the error was added with an explicit key
10417
+ * (e.g. an object / named-command batch). Array-mode batches and
10418
+ * {@link Result.addErrors} fall back to generated UUID keys.
10419
+ *
10420
+ * @returns {Record<string, Error>} A map of error key to Error object.
10421
+ */
10422
+ getErrorsByKey() {
10423
+ return Object.fromEntries(this._errors);
10424
+ }
10425
+ /**
10426
+ * Retrieves all error messages as a plain object (a snapshot copy) keyed by
10427
+ * their identifier. Unlike {@link Result.getErrorMessages}, the keys are
10428
+ * preserved. See {@link Result.getErrorsByKey} for when keys are meaningful.
10429
+ *
10430
+ * @returns {Record<string, string>} A map of error key to error message.
10431
+ */
10432
+ getErrorMessagesByKey() {
10433
+ return Object.fromEntries(
10434
+ Array.from(this._errors, ([key, error]) => [key, error.message])
10435
+ );
10436
+ }
10410
10437
  /**
10411
10438
  * Converts the Result object to a string.
10412
10439
  *
@@ -11726,6 +11753,10 @@ ${this.stack}`;
11726
11753
  this.#logError(this.#operatingLimiter.getTitle(), requestId, "OPERATION_TIME_LIMIT", error.message, method, wait);
11727
11754
  return wait;
11728
11755
  }
11756
+ if (this.#isNonRetryableClientError(error)) {
11757
+ this.#logNonRetryableClientError(requestId, error?.code ? `${error.code}` : "?", error?.message ?? "", method, Number(error?.status ?? 0));
11758
+ return 0;
11759
+ }
11729
11760
  if (!this.#isNeedThrowError(error)) {
11730
11761
  const baseDelay = await this.#getErrorBackoff(requestId);
11731
11762
  const maxDelay = Math.max(3e4, baseDelay);
@@ -11767,6 +11798,20 @@ ${this.stack}`;
11767
11798
  async #handleOperatingLimitError(requestId, method, params, _error) {
11768
11799
  return this.#operatingLimiter.getTimeToFree(requestId, method, params, _error);
11769
11800
  }
11801
+ /**
11802
+ * Checks if the error is a non-retryable client error (HTTP 4xx).
11803
+ *
11804
+ * `429` is excluded — it is handled as a rate/operating limit and is retried
11805
+ * with backoff. `408` (request timeout) is excluded — it is transient and is
11806
+ * governed by `retryOnNetworkError`.
11807
+ */
11808
+ #isNonRetryableClientError(error) {
11809
+ const status = Number(error?.status ?? 0);
11810
+ if (Number.isNaN(status)) {
11811
+ return false;
11812
+ }
11813
+ return status >= 400 && status < 500 && status !== 408 && status !== 429;
11814
+ }
11770
11815
  /**
11771
11816
  * Checks whether attempts should be stopped if errors are encountered that are unclear.
11772
11817
  */
@@ -11799,6 +11844,7 @@ ${this.stack}`;
11799
11844
  "INVALID_REQUEST",
11800
11845
  "OVERLOAD_LIMIT",
11801
11846
  "expired_token",
11847
+ "invalid_token",
11802
11848
  "ACCESS_DENIED",
11803
11849
  "INVALID_CREDENTIALS",
11804
11850
  "user_access_error",
@@ -11963,6 +12009,17 @@ ${this.stack}`;
11963
12009
  }
11964
12010
  });
11965
12011
  }
12012
+ #logNonRetryableClientError(requestId, code, message, method, status) {
12013
+ this.getLogger().error(`client error ${status} (${code}) for the ${method} method is not retryable`, {
12014
+ requestId,
12015
+ method,
12016
+ status,
12017
+ error: {
12018
+ code,
12019
+ message
12020
+ }
12021
+ });
12022
+ }
11966
12023
  // endregion ////
11967
12024
  }
11968
12025
 
@@ -12030,6 +12087,7 @@ ${JSON.stringify({
12030
12087
  #supportMethods;
12031
12088
  constructor() {
12032
12089
  this.#supportMethods = [
12090
+ // --- infrastructure ---
12033
12091
  "/batch",
12034
12092
  // done
12035
12093
  "/scopes",
@@ -12038,6 +12096,7 @@ ${JSON.stringify({
12038
12096
  // done
12039
12097
  "/rest.documentation.openapi",
12040
12098
  "/documentation",
12099
+ // --- main ---
12041
12100
  /** @see /settings/configs/event_log.php */
12042
12101
  "/main.eventlog.list",
12043
12102
  // done
@@ -12045,21 +12104,96 @@ ${JSON.stringify({
12045
12104
  // done
12046
12105
  "/main.eventlog.tail",
12047
12106
  // done
12048
- "/tasks.task.chat.message.send",
12049
- "/tasks.task.access.get",
12050
- "/tasks.task.file.attach",
12107
+ "/main.eventlog.field.list",
12108
+ "/main.eventlog.field.get",
12109
+ // --- mail (rest-v3) ---
12110
+ "/mail.mailbox.list",
12111
+ "/mail.mailbox.get",
12112
+ "/mail.mailbox.senders",
12113
+ "/mail.mailbox.field.list",
12114
+ "/mail.mailbox.field.get",
12115
+ "/mail.message.list",
12116
+ "/mail.message.get",
12117
+ "/mail.message.thread",
12118
+ "/mail.message.send",
12119
+ "/mail.message.reply",
12120
+ "/mail.message.forward",
12121
+ "/mail.message.movetofolder",
12122
+ "/mail.message.createcrmactivity",
12123
+ "/mail.message.removecrmactivity",
12124
+ "/mail.message.createtask",
12125
+ "/mail.message.createcalendarevent",
12126
+ "/mail.message.createchat",
12127
+ "/mail.message.createfeedpost",
12128
+ "/mail.message.field.list",
12129
+ "/mail.message.field.get",
12130
+ "/mail.recipient.listcontacts",
12131
+ "/mail.recipient.listemployees",
12132
+ "/mail.recipient.field.list",
12133
+ "/mail.recipient.field.get",
12134
+ // --- humanresources (rest-v3) ---
12135
+ "/humanresources.node.add",
12136
+ "/humanresources.node.edit",
12137
+ "/humanresources.node.get",
12138
+ "/humanresources.node.list",
12139
+ "/humanresources.node.search",
12140
+ "/humanresources.node.children",
12141
+ "/humanresources.node.count",
12142
+ "/humanresources.node.move",
12143
+ "/humanresources.node.field.list",
12144
+ "/humanresources.node.field.get",
12145
+ "/humanresources.node.member.add",
12146
+ "/humanresources.node.member.set",
12147
+ "/humanresources.node.member.move",
12148
+ "/humanresources.node.member.remove",
12149
+ "/humanresources.node.communication.edit",
12150
+ "/humanresources.node.communication.list",
12151
+ "/humanresources.employee.search",
12152
+ "/humanresources.employee.subordinates",
12153
+ "/humanresources.employee.count",
12154
+ "/humanresources.employee.multidepartment",
12155
+ "/humanresources.employee.field.list",
12156
+ "/humanresources.employee.field.get",
12157
+ // --- tasks (rest-v3) ---
12158
+ "/tasks.task.add",
12159
+ "/tasks.task.get",
12160
+ // done
12051
12161
  "/tasks.task.update",
12052
12162
  // done
12053
12163
  "/tasks.task.delete",
12054
- "/tasks.task.add",
12055
- "/tasks.task.get"
12056
- // done
12164
+ "/tasks.task.access.get",
12165
+ "/tasks.task.file.attach",
12166
+ "/tasks.task.chat.message.send",
12167
+ "/tasks.task.result.add",
12168
+ "/tasks.task.result.addfromchatmessage",
12169
+ "/tasks.task.result.update",
12170
+ "/tasks.task.result.list",
12171
+ "/tasks.task.result.delete",
12172
+ "/tasks.task.field.list",
12173
+ "/tasks.task.field.get",
12174
+ "/tasks.task.access.field.list",
12175
+ "/tasks.task.access.field.get",
12176
+ "/tasks.task.file.field.list",
12177
+ "/tasks.task.file.field.get",
12178
+ "/tasks.task.chat.message.field.list",
12179
+ "/tasks.task.chat.message.field.get",
12180
+ // --- timeman (rest-v3) — read-only in v3 (no record.get / add / update / delete) ---
12181
+ "/timeman.record.list",
12182
+ "/timeman.record.field.list",
12183
+ "/timeman.record.field.get"
12184
+ // Cross-module methods are cross-referenced from the rest-v3 pages above but
12185
+ // belong to modules not actualized here — add them when those modules land:
12186
+ // user.get — user module (seen on humanresources + timeman)
12187
+ // im.message.update / im.message.delete / im.dialog.messages.get — im module (seen on tasks)
12188
+ // disk.storage.uploadfile / disk.folder.uploadfile /
12189
+ // disk.storage.getchildren / disk.folder.getchildren — disk module (seen on tasks)
12190
+ //
12057
12191
  // @todo When API.v3 arrives - change in AuthOAuthManager.initIsAdmin()
12058
- // '/profile' // waite
12059
- // '/main.message.get' // waite
12060
- // '/main.chat.update' // waite
12061
- // '/main.chat.list' // waite
12062
- // '/main.user.list' // waite
12192
+ // '/profile' // wait
12193
+ // '/main.message.get' // wait
12194
+ // '/main.chat.update' // wait
12195
+ // '/main.chat.list' // wait
12196
+ // '/main.user.list' // wait
12063
12197
  ];
12064
12198
  }
12065
12199
  static create() {
@@ -12203,12 +12337,16 @@ ${JSON.stringify({
12203
12337
  *
12204
12338
  * @param {ActionCallListV2} options - parameters for executing the request.
12205
12339
  * - `method: string` - The name of the REST API method that returns a list of data (for example: `crm.item.list`, `tasks.task.list`)
12206
- * - `params?: Omit<TypeCallParams, 'start'>` - Request parameters, excluding the `start` parameter,
12340
+ * - `params?: Omit<TypeCallParams, 'start' | 'order'>` - Request parameters, excluding the `start` and `order` parameters,
12207
12341
  * since the method is designed to obtain all data in one call.
12208
12342
  * Note: Use `filter`, `order`, and `select` to control the selection.
12209
- * - `idKey?: string` - The name of the field containing the unique identifier of the element.
12210
- * Default is 'ID' (uppercase). Alternatively, it can be 'id' (lowercase).
12211
- * or another field, depending on the REST API data structure.
12343
+ * - `idKey?: string` - The name of the id field as it appears in each RESPONSE item; its value
12344
+ * drives the cursor. Default is 'ID' (uppercase). For methods that return a lowercase /
12345
+ * camelCase id (for example `tasks.task.list` returns `id`), set `idKey: 'id'`.
12346
+ * - `cursorIdKey?: string` - The field name used in the REQUEST for `order` and the `>` page
12347
+ * filter. Defaults to `idKey`. Set it only when the sortable / filterable field name differs
12348
+ * from the response field name — e.g. `tasks.task.list` sorts and filters by `ID` (uppercase)
12349
+ * but returns `id` (lowercase): pass `idKey: 'id', cursorIdKey: 'ID'`.
12212
12350
  * - `customKeyForResult?: string` - A custom key indicating that the response REST API will be
12213
12351
  * grouped by this field.
12214
12352
  * Example: `items` to group a list of CRM items.
@@ -12247,16 +12385,17 @@ ${JSON.stringify({
12247
12385
  const batchSize = 50;
12248
12386
  const result = new Result();
12249
12387
  const idKey = options?.idKey ?? "ID";
12388
+ const cursorIdKey = options?.cursorIdKey ?? idKey;
12250
12389
  const customKeyForResult = options?.customKeyForResult ?? null;
12251
12390
  const params = options?.params ?? {};
12252
12391
  if ("order" in params && params["order"]) {
12253
- this._logger.warning("callList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by idKey. Use `filter` to narrow results instead.");
12392
+ this._logger.warning("callList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by cursorIdKey. Use `filter` to narrow results instead.");
12254
12393
  }
12255
- const moreIdKey = `>${idKey}`;
12394
+ const moreIdKey = `>${cursorIdKey}`;
12256
12395
  const { order: _ignoredOrder, ...restParams } = params;
12257
12396
  const requestParams = {
12258
12397
  ...restParams,
12259
- order: { [idKey]: "ASC" },
12398
+ order: { [cursorIdKey]: "ASC" },
12260
12399
  filter: { ...params["filter"] || {}, [moreIdKey]: 0 },
12261
12400
  start: -1
12262
12401
  };
@@ -12301,9 +12440,11 @@ ${JSON.stringify({
12301
12440
  break;
12302
12441
  }
12303
12442
  const lastItem = resultData[resultData.length - 1];
12304
- if (lastItem && typeof lastItem[idKey] !== "undefined") {
12305
- requestParams.filter[moreIdKey] = Number.parseInt(lastItem[idKey]);
12443
+ const cursorValue = lastItem ? Number.parseInt(lastItem[idKey], 10) : Number.NaN;
12444
+ if (Number.isFinite(cursorValue)) {
12445
+ requestParams.filter[moreIdKey] = cursorValue;
12306
12446
  } else {
12447
+ this._logger.warning(`callList.make: pagination stops here \u2014 no numeric id could be read from the returned items via idKey "${idKey}". Make sure idKey matches the id field in the response; if the sortable field name differs from it, also set cursorIdKey (e.g. idKey: 'id', cursorIdKey: 'ID').`);
12307
12448
  isContinue = false;
12308
12449
  break;
12309
12450
  }
@@ -12326,12 +12467,16 @@ ${JSON.stringify({
12326
12467
  *
12327
12468
  * @param {ActionFetchListV2} options - parameters for executing the request.
12328
12469
  * - `method: string` - The name of the REST API method that returns a list of data (for example: `crm.item.list`, `tasks.task.list`)
12329
- * - `params?: Omit<TypeCallParams, 'start'>` - Request parameters, excluding the `start` parameter,
12470
+ * - `params?: Omit<TypeCallParams, 'start' | 'order'>` - Request parameters, excluding the `start` and `order` parameters,
12330
12471
  * since the method is designed to obtain all data in one call.
12331
12472
  * Note: Use `filter`, `order`, and `select` to control the selection.
12332
- * - `idKey?: string` - The name of the field containing the unique identifier of the element.
12333
- * Default is 'ID' (uppercase). Alternatively, it can be 'id' (lowercase).
12334
- * or another field, depending on the REST API data structure.
12473
+ * - `idKey?: string` - The name of the id field as it appears in each RESPONSE item; its value
12474
+ * drives the cursor. Default is 'ID' (uppercase). For methods that return a lowercase /
12475
+ * camelCase id (for example `tasks.task.list` returns `id`), set `idKey: 'id'`.
12476
+ * - `cursorIdKey?: string` - The field name used in the REQUEST for `order` and the `>` page
12477
+ * filter. Defaults to `idKey`. Set it only when the sortable / filterable field name differs
12478
+ * from the response field name — e.g. `tasks.task.list` sorts and filters by `ID` (uppercase)
12479
+ * but returns `id` (lowercase): pass `idKey: 'id', cursorIdKey: 'ID'`.
12335
12480
  * - `customKeyForResult?: string` - A custom key indicating that the response REST API will be
12336
12481
  * grouped by this field.
12337
12482
  * Example: `items` to group a list of CRM items.
@@ -12372,16 +12517,17 @@ ${JSON.stringify({
12372
12517
  async *make(options) {
12373
12518
  const batchSize = 50;
12374
12519
  const idKey = options?.idKey ?? "ID";
12520
+ const cursorIdKey = options?.cursorIdKey ?? idKey;
12375
12521
  const customKeyForResult = options?.customKeyForResult ?? null;
12376
12522
  const params = options?.params ?? {};
12377
12523
  if ("order" in params && params["order"]) {
12378
- this._logger.warning("fetchList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by idKey. Use `filter` to narrow results instead.");
12524
+ this._logger.warning("fetchList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by cursorIdKey. Use `filter` to narrow results instead.");
12379
12525
  }
12380
- const moreIdKey = `>${idKey}`;
12526
+ const moreIdKey = `>${cursorIdKey}`;
12381
12527
  const { order: _ignoredOrder, ...restParams } = params;
12382
12528
  const requestParams = {
12383
12529
  ...restParams,
12384
- order: { [idKey]: "ASC" },
12530
+ order: { [cursorIdKey]: "ASC" },
12385
12531
  filter: { ...params["filter"] || {}, [moreIdKey]: 0 },
12386
12532
  start: -1
12387
12533
  };
@@ -12425,9 +12571,11 @@ ${JSON.stringify({
12425
12571
  break;
12426
12572
  }
12427
12573
  const lastItem = resultData[resultData.length - 1];
12428
- if (lastItem && typeof lastItem[idKey] !== "undefined") {
12429
- requestParams.filter[moreIdKey] = Number.parseInt(lastItem[idKey]);
12574
+ const cursorValue = lastItem ? Number.parseInt(lastItem[idKey], 10) : Number.NaN;
12575
+ if (Number.isFinite(cursorValue)) {
12576
+ requestParams.filter[moreIdKey] = cursorValue;
12430
12577
  } else {
12578
+ this._logger.warning(`fetchList.make: pagination stops here \u2014 no numeric id could be read from the returned items via idKey "${idKey}". Make sure idKey matches the id field in the response; if the sortable field name differs from it, also set cursorIdKey (e.g. idKey: 'id', cursorIdKey: 'ID').`);
12431
12579
  isContinue = false;
12432
12580
  break;
12433
12581
  }
@@ -12569,7 +12717,7 @@ ${JSON.stringify({
12569
12717
  * const resultData = (response as Result<AjaxResult<{ item: Contact }>[]>).getData()
12570
12718
  * resultData.forEach((resultRow, index) => {
12571
12719
  * if (resultRow.isSuccess) {
12572
- * console.log(`Item ${index + 1}:`, resultRow.getData().result.item)
12720
+ * console.log(`Item ${index + 1}:`, resultRow.getData()!.result.item)
12573
12721
  * }
12574
12722
  * })
12575
12723
  *
@@ -12612,8 +12760,8 @@ ${JSON.stringify({
12612
12760
  * }
12613
12761
  *
12614
12762
  * const results = response.getData() as Record<string, AjaxResult<{ item: Contact } | { item: Deal }>>
12615
- * console.log('Contact:', results.Contact.getData().result.item as Contact)
12616
- * console.log('Deal:', results.Deal.getData().result.item as Deal)
12763
+ * console.log('Contact:', results.Contact.getData()?.result.item as Contact)
12764
+ * console.log('Deal:', results.Deal.getData()?.result.item as Deal)
12617
12765
  *
12618
12766
  * @warning The maximum number of commands in one batch request is 50.
12619
12767
  * @note A batch request executes faster than sequential single calls,
@@ -12711,11 +12859,11 @@ ${JSON.stringify({
12711
12859
 
12712
12860
  var __defProp$10 = Object.defineProperty;
12713
12861
  var __name$10 = (target, value) => __defProp$10(target, "name", { value, configurable: true });
12714
- const callName$1 = Symbol("call_V2");
12715
- const callListName$1 = Symbol("callList_V2");
12716
- const fetchListName$1 = Symbol("fetchList_V2");
12717
- const batchName$1 = Symbol("batch_V2");
12718
- const batchByChunkName$1 = Symbol("batchByChunk_V2");
12862
+ const callName$1 = /* @__PURE__ */ Symbol("call_V2");
12863
+ const callListName$1 = /* @__PURE__ */ Symbol("callList_V2");
12864
+ const fetchListName$1 = /* @__PURE__ */ Symbol("fetchList_V2");
12865
+ const batchName$1 = /* @__PURE__ */ Symbol("batch_V2");
12866
+ const batchByChunkName$1 = /* @__PURE__ */ Symbol("batchByChunk_V2");
12719
12867
  class ActionsManagerV2 {
12720
12868
  static {
12721
12869
  __name$10(this, "ActionsManagerV2");
@@ -12822,11 +12970,15 @@ ${JSON.stringify({
12822
12970
  *
12823
12971
  * @param {ActionCallListV3} options - parameters for executing the request.
12824
12972
  * - `method: string` - The name of the REST API method that returns a list of data (for example: `crm.item.list`, `tasks.task.list`)
12825
- * - `params?: Omit<TypeCallParams, 'pagination'>` - Request parameters, excluding the `pagination` parameter,
12973
+ * - `params?: Omit<TypeCallParams, 'pagination' | 'order'>` - Request parameters, excluding the `pagination` and `order` parameters,
12826
12974
  * since the method is designed to obtain all data in one call.
12827
12975
  * Note: Use `filter`, `order`, and `select` to control the selection.
12828
- * - `idKey?: string` - The name of the field containing the unique identifier of the element.
12829
- * Default is 'id'. Alternatively, it can be another field, depending on the REST API data structure.
12976
+ * - `idKey?: string` - The name of the id field as it appears in each RESPONSE item; its value
12977
+ * drives the cursor. Default is 'id'. Set it to match the id field the method returns.
12978
+ * - `cursorIdKey?: string` - The field name used in the REQUEST for `order` and the
12979
+ * `[field, '>', n]` page filter. Defaults to `idKey`. Set it only when the sortable /
12980
+ * filterable field name differs from the response field name (e.g. an uppercase request
12981
+ * field but a lowercase response id): pass `idKey: 'id', cursorIdKey: 'ID'`.
12830
12982
  * - `customKeyForResult: string` - A custom key indicating that the response REST API will be
12831
12983
  * grouped by this field.
12832
12984
  * Example: `items` to group a list of CRM items.
@@ -12865,15 +13017,16 @@ ${JSON.stringify({
12865
13017
  const batchSize = options?.limit ?? 50;
12866
13018
  const result = new Result();
12867
13019
  const idKey = options?.idKey ?? "id";
13020
+ const cursorIdKey = options?.cursorIdKey ?? idKey;
12868
13021
  const customKeyForResult = options?.customKeyForResult ?? null;
12869
13022
  const params = options?.params ?? {};
12870
13023
  if ("order" in params && params["order"]) {
12871
- this._logger.warning("callList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by idKey. Use `filter` to narrow results instead.");
13024
+ this._logger.warning("callList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by cursorIdKey. Use `filter` to narrow results instead.");
12872
13025
  }
12873
13026
  const { order: _ignoredOrder, ...restParams } = params;
12874
13027
  const requestParams = {
12875
13028
  ...restParams,
12876
- order: { [idKey]: "ASC" },
13029
+ order: { [cursorIdKey]: "ASC" },
12877
13030
  filter: [...params["filter"] || []],
12878
13031
  pagination: { page: 0, limit: batchSize }
12879
13032
  };
@@ -12882,7 +13035,7 @@ ${JSON.stringify({
12882
13035
  let nextId = 0;
12883
13036
  do {
12884
13037
  const sendParams = { ...requestParams, filter: [...requestParams.filter] };
12885
- sendParams.filter.push([idKey, ">", nextId]);
13038
+ sendParams.filter.push([cursorIdKey, ">", nextId]);
12886
13039
  const response = await this._b24.actions.v3.call.make({
12887
13040
  method: options.method,
12888
13041
  params: sendParams,
@@ -12916,9 +13069,11 @@ ${JSON.stringify({
12916
13069
  break;
12917
13070
  }
12918
13071
  const lastItem = resultData[resultData.length - 1];
12919
- if (lastItem && typeof lastItem[idKey] !== "undefined") {
12920
- nextId = Number.parseInt(lastItem[idKey]);
13072
+ const cursorValue = lastItem ? Number.parseInt(lastItem[idKey], 10) : Number.NaN;
13073
+ if (Number.isFinite(cursorValue)) {
13074
+ nextId = cursorValue;
12921
13075
  } else {
13076
+ this._logger.warning(`callList.make: pagination stops here \u2014 no numeric id could be read from the returned items via idKey "${idKey}". Make sure idKey matches the id field in the response; if the sortable field name differs from it, also set cursorIdKey (e.g. idKey: 'id', cursorIdKey: 'ID').`);
12922
13077
  isContinue = false;
12923
13078
  break;
12924
13079
  }
@@ -12941,11 +13096,15 @@ ${JSON.stringify({
12941
13096
  *
12942
13097
  * @param {ActionFetchListV3} options - parameters for executing the request.
12943
13098
  * - `method: string` - The name of the REST API method that returns a list of data (for example: `crm.item.list`, `tasks.task.list`)
12944
- * - `params?: Omit<TypeCallParams, 'pagination'>` - Request parameters, excluding the `pagination` parameter,
13099
+ * - `params?: Omit<TypeCallParams, 'pagination' | 'order'>` - Request parameters, excluding the `pagination` and `order` parameters,
12945
13100
  * since the method is designed to obtain all data in one call.
12946
13101
  * Note: Use `filter`, `order`, and `select` to control the selection.
12947
- * - `idKey?: string` - The name of the field containing the unique identifier of the element.
12948
- * Default is 'id'. Alternatively, it can be another field, depending on the REST API data structure.
13102
+ * - `idKey?: string` - The name of the id field as it appears in each RESPONSE item; its value
13103
+ * drives the cursor. Default is 'id'. Set it to match the id field the method returns.
13104
+ * - `cursorIdKey?: string` - The field name used in the REQUEST for `order` and the
13105
+ * `[field, '>', n]` page filter. Defaults to `idKey`. Set it only when the sortable /
13106
+ * filterable field name differs from the response field name (e.g. an uppercase request
13107
+ * field but a lowercase response id): pass `idKey: 'id', cursorIdKey: 'ID'`.
12949
13108
  * - `customKeyForResult: string` - A custom key indicating that the response REST API will be
12950
13109
  * grouped by this field.
12951
13110
  * Example: `items` to group a list of CRM items.
@@ -12984,15 +13143,16 @@ ${JSON.stringify({
12984
13143
  async *make(options) {
12985
13144
  const batchSize = options?.limit ?? 50;
12986
13145
  const idKey = options?.idKey ?? "id";
13146
+ const cursorIdKey = options?.cursorIdKey ?? idKey;
12987
13147
  const customKeyForResult = options?.customKeyForResult ?? null;
12988
13148
  const params = options?.params ?? {};
12989
13149
  if ("order" in params && params["order"]) {
12990
- this._logger.warning("fetchList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by idKey. Use `filter` to narrow results instead.");
13150
+ this._logger.warning("fetchList.make: user-provided `order` parameter is ignored because cursor-based pagination requires ordering by cursorIdKey. Use `filter` to narrow results instead.");
12991
13151
  }
12992
13152
  const { order: _ignoredOrder, ...restParams } = params;
12993
13153
  const requestParams = {
12994
13154
  ...restParams,
12995
- order: { [idKey]: "ASC" },
13155
+ order: { [cursorIdKey]: "ASC" },
12996
13156
  filter: [...params["filter"] || []],
12997
13157
  pagination: { page: 0, limit: batchSize }
12998
13158
  };
@@ -13000,7 +13160,7 @@ ${JSON.stringify({
13000
13160
  let nextId = 0;
13001
13161
  do {
13002
13162
  const sendParams = { ...requestParams, filter: [...requestParams.filter] };
13003
- sendParams.filter.push([idKey, ">", nextId]);
13163
+ sendParams.filter.push([cursorIdKey, ">", nextId]);
13004
13164
  const response = await this._b24.actions.v3.call.make({
13005
13165
  method: options.method,
13006
13166
  params: sendParams,
@@ -13034,9 +13194,11 @@ ${JSON.stringify({
13034
13194
  break;
13035
13195
  }
13036
13196
  const lastItem = resultData[resultData.length - 1];
13037
- if (lastItem && typeof lastItem[idKey] !== "undefined") {
13038
- nextId = Number.parseInt(lastItem[idKey]);
13197
+ const cursorValue = lastItem ? Number.parseInt(lastItem[idKey], 10) : Number.NaN;
13198
+ if (Number.isFinite(cursorValue)) {
13199
+ nextId = cursorValue;
13039
13200
  } else {
13201
+ this._logger.warning(`fetchList.make: pagination stops here \u2014 no numeric id could be read from the returned items via idKey "${idKey}". Make sure idKey matches the id field in the response; if the sortable field name differs from it, also set cursorIdKey (e.g. idKey: 'id', cursorIdKey: 'ID').`);
13040
13202
  isContinue = false;
13041
13203
  break;
13042
13204
  }
@@ -13094,7 +13256,7 @@ ${JSON.stringify({
13094
13256
  * const resultData = (response as Result<AjaxResult<{ item: TaskItem }>[]>).getData()
13095
13257
  * resultData.forEach((resultRow, index) => {
13096
13258
  * if (resultRow.isSuccess) {
13097
- * console.log(`Item ${index + 1}:`, resultRow.getData().result.item)
13259
+ * console.log(`Item ${index + 1}:`, resultRow.getData()!.result.item)
13098
13260
  * }
13099
13261
  * })
13100
13262
  *
@@ -13133,8 +13295,8 @@ ${JSON.stringify({
13133
13295
  * }
13134
13296
  *
13135
13297
  * const results = response.getData() as Record<string, AjaxResult<{ item: TaskItem } | { items: MainEventLogItem[] }>>
13136
- * console.log('Task:', results.Task.getData().result.item as TaskItem)
13137
- * console.log('MainEventLog:', results.MainEventLog.getData().result.items as MainEventLogItem[])
13298
+ * console.log('Task:', results.Task.getData()?.result.item as TaskItem)
13299
+ * console.log('MainEventLog:', results.MainEventLog.getData()?.result.items as MainEventLogItem[])
13138
13300
  *
13139
13301
  * @warning The maximum number of commands in one batch request is 50.
13140
13302
  * @note A batch request executes faster than sequential single calls,
@@ -13237,11 +13399,11 @@ ${JSON.stringify({
13237
13399
 
13238
13400
  var __defProp$W = Object.defineProperty;
13239
13401
  var __name$W = (target, value) => __defProp$W(target, "name", { value, configurable: true });
13240
- const callName = Symbol("call_V3");
13241
- const callListName = Symbol("callList_V3");
13242
- const fetchListName = Symbol("fetchList_V3");
13243
- const batchName = Symbol("batch_V3");
13244
- const batchByChunkName = Symbol("batchByChunk_V3");
13402
+ const callName = /* @__PURE__ */ Symbol("call_V3");
13403
+ const callListName = /* @__PURE__ */ Symbol("callList_V3");
13404
+ const fetchListName = /* @__PURE__ */ Symbol("fetchList_V3");
13405
+ const batchName = /* @__PURE__ */ Symbol("batch_V3");
13406
+ const batchByChunkName = /* @__PURE__ */ Symbol("batchByChunk_V3");
13245
13407
  class ActionsManagerV3 {
13246
13408
  static {
13247
13409
  __name$W(this, "ActionsManagerV3");
@@ -13426,8 +13588,8 @@ ${JSON.stringify({
13426
13588
 
13427
13589
  var __defProp$R = Object.defineProperty;
13428
13590
  var __name$R = (target, value) => __defProp$R(target, "name", { value, configurable: true });
13429
- const pingName = Symbol("ping");
13430
- const healthCheckName = Symbol("healthCheck");
13591
+ const pingName = /* @__PURE__ */ Symbol("ping");
13592
+ const healthCheckName = /* @__PURE__ */ Symbol("healthCheck");
13431
13593
  class ToolsManager {
13432
13594
  static {
13433
13595
  __name$R(this, "ToolsManager");
@@ -13999,9 +14161,9 @@ ${JSON.stringify({
13999
14161
  * also have a `name` and `type` attribute to specify filename and content type
14000
14162
  *
14001
14163
  * @see https://github.com/facebook/react-native/blob/26684cf3adf4094eb6c405d345a75bf8c7c0bf88/Libraries/Network/FormData.js#L68-L71
14002
- *
14164
+ *
14003
14165
  * @param {*} value The value to test
14004
- *
14166
+ *
14005
14167
  * @returns {boolean} True if value is a React Native Blob, otherwise false
14006
14168
  */
14007
14169
  const isReactNativeBlob = (value) => {
@@ -14011,9 +14173,9 @@ ${JSON.stringify({
14011
14173
  /**
14012
14174
  * Determine if environment is React Native
14013
14175
  * ReactNative `FormData` has a non-standard `getParts()` method
14014
- *
14176
+ *
14015
14177
  * @param {*} formData The formData to test
14016
- *
14178
+ *
14017
14179
  * @returns {boolean} True if environment is React Native, otherwise false
14018
14180
  */
14019
14181
  const isReactNative = (formData) => formData && typeof formData.getParts !== 'undefined';
@@ -14032,7 +14194,7 @@ ${JSON.stringify({
14032
14194
  *
14033
14195
  * @param {*} val The value to test
14034
14196
  *
14035
- * @returns {boolean} True if value is a File, otherwise false
14197
+ * @returns {boolean} True if value is a FileList, otherwise false
14036
14198
  */
14037
14199
  const isFileList = kindOfTest('FileList');
14038
14200
 
@@ -14066,14 +14228,16 @@ ${JSON.stringify({
14066
14228
  const isFormData = (thing) => {
14067
14229
  if (!thing) return false;
14068
14230
  if (FormDataCtor && thing instanceof FormDataCtor) return true;
14069
- // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData (GHSA-6chq-wfr3-2hj9).
14231
+ // Reject plain objects inheriting directly from Object.prototype so prototype-pollution gadgets can't spoof FormData.
14070
14232
  const proto = getPrototypeOf(thing);
14071
14233
  if (!proto || proto === Object.prototype) return false;
14072
14234
  if (!isFunction$1(thing.append)) return false;
14073
14235
  const kind = kindOf(thing);
14074
- return kind === 'formdata' ||
14236
+ return (
14237
+ kind === 'formdata' ||
14075
14238
  // detect form-data instance
14076
- (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]');
14239
+ (kind === 'object' && isFunction$1(thing.toString) && thing.toString() === '[object FormData]')
14240
+ );
14077
14241
  };
14078
14242
 
14079
14243
  /**
@@ -14208,7 +14372,7 @@ ${JSON.stringify({
14208
14372
  *
14209
14373
  * @returns {Object} Result of all merge properties
14210
14374
  */
14211
- function merge(/* obj1, obj2, obj3, ... */) {
14375
+ function merge(...objs) {
14212
14376
  const { caseless, skipUndefined } = (isContextDefined(this) && this) || {};
14213
14377
  const result = {};
14214
14378
  const assignValue = (val, key) => {
@@ -14218,8 +14382,12 @@ ${JSON.stringify({
14218
14382
  }
14219
14383
 
14220
14384
  const targetKey = (caseless && findKey(result, key)) || key;
14221
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
14222
- result[targetKey] = merge(result[targetKey], val);
14385
+ // Read via own-prop only — a bare `result[targetKey]` walks the prototype
14386
+ // chain, so a polluted Object.prototype value could surface here and get
14387
+ // copied into the merged result.
14388
+ const existing = hasOwnProperty(result, targetKey) ? result[targetKey] : undefined;
14389
+ if (isPlainObject(existing) && isPlainObject(val)) {
14390
+ result[targetKey] = merge(existing, val);
14223
14391
  } else if (isPlainObject(val)) {
14224
14392
  result[targetKey] = merge({}, val);
14225
14393
  } else if (isArray$2(val)) {
@@ -14229,8 +14397,8 @@ ${JSON.stringify({
14229
14397
  }
14230
14398
  };
14231
14399
 
14232
- for (let i = 0, l = arguments.length; i < l; i++) {
14233
- arguments[i] && forEach(arguments[i], assignValue);
14400
+ for (let i = 0, l = objs.length; i < l; i++) {
14401
+ objs[i] && forEach(objs[i], assignValue);
14234
14402
  }
14235
14403
  return result;
14236
14404
  }
@@ -14252,6 +14420,9 @@ ${JSON.stringify({
14252
14420
  (val, key) => {
14253
14421
  if (thisArg && isFunction$1(val)) {
14254
14422
  Object.defineProperty(a, key, {
14423
+ // Null-proto descriptor so a polluted Object.prototype.get cannot
14424
+ // hijack defineProperty's accessor-vs-data resolution.
14425
+ __proto__: null,
14255
14426
  value: bind(val, thisArg),
14256
14427
  writable: true,
14257
14428
  enumerable: true,
@@ -14259,6 +14430,7 @@ ${JSON.stringify({
14259
14430
  });
14260
14431
  } else {
14261
14432
  Object.defineProperty(a, key, {
14433
+ __proto__: null,
14262
14434
  value: val,
14263
14435
  writable: true,
14264
14436
  enumerable: true,
@@ -14297,12 +14469,14 @@ ${JSON.stringify({
14297
14469
  const inherits = (constructor, superConstructor, props, descriptors) => {
14298
14470
  constructor.prototype = Object.create(superConstructor.prototype, descriptors);
14299
14471
  Object.defineProperty(constructor.prototype, 'constructor', {
14472
+ __proto__: null,
14300
14473
  value: constructor,
14301
14474
  writable: true,
14302
14475
  enumerable: false,
14303
14476
  configurable: true,
14304
14477
  });
14305
14478
  Object.defineProperty(constructor, 'super', {
14479
+ __proto__: null,
14306
14480
  value: superConstructor.prototype,
14307
14481
  });
14308
14482
  props && Object.assign(constructor.prototype, props);
@@ -14484,7 +14658,7 @@ ${JSON.stringify({
14484
14658
  const freezeMethods = (obj) => {
14485
14659
  reduceDescriptors(obj, (descriptor, name) => {
14486
14660
  // skip restricted props in strict mode
14487
- if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {
14661
+ if (isFunction$1(obj) && ['arguments', 'caller', 'callee'].includes(name)) {
14488
14662
  return false;
14489
14663
  }
14490
14664
 
@@ -14558,11 +14732,11 @@ ${JSON.stringify({
14558
14732
  * @returns {Object} The JSON-compatible object.
14559
14733
  */
14560
14734
  const toJSONObject = (obj) => {
14561
- const stack = new Array(10);
14735
+ const visited = new WeakSet();
14562
14736
 
14563
- const visit = (source, i) => {
14737
+ const visit = (source) => {
14564
14738
  if (isObject(source)) {
14565
- if (stack.indexOf(source) >= 0) {
14739
+ if (visited.has(source)) {
14566
14740
  return;
14567
14741
  }
14568
14742
 
@@ -14572,15 +14746,16 @@ ${JSON.stringify({
14572
14746
  }
14573
14747
 
14574
14748
  if (!('toJSON' in source)) {
14575
- stack[i] = source;
14749
+ // add-on descent / delete-on-ascent: preserves path semantics, so DAG nodes serialise at every occurrence (see #7230).
14750
+ visited.add(source);
14576
14751
  const target = isArray$2(source) ? [] : {};
14577
14752
 
14578
14753
  forEach(source, (value, key) => {
14579
- const reducedValue = visit(value, i + 1);
14754
+ const reducedValue = visit(value);
14580
14755
  !isUndefined(reducedValue) && (target[key] = reducedValue);
14581
14756
  });
14582
14757
 
14583
- stack[i] = undefined;
14758
+ visited.delete(source);
14584
14759
 
14585
14760
  return target;
14586
14761
  }
@@ -14589,7 +14764,7 @@ ${JSON.stringify({
14589
14764
  return source;
14590
14765
  };
14591
14766
 
14592
- return visit(obj, 0);
14767
+ return visit(obj);
14593
14768
  };
14594
14769
 
14595
14770
  /**
@@ -14725,1311 +14900,1422 @@ ${JSON.stringify({
14725
14900
  isIterable,
14726
14901
  };
14727
14902
 
14728
- let AxiosError$1 = class AxiosError extends Error {
14729
- static from(error, code, config, request, response, customProps) {
14730
- const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
14731
- axiosError.cause = error;
14732
- axiosError.name = error.name;
14903
+ // RawAxiosHeaders whose duplicates are ignored by node
14904
+ // c.f. https://nodejs.org/api/http.html#http_message_headers
14905
+ const ignoreDuplicateOf = utils$1.toObjectSet([
14906
+ 'age',
14907
+ 'authorization',
14908
+ 'content-length',
14909
+ 'content-type',
14910
+ 'etag',
14911
+ 'expires',
14912
+ 'from',
14913
+ 'host',
14914
+ 'if-modified-since',
14915
+ 'if-unmodified-since',
14916
+ 'last-modified',
14917
+ 'location',
14918
+ 'max-forwards',
14919
+ 'proxy-authorization',
14920
+ 'referer',
14921
+ 'retry-after',
14922
+ 'user-agent',
14923
+ ]);
14733
14924
 
14734
- // Preserve status from the original error if not already set from response
14735
- if (error.status != null && axiosError.status == null) {
14736
- axiosError.status = error.status;
14737
- }
14925
+ /**
14926
+ * Parse headers into an object
14927
+ *
14928
+ * ```
14929
+ * Date: Wed, 27 Aug 2014 08:58:49 GMT
14930
+ * Content-Type: application/json
14931
+ * Connection: keep-alive
14932
+ * Transfer-Encoding: chunked
14933
+ * ```
14934
+ *
14935
+ * @param {String} rawHeaders Headers needing to be parsed
14936
+ *
14937
+ * @returns {Object} Headers parsed into an object
14938
+ */
14939
+ const parseHeaders = (rawHeaders) => {
14940
+ const parsed = {};
14941
+ let key;
14942
+ let val;
14943
+ let i;
14738
14944
 
14739
- customProps && Object.assign(axiosError, customProps);
14740
- return axiosError;
14741
- }
14945
+ rawHeaders &&
14946
+ rawHeaders.split('\n').forEach(function parser(line) {
14947
+ i = line.indexOf(':');
14948
+ key = line.substring(0, i).trim().toLowerCase();
14949
+ val = line.substring(i + 1).trim();
14742
14950
 
14743
- /**
14744
- * Create an Error with the specified message, config, error code, request and response.
14745
- *
14746
- * @param {string} message The error message.
14747
- * @param {string} [code] The error code (for example, 'ECONNABORTED').
14748
- * @param {Object} [config] The config.
14749
- * @param {Object} [request] The request.
14750
- * @param {Object} [response] The response.
14751
- *
14752
- * @returns {Error} The created error.
14753
- */
14754
- constructor(message, code, config, request, response) {
14755
- super(message);
14951
+ if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
14952
+ return;
14953
+ }
14756
14954
 
14757
- // Make message enumerable to maintain backward compatibility
14758
- // The native Error constructor sets message as non-enumerable,
14759
- // but axios < v1.13.3 had it as enumerable
14760
- Object.defineProperty(this, 'message', {
14761
- value: message,
14762
- enumerable: true,
14763
- writable: true,
14764
- configurable: true,
14955
+ if (key === 'set-cookie') {
14956
+ if (parsed[key]) {
14957
+ parsed[key].push(val);
14958
+ } else {
14959
+ parsed[key] = [val];
14960
+ }
14961
+ } else {
14962
+ parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
14963
+ }
14765
14964
  });
14766
14965
 
14767
- this.name = 'AxiosError';
14768
- this.isAxiosError = true;
14769
- code && (this.code = code);
14770
- config && (this.config = config);
14771
- request && (this.request = request);
14772
- if (response) {
14773
- this.response = response;
14774
- this.status = response.status;
14966
+ return parsed;
14967
+ };
14968
+
14969
+ function trimSPorHTAB(str) {
14970
+ let start = 0;
14971
+ let end = str.length;
14972
+
14973
+ while (start < end) {
14974
+ const code = str.charCodeAt(start);
14975
+
14976
+ if (code !== 0x09 && code !== 0x20) {
14977
+ break;
14775
14978
  }
14776
- }
14777
14979
 
14778
- toJSON() {
14779
- return {
14780
- // Standard
14781
- message: this.message,
14782
- name: this.name,
14783
- // Microsoft
14784
- description: this.description,
14785
- number: this.number,
14786
- // Mozilla
14787
- fileName: this.fileName,
14788
- lineNumber: this.lineNumber,
14789
- columnNumber: this.columnNumber,
14790
- stack: this.stack,
14791
- // Axios
14792
- config: utils$1.toJSONObject(this.config),
14793
- code: this.code,
14794
- status: this.status,
14795
- };
14980
+ start += 1;
14796
14981
  }
14797
- };
14798
14982
 
14799
- // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
14800
- AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
14801
- AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
14802
- AxiosError$1.ECONNABORTED = 'ECONNABORTED';
14803
- AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
14804
- AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
14805
- AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
14806
- AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
14807
- AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
14808
- AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
14809
- AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
14810
- AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
14811
- AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
14812
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
14983
+ while (end > start) {
14984
+ const code = str.charCodeAt(end - 1);
14813
14985
 
14814
- // eslint-disable-next-line strict
14815
- const httpAdapter = null;
14986
+ if (code !== 0x09 && code !== 0x20) {
14987
+ break;
14988
+ }
14816
14989
 
14817
- /**
14818
- * Determines if the given thing is a array or js object.
14819
- *
14820
- * @param {string} thing - The object or array to be visited.
14821
- *
14822
- * @returns {boolean}
14823
- */
14824
- function isVisitable(thing) {
14825
- return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
14826
- }
14990
+ end -= 1;
14991
+ }
14827
14992
 
14828
- /**
14829
- * It removes the brackets from the end of a string
14830
- *
14831
- * @param {string} key - The key of the parameter.
14832
- *
14833
- * @returns {string} the key without the brackets.
14834
- */
14835
- function removeBrackets(key) {
14836
- return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
14993
+ return start === 0 && end === str.length ? str : str.slice(start, end);
14837
14994
  }
14838
14995
 
14839
- /**
14840
- * It takes a path, a key, and a boolean, and returns a string
14841
- *
14842
- * @param {string} path - The path to the current key.
14843
- * @param {string} key - The key of the current object being iterated over.
14844
- * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
14845
- *
14846
- * @returns {string} The path to the current key.
14847
- */
14848
- function renderKey(path, key, dots) {
14849
- if (!path) return key;
14850
- return path
14851
- .concat(key)
14852
- .map(function each(token, i) {
14853
- // eslint-disable-next-line no-param-reassign
14854
- token = removeBrackets(token);
14855
- return !dots && i ? '[' + token + ']' : token;
14856
- })
14857
- .join(dots ? '.' : '');
14858
- }
14996
+ // The control-code ranges are intentional: header sanitization strips C0/DEL bytes.
14997
+ // eslint-disable-next-line no-control-regex
14998
+ const INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp('[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+', 'g');
14999
+ // eslint-disable-next-line no-control-regex
15000
+ const INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp('[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+', 'g');
14859
15001
 
14860
- /**
14861
- * If the array is an array and none of its elements are visitable, then it's a flat array.
14862
- *
14863
- * @param {Array<any>} arr - The array to check
14864
- *
14865
- * @returns {boolean}
14866
- */
14867
- function isFlatArray(arr) {
14868
- return utils$1.isArray(arr) && !arr.some(isVisitable);
15002
+ function sanitizeValue(value, invalidChars) {
15003
+ if (utils$1.isArray(value)) {
15004
+ return value.map((item) => sanitizeValue(item, invalidChars));
15005
+ }
15006
+
15007
+ return trimSPorHTAB(String(value).replace(invalidChars, ''));
14869
15008
  }
14870
15009
 
14871
- const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
14872
- return /^is[A-Z]/.test(prop);
14873
- });
15010
+ const sanitizeHeaderValue = (value) =>
15011
+ sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
14874
15012
 
14875
- /**
14876
- * Convert a data object to FormData
14877
- *
14878
- * @param {Object} obj
14879
- * @param {?Object} [formData]
14880
- * @param {?Object} [options]
14881
- * @param {Function} [options.visitor]
14882
- * @param {Boolean} [options.metaTokens = true]
14883
- * @param {Boolean} [options.dots = false]
14884
- * @param {?Boolean} [options.indexes = false]
14885
- *
14886
- * @returns {Object}
14887
- **/
15013
+ const sanitizeByteStringHeaderValue = (value) =>
15014
+ sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
14888
15015
 
14889
- /**
14890
- * It converts an object into a FormData object
14891
- *
14892
- * @param {Object<any, any>} obj - The object to convert to form data.
14893
- * @param {string} formData - The FormData object to append to.
14894
- * @param {Object<string, any>} options
14895
- *
14896
- * @returns
14897
- */
14898
- function toFormData$1(obj, formData, options) {
14899
- if (!utils$1.isObject(obj)) {
14900
- throw new TypeError('target must be an object');
14901
- }
15016
+ function toByteStringHeaderObject(headers) {
15017
+ const byteStringHeaders = Object.create(null);
14902
15018
 
14903
- // eslint-disable-next-line no-param-reassign
14904
- formData = formData || new (FormData)();
15019
+ utils$1.forEach(headers.toJSON(), (value, header) => {
15020
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
15021
+ });
14905
15022
 
14906
- // eslint-disable-next-line no-param-reassign
14907
- options = utils$1.toFlatObject(
14908
- options,
14909
- {
14910
- metaTokens: true,
14911
- dots: false,
14912
- indexes: false,
14913
- },
14914
- false,
14915
- function defined(option, source) {
14916
- // eslint-disable-next-line no-eq-null,eqeqeq
14917
- return !utils$1.isUndefined(source[option]);
14918
- }
14919
- );
15023
+ return byteStringHeaders;
15024
+ }
14920
15025
 
14921
- const metaTokens = options.metaTokens;
14922
- // eslint-disable-next-line no-use-before-define
14923
- const visitor = options.visitor || defaultVisitor;
14924
- const dots = options.dots;
14925
- const indexes = options.indexes;
14926
- const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
14927
- const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
14928
- const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
15026
+ const $internals = Symbol('internals');
14929
15027
 
14930
- if (!utils$1.isFunction(visitor)) {
14931
- throw new TypeError('visitor must be a function');
15028
+ function normalizeHeader(header) {
15029
+ return header && String(header).trim().toLowerCase();
15030
+ }
15031
+
15032
+ function normalizeValue(value) {
15033
+ if (value === false || value == null) {
15034
+ return value;
14932
15035
  }
14933
15036
 
14934
- function convertValue(value) {
14935
- if (value === null) return '';
15037
+ return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
15038
+ }
14936
15039
 
14937
- if (utils$1.isDate(value)) {
14938
- return value.toISOString();
14939
- }
15040
+ function parseTokens(str) {
15041
+ const tokens = Object.create(null);
15042
+ const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
15043
+ let match;
14940
15044
 
14941
- if (utils$1.isBoolean(value)) {
14942
- return value.toString();
14943
- }
15045
+ while ((match = tokensRE.exec(str))) {
15046
+ tokens[match[1]] = match[2];
15047
+ }
14944
15048
 
14945
- if (!useBlob && utils$1.isBlob(value)) {
14946
- throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
14947
- }
15049
+ return tokens;
15050
+ }
14948
15051
 
14949
- if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
14950
- return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
14951
- }
15052
+ const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
14952
15053
 
14953
- return value;
15054
+ function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
15055
+ if (utils$1.isFunction(filter)) {
15056
+ return filter.call(this, value, header);
14954
15057
  }
14955
15058
 
14956
- /**
14957
- * Default visitor.
14958
- *
14959
- * @param {*} value
14960
- * @param {String|Number} key
14961
- * @param {Array<String|Number>} path
14962
- * @this {FormData}
14963
- *
14964
- * @returns {boolean} return true to visit the each prop of the value recursively
14965
- */
14966
- function defaultVisitor(value, key, path) {
14967
- let arr = value;
15059
+ if (isHeaderNameFilter) {
15060
+ value = header;
15061
+ }
14968
15062
 
14969
- if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
14970
- formData.append(renderKey(path, key, dots), convertValue(value));
14971
- return false;
14972
- }
15063
+ if (!utils$1.isString(value)) return;
14973
15064
 
14974
- if (value && !path && typeof value === 'object') {
14975
- if (utils$1.endsWith(key, '{}')) {
14976
- // eslint-disable-next-line no-param-reassign
14977
- key = metaTokens ? key : key.slice(0, -2);
14978
- // eslint-disable-next-line no-param-reassign
14979
- value = JSON.stringify(value);
14980
- } else if (
14981
- (utils$1.isArray(value) && isFlatArray(value)) ||
14982
- ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
14983
- ) {
14984
- // eslint-disable-next-line no-param-reassign
14985
- key = removeBrackets(key);
15065
+ if (utils$1.isString(filter)) {
15066
+ return value.indexOf(filter) !== -1;
15067
+ }
14986
15068
 
14987
- arr.forEach(function each(el, index) {
14988
- !(utils$1.isUndefined(el) || el === null) &&
14989
- formData.append(
14990
- // eslint-disable-next-line no-nested-ternary
14991
- indexes === true
14992
- ? renderKey([key], index, dots)
14993
- : indexes === null
14994
- ? key
14995
- : key + '[]',
14996
- convertValue(el)
14997
- );
14998
- });
14999
- return false;
15000
- }
15001
- }
15069
+ if (utils$1.isRegExp(filter)) {
15070
+ return filter.test(value);
15071
+ }
15072
+ }
15002
15073
 
15003
- if (isVisitable(value)) {
15004
- return true;
15005
- }
15074
+ function formatHeader(header) {
15075
+ return header
15076
+ .trim()
15077
+ .toLowerCase()
15078
+ .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
15079
+ return char.toUpperCase() + str;
15080
+ });
15081
+ }
15006
15082
 
15007
- formData.append(renderKey(path, key, dots), convertValue(value));
15083
+ function buildAccessors(obj, header) {
15084
+ const accessorName = utils$1.toCamelCase(' ' + header);
15008
15085
 
15009
- return false;
15086
+ ['get', 'set', 'has'].forEach((methodName) => {
15087
+ Object.defineProperty(obj, methodName + accessorName, {
15088
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
15089
+ // this data descriptor into an accessor descriptor on the way in.
15090
+ __proto__: null,
15091
+ value: function (arg1, arg2, arg3) {
15092
+ return this[methodName].call(this, header, arg1, arg2, arg3);
15093
+ },
15094
+ configurable: true,
15095
+ });
15096
+ });
15097
+ }
15098
+
15099
+ let AxiosHeaders$1 = class AxiosHeaders {
15100
+ constructor(headers) {
15101
+ headers && this.set(headers);
15010
15102
  }
15011
15103
 
15012
- const stack = [];
15104
+ set(header, valueOrRewrite, rewrite) {
15105
+ const self = this;
15013
15106
 
15014
- const exposedHelpers = Object.assign(predicates, {
15015
- defaultVisitor,
15016
- convertValue,
15017
- isVisitable,
15018
- });
15107
+ function setHeader(_value, _header, _rewrite) {
15108
+ const lHeader = normalizeHeader(_header);
15019
15109
 
15020
- function build(value, path, depth = 0) {
15021
- if (utils$1.isUndefined(value)) return;
15110
+ if (!lHeader) {
15111
+ throw new Error('header name must be a non-empty string');
15112
+ }
15022
15113
 
15023
- if (depth > maxDepth) {
15024
- throw new AxiosError$1(
15025
- 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
15026
- AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
15027
- );
15028
- }
15114
+ const key = utils$1.findKey(self, lHeader);
15029
15115
 
15030
- if (stack.indexOf(value) !== -1) {
15031
- throw Error('Circular reference detected in ' + path.join('.'));
15116
+ if (
15117
+ !key ||
15118
+ self[key] === undefined ||
15119
+ _rewrite === true ||
15120
+ (_rewrite === undefined && self[key] !== false)
15121
+ ) {
15122
+ self[key || _header] = normalizeValue(_value);
15123
+ }
15032
15124
  }
15033
15125
 
15034
- stack.push(value);
15126
+ const setHeaders = (headers, _rewrite) =>
15127
+ utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15035
15128
 
15036
- utils$1.forEach(value, function each(el, key) {
15037
- const result =
15038
- !(utils$1.isUndefined(el) || el === null) &&
15039
- visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
15129
+ if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
15130
+ setHeaders(header, valueOrRewrite);
15131
+ } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
15132
+ setHeaders(parseHeaders(header), valueOrRewrite);
15133
+ } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
15134
+ let obj = {},
15135
+ dest,
15136
+ key;
15137
+ for (const entry of header) {
15138
+ if (!utils$1.isArray(entry)) {
15139
+ throw TypeError('Object iterator must return a key-value pair');
15140
+ }
15040
15141
 
15041
- if (result === true) {
15042
- build(el, path ? path.concat(key) : [key], depth + 1);
15142
+ obj[(key = entry[0])] = (dest = obj[key])
15143
+ ? utils$1.isArray(dest)
15144
+ ? [...dest, entry[1]]
15145
+ : [dest, entry[1]]
15146
+ : entry[1];
15043
15147
  }
15044
- });
15045
15148
 
15046
- stack.pop();
15047
- }
15149
+ setHeaders(obj, valueOrRewrite);
15150
+ } else {
15151
+ header != null && setHeader(valueOrRewrite, header, rewrite);
15152
+ }
15048
15153
 
15049
- if (!utils$1.isObject(obj)) {
15050
- throw new TypeError('data must be an object');
15154
+ return this;
15051
15155
  }
15052
15156
 
15053
- build(obj);
15157
+ get(header, parser) {
15158
+ header = normalizeHeader(header);
15054
15159
 
15055
- return formData;
15056
- }
15160
+ if (header) {
15161
+ const key = utils$1.findKey(this, header);
15057
15162
 
15058
- /**
15059
- * It encodes a string by replacing all characters that are not in the unreserved set with
15060
- * their percent-encoded equivalents
15061
- *
15062
- * @param {string} str - The string to encode.
15063
- *
15064
- * @returns {string} The encoded string.
15065
- */
15066
- function encode$2(str) {
15067
- const charMap = {
15068
- '!': '%21',
15069
- "'": '%27',
15070
- '(': '%28',
15071
- ')': '%29',
15072
- '~': '%7E',
15073
- '%20': '+',
15074
- };
15075
- return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
15076
- return charMap[match];
15077
- });
15078
- }
15163
+ if (key) {
15164
+ const value = this[key];
15079
15165
 
15080
- /**
15081
- * It takes a params object and converts it to a FormData object
15082
- *
15083
- * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
15084
- * @param {Object<string, any>} options - The options object passed to the Axios constructor.
15085
- *
15086
- * @returns {void}
15087
- */
15088
- function AxiosURLSearchParams(params, options) {
15089
- this._pairs = [];
15166
+ if (!parser) {
15167
+ return value;
15168
+ }
15090
15169
 
15091
- params && toFormData$1(params, this, options);
15092
- }
15170
+ if (parser === true) {
15171
+ return parseTokens(value);
15172
+ }
15093
15173
 
15094
- const prototype = AxiosURLSearchParams.prototype;
15174
+ if (utils$1.isFunction(parser)) {
15175
+ return parser.call(this, value, key);
15176
+ }
15095
15177
 
15096
- prototype.append = function append(name, value) {
15097
- this._pairs.push([name, value]);
15098
- };
15178
+ if (utils$1.isRegExp(parser)) {
15179
+ return parser.exec(value);
15180
+ }
15099
15181
 
15100
- prototype.toString = function toString(encoder) {
15101
- const _encode = encoder
15102
- ? function (value) {
15103
- return encoder.call(this, value, encode$2);
15182
+ throw new TypeError('parser must be boolean|regexp|function');
15104
15183
  }
15105
- : encode$2;
15184
+ }
15185
+ }
15106
15186
 
15107
- return this._pairs
15108
- .map(function each(pair) {
15109
- return _encode(pair[0]) + '=' + _encode(pair[1]);
15110
- }, '')
15111
- .join('&');
15112
- };
15187
+ has(header, matcher) {
15188
+ header = normalizeHeader(header);
15113
15189
 
15114
- /**
15115
- * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
15116
- * their plain counterparts (`:`, `$`, `,`, `+`).
15117
- *
15118
- * @param {string} val The value to be encoded.
15119
- *
15120
- * @returns {string} The encoded value.
15121
- */
15122
- function encode$1(val) {
15123
- return encodeURIComponent(val)
15124
- .replace(/%3A/gi, ':')
15125
- .replace(/%24/g, '$')
15126
- .replace(/%2C/gi, ',')
15127
- .replace(/%20/g, '+');
15128
- }
15190
+ if (header) {
15191
+ const key = utils$1.findKey(this, header);
15129
15192
 
15130
- /**
15131
- * Build a URL by appending params to the end
15132
- *
15133
- * @param {string} url The base of the url (e.g., http://www.google.com)
15134
- * @param {object} [params] The params to be appended
15135
- * @param {?(object|Function)} options
15136
- *
15137
- * @returns {string} The formatted url
15138
- */
15139
- function buildURL(url, params, options) {
15140
- if (!params) {
15141
- return url;
15193
+ return !!(
15194
+ key &&
15195
+ this[key] !== undefined &&
15196
+ (!matcher || matchHeaderValue(this, this[key], key, matcher))
15197
+ );
15198
+ }
15199
+
15200
+ return false;
15142
15201
  }
15143
15202
 
15144
- const _encode = (options && options.encode) || encode$1;
15203
+ delete(header, matcher) {
15204
+ const self = this;
15205
+ let deleted = false;
15145
15206
 
15146
- const _options = utils$1.isFunction(options)
15147
- ? {
15148
- serialize: options,
15149
- }
15150
- : options;
15207
+ function deleteHeader(_header) {
15208
+ _header = normalizeHeader(_header);
15151
15209
 
15152
- const serializeFn = _options && _options.serialize;
15210
+ if (_header) {
15211
+ const key = utils$1.findKey(self, _header);
15153
15212
 
15154
- let serializedParams;
15213
+ if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
15214
+ delete self[key];
15155
15215
 
15156
- if (serializeFn) {
15157
- serializedParams = serializeFn(params, _options);
15158
- } else {
15159
- serializedParams = utils$1.isURLSearchParams(params)
15160
- ? params.toString()
15161
- : new AxiosURLSearchParams(params, _options).toString(_encode);
15216
+ deleted = true;
15217
+ }
15218
+ }
15219
+ }
15220
+
15221
+ if (utils$1.isArray(header)) {
15222
+ header.forEach(deleteHeader);
15223
+ } else {
15224
+ deleteHeader(header);
15225
+ }
15226
+
15227
+ return deleted;
15162
15228
  }
15163
15229
 
15164
- if (serializedParams) {
15165
- const hashmarkIndex = url.indexOf('#');
15230
+ clear(matcher) {
15231
+ const keys = Object.keys(this);
15232
+ let i = keys.length;
15233
+ let deleted = false;
15166
15234
 
15167
- if (hashmarkIndex !== -1) {
15168
- url = url.slice(0, hashmarkIndex);
15235
+ while (i--) {
15236
+ const key = keys[i];
15237
+ if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
15238
+ delete this[key];
15239
+ deleted = true;
15240
+ }
15169
15241
  }
15170
- url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
15242
+
15243
+ return deleted;
15171
15244
  }
15172
15245
 
15173
- return url;
15174
- }
15246
+ normalize(format) {
15247
+ const self = this;
15248
+ const headers = {};
15175
15249
 
15176
- class InterceptorManager {
15177
- constructor() {
15178
- this.handlers = [];
15179
- }
15250
+ utils$1.forEach(this, (value, header) => {
15251
+ const key = utils$1.findKey(headers, header);
15180
15252
 
15181
- /**
15182
- * Add a new interceptor to the stack
15183
- *
15184
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
15185
- * @param {Function} rejected The function to handle `reject` for a `Promise`
15186
- * @param {Object} options The options for the interceptor, synchronous and runWhen
15187
- *
15188
- * @return {Number} An ID used to remove interceptor later
15189
- */
15190
- use(fulfilled, rejected, options) {
15191
- this.handlers.push({
15192
- fulfilled,
15193
- rejected,
15194
- synchronous: options ? options.synchronous : false,
15195
- runWhen: options ? options.runWhen : null,
15253
+ if (key) {
15254
+ self[key] = normalizeValue(value);
15255
+ delete self[header];
15256
+ return;
15257
+ }
15258
+
15259
+ const normalized = format ? formatHeader(header) : String(header).trim();
15260
+
15261
+ if (normalized !== header) {
15262
+ delete self[header];
15263
+ }
15264
+
15265
+ self[normalized] = normalizeValue(value);
15266
+
15267
+ headers[normalized] = true;
15196
15268
  });
15197
- return this.handlers.length - 1;
15198
- }
15199
15269
 
15200
- /**
15201
- * Remove an interceptor from the stack
15202
- *
15203
- * @param {Number} id The ID that was returned by `use`
15204
- *
15205
- * @returns {void}
15206
- */
15207
- eject(id) {
15208
- if (this.handlers[id]) {
15209
- this.handlers[id] = null;
15210
- }
15270
+ return this;
15211
15271
  }
15212
15272
 
15213
- /**
15214
- * Clear all interceptors from the stack
15215
- *
15216
- * @returns {void}
15217
- */
15218
- clear() {
15219
- if (this.handlers) {
15220
- this.handlers = [];
15221
- }
15273
+ concat(...targets) {
15274
+ return this.constructor.concat(this, ...targets);
15222
15275
  }
15223
15276
 
15224
- /**
15225
- * Iterate over all the registered interceptors
15226
- *
15227
- * This method is particularly useful for skipping over any
15228
- * interceptors that may have become `null` calling `eject`.
15229
- *
15230
- * @param {Function} fn The function to call for each interceptor
15231
- *
15232
- * @returns {void}
15233
- */
15234
- forEach(fn) {
15235
- utils$1.forEach(this.handlers, function forEachHandler(h) {
15236
- if (h !== null) {
15237
- fn(h);
15238
- }
15277
+ toJSON(asStrings) {
15278
+ const obj = Object.create(null);
15279
+
15280
+ utils$1.forEach(this, (value, header) => {
15281
+ value != null &&
15282
+ value !== false &&
15283
+ (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
15239
15284
  });
15240
- }
15241
- }
15242
15285
 
15243
- const transitionalDefaults = {
15244
- silentJSONParsing: true,
15245
- forcedJSONParsing: true,
15246
- clarifyTimeoutError: false,
15247
- legacyInterceptorReqResOrdering: true,
15248
- };
15286
+ return obj;
15287
+ }
15249
15288
 
15250
- const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
15289
+ [Symbol.iterator]() {
15290
+ return Object.entries(this.toJSON())[Symbol.iterator]();
15291
+ }
15251
15292
 
15252
- const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
15293
+ toString() {
15294
+ return Object.entries(this.toJSON())
15295
+ .map(([header, value]) => header + ': ' + value)
15296
+ .join('\n');
15297
+ }
15253
15298
 
15254
- const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15299
+ getSetCookie() {
15300
+ return this.get('set-cookie') || [];
15301
+ }
15255
15302
 
15256
- const platform$1 = {
15257
- isBrowser: true,
15258
- classes: {
15259
- URLSearchParams: URLSearchParams$1,
15260
- FormData: FormData$1,
15261
- Blob: Blob$1,
15262
- },
15263
- protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
15264
- };
15303
+ get [Symbol.toStringTag]() {
15304
+ return 'AxiosHeaders';
15305
+ }
15265
15306
 
15266
- const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
15307
+ static from(thing) {
15308
+ return thing instanceof this ? thing : new this(thing);
15309
+ }
15267
15310
 
15268
- const _navigator = (typeof navigator === 'object' && navigator) || undefined;
15311
+ static concat(first, ...targets) {
15312
+ const computed = new this(first);
15269
15313
 
15270
- /**
15271
- * Determine if we're running in a standard browser environment
15272
- *
15273
- * This allows axios to run in a web worker, and react-native.
15274
- * Both environments support XMLHttpRequest, but not fully standard globals.
15275
- *
15276
- * web workers:
15277
- * typeof window -> undefined
15278
- * typeof document -> undefined
15279
- *
15280
- * react-native:
15281
- * navigator.product -> 'ReactNative'
15282
- * nativescript
15283
- * navigator.product -> 'NativeScript' or 'NS'
15284
- *
15285
- * @returns {boolean}
15286
- */
15287
- const hasStandardBrowserEnv =
15288
- hasBrowserEnv &&
15289
- (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
15314
+ targets.forEach((target) => computed.set(target));
15290
15315
 
15291
- /**
15292
- * Determine if we're running in a standard browser webWorker environment
15293
- *
15294
- * Although the `isStandardBrowserEnv` method indicates that
15295
- * `allows axios to run in a web worker`, the WebWorker will still be
15296
- * filtered out due to its judgment standard
15297
- * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
15298
- * This leads to a problem when axios post `FormData` in webWorker
15299
- */
15300
- const hasStandardBrowserWebWorkerEnv = (() => {
15301
- return (
15302
- typeof WorkerGlobalScope !== 'undefined' &&
15303
- // eslint-disable-next-line no-undef
15304
- self instanceof WorkerGlobalScope &&
15305
- typeof self.importScripts === 'function'
15306
- );
15307
- })();
15316
+ return computed;
15317
+ }
15308
15318
 
15309
- const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
15319
+ static accessor(header) {
15320
+ const internals =
15321
+ (this[$internals] =
15322
+ this[$internals] =
15323
+ {
15324
+ accessors: {},
15325
+ });
15310
15326
 
15311
- const utils = {
15312
- __proto__: null,
15313
- hasBrowserEnv: hasBrowserEnv,
15314
- hasStandardBrowserEnv: hasStandardBrowserEnv,
15315
- hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
15316
- navigator: _navigator,
15317
- origin: origin
15318
- };
15327
+ const accessors = internals.accessors;
15328
+ const prototype = this.prototype;
15319
15329
 
15320
- const platform = {
15321
- ...utils,
15322
- ...platform$1,
15323
- };
15330
+ function defineAccessor(_header) {
15331
+ const lHeader = normalizeHeader(_header);
15324
15332
 
15325
- function toURLEncodedForm(data, options) {
15326
- return toFormData$1(data, new platform.classes.URLSearchParams(), {
15327
- visitor: function (value, key, path, helpers) {
15328
- if (platform.isNode && utils$1.isBuffer(value)) {
15329
- this.append(key, value.toString('base64'));
15330
- return false;
15333
+ if (!accessors[lHeader]) {
15334
+ buildAccessors(prototype, _header);
15335
+ accessors[lHeader] = true;
15331
15336
  }
15337
+ }
15332
15338
 
15333
- return helpers.defaultVisitor.apply(this, arguments);
15334
- },
15335
- ...options,
15336
- });
15337
- }
15338
-
15339
- /**
15340
- * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
15341
- *
15342
- * @param {string} name - The name of the property to get.
15343
- *
15344
- * @returns An array of strings.
15345
- */
15346
- function parsePropPath(name) {
15347
- // foo[x][y][z]
15348
- // foo.x.y.z
15349
- // foo-x-y-z
15350
- // foo x y z
15351
- return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
15352
- return match[0] === '[]' ? '' : match[1] || match[0];
15353
- });
15354
- }
15339
+ utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
15355
15340
 
15356
- /**
15357
- * Convert an array to an object.
15358
- *
15359
- * @param {Array<any>} arr - The array to convert to an object.
15360
- *
15361
- * @returns An object with the same keys and values as the array.
15362
- */
15363
- function arrayToObject(arr) {
15364
- const obj = {};
15365
- const keys = Object.keys(arr);
15366
- let i;
15367
- const len = keys.length;
15368
- let key;
15369
- for (i = 0; i < len; i++) {
15370
- key = keys[i];
15371
- obj[key] = arr[key];
15341
+ return this;
15372
15342
  }
15373
- return obj;
15374
- }
15375
-
15376
- /**
15377
- * It takes a FormData object and returns a JavaScript object
15378
- *
15379
- * @param {string} formData The FormData object to convert to JSON.
15380
- *
15381
- * @returns {Object<string, any> | null} The converted object.
15382
- */
15383
- function formDataToJSON(formData) {
15384
- function buildPath(path, value, target, index) {
15385
- let name = path[index++];
15343
+ };
15386
15344
 
15387
- if (name === '__proto__') return true;
15345
+ AxiosHeaders$1.accessor([
15346
+ 'Content-Type',
15347
+ 'Content-Length',
15348
+ 'Accept',
15349
+ 'Accept-Encoding',
15350
+ 'User-Agent',
15351
+ 'Authorization',
15352
+ ]);
15388
15353
 
15389
- const isNumericKey = Number.isFinite(+name);
15390
- const isLast = index >= path.length;
15391
- name = !name && utils$1.isArray(target) ? target.length : name;
15354
+ // reserved names hotfix
15355
+ utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
15356
+ let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
15357
+ return {
15358
+ get: () => value,
15359
+ set(headerValue) {
15360
+ this[mapped] = headerValue;
15361
+ },
15362
+ };
15363
+ });
15392
15364
 
15393
- if (isLast) {
15394
- if (utils$1.hasOwnProp(target, name)) {
15395
- target[name] = utils$1.isArray(target[name])
15396
- ? target[name].concat(value)
15397
- : [target[name], value];
15398
- } else {
15399
- target[name] = value;
15400
- }
15365
+ utils$1.freezeMethods(AxiosHeaders$1);
15401
15366
 
15402
- return !isNumericKey;
15403
- }
15367
+ const REDACTED = '[REDACTED ****]';
15404
15368
 
15405
- if (!target[name] || !utils$1.isObject(target[name])) {
15406
- target[name] = [];
15407
- }
15369
+ function hasOwnOrPrototypeToJSON(source) {
15370
+ if (utils$1.hasOwnProp(source, 'toJSON')) {
15371
+ return true;
15372
+ }
15408
15373
 
15409
- const result = buildPath(path, value, target[name], index);
15374
+ let prototype = Object.getPrototypeOf(source);
15410
15375
 
15411
- if (result && utils$1.isArray(target[name])) {
15412
- target[name] = arrayToObject(target[name]);
15376
+ while (prototype && prototype !== Object.prototype) {
15377
+ if (utils$1.hasOwnProp(prototype, 'toJSON')) {
15378
+ return true;
15413
15379
  }
15414
15380
 
15415
- return !isNumericKey;
15381
+ prototype = Object.getPrototypeOf(prototype);
15416
15382
  }
15417
15383
 
15418
- if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
15419
- const obj = {};
15384
+ return false;
15385
+ }
15420
15386
 
15421
- utils$1.forEachEntry(formData, (name, value) => {
15422
- buildPath(parsePropPath(name), value, obj, 0);
15423
- });
15387
+ // Build a plain-object snapshot of `config` and replace the value of any key
15388
+ // (case-insensitive) listed in `redactKeys` with REDACTED. Walks through arrays
15389
+ // and AxiosHeaders, and short-circuits on circular references.
15390
+ function redactConfig(config, redactKeys) {
15391
+ const lowerKeys = new Set(redactKeys.map((k) => String(k).toLowerCase()));
15392
+ const seen = [];
15424
15393
 
15425
- return obj;
15426
- }
15394
+ const visit = (source) => {
15395
+ if (source === null || typeof source !== 'object') return source;
15396
+ if (utils$1.isBuffer(source)) return source;
15397
+ if (seen.indexOf(source) !== -1) return undefined;
15427
15398
 
15428
- return null;
15429
- }
15399
+ if (source instanceof AxiosHeaders$1) {
15400
+ source = source.toJSON();
15401
+ }
15430
15402
 
15431
- const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
15403
+ seen.push(source);
15432
15404
 
15433
- /**
15434
- * It takes a string, tries to parse it, and if it fails, it returns the stringified version
15435
- * of the input
15436
- *
15437
- * @param {any} rawValue - The value to be stringified.
15438
- * @param {Function} parser - A function that parses a string into a JavaScript object.
15439
- * @param {Function} encoder - A function that takes a value and returns a string.
15440
- *
15441
- * @returns {string} A stringified version of the rawValue.
15442
- */
15443
- function stringifySafely(rawValue, parser, encoder) {
15444
- if (utils$1.isString(rawValue)) {
15445
- try {
15446
- (parser || JSON.parse)(rawValue);
15447
- return utils$1.trim(rawValue);
15448
- } catch (e) {
15449
- if (e.name !== 'SyntaxError') {
15450
- throw e;
15405
+ let result;
15406
+ if (utils$1.isArray(source)) {
15407
+ result = [];
15408
+ source.forEach((v, i) => {
15409
+ const reducedValue = visit(v);
15410
+ if (!utils$1.isUndefined(reducedValue)) {
15411
+ result[i] = reducedValue;
15412
+ }
15413
+ });
15414
+ } else {
15415
+ if (!utils$1.isPlainObject(source) && hasOwnOrPrototypeToJSON(source)) {
15416
+ seen.pop();
15417
+ return source;
15418
+ }
15419
+
15420
+ result = Object.create(null);
15421
+ for (const [key, value] of Object.entries(source)) {
15422
+ const reducedValue = lowerKeys.has(key.toLowerCase()) ? REDACTED : visit(value);
15423
+ if (!utils$1.isUndefined(reducedValue)) {
15424
+ result[key] = reducedValue;
15425
+ }
15451
15426
  }
15452
15427
  }
15453
- }
15454
15428
 
15455
- return (encoder || JSON.stringify)(rawValue);
15456
- }
15429
+ seen.pop();
15430
+ return result;
15431
+ };
15457
15432
 
15458
- const defaults$1 = {
15459
- transitional: transitionalDefaults,
15433
+ return visit(config);
15434
+ }
15460
15435
 
15461
- adapter: ['xhr', 'http', 'fetch'],
15436
+ let AxiosError$1 = class AxiosError extends Error {
15437
+ static from(error, code, config, request, response, customProps) {
15438
+ const axiosError = new AxiosError(error.message, code || error.code, config, request, response);
15439
+ axiosError.cause = error;
15440
+ axiosError.name = error.name;
15462
15441
 
15463
- transformRequest: [
15464
- function transformRequest(data, headers) {
15465
- const contentType = headers.getContentType() || '';
15466
- const hasJSONContentType = contentType.indexOf('application/json') > -1;
15467
- const isObjectPayload = utils$1.isObject(data);
15442
+ // Preserve status from the original error if not already set from response
15443
+ if (error.status != null && axiosError.status == null) {
15444
+ axiosError.status = error.status;
15445
+ }
15468
15446
 
15469
- if (isObjectPayload && utils$1.isHTMLForm(data)) {
15470
- data = new FormData(data);
15471
- }
15447
+ customProps && Object.assign(axiosError, customProps);
15448
+ return axiosError;
15449
+ }
15472
15450
 
15473
- const isFormData = utils$1.isFormData(data);
15451
+ /**
15452
+ * Create an Error with the specified message, config, error code, request and response.
15453
+ *
15454
+ * @param {string} message The error message.
15455
+ * @param {string} [code] The error code (for example, 'ECONNABORTED').
15456
+ * @param {Object} [config] The config.
15457
+ * @param {Object} [request] The request.
15458
+ * @param {Object} [response] The response.
15459
+ *
15460
+ * @returns {Error} The created error.
15461
+ */
15462
+ constructor(message, code, config, request, response) {
15463
+ super(message);
15474
15464
 
15475
- if (isFormData) {
15476
- return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
15477
- }
15465
+ // Make message enumerable to maintain backward compatibility
15466
+ // The native Error constructor sets message as non-enumerable,
15467
+ // but axios < v1.13.3 had it as enumerable
15468
+ Object.defineProperty(this, 'message', {
15469
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
15470
+ // this data descriptor into an accessor descriptor on the way in.
15471
+ __proto__: null,
15472
+ value: message,
15473
+ enumerable: true,
15474
+ writable: true,
15475
+ configurable: true,
15476
+ });
15478
15477
 
15479
- if (
15480
- utils$1.isArrayBuffer(data) ||
15481
- utils$1.isBuffer(data) ||
15482
- utils$1.isStream(data) ||
15483
- utils$1.isFile(data) ||
15484
- utils$1.isBlob(data) ||
15485
- utils$1.isReadableStream(data)
15486
- ) {
15487
- return data;
15488
- }
15489
- if (utils$1.isArrayBufferView(data)) {
15490
- return data.buffer;
15491
- }
15492
- if (utils$1.isURLSearchParams(data)) {
15493
- headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
15494
- return data.toString();
15495
- }
15478
+ this.name = 'AxiosError';
15479
+ this.isAxiosError = true;
15480
+ code && (this.code = code);
15481
+ config && (this.config = config);
15482
+ request && (this.request = request);
15483
+ if (response) {
15484
+ this.response = response;
15485
+ this.status = response.status;
15486
+ }
15487
+ }
15496
15488
 
15497
- let isFileList;
15489
+ toJSON() {
15490
+ // Opt-in redaction: when the request config carries a `redact` array, the
15491
+ // value of any matching key (case-insensitive, at any depth) is replaced
15492
+ // with REDACTED in the serialized snapshot. Undefined or empty leaves the
15493
+ // existing serialization behavior unchanged.
15494
+ const config = this.config;
15495
+ const redactKeys = config && utils$1.hasOwnProp(config, 'redact') ? config.redact : undefined;
15496
+ const serializedConfig =
15497
+ utils$1.isArray(redactKeys) && redactKeys.length > 0
15498
+ ? redactConfig(config, redactKeys)
15499
+ : utils$1.toJSONObject(config);
15498
15500
 
15499
- if (isObjectPayload) {
15500
- const formSerializer = own(this, 'formSerializer');
15501
- if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
15502
- return toURLEncodedForm(data, formSerializer).toString();
15503
- }
15501
+ return {
15502
+ // Standard
15503
+ message: this.message,
15504
+ name: this.name,
15505
+ // Microsoft
15506
+ description: this.description,
15507
+ number: this.number,
15508
+ // Mozilla
15509
+ fileName: this.fileName,
15510
+ lineNumber: this.lineNumber,
15511
+ columnNumber: this.columnNumber,
15512
+ stack: this.stack,
15513
+ // Axios
15514
+ config: serializedConfig,
15515
+ code: this.code,
15516
+ status: this.status,
15517
+ };
15518
+ }
15519
+ };
15504
15520
 
15505
- if (
15506
- (isFileList = utils$1.isFileList(data)) ||
15507
- contentType.indexOf('multipart/form-data') > -1
15508
- ) {
15509
- const env = own(this, 'env');
15510
- const _FormData = env && env.FormData;
15521
+ // This can be changed to static properties as soon as the parser options in .eslint.cjs are updated.
15522
+ AxiosError$1.ERR_BAD_OPTION_VALUE = 'ERR_BAD_OPTION_VALUE';
15523
+ AxiosError$1.ERR_BAD_OPTION = 'ERR_BAD_OPTION';
15524
+ AxiosError$1.ECONNABORTED = 'ECONNABORTED';
15525
+ AxiosError$1.ETIMEDOUT = 'ETIMEDOUT';
15526
+ AxiosError$1.ECONNREFUSED = 'ECONNREFUSED';
15527
+ AxiosError$1.ERR_NETWORK = 'ERR_NETWORK';
15528
+ AxiosError$1.ERR_FR_TOO_MANY_REDIRECTS = 'ERR_FR_TOO_MANY_REDIRECTS';
15529
+ AxiosError$1.ERR_DEPRECATED = 'ERR_DEPRECATED';
15530
+ AxiosError$1.ERR_BAD_RESPONSE = 'ERR_BAD_RESPONSE';
15531
+ AxiosError$1.ERR_BAD_REQUEST = 'ERR_BAD_REQUEST';
15532
+ AxiosError$1.ERR_CANCELED = 'ERR_CANCELED';
15533
+ AxiosError$1.ERR_NOT_SUPPORT = 'ERR_NOT_SUPPORT';
15534
+ AxiosError$1.ERR_INVALID_URL = 'ERR_INVALID_URL';
15535
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED = 'ERR_FORM_DATA_DEPTH_EXCEEDED';
15511
15536
 
15512
- return toFormData$1(
15513
- isFileList ? { 'files[]': data } : data,
15514
- _FormData && new _FormData(),
15515
- formSerializer
15516
- );
15517
- }
15518
- }
15537
+ // eslint-disable-next-line strict
15538
+ const httpAdapter = null;
15539
+
15540
+ /**
15541
+ * Determines if the given thing is a array or js object.
15542
+ *
15543
+ * @param {string} thing - The object or array to be visited.
15544
+ *
15545
+ * @returns {boolean}
15546
+ */
15547
+ function isVisitable(thing) {
15548
+ return utils$1.isPlainObject(thing) || utils$1.isArray(thing);
15549
+ }
15550
+
15551
+ /**
15552
+ * It removes the brackets from the end of a string
15553
+ *
15554
+ * @param {string} key - The key of the parameter.
15555
+ *
15556
+ * @returns {string} the key without the brackets.
15557
+ */
15558
+ function removeBrackets(key) {
15559
+ return utils$1.endsWith(key, '[]') ? key.slice(0, -2) : key;
15560
+ }
15561
+
15562
+ /**
15563
+ * It takes a path, a key, and a boolean, and returns a string
15564
+ *
15565
+ * @param {string} path - The path to the current key.
15566
+ * @param {string} key - The key of the current object being iterated over.
15567
+ * @param {string} dots - If true, the key will be rendered with dots instead of brackets.
15568
+ *
15569
+ * @returns {string} The path to the current key.
15570
+ */
15571
+ function renderKey(path, key, dots) {
15572
+ if (!path) return key;
15573
+ return path
15574
+ .concat(key)
15575
+ .map(function each(token, i) {
15576
+ // eslint-disable-next-line no-param-reassign
15577
+ token = removeBrackets(token);
15578
+ return !dots && i ? '[' + token + ']' : token;
15579
+ })
15580
+ .join(dots ? '.' : '');
15581
+ }
15582
+
15583
+ /**
15584
+ * If the array is an array and none of its elements are visitable, then it's a flat array.
15585
+ *
15586
+ * @param {Array<any>} arr - The array to check
15587
+ *
15588
+ * @returns {boolean}
15589
+ */
15590
+ function isFlatArray(arr) {
15591
+ return utils$1.isArray(arr) && !arr.some(isVisitable);
15592
+ }
15593
+
15594
+ const predicates = utils$1.toFlatObject(utils$1, {}, null, function filter(prop) {
15595
+ return /^is[A-Z]/.test(prop);
15596
+ });
15597
+
15598
+ /**
15599
+ * Convert a data object to FormData
15600
+ *
15601
+ * @param {Object} obj
15602
+ * @param {?Object} [formData]
15603
+ * @param {?Object} [options]
15604
+ * @param {Function} [options.visitor]
15605
+ * @param {Boolean} [options.metaTokens = true]
15606
+ * @param {Boolean} [options.dots = false]
15607
+ * @param {?Boolean} [options.indexes = false]
15608
+ *
15609
+ * @returns {Object}
15610
+ **/
15611
+
15612
+ /**
15613
+ * It converts an object into a FormData object
15614
+ *
15615
+ * @param {Object<any, any>} obj - The object to convert to form data.
15616
+ * @param {string} formData - The FormData object to append to.
15617
+ * @param {Object<string, any>} options
15618
+ *
15619
+ * @returns
15620
+ */
15621
+ function toFormData$1(obj, formData, options) {
15622
+ if (!utils$1.isObject(obj)) {
15623
+ throw new TypeError('target must be an object');
15624
+ }
15625
+
15626
+ // eslint-disable-next-line no-param-reassign
15627
+ formData = formData || new (FormData)();
15628
+
15629
+ // eslint-disable-next-line no-param-reassign
15630
+ options = utils$1.toFlatObject(
15631
+ options,
15632
+ {
15633
+ metaTokens: true,
15634
+ dots: false,
15635
+ indexes: false,
15636
+ },
15637
+ false,
15638
+ function defined(option, source) {
15639
+ // eslint-disable-next-line no-eq-null,eqeqeq
15640
+ return !utils$1.isUndefined(source[option]);
15641
+ }
15642
+ );
15643
+
15644
+ const metaTokens = options.metaTokens;
15645
+ // eslint-disable-next-line no-use-before-define
15646
+ const visitor = options.visitor || defaultVisitor;
15647
+ const dots = options.dots;
15648
+ const indexes = options.indexes;
15649
+ const _Blob = options.Blob || (typeof Blob !== 'undefined' && Blob);
15650
+ const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
15651
+ const useBlob = _Blob && utils$1.isSpecCompliantForm(formData);
15652
+
15653
+ if (!utils$1.isFunction(visitor)) {
15654
+ throw new TypeError('visitor must be a function');
15655
+ }
15656
+
15657
+ function convertValue(value) {
15658
+ if (value === null) return '';
15659
+
15660
+ if (utils$1.isDate(value)) {
15661
+ return value.toISOString();
15662
+ }
15663
+
15664
+ if (utils$1.isBoolean(value)) {
15665
+ return value.toString();
15666
+ }
15667
+
15668
+ if (!useBlob && utils$1.isBlob(value)) {
15669
+ throw new AxiosError$1('Blob is not supported. Use a Buffer instead.');
15670
+ }
15671
+
15672
+ if (utils$1.isArrayBuffer(value) || utils$1.isTypedArray(value)) {
15673
+ return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);
15674
+ }
15675
+
15676
+ return value;
15677
+ }
15678
+
15679
+ /**
15680
+ * Default visitor.
15681
+ *
15682
+ * @param {*} value
15683
+ * @param {String|Number} key
15684
+ * @param {Array<String|Number>} path
15685
+ * @this {FormData}
15686
+ *
15687
+ * @returns {boolean} return true to visit the each prop of the value recursively
15688
+ */
15689
+ function defaultVisitor(value, key, path) {
15690
+ let arr = value;
15691
+
15692
+ if (utils$1.isReactNative(formData) && utils$1.isReactNativeBlob(value)) {
15693
+ formData.append(renderKey(path, key, dots), convertValue(value));
15694
+ return false;
15695
+ }
15696
+
15697
+ if (value && !path && typeof value === 'object') {
15698
+ if (utils$1.endsWith(key, '{}')) {
15699
+ // eslint-disable-next-line no-param-reassign
15700
+ key = metaTokens ? key : key.slice(0, -2);
15701
+ // eslint-disable-next-line no-param-reassign
15702
+ value = JSON.stringify(value);
15703
+ } else if (
15704
+ (utils$1.isArray(value) && isFlatArray(value)) ||
15705
+ ((utils$1.isFileList(value) || utils$1.endsWith(key, '[]')) && (arr = utils$1.toArray(value)))
15706
+ ) {
15707
+ // eslint-disable-next-line no-param-reassign
15708
+ key = removeBrackets(key);
15519
15709
 
15520
- if (isObjectPayload || hasJSONContentType) {
15521
- headers.setContentType('application/json', false);
15522
- return stringifySafely(data);
15710
+ arr.forEach(function each(el, index) {
15711
+ !(utils$1.isUndefined(el) || el === null) &&
15712
+ formData.append(
15713
+ // eslint-disable-next-line no-nested-ternary
15714
+ indexes === true
15715
+ ? renderKey([key], index, dots)
15716
+ : indexes === null
15717
+ ? key
15718
+ : key + '[]',
15719
+ convertValue(el)
15720
+ );
15721
+ });
15722
+ return false;
15523
15723
  }
15724
+ }
15524
15725
 
15525
- return data;
15526
- },
15527
- ],
15726
+ if (isVisitable(value)) {
15727
+ return true;
15728
+ }
15528
15729
 
15529
- transformResponse: [
15530
- function transformResponse(data) {
15531
- const transitional = own(this, 'transitional') || defaults$1.transitional;
15532
- const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
15533
- const responseType = own(this, 'responseType');
15534
- const JSONRequested = responseType === 'json';
15730
+ formData.append(renderKey(path, key, dots), convertValue(value));
15535
15731
 
15536
- if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
15537
- return data;
15538
- }
15732
+ return false;
15733
+ }
15539
15734
 
15540
- if (
15541
- data &&
15542
- utils$1.isString(data) &&
15543
- ((forcedJSONParsing && !responseType) || JSONRequested)
15544
- ) {
15545
- const silentJSONParsing = transitional && transitional.silentJSONParsing;
15546
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
15735
+ const stack = [];
15547
15736
 
15548
- try {
15549
- return JSON.parse(data, own(this, 'parseReviver'));
15550
- } catch (e) {
15551
- if (strictJSONParsing) {
15552
- if (e.name === 'SyntaxError') {
15553
- throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
15554
- }
15555
- throw e;
15556
- }
15557
- }
15558
- }
15737
+ const exposedHelpers = Object.assign(predicates, {
15738
+ defaultVisitor,
15739
+ convertValue,
15740
+ isVisitable,
15741
+ });
15559
15742
 
15560
- return data;
15561
- },
15562
- ],
15743
+ function build(value, path, depth = 0) {
15744
+ if (utils$1.isUndefined(value)) return;
15563
15745
 
15564
- /**
15565
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
15566
- * timeout is not created.
15567
- */
15568
- timeout: 0,
15746
+ if (depth > maxDepth) {
15747
+ throw new AxiosError$1(
15748
+ 'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
15749
+ AxiosError$1.ERR_FORM_DATA_DEPTH_EXCEEDED
15750
+ );
15751
+ }
15569
15752
 
15570
- xsrfCookieName: 'XSRF-TOKEN',
15571
- xsrfHeaderName: 'X-XSRF-TOKEN',
15753
+ if (stack.indexOf(value) !== -1) {
15754
+ throw Error('Circular reference detected in ' + path.join('.'));
15755
+ }
15572
15756
 
15573
- maxContentLength: -1,
15574
- maxBodyLength: -1,
15757
+ stack.push(value);
15575
15758
 
15576
- env: {
15577
- FormData: platform.classes.FormData,
15578
- Blob: platform.classes.Blob,
15579
- },
15759
+ utils$1.forEach(value, function each(el, key) {
15760
+ const result =
15761
+ !(utils$1.isUndefined(el) || el === null) &&
15762
+ visitor.call(formData, el, utils$1.isString(key) ? key.trim() : key, path, exposedHelpers);
15580
15763
 
15581
- validateStatus: function validateStatus(status) {
15582
- return status >= 200 && status < 300;
15583
- },
15764
+ if (result === true) {
15765
+ build(el, path ? path.concat(key) : [key], depth + 1);
15766
+ }
15767
+ });
15584
15768
 
15585
- headers: {
15586
- common: {
15587
- Accept: 'application/json, text/plain, */*',
15588
- 'Content-Type': undefined,
15589
- },
15590
- },
15591
- };
15769
+ stack.pop();
15770
+ }
15592
15771
 
15593
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {
15594
- defaults$1.headers[method] = {};
15595
- });
15772
+ if (!utils$1.isObject(obj)) {
15773
+ throw new TypeError('data must be an object');
15774
+ }
15596
15775
 
15597
- // RawAxiosHeaders whose duplicates are ignored by node
15598
- // c.f. https://nodejs.org/api/http.html#http_message_headers
15599
- const ignoreDuplicateOf = utils$1.toObjectSet([
15600
- 'age',
15601
- 'authorization',
15602
- 'content-length',
15603
- 'content-type',
15604
- 'etag',
15605
- 'expires',
15606
- 'from',
15607
- 'host',
15608
- 'if-modified-since',
15609
- 'if-unmodified-since',
15610
- 'last-modified',
15611
- 'location',
15612
- 'max-forwards',
15613
- 'proxy-authorization',
15614
- 'referer',
15615
- 'retry-after',
15616
- 'user-agent',
15617
- ]);
15776
+ build(obj);
15777
+
15778
+ return formData;
15779
+ }
15618
15780
 
15619
15781
  /**
15620
- * Parse headers into an object
15621
- *
15622
- * ```
15623
- * Date: Wed, 27 Aug 2014 08:58:49 GMT
15624
- * Content-Type: application/json
15625
- * Connection: keep-alive
15626
- * Transfer-Encoding: chunked
15627
- * ```
15782
+ * It encodes a string by replacing all characters that are not in the unreserved set with
15783
+ * their percent-encoded equivalents
15628
15784
  *
15629
- * @param {String} rawHeaders Headers needing to be parsed
15785
+ * @param {string} str - The string to encode.
15630
15786
  *
15631
- * @returns {Object} Headers parsed into an object
15787
+ * @returns {string} The encoded string.
15632
15788
  */
15633
- const parseHeaders = (rawHeaders) => {
15634
- const parsed = {};
15635
- let key;
15636
- let val;
15637
- let i;
15789
+ function encode$2(str) {
15790
+ const charMap = {
15791
+ '!': '%21',
15792
+ "'": '%27',
15793
+ '(': '%28',
15794
+ ')': '%29',
15795
+ '~': '%7E',
15796
+ '%20': '+',
15797
+ };
15798
+ return encodeURIComponent(str).replace(/[!'()~]|%20/g, function replacer(match) {
15799
+ return charMap[match];
15800
+ });
15801
+ }
15638
15802
 
15639
- rawHeaders &&
15640
- rawHeaders.split('\n').forEach(function parser(line) {
15641
- i = line.indexOf(':');
15642
- key = line.substring(0, i).trim().toLowerCase();
15643
- val = line.substring(i + 1).trim();
15803
+ /**
15804
+ * It takes a params object and converts it to a FormData object
15805
+ *
15806
+ * @param {Object<string, any>} params - The parameters to be converted to a FormData object.
15807
+ * @param {Object<string, any>} options - The options object passed to the Axios constructor.
15808
+ *
15809
+ * @returns {void}
15810
+ */
15811
+ function AxiosURLSearchParams(params, options) {
15812
+ this._pairs = [];
15644
15813
 
15645
- if (!key || (parsed[key] && ignoreDuplicateOf[key])) {
15646
- return;
15647
- }
15814
+ params && toFormData$1(params, this, options);
15815
+ }
15648
15816
 
15649
- if (key === 'set-cookie') {
15650
- if (parsed[key]) {
15651
- parsed[key].push(val);
15652
- } else {
15653
- parsed[key] = [val];
15654
- }
15655
- } else {
15656
- parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
15657
- }
15658
- });
15817
+ const prototype = AxiosURLSearchParams.prototype;
15659
15818
 
15660
- return parsed;
15819
+ prototype.append = function append(name, value) {
15820
+ this._pairs.push([name, value]);
15661
15821
  };
15662
15822
 
15663
- const $internals = Symbol('internals');
15664
-
15665
- const INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
15666
-
15667
- function trimSPorHTAB(str) {
15668
- let start = 0;
15669
- let end = str.length;
15823
+ prototype.toString = function toString(encoder) {
15824
+ const _encode = encoder
15825
+ ? function (value) {
15826
+ return encoder.call(this, value, encode$2);
15827
+ }
15828
+ : encode$2;
15670
15829
 
15671
- while (start < end) {
15672
- const code = str.charCodeAt(start);
15830
+ return this._pairs
15831
+ .map(function each(pair) {
15832
+ return _encode(pair[0]) + '=' + _encode(pair[1]);
15833
+ }, '')
15834
+ .join('&');
15835
+ };
15673
15836
 
15674
- if (code !== 0x09 && code !== 0x20) {
15675
- break;
15676
- }
15837
+ /**
15838
+ * It replaces URL-encoded forms of `:`, `$`, `,`, and spaces with
15839
+ * their plain counterparts (`:`, `$`, `,`, `+`).
15840
+ *
15841
+ * @param {string} val The value to be encoded.
15842
+ *
15843
+ * @returns {string} The encoded value.
15844
+ */
15845
+ function encode$1(val) {
15846
+ return encodeURIComponent(val)
15847
+ .replace(/%3A/gi, ':')
15848
+ .replace(/%24/g, '$')
15849
+ .replace(/%2C/gi, ',')
15850
+ .replace(/%20/g, '+');
15851
+ }
15677
15852
 
15678
- start += 1;
15853
+ /**
15854
+ * Build a URL by appending params to the end
15855
+ *
15856
+ * @param {string} url The base of the url (e.g., http://www.google.com)
15857
+ * @param {object} [params] The params to be appended
15858
+ * @param {?(object|Function)} options
15859
+ *
15860
+ * @returns {string} The formatted url
15861
+ */
15862
+ function buildURL(url, params, options) {
15863
+ if (!params) {
15864
+ return url;
15679
15865
  }
15680
15866
 
15681
- while (end > start) {
15682
- const code = str.charCodeAt(end - 1);
15683
-
15684
- if (code !== 0x09 && code !== 0x20) {
15685
- break;
15686
- }
15687
-
15688
- end -= 1;
15689
- }
15867
+ const _encode = (options && options.encode) || encode$1;
15690
15868
 
15691
- return start === 0 && end === str.length ? str : str.slice(start, end);
15692
- }
15869
+ const _options = utils$1.isFunction(options)
15870
+ ? {
15871
+ serialize: options,
15872
+ }
15873
+ : options;
15693
15874
 
15694
- function normalizeHeader(header) {
15695
- return header && String(header).trim().toLowerCase();
15696
- }
15875
+ const serializeFn = _options && _options.serialize;
15697
15876
 
15698
- function sanitizeHeaderValue(str) {
15699
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ''));
15700
- }
15877
+ let serializedParams;
15701
15878
 
15702
- function normalizeValue(value) {
15703
- if (value === false || value == null) {
15704
- return value;
15879
+ if (serializeFn) {
15880
+ serializedParams = serializeFn(params, _options);
15881
+ } else {
15882
+ serializedParams = utils$1.isURLSearchParams(params)
15883
+ ? params.toString()
15884
+ : new AxiosURLSearchParams(params, _options).toString(_encode);
15705
15885
  }
15706
15886
 
15707
- return utils$1.isArray(value) ? value.map(normalizeValue) : sanitizeHeaderValue(String(value));
15708
- }
15709
-
15710
- function parseTokens(str) {
15711
- const tokens = Object.create(null);
15712
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
15713
- let match;
15887
+ if (serializedParams) {
15888
+ const hashmarkIndex = url.indexOf('#');
15714
15889
 
15715
- while ((match = tokensRE.exec(str))) {
15716
- tokens[match[1]] = match[2];
15890
+ if (hashmarkIndex !== -1) {
15891
+ url = url.slice(0, hashmarkIndex);
15892
+ }
15893
+ url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
15717
15894
  }
15718
15895
 
15719
- return tokens;
15896
+ return url;
15720
15897
  }
15721
15898
 
15722
- const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
15723
-
15724
- function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
15725
- if (utils$1.isFunction(filter)) {
15726
- return filter.call(this, value, header);
15899
+ class InterceptorManager {
15900
+ constructor() {
15901
+ this.handlers = [];
15727
15902
  }
15728
15903
 
15729
- if (isHeaderNameFilter) {
15730
- value = header;
15904
+ /**
15905
+ * Add a new interceptor to the stack
15906
+ *
15907
+ * @param {Function} fulfilled The function to handle `then` for a `Promise`
15908
+ * @param {Function} rejected The function to handle `reject` for a `Promise`
15909
+ * @param {Object} options The options for the interceptor, synchronous and runWhen
15910
+ *
15911
+ * @return {Number} An ID used to remove interceptor later
15912
+ */
15913
+ use(fulfilled, rejected, options) {
15914
+ this.handlers.push({
15915
+ fulfilled,
15916
+ rejected,
15917
+ synchronous: options ? options.synchronous : false,
15918
+ runWhen: options ? options.runWhen : null,
15919
+ });
15920
+ return this.handlers.length - 1;
15731
15921
  }
15732
15922
 
15733
- if (!utils$1.isString(value)) return;
15734
-
15735
- if (utils$1.isString(filter)) {
15736
- return value.indexOf(filter) !== -1;
15923
+ /**
15924
+ * Remove an interceptor from the stack
15925
+ *
15926
+ * @param {Number} id The ID that was returned by `use`
15927
+ *
15928
+ * @returns {void}
15929
+ */
15930
+ eject(id) {
15931
+ if (this.handlers[id]) {
15932
+ this.handlers[id] = null;
15933
+ }
15737
15934
  }
15738
15935
 
15739
- if (utils$1.isRegExp(filter)) {
15740
- return filter.test(value);
15936
+ /**
15937
+ * Clear all interceptors from the stack
15938
+ *
15939
+ * @returns {void}
15940
+ */
15941
+ clear() {
15942
+ if (this.handlers) {
15943
+ this.handlers = [];
15944
+ }
15741
15945
  }
15742
- }
15743
-
15744
- function formatHeader(header) {
15745
- return header
15746
- .trim()
15747
- .toLowerCase()
15748
- .replace(/([a-z\d])(\w*)/g, (w, char, str) => {
15749
- return char.toUpperCase() + str;
15750
- });
15751
- }
15752
-
15753
- function buildAccessors(obj, header) {
15754
- const accessorName = utils$1.toCamelCase(' ' + header);
15755
15946
 
15756
- ['get', 'set', 'has'].forEach((methodName) => {
15757
- Object.defineProperty(obj, methodName + accessorName, {
15758
- value: function (arg1, arg2, arg3) {
15759
- return this[methodName].call(this, header, arg1, arg2, arg3);
15760
- },
15761
- configurable: true,
15947
+ /**
15948
+ * Iterate over all the registered interceptors
15949
+ *
15950
+ * This method is particularly useful for skipping over any
15951
+ * interceptors that may have become `null` calling `eject`.
15952
+ *
15953
+ * @param {Function} fn The function to call for each interceptor
15954
+ *
15955
+ * @returns {void}
15956
+ */
15957
+ forEach(fn) {
15958
+ utils$1.forEach(this.handlers, function forEachHandler(h) {
15959
+ if (h !== null) {
15960
+ fn(h);
15961
+ }
15762
15962
  });
15763
- });
15764
- }
15765
-
15766
- let AxiosHeaders$1 = class AxiosHeaders {
15767
- constructor(headers) {
15768
- headers && this.set(headers);
15769
15963
  }
15964
+ }
15770
15965
 
15771
- set(header, valueOrRewrite, rewrite) {
15772
- const self = this;
15773
-
15774
- function setHeader(_value, _header, _rewrite) {
15775
- const lHeader = normalizeHeader(_header);
15776
-
15777
- if (!lHeader) {
15778
- throw new Error('header name must be a non-empty string');
15779
- }
15780
-
15781
- const key = utils$1.findKey(self, lHeader);
15782
-
15783
- if (
15784
- !key ||
15785
- self[key] === undefined ||
15786
- _rewrite === true ||
15787
- (_rewrite === undefined && self[key] !== false)
15788
- ) {
15789
- self[key || _header] = normalizeValue(_value);
15790
- }
15791
- }
15792
-
15793
- const setHeaders = (headers, _rewrite) =>
15794
- utils$1.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
15966
+ const transitionalDefaults = {
15967
+ silentJSONParsing: true,
15968
+ forcedJSONParsing: true,
15969
+ clarifyTimeoutError: false,
15970
+ legacyInterceptorReqResOrdering: true,
15971
+ };
15795
15972
 
15796
- if (utils$1.isPlainObject(header) || header instanceof this.constructor) {
15797
- setHeaders(header, valueOrRewrite);
15798
- } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
15799
- setHeaders(parseHeaders(header), valueOrRewrite);
15800
- } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
15801
- let obj = {},
15802
- dest,
15803
- key;
15804
- for (const entry of header) {
15805
- if (!utils$1.isArray(entry)) {
15806
- throw TypeError('Object iterator must return a key-value pair');
15807
- }
15973
+ const URLSearchParams$1 = typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;
15808
15974
 
15809
- obj[(key = entry[0])] = (dest = obj[key])
15810
- ? utils$1.isArray(dest)
15811
- ? [...dest, entry[1]]
15812
- : [dest, entry[1]]
15813
- : entry[1];
15814
- }
15975
+ const FormData$1 = typeof FormData !== 'undefined' ? FormData : null;
15815
15976
 
15816
- setHeaders(obj, valueOrRewrite);
15817
- } else {
15818
- header != null && setHeader(valueOrRewrite, header, rewrite);
15819
- }
15977
+ const Blob$1 = typeof Blob !== 'undefined' ? Blob : null;
15820
15978
 
15821
- return this;
15822
- }
15979
+ const platform$1 = {
15980
+ isBrowser: true,
15981
+ classes: {
15982
+ URLSearchParams: URLSearchParams$1,
15983
+ FormData: FormData$1,
15984
+ Blob: Blob$1,
15985
+ },
15986
+ protocols: ['http', 'https', 'file', 'blob', 'url', 'data'],
15987
+ };
15823
15988
 
15824
- get(header, parser) {
15825
- header = normalizeHeader(header);
15989
+ const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';
15826
15990
 
15827
- if (header) {
15828
- const key = utils$1.findKey(this, header);
15991
+ const _navigator = (typeof navigator === 'object' && navigator) || undefined;
15829
15992
 
15830
- if (key) {
15831
- const value = this[key];
15993
+ /**
15994
+ * Determine if we're running in a standard browser environment
15995
+ *
15996
+ * This allows axios to run in a web worker, and react-native.
15997
+ * Both environments support XMLHttpRequest, but not fully standard globals.
15998
+ *
15999
+ * web workers:
16000
+ * typeof window -> undefined
16001
+ * typeof document -> undefined
16002
+ *
16003
+ * react-native:
16004
+ * navigator.product -> 'ReactNative'
16005
+ * nativescript
16006
+ * navigator.product -> 'NativeScript' or 'NS'
16007
+ *
16008
+ * @returns {boolean}
16009
+ */
16010
+ const hasStandardBrowserEnv =
16011
+ hasBrowserEnv &&
16012
+ (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);
15832
16013
 
15833
- if (!parser) {
15834
- return value;
15835
- }
16014
+ /**
16015
+ * Determine if we're running in a standard browser webWorker environment
16016
+ *
16017
+ * Although the `isStandardBrowserEnv` method indicates that
16018
+ * `allows axios to run in a web worker`, the WebWorker will still be
16019
+ * filtered out due to its judgment standard
16020
+ * `typeof window !== 'undefined' && typeof document !== 'undefined'`.
16021
+ * This leads to a problem when axios post `FormData` in webWorker
16022
+ */
16023
+ const hasStandardBrowserWebWorkerEnv = (() => {
16024
+ return (
16025
+ typeof WorkerGlobalScope !== 'undefined' &&
16026
+ // eslint-disable-next-line no-undef
16027
+ self instanceof WorkerGlobalScope &&
16028
+ typeof self.importScripts === 'function'
16029
+ );
16030
+ })();
15836
16031
 
15837
- if (parser === true) {
15838
- return parseTokens(value);
15839
- }
16032
+ const origin = (hasBrowserEnv && window.location.href) || 'http://localhost';
15840
16033
 
15841
- if (utils$1.isFunction(parser)) {
15842
- return parser.call(this, value, key);
15843
- }
16034
+ const utils = {
16035
+ __proto__: null,
16036
+ hasBrowserEnv: hasBrowserEnv,
16037
+ hasStandardBrowserEnv: hasStandardBrowserEnv,
16038
+ hasStandardBrowserWebWorkerEnv: hasStandardBrowserWebWorkerEnv,
16039
+ navigator: _navigator,
16040
+ origin: origin
16041
+ };
15844
16042
 
15845
- if (utils$1.isRegExp(parser)) {
15846
- return parser.exec(value);
15847
- }
16043
+ const platform = {
16044
+ ...utils,
16045
+ ...platform$1,
16046
+ };
15848
16047
 
15849
- throw new TypeError('parser must be boolean|regexp|function');
16048
+ function toURLEncodedForm(data, options) {
16049
+ return toFormData$1(data, new platform.classes.URLSearchParams(), {
16050
+ visitor: function (value, key, path, helpers) {
16051
+ if (platform.isNode && utils$1.isBuffer(value)) {
16052
+ this.append(key, value.toString('base64'));
16053
+ return false;
15850
16054
  }
15851
- }
15852
- }
15853
-
15854
- has(header, matcher) {
15855
- header = normalizeHeader(header);
15856
16055
 
15857
- if (header) {
15858
- const key = utils$1.findKey(this, header);
16056
+ return helpers.defaultVisitor.apply(this, arguments);
16057
+ },
16058
+ ...options,
16059
+ });
16060
+ }
15859
16061
 
15860
- return !!(
15861
- key &&
15862
- this[key] !== undefined &&
15863
- (!matcher || matchHeaderValue(this, this[key], key, matcher))
15864
- );
15865
- }
16062
+ /**
16063
+ * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']
16064
+ *
16065
+ * @param {string} name - The name of the property to get.
16066
+ *
16067
+ * @returns An array of strings.
16068
+ */
16069
+ function parsePropPath(name) {
16070
+ // foo[x][y][z]
16071
+ // foo.x.y.z
16072
+ // foo-x-y-z
16073
+ // foo x y z
16074
+ return utils$1.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
16075
+ return match[0] === '[]' ? '' : match[1] || match[0];
16076
+ });
16077
+ }
15866
16078
 
15867
- return false;
16079
+ /**
16080
+ * Convert an array to an object.
16081
+ *
16082
+ * @param {Array<any>} arr - The array to convert to an object.
16083
+ *
16084
+ * @returns An object with the same keys and values as the array.
16085
+ */
16086
+ function arrayToObject(arr) {
16087
+ const obj = {};
16088
+ const keys = Object.keys(arr);
16089
+ let i;
16090
+ const len = keys.length;
16091
+ let key;
16092
+ for (i = 0; i < len; i++) {
16093
+ key = keys[i];
16094
+ obj[key] = arr[key];
15868
16095
  }
16096
+ return obj;
16097
+ }
15869
16098
 
15870
- delete(header, matcher) {
15871
- const self = this;
15872
- let deleted = false;
15873
-
15874
- function deleteHeader(_header) {
15875
- _header = normalizeHeader(_header);
16099
+ /**
16100
+ * It takes a FormData object and returns a JavaScript object
16101
+ *
16102
+ * @param {string} formData The FormData object to convert to JSON.
16103
+ *
16104
+ * @returns {Object<string, any> | null} The converted object.
16105
+ */
16106
+ function formDataToJSON(formData) {
16107
+ function buildPath(path, value, target, index) {
16108
+ let name = path[index++];
15876
16109
 
15877
- if (_header) {
15878
- const key = utils$1.findKey(self, _header);
16110
+ if (name === '__proto__') return true;
15879
16111
 
15880
- if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
15881
- delete self[key];
16112
+ const isNumericKey = Number.isFinite(+name);
16113
+ const isLast = index >= path.length;
16114
+ name = !name && utils$1.isArray(target) ? target.length : name;
15882
16115
 
15883
- deleted = true;
15884
- }
16116
+ if (isLast) {
16117
+ if (utils$1.hasOwnProp(target, name)) {
16118
+ target[name] = utils$1.isArray(target[name])
16119
+ ? target[name].concat(value)
16120
+ : [target[name], value];
16121
+ } else {
16122
+ target[name] = value;
15885
16123
  }
16124
+
16125
+ return !isNumericKey;
15886
16126
  }
15887
16127
 
15888
- if (utils$1.isArray(header)) {
15889
- header.forEach(deleteHeader);
15890
- } else {
15891
- deleteHeader(header);
16128
+ if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
16129
+ target[name] = [];
15892
16130
  }
15893
16131
 
15894
- return deleted;
16132
+ const result = buildPath(path, value, target[name], index);
16133
+
16134
+ if (result && utils$1.isArray(target[name])) {
16135
+ target[name] = arrayToObject(target[name]);
16136
+ }
16137
+
16138
+ return !isNumericKey;
15895
16139
  }
15896
16140
 
15897
- clear(matcher) {
15898
- const keys = Object.keys(this);
15899
- let i = keys.length;
15900
- let deleted = false;
16141
+ if (utils$1.isFormData(formData) && utils$1.isFunction(formData.entries)) {
16142
+ const obj = {};
15901
16143
 
15902
- while (i--) {
15903
- const key = keys[i];
15904
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
15905
- delete this[key];
15906
- deleted = true;
15907
- }
15908
- }
16144
+ utils$1.forEachEntry(formData, (name, value) => {
16145
+ buildPath(parsePropPath(name), value, obj, 0);
16146
+ });
15909
16147
 
15910
- return deleted;
16148
+ return obj;
15911
16149
  }
15912
16150
 
15913
- normalize(format) {
15914
- const self = this;
15915
- const headers = {};
16151
+ return null;
16152
+ }
15916
16153
 
15917
- utils$1.forEach(this, (value, header) => {
15918
- const key = utils$1.findKey(headers, header);
16154
+ const own = (obj, key) => (obj != null && utils$1.hasOwnProp(obj, key) ? obj[key] : undefined);
15919
16155
 
15920
- if (key) {
15921
- self[key] = normalizeValue(value);
15922
- delete self[header];
15923
- return;
16156
+ /**
16157
+ * It takes a string, tries to parse it, and if it fails, it returns the stringified version
16158
+ * of the input
16159
+ *
16160
+ * @param {any} rawValue - The value to be stringified.
16161
+ * @param {Function} parser - A function that parses a string into a JavaScript object.
16162
+ * @param {Function} encoder - A function that takes a value and returns a string.
16163
+ *
16164
+ * @returns {string} A stringified version of the rawValue.
16165
+ */
16166
+ function stringifySafely(rawValue, parser, encoder) {
16167
+ if (utils$1.isString(rawValue)) {
16168
+ try {
16169
+ (parser || JSON.parse)(rawValue);
16170
+ return utils$1.trim(rawValue);
16171
+ } catch (e) {
16172
+ if (e.name !== 'SyntaxError') {
16173
+ throw e;
15924
16174
  }
16175
+ }
16176
+ }
15925
16177
 
15926
- const normalized = format ? formatHeader(header) : String(header).trim();
16178
+ return (encoder || JSON.stringify)(rawValue);
16179
+ }
15927
16180
 
15928
- if (normalized !== header) {
15929
- delete self[header];
15930
- }
16181
+ const defaults$1 = {
16182
+ transitional: transitionalDefaults,
15931
16183
 
15932
- self[normalized] = normalizeValue(value);
16184
+ adapter: ['xhr', 'http', 'fetch'],
15933
16185
 
15934
- headers[normalized] = true;
15935
- });
16186
+ transformRequest: [
16187
+ function transformRequest(data, headers) {
16188
+ const contentType = headers.getContentType() || '';
16189
+ const hasJSONContentType = contentType.indexOf('application/json') > -1;
16190
+ const isObjectPayload = utils$1.isObject(data);
15936
16191
 
15937
- return this;
15938
- }
16192
+ if (isObjectPayload && utils$1.isHTMLForm(data)) {
16193
+ data = new FormData(data);
16194
+ }
15939
16195
 
15940
- concat(...targets) {
15941
- return this.constructor.concat(this, ...targets);
15942
- }
16196
+ const isFormData = utils$1.isFormData(data);
15943
16197
 
15944
- toJSON(asStrings) {
15945
- const obj = Object.create(null);
16198
+ if (isFormData) {
16199
+ return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;
16200
+ }
15946
16201
 
15947
- utils$1.forEach(this, (value, header) => {
15948
- value != null &&
15949
- value !== false &&
15950
- (obj[header] = asStrings && utils$1.isArray(value) ? value.join(', ') : value);
15951
- });
16202
+ if (
16203
+ utils$1.isArrayBuffer(data) ||
16204
+ utils$1.isBuffer(data) ||
16205
+ utils$1.isStream(data) ||
16206
+ utils$1.isFile(data) ||
16207
+ utils$1.isBlob(data) ||
16208
+ utils$1.isReadableStream(data)
16209
+ ) {
16210
+ return data;
16211
+ }
16212
+ if (utils$1.isArrayBufferView(data)) {
16213
+ return data.buffer;
16214
+ }
16215
+ if (utils$1.isURLSearchParams(data)) {
16216
+ headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);
16217
+ return data.toString();
16218
+ }
15952
16219
 
15953
- return obj;
15954
- }
16220
+ let isFileList;
15955
16221
 
15956
- [Symbol.iterator]() {
15957
- return Object.entries(this.toJSON())[Symbol.iterator]();
15958
- }
16222
+ if (isObjectPayload) {
16223
+ const formSerializer = own(this, 'formSerializer');
16224
+ if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {
16225
+ return toURLEncodedForm(data, formSerializer).toString();
16226
+ }
15959
16227
 
15960
- toString() {
15961
- return Object.entries(this.toJSON())
15962
- .map(([header, value]) => header + ': ' + value)
15963
- .join('\n');
15964
- }
16228
+ if (
16229
+ (isFileList = utils$1.isFileList(data)) ||
16230
+ contentType.indexOf('multipart/form-data') > -1
16231
+ ) {
16232
+ const env = own(this, 'env');
16233
+ const _FormData = env && env.FormData;
15965
16234
 
15966
- getSetCookie() {
15967
- return this.get('set-cookie') || [];
15968
- }
16235
+ return toFormData$1(
16236
+ isFileList ? { 'files[]': data } : data,
16237
+ _FormData && new _FormData(),
16238
+ formSerializer
16239
+ );
16240
+ }
16241
+ }
15969
16242
 
15970
- get [Symbol.toStringTag]() {
15971
- return 'AxiosHeaders';
15972
- }
16243
+ if (isObjectPayload || hasJSONContentType) {
16244
+ headers.setContentType('application/json', false);
16245
+ return stringifySafely(data);
16246
+ }
15973
16247
 
15974
- static from(thing) {
15975
- return thing instanceof this ? thing : new this(thing);
15976
- }
16248
+ return data;
16249
+ },
16250
+ ],
15977
16251
 
15978
- static concat(first, ...targets) {
15979
- const computed = new this(first);
16252
+ transformResponse: [
16253
+ function transformResponse(data) {
16254
+ const transitional = own(this, 'transitional') || defaults$1.transitional;
16255
+ const forcedJSONParsing = transitional && transitional.forcedJSONParsing;
16256
+ const responseType = own(this, 'responseType');
16257
+ const JSONRequested = responseType === 'json';
15980
16258
 
15981
- targets.forEach((target) => computed.set(target));
16259
+ if (utils$1.isResponse(data) || utils$1.isReadableStream(data)) {
16260
+ return data;
16261
+ }
15982
16262
 
15983
- return computed;
15984
- }
16263
+ if (
16264
+ data &&
16265
+ utils$1.isString(data) &&
16266
+ ((forcedJSONParsing && !responseType) || JSONRequested)
16267
+ ) {
16268
+ const silentJSONParsing = transitional && transitional.silentJSONParsing;
16269
+ const strictJSONParsing = !silentJSONParsing && JSONRequested;
15985
16270
 
15986
- static accessor(header) {
15987
- const internals =
15988
- (this[$internals] =
15989
- this[$internals] =
15990
- {
15991
- accessors: {},
15992
- });
16271
+ try {
16272
+ return JSON.parse(data, own(this, 'parseReviver'));
16273
+ } catch (e) {
16274
+ if (strictJSONParsing) {
16275
+ if (e.name === 'SyntaxError') {
16276
+ throw AxiosError$1.from(e, AxiosError$1.ERR_BAD_RESPONSE, this, null, own(this, 'response'));
16277
+ }
16278
+ throw e;
16279
+ }
16280
+ }
16281
+ }
15993
16282
 
15994
- const accessors = internals.accessors;
15995
- const prototype = this.prototype;
16283
+ return data;
16284
+ },
16285
+ ],
15996
16286
 
15997
- function defineAccessor(_header) {
15998
- const lHeader = normalizeHeader(_header);
16287
+ /**
16288
+ * A timeout in milliseconds to abort a request. If set to 0 (default) a
16289
+ * timeout is not created.
16290
+ */
16291
+ timeout: 0,
15999
16292
 
16000
- if (!accessors[lHeader]) {
16001
- buildAccessors(prototype, _header);
16002
- accessors[lHeader] = true;
16003
- }
16004
- }
16293
+ xsrfCookieName: 'XSRF-TOKEN',
16294
+ xsrfHeaderName: 'X-XSRF-TOKEN',
16005
16295
 
16006
- utils$1.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
16296
+ maxContentLength: -1,
16297
+ maxBodyLength: -1,
16007
16298
 
16008
- return this;
16009
- }
16010
- };
16299
+ env: {
16300
+ FormData: platform.classes.FormData,
16301
+ Blob: platform.classes.Blob,
16302
+ },
16011
16303
 
16012
- AxiosHeaders$1.accessor([
16013
- 'Content-Type',
16014
- 'Content-Length',
16015
- 'Accept',
16016
- 'Accept-Encoding',
16017
- 'User-Agent',
16018
- 'Authorization',
16019
- ]);
16304
+ validateStatus: function validateStatus(status) {
16305
+ return status >= 200 && status < 300;
16306
+ },
16020
16307
 
16021
- // reserved names hotfix
16022
- utils$1.reduceDescriptors(AxiosHeaders$1.prototype, ({ value }, key) => {
16023
- let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
16024
- return {
16025
- get: () => value,
16026
- set(headerValue) {
16027
- this[mapped] = headerValue;
16308
+ headers: {
16309
+ common: {
16310
+ Accept: 'application/json, text/plain, */*',
16311
+ 'Content-Type': undefined,
16028
16312
  },
16029
- };
16030
- });
16313
+ },
16314
+ };
16031
16315
 
16032
- utils$1.freezeMethods(AxiosHeaders$1);
16316
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query'], (method) => {
16317
+ defaults$1.headers[method] = {};
16318
+ });
16033
16319
 
16034
16320
  /**
16035
16321
  * Transform the data for a request or a response
@@ -16089,22 +16375,18 @@ ${JSON.stringify({
16089
16375
  if (!response.status || !validateStatus || validateStatus(response.status)) {
16090
16376
  resolve(response);
16091
16377
  } else {
16092
- reject(
16093
- new AxiosError$1(
16094
- 'Request failed with status code ' + response.status,
16095
- [AxiosError$1.ERR_BAD_REQUEST, AxiosError$1.ERR_BAD_RESPONSE][
16096
- Math.floor(response.status / 100) - 4
16097
- ],
16098
- response.config,
16099
- response.request,
16100
- response
16101
- )
16102
- );
16378
+ reject(new AxiosError$1(
16379
+ 'Request failed with status code ' + response.status,
16380
+ response.status >= 400 && response.status < 500 ? AxiosError$1.ERR_BAD_REQUEST : AxiosError$1.ERR_BAD_RESPONSE,
16381
+ response.config,
16382
+ response.request,
16383
+ response
16384
+ ));
16103
16385
  }
16104
16386
  }
16105
16387
 
16106
16388
  function parseProtocol(url) {
16107
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
16389
+ const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url);
16108
16390
  return (match && match[1]) || '';
16109
16391
  }
16110
16392
 
@@ -16208,6 +16490,9 @@ ${JSON.stringify({
16208
16490
  const _speedometer = speedometer(50, 250);
16209
16491
 
16210
16492
  return throttle((e) => {
16493
+ if (!e || typeof e.loaded !== 'number') {
16494
+ return;
16495
+ }
16211
16496
  const rawLoaded = e.loaded;
16212
16497
  const total = e.lengthComputable ? e.total : undefined;
16213
16498
  const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
@@ -16295,8 +16580,20 @@ ${JSON.stringify({
16295
16580
 
16296
16581
  read(name) {
16297
16582
  if (typeof document === 'undefined') return null;
16298
- const match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)'));
16299
- return match ? decodeURIComponent(match[1]) : null;
16583
+ // Match name=value by splitting on the semicolon separator instead of building a
16584
+ // RegExp from `name` interpolating an unescaped string into a RegExp would let
16585
+ // metacharacters (e.g. `.+?` in an attacker-influenced cookie name) cause ReDoS or
16586
+ // match the wrong cookie. Browsers may serialize cookie pairs as either ";" or
16587
+ // "; ", so ignore optional whitespace before each cookie name.
16588
+ const cookies = document.cookie.split(';');
16589
+ for (let i = 0; i < cookies.length; i++) {
16590
+ const cookie = cookies[i].replace(/^\s+/, '');
16591
+ const eq = cookie.indexOf('=');
16592
+ if (eq !== -1 && cookie.slice(0, eq) === name) {
16593
+ return decodeURIComponent(cookie.slice(eq + 1));
16594
+ }
16595
+ }
16596
+ return null;
16300
16597
  },
16301
16598
 
16302
16599
  remove(name) {
@@ -16378,11 +16675,14 @@ ${JSON.stringify({
16378
16675
  config2 = config2 || {};
16379
16676
 
16380
16677
  // Use a null-prototype object so that downstream reads such as `config.auth`
16381
- // or `config.baseURL` cannot inherit polluted values from Object.prototype
16382
- // (see GHSA-q8qp-cvcw-x6jj). `hasOwnProperty` is restored as a non-enumerable
16383
- // own slot to preserve ergonomics for user code that relies on it.
16678
+ // or `config.baseURL` cannot inherit polluted values from Object.prototype.
16679
+ // `hasOwnProperty` is restored as a non-enumerable own slot to preserve
16680
+ // ergonomics for user code that relies on it.
16384
16681
  const config = Object.create(null);
16385
16682
  Object.defineProperty(config, 'hasOwnProperty', {
16683
+ // Null-proto descriptor so a polluted Object.prototype.get cannot turn
16684
+ // this data descriptor into an accessor descriptor on the way in.
16685
+ __proto__: null,
16386
16686
  value: Object.prototype.hasOwnProperty,
16387
16687
  enumerable: false,
16388
16688
  writable: true,
@@ -16479,11 +16779,39 @@ ${JSON.stringify({
16479
16779
  return config;
16480
16780
  }
16481
16781
 
16782
+ const FORM_DATA_CONTENT_HEADERS = ['content-type', 'content-length'];
16783
+
16784
+ function setFormDataHeaders(headers, formHeaders, policy) {
16785
+ if (policy !== 'content-only') {
16786
+ headers.set(formHeaders);
16787
+ return;
16788
+ }
16789
+
16790
+ Object.entries(formHeaders).forEach(([key, val]) => {
16791
+ if (FORM_DATA_CONTENT_HEADERS.includes(key.toLowerCase())) {
16792
+ headers.set(key, val);
16793
+ }
16794
+ });
16795
+ }
16796
+
16797
+ /**
16798
+ * Encode a UTF-8 string to a Latin-1 byte string for use with btoa().
16799
+ * This is a modern replacement for the deprecated unescape(encodeURIComponent(str)) pattern.
16800
+ *
16801
+ * @param {string} str The string to encode
16802
+ *
16803
+ * @returns {string} UTF-8 bytes as a Latin-1 string
16804
+ */
16805
+ const encodeUTF8 = (str) =>
16806
+ encodeURIComponent(str).replace(/%([0-9A-F]{2})/gi, (_, hex) =>
16807
+ String.fromCharCode(parseInt(hex, 16))
16808
+ );
16809
+
16482
16810
  const resolveConfig = (config) => {
16483
16811
  const newConfig = mergeConfig$1({}, config);
16484
16812
 
16485
16813
  // Read only own properties to prevent prototype pollution gadgets
16486
- // (e.g. Object.prototype.baseURL = 'https://evil.com'). See GHSA-q8qp-cvcw-x6jj.
16814
+ // (e.g. Object.prototype.baseURL = 'https://evil.com').
16487
16815
  const own = (key) => (utils$1.hasOwnProp(newConfig, key) ? newConfig[key] : undefined);
16488
16816
 
16489
16817
  const data = own('data');
@@ -16509,11 +16837,7 @@ ${JSON.stringify({
16509
16837
  headers.set(
16510
16838
  'Authorization',
16511
16839
  'Basic ' +
16512
- btoa(
16513
- (auth.username || '') +
16514
- ':' +
16515
- (auth.password ? unescape(encodeURIComponent(auth.password)) : '')
16516
- )
16840
+ btoa((auth.username || '') + ':' + (auth.password ? encodeUTF8(auth.password) : ''))
16517
16841
  );
16518
16842
  }
16519
16843
 
@@ -16522,14 +16846,7 @@ ${JSON.stringify({
16522
16846
  headers.setContentType(undefined); // browser handles it
16523
16847
  } else if (utils$1.isFunction(data.getHeaders)) {
16524
16848
  // Node.js FormData (like form-data package)
16525
- const formHeaders = data.getHeaders();
16526
- // Only set safe headers to avoid overwriting security headers
16527
- const allowedHeaders = ['content-type', 'content-length'];
16528
- Object.entries(formHeaders).forEach(([key, val]) => {
16529
- if (allowedHeaders.includes(key.toLowerCase())) {
16530
- headers.set(key, val);
16531
- }
16532
- });
16849
+ setFormDataHeaders(headers, data.getHeaders(), own('formDataHeaderPolicy'));
16533
16850
  }
16534
16851
  }
16535
16852
 
@@ -16544,10 +16861,9 @@ ${JSON.stringify({
16544
16861
 
16545
16862
  // Strict boolean check — prevents proto-pollution gadgets (e.g. Object.prototype.withXSRFToken = 1)
16546
16863
  // and misconfigurations (e.g. "false") from short-circuiting the same-origin check and leaking
16547
- // the XSRF token cross-origin. See GHSA-xx6v-rp6x-q39c.
16864
+ // the XSRF token cross-origin.
16548
16865
  const shouldSendXSRF =
16549
- withXSRFToken === true ||
16550
- (withXSRFToken == null && isURLSameOrigin(newConfig.url));
16866
+ withXSRFToken === true || (withXSRFToken == null && isURLSameOrigin(newConfig.url));
16551
16867
 
16552
16868
  if (shouldSendXSRF) {
16553
16869
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
@@ -16643,7 +16959,7 @@ ${JSON.stringify({
16643
16959
  // will return status as 0 even though it's a successful request
16644
16960
  if (
16645
16961
  request.status === 0 &&
16646
- !(request.responseURL && request.responseURL.indexOf('file:') === 0)
16962
+ !(request.responseURL && request.responseURL.startsWith('file:'))
16647
16963
  ) {
16648
16964
  return;
16649
16965
  }
@@ -16660,6 +16976,7 @@ ${JSON.stringify({
16660
16976
  }
16661
16977
 
16662
16978
  reject(new AxiosError$1('Request aborted', AxiosError$1.ECONNABORTED, config, request));
16979
+ done();
16663
16980
 
16664
16981
  // Clean up request
16665
16982
  request = null;
@@ -16675,6 +16992,7 @@ ${JSON.stringify({
16675
16992
  // attach the underlying event for consumers who want details
16676
16993
  err.event = event || null;
16677
16994
  reject(err);
16995
+ done();
16678
16996
  request = null;
16679
16997
  };
16680
16998
 
@@ -16695,6 +17013,7 @@ ${JSON.stringify({
16695
17013
  request
16696
17014
  )
16697
17015
  );
17016
+ done();
16698
17017
 
16699
17018
  // Clean up request
16700
17019
  request = null;
@@ -16705,7 +17024,7 @@ ${JSON.stringify({
16705
17024
 
16706
17025
  // Add headers to the request
16707
17026
  if ('setRequestHeader' in request) {
16708
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
17027
+ utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
16709
17028
  request.setRequestHeader(key, val);
16710
17029
  });
16711
17030
  }
@@ -16744,6 +17063,7 @@ ${JSON.stringify({
16744
17063
  }
16745
17064
  reject(!cancel || cancel.type ? new CanceledError$1(null, config, request) : cancel);
16746
17065
  request.abort();
17066
+ done();
16747
17067
  request = null;
16748
17068
  };
16749
17069
 
@@ -16757,7 +17077,7 @@ ${JSON.stringify({
16757
17077
 
16758
17078
  const protocol = parseProtocol(_config.url);
16759
17079
 
16760
- if (protocol && platform.protocols.indexOf(protocol) === -1) {
17080
+ if (protocol && !platform.protocols.includes(protocol)) {
16761
17081
  reject(
16762
17082
  new AxiosError$1(
16763
17083
  'Unsupported protocol ' + protocol + ':',
@@ -16774,54 +17094,55 @@ ${JSON.stringify({
16774
17094
  };
16775
17095
 
16776
17096
  const composeSignals = (signals, timeout) => {
16777
- const { length } = (signals = signals ? signals.filter(Boolean) : []);
16778
-
16779
- if (timeout || length) {
16780
- let controller = new AbortController();
16781
-
16782
- let aborted;
16783
-
16784
- const onabort = function (reason) {
16785
- if (!aborted) {
16786
- aborted = true;
16787
- unsubscribe();
16788
- const err = reason instanceof Error ? reason : this.reason;
16789
- controller.abort(
16790
- err instanceof AxiosError$1
16791
- ? err
16792
- : new CanceledError$1(err instanceof Error ? err.message : err)
16793
- );
16794
- }
16795
- };
17097
+ signals = signals ? signals.filter(Boolean) : [];
16796
17098
 
16797
- let timer =
16798
- timeout &&
16799
- setTimeout(() => {
16800
- timer = null;
16801
- onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
16802
- }, timeout);
16803
-
16804
- const unsubscribe = () => {
16805
- if (signals) {
16806
- timer && clearTimeout(timer);
16807
- timer = null;
16808
- signals.forEach((signal) => {
16809
- signal.unsubscribe
16810
- ? signal.unsubscribe(onabort)
16811
- : signal.removeEventListener('abort', onabort);
16812
- });
16813
- signals = null;
16814
- }
16815
- };
17099
+ if (!timeout && !signals.length) {
17100
+ return;
17101
+ }
16816
17102
 
16817
- signals.forEach((signal) => signal.addEventListener('abort', onabort));
17103
+ const controller = new AbortController();
16818
17104
 
16819
- const { signal } = controller;
17105
+ let aborted = false;
16820
17106
 
16821
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
17107
+ const onabort = function (reason) {
17108
+ if (!aborted) {
17109
+ aborted = true;
17110
+ unsubscribe();
17111
+ const err = reason instanceof Error ? reason : this.reason;
17112
+ controller.abort(
17113
+ err instanceof AxiosError$1
17114
+ ? err
17115
+ : new CanceledError$1(err instanceof Error ? err.message : err)
17116
+ );
17117
+ }
17118
+ };
16822
17119
 
16823
- return signal;
16824
- }
17120
+ let timer =
17121
+ timeout &&
17122
+ setTimeout(() => {
17123
+ timer = null;
17124
+ onabort(new AxiosError$1(`timeout of ${timeout}ms exceeded`, AxiosError$1.ETIMEDOUT));
17125
+ }, timeout);
17126
+
17127
+ const unsubscribe = () => {
17128
+ if (!signals) { return; }
17129
+ timer && clearTimeout(timer);
17130
+ timer = null;
17131
+ signals.forEach((signal) => {
17132
+ signal.unsubscribe
17133
+ ? signal.unsubscribe(onabort)
17134
+ : signal.removeEventListener('abort', onabort);
17135
+ });
17136
+ signals = null;
17137
+ };
17138
+
17139
+ signals.forEach((signal) => signal.addEventListener('abort', onabort));
17140
+
17141
+ const { signal } = controller;
17142
+
17143
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
17144
+
17145
+ return signal;
16825
17146
  };
16826
17147
 
16827
17148
  const streamChunk = function* (chunk, chunkSize) {
@@ -16914,16 +17235,112 @@ ${JSON.stringify({
16914
17235
  );
16915
17236
  };
16916
17237
 
16917
- const DEFAULT_CHUNK_SIZE = 64 * 1024;
17238
+ /**
17239
+ * Estimate decoded byte length of a data:// URL *without* allocating large buffers.
17240
+ * - For base64: compute exact decoded size using length and padding;
17241
+ * handle %XX at the character-count level (no string allocation).
17242
+ * - For non-base64: use UTF-8 byteLength of the encoded body as a safe upper bound.
17243
+ *
17244
+ * @param {string} url
17245
+ * @returns {number}
17246
+ */
17247
+ function estimateDataURLDecodedBytes(url) {
17248
+ if (!url || typeof url !== 'string') return 0;
17249
+ if (!url.startsWith('data:')) return 0;
17250
+
17251
+ const comma = url.indexOf(',');
17252
+ if (comma < 0) return 0;
17253
+
17254
+ const meta = url.slice(5, comma);
17255
+ const body = url.slice(comma + 1);
17256
+ const isBase64 = /;base64/i.test(meta);
17257
+
17258
+ if (isBase64) {
17259
+ let effectiveLen = body.length;
17260
+ const len = body.length; // cache length
17261
+
17262
+ for (let i = 0; i < len; i++) {
17263
+ if (body.charCodeAt(i) === 37 /* '%' */ && i + 2 < len) {
17264
+ const a = body.charCodeAt(i + 1);
17265
+ const b = body.charCodeAt(i + 2);
17266
+ const isHex =
17267
+ ((a >= 48 && a <= 57) || (a >= 65 && a <= 70) || (a >= 97 && a <= 102)) &&
17268
+ ((b >= 48 && b <= 57) || (b >= 65 && b <= 70) || (b >= 97 && b <= 102));
17269
+
17270
+ if (isHex) {
17271
+ effectiveLen -= 2;
17272
+ i += 2;
17273
+ }
17274
+ }
17275
+ }
16918
17276
 
16919
- const { isFunction } = utils$1;
17277
+ let pad = 0;
17278
+ let idx = len - 1;
17279
+
17280
+ const tailIsPct3D = (j) =>
17281
+ j >= 2 &&
17282
+ body.charCodeAt(j - 2) === 37 && // '%'
17283
+ body.charCodeAt(j - 1) === 51 && // '3'
17284
+ (body.charCodeAt(j) === 68 || body.charCodeAt(j) === 100); // 'D' or 'd'
17285
+
17286
+ if (idx >= 0) {
17287
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
17288
+ pad++;
17289
+ idx--;
17290
+ } else if (tailIsPct3D(idx)) {
17291
+ pad++;
17292
+ idx -= 3;
17293
+ }
17294
+ }
17295
+
17296
+ if (pad === 1 && idx >= 0) {
17297
+ if (body.charCodeAt(idx) === 61 /* '=' */) {
17298
+ pad++;
17299
+ } else if (tailIsPct3D(idx)) {
17300
+ pad++;
17301
+ }
17302
+ }
17303
+
17304
+ const groups = Math.floor(effectiveLen / 4);
17305
+ const bytes = groups * 3 - (pad || 0);
17306
+ return bytes > 0 ? bytes : 0;
17307
+ }
17308
+
17309
+ if (typeof Buffer !== 'undefined' && typeof Buffer.byteLength === 'function') {
17310
+ return Buffer.byteLength(body, 'utf8');
17311
+ }
17312
+
17313
+ // Compute UTF-8 byte length directly from UTF-16 code units without allocating
17314
+ // a byte buffer (TextEncoder.encode would defeat the DoS guard on large bodies).
17315
+ // Using body.length here would undercount non-ASCII (e.g. '€' is 1 code unit
17316
+ // but 3 UTF-8 bytes).
17317
+ let bytes = 0;
17318
+ for (let i = 0, len = body.length; i < len; i++) {
17319
+ const c = body.charCodeAt(i);
17320
+ if (c < 0x80) {
17321
+ bytes += 1;
17322
+ } else if (c < 0x800) {
17323
+ bytes += 2;
17324
+ } else if (c >= 0xd800 && c <= 0xdbff && i + 1 < len) {
17325
+ const next = body.charCodeAt(i + 1);
17326
+ if (next >= 0xdc00 && next <= 0xdfff) {
17327
+ bytes += 4;
17328
+ i++;
17329
+ } else {
17330
+ bytes += 3;
17331
+ }
17332
+ } else {
17333
+ bytes += 3;
17334
+ }
17335
+ }
17336
+ return bytes;
17337
+ }
17338
+
17339
+ const VERSION$1 = "1.16.1";
16920
17340
 
16921
- const globalFetchAPI = (({ Request, Response }) => ({
16922
- Request,
16923
- Response,
16924
- }))(utils$1.global);
17341
+ const DEFAULT_CHUNK_SIZE = 64 * 1024;
16925
17342
 
16926
- const { ReadableStream: ReadableStream$1, TextEncoder } = utils$1.global;
17343
+ const { isFunction } = utils$1;
16927
17344
 
16928
17345
  const test = (fn, ...args) => {
16929
17346
  try {
@@ -16934,11 +17351,20 @@ ${JSON.stringify({
16934
17351
  };
16935
17352
 
16936
17353
  const factory = (env) => {
17354
+ const globalObject =
17355
+ utils$1.global !== undefined && utils$1.global !== null
17356
+ ? utils$1.global
17357
+ : globalThis;
17358
+ const { ReadableStream, TextEncoder } = globalObject;
17359
+
16937
17360
  env = utils$1.merge.call(
16938
17361
  {
16939
17362
  skipUndefined: true,
16940
17363
  },
16941
- globalFetchAPI,
17364
+ {
17365
+ Request: globalObject.Request,
17366
+ Response: globalObject.Response,
17367
+ },
16942
17368
  env
16943
17369
  );
16944
17370
 
@@ -16951,7 +17377,7 @@ ${JSON.stringify({
16951
17377
  return false;
16952
17378
  }
16953
17379
 
16954
- const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream$1);
17380
+ const isReadableStreamSupported = isFetchSupported && isFunction(ReadableStream);
16955
17381
 
16956
17382
  const encodeText =
16957
17383
  isFetchSupported &&
@@ -16969,7 +17395,7 @@ ${JSON.stringify({
16969
17395
  let duplexAccessed = false;
16970
17396
 
16971
17397
  const request = new Request(platform.origin, {
16972
- body: new ReadableStream$1(),
17398
+ body: new ReadableStream(),
16973
17399
  method: 'POST',
16974
17400
  get duplex() {
16975
17401
  duplexAccessed = true;
@@ -17065,8 +17491,13 @@ ${JSON.stringify({
17065
17491
  headers,
17066
17492
  withCredentials = 'same-origin',
17067
17493
  fetchOptions,
17494
+ maxContentLength,
17495
+ maxBodyLength,
17068
17496
  } = resolveConfig(config);
17069
17497
 
17498
+ const hasMaxContentLength = utils$1.isNumber(maxContentLength) && maxContentLength > -1;
17499
+ const hasMaxBodyLength = utils$1.isNumber(maxBodyLength) && maxBodyLength > -1;
17500
+
17070
17501
  let _fetch = envFetch || fetch;
17071
17502
 
17072
17503
  responseType = responseType ? (responseType + '').toLowerCase() : 'text';
@@ -17088,6 +17519,41 @@ ${JSON.stringify({
17088
17519
  let requestContentLength;
17089
17520
 
17090
17521
  try {
17522
+ // Enforce maxContentLength for data: URLs up-front so we never materialize
17523
+ // an oversized payload. The HTTP adapter applies the same check (see http.js
17524
+ // "if (protocol === 'data:')" branch).
17525
+ if (hasMaxContentLength && typeof url === 'string' && url.startsWith('data:')) {
17526
+ const estimated = estimateDataURLDecodedBytes(url);
17527
+ if (estimated > maxContentLength) {
17528
+ throw new AxiosError$1(
17529
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17530
+ AxiosError$1.ERR_BAD_RESPONSE,
17531
+ config,
17532
+ request
17533
+ );
17534
+ }
17535
+ }
17536
+
17537
+ // Enforce maxBodyLength against the outbound request body before dispatch.
17538
+ // Mirrors http.js behavior (ERR_BAD_REQUEST / 'Request body larger than
17539
+ // maxBodyLength limit'). Skip when the body length cannot be determined
17540
+ // (e.g. a live ReadableStream supplied by the caller).
17541
+ if (hasMaxBodyLength && method !== 'get' && method !== 'head') {
17542
+ const outboundLength = await resolveBodyLength(headers, data);
17543
+ if (
17544
+ typeof outboundLength === 'number' &&
17545
+ isFinite(outboundLength) &&
17546
+ outboundLength > maxBodyLength
17547
+ ) {
17548
+ throw new AxiosError$1(
17549
+ 'Request body larger than maxBodyLength limit',
17550
+ AxiosError$1.ERR_BAD_REQUEST,
17551
+ config,
17552
+ request
17553
+ );
17554
+ }
17555
+ }
17556
+
17091
17557
  if (
17092
17558
  onUploadProgress &&
17093
17559
  supportsRequestStream &&
@@ -17138,11 +17604,14 @@ ${JSON.stringify({
17138
17604
  }
17139
17605
  }
17140
17606
 
17607
+ // Set User-Agent header if not already set (fetch defaults to 'node' in Node.js)
17608
+ headers.set('User-Agent', 'axios/' + VERSION$1, false);
17609
+
17141
17610
  const resolvedOptions = {
17142
17611
  ...fetchOptions,
17143
17612
  signal: composedSignal,
17144
17613
  method: method.toUpperCase(),
17145
- headers: headers.normalize().toJSON(),
17614
+ headers: toByteStringHeaderObject(headers.normalize()),
17146
17615
  body: data,
17147
17616
  duplex: 'half',
17148
17617
  credentials: isCredentialsSupported ? withCredentials : undefined,
@@ -17154,10 +17623,28 @@ ${JSON.stringify({
17154
17623
  ? _fetch(request, fetchOptions)
17155
17624
  : _fetch(url, resolvedOptions));
17156
17625
 
17626
+ // Cheap pre-check: if the server honestly declares a content-length that
17627
+ // already exceeds the cap, reject before we start streaming.
17628
+ if (hasMaxContentLength) {
17629
+ const declaredLength = utils$1.toFiniteNumber(response.headers.get('content-length'));
17630
+ if (declaredLength != null && declaredLength > maxContentLength) {
17631
+ throw new AxiosError$1(
17632
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17633
+ AxiosError$1.ERR_BAD_RESPONSE,
17634
+ config,
17635
+ request
17636
+ );
17637
+ }
17638
+ }
17639
+
17157
17640
  const isStreamResponse =
17158
17641
  supportsResponseStream && (responseType === 'stream' || responseType === 'response');
17159
17642
 
17160
- if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {
17643
+ if (
17644
+ supportsResponseStream &&
17645
+ response.body &&
17646
+ (onDownloadProgress || hasMaxContentLength || (isStreamResponse && unsubscribe))
17647
+ ) {
17161
17648
  const options = {};
17162
17649
 
17163
17650
  ['status', 'statusText', 'headers'].forEach((prop) => {
@@ -17174,8 +17661,24 @@ ${JSON.stringify({
17174
17661
  )) ||
17175
17662
  [];
17176
17663
 
17664
+ let bytesRead = 0;
17665
+ const onChunkProgress = (loadedBytes) => {
17666
+ if (hasMaxContentLength) {
17667
+ bytesRead = loadedBytes;
17668
+ if (bytesRead > maxContentLength) {
17669
+ throw new AxiosError$1(
17670
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17671
+ AxiosError$1.ERR_BAD_RESPONSE,
17672
+ config,
17673
+ request
17674
+ );
17675
+ }
17676
+ }
17677
+ onProgress && onProgress(loadedBytes);
17678
+ };
17679
+
17177
17680
  response = new Response(
17178
- trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {
17681
+ trackStream(response.body, DEFAULT_CHUNK_SIZE, onChunkProgress, () => {
17179
17682
  flush && flush();
17180
17683
  unsubscribe && unsubscribe();
17181
17684
  }),
@@ -17190,6 +17693,33 @@ ${JSON.stringify({
17190
17693
  config
17191
17694
  );
17192
17695
 
17696
+ // Fallback enforcement for environments without ReadableStream support
17697
+ // (legacy runtimes). Detect materialized size from typed output; skip
17698
+ // streams/Response passthrough since the user will read those themselves.
17699
+ if (hasMaxContentLength && !supportsResponseStream && !isStreamResponse) {
17700
+ let materializedSize;
17701
+ if (responseData != null) {
17702
+ if (typeof responseData.byteLength === 'number') {
17703
+ materializedSize = responseData.byteLength;
17704
+ } else if (typeof responseData.size === 'number') {
17705
+ materializedSize = responseData.size;
17706
+ } else if (typeof responseData === 'string') {
17707
+ materializedSize =
17708
+ typeof TextEncoder === 'function'
17709
+ ? new TextEncoder().encode(responseData).byteLength
17710
+ : responseData.length;
17711
+ }
17712
+ }
17713
+ if (typeof materializedSize === 'number' && materializedSize > maxContentLength) {
17714
+ throw new AxiosError$1(
17715
+ 'maxContentLength size of ' + maxContentLength + ' exceeded',
17716
+ AxiosError$1.ERR_BAD_RESPONSE,
17717
+ config,
17718
+ request
17719
+ );
17720
+ }
17721
+ }
17722
+
17193
17723
  !isStreamResponse && unsubscribe && unsubscribe();
17194
17724
 
17195
17725
  return await new Promise((resolve, reject) => {
@@ -17205,6 +17735,17 @@ ${JSON.stringify({
17205
17735
  } catch (err) {
17206
17736
  unsubscribe && unsubscribe();
17207
17737
 
17738
+ // Safari can surface fetch aborts as a DOMException-like object whose
17739
+ // branded getters throw. Prefer our composed signal reason before reading
17740
+ // the caught error, preserving timeout vs cancellation semantics.
17741
+ if (composedSignal && composedSignal.aborted && composedSignal.reason instanceof AxiosError$1) {
17742
+ const canceledError = composedSignal.reason;
17743
+ canceledError.config = config;
17744
+ request && (canceledError.request = request);
17745
+ err !== canceledError && (canceledError.cause = err);
17746
+ throw canceledError;
17747
+ }
17748
+
17208
17749
  if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
17209
17750
  throw Object.assign(
17210
17751
  new AxiosError$1(
@@ -17273,11 +17814,13 @@ ${JSON.stringify({
17273
17814
  utils$1.forEach(knownAdapters, (fn, value) => {
17274
17815
  if (fn) {
17275
17816
  try {
17276
- Object.defineProperty(fn, 'name', { value });
17817
+ // Null-proto descriptors so a polluted Object.prototype.get cannot turn
17818
+ // these data descriptors into accessor descriptors on the way in.
17819
+ Object.defineProperty(fn, 'name', { __proto__: null, value });
17277
17820
  } catch (e) {
17278
17821
  // eslint-disable-next-line no-empty
17279
17822
  }
17280
- Object.defineProperty(fn, 'adapterName', { value });
17823
+ Object.defineProperty(fn, 'adapterName', { __proto__: null, value });
17281
17824
  }
17282
17825
  });
17283
17826
 
@@ -17419,8 +17962,15 @@ ${JSON.stringify({
17419
17962
  function onAdapterResolution(response) {
17420
17963
  throwIfCancellationRequested(config);
17421
17964
 
17422
- // Transform response data
17423
- response.data = transformData.call(config, config.transformResponse, response);
17965
+ // Expose the current response on config so that transformResponse can
17966
+ // attach it to any AxiosError it throws (e.g. on JSON parse failure).
17967
+ // We clean it up afterwards to avoid polluting the config object.
17968
+ config.response = response;
17969
+ try {
17970
+ response.data = transformData.call(config, config.transformResponse, response);
17971
+ } finally {
17972
+ delete config.response;
17973
+ }
17424
17974
 
17425
17975
  response.headers = AxiosHeaders$1.from(response.headers);
17426
17976
 
@@ -17432,11 +17982,16 @@ ${JSON.stringify({
17432
17982
 
17433
17983
  // Transform response data
17434
17984
  if (reason && reason.response) {
17435
- reason.response.data = transformData.call(
17436
- config,
17437
- config.transformResponse,
17438
- reason.response
17439
- );
17985
+ config.response = reason.response;
17986
+ try {
17987
+ reason.response.data = transformData.call(
17988
+ config,
17989
+ config.transformResponse,
17990
+ reason.response
17991
+ );
17992
+ } finally {
17993
+ delete config.response;
17994
+ }
17440
17995
  reason.response.headers = AxiosHeaders$1.from(reason.response.headers);
17441
17996
  }
17442
17997
  }
@@ -17446,8 +18001,6 @@ ${JSON.stringify({
17446
18001
  );
17447
18002
  }
17448
18003
 
17449
- const VERSION$1 = "1.15.2";
17450
-
17451
18004
  const validators$1 = {};
17452
18005
 
17453
18006
  // eslint-disable-next-line func-names
@@ -17532,7 +18085,7 @@ ${JSON.stringify({
17532
18085
  while (i-- > 0) {
17533
18086
  const opt = keys[i];
17534
18087
  // Use hasOwnProperty so a polluted Object.prototype.<opt> cannot supply
17535
- // a non-function validator and cause a TypeError. See GHSA-q8qp-cvcw-x6jj.
18088
+ // a non-function validator and cause a TypeError.
17536
18089
  const validator = Object.prototype.hasOwnProperty.call(schema, opt) ? schema[opt] : undefined;
17537
18090
  if (validator) {
17538
18091
  const value = options[opt];
@@ -17692,7 +18245,7 @@ ${JSON.stringify({
17692
18245
  let contextHeaders = headers && utils$1.merge(headers.common, headers[config.method]);
17693
18246
 
17694
18247
  headers &&
17695
- utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], (method) => {
18248
+ utils$1.forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'query', 'common'], (method) => {
17696
18249
  delete headers[method];
17697
18250
  });
17698
18251
 
@@ -17795,7 +18348,7 @@ ${JSON.stringify({
17795
18348
  };
17796
18349
  });
17797
18350
 
17798
- utils$1.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
18351
+ utils$1.forEach(['post', 'put', 'patch', 'query'], function forEachMethodWithData(method) {
17799
18352
  function generateHTTPMethod(isForm) {
17800
18353
  return function httpMethod(url, data, config) {
17801
18354
  return this.request(
@@ -17815,7 +18368,11 @@ ${JSON.stringify({
17815
18368
 
17816
18369
  Axios$1.prototype[method] = generateHTTPMethod();
17817
18370
 
17818
- Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
18371
+ // QUERY is a safe/idempotent read method; multipart form bodies don't fit
18372
+ // its semantics, so no queryForm shorthand is generated.
18373
+ if (method !== 'query') {
18374
+ Axios$1.prototype[method + 'Form'] = generateHTTPMethod(true);
18375
+ }
17819
18376
  });
17820
18377
 
17821
18378
  /**
@@ -18149,6 +18706,7 @@ ${JSON.stringify({
18149
18706
  formToJSON,
18150
18707
  getAdapter,
18151
18708
  mergeConfig,
18709
+ create,
18152
18710
  } = axios;
18153
18711
 
18154
18712
  var __defProp$P = Object.defineProperty;
@@ -18191,6 +18749,12 @@ ${JSON.stringify({
18191
18749
  _authActions;
18192
18750
  _requestIdGenerator;
18193
18751
  _restrictionManager;
18752
+ /**
18753
+ * In-flight token refresh, shared so concurrent 401s coalesce into a single
18754
+ * `refreshAuth()` round-trip — avoids OAuth refresh-token reuse errors when a
18755
+ * burst of requests expires together. (#182)
18756
+ */
18757
+ _pendingRefresh = null;
18194
18758
  _logger;
18195
18759
  _isClientSideWarning = false;
18196
18760
  _clientSideWarningMessage = "";
@@ -18208,7 +18772,7 @@ ${JSON.stringify({
18208
18772
  this._logger = LoggerFactory.createNullLogger();
18209
18773
  const defaultHeaders = {};
18210
18774
  if (this.isServerSide()) {
18211
- defaultHeaders["User-Agent"] = "b24-js-sdk/1.1.2";
18775
+ defaultHeaders["User-Agent"] = "b24-js-sdk/1.3.0";
18212
18776
  }
18213
18777
  this._authActions = authActions;
18214
18778
  this._requestIdGenerator = new RequestIdGenerator();
@@ -18459,10 +19023,27 @@ ${JSON.stringify({
18459
19023
  let authData = this._authActions.getAuthData();
18460
19024
  if (authData === false) {
18461
19025
  this._logRefreshingAuthToken(requestId);
18462
- authData = await this._authActions.refreshAuth();
19026
+ authData = await this._refreshAuth();
18463
19027
  }
18464
19028
  return authData;
18465
19029
  }
19030
+ /**
19031
+ * Refresh the auth token, coalescing concurrent callers onto a single
19032
+ * in-flight `refreshAuth()` so a burst of 401s triggers exactly one refresh
19033
+ * round-trip. The slot clears once the refresh settles. (#182)
19034
+ */
19035
+ _refreshAuth() {
19036
+ if (this._pendingRefresh) {
19037
+ return this._pendingRefresh;
19038
+ }
19039
+ const refresh = this._authActions.refreshAuth();
19040
+ this._pendingRefresh = refresh;
19041
+ refresh.finally(() => {
19042
+ this._pendingRefresh = null;
19043
+ }).catch(() => {
19044
+ });
19045
+ return refresh;
19046
+ }
18466
19047
  // Execute the request with 401 error handling
18467
19048
  async _makeRequestWithAuthRetry(requestId, method, params, authData) {
18468
19049
  try {
@@ -18481,14 +19062,15 @@ ${JSON.stringify({
18481
19062
  }
18482
19063
  );
18483
19064
  }
18484
- if (this._isAuthError(error)) {
19065
+ const ajaxError = this._convertToAjaxError(requestId, error, method, params);
19066
+ if (this._isAuthError(ajaxError)) {
18485
19067
  this._logAuthErrorDetected(requestId);
18486
19068
  this._logRefreshingAuthToken(requestId);
18487
- const refreshedAuthData = await this._authActions.refreshAuth();
19069
+ const refreshedAuthData = await this._refreshAuth();
18488
19070
  await this._restrictionManager.checkRateLimit(requestId, method);
18489
19071
  return await this._makeAxiosRequest(requestId, method, params, refreshedAuthData);
18490
19072
  }
18491
- throw error;
19073
+ throw ajaxError;
18492
19074
  }
18493
19075
  }
18494
19076
  async _makeAxiosRequest(requestId, method, params, authData) {
@@ -19456,7 +20038,7 @@ ${JSON.stringify({
19456
20038
  }
19457
20039
  const queryParams = new URLSearchParams({
19458
20040
  [this._requestIdGenerator.getQueryStringParameterName()]: requestId,
19459
- [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.1.2",
20041
+ [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.3.0",
19460
20042
  [this._requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
19461
20043
  });
19462
20044
  return `${baseUrl}${methodUrl}?${queryParams.toString()}`;
@@ -19710,7 +20292,7 @@ ${JSON.stringify({
19710
20292
  const methodUrl = `/${encodeURIComponent(method)}`;
19711
20293
  const queryParams = new URLSearchParams({
19712
20294
  [this._requestIdGenerator.getQueryStringParameterName()]: requestId,
19713
- [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.1.2",
20295
+ [this._requestIdGenerator.getQueryStringSdkParameterName()]: "1.3.0",
19714
20296
  [this._requestIdGenerator.getQueryStringSdkTypeParameterName()]: "b24-js-sdk"
19715
20297
  });
19716
20298
  return `${baseUrl}${methodUrl}?${queryParams.toString()}`;
@@ -21202,7 +21784,11 @@ ${JSON.stringify({
21202
21784
  });
21203
21785
  }
21204
21786
  /**
21205
- * Set Page Title
21787
+ * Sets the in-layout page title (the `#pagetitle` element the portal renders around the app).
21788
+ *
21789
+ * Does NOT change the browser tab title (`document.title`): the portal applies this command to
21790
+ * `#pagetitle`, never to the tab. To set the browser tab title, open the view as a slider via
21791
+ * `SliderManager.openSliderAppPage` with a `bx24_title` option.
21206
21792
  *
21207
21793
  * @param {string} title
21208
21794
  *
@@ -21519,6 +22105,10 @@ ${JSON.stringify({
21519
22105
  /**
21520
22106
  * When the method is called, a pop-up window with the application frame will be opened.
21521
22107
  *
22108
+ * Settings are passed via `bx24_`-prefixed keys (e.g. `bx24_title`, `bx24_width`).
22109
+ * `bx24_title` sets the slider title; the portal also reflects it to the browser tab title
22110
+ * (`document.title`) — unlike `ParentManager.setTitle`, which only updates the in-layout `#pagetitle`.
22111
+ *
21522
22112
  * @link https://apidocs.bitrix24.com/sdk/bx24-js-sdk/additional-functions/bx24-open-application.html
21523
22113
  */
21524
22114
  async openSliderAppPage(params = {}) {
@@ -23263,7 +23853,7 @@ ${JSON.stringify({
23263
23853
  var protobuf = $require(entries[0]);
23264
23854
  if (module && module.exports)
23265
23855
  module.exports = protobuf;
23266
- }), "prelude"))({ 1: [function(require2, module2, exports$1) {
23856
+ }), "prelude"))({ 1: [function(require2, module2, exports) {
23267
23857
  module2.exports = asPromise;
23268
23858
  function asPromise(fn, ctx) {
23269
23859
  var params = new Array(arguments.length - 1), offset = 0, index = 2, pending = true;
@@ -23294,8 +23884,8 @@ ${JSON.stringify({
23294
23884
  }, "executor"));
23295
23885
  }
23296
23886
  __name(asPromise, "asPromise");
23297
- }, {}], 2: [function(require2, module2, exports$1) {
23298
- var base64 = exports$1;
23887
+ }, {}], 2: [function(require2, module2, exports) {
23888
+ var base64 = exports;
23299
23889
  base64.length = /* @__PURE__ */ __name(function length(string) {
23300
23890
  var p = string.length;
23301
23891
  if (!p)
@@ -23387,7 +23977,7 @@ ${JSON.stringify({
23387
23977
  base64.test = /* @__PURE__ */ __name(function test(string) {
23388
23978
  return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);
23389
23979
  }, "test");
23390
- }, {}], 3: [function(require2, module2, exports$1) {
23980
+ }, {}], 3: [function(require2, module2, exports) {
23391
23981
  module2.exports = codegen;
23392
23982
  function codegen(functionParams, functionName) {
23393
23983
  if (typeof functionParams === "string") {
@@ -23446,7 +24036,7 @@ ${JSON.stringify({
23446
24036
  }
23447
24037
  __name(codegen, "codegen");
23448
24038
  codegen.verbose = false;
23449
- }, {}], 4: [function(require2, module2, exports$1) {
24039
+ }, {}], 4: [function(require2, module2, exports) {
23450
24040
  module2.exports = EventEmitter;
23451
24041
  function EventEmitter() {
23452
24042
  this._listeners = {};
@@ -23487,7 +24077,7 @@ ${JSON.stringify({
23487
24077
  }
23488
24078
  return this;
23489
24079
  }, "emit");
23490
- }, {}], 5: [function(require2, module2, exports$1) {
24080
+ }, {}], 5: [function(require2, module2, exports) {
23491
24081
  module2.exports = fetch;
23492
24082
  var asPromise = require2(1), inquire = require2(7);
23493
24083
  var fs = inquire("fs");
@@ -23532,7 +24122,7 @@ ${JSON.stringify({
23532
24122
  xhr.open("GET", filename);
23533
24123
  xhr.send();
23534
24124
  }, "fetch_xhr");
23535
- }, { "1": 1, "7": 7 }], 6: [function(require2, module2, exports$1) {
24125
+ }, { "1": 1, "7": 7 }], 6: [function(require2, module2, exports) {
23536
24126
  module2.exports = factory(factory);
23537
24127
  function factory(exports2) {
23538
24128
  if (typeof Float32Array !== "undefined") (function() {
@@ -23737,7 +24327,7 @@ ${JSON.stringify({
23737
24327
  return (buf[pos] << 24 | buf[pos + 1] << 16 | buf[pos + 2] << 8 | buf[pos + 3]) >>> 0;
23738
24328
  }
23739
24329
  __name(readUintBE, "readUintBE");
23740
- }, {}], 7: [function(require2, module2, exports$1) {
24330
+ }, {}], 7: [function(require2, module2, exports) {
23741
24331
  module2.exports = inquire;
23742
24332
  function inquire(moduleName) {
23743
24333
  try {
@@ -23749,8 +24339,8 @@ ${JSON.stringify({
23749
24339
  return null;
23750
24340
  }
23751
24341
  __name(inquire, "inquire");
23752
- }, {}], 8: [function(require2, module2, exports$1) {
23753
- var path = exports$1;
24342
+ }, {}], 8: [function(require2, module2, exports) {
24343
+ var path = exports;
23754
24344
  var isAbsolute = (
23755
24345
  /**
23756
24346
  * Tests if the specified path is absolute.
@@ -23797,7 +24387,7 @@ ${JSON.stringify({
23797
24387
  originPath = normalize(originPath);
23798
24388
  return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
23799
24389
  }, "resolve");
23800
- }, {}], 9: [function(require2, module2, exports$1) {
24390
+ }, {}], 9: [function(require2, module2, exports) {
23801
24391
  module2.exports = pool;
23802
24392
  function pool(alloc, slice, size) {
23803
24393
  var SIZE = size || 8192;
@@ -23818,8 +24408,8 @@ ${JSON.stringify({
23818
24408
  }, "pool_alloc");
23819
24409
  }
23820
24410
  __name(pool, "pool");
23821
- }, {}], 10: [function(require2, module2, exports$1) {
23822
- var utf8 = exports$1;
24411
+ }, {}], 10: [function(require2, module2, exports) {
24412
+ var utf8 = exports;
23823
24413
  utf8.length = /* @__PURE__ */ __name(function utf8_length(string) {
23824
24414
  var len = 0, c = 0;
23825
24415
  for (var i = 0; i < string.length; ++i) {
@@ -23889,7 +24479,7 @@ ${JSON.stringify({
23889
24479
  }
23890
24480
  return offset - start;
23891
24481
  }, "utf8_write");
23892
- }, {}], 11: [function(require2, module2, exports$1) {
24482
+ }, {}], 11: [function(require2, module2, exports) {
23893
24483
  module2.exports = common;
23894
24484
  var commonRe = /\/|\./;
23895
24485
  function common(name, json) {
@@ -24216,8 +24806,8 @@ ${JSON.stringify({
24216
24806
  common.get = /* @__PURE__ */ __name(function get(file) {
24217
24807
  return common[file] || null;
24218
24808
  }, "get");
24219
- }, {}], 12: [function(require2, module2, exports$1) {
24220
- var converter = exports$1;
24809
+ }, {}], 12: [function(require2, module2, exports) {
24810
+ var converter = exports;
24221
24811
  var Enum = require2(15), util = require2(37);
24222
24812
  function genValuePartial_fromObject(gen, field, fieldIndex, prop) {
24223
24813
  if (field.resolvedType) {
@@ -24408,7 +24998,7 @@ ${JSON.stringify({
24408
24998
  }
24409
24999
  return gen("return d");
24410
25000
  }, "toObject");
24411
- }, { "15": 15, "37": 37 }], 13: [function(require2, module2, exports$1) {
25001
+ }, { "15": 15, "37": 37 }], 13: [function(require2, module2, exports) {
24412
25002
  module2.exports = decoder;
24413
25003
  var Enum = require2(15), types = require2(36), util = require2(37);
24414
25004
  function missing(field) {
@@ -24452,7 +25042,7 @@ ${JSON.stringify({
24452
25042
  return gen("return m");
24453
25043
  }
24454
25044
  __name(decoder, "decoder");
24455
- }, { "15": 15, "36": 36, "37": 37 }], 14: [function(require2, module2, exports$1) {
25045
+ }, { "15": 15, "36": 36, "37": 37 }], 14: [function(require2, module2, exports) {
24456
25046
  module2.exports = encoder;
24457
25047
  var Enum = require2(15), types = require2(36), util = require2(37);
24458
25048
  function genTypePartial(gen, field, fieldIndex, ref) {
@@ -24495,7 +25085,7 @@ ${JSON.stringify({
24495
25085
  return gen("return w");
24496
25086
  }
24497
25087
  __name(encoder, "encoder");
24498
- }, { "15": 15, "36": 36, "37": 37 }], 15: [function(require2, module2, exports$1) {
25088
+ }, { "15": 15, "36": 36, "37": 37 }], 15: [function(require2, module2, exports) {
24499
25089
  module2.exports = Enum;
24500
25090
  var ReflectionObject = require2(24);
24501
25091
  ((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = "Enum";
@@ -24573,7 +25163,7 @@ ${JSON.stringify({
24573
25163
  Enum.prototype.isReservedName = /* @__PURE__ */ __name(function isReservedName(name) {
24574
25164
  return Namespace.isReservedName(this.reserved, name);
24575
25165
  }, "isReservedName");
24576
- }, { "23": 23, "24": 24, "37": 37 }], 16: [function(require2, module2, exports$1) {
25166
+ }, { "23": 23, "24": 24, "37": 37 }], 16: [function(require2, module2, exports) {
24577
25167
  module2.exports = Field;
24578
25168
  var ReflectionObject = require2(24);
24579
25169
  ((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = "Field";
@@ -24710,7 +25300,7 @@ ${JSON.stringify({
24710
25300
  Field._configure = /* @__PURE__ */ __name(function configure(Type_) {
24711
25301
  Type = Type_;
24712
25302
  }, "configure");
24713
- }, { "15": 15, "24": 24, "36": 36, "37": 37 }], 17: [function(require2, module2, exports$1) {
25303
+ }, { "15": 15, "24": 24, "36": 36, "37": 37 }], 17: [function(require2, module2, exports) {
24714
25304
  var protobuf = module2.exports = require2(18);
24715
25305
  protobuf.build = "light";
24716
25306
  function load(filename, root, callback) {
@@ -24752,8 +25342,8 @@ ${JSON.stringify({
24752
25342
  protobuf.Namespace._configure(protobuf.Type, protobuf.Service);
24753
25343
  protobuf.Root._configure(protobuf.Type);
24754
25344
  protobuf.Field._configure(protobuf.Type);
24755
- }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "18": 18, "20": 20, "21": 21, "22": 22, "23": 23, "24": 24, "25": 25, "29": 29, "33": 33, "35": 35, "36": 36, "37": 37, "40": 40, "41": 41 }], 18: [function(require2, module2, exports$1) {
24756
- var protobuf = exports$1;
25345
+ }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "18": 18, "20": 20, "21": 21, "22": 22, "23": 23, "24": 24, "25": 25, "29": 29, "33": 33, "35": 35, "36": 36, "37": 37, "40": 40, "41": 41 }], 18: [function(require2, module2, exports) {
25346
+ var protobuf = exports;
24757
25347
  protobuf.build = "minimal";
24758
25348
  protobuf.Writer = require2(42);
24759
25349
  protobuf.BufferWriter = require2(43);
@@ -24770,14 +25360,14 @@ ${JSON.stringify({
24770
25360
  __name(configure, "configure");
24771
25361
  protobuf.Writer._configure(protobuf.BufferWriter);
24772
25362
  configure();
24773
- }, { "27": 27, "28": 28, "30": 30, "31": 31, "39": 39, "42": 42, "43": 43 }], 19: [function(require2, module2, exports$1) {
25363
+ }, { "27": 27, "28": 28, "30": 30, "31": 31, "39": 39, "42": 42, "43": 43 }], 19: [function(require2, module2, exports) {
24774
25364
  var protobuf = module2.exports = require2(17);
24775
25365
  protobuf.build = "full";
24776
25366
  protobuf.tokenize = require2(34);
24777
25367
  protobuf.parse = require2(26);
24778
25368
  protobuf.common = require2(11);
24779
25369
  protobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);
24780
- }, { "11": 11, "17": 17, "26": 26, "34": 34 }], 20: [function(require2, module2, exports$1) {
25370
+ }, { "11": 11, "17": 17, "26": 26, "34": 34 }], 20: [function(require2, module2, exports) {
24781
25371
  module2.exports = MapField;
24782
25372
  var Field = require2(16);
24783
25373
  ((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = "MapField";
@@ -24827,7 +25417,7 @@ ${JSON.stringify({
24827
25417
  util.decorateType(prototype.constructor).add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));
24828
25418
  }, "mapFieldDecorator");
24829
25419
  }, "decorateMapField");
24830
- }, { "16": 16, "36": 36, "37": 37 }], 21: [function(require2, module2, exports$1) {
25420
+ }, { "16": 16, "36": 36, "37": 37 }], 21: [function(require2, module2, exports) {
24831
25421
  module2.exports = Message;
24832
25422
  var util = require2(39);
24833
25423
  function Message(properties) {
@@ -24863,7 +25453,7 @@ ${JSON.stringify({
24863
25453
  Message.prototype.toJSON = /* @__PURE__ */ __name(function toJSON() {
24864
25454
  return this.$type.toObject(this, util.toJSONOptions);
24865
25455
  }, "toJSON");
24866
- }, { "39": 39 }], 22: [function(require2, module2, exports$1) {
25456
+ }, { "39": 39 }], 22: [function(require2, module2, exports) {
24867
25457
  module2.exports = Method;
24868
25458
  var ReflectionObject = require2(24);
24869
25459
  ((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = "Method";
@@ -24923,7 +25513,7 @@ ${JSON.stringify({
24923
25513
  this.resolvedResponseType = this.parent.lookupType(this.responseType);
24924
25514
  return ReflectionObject.prototype.resolve.call(this);
24925
25515
  }, "resolve");
24926
- }, { "24": 24, "37": 37 }], 23: [function(require2, module2, exports$1) {
25516
+ }, { "24": 24, "37": 37 }], 23: [function(require2, module2, exports) {
24927
25517
  module2.exports = Namespace;
24928
25518
  var ReflectionObject = require2(24);
24929
25519
  ((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = "Namespace";
@@ -25125,7 +25715,7 @@ ${JSON.stringify({
25125
25715
  Type = Type_;
25126
25716
  Service = Service_;
25127
25717
  };
25128
- }, { "15": 15, "16": 16, "24": 24, "37": 37 }], 24: [function(require2, module2, exports$1) {
25718
+ }, { "15": 15, "16": 16, "24": 24, "37": 37 }], 24: [function(require2, module2, exports) {
25129
25719
  module2.exports = ReflectionObject;
25130
25720
  ReflectionObject.className = "ReflectionObject";
25131
25721
  var util = require2(37);
@@ -25227,7 +25817,7 @@ ${JSON.stringify({
25227
25817
  ReflectionObject._configure = function(Root_) {
25228
25818
  Root = Root_;
25229
25819
  };
25230
- }, { "37": 37 }], 25: [function(require2, module2, exports$1) {
25820
+ }, { "37": 37 }], 25: [function(require2, module2, exports) {
25231
25821
  module2.exports = OneOf;
25232
25822
  var ReflectionObject = require2(24);
25233
25823
  ((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = "OneOf";
@@ -25321,7 +25911,7 @@ ${JSON.stringify({
25321
25911
  });
25322
25912
  }, "oneOfDecorator");
25323
25913
  }, "decorateOneOf");
25324
- }, { "16": 16, "24": 24, "37": 37 }], 26: [function(require2, module2, exports$1) {
25914
+ }, { "16": 16, "24": 24, "37": 37 }], 26: [function(require2, module2, exports) {
25325
25915
  module2.exports = parse;
25326
25916
  parse.filename = null;
25327
25917
  parse.defaults = { keepCase: false };
@@ -25870,7 +26460,7 @@ ${JSON.stringify({
25870
26460
  };
25871
26461
  }
25872
26462
  __name(parse, "parse");
25873
- }, { "15": 15, "16": 16, "20": 20, "22": 22, "25": 25, "29": 29, "33": 33, "34": 34, "35": 35, "36": 36, "37": 37 }], 27: [function(require2, module2, exports$1) {
26463
+ }, { "15": 15, "16": 16, "20": 20, "22": 22, "25": 25, "29": 29, "33": 33, "34": 34, "35": 35, "36": 36, "37": 37 }], 27: [function(require2, module2, exports) {
25874
26464
  module2.exports = Reader;
25875
26465
  var util = require2(39);
25876
26466
  var BufferReader;
@@ -26085,7 +26675,7 @@ ${JSON.stringify({
26085
26675
  }, "read_sfixed64")
26086
26676
  });
26087
26677
  };
26088
- }, { "39": 39 }], 28: [function(require2, module2, exports$1) {
26678
+ }, { "39": 39 }], 28: [function(require2, module2, exports) {
26089
26679
  module2.exports = BufferReader;
26090
26680
  var Reader = require2(27);
26091
26681
  (BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;
@@ -26100,7 +26690,7 @@ ${JSON.stringify({
26100
26690
  var len = this.uint32();
26101
26691
  return this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len));
26102
26692
  }, "read_string_buffer");
26103
- }, { "27": 27, "39": 39 }], 29: [function(require2, module2, exports$1) {
26693
+ }, { "27": 27, "39": 39 }], 29: [function(require2, module2, exports) {
26104
26694
  module2.exports = Root;
26105
26695
  var Namespace = require2(23);
26106
26696
  ((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = "Root";
@@ -26317,12 +26907,12 @@ ${JSON.stringify({
26317
26907
  parse = parse_;
26318
26908
  common = common_;
26319
26909
  };
26320
- }, { "15": 15, "16": 16, "23": 23, "25": 25, "37": 37 }], 30: [function(require2, module2, exports$1) {
26910
+ }, { "15": 15, "16": 16, "23": 23, "25": 25, "37": 37 }], 30: [function(require2, module2, exports) {
26321
26911
  module2.exports = {};
26322
- }, {}], 31: [function(require2, module2, exports$1) {
26323
- var rpc = exports$1;
26912
+ }, {}], 31: [function(require2, module2, exports) {
26913
+ var rpc = exports;
26324
26914
  rpc.Service = require2(32);
26325
- }, { "32": 32 }], 32: [function(require2, module2, exports$1) {
26915
+ }, { "32": 32 }], 32: [function(require2, module2, exports) {
26326
26916
  module2.exports = Service;
26327
26917
  var util = require2(39);
26328
26918
  (Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;
@@ -26392,7 +26982,7 @@ ${JSON.stringify({
26392
26982
  }
26393
26983
  return this;
26394
26984
  }, "end");
26395
- }, { "39": 39 }], 33: [function(require2, module2, exports$1) {
26985
+ }, { "39": 39 }], 33: [function(require2, module2, exports) {
26396
26986
  module2.exports = Service;
26397
26987
  var Namespace = require2(23);
26398
26988
  ((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = "Service";
@@ -26480,7 +27070,7 @@ ${JSON.stringify({
26480
27070
  }
26481
27071
  return rpcService;
26482
27072
  }, "create");
26483
- }, { "22": 22, "23": 23, "31": 31, "37": 37 }], 34: [function(require2, module2, exports$1) {
27073
+ }, { "22": 22, "23": 23, "31": 31, "37": 37 }], 34: [function(require2, module2, exports) {
26484
27074
  module2.exports = tokenize;
26485
27075
  var delimRe = /[\s{}=;:[\],'"()<>]/g, stringDoubleRe = /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g, stringSingleRe = /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g;
26486
27076
  var setCommentRe = /^ *[*/]+ */, setCommentAltRe = /^\s*\*?\/*/, setCommentSplitRe = /\n/g, whitespaceRe = /\s/, unescapeRe = /\\(.?)/g;
@@ -26711,7 +27301,7 @@ ${JSON.stringify({
26711
27301
  });
26712
27302
  }
26713
27303
  __name(tokenize, "tokenize");
26714
- }, {}], 35: [function(require2, module2, exports$1) {
27304
+ }, {}], 35: [function(require2, module2, exports) {
26715
27305
  module2.exports = Type;
26716
27306
  var Namespace = require2(23);
26717
27307
  ((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = "Type";
@@ -27011,8 +27601,8 @@ ${JSON.stringify({
27011
27601
  util.decorateType(target, typeName);
27012
27602
  }, "typeDecorator");
27013
27603
  }, "decorateType");
27014
- }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "20": 20, "21": 21, "23": 23, "25": 25, "27": 27, "33": 33, "37": 37, "40": 40, "41": 41, "42": 42 }], 36: [function(require2, module2, exports$1) {
27015
- var types = exports$1;
27604
+ }, { "12": 12, "13": 13, "14": 14, "15": 15, "16": 16, "20": 20, "21": 21, "23": 23, "25": 25, "27": 27, "33": 33, "37": 37, "40": 40, "41": 41, "42": 42 }], 36: [function(require2, module2, exports) {
27605
+ var types = exports;
27016
27606
  var util = require2(37);
27017
27607
  var s = [
27018
27608
  "double",
@@ -27185,7 +27775,7 @@ ${JSON.stringify({
27185
27775
  /* bool */
27186
27776
  0
27187
27777
  ]);
27188
- }, { "37": 37 }], 37: [function(require2, module2, exports$1) {
27778
+ }, { "37": 37 }], 37: [function(require2, module2, exports) {
27189
27779
  var util = module2.exports = require2(39);
27190
27780
  var roots = require2(30);
27191
27781
  var Type, Enum;
@@ -27266,7 +27856,7 @@ ${JSON.stringify({
27266
27856
  return roots["decorated"] || (roots["decorated"] = new (require2(29))());
27267
27857
  }, "get")
27268
27858
  });
27269
- }, { "15": 15, "29": 29, "3": 3, "30": 30, "35": 35, "39": 39, "5": 5, "8": 8 }], 38: [function(require2, module2, exports$1) {
27859
+ }, { "15": 15, "29": 29, "3": 3, "30": 30, "35": 35, "39": 39, "5": 5, "8": 8 }], 38: [function(require2, module2, exports) {
27270
27860
  module2.exports = LongBits;
27271
27861
  var util = require2(39);
27272
27862
  function LongBits(lo, hi) {
@@ -27363,8 +27953,8 @@ ${JSON.stringify({
27363
27953
  var part0 = this.lo, part1 = (this.lo >>> 28 | this.hi << 4) >>> 0, part2 = this.hi >>> 24;
27364
27954
  return part2 === 0 ? part1 === 0 ? part0 < 16384 ? part0 < 128 ? 1 : 2 : part0 < 2097152 ? 3 : 4 : part1 < 16384 ? part1 < 128 ? 5 : 6 : part1 < 2097152 ? 7 : 8 : part2 < 128 ? 9 : 10;
27365
27955
  }, "length");
27366
- }, { "39": 39 }], 39: [function(require2, module2, exports$1) {
27367
- var util = exports$1;
27956
+ }, { "39": 39 }], 39: [function(require2, module2, exports) {
27957
+ var util = exports;
27368
27958
  util.asPromise = require2(1);
27369
27959
  util.base64 = require2(2);
27370
27960
  util.EventEmitter = require2(4);
@@ -27512,7 +28102,7 @@ ${JSON.stringify({
27512
28102
  return new Buffer2(size);
27513
28103
  }, "Buffer_allocUnsafe");
27514
28104
  };
27515
- }, { "1": 1, "10": 10, "2": 2, "38": 38, "4": 4, "6": 6, "7": 7, "9": 9 }], 40: [function(require2, module2, exports$1) {
28105
+ }, { "1": 1, "10": 10, "2": 2, "38": 38, "4": 4, "6": 6, "7": 7, "9": 9 }], 40: [function(require2, module2, exports) {
27516
28106
  module2.exports = verifier;
27517
28107
  var Enum = require2(15), util = require2(37);
27518
28108
  function invalid(field, expected) {
@@ -27614,8 +28204,8 @@ ${JSON.stringify({
27614
28204
  return gen("return null");
27615
28205
  }
27616
28206
  __name(verifier, "verifier");
27617
- }, { "15": 15, "37": 37 }], 41: [function(require2, module2, exports$1) {
27618
- var wrappers = exports$1;
28207
+ }, { "15": 15, "37": 37 }], 41: [function(require2, module2, exports) {
28208
+ var wrappers = exports;
27619
28209
  var Message = require2(21);
27620
28210
  wrappers[".google.protobuf.Any"] = {
27621
28211
  fromObject: /* @__PURE__ */ __name(function(object) {
@@ -27646,7 +28236,7 @@ ${JSON.stringify({
27646
28236
  return this.toObject(message, options);
27647
28237
  }, "toObject")
27648
28238
  };
27649
- }, { "21": 21 }], 42: [function(require2, module2, exports$1) {
28239
+ }, { "21": 21 }], 42: [function(require2, module2, exports) {
27650
28240
  module2.exports = Writer;
27651
28241
  var util = require2(39);
27652
28242
  var BufferWriter;
@@ -27833,7 +28423,7 @@ ${JSON.stringify({
27833
28423
  Writer._configure = function(BufferWriter_) {
27834
28424
  BufferWriter = BufferWriter_;
27835
28425
  };
27836
- }, { "39": 39 }], 43: [function(require2, module2, exports$1) {
28426
+ }, { "39": 39 }], 43: [function(require2, module2, exports) {
27837
28427
  module2.exports = BufferWriter;
27838
28428
  var Writer = require2(42);
27839
28429
  (BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;