daytona-wildberries-typescript-sdk 4.0.1 → 4.2.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 (262) hide show
  1. package/README.md +22 -6
  2. package/dist/cjs/index.cjs +21 -26
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/cjs/modules/analytics/index.cjs +2 -0
  5. package/dist/cjs/modules/analytics/index.cjs.map +1 -0
  6. package/dist/cjs/modules/communications/index.cjs +2 -0
  7. package/dist/cjs/modules/communications/index.cjs.map +1 -0
  8. package/dist/cjs/modules/finances/index.cjs +2 -0
  9. package/dist/cjs/modules/finances/index.cjs.map +1 -0
  10. package/dist/cjs/modules/reports/index.cjs +2 -0
  11. package/dist/cjs/modules/reports/index.cjs.map +1 -0
  12. package/dist/esm/client/base-client.d.ts.map +1 -0
  13. package/dist/esm/client/index.d.ts.map +1 -0
  14. package/dist/esm/client/rate-limiter.d.ts.map +1 -0
  15. package/dist/esm/client/retry-handler.d.ts.map +1 -0
  16. package/dist/esm/config/1_0_0-rate-limits.d.ts.map +1 -0
  17. package/dist/esm/config/analytics-rate-limits.d.ts.map +1 -0
  18. package/dist/esm/config/communications-rate-limits.d.ts.map +1 -0
  19. package/dist/esm/config/finances-rate-limits.d.ts.map +1 -0
  20. package/dist/esm/config/general-rate-limits.d.ts.map +1 -0
  21. package/dist/esm/config/in-store-pickup-rate-limits.d.ts.map +1 -0
  22. package/dist/esm/config/index.d.ts.map +1 -0
  23. package/dist/esm/config/operation-metadata.d.ts.map +1 -0
  24. package/dist/esm/config/orders-dbs-rate-limits.d.ts.map +1 -0
  25. package/dist/esm/config/orders-fbs-rate-limits.d.ts.map +1 -0
  26. package/dist/esm/config/orders-fbw-rate-limits.d.ts.map +1 -0
  27. package/dist/esm/config/products-rate-limits.d.ts.map +1 -0
  28. package/dist/esm/config/promotion-rate-limits.d.ts.map +1 -0
  29. package/dist/esm/config/rate-limits.d.ts.map +1 -0
  30. package/dist/esm/config/reports-rate-limits.d.ts.map +1 -0
  31. package/dist/esm/config/sdk-config.d.ts.map +1 -0
  32. package/dist/esm/config/tariffs-rate-limits.d.ts.map +1 -0
  33. package/dist/esm/config/user-management-rate-limits.d.ts.map +1 -0
  34. package/dist/esm/errors/auth-error.d.ts.map +1 -0
  35. package/dist/esm/errors/base-error.d.ts.map +1 -0
  36. package/dist/esm/errors/bid-out-of-range-error.d.ts.map +1 -0
  37. package/dist/esm/errors/in-store-pickup-errors.d.ts.map +1 -0
  38. package/dist/esm/errors/index.d.ts.map +1 -0
  39. package/dist/esm/errors/meta-validation-fail-error.d.ts.map +1 -0
  40. package/dist/esm/errors/network-error.d.ts.map +1 -0
  41. package/dist/esm/errors/promotion-errors.d.ts.map +1 -0
  42. package/dist/esm/errors/rate-limit-error.d.ts.map +1 -0
  43. package/dist/esm/errors/validation-error.d.ts.map +1 -0
  44. package/dist/esm/errors/warehouse-stocks-update-block-error.d.ts.map +1 -0
  45. package/dist/esm/{src/index.d.ts → index.d.ts} +2 -2
  46. package/dist/esm/index.d.ts.map +1 -0
  47. package/dist/esm/index.js +2280 -3990
  48. package/dist/esm/index.js.map +1 -1
  49. package/dist/esm/modules/1_0_0/index.d.ts.map +1 -0
  50. package/dist/esm/{src/modules → modules}/analytics/index.d.ts +35 -3
  51. package/dist/esm/modules/analytics/index.d.ts.map +1 -0
  52. package/dist/esm/modules/analytics/index.js +587 -0
  53. package/dist/esm/modules/analytics/index.js.map +1 -0
  54. package/dist/esm/modules/communications/index.d.ts.map +1 -0
  55. package/dist/esm/modules/communications/index.js +6 -0
  56. package/dist/esm/modules/communications/index.js.map +1 -0
  57. package/dist/esm/modules/finances/index.d.ts.map +1 -0
  58. package/dist/esm/modules/finances/index.js +385 -0
  59. package/dist/esm/modules/finances/index.js.map +1 -0
  60. package/dist/esm/modules/general/index.d.ts.map +1 -0
  61. package/dist/esm/modules/in-store-pickup/index.d.ts.map +1 -0
  62. package/dist/esm/modules/index.d.ts.map +1 -0
  63. package/dist/esm/modules/orders-dbs/index.d.ts.map +1 -0
  64. package/dist/esm/{src/modules → modules}/orders-fbs/index.d.ts +21 -0
  65. package/dist/esm/modules/orders-fbs/index.d.ts.map +1 -0
  66. package/dist/esm/modules/orders-fbw/index.d.ts.map +1 -0
  67. package/dist/esm/modules/products/index.d.ts.map +1 -0
  68. package/dist/esm/modules/promotion/index.d.ts.map +1 -0
  69. package/dist/esm/{src/modules → modules}/reports/index.d.ts +3 -0
  70. package/dist/esm/modules/reports/index.d.ts.map +1 -0
  71. package/dist/esm/modules/reports/index.js +564 -0
  72. package/dist/esm/modules/reports/index.js.map +1 -0
  73. package/dist/esm/modules/returns/index.d.ts.map +1 -0
  74. package/dist/esm/modules/tariffs/index.d.ts.map +1 -0
  75. package/dist/esm/modules/user-management/index.d.ts.map +1 -0
  76. package/dist/esm/{src/types → types}/analytics.types.d.ts +89 -0
  77. package/dist/esm/types/analytics.types.d.ts.map +1 -0
  78. package/dist/esm/{src/types → types}/communications.types.d.ts +3 -3
  79. package/dist/esm/types/communications.types.d.ts.map +1 -0
  80. package/dist/esm/types/finances.types.d.ts.map +1 -0
  81. package/dist/esm/types/general.types.d.ts.map +1 -0
  82. package/dist/esm/types/in-store-pickup.types.d.ts.map +1 -0
  83. package/dist/esm/types/orders-dbs.types.d.ts.map +1 -0
  84. package/dist/esm/types/orders-fbs.types.d.ts.map +1 -0
  85. package/dist/esm/types/orders-fbw.types.d.ts.map +1 -0
  86. package/dist/esm/types/products.types.d.ts.map +1 -0
  87. package/dist/esm/types/promotion.types.d.ts.map +1 -0
  88. package/dist/esm/{src/types → types}/reports.types.d.ts +10 -9
  89. package/dist/esm/types/reports.types.d.ts.map +1 -0
  90. package/dist/esm/types/returns.types.d.ts.map +1 -0
  91. package/dist/esm/types/tariffs.types.d.ts.map +1 -0
  92. package/dist/esm/types/user-management.types.d.ts.map +1 -0
  93. package/dist/esm/utils/bid-validation.d.ts.map +1 -0
  94. package/dist/esm/utils/calculateSupplyCost.d.ts.map +1 -0
  95. package/dist/esm/utils/classifyFbsReturnCategory.d.ts.map +1 -0
  96. package/dist/esm/utils/classifyReturnReason.d.ts.map +1 -0
  97. package/dist/esm/utils/compareTariffs.d.ts.map +1 -0
  98. package/dist/esm/utils/deprecation.d.ts.map +1 -0
  99. package/dist/esm/utils/enrichReturnsWithType.d.ts.map +1 -0
  100. package/dist/esm/{src/utils → utils}/index.d.ts +1 -0
  101. package/dist/esm/utils/index.d.ts.map +1 -0
  102. package/dist/esm/utils/parseMetaValidationFail.d.ts.map +1 -0
  103. package/dist/esm/utils/parseMoneyAmount.d.ts.map +1 -0
  104. package/dist/esm/utils/reconcileAcceptanceDelta.d.ts +82 -0
  105. package/dist/esm/utils/reconcileAcceptanceDelta.d.ts.map +1 -0
  106. package/dist/esm/utils/reconcileBuyoutsAndReturns.d.ts.map +1 -0
  107. package/dist/esm/utils/roas.d.ts.map +1 -0
  108. package/dist/esm/utils/validateMergedCardVariants.d.ts.map +1 -0
  109. package/dist/esm/utils/validateRequiredCharacteristics.d.ts.map +1 -0
  110. package/dist/index-BJPymceu.cjs +10 -0
  111. package/dist/index-BJPymceu.cjs.map +1 -0
  112. package/dist/index-BT3QDNa0.js +849 -0
  113. package/dist/index-BT3QDNa0.js.map +1 -0
  114. package/package.json +22 -18
  115. package/dist/esm/src/client/base-client.d.ts.map +0 -1
  116. package/dist/esm/src/client/index.d.ts.map +0 -1
  117. package/dist/esm/src/client/rate-limiter.d.ts.map +0 -1
  118. package/dist/esm/src/client/retry-handler.d.ts.map +0 -1
  119. package/dist/esm/src/config/1_0_0-rate-limits.d.ts.map +0 -1
  120. package/dist/esm/src/config/analytics-rate-limits.d.ts.map +0 -1
  121. package/dist/esm/src/config/communications-rate-limits.d.ts.map +0 -1
  122. package/dist/esm/src/config/finances-rate-limits.d.ts.map +0 -1
  123. package/dist/esm/src/config/general-rate-limits.d.ts.map +0 -1
  124. package/dist/esm/src/config/in-store-pickup-rate-limits.d.ts.map +0 -1
  125. package/dist/esm/src/config/index.d.ts.map +0 -1
  126. package/dist/esm/src/config/operation-metadata.d.ts.map +0 -1
  127. package/dist/esm/src/config/orders-dbs-rate-limits.d.ts.map +0 -1
  128. package/dist/esm/src/config/orders-fbs-rate-limits.d.ts.map +0 -1
  129. package/dist/esm/src/config/orders-fbw-rate-limits.d.ts.map +0 -1
  130. package/dist/esm/src/config/products-rate-limits.d.ts.map +0 -1
  131. package/dist/esm/src/config/promotion-rate-limits.d.ts.map +0 -1
  132. package/dist/esm/src/config/rate-limits.d.ts.map +0 -1
  133. package/dist/esm/src/config/reports-rate-limits.d.ts.map +0 -1
  134. package/dist/esm/src/config/sdk-config.d.ts.map +0 -1
  135. package/dist/esm/src/config/tariffs-rate-limits.d.ts.map +0 -1
  136. package/dist/esm/src/config/user-management-rate-limits.d.ts.map +0 -1
  137. package/dist/esm/src/errors/auth-error.d.ts.map +0 -1
  138. package/dist/esm/src/errors/base-error.d.ts.map +0 -1
  139. package/dist/esm/src/errors/bid-out-of-range-error.d.ts.map +0 -1
  140. package/dist/esm/src/errors/in-store-pickup-errors.d.ts.map +0 -1
  141. package/dist/esm/src/errors/index.d.ts.map +0 -1
  142. package/dist/esm/src/errors/meta-validation-fail-error.d.ts.map +0 -1
  143. package/dist/esm/src/errors/network-error.d.ts.map +0 -1
  144. package/dist/esm/src/errors/promotion-errors.d.ts.map +0 -1
  145. package/dist/esm/src/errors/rate-limit-error.d.ts.map +0 -1
  146. package/dist/esm/src/errors/validation-error.d.ts.map +0 -1
  147. package/dist/esm/src/errors/warehouse-stocks-update-block-error.d.ts.map +0 -1
  148. package/dist/esm/src/index.d.ts.map +0 -1
  149. package/dist/esm/src/modules/1_0_0/index.d.ts.map +0 -1
  150. package/dist/esm/src/modules/analytics/index.d.ts.map +0 -1
  151. package/dist/esm/src/modules/communications/index.d.ts.map +0 -1
  152. package/dist/esm/src/modules/finances/index.d.ts.map +0 -1
  153. package/dist/esm/src/modules/general/index.d.ts.map +0 -1
  154. package/dist/esm/src/modules/in-store-pickup/index.d.ts.map +0 -1
  155. package/dist/esm/src/modules/index.d.ts.map +0 -1
  156. package/dist/esm/src/modules/orders-dbs/index.d.ts.map +0 -1
  157. package/dist/esm/src/modules/orders-fbs/index.d.ts.map +0 -1
  158. package/dist/esm/src/modules/orders-fbw/index.d.ts.map +0 -1
  159. package/dist/esm/src/modules/products/index.d.ts.map +0 -1
  160. package/dist/esm/src/modules/promotion/index.d.ts.map +0 -1
  161. package/dist/esm/src/modules/reports/index.d.ts.map +0 -1
  162. package/dist/esm/src/modules/returns/index.d.ts.map +0 -1
  163. package/dist/esm/src/modules/tariffs/index.d.ts.map +0 -1
  164. package/dist/esm/src/modules/user-management/index.d.ts.map +0 -1
  165. package/dist/esm/src/types/analytics.types.d.ts.map +0 -1
  166. package/dist/esm/src/types/communications.types.d.ts.map +0 -1
  167. package/dist/esm/src/types/finances.types.d.ts.map +0 -1
  168. package/dist/esm/src/types/general.types.d.ts.map +0 -1
  169. package/dist/esm/src/types/in-store-pickup.types.d.ts.map +0 -1
  170. package/dist/esm/src/types/orders-dbs.types.d.ts.map +0 -1
  171. package/dist/esm/src/types/orders-fbs.types.d.ts.map +0 -1
  172. package/dist/esm/src/types/orders-fbw.types.d.ts.map +0 -1
  173. package/dist/esm/src/types/products.types.d.ts.map +0 -1
  174. package/dist/esm/src/types/promotion.types.d.ts.map +0 -1
  175. package/dist/esm/src/types/reports.types.d.ts.map +0 -1
  176. package/dist/esm/src/types/returns.types.d.ts.map +0 -1
  177. package/dist/esm/src/types/tariffs.types.d.ts.map +0 -1
  178. package/dist/esm/src/types/user-management.types.d.ts.map +0 -1
  179. package/dist/esm/src/utils/bid-validation.d.ts.map +0 -1
  180. package/dist/esm/src/utils/calculateSupplyCost.d.ts.map +0 -1
  181. package/dist/esm/src/utils/classifyFbsReturnCategory.d.ts.map +0 -1
  182. package/dist/esm/src/utils/classifyReturnReason.d.ts.map +0 -1
  183. package/dist/esm/src/utils/compareTariffs.d.ts.map +0 -1
  184. package/dist/esm/src/utils/deprecation.d.ts.map +0 -1
  185. package/dist/esm/src/utils/enrichReturnsWithType.d.ts.map +0 -1
  186. package/dist/esm/src/utils/index.d.ts.map +0 -1
  187. package/dist/esm/src/utils/parseMetaValidationFail.d.ts.map +0 -1
  188. package/dist/esm/src/utils/parseMoneyAmount.d.ts.map +0 -1
  189. package/dist/esm/src/utils/reconcileBuyoutsAndReturns.d.ts.map +0 -1
  190. package/dist/esm/src/utils/roas.d.ts.map +0 -1
  191. package/dist/esm/src/utils/validateMergedCardVariants.d.ts.map +0 -1
  192. package/dist/esm/src/utils/validateRequiredCharacteristics.d.ts.map +0 -1
  193. /package/dist/esm/{src/client → client}/base-client.d.ts +0 -0
  194. /package/dist/esm/{src/client → client}/index.d.ts +0 -0
  195. /package/dist/esm/{src/client → client}/rate-limiter.d.ts +0 -0
  196. /package/dist/esm/{src/client → client}/retry-handler.d.ts +0 -0
  197. /package/dist/esm/{src/config → config}/1_0_0-rate-limits.d.ts +0 -0
  198. /package/dist/esm/{src/config → config}/analytics-rate-limits.d.ts +0 -0
  199. /package/dist/esm/{src/config → config}/communications-rate-limits.d.ts +0 -0
  200. /package/dist/esm/{src/config → config}/finances-rate-limits.d.ts +0 -0
  201. /package/dist/esm/{src/config → config}/general-rate-limits.d.ts +0 -0
  202. /package/dist/esm/{src/config → config}/in-store-pickup-rate-limits.d.ts +0 -0
  203. /package/dist/esm/{src/config → config}/index.d.ts +0 -0
  204. /package/dist/esm/{src/config → config}/operation-metadata.d.ts +0 -0
  205. /package/dist/esm/{src/config → config}/orders-dbs-rate-limits.d.ts +0 -0
  206. /package/dist/esm/{src/config → config}/orders-fbs-rate-limits.d.ts +0 -0
  207. /package/dist/esm/{src/config → config}/orders-fbw-rate-limits.d.ts +0 -0
  208. /package/dist/esm/{src/config → config}/products-rate-limits.d.ts +0 -0
  209. /package/dist/esm/{src/config → config}/promotion-rate-limits.d.ts +0 -0
  210. /package/dist/esm/{src/config → config}/rate-limits.d.ts +0 -0
  211. /package/dist/esm/{src/config → config}/reports-rate-limits.d.ts +0 -0
  212. /package/dist/esm/{src/config → config}/sdk-config.d.ts +0 -0
  213. /package/dist/esm/{src/config → config}/tariffs-rate-limits.d.ts +0 -0
  214. /package/dist/esm/{src/config → config}/user-management-rate-limits.d.ts +0 -0
  215. /package/dist/esm/{src/errors → errors}/auth-error.d.ts +0 -0
  216. /package/dist/esm/{src/errors → errors}/base-error.d.ts +0 -0
  217. /package/dist/esm/{src/errors → errors}/bid-out-of-range-error.d.ts +0 -0
  218. /package/dist/esm/{src/errors → errors}/in-store-pickup-errors.d.ts +0 -0
  219. /package/dist/esm/{src/errors → errors}/index.d.ts +0 -0
  220. /package/dist/esm/{src/errors → errors}/meta-validation-fail-error.d.ts +0 -0
  221. /package/dist/esm/{src/errors → errors}/network-error.d.ts +0 -0
  222. /package/dist/esm/{src/errors → errors}/promotion-errors.d.ts +0 -0
  223. /package/dist/esm/{src/errors → errors}/rate-limit-error.d.ts +0 -0
  224. /package/dist/esm/{src/errors → errors}/validation-error.d.ts +0 -0
  225. /package/dist/esm/{src/errors → errors}/warehouse-stocks-update-block-error.d.ts +0 -0
  226. /package/dist/esm/{src/modules → modules}/1_0_0/index.d.ts +0 -0
  227. /package/dist/esm/{src/modules → modules}/communications/index.d.ts +0 -0
  228. /package/dist/esm/{src/modules → modules}/finances/index.d.ts +0 -0
  229. /package/dist/esm/{src/modules → modules}/general/index.d.ts +0 -0
  230. /package/dist/esm/{src/modules → modules}/in-store-pickup/index.d.ts +0 -0
  231. /package/dist/esm/{src/modules → modules}/index.d.ts +0 -0
  232. /package/dist/esm/{src/modules → modules}/orders-dbs/index.d.ts +0 -0
  233. /package/dist/esm/{src/modules → modules}/orders-fbw/index.d.ts +0 -0
  234. /package/dist/esm/{src/modules → modules}/products/index.d.ts +0 -0
  235. /package/dist/esm/{src/modules → modules}/promotion/index.d.ts +0 -0
  236. /package/dist/esm/{src/modules → modules}/returns/index.d.ts +0 -0
  237. /package/dist/esm/{src/modules → modules}/tariffs/index.d.ts +0 -0
  238. /package/dist/esm/{src/modules → modules}/user-management/index.d.ts +0 -0
  239. /package/dist/esm/{src/types → types}/finances.types.d.ts +0 -0
  240. /package/dist/esm/{src/types → types}/general.types.d.ts +0 -0
  241. /package/dist/esm/{src/types → types}/in-store-pickup.types.d.ts +0 -0
  242. /package/dist/esm/{src/types → types}/orders-dbs.types.d.ts +0 -0
  243. /package/dist/esm/{src/types → types}/orders-fbs.types.d.ts +0 -0
  244. /package/dist/esm/{src/types → types}/orders-fbw.types.d.ts +0 -0
  245. /package/dist/esm/{src/types → types}/products.types.d.ts +0 -0
  246. /package/dist/esm/{src/types → types}/promotion.types.d.ts +0 -0
  247. /package/dist/esm/{src/types → types}/returns.types.d.ts +0 -0
  248. /package/dist/esm/{src/types → types}/tariffs.types.d.ts +0 -0
  249. /package/dist/esm/{src/types → types}/user-management.types.d.ts +0 -0
  250. /package/dist/esm/{src/utils → utils}/bid-validation.d.ts +0 -0
  251. /package/dist/esm/{src/utils → utils}/calculateSupplyCost.d.ts +0 -0
  252. /package/dist/esm/{src/utils → utils}/classifyFbsReturnCategory.d.ts +0 -0
  253. /package/dist/esm/{src/utils → utils}/classifyReturnReason.d.ts +0 -0
  254. /package/dist/esm/{src/utils → utils}/compareTariffs.d.ts +0 -0
  255. /package/dist/esm/{src/utils → utils}/deprecation.d.ts +0 -0
  256. /package/dist/esm/{src/utils → utils}/enrichReturnsWithType.d.ts +0 -0
  257. /package/dist/esm/{src/utils → utils}/parseMetaValidationFail.d.ts +0 -0
  258. /package/dist/esm/{src/utils → utils}/parseMoneyAmount.d.ts +0 -0
  259. /package/dist/esm/{src/utils → utils}/reconcileBuyoutsAndReturns.d.ts +0 -0
  260. /package/dist/esm/{src/utils → utils}/roas.d.ts +0 -0
  261. /package/dist/esm/{src/utils → utils}/validateMergedCardVariants.d.ts +0 -0
  262. /package/dist/esm/{src/utils → utils}/validateRequiredCharacteristics.d.ts +0 -0
@@ -1,25 +1,20 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const br="4.0.1",vr={version:br};function lt(r,e){return function(){return r.apply(e,arguments)}}const{toString:Sr}=Object.prototype,{getPrototypeOf:Oe}=Object,{iterator:me,toStringTag:dt}=Symbol,ye=(r=>e=>{const t=Sr.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),O=r=>(r=r.toLowerCase(),e=>ye(e)===r),fe=r=>e=>typeof e===r,{isArray:J}=Array,z=fe("undefined");function Z(r){return r!==null&&!z(r)&&r.constructor!==null&&!z(r.constructor)&&q(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const pt=O("ArrayBuffer");function Lr(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&pt(r.buffer),e}const wr=fe("string"),q=fe("function"),mt=fe("number"),ee=r=>r!==null&&typeof r=="object",kr=r=>r===!0||r===!1,ce=r=>{if(ye(r)!=="object")return!1;const e=Oe(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(dt in r)&&!(me in r)},Mr=r=>{if(!ee(r)||Z(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Pr=O("Date"),Cr=O("File"),Kr=O("Blob"),qr=O("FileList"),Br=r=>ee(r)&&q(r.pipe),Rr=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||q(r.append)&&((e=ye(r))==="formdata"||e==="object"&&q(r.toString)&&r.toString()==="[object FormData]"))},Ar=O("URLSearchParams"),[Tr,Or,Er,Dr]=["ReadableStream","Request","Response","Headers"].map(O),Ir=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function te(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let s,i;if(typeof r!="object"&&(r=[r]),J(r))for(s=0,i=r.length;s<i;s++)e.call(null,r[s],s,r);else{if(Z(r))return;const a=t?Object.getOwnPropertyNames(r):Object.keys(r),n=a.length;let o;for(s=0;s<n;s++)o=a[s],e.call(null,r[o],o,r)}}function yt(r,e){if(Z(r))return null;e=e.toLowerCase();const t=Object.keys(r);let s=t.length,i;for(;s-- >0;)if(i=t[s],e===i.toLowerCase())return i;return null}const j=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ft=r=>!z(r)&&r!==j;function Ce(){const{caseless:r,skipUndefined:e}=ft(this)&&this||{},t={},s=(i,a)=>{const n=r&&yt(t,a)||a;ce(t[n])&&ce(i)?t[n]=Ce(t[n],i):ce(i)?t[n]=Ce({},i):J(i)?t[n]=i.slice():(!e||!z(i))&&(t[n]=i)};for(let i=0,a=arguments.length;i<a;i++)arguments[i]&&te(arguments[i],s);return t}const Fr=(r,e,t,{allOwnKeys:s}={})=>(te(e,(i,a)=>{t&&q(i)?r[a]=lt(i,t):r[a]=i},{allOwnKeys:s}),r),Nr=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),xr=(r,e,t,s)=>{r.prototype=Object.create(e.prototype,s),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},Ur=(r,e,t,s)=>{let i,a,n;const o={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),a=i.length;a-- >0;)n=i[a],(!s||s(n,r,e))&&!o[n]&&(e[n]=r[n],o[n]=!0);r=t!==!1&&Oe(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},_r=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const s=r.indexOf(e,t);return s!==-1&&s===t},$r=r=>{if(!r)return null;if(J(r))return r;let e=r.length;if(!mt(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},jr=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&Oe(Uint8Array)),Wr=(r,e)=>{const s=(r&&r[me]).call(r);let i;for(;(i=s.next())&&!i.done;){const a=i.value;e.call(r,a[0],a[1])}},Gr=(r,e)=>{let t;const s=[];for(;(t=r.exec(e))!==null;)s.push(t);return s},Hr=O("HTMLFormElement"),Vr=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,i){return s.toUpperCase()+i}),Ge=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),zr=O("RegExp"),ht=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),s={};te(t,(i,a)=>{let n;(n=e(i,a,r))!==!1&&(s[a]=n||i)}),Object.defineProperties(r,s)},Jr=r=>{ht(r,(e,t)=>{if(q(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const s=r[t];if(q(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Xr=(r,e)=>{const t={},s=i=>{i.forEach(a=>{t[a]=!0})};return J(r)?s(r):s(String(r).split(e)),t},Qr=()=>{},Yr=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function Zr(r){return!!(r&&q(r.append)&&r[dt]==="FormData"&&r[me])}const es=r=>{const e=new Array(10),t=(s,i)=>{if(ee(s)){if(e.indexOf(s)>=0)return;if(Z(s))return s;if(!("toJSON"in s)){e[i]=s;const a=J(s)?[]:{};return te(s,(n,o)=>{const u=t(n,i+1);!z(u)&&(a[o]=u)}),e[i]=void 0,a}}return s};return t(r,0)},ts=O("AsyncFunction"),rs=r=>r&&(ee(r)||q(r))&&q(r.then)&&q(r.catch),gt=((r,e)=>r?setImmediate:e?((t,s)=>(j.addEventListener("message",({source:i,data:a})=>{i===j&&a===t&&s.length&&s.shift()()},!1),i=>{s.push(i),j.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",q(j.postMessage)),ss=typeof queueMicrotask<"u"?queueMicrotask.bind(j):typeof process<"u"&&process.nextTick||gt,is=r=>r!=null&&q(r[me]),c={isArray:J,isArrayBuffer:pt,isBuffer:Z,isFormData:Rr,isArrayBufferView:Lr,isString:wr,isNumber:mt,isBoolean:kr,isObject:ee,isPlainObject:ce,isEmptyObject:Mr,isReadableStream:Tr,isRequest:Or,isResponse:Er,isHeaders:Dr,isUndefined:z,isDate:Pr,isFile:Cr,isBlob:Kr,isRegExp:zr,isFunction:q,isStream:Br,isURLSearchParams:Ar,isTypedArray:jr,isFileList:qr,forEach:te,merge:Ce,extend:Fr,trim:Ir,stripBOM:Nr,inherits:xr,toFlatObject:Ur,kindOf:ye,kindOfTest:O,endsWith:_r,toArray:$r,forEachEntry:Wr,matchAll:Gr,isHTMLForm:Hr,hasOwnProperty:Ge,hasOwnProp:Ge,reduceDescriptors:ht,freezeMethods:Jr,toObjectSet:Xr,toCamelCase:Vr,noop:Qr,toFiniteNumber:Yr,findKey:yt,global:j,isContextDefined:ft,isSpecCompliantForm:Zr,toJSONObject:es,isAsyncFn:ts,isThenable:rs,setImmediate:gt,asap:ss,isIterable:is};function v(r,e,t,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),i&&(this.response=i,this.status=i.status?i.status:null)}c.inherits(v,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const bt=v.prototype,vt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{vt[r]={value:r}});Object.defineProperties(v,vt);Object.defineProperty(bt,"isAxiosError",{value:!0});v.from=(r,e,t,s,i,a)=>{const n=Object.create(bt);c.toFlatObject(r,n,function(d){return d!==Error.prototype},l=>l!=="isAxiosError");const o=r&&r.message?r.message:"Error",u=e==null&&r?r.code:e;return v.call(n,o,u,t,s,i),r&&n.cause==null&&Object.defineProperty(n,"cause",{value:r,configurable:!0}),n.name=r&&r.name||"Error",a&&Object.assign(n,a),n};const as=null;function Ke(r){return c.isPlainObject(r)||c.isArray(r)}function St(r){return c.endsWith(r,"[]")?r.slice(0,-2):r}function He(r,e,t){return r?r.concat(e).map(function(i,a){return i=St(i),!t&&a?"["+i+"]":i}).join(t?".":""):e}function ns(r){return c.isArray(r)&&!r.some(Ke)}const os=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function he(r,e,t){if(!c.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=c.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(f,h){return!c.isUndefined(h[f])});const s=t.metaTokens,i=t.visitor||d,a=t.dots,n=t.indexes,u=(t.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(i))throw new TypeError("visitor must be a function");function l(p){if(p===null)return"";if(c.isDate(p))return p.toISOString();if(c.isBoolean(p))return p.toString();if(!u&&c.isBlob(p))throw new v("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(p)||c.isTypedArray(p)?u&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,f,h){let S=p;if(p&&!h&&typeof p=="object"){if(c.endsWith(f,"{}"))f=s?f:f.slice(0,-2),p=JSON.stringify(p);else if(c.isArray(p)&&ns(p)||(c.isFileList(p)||c.endsWith(f,"[]"))&&(S=c.toArray(p)))return f=St(f),S.forEach(function(w,K){!(c.isUndefined(w)||w===null)&&e.append(n===!0?He([f],K,a):n===null?f:f+"[]",l(w))}),!1}return Ke(p)?!0:(e.append(He(h,f,a),l(p)),!1)}const y=[],m=Object.assign(os,{defaultVisitor:d,convertValue:l,isVisitable:Ke});function b(p,f){if(!c.isUndefined(p)){if(y.indexOf(p)!==-1)throw Error("Circular reference detected in "+f.join("."));y.push(p),c.forEach(p,function(S,L){(!(c.isUndefined(S)||S===null)&&i.call(e,S,c.isString(L)?L.trim():L,f,m))===!0&&b(S,f?f.concat(L):[L])}),y.pop()}}if(!c.isObject(r))throw new TypeError("data must be an object");return b(r),e}function Ve(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function Ee(r,e){this._pairs=[],r&&he(r,this,e)}const Lt=Ee.prototype;Lt.append=function(e,t){this._pairs.push([e,t])};Lt.toString=function(e){const t=e?function(s){return e.call(this,s,Ve)}:Ve;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function cs(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function wt(r,e,t){if(!e)return r;const s=t&&t.encode||cs;c.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let a;if(i?a=i(e,t):a=c.isURLSearchParams(e)?e.toString():new Ee(e,t).toString(s),a){const n=r.indexOf("#");n!==-1&&(r=r.slice(0,n)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}class ze{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(s){s!==null&&e(s)})}}const kt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},us=typeof URLSearchParams<"u"?URLSearchParams:Ee,ls=typeof FormData<"u"?FormData:null,ds=typeof Blob<"u"?Blob:null,ps={isBrowser:!0,classes:{URLSearchParams:us,FormData:ls,Blob:ds},protocols:["http","https","file","blob","url","data"]},De=typeof window<"u"&&typeof document<"u",qe=typeof navigator=="object"&&navigator||void 0,ms=De&&(!qe||["ReactNative","NativeScript","NS"].indexOf(qe.product)<0),ys=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",fs=De&&window.location.href||"http://localhost",hs=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:De,hasStandardBrowserEnv:ms,hasStandardBrowserWebWorkerEnv:ys,navigator:qe,origin:fs},Symbol.toStringTag,{value:"Module"})),P={...hs,...ps};function gs(r,e){return he(r,new P.classes.URLSearchParams,{visitor:function(t,s,i,a){return P.isNode&&c.isBuffer(t)?(this.append(s,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...e})}function bs(r){return c.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function vs(r){const e={},t=Object.keys(r);let s;const i=t.length;let a;for(s=0;s<i;s++)a=t[s],e[a]=r[a];return e}function Mt(r){function e(t,s,i,a){let n=t[a++];if(n==="__proto__")return!0;const o=Number.isFinite(+n),u=a>=t.length;return n=!n&&c.isArray(i)?i.length:n,u?(c.hasOwnProp(i,n)?i[n]=[i[n],s]:i[n]=s,!o):((!i[n]||!c.isObject(i[n]))&&(i[n]=[]),e(t,s,i[n],a)&&c.isArray(i[n])&&(i[n]=vs(i[n])),!o)}if(c.isFormData(r)&&c.isFunction(r.entries)){const t={};return c.forEachEntry(r,(s,i)=>{e(bs(s),i,t,0)}),t}return null}function Ss(r,e,t){if(c.isString(r))try{return(e||JSON.parse)(r),c.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}const re={transitional:kt,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",i=s.indexOf("application/json")>-1,a=c.isObject(e);if(a&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return i?JSON.stringify(Mt(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(s.indexOf("application/x-www-form-urlencoded")>-1)return gs(e,this.formSerializer).toString();if((o=c.isFileList(e))||s.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return he(o?{"files[]":e}:e,u&&new u,this.formSerializer)}}return a||i?(t.setContentType("application/json",!1),Ss(e)):e}],transformResponse:[function(e){const t=this.transitional||re.transitional,s=t&&t.forcedJSONParsing,i=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(s&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(o){if(n)throw o.name==="SyntaxError"?v.from(o,v.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:P.classes.FormData,Blob:P.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],r=>{re.headers[r]={}});const Ls=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ws=r=>{const e={};let t,s,i;return r&&r.split(`
2
- `).forEach(function(n){i=n.indexOf(":"),t=n.substring(0,i).trim().toLowerCase(),s=n.substring(i+1).trim(),!(!t||e[t]&&Ls[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e},Je=Symbol("internals");function Y(r){return r&&String(r).trim().toLowerCase()}function ue(r){return r===!1||r==null?r:c.isArray(r)?r.map(ue):String(r)}function ks(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(r);)e[s[1]]=s[2];return e}const Ms=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function ke(r,e,t,s,i){if(c.isFunction(s))return s.call(this,e,t);if(i&&(e=t),!!c.isString(e)){if(c.isString(s))return e.indexOf(s)!==-1;if(c.isRegExp(s))return s.test(e)}}function Ps(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function Cs(r,e){const t=c.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(r,s+t,{value:function(i,a,n){return this[s].call(this,e,i,a,n)},configurable:!0})})}let B=class{constructor(e){e&&this.set(e)}set(e,t,s){const i=this;function a(o,u,l){const d=Y(u);if(!d)throw new Error("header name must be a non-empty string");const y=c.findKey(i,d);(!y||i[y]===void 0||l===!0||l===void 0&&i[y]!==!1)&&(i[y||u]=ue(o))}const n=(o,u)=>c.forEach(o,(l,d)=>a(l,d,u));if(c.isPlainObject(e)||e instanceof this.constructor)n(e,t);else if(c.isString(e)&&(e=e.trim())&&!Ms(e))n(ws(e),t);else if(c.isObject(e)&&c.isIterable(e)){let o={},u,l;for(const d of e){if(!c.isArray(d))throw TypeError("Object iterator must return a key-value pair");o[l=d[0]]=(u=o[l])?c.isArray(u)?[...u,d[1]]:[u,d[1]]:d[1]}n(o,t)}else e!=null&&a(t,e,s);return this}get(e,t){if(e=Y(e),e){const s=c.findKey(this,e);if(s){const i=this[s];if(!t)return i;if(t===!0)return ks(i);if(c.isFunction(t))return t.call(this,i,s);if(c.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Y(e),e){const s=c.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||ke(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let i=!1;function a(n){if(n=Y(n),n){const o=c.findKey(s,n);o&&(!t||ke(s,s[o],o,t))&&(delete s[o],i=!0)}}return c.isArray(e)?e.forEach(a):a(e),i}clear(e){const t=Object.keys(this);let s=t.length,i=!1;for(;s--;){const a=t[s];(!e||ke(this,this[a],a,e,!0))&&(delete this[a],i=!0)}return i}normalize(e){const t=this,s={};return c.forEach(this,(i,a)=>{const n=c.findKey(s,a);if(n){t[n]=ue(i),delete t[a];return}const o=e?Ps(a):String(a).trim();o!==a&&delete t[a],t[o]=ue(i),s[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return c.forEach(this,(s,i)=>{s!=null&&s!==!1&&(t[i]=e&&c.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
3
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(i=>s.set(i)),s}static accessor(e){const s=(this[Je]=this[Je]={accessors:{}}).accessors,i=this.prototype;function a(n){const o=Y(n);s[o]||(Cs(i,n),s[o]=!0)}return c.isArray(e)?e.forEach(a):a(e),this}};B.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(B.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(s){this[t]=s}}});c.freezeMethods(B);function Me(r,e){const t=this||re,s=e||t,i=B.from(s.headers);let a=s.data;return c.forEach(r,function(o){a=o.call(t,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function Pt(r){return!!(r&&r.__CANCEL__)}function X(r,e,t){v.call(this,r??"canceled",v.ERR_CANCELED,e,t),this.name="CanceledError"}c.inherits(X,v,{__CANCEL__:!0});function Ct(r,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?r(t):e(new v("Request failed with status code "+t.status,[v.ERR_BAD_REQUEST,v.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Ks(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function qs(r,e){r=r||10;const t=new Array(r),s=new Array(r);let i=0,a=0,n;return e=e!==void 0?e:1e3,function(u){const l=Date.now(),d=s[a];n||(n=l),t[i]=u,s[i]=l;let y=a,m=0;for(;y!==i;)m+=t[y++],y=y%r;if(i=(i+1)%r,i===a&&(a=(a+1)%r),l-n<e)return;const b=d&&l-d;return b?Math.round(m*1e3/b):void 0}}function Bs(r,e){let t=0,s=1e3/e,i,a;const n=(l,d=Date.now())=>{t=d,i=null,a&&(clearTimeout(a),a=null),r(...l)};return[(...l)=>{const d=Date.now(),y=d-t;y>=s?n(l,d):(i=l,a||(a=setTimeout(()=>{a=null,n(i)},s-y)))},()=>i&&n(i)]}const de=(r,e,t=3)=>{let s=0;const i=qs(50,250);return Bs(a=>{const n=a.loaded,o=a.lengthComputable?a.total:void 0,u=n-s,l=i(u),d=n<=o;s=n;const y={loaded:n,total:o,progress:o?n/o:void 0,bytes:u,rate:l||void 0,estimated:l&&o&&d?(o-n)/l:void 0,event:a,lengthComputable:o!=null,[e?"download":"upload"]:!0};r(y)},t)},Xe=(r,e)=>{const t=r!=null;return[s=>e[0]({lengthComputable:t,total:r,loaded:s}),e[1]]},Qe=r=>(...e)=>c.asap(()=>r(...e)),Rs=P.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,P.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(P.origin),P.navigator&&/(msie|trident)/i.test(P.navigator.userAgent)):()=>!0,As=P.hasStandardBrowserEnv?{write(r,e,t,s,i,a){const n=[r+"="+encodeURIComponent(e)];c.isNumber(t)&&n.push("expires="+new Date(t).toGMTString()),c.isString(s)&&n.push("path="+s),c.isString(i)&&n.push("domain="+i),a===!0&&n.push("secure"),document.cookie=n.join("; ")},read(r){const e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ts(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function Os(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function Kt(r,e,t){let s=!Ts(e);return r&&(s||t==!1)?Os(r,e):e}const Ye=r=>r instanceof B?{...r}:r;function H(r,e){e=e||{};const t={};function s(l,d,y,m){return c.isPlainObject(l)&&c.isPlainObject(d)?c.merge.call({caseless:m},l,d):c.isPlainObject(d)?c.merge({},d):c.isArray(d)?d.slice():d}function i(l,d,y,m){if(c.isUndefined(d)){if(!c.isUndefined(l))return s(void 0,l,y,m)}else return s(l,d,y,m)}function a(l,d){if(!c.isUndefined(d))return s(void 0,d)}function n(l,d){if(c.isUndefined(d)){if(!c.isUndefined(l))return s(void 0,l)}else return s(void 0,d)}function o(l,d,y){if(y in e)return s(l,d);if(y in r)return s(void 0,l)}const u={url:a,method:a,data:a,baseURL:n,transformRequest:n,transformResponse:n,paramsSerializer:n,timeout:n,timeoutMessage:n,withCredentials:n,withXSRFToken:n,adapter:n,responseType:n,xsrfCookieName:n,xsrfHeaderName:n,onUploadProgress:n,onDownloadProgress:n,decompress:n,maxContentLength:n,maxBodyLength:n,beforeRedirect:n,transport:n,httpAgent:n,httpsAgent:n,cancelToken:n,socketPath:n,responseEncoding:n,validateStatus:o,headers:(l,d,y)=>i(Ye(l),Ye(d),y,!0)};return c.forEach(Object.keys({...r,...e}),function(d){const y=u[d]||i,m=y(r[d],e[d],d);c.isUndefined(m)&&y!==o||(t[d]=m)}),t}const qt=r=>{const e=H({},r);let{data:t,withXSRFToken:s,xsrfHeaderName:i,xsrfCookieName:a,headers:n,auth:o}=e;if(e.headers=n=B.from(n),e.url=wt(Kt(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),o&&n.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):""))),c.isFormData(t)){if(P.hasStandardBrowserEnv||P.hasStandardBrowserWebWorkerEnv)n.setContentType(void 0);else if(c.isFunction(t.getHeaders)){const u=t.getHeaders(),l=["content-type","content-length"];Object.entries(u).forEach(([d,y])=>{l.includes(d.toLowerCase())&&n.set(d,y)})}}if(P.hasStandardBrowserEnv&&(s&&c.isFunction(s)&&(s=s(e)),s||s!==!1&&Rs(e.url))){const u=i&&a&&As.read(a);u&&n.set(i,u)}return e},Es=typeof XMLHttpRequest<"u",Ds=Es&&function(r){return new Promise(function(t,s){const i=qt(r);let a=i.data;const n=B.from(i.headers).normalize();let{responseType:o,onUploadProgress:u,onDownloadProgress:l}=i,d,y,m,b,p;function f(){b&&b(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let h=new XMLHttpRequest;h.open(i.method.toUpperCase(),i.url,!0),h.timeout=i.timeout;function S(){if(!h)return;const w=B.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),T={data:!o||o==="text"||o==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:r,request:h};Ct(function(R){t(R),f()},function(R){s(R),f()},T),h=null}"onloadend"in h?h.onloadend=S:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(S)},h.onabort=function(){h&&(s(new v("Request aborted",v.ECONNABORTED,r,h)),h=null)},h.onerror=function(K){const T=K&&K.message?K.message:"Network Error",_=new v(T,v.ERR_NETWORK,r,h);_.event=K||null,s(_),h=null},h.ontimeout=function(){let K=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const T=i.transitional||kt;i.timeoutErrorMessage&&(K=i.timeoutErrorMessage),s(new v(K,T.clarifyTimeoutError?v.ETIMEDOUT:v.ECONNABORTED,r,h)),h=null},a===void 0&&n.setContentType(null),"setRequestHeader"in h&&c.forEach(n.toJSON(),function(K,T){h.setRequestHeader(T,K)}),c.isUndefined(i.withCredentials)||(h.withCredentials=!!i.withCredentials),o&&o!=="json"&&(h.responseType=i.responseType),l&&([m,p]=de(l,!0),h.addEventListener("progress",m)),u&&h.upload&&([y,b]=de(u),h.upload.addEventListener("progress",y),h.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(d=w=>{h&&(s(!w||w.type?new X(null,r,h):w),h.abort(),h=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const L=Ks(i.url);if(L&&P.protocols.indexOf(L)===-1){s(new v("Unsupported protocol "+L+":",v.ERR_BAD_REQUEST,r));return}h.send(a||null)})},Is=(r,e)=>{const{length:t}=r=r?r.filter(Boolean):[];if(e||t){let s=new AbortController,i;const a=function(l){if(!i){i=!0,o();const d=l instanceof Error?l:this.reason;s.abort(d instanceof v?d:new X(d instanceof Error?d.message:d))}};let n=e&&setTimeout(()=>{n=null,a(new v(`timeout ${e} of ms exceeded`,v.ETIMEDOUT))},e);const o=()=>{r&&(n&&clearTimeout(n),n=null,r.forEach(l=>{l.unsubscribe?l.unsubscribe(a):l.removeEventListener("abort",a)}),r=null)};r.forEach(l=>l.addEventListener("abort",a));const{signal:u}=s;return u.unsubscribe=()=>c.asap(o),u}},Fs=function*(r,e){let t=r.byteLength;if(t<e){yield r;return}let s=0,i;for(;s<t;)i=s+e,yield r.slice(s,i),s=i},Ns=async function*(r,e){for await(const t of xs(r))yield*Fs(t,e)},xs=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const e=r.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},Ze=(r,e,t,s)=>{const i=Ns(r,e);let a=0,n,o=u=>{n||(n=!0,s&&s(u))};return new ReadableStream({async pull(u){try{const{done:l,value:d}=await i.next();if(l){o(),u.close();return}let y=d.byteLength;if(t){let m=a+=y;t(m)}u.enqueue(new Uint8Array(d))}catch(l){throw o(l),l}},cancel(u){return o(u),i.return()}},{highWaterMark:2})},et=64*1024,{isFunction:oe}=c,Us=(({Request:r,Response:e})=>({Request:r,Response:e}))(c.global),{ReadableStream:tt,TextEncoder:rt}=c.global,st=(r,...e)=>{try{return!!r(...e)}catch{return!1}},_s=r=>{r=c.merge.call({skipUndefined:!0},Us,r);const{fetch:e,Request:t,Response:s}=r,i=e?oe(e):typeof fetch=="function",a=oe(t),n=oe(s);if(!i)return!1;const o=i&&oe(tt),u=i&&(typeof rt=="function"?(p=>f=>p.encode(f))(new rt):async p=>new Uint8Array(await new t(p).arrayBuffer())),l=a&&o&&st(()=>{let p=!1;const f=new t(P.origin,{body:new tt,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!f}),d=n&&o&&st(()=>c.isReadableStream(new s("").body)),y={stream:d&&(p=>p.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!y[p]&&(y[p]=(f,h)=>{let S=f&&f[p];if(S)return S.call(f);throw new v(`Response type '${p}' is not supported`,v.ERR_NOT_SUPPORT,h)})});const m=async p=>{if(p==null)return 0;if(c.isBlob(p))return p.size;if(c.isSpecCompliantForm(p))return(await new t(P.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(c.isArrayBufferView(p)||c.isArrayBuffer(p))return p.byteLength;if(c.isURLSearchParams(p)&&(p=p+""),c.isString(p))return(await u(p)).byteLength},b=async(p,f)=>{const h=c.toFiniteNumber(p.getContentLength());return h??m(f)};return async p=>{let{url:f,method:h,data:S,signal:L,cancelToken:w,timeout:K,onDownloadProgress:T,onUploadProgress:_,responseType:R,headers:Le,withCredentials:ie="same-origin",fetchOptions:xe}=qt(p),Ue=e||fetch;R=R?(R+"").toLowerCase():"text";let ae=Is([L,w&&w.toAbortSignal()],K),Q=null;const $=ae&&ae.unsubscribe&&(()=>{ae.unsubscribe()});let _e;try{if(_&&l&&h!=="get"&&h!=="head"&&(_e=await b(Le,S))!==0){let F=new t(f,{method:"POST",body:S,duplex:"half"}),V;if(c.isFormData(S)&&(V=F.headers.get("content-type"))&&Le.setContentType(V),F.body){const[we,ne]=Xe(_e,de(Qe(_)));S=Ze(F.body,et,we,ne)}}c.isString(ie)||(ie=ie?"include":"omit");const E=a&&"credentials"in t.prototype,$e={...xe,signal:ae,method:h.toUpperCase(),headers:Le.normalize().toJSON(),body:S,duplex:"half",credentials:E?ie:void 0};Q=a&&new t(f,$e);let I=await(a?Ue(Q,xe):Ue(f,$e));const je=d&&(R==="stream"||R==="response");if(d&&(T||je&&$)){const F={};["status","statusText","headers"].forEach(We=>{F[We]=I[We]});const V=c.toFiniteNumber(I.headers.get("content-length")),[we,ne]=T&&Xe(V,de(Qe(T),!0))||[];I=new s(Ze(I.body,et,we,()=>{ne&&ne(),$&&$()}),F)}R=R||"text";let gr=await y[c.findKey(y,R)||"text"](I,p);return!je&&$&&$(),await new Promise((F,V)=>{Ct(F,V,{data:gr,headers:B.from(I.headers),status:I.status,statusText:I.statusText,config:p,request:Q})})}catch(E){throw $&&$(),E&&E.name==="TypeError"&&/Load failed|fetch/i.test(E.message)?Object.assign(new v("Network Error",v.ERR_NETWORK,p,Q),{cause:E.cause||E}):v.from(E,E&&E.code,p,Q)}}},$s=new Map,Bt=r=>{let e=r?r.env:{};const{fetch:t,Request:s,Response:i}=e,a=[s,i,t];let n=a.length,o=n,u,l,d=$s;for(;o--;)u=a[o],l=d.get(u),l===void 0&&d.set(u,l=o?new Map:_s(e)),d=l;return l};Bt();const Be={http:as,xhr:Ds,fetch:{get:Bt}};c.forEach(Be,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const it=r=>`- ${r}`,js=r=>c.isFunction(r)||r===null||r===!1,Rt={getAdapter:(r,e)=>{r=c.isArray(r)?r:[r];const{length:t}=r;let s,i;const a={};for(let n=0;n<t;n++){s=r[n];let o;if(i=s,!js(s)&&(i=Be[(o=String(s)).toLowerCase()],i===void 0))throw new v(`Unknown adapter '${o}'`);if(i&&(c.isFunction(i)||(i=i.get(e))))break;a[o||"#"+n]=i}if(!i){const n=Object.entries(a).map(([u,l])=>`adapter ${u} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?n.length>1?`since :
4
- `+n.map(it).join(`
5
- `):" "+it(n[0]):"as no adapter specified";throw new v("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return i},adapters:Be};function Pe(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new X(null,r)}function at(r){return Pe(r),r.headers=B.from(r.headers),r.data=Me.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),Rt.getAdapter(r.adapter||re.adapter,r)(r).then(function(s){return Pe(r),s.data=Me.call(r,r.transformResponse,s),s.headers=B.from(s.headers),s},function(s){return Pt(s)||(Pe(r),s&&s.response&&(s.response.data=Me.call(r,r.transformResponse,s.response),s.response.headers=B.from(s.response.headers))),Promise.reject(s)})}const At="1.12.2",ge={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{ge[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});const nt={};ge.transitional=function(e,t,s){function i(a,n){return"[Axios v"+At+"] Transitional option '"+a+"'"+n+(s?". "+s:"")}return(a,n,o)=>{if(e===!1)throw new v(i(n," has been removed"+(t?" in "+t:"")),v.ERR_DEPRECATED);return t&&!nt[n]&&(nt[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,n,o):!0}};ge.spelling=function(e){return(t,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function Ws(r,e,t){if(typeof r!="object")throw new v("options must be an object",v.ERR_BAD_OPTION_VALUE);const s=Object.keys(r);let i=s.length;for(;i-- >0;){const a=s[i],n=e[a];if(n){const o=r[a],u=o===void 0||n(o,a,r);if(u!==!0)throw new v("option "+a+" must be "+u,v.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new v("Unknown option "+a,v.ERR_BAD_OPTION)}}const le={assertOptions:Ws,validators:ge},D=le.validators;let W=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ze,response:new ze}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{s.stack?a&&!String(s.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
- `+a):s.stack=a}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=H(this.defaults,t);const{transitional:s,paramsSerializer:i,headers:a}=t;s!==void 0&&le.assertOptions(s,{silentJSONParsing:D.transitional(D.boolean),forcedJSONParsing:D.transitional(D.boolean),clarifyTimeoutError:D.transitional(D.boolean)},!1),i!=null&&(c.isFunction(i)?t.paramsSerializer={serialize:i}:le.assertOptions(i,{encode:D.function,serialize:D.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),le.assertOptions(t,{baseUrl:D.spelling("baseURL"),withXsrfToken:D.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let n=a&&c.merge(a.common,a[t.method]);a&&c.forEach(["delete","get","head","post","put","patch","common"],p=>{delete a[p]}),t.headers=B.concat(n,a);const o=[];let u=!0;this.interceptors.request.forEach(function(f){typeof f.runWhen=="function"&&f.runWhen(t)===!1||(u=u&&f.synchronous,o.unshift(f.fulfilled,f.rejected))});const l=[];this.interceptors.response.forEach(function(f){l.push(f.fulfilled,f.rejected)});let d,y=0,m;if(!u){const p=[at.bind(this),void 0];for(p.unshift(...o),p.push(...l),m=p.length,d=Promise.resolve(t);y<m;)d=d.then(p[y++],p[y++]);return d}m=o.length;let b=t;for(;y<m;){const p=o[y++],f=o[y++];try{b=p(b)}catch(h){f.call(this,h);break}}try{d=at.call(this,b)}catch(p){return Promise.reject(p)}for(y=0,m=l.length;y<m;)d=d.then(l[y++],l[y++]);return d}getUri(e){e=H(this.defaults,e);const t=Kt(e.baseURL,e.url,e.allowAbsoluteUrls);return wt(t,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){W.prototype[e]=function(t,s){return this.request(H(s||{},{method:e,url:t,data:(s||{}).data}))}});c.forEach(["post","put","patch"],function(e){function t(s){return function(a,n,o){return this.request(H(o||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:a,data:n}))}}W.prototype[e]=t(),W.prototype[e+"Form"]=t(!0)});let Gs=class Tt{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(a){t=a});const s=this;this.promise.then(i=>{if(!s._listeners)return;let a=s._listeners.length;for(;a-- >0;)s._listeners[a](i);s._listeners=null}),this.promise.then=i=>{let a;const n=new Promise(o=>{s.subscribe(o),a=o}).then(i);return n.cancel=function(){s.unsubscribe(a)},n},e(function(a,n,o){s.reason||(s.reason=new X(a,n,o),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Tt(function(i){e=i}),cancel:e}}};function Hs(r){return function(t){return r.apply(null,t)}}function Vs(r){return c.isObject(r)&&r.isAxiosError===!0}const Re={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Re).forEach(([r,e])=>{Re[e]=r});function Ot(r){const e=new W(r),t=lt(W.prototype.request,e);return c.extend(t,W.prototype,e,{allOwnKeys:!0}),c.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return Ot(H(r,i))},t}const k=Ot(re);k.Axios=W;k.CanceledError=X;k.CancelToken=Gs;k.isCancel=Pt;k.VERSION=At;k.toFormData=he;k.AxiosError=v;k.Cancel=k.CanceledError;k.all=function(e){return Promise.all(e)};k.spread=Hs;k.isAxiosError=Vs;k.mergeConfig=H;k.AxiosHeaders=B;k.formToJSON=r=>Mt(c.isHTMLForm(r)?new FormData(r):r);k.getAdapter=Rt.getAdapter;k.HttpStatusCode=Re;k.default=k;const{Axios:ea,AxiosError:ta,CanceledError:ra,isCancel:sa,CancelToken:ia,VERSION:aa,all:na,Cancel:oa,isAxiosError:ca,spread:ua,toFormData:la,AxiosHeaders:da,HttpStatusCode:pa,formToJSON:ma,getAdapter:ya,mergeConfig:fa}=k;class C extends Error{constructor(e,t,s,i,a,n){super(e),this.name=this.constructor.name;const o=Error.captureStackTrace;o&&o(this,this.constructor),this.statusCode=t,this.response=s,this.requestId=i,this.origin=a,this.timestamp=n}getUserMessage(){let e=this.message;return this.statusCode!==void 0&&(e+=` (Status: ${this.statusCode.toString()})`),this.requestId&&(e+=` [Request ID: ${this.requestId}]`),this.origin&&(e+=` [Origin: ${this.origin}]`),e}toJSON(){return{name:this.name,message:this.message,statusCode:this.statusCode,response:this.response,requestId:this.requestId,origin:this.origin,timestamp:this.timestamp}}}class be extends C{constructor(e="Authentication failed. Please verify your API key is valid and has the required permissions.",t=401,s,i,a,n){super(e,t,s,i,a,n),this.name="AuthenticationError"}getUserMessage(){const e=super.getUserMessage(),t=[`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("../index-BJPymceu.cjs"),Bt=require("./modules/finances/index.cjs"),qt=require("./modules/analytics/index.cjs"),Et=require("./modules/reports/index.cjs"),xr="4.2.0",Fr={version:xr};function Ot(r,e){return function(){return r.apply(e,arguments)}}const{toString:_r}=Object.prototype,{getPrototypeOf:ne}=Object,{iterator:ye,toStringTag:Kt}=Symbol,Pe=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),me=(r,e)=>{let t=r;const s=[];for(;t!=null&&t!==Object.prototype;){if(s.indexOf(t)!==-1)return!1;if(s.push(t),Pe(t,e))return!0;t=ne(t)}return!1},Ur=(r,e)=>r!=null&&me(r,e)?r[e]:void 0,ze=(r=>e=>{const t=_r.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),x=r=>(r=r.toLowerCase(),e=>ze(e)===r),Be=r=>e=>typeof e===r,{isArray:te}=Array,ae=Be("undefined");function oe(r){return r!==null&&!ae(r)&&r.constructor!==null&&!ae(r.constructor)&&T(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const Tt=x("ArrayBuffer");function $r(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&Tt(r.buffer),e}const jr=Be("string"),T=Be("function"),Dt=Be("number"),ce=r=>r!==null&&typeof r=="object",Vr=r=>r===!0||r===!1,we=r=>{if(!ce(r))return!1;const e=ne(r);return(e===null||e===Object.prototype||ne(e)===null)&&!me(r,Kt)&&!me(r,ye)},Wr=r=>{if(!ce(r)||oe(r))return!1;try{return Object.keys(r).length===0&&Object.getPrototypeOf(r)===Object.prototype}catch{return!1}},Hr=x("Date"),Gr=x("File"),zr=r=>!!(r&&typeof r.uri<"u"),Jr=r=>r&&typeof r.getParts<"u",Xr=x("Blob"),Qr=x("FileList"),Yr=r=>ce(r)&&T(r.pipe);function Zr(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const dt=Zr(),pt=typeof dt.FormData<"u"?dt.FormData:void 0,es=r=>{if(!r)return!1;if(pt&&r instanceof pt)return!0;const e=ne(r);if(!e||e===Object.prototype||!T(r.append))return!1;const t=ze(r);return t==="formdata"||t==="object"&&T(r.toString)&&r.toString()==="[object FormData]"},ts=x("URLSearchParams"),[rs,ss,is,ns]=["ReadableStream","Request","Response","Headers"].map(x),as=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function fe(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let s,i;if(typeof r!="object"&&(r=[r]),te(r))for(s=0,i=r.length;s<i;s++)e.call(null,r[s],s,r);else{if(oe(r))return;const n=t?Object.getOwnPropertyNames(r):Object.keys(r),a=n.length;let o;for(s=0;s<a;s++)o=n[s],e.call(null,r[o],o,r)}}function It(r,e){if(oe(r))return null;e=e.toLowerCase();const t=Object.keys(r);let s=t.length,i;for(;s-- >0;)if(i=t[s],e===i.toLowerCase())return i;return null}const Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Nt=r=>!ae(r)&&r!==Y;function je(...r){const{caseless:e,skipUndefined:t}=Nt(this)&&this||{},s={},i=(n,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const o=e&&typeof a=="string"&&It(s,a)||a,u=Pe(s,o)?s[o]:void 0;we(u)&&we(n)?s[o]=je(u,n):we(n)?s[o]=je({},n):te(n)?s[o]=n.slice():(!t||!ae(n))&&(s[o]=n)};for(let n=0,a=r.length;n<a;n++){const o=r[n];if(!o||oe(o)||(fe(o,i),typeof o!="object"||te(o)))continue;const u=Object.getOwnPropertySymbols(o);for(let l=0;l<u.length;l++){const d=u[l];bs.call(o,d)&&i(o[d],d)}}return s}const os=(r,e,t,{allOwnKeys:s}={})=>(fe(e,(i,n)=>{t&&T(i)?Object.defineProperty(r,n,{__proto__:null,value:Ot(i,t),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(r,n,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),r),cs=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),us=(r,e,t,s)=>{r.prototype=Object.create(e.prototype,s),Object.defineProperty(r.prototype,"constructor",{__proto__:null,value:r,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(r,"super",{__proto__:null,value:e.prototype}),t&&Object.assign(r.prototype,t)},ls=(r,e,t,s)=>{let i,n,a;const o={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),n=i.length;n-- >0;)a=i[n],(!s||s(a,r,e))&&!o[a]&&(e[a]=r[a],o[a]=!0);r=t!==!1&&ne(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},ds=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const s=r.indexOf(e,t);return s!==-1&&s===t},ps=r=>{if(!r)return null;if(te(r))return r;let e=r.length;if(!Dt(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},ms=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&ne(Uint8Array)),ys=(r,e)=>{const s=(r&&r[ye]).call(r);let i;for(;(i=s.next())&&!i.done;){const n=i.value;e.call(r,n[0],n[1])}},fs=(r,e)=>{let t;const s=[];for(;(t=r.exec(e))!==null;)s.push(t);return s},hs=x("HTMLFormElement"),gs=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,s,i){return s.toUpperCase()+i}),{propertyIsEnumerable:bs}=Object.prototype,vs=x("RegExp"),xt=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),s={};fe(t,(i,n)=>{let a;(a=e(i,n,r))!==!1&&(s[n]=a||i)}),Object.defineProperties(r,s)},Ss=r=>{xt(r,(e,t)=>{if(T(r)&&["arguments","caller","callee"].includes(t))return!1;const s=r[t];if(T(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},Ls=(r,e)=>{const t={},s=i=>{i.forEach(n=>{t[n]=!0})};return te(r)?s(r):s(String(r).split(e)),t},ws=()=>{},Ms=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function ks(r){return!!(r&&T(r.append)&&r[Kt]==="FormData"&&r[ye])}const Ps=r=>{const e=new WeakSet,t=s=>{if(ce(s)){if(e.has(s))return;if(oe(s))return s;if(!("toJSON"in s)){e.add(s);const i=te(s)?[]:{};return fe(s,(n,a)=>{const o=t(n);!ae(o)&&(i[a]=o)}),e.delete(s),i}}return s};return t(r)},Cs=x("AsyncFunction"),Rs=r=>r&&(ce(r)||T(r))&&T(r.then)&&T(r.catch),Ft=((r,e)=>r?setImmediate:e?((t,s)=>(Y.addEventListener("message",({source:i,data:n})=>{i===Y&&n===t&&s.length&&s.shift()()},!1),i=>{s.push(i),Y.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",T(Y.postMessage)),As=typeof queueMicrotask<"u"?queueMicrotask.bind(Y):typeof process<"u"&&process.nextTick||Ft,_t=r=>r!=null&&T(r[ye]),Bs=r=>r!=null&&me(r,ye)&&_t(r),c={isArray:te,isArrayBuffer:Tt,isBuffer:oe,isFormData:es,isArrayBufferView:$r,isString:jr,isNumber:Dt,isBoolean:Vr,isObject:ce,isPlainObject:we,isEmptyObject:Wr,isReadableStream:rs,isRequest:ss,isResponse:is,isHeaders:ns,isUndefined:ae,isDate:Hr,isFile:Gr,isReactNativeBlob:zr,isReactNative:Jr,isBlob:Xr,isRegExp:vs,isFunction:T,isStream:Yr,isURLSearchParams:ts,isTypedArray:ms,isFileList:Qr,forEach:fe,merge:je,extend:os,trim:as,stripBOM:cs,inherits:us,toFlatObject:ls,kindOf:ze,kindOfTest:x,endsWith:ds,toArray:ps,forEachEntry:ys,matchAll:fs,isHTMLForm:hs,hasOwnProperty:Pe,hasOwnProp:Pe,hasOwnInPrototypeChain:me,getSafeProp:Ur,reduceDescriptors:xt,freezeMethods:Ss,toObjectSet:Ls,toCamelCase:gs,noop:ws,toFiniteNumber:Ms,findKey:It,global:Y,isContextDefined:Nt,isSpecCompliantForm:ks,toJSONObject:Ps,isAsyncFn:Cs,isThenable:Rs,setImmediate:Ft,asap:As,isIterable:_t,isSafeIterable:Bs},qs=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Es=r=>{const e={};let t,s,i;return r&&r.split(`
2
+ `).forEach(function(a){i=a.indexOf(":"),t=a.substring(0,i).trim().toLowerCase(),s=a.substring(i+1).trim(),!(!t||e[t]&&qs[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e};function Os(r){let e=0,t=r.length;for(;e<t;){const s=r.charCodeAt(e);if(s!==9&&s!==32)break;e+=1}for(;t>e;){const s=r.charCodeAt(t-1);if(s!==9&&s!==32)break;t-=1}return e===0&&t===r.length?r:r.slice(e,t)}const Ks=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Ts=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function Je(r,e){return c.isArray(r)?r.map(t=>Je(t,e)):Os(String(r).replace(e,""))}const Ds=r=>Je(r,Ks),Is=r=>Je(r,Ts);function Ut(r){const e=Object.create(null);return c.forEach(r.toJSON(),(t,s)=>{e[s]=Is(t)}),e}const mt=Symbol("internals");function pe(r){return r&&String(r).trim().toLowerCase()}function Me(r){return r===!1||r==null?r:c.isArray(r)?r.map(Me):Ds(String(r))}function Ns(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=t.exec(r);)e[s[1]]=s[2];return e}const xs=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function Fe(r,e,t,s,i){if(c.isFunction(s))return s.call(this,e,t);if(i&&(e=t),!!c.isString(e)){if(c.isString(s))return e.indexOf(s)!==-1;if(c.isRegExp(s))return s.test(e)}}function Fs(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function _s(r,e){const t=c.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(r,s+t,{__proto__:null,value:function(i,n,a){return this[s].call(this,e,i,n,a)},configurable:!0})})}let K=class{constructor(e){e&&this.set(e)}set(e,t,s){const i=this;function n(o,u,l){const d=pe(u);if(!d)return;const m=c.findKey(i,d);(!m||i[m]===void 0||l===!0||l===void 0&&i[m]!==!1)&&(i[m||u]=Me(o))}const a=(o,u)=>c.forEach(o,(l,d)=>n(l,d,u));if(c.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(c.isString(e)&&(e=e.trim())&&!xs(e))a(Es(e),t);else if(c.isObject(e)&&c.isSafeIterable(e)){let o=Object.create(null),u,l;for(const d of e){if(!c.isArray(d))throw new TypeError("Object iterator must return a key-value pair");l=d[0],c.hasOwnProp(o,l)?(u=o[l],o[l]=c.isArray(u)?[...u,d[1]]:[u,d[1]]):o[l]=d[1]}a(o,t)}else e!=null&&n(t,e,s);return this}get(e,t){if(e=pe(e),e){const s=c.findKey(this,e);if(s){const i=this[s];if(!t)return i;if(t===!0)return Ns(i);if(c.isFunction(t))return t.call(this,i,s);if(c.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=pe(e),e){const s=c.findKey(this,e);return!!(s&&this[s]!==void 0&&(!t||Fe(this,this[s],s,t)))}return!1}delete(e,t){const s=this;let i=!1;function n(a){if(a=pe(a),a){const o=c.findKey(s,a);o&&(!t||Fe(s,s[o],o,t))&&(delete s[o],i=!0)}}return c.isArray(e)?e.forEach(n):n(e),i}clear(e){const t=Object.keys(this);let s=t.length,i=!1;for(;s--;){const n=t[s];(!e||Fe(this,this[n],n,e,!0))&&(delete this[n],i=!0)}return i}normalize(e){const t=this,s={};return c.forEach(this,(i,n)=>{const a=c.findKey(s,n);if(a){t[a]=Me(i),delete t[n];return}const o=e?Fs(n):String(n).trim();o!==n&&delete t[n],t[o]=Me(i),s[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return c.forEach(this,(s,i)=>{s!=null&&s!==!1&&(t[i]=e&&c.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
3
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const s=new this(e);return t.forEach(i=>s.set(i)),s}static accessor(e){const s=(this[mt]=this[mt]={accessors:{}}).accessors,i=this.prototype;function n(a){const o=pe(a);s[o]||(_s(i,a),s[o]=!0)}return c.isArray(e)?e.forEach(n):n(e),this}};K.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(K.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(s){this[t]=s}}});c.freezeMethods(K);const Us="[REDACTED ****]";function $s(r){if(c.hasOwnProp(r,"toJSON"))return!0;let e=Object.getPrototypeOf(r);for(;e&&e!==Object.prototype;){if(c.hasOwnProp(e,"toJSON"))return!0;e=Object.getPrototypeOf(e)}return!1}function js(r,e){const t=new Set(e.map(n=>String(n).toLowerCase())),s=[],i=n=>{if(n===null||typeof n!="object"||c.isBuffer(n))return n;if(s.indexOf(n)!==-1)return;n instanceof K&&(n=n.toJSON()),s.push(n);let a;if(c.isArray(n))a=[],n.forEach((o,u)=>{const l=i(o);c.isUndefined(l)||(a[u]=l)});else{if(!c.isPlainObject(n)&&$s(n))return s.pop(),n;a=Object.create(null);for(const[o,u]of Object.entries(n)){const l=t.has(o.toLowerCase())?Us:i(u);c.isUndefined(l)||(a[o]=l)}}return s.pop(),a};return i(r)}let g=class $t extends Error{static from(e,t,s,i,n,a){const o=new $t(e.message,t||e.code,s,i,n);return Object.defineProperty(o,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),o.name=e.name,e.status!=null&&o.status==null&&(o.status=e.status),a&&Object.assign(o,a),o}constructor(e,t,s,i,n){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),s&&(this.config=s),i&&(this.request=i),n&&(this.response=n,this.status=n.status)}toJSON(){const e=this.config,t=e&&c.hasOwnProp(e,"redact")?e.redact:void 0,s=c.isArray(t)&&t.length>0?js(e,t):c.toJSONObject(e);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:s,code:this.code,status:this.status}}};g.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";g.ERR_BAD_OPTION="ERR_BAD_OPTION";g.ECONNABORTED="ECONNABORTED";g.ETIMEDOUT="ETIMEDOUT";g.ECONNREFUSED="ECONNREFUSED";g.ERR_NETWORK="ERR_NETWORK";g.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";g.ERR_DEPRECATED="ERR_DEPRECATED";g.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";g.ERR_BAD_REQUEST="ERR_BAD_REQUEST";g.ERR_CANCELED="ERR_CANCELED";g.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";g.ERR_INVALID_URL="ERR_INVALID_URL";g.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const Vs=null,jt=100;function Ve(r){return c.isPlainObject(r)||c.isArray(r)}function Vt(r){return c.endsWith(r,"[]")?r.slice(0,-2):r}function _e(r,e,t){return r?r.concat(e).map(function(i,n){return i=Vt(i),!t&&n?"["+i+"]":i}).join(t?".":""):e}function Ws(r){return c.isArray(r)&&!r.some(Ve)}const Hs=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function qe(r,e,t){if(!c.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=c.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,w){return!c.isUndefined(w[S])});const s=t.metaTokens,i=t.visitor||v,n=t.dots,a=t.indexes,o=t.Blob||typeof Blob<"u"&&Blob,u=t.maxDepth===void 0?jt:t.maxDepth,l=o&&c.isSpecCompliantForm(e),d=[];if(!c.isFunction(i))throw new TypeError("visitor must be a function");function m(y){if(y===null)return"";if(c.isDate(y))return y.toISOString();if(c.isBoolean(y))return y.toString();if(!l&&c.isBlob(y))throw new g("Blob is not supported. Use a Buffer instead.");if(c.isArrayBuffer(y)||c.isTypedArray(y)){if(l&&typeof o=="function")return new o([y]);if(typeof Buffer<"u")return Buffer.from(y);throw new g("Blob is not supported. Use a Buffer instead.",g.ERR_NOT_SUPPORT)}return y}function p(y){if(y>u)throw new g("Object is too deeply nested ("+y+" levels). Max depth: "+u,g.ERR_FORM_DATA_DEPTH_EXCEEDED)}function f(y,S){if(u===1/0)return JSON.stringify(y);const w=[];return JSON.stringify(y,function(E,C){if(!c.isObject(C))return C;for(;w.length&&w[w.length-1]!==this;)w.pop();return w.push(C),p(S+w.length-1),C})}function v(y,S,w){let k=y;if(c.isReactNative(e)&&c.isReactNativeBlob(y))return e.append(_e(w,S,n),m(y)),!1;if(y&&!w&&typeof y=="object"){if(c.endsWith(S,"{}"))S=s?S:S.slice(0,-2),y=f(y,1);else if(c.isArray(y)&&Ws(y)||(c.isFileList(y)||c.endsWith(S,"[]"))&&(k=c.toArray(y)))return S=Vt(S),k.forEach(function(C,$){!(c.isUndefined(C)||C===null)&&e.append(a===!0?_e([S],$,n):a===null?S:S+"[]",m(C))}),!1}return Ve(y)?!0:(e.append(_e(w,S,n),m(y)),!1)}const L=Object.assign(Hs,{defaultVisitor:v,convertValue:m,isVisitable:Ve});function b(y,S,w=0){if(!c.isUndefined(y)){if(p(w),d.indexOf(y)!==-1)throw new Error("Circular reference detected in "+S.join("."));d.push(y),c.forEach(y,function(E,C){(!(c.isUndefined(E)||E===null)&&i.call(e,E,c.isString(C)?C.trim():C,S,L))===!0&&b(E,S?S.concat(C):[C],w+1)}),d.pop()}}if(!c.isObject(r))throw new TypeError("data must be an object");return b(r),e}function yt(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(r).replace(/[!'()~]|%20/g,function(s){return e[s]})}function Xe(r,e){this._pairs=[],r&&qe(r,this,e)}const Wt=Xe.prototype;Wt.append=function(e,t){this._pairs.push([e,t])};Wt.toString=function(e){const t=e?s=>e.call(this,s,yt):yt;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function Gs(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ht(r,e,t){if(!e)return r;r=r||"";const s=c.isFunction(t)?{serialize:t}:t,i=c.getSafeProp(s,"encode")||Gs,n=c.getSafeProp(s,"serialize");let a;if(n?a=n(e,s):a=c.isURLSearchParams(e)?e.toString():new Xe(e,s).toString(i),a){const o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}class ft{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(s){s!==null&&e(s)})}}const Qe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},zs=typeof URLSearchParams<"u"?URLSearchParams:Xe,Js=typeof FormData<"u"?FormData:null,Xs=typeof Blob<"u"?Blob:null,Qs={isBrowser:!0,classes:{URLSearchParams:zs,FormData:Js,Blob:Xs},protocols:["http","https","file","blob","url","data"]},Ye=typeof window<"u"&&typeof document<"u",We=typeof navigator=="object"&&navigator||void 0,Ys=Ye&&(!We||["ReactNative","NativeScript","NS"].indexOf(We.product)<0),Zs=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ei=Ye&&window.location.href||"http://localhost",ti=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Ye,hasStandardBrowserEnv:Ys,hasStandardBrowserWebWorkerEnv:Zs,navigator:We,origin:ei},Symbol.toStringTag,{value:"Module"})),q={...ti,...Qs};function ri(r,e){return qe(r,new q.classes.URLSearchParams,{visitor:function(t,s,i,n){return q.isNode&&c.isBuffer(t)?(this.append(s,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)},...e})}const ht=jt;function Gt(r){if(r>ht)throw new g("FormData field is too deeply nested ("+r+" levels). Max depth: "+ht,g.ERR_FORM_DATA_DEPTH_EXCEEDED)}function si(r){const e=[],t=/\w+|\[(\w*)]/g;let s;for(;(s=t.exec(r))!==null;)Gt(e.length),e.push(s[0]==="[]"?"":s[1]||s[0]);return e}function ii(r){const e={},t=Object.keys(r);let s;const i=t.length;let n;for(s=0;s<i;s++)n=t[s],e[n]=r[n];return e}function zt(r){function e(t,s,i,n){Gt(n);let a=t[n++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),u=n>=t.length;return a=!a&&c.isArray(i)?i.length:a,u?(c.hasOwnProp(i,a)?i[a]=c.isArray(i[a])?i[a].concat(s):[i[a],s]:i[a]=s,!o):((!c.hasOwnProp(i,a)||!c.isObject(i[a]))&&(i[a]=[]),e(t,s,i[a],n)&&c.isArray(i[a])&&(i[a]=ii(i[a])),!o)}if(c.isFormData(r)&&c.isFunction(r.entries)){const t={};return c.forEachEntry(r,(s,i)=>{e(si(s),i,t,0)}),t}return null}const ie=(r,e)=>r!=null&&c.hasOwnProp(r,e)?r[e]:void 0;function ni(r,e,t){if(c.isString(r))try{return(e||JSON.parse)(r),c.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(r)}const he={transitional:Qe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const s=t.getContentType()||"",i=s.indexOf("application/json")>-1,n=c.isObject(e);if(n&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return i?JSON.stringify(zt(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(n){const u=ie(this,"formSerializer");if(s.indexOf("application/x-www-form-urlencoded")>-1)return ri(e,u).toString();if((o=c.isFileList(e))||s.indexOf("multipart/form-data")>-1){const l=ie(this,"env"),d=l&&l.FormData;return qe(o?{"files[]":e}:e,d&&new d,u)}}return n||i?(t.setContentType("application/json",!1),ni(e)):e}],transformResponse:[function(e){const t=ie(this,"transitional")||he.transitional,s=t&&t.forcedJSONParsing,i=ie(this,"responseType"),n=i==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(s&&!i||n)){const o=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e,ie(this,"parseReviver"))}catch(u){if(o)throw u.name==="SyntaxError"?g.from(u,g.ERR_BAD_RESPONSE,this,null,ie(this,"response")):u}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:q.classes.FormData,Blob:q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch","query"],r=>{he.headers[r]={}});function Ue(r,e){const t=this||he,s=e||t,i=K.from(s.headers);let n=s.data;return c.forEach(r,function(o){n=o.call(t,n,i.normalize(),e?e.status:void 0)}),i.normalize(),n}function Jt(r){return!!(r&&r.__CANCEL__)}let ge=class extends g{constructor(e,t,s){super(e??"canceled",g.ERR_CANCELED,t,s),this.name="CanceledError",this.__CANCEL__=!0}};function Xt(r,e,t){const s=t.config.validateStatus;!t.status||!s||s(t.status)?r(t):e(new g("Request failed with status code "+t.status,t.status>=400&&t.status<500?g.ERR_BAD_REQUEST:g.ERR_BAD_RESPONSE,t.config,t.request,t))}function ai(r){const e=/^([-+\w]{1,25}):(?:\/\/)?/.exec(r);return e&&e[1]||""}function oi(r,e){r=r||10;const t=new Array(r),s=new Array(r);let i=0,n=0,a;return e=e!==void 0?e:1e3,function(u){const l=Date.now(),d=s[n];a||(a=l),t[i]=u,s[i]=l;let m=n,p=0;for(;m!==i;)p+=t[m++],m=m%r;if(i=(i+1)%r,i===n&&(n=(n+1)%r),l-a<e)return;const f=d&&l-d;return f?Math.round(p*1e3/f):void 0}}function ci(r,e){let t=0,s=1e3/e,i,n;const a=(l,d=Date.now())=>{t=d,i=null,n&&(clearTimeout(n),n=null),r(...l)};return[(...l)=>{const d=Date.now(),m=d-t;m>=s?a(l,d):(i=l,n||(n=setTimeout(()=>{n=null,a(i)},s-m)))},()=>i&&a(i)]}const Ce=(r,e,t=3)=>{let s=0;const i=oi(50,250);return ci(n=>{if(!n||typeof n.loaded!="number")return;const a=n.loaded,o=n.lengthComputable?n.total:void 0,u=o!=null?Math.min(a,o):a,l=Math.max(0,u-s),d=i(l);s=Math.max(s,u);const m={loaded:u,total:o,progress:o?u/o:void 0,bytes:l,rate:d||void 0,estimated:d&&o?(o-u)/d:void 0,event:n,lengthComputable:o!=null,[e?"download":"upload"]:!0};r(m)},t)},gt=(r,e)=>{const t=r!=null;return[s=>e[0]({lengthComputable:t,total:r,loaded:s}),e[1]]},bt=r=>(...e)=>c.asap(()=>r(...e)),ui=q.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,q.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(q.origin),q.navigator&&/(msie|trident)/i.test(q.navigator.userAgent)):()=>!0,li=q.hasStandardBrowserEnv?{write(r,e,t,s,i,n,a){if(typeof document>"u")return;const o=[`${r}=${encodeURIComponent(e)}`];c.isNumber(t)&&o.push(`expires=${new Date(t).toUTCString()}`),c.isString(s)&&o.push(`path=${s}`),c.isString(i)&&o.push(`domain=${i}`),n===!0&&o.push("secure"),c.isString(a)&&o.push(`SameSite=${a}`),document.cookie=o.join("; ")},read(r){if(typeof document>"u")return null;const e=document.cookie.split(";");for(let t=0;t<e.length;t++){const s=e[t].replace(/^\s+/,""),i=s.indexOf("=");if(i!==-1&&s.slice(0,i)===r)try{return decodeURIComponent(s.slice(i+1))}catch{return s.slice(i+1)}}return null},remove(r){this.write(r,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function di(r){return typeof r!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function pi(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}const mi=/^https?:(?!\/\/)/i,yi=/[\t\n\r]/g;function fi(r){let e=0;for(;e<r.length&&r.charCodeAt(e)<=32;)e++;return r.slice(e)}function hi(r){return fi(r).replace(yi,"")}function vt(r,e){if(typeof r=="string"&&mi.test(hi(r)))throw new g('Invalid URL: missing "//" after protocol',g.ERR_INVALID_URL,e)}function Qt(r,e,t,s){vt(e,s);let i=!di(e);return r&&(i||t===!1)?(vt(r,s),pi(r,e)):e}const St=r=>r instanceof K?{...r}:r;function re(r,e){r=r||{},e=e||{};const t=Object.create(null);Object.defineProperty(t,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function s(d,m,p,f){return c.isPlainObject(d)&&c.isPlainObject(m)?c.merge.call({caseless:f},d,m):c.isPlainObject(m)?c.merge({},m):c.isArray(m)?m.slice():m}function i(d,m,p,f){if(c.isUndefined(m)){if(!c.isUndefined(d))return s(void 0,d,p,f)}else return s(d,m,p,f)}function n(d,m){if(!c.isUndefined(m))return s(void 0,m)}function a(d,m){if(c.isUndefined(m)){if(!c.isUndefined(d))return s(void 0,d)}else return s(void 0,m)}function o(d){const m=c.hasOwnProp(e,"transitional")?e.transitional:void 0;if(!c.isUndefined(m))if(c.isPlainObject(m)){if(c.hasOwnProp(m,d))return m[d]}else return;const p=c.hasOwnProp(r,"transitional")?r.transitional:void 0;if(c.isPlainObject(p)&&c.hasOwnProp(p,d))return p[d]}function u(d,m,p){if(c.hasOwnProp(e,p))return s(d,m);if(c.hasOwnProp(r,p))return s(void 0,d)}const l={url:n,method:n,data:n,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:u,headers:(d,m,p)=>i(St(d),St(m),p,!0)};return c.forEach(Object.keys({...r,...e}),function(m){if(m==="__proto__"||m==="constructor"||m==="prototype")return;const p=c.hasOwnProp(l,m)?l[m]:i,f=c.hasOwnProp(r,m)?r[m]:void 0,v=c.hasOwnProp(e,m)?e[m]:void 0,L=p(f,v,m);c.isUndefined(L)&&p!==u||(t[m]=L)}),c.hasOwnProp(e,"validateStatus")&&c.isUndefined(e.validateStatus)&&o("validateStatusUndefinedResolves")===!1&&(c.hasOwnProp(r,"validateStatus")?t.validateStatus=s(void 0,r.validateStatus):delete t.validateStatus),t}const gi=["content-type","content-length"];function bi(r,e,t){if(t!=="content-only"){r.set(e);return}Object.entries(e||{}).forEach(([s,i])=>{gi.includes(s.toLowerCase())&&r.set(s,i)})}const vi=r=>encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)));function Yt(r){const e=re({},r),t=p=>c.hasOwnProp(e,p)?e[p]:void 0,s=t("data");let i=t("withXSRFToken");const n=t("xsrfHeaderName"),a=t("xsrfCookieName");let o=t("headers");const u=t("auth"),l=t("baseURL"),d=t("allowAbsoluteUrls"),m=t("url");if(e.headers=o=K.from(o),e.url=Ht(Qt(l,m,d,e),t("params"),t("paramsSerializer")),u){const p=c.getSafeProp(u,"username")||"",f=c.getSafeProp(u,"password")||"";try{o.set("Authorization","Basic "+btoa(p+":"+(f?vi(f):"")))}catch(v){throw g.from(v,g.ERR_BAD_OPTION_VALUE,r)}}if(c.isFormData(s)&&(q.hasStandardBrowserEnv||q.hasStandardBrowserWebWorkerEnv||c.isReactNative(s)?o.setContentType(void 0):c.isFunction(s.getHeaders)&&bi(o,s.getHeaders(),t("formDataHeaderPolicy"))),q.hasStandardBrowserEnv&&(c.isFunction(i)&&(i=i(e)),i===!0||i==null&&ui(e.url))){const f=n&&a&&li.read(a);f&&o.set(n,f)}return e}const Si=typeof XMLHttpRequest<"u",Li=Si&&function(r){return new Promise(function(t,s){const i=Yt(r);let n=i.data;const a=K.from(i.headers).normalize();let{responseType:o,onUploadProgress:u,onDownloadProgress:l}=i,d,m,p,f,v;function L(){f&&f(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function y(){if(!b)return;const w=K.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),E={data:!o||o==="text"||o==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:w,config:r,request:b};Xt(function($){t($),L()},function($){s($),L()},E),b=null}"onloadend"in b?b.onloadend=y:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.startsWith("file:"))||setTimeout(y)},b.onabort=function(){b&&(s(new g("Request aborted",g.ECONNABORTED,r,b)),L(),b=null)},b.onerror=function(k){const E=k&&k.message?k.message:"Network Error",C=new g(E,g.ERR_NETWORK,r,b);C.event=k||null,s(C),L(),b=null},b.ontimeout=function(){let k=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||Qe;i.timeoutErrorMessage&&(k=i.timeoutErrorMessage),s(new g(k,E.clarifyTimeoutError?g.ETIMEDOUT:g.ECONNABORTED,r,b)),L(),b=null},n===void 0&&a.setContentType(null),"setRequestHeader"in b&&c.forEach(Ut(a),function(k,E){b.setRequestHeader(E,k)}),c.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),o&&o!=="json"&&(b.responseType=i.responseType),l&&([p,v]=Ce(l,!0),b.addEventListener("progress",p)),u&&b.upload&&([m,f]=Ce(u),b.upload.addEventListener("progress",m),b.upload.addEventListener("loadend",f)),(i.cancelToken||i.signal)&&(d=w=>{b&&(s(!w||w.type?new ge(null,r,b):w),b.abort(),L(),b=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const S=ai(i.url);if(S&&!q.protocols.includes(S)){s(new g("Unsupported protocol "+S+":",g.ERR_BAD_REQUEST,r)),L();return}b.send(n||null)})},wi=(r,e)=>{if(r=r?r.filter(Boolean):[],!e&&!r.length)return;const t=new AbortController;let s=!1;const i=function(u){if(!s){s=!0,a();const l=u instanceof Error?u:this.reason;t.abort(l instanceof g?l:new ge(l instanceof Error?l.message:l))}};let n=e&&setTimeout(()=>{n=null,i(new g(`timeout of ${e}ms exceeded`,g.ETIMEDOUT))},e);const a=()=>{r&&(n&&clearTimeout(n),n=null,r.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),r=null)};r.forEach(u=>u.addEventListener("abort",i,{once:!0}));const{signal:o}=t;return o.unsubscribe=()=>c.asap(a),o},Mi=function*(r,e){let t=r.byteLength;if(t<e){yield r;return}let s=0,i;for(;s<t;)i=s+e,yield r.slice(s,i),s=i},ki=async function*(r,e){for await(const t of Pi(r))yield*Mi(t,e)},Pi=async function*(r){if(r[Symbol.asyncIterator]){yield*r;return}const e=r.getReader();try{for(;;){const{done:t,value:s}=await e.read();if(t)break;yield s}}finally{await e.cancel()}},Lt=(r,e,t,s)=>{const i=ki(r,e);let n=0,a,o=u=>{a||(a=!0,s&&s(u))};return new ReadableStream({async pull(u){try{const{done:l,value:d}=await i.next();if(l){o(),u.close();return}let m=d.byteLength;if(t){let p=n+=m;t(p)}u.enqueue(new Uint8Array(d))}catch(l){throw o(l),l}},cancel(u){return o(u),i.return()}},{highWaterMark:2})},Re=r=>r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102,Ci=(r,e,t)=>e+2<t&&Re(r.charCodeAt(e+1))&&Re(r.charCodeAt(e+2));function Ri(r){if(!r||typeof r!="string"||!r.startsWith("data:"))return 0;const e=r.indexOf(",");if(e<0)return 0;const t=r.slice(5,e),s=r.slice(e+1);if(/;base64/i.test(t)){let a=s.length;const o=s.length;for(let f=0;f<o;f++)if(s.charCodeAt(f)===37&&f+2<o){const v=s.charCodeAt(f+1),L=s.charCodeAt(f+2);Re(v)&&Re(L)&&(a-=2,f+=2)}let u=0,l=o-1;const d=f=>f>=2&&s.charCodeAt(f-2)===37&&s.charCodeAt(f-1)===51&&(s.charCodeAt(f)===68||s.charCodeAt(f)===100);l>=0&&(s.charCodeAt(l)===61?(u++,l--):d(l)&&(u++,l-=3)),u===1&&l>=0&&(s.charCodeAt(l)===61||d(l))&&u++;const p=Math.floor(a/4)*3-(u||0);return p>0?p:0}let n=0;for(let a=0,o=s.length;a<o;a++){const u=s.charCodeAt(a);if(u===37&&Ci(s,a,o))n+=1,a+=2;else if(u<128)n+=1;else if(u<2048)n+=2;else if(u>=55296&&u<=56319&&a+1<o){const l=s.charCodeAt(a+1);l>=56320&&l<=57343?(n+=4,a++):n+=3}else n+=3}return n}const Ze="1.18.1",wt=64*1024,{isFunction:Le}=c,Ai=r=>encodeURIComponent(r).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Mt=r=>{if(!c.isString(r))return r;try{return decodeURIComponent(r)}catch{return r}},kt=(r,...e)=>{try{return!!r(...e)}catch{return!1}},Bi=r=>{const e=r.indexOf("://");let t=r;return e!==-1&&(t=t.slice(e+3)),t.includes("@")||t.includes(":")},qi=r=>{const e=c.global!==void 0&&c.global!==null?c.global:globalThis,{ReadableStream:t,TextEncoder:s}=e;r=c.merge.call({skipUndefined:!0},{Request:e.Request,Response:e.Response},r);const{fetch:i,Request:n,Response:a}=r,o=i?Le(i):typeof fetch=="function",u=Le(n),l=Le(a);if(!o)return!1;const d=o&&Le(t),m=o&&(typeof s=="function"?(y=>S=>y.encode(S))(new s):async y=>new Uint8Array(await new n(y).arrayBuffer())),p=u&&d&&kt(()=>{let y=!1;const S=new n(q.origin,{body:new t,method:"POST",get duplex(){return y=!0,"half"}}),w=S.headers.has("Content-Type");return S.body!=null&&S.body.cancel(),y&&!w}),f=l&&d&&kt(()=>c.isReadableStream(new a("").body)),v={stream:f&&(y=>y.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(y=>{!v[y]&&(v[y]=(S,w)=>{let k=S&&S[y];if(k)return k.call(S);throw new g(`Response type '${y}' is not supported`,g.ERR_NOT_SUPPORT,w)})});const L=async y=>{if(y==null)return 0;if(c.isBlob(y))return y.size;if(c.isSpecCompliantForm(y))return(await new n(q.origin,{method:"POST",body:y}).arrayBuffer()).byteLength;if(c.isArrayBufferView(y)||c.isArrayBuffer(y))return y.byteLength;if(c.isURLSearchParams(y)&&(y=y+""),c.isString(y))return(await m(y)).byteLength},b=async(y,S)=>{const w=c.toFiniteNumber(y.getContentLength());return w??L(S)};return async y=>{let{url:S,method:w,data:k,signal:E,cancelToken:C,timeout:$,onDownloadProgress:De,onUploadProgress:Ie,responseType:j,headers:V,withCredentials:be="same-origin",fetchOptions:it,maxContentLength:F,maxBodyLength:ve}=Yt(y);const ue=c.isNumber(F)&&F>-1,Ne=c.isNumber(ve)&&ve>-1,Dr=P=>c.hasOwnProp(y,P)?y[P]:void 0;let nt=i||fetch;j=j?(j+"").toLowerCase():"text";let W=wi([E,C&&C.toAbortSignal()],$),B=null;const X=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let se,le=null;const at=()=>new g("Request body larger than maxBodyLength limit",g.ERR_BAD_REQUEST,y,B);try{let P;const I=Dr("auth");if(I){const M=c.getSafeProp(I,"username")||"",D=c.getSafeProp(I,"password")||"";P={username:M,password:D}}if(Bi(S)){const M=new URL(S,q.origin);if(!P&&(M.username||M.password)){const D=Mt(M.username),H=Mt(M.password);P={username:D,password:H}}(M.username||M.password)&&(M.username="",M.password="",S=M.href)}if(P&&(V.delete("authorization"),V.set("Authorization","Basic "+btoa(Ai((P.username||"")+":"+(P.password||""))))),ue&&typeof S=="string"&&S.startsWith("data:")&&Ri(S)>F)throw new g("maxContentLength size of "+F+" exceeded",g.ERR_BAD_RESPONSE,y,B);if(Ne&&w!=="get"&&w!=="head"){const M=await L(k);if(typeof M=="number"&&isFinite(M)&&(se=M,M>ve))throw at()}const Se=Ne&&(c.isReadableStream(k)||c.isStream(k)),ot=(M,D,H)=>Lt(M,wt,Q=>{if(Ne&&Q>ve)throw le=at();D&&D(Q)},H);if(p&&w!=="get"&&w!=="head"&&(Ie||Se)){if(se=se??await b(V,k),se!==0||Se){let M=new n(S,{method:"POST",body:k,duplex:"half"}),D;if(c.isFormData(k)&&(D=M.headers.get("content-type"))&&V.setContentType(D),M.body){const[H,Q]=Ie&&gt(se,Ce(bt(Ie)))||[];k=ot(M.body,H,Q)}}}else if(Se&&!u&&d&&w!=="get"&&w!=="head")k=ot(k);else if(Se&&u&&!p&&w!=="get"&&w!=="head")throw new g("Stream request bodies are not supported by the current fetch implementation",g.ERR_NOT_SUPPORT,y,B);c.isString(be)||(be=be?"include":"omit");const Ir=u&&"credentials"in n.prototype;if(c.isFormData(k)){const M=V.getContentType();M&&/^multipart\/form-data/i.test(M)&&!/boundary=/i.test(M)&&V.delete("content-type")}V.set("User-Agent","axios/"+Ze,!1);const ct={...it,signal:W,method:w.toUpperCase(),headers:Ut(V.normalize()),body:k,duplex:"half",credentials:Ir?be:void 0};B=u&&new n(S,ct);let _=await(u?nt(B,it):nt(S,ct));const ut=K.from(_.headers);if(ue){const M=c.toFiniteNumber(ut.getContentLength());if(M!=null&&M>F)throw new g("maxContentLength size of "+F+" exceeded",g.ERR_BAD_RESPONSE,y,B)}const xe=f&&(j==="stream"||j==="response");if(f&&_.body&&(De||ue||xe&&X)){const M={};["status","statusText","headers"].forEach(de=>{M[de]=_[de]});const D=c.toFiniteNumber(ut.getContentLength()),[H,Q]=De&&gt(D,Ce(bt(De),!0))||[];let lt=0;const Nr=de=>{if(ue&&(lt=de,lt>F))throw new g("maxContentLength size of "+F+" exceeded",g.ERR_BAD_RESPONSE,y,B);H&&H(de)};_=new a(Lt(_.body,wt,Nr,()=>{Q&&Q(),X&&X()}),M)}j=j||"text";let U=await v[c.findKey(v,j)||"text"](_,y);if(ue&&!f&&!xe){let M;if(U!=null&&(typeof U.byteLength=="number"?M=U.byteLength:typeof U.size=="number"?M=U.size:typeof U=="string"&&(M=typeof s=="function"?new s().encode(U).byteLength:U.length)),typeof M=="number"&&M>F)throw new g("maxContentLength size of "+F+" exceeded",g.ERR_BAD_RESPONSE,y,B)}return!xe&&X&&X(),await new Promise((M,D)=>{Xt(M,D,{data:U,headers:K.from(_.headers),status:_.status,statusText:_.statusText,config:y,request:B})})}catch(P){if(X&&X(),W&&W.aborted&&W.reason instanceof g){const I=W.reason;throw I.config=y,B&&(I.request=B),P!==I&&Object.defineProperty(I,"cause",{__proto__:null,value:P,writable:!0,enumerable:!1,configurable:!0}),I}if(le)throw B&&!le.request&&(le.request=B),le;if(P instanceof g)throw B&&!P.request&&(P.request=B),P;if(P&&P.name==="TypeError"&&/Load failed|fetch/i.test(P.message)){const I=new g("Network Error",g.ERR_NETWORK,y,B,P&&P.response);throw Object.defineProperty(I,"cause",{__proto__:null,value:P.cause||P,writable:!0,enumerable:!1,configurable:!0}),I}throw g.from(P,P&&P.code,y,B,P&&P.response)}}},Ei=new Map,Zt=r=>{let e=r&&r.env||{};const{fetch:t,Request:s,Response:i}=e,n=[s,i,t];let a=n.length,o=a,u,l,d=Ei;for(;o--;)u=n[o],l=d.get(u),l===void 0&&d.set(u,l=o?new Map:qi(e)),d=l;return l};Zt();const et={http:Vs,xhr:Li,fetch:{get:Zt}};c.forEach(et,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{__proto__:null,value:e})}catch{}Object.defineProperty(r,"adapterName",{__proto__:null,value:e})}});const Pt=r=>`- ${r}`,Oi=r=>c.isFunction(r)||r===null||r===!1;function Ki(r,e){r=c.isArray(r)?r:[r];const{length:t}=r;let s,i;const n={};for(let a=0;a<t;a++){s=r[a];let o;if(i=s,!Oi(s)&&(i=et[(o=String(s)).toLowerCase()],i===void 0))throw new g(`Unknown adapter '${o}'`);if(i&&(c.isFunction(i)||(i=i.get(e))))break;n[o||"#"+a]=i}if(!i){const a=Object.entries(n).map(([u,l])=>`adapter ${u} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
4
+ `+a.map(Pt).join(`
5
+ `):" "+Pt(a[0]):"as no adapter specified";throw new g("There is no suitable adapter to dispatch the request "+o,g.ERR_NOT_SUPPORT)}return i}const er={getAdapter:Ki,adapters:et};function $e(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new ge(null,r)}function Ct(r){return $e(r),r.headers=K.from(r.headers),r.data=Ue.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),er.getAdapter(r.adapter||he.adapter,r)(r).then(function(s){$e(r),r.response=s;try{s.data=Ue.call(r,r.transformResponse,s)}finally{delete r.response}return s.headers=K.from(s.headers),s},function(s){if(!Jt(s)&&($e(r),s&&s.response)){r.response=s.response;try{s.response.data=Ue.call(r,r.transformResponse,s.response)}finally{delete r.response}s.response.headers=K.from(s.response.headers)}return Promise.reject(s)})}const Ee={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{Ee[r]=function(s){return typeof s===r||"a"+(e<1?"n ":" ")+r}});const Rt={};Ee.transitional=function(e,t,s){function i(n,a){return"[Axios v"+Ze+"] Transitional option '"+n+"'"+a+(s?". "+s:"")}return(n,a,o)=>{if(e===!1)throw new g(i(a," has been removed"+(t?" in "+t:"")),g.ERR_DEPRECATED);return t&&!Rt[a]&&(Rt[a]=!0,console.warn(i(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(n,a,o):!0}};Ee.spelling=function(e){return(t,s)=>(console.warn(`${s} is likely a misspelling of ${e}`),!0)};function Ti(r,e,t){if(typeof r!="object"||r===null)throw new g("options must be an object",g.ERR_BAD_OPTION_VALUE);const s=Object.keys(r);let i=s.length;for(;i-- >0;){const n=s[i],a=Object.prototype.hasOwnProperty.call(e,n)?e[n]:void 0;if(a){const o=r[n],u=o===void 0||a(o,n,r);if(u!==!0)throw new g("option "+n+" must be "+u,g.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new g("Unknown option "+n,g.ERR_BAD_OPTION)}}const ke={assertOptions:Ti,validators:Ee},O=ke.validators;let Z=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ft,response:new ft}}async request(e,t){try{return await this._request(e,t)}catch(s){if(s instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const n=(()=>{if(!i.stack)return"";const a=i.stack.indexOf(`
6
+ `);return a===-1?"":i.stack.slice(a+1)})();try{if(!s.stack)s.stack=n;else if(n){const a=n.indexOf(`
7
+ `),o=a===-1?-1:n.indexOf(`
8
+ `,a+1),u=o===-1?"":n.slice(o+1);String(s.stack).endsWith(u)||(s.stack+=`
9
+ `+n)}}catch{}}throw s}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=re(this.defaults,t);const{transitional:s,paramsSerializer:i,headers:n}=t;s!==void 0&&ke.assertOptions(s,{silentJSONParsing:O.transitional(O.boolean),forcedJSONParsing:O.transitional(O.boolean),clarifyTimeoutError:O.transitional(O.boolean),legacyInterceptorReqResOrdering:O.transitional(O.boolean),advertiseZstdAcceptEncoding:O.transitional(O.boolean),validateStatusUndefinedResolves:O.transitional(O.boolean)},!1),i!=null&&(c.isFunction(i)?t.paramsSerializer={serialize:i}:ke.assertOptions(i,{encode:O.function,serialize:O.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),ke.assertOptions(t,{baseUrl:O.spelling("baseURL"),withXsrfToken:O.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=n&&c.merge(n.common,n[t.method]);n&&c.forEach(["delete","get","head","post","put","patch","query","common"],v=>{delete n[v]}),t.headers=K.concat(a,n);const o=[];let u=!0;this.interceptors.request.forEach(function(L){if(typeof L.runWhen=="function"&&L.runWhen(t)===!1)return;u=u&&L.synchronous;const b=t.transitional||Qe;b&&b.legacyInterceptorReqResOrdering?o.unshift(L.fulfilled,L.rejected):o.push(L.fulfilled,L.rejected)});const l=[];this.interceptors.response.forEach(function(L){l.push(L.fulfilled,L.rejected)});let d,m=0,p;if(!u){const v=[Ct.bind(this),void 0];for(v.unshift(...o),v.push(...l),p=v.length,d=Promise.resolve(t);m<p;)d=d.then(v[m++],v[m++]);return d}p=o.length;let f=t;for(;m<p;){const v=o[m++],L=o[m++];try{f=v(f)}catch(b){L.call(this,b);break}}try{d=Ct.call(this,f)}catch(v){return Promise.reject(v)}for(m=0,p=l.length;m<p;)d=d.then(l[m++],l[m++]);return d}getUri(e){e=re(this.defaults,e);const t=Qt(e.baseURL,e.url,e.allowAbsoluteUrls,e);return Ht(t,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){Z.prototype[e]=function(t,s){return this.request(re(s||{},{method:e,url:t,data:s&&c.hasOwnProp(s,"data")?s.data:void 0}))}});c.forEach(["post","put","patch","query"],function(e){function t(s){return function(n,a,o){return this.request(re(o||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:a}))}}Z.prototype[e]=t(),e!=="query"&&(Z.prototype[e+"Form"]=t(!0))});let Di=class tr{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(n){t=n});const s=this;this.promise.then(i=>{if(!s._listeners)return;let n=s._listeners.length;for(;n-- >0;)s._listeners[n](i);s._listeners=null}),this.promise.then=i=>{let n;const a=new Promise(o=>{s.subscribe(o),n=o}).then(i);return a.cancel=function(){s.unsubscribe(n)},a},e(function(n,a,o){s.reason||(s.reason=new ge(n,a,o),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new tr(function(i){e=i}),cancel:e}}};function Ii(r){return function(t){return r.apply(null,t)}}function Ni(r){return c.isObject(r)&&r.isAxiosError===!0}const He={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(He).forEach(([r,e])=>{He[e]=r});function rr(r){const e=new Z(r),t=Ot(Z.prototype.request,e);return c.extend(t,Z.prototype,e,{allOwnKeys:!0}),c.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return rr(re(r,i))},t}const R=rr(he);R.Axios=Z;R.CanceledError=ge;R.CancelToken=Di;R.isCancel=Jt;R.VERSION=Ze;R.toFormData=qe;R.AxiosError=g;R.Cancel=R.CanceledError;R.all=function(e){return Promise.all(e)};R.spread=Ii;R.isAxiosError=Ni;R.mergeConfig=re;R.AxiosHeaders=K;R.formToJSON=r=>zt(c.isHTMLForm(r)?new FormData(r):r);R.getAdapter=er.getAdapter;R.HttpStatusCode=He;R.default=R;const{Axios:Un,AxiosError:$n,CanceledError:jn,isCancel:Vn,CancelToken:Wn,VERSION:Hn,all:Gn,Cancel:zn,isAxiosError:Jn,spread:Xn,toFormData:Qn,AxiosHeaders:Yn,HttpStatusCode:Zn,formToJSON:ea,getAdapter:ta,mergeConfig:ra,create:sa}=R;class Oe extends h.WBAPIError{constructor(e="Authentication failed. Please verify your API key is valid and has the required permissions.",t=401,s,i,n,a){super(e,t,s,i,n,a),this.name="AuthenticationError"}getUserMessage(){const e=super.getUserMessage(),t=[`
7
10
 
8
11
  To resolve this issue:`,"1. Verify your API key is valid and correctly formatted","2. Check that your API key has the required permissions for this operation","3. Ensure the Authorization header is properly set","4. Confirm your API key has not been revoked or expired"].join(`
9
- `);return e+t}}class Ie extends C{constructor(e="Rate limit exceeded. The SDK will automatically retry this request.",t,s,i,a,n){super(e,429,s,i,a,n),this.name="RateLimitError",this.retryAfter=t}getUserMessage(){const e=super.getUserMessage(),s=[`
12
+ `);return e+t}}class tt extends h.WBAPIError{constructor(e="Rate limit exceeded. The SDK will automatically retry this request.",t,s,i,n,a){super(e,429,s,i,n,a),this.name="RateLimitError",this.retryAfter=t}getUserMessage(){const e=super.getUserMessage(),s=[`
10
13
 
11
14
  Retry after: ${(this.retryAfter/1e3).toFixed(1)} seconds`,`
12
15
  The SDK will automatically retry this request.`,`
13
16
  If rate limiting occurs frequently, consider:`,"1. Implementing request batching to reduce API call frequency","2. Caching responses when appropriate","3. Reviewing your application's API usage patterns"].join(`
14
- `);return e+s}toJSON(){return{...super.toJSON(),statusCode:this.statusCode??429,retryAfter:this.retryAfter}}}class g extends C{constructor(e="Validation failed. Please check the request data and try again.",t,s=400,i,a){super(e,s,i,a),this.name="ValidationError",this.fieldErrors=t}getUserMessage(){const e=super.getUserMessage();if(this.fieldErrors&&Object.keys(this.fieldErrors).length>0){const i=[`
15
-
16
- Field validation errors:`,Object.entries(this.fieldErrors).map(([a,n])=>` - ${a}: ${n}`).join(`
17
- `),`
18
- Please correct the above fields and try again.`].join(`
19
- `);return e+i}const t=[`
20
-
21
- To resolve this issue:`,"1. Ensure all required fields are provided","2. Verify that field values meet the API specifications","3. Check that data types and formats are correct","4. Review the API documentation for field requirements"].join(`
22
- `);return e+t}toJSON(){return{...super.toJSON(),statusCode:this.statusCode??400,fieldErrors:this.fieldErrors}}}class G extends C{constructor(e,t=!1,s,i,a,n){super(e,s,a,n),this.name="NetworkError",this.isTimeout=t,this.cause=i}getUserMessage(){const e=super.getUserMessage();let t;return this.isTimeout?t=[`
17
+ `);return e+s}toJSON(){return{...super.toJSON(),statusCode:this.statusCode??429,retryAfter:this.retryAfter}}}class ee extends h.WBAPIError{constructor(e,t=!1,s,i,n,a){super(e,s,n,a),this.name="NetworkError",this.isTimeout=t,this.cause=i}getUserMessage(){const e=super.getUserMessage();let t;return this.isTimeout?t=[`
23
18
 
24
19
  This request timed out after 30 seconds.`,"The SDK automatically retried this request 3 times.",`
25
20
  To resolve timeout issues:`,"1. Check if the Wildberries API is experiencing high latency","2. Consider increasing the timeout configuration","3. Verify your network connection is stable","4. Try again later if the API is overloaded"].join(`
@@ -31,37 +26,37 @@ To resolve server errors:`,"1. Wait a few moments and try again","2. Check the W
31
26
 
32
27
  Network connection failed.`,"The SDK automatically retried this request 3 times.",`
33
28
  To resolve connection issues:`,"1. Check your internet connection","2. Verify network firewalls allow HTTPS connections","3. Ensure DNS resolution is working properly","4. Try again when network connectivity is restored"].join(`
34
- `),e+t}toJSON(){return{...super.toJSON(),isTimeout:this.isTimeout}}}class zs extends C{constructor(e,t,s){super(`Campaign not found: ${e}`,404,t,s),this.name="CampaignNotFoundError",this.campaignId=e}getUserMessage(){const e=super.getUserMessage(),t=[`
29
+ `),e+t}toJSON(){return{...super.toJSON(),isTimeout:this.isTimeout}}}class xi extends h.WBAPIError{constructor(e,t,s){super(`Campaign not found: ${e}`,404,t,s),this.name="CampaignNotFoundError",this.campaignId=e}getUserMessage(){const e=super.getUserMessage(),t=[`
35
30
 
36
31
  To resolve this issue:`,`1. Verify that campaign ID ${this.campaignId} is correct`,"2. Check if the campaign was deleted","3. Ensure you have access to this campaign in your account","4. Use getCampaignCount() to list all available campaigns"].join(`
37
- `);return e+t}toJSON(){return{...super.toJSON(),statusCode:404,campaignId:this.campaignId}}}class Js extends g{constructor(e,t,s,i){const a=t!=null&&t.field?{[t.field]:e}:{bid:e};super(e,a,400,s,i),this.name="InvalidBidError",this.minBid=t==null?void 0:t.minBid,this.maxBid=t==null?void 0:t.maxBid,this.currentBid=t==null?void 0:t.currentBid}getUserMessage(){const e=super.getUserMessage(),t=[];if(this.minBid!==void 0&&t.push(`Minimum bid: ${this.minBid} руб.`),this.maxBid!==void 0&&t.push(`Maximum bid: ${this.maxBid} руб.`),this.currentBid!==void 0&&t.push(`Your bid: ${this.currentBid} руб.`),t.length>0){const s=[`
32
+ `);return e+t}toJSON(){return{...super.toJSON(),statusCode:404,campaignId:this.campaignId}}}class Fi extends h.ValidationError{constructor(e,t,s,i){const n=t!=null&&t.field?{[t.field]:e}:{bid:e};super(e,n,400,s,i),this.name="InvalidBidError",this.minBid=t==null?void 0:t.minBid,this.maxBid=t==null?void 0:t.maxBid,this.currentBid=t==null?void 0:t.currentBid}getUserMessage(){const e=super.getUserMessage(),t=[];if(this.minBid!==void 0&&t.push(`Minimum bid: ${this.minBid} руб.`),this.maxBid!==void 0&&t.push(`Maximum bid: ${this.maxBid} руб.`),this.currentBid!==void 0&&t.push(`Your bid: ${this.currentBid} руб.`),t.length>0){const s=[`
38
33
 
39
34
  Bid requirements:`,...t.map(i=>` - ${i}`),`
40
35
  Please adjust your bid to meet these requirements.`].join(`
41
- `);return e+s}return e}toJSON(){return{...super.toJSON(),minBid:this.minBid,maxBid:this.maxBid,currentBid:this.currentBid}}}class Xs extends C{constructor(e,t,s,i){super(e,400,s,i),this.name="BudgetExceededError",this.availableBudget=t==null?void 0:t.availableBudget,this.requiredBudget=t==null?void 0:t.requiredBudget}getUserMessage(){const e=super.getUserMessage(),t=[];if(this.availableBudget!==void 0&&t.push(`Available budget: ${this.availableBudget} руб.`),this.requiredBudget!==void 0&&t.push(`Required budget: ${this.requiredBudget} руб.`),t.length>0){const i=[`
36
+ `);return e+s}return e}toJSON(){return{...super.toJSON(),minBid:this.minBid,maxBid:this.maxBid,currentBid:this.currentBid}}}class _i extends h.WBAPIError{constructor(e,t,s,i){super(e,400,s,i),this.name="BudgetExceededError",this.availableBudget=t==null?void 0:t.availableBudget,this.requiredBudget=t==null?void 0:t.requiredBudget}getUserMessage(){const e=super.getUserMessage(),t=[];if(this.availableBudget!==void 0&&t.push(`Available budget: ${this.availableBudget} руб.`),this.requiredBudget!==void 0&&t.push(`Required budget: ${this.requiredBudget} руб.`),t.length>0){const i=[`
42
37
 
43
- Budget information:`,...t.map(a=>` - ${a}`),`
38
+ Budget information:`,...t.map(n=>` - ${n}`),`
44
39
  To resolve this issue:`,"1. Check your account balance using getAdvBalance()","2. Add funds to your advertising account","3. Reduce the requested budget or bid amounts","4. Contact Wildberries support for account limit increases"].join(`
45
40
  `);return e+i}const s=[`
46
41
 
47
42
  To resolve this issue:`,"1. Check your account balance using getAdvBalance()","2. Add funds to your advertising account","3. Verify campaign budget limits"].join(`
48
- `);return e+s}toJSON(){return{...super.toJSON(),statusCode:400,availableBudget:this.availableBudget,requiredBudget:this.requiredBudget}}}class Qs extends C{constructor(e,t,s,i,a){super(`Cannot ${t} campaign in ${e} state`,400,i,a),this.name="InvalidCampaignStateError",this.currentState=e,this.attemptedAction=t,this.validStates=s}getUserMessage(){const e=super.getUserMessage(),t=[`
43
+ `);return e+s}toJSON(){return{...super.toJSON(),statusCode:400,availableBudget:this.availableBudget,requiredBudget:this.requiredBudget}}}class Ui extends h.WBAPIError{constructor(e,t,s,i,n){super(`Cannot ${t} campaign in ${e} state`,400,i,n),this.name="InvalidCampaignStateError",this.currentState=e,this.attemptedAction=t,this.validStates=s}getUserMessage(){const e=super.getUserMessage(),t=[`
49
44
 
50
45
  Campaign state information:`,` - Current state: ${this.currentState}`];this.validStates&&this.validStates.length>0&&t.push(` - Valid states for ${this.attemptedAction}: ${this.validStates.join(", ")}`);const s=[`
51
46
  Valid state transitions:`," - Ready (4) → Active (9): Use startCampaign()"," - Active (9) → Paused (11): Use pauseCampaign()"," - Paused (11) → Active (9): Use startCampaign()"," - Active/Paused → Completed (7): Use stopCampaign()",`
52
47
  To resolve this issue:`,"1. Check current campaign state using getAdvertsV2()","2. Ensure campaign is in a valid state for this operation","3. Review campaign lifecycle documentation"].join(`
53
48
  `);return e+t.join(`
54
- `)+s}toJSON(){return{...super.toJSON(),statusCode:400,currentState:this.currentState,attemptedAction:this.attemptedAction,validStates:this.validStates}}}const Ys=/wrong bid value:\s*(?<received>-?\d+)\s*;\s*min:\s*(?<min>-?\d+)(?:\s*;\s*max:\s*(?<max>-?\d+))?/i;function Et(r){if(typeof r!="string")return null;const e=Ys.exec(r),t=(e==null?void 0:e.groups)??void 0;if(!t)return null;const s=Number(t.received),i=Number(t.min);if(Number.isNaN(s)||Number.isNaN(i))return null;const a={received:s,min:i};if(t.max!==void 0){const n=Number(t.max);Number.isNaN(n)||(a.max=n)}return a}class Fe extends g{constructor(e,t,s,i){const a={[(t==null?void 0:t.field)??"bid"]:e};super(e,a,400,s,i),this.name="BidOutOfRangeError",this.received=t==null?void 0:t.received,this.min=t==null?void 0:t.min,this.max=t==null?void 0:t.max}getUserMessage(){const e=super.getUserMessage(),t=[];if(this.received!==void 0&&t.push(`Your bid: ${this.received.toString()}`),this.min!==void 0&&t.push(`Minimum accepted: ${this.min.toString()}`),this.max!==void 0&&t.push(`Maximum accepted: ${this.max.toString()}`),t.length>0){const s=[`
49
+ `)+s}toJSON(){return{...super.toJSON(),statusCode:400,currentState:this.currentState,attemptedAction:this.attemptedAction,validStates:this.validStates}}}const $i=/wrong bid value:\s*(?<received>-?\d+)\s*;\s*min:\s*(?<min>-?\d+)(?:\s*;\s*max:\s*(?<max>-?\d+))?/i;function sr(r){if(typeof r!="string")return null;const e=$i.exec(r),t=(e==null?void 0:e.groups)??void 0;if(!t)return null;const s=Number(t.received),i=Number(t.min);if(Number.isNaN(s)||Number.isNaN(i))return null;const n={received:s,min:i};if(t.max!==void 0){const a=Number(t.max);Number.isNaN(a)||(n.max=a)}return n}class rt extends h.ValidationError{constructor(e,t,s,i){const n={[(t==null?void 0:t.field)??"bid"]:e};super(e,n,400,s,i),this.name="BidOutOfRangeError",this.received=t==null?void 0:t.received,this.min=t==null?void 0:t.min,this.max=t==null?void 0:t.max}getUserMessage(){const e=super.getUserMessage(),t=[];if(this.received!==void 0&&t.push(`Your bid: ${this.received.toString()}`),this.min!==void 0&&t.push(`Minimum accepted: ${this.min.toString()}`),this.max!==void 0&&t.push(`Maximum accepted: ${this.max.toString()}`),t.length>0){const s=[`
55
50
 
56
51
  Bid out of range:`,...t.map(i=>` - ${i}`),`
57
52
  Adjust your bid to fall within the accepted range and retry.`].join(`
58
- `);return e+s}return e}toJSON(){return{...super.toJSON(),received:this.received,min:this.min,max:this.max}}}class Zs extends C{constructor(e,t){super(`Pickup order not found: ${e}`,404,{orderId:e,errorType:"OrderNotFound"},t),this.orderId=e,this.name="PickupOrderNotFoundError"}getUserMessage(){return`Pickup order ${this.orderId} was not found. Please verify the order ID and try again. The order may have been cancelled or does not exist.`}}class ei extends C{constructor(e,t,s,i){const a=t?` in ${t} state`:"";super(`Cannot ${s} order ${e}${a}. Invalid state transition.`,409,{orderId:e,currentState:t,attemptedAction:s,errorType:"StatusMismatch"},i),this.orderId=e,this.currentState=t,this.attemptedAction=s,this.name="InvalidOrderStateError"}getUserMessage(){return`${this.currentState?`The order is currently in "${this.currentState}" state and`:"The order"} cannot be transitioned to "${this.attemptedAction}". Please check the current order status using getOrderStatuses() and ensure you follow the correct state transition sequence: new → confirm → prepare → receive/reject. Note: This 409 response counts as 10 requests toward your rate limit.`}}class ti extends C{constructor(e,t,s){super(`Customer verification failed for order ${e}: ${t}`,409,{orderCode:e,errorType:"InvalidPasscode"},s),this.orderCode=e,this.name="CustomerVerificationError"}getUserMessage(){return`Customer identity verification failed for order ${this.orderCode}. The passcode provided does not match. Please ask the customer to check their Wildberries app for the correct passcode. Note: This 409 response counts as 10 requests toward your rate limit. Be careful not to exceed the 30 requests/minute limit for this endpoint.`}}class ri extends C{constructor(e,t,s,i){super(s,409,{codeType:e,orderId:t,errorType:"FailedToUpdateMeta"},i),this.codeType=e,this.orderId=t,this.name="MetadataValidationError"}getUserMessage(){return`Failed to set ${this.codeType} metadata for order ${this.orderId}. Please ensure: 1) Order is in "confirm" status, 2) "${this.codeType.toLowerCase()}" is in the order's requiredMeta list, 3) Code format is valid, 4) For UIN/IMEI/GTIN: delivery is by WB. Use getNewOrders() to check requiredMeta and getOrderStatuses() to check status. Note: This 409 response counts as 10 requests toward your rate limit.`}}class ve extends C{constructor(e,t,s,i,a,n,o){super(e,409,i,a,n,o),this.name="MetaValidationFailError",this.code=t,this.metaDetails=[...s]}getUserMessage(){const e=super.getUserMessage(),t=this.metaDetails.filter(a=>a.decision==="invalid"),s=this.metaDetails.filter(a=>a.decision==="required"),i=[e];return t.length>0&&i.push(`
53
+ `);return e+s}return e}toJSON(){return{...super.toJSON(),received:this.received,min:this.min,max:this.max}}}class ji extends h.WBAPIError{constructor(e,t){super(`Pickup order not found: ${e}`,404,{orderId:e,errorType:"OrderNotFound"},t),this.orderId=e,this.name="PickupOrderNotFoundError"}getUserMessage(){return`Pickup order ${this.orderId} was not found. Please verify the order ID and try again. The order may have been cancelled or does not exist.`}}class Vi extends h.WBAPIError{constructor(e,t,s,i){const n=t?` in ${t} state`:"";super(`Cannot ${s} order ${e}${n}. Invalid state transition.`,409,{orderId:e,currentState:t,attemptedAction:s,errorType:"StatusMismatch"},i),this.orderId=e,this.currentState=t,this.attemptedAction=s,this.name="InvalidOrderStateError"}getUserMessage(){return`${this.currentState?`The order is currently in "${this.currentState}" state and`:"The order"} cannot be transitioned to "${this.attemptedAction}". Please check the current order status using getOrderStatuses() and ensure you follow the correct state transition sequence: new → confirm → prepare → receive/reject. Note: This 409 response counts as 10 requests toward your rate limit.`}}class Wi extends h.WBAPIError{constructor(e,t,s){super(`Customer verification failed for order ${e}: ${t}`,409,{orderCode:e,errorType:"InvalidPasscode"},s),this.orderCode=e,this.name="CustomerVerificationError"}getUserMessage(){return`Customer identity verification failed for order ${this.orderCode}. The passcode provided does not match. Please ask the customer to check their Wildberries app for the correct passcode. Note: This 409 response counts as 10 requests toward your rate limit. Be careful not to exceed the 30 requests/minute limit for this endpoint.`}}class Hi extends h.WBAPIError{constructor(e,t,s,i){super(s,409,{codeType:e,orderId:t,errorType:"FailedToUpdateMeta"},i),this.codeType=e,this.orderId=t,this.name="MetadataValidationError"}getUserMessage(){return`Failed to set ${this.codeType} metadata for order ${this.orderId}. Please ensure: 1) Order is in "confirm" status, 2) "${this.codeType.toLowerCase()}" is in the order's requiredMeta list, 3) Code format is valid, 4) For UIN/IMEI/GTIN: delivery is by WB. Use getNewOrders() to check requiredMeta and getOrderStatuses() to check status. Note: This 409 response counts as 10 requests toward your rate limit.`}}class Ke extends h.WBAPIError{constructor(e,t,s,i,n,a,o){super(e,409,i,n,a,o),this.name="MetaValidationFailError",this.code=t,this.metaDetails=[...s]}getUserMessage(){const e=super.getUserMessage(),t=this.metaDetails.filter(n=>n.decision==="invalid"),s=this.metaDetails.filter(n=>n.decision==="required"),i=[e];return t.length>0&&i.push(`
59
54
 
60
- Invalid marking codes (${t.length.toString()}):`,...t.map(a=>` - ${a.key}: "${a.value}"`)),s.length>0&&i.push(`
55
+ Invalid marking codes (${t.length.toString()}):`,...t.map(n=>` - ${n.key}: "${n.value}"`)),s.length>0&&i.push(`
61
56
 
62
- Missing required marking codes (${s.length.toString()}):`,...s.map(a=>` - ${a.key}`)),i.push(`
57
+ Missing required marking codes (${s.length.toString()}):`,...s.map(n=>` - ${n.key}`)),i.push(`
63
58
 
64
59
  Recovery steps:`,"1. Use sdk.ordersFBS.getOrdersMetaBulk() to pre-flight check marking codes before deliver","2. Ensure marking codes include GS separators (ASCII 0x1D) and crypto-tail in full","3. Fix the flagged assembly tasks, then retry updateSuppliesDeliver()",`
65
60
  ⚠️ Each 409 response counts as 10 requests against the rate-limit budget.`),i.join(`
66
- `)}toJSON(){return{...super.toJSON(),code:this.code,metaDetails:this.metaDetails}}}class Dt extends C{constructor(e,t,s,i,a){super(e,406,t,s,i,a)}getUserMessage(){return`${this.message} The warehouse is processing — retry the inventory update later.`}}class si{constructor(e){this.capacity=e.burstLimit??e.requestsPerMinute,this.tokens=this.capacity,this.refillRate=e.requestsPerMinute/6e4,this.lastRefill=Date.now(),this.queue=[]}refill(){const e=Date.now(),s=(e-this.lastRefill)*this.refillRate;this.tokens=Math.min(this.capacity,this.tokens+s),this.lastRefill=e}async consume(){if(this.refill(),this.tokens>=1){this.tokens-=1;return}return new Promise(e=>{this.queue.push(e),this.scheduleNextRelease()})}scheduleNextRelease(){if(this.queue.length===0)return;const e=1/this.refillRate;setTimeout(()=>{if(this.refill(),this.tokens>=1&&this.queue.length>0){this.tokens-=1;const t=this.queue.shift();t&&t(),this.queue.length>0&&this.scheduleNextRelease()}},e)}getAvailableTokens(){return this.refill(),this.tokens}}class ii{constructor(e){this.buckets=new Map,this.config=e??{}}async waitForSlot(e){const t=this.getOrCreateBucket(e);t&&await t.consume()}getOrCreateBucket(e){if(this.buckets.has(e))return this.buckets.get(e)??null;if(!(e in this.config))return null;const t=this.config[e],s=new si(t);return this.buckets.set(e,s),s}configure(e,t){this.config[e]=t,this.buckets.delete(e)}getConfiguration(e){return e in this.config?this.config[e]:void 0}canProceed(e){const t=this.getOrCreateBucket(e);return t?t.getAvailableTokens()>=1:!0}getRemainingTokens(e){const t=this.getOrCreateBucket(e);return t?t.getAvailableTokens():1/0}reset(e){e?this.buckets.delete(e):this.buckets.clear()}}const U={"general.ping":{readonly:!0,category:"all",rateLimitKey:"general.ping"},"general.news":{readonly:!0,category:"commonapi",rateLimitKey:"general.communicationsNews"},"general.sellerInfo":{readonly:!0,category:"commonapi",rateLimitKey:"general.sellerInfo"},"products.getParentAll":{readonly:!0,category:"content",rateLimitKey:"products.contentObjectParentAll"},"products.getObjectAll":{readonly:!0,category:"content",rateLimitKey:"products.contentObjectAll"},"products.getObjectCharc":{readonly:!0,category:"content",rateLimitKey:"products.contentObjectCharcs"},"products.getDirectoryColors":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryColors"},"products.getDirectoryKinds":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryKinds"},"products.getDirectoryCountries":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryCountries"},"products.getDirectorySeasons":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectorySeasons"},"products.getDirectoryVat":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryVat"},"products.getDirectoryTnved":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryTnved"},"products.getBrands":{readonly:!0,category:"content",rateLimitKey:"products.brands"},"products.getContentTags":{readonly:!0,category:"content",rateLimitKey:"products.contentTags"},"products.createContentTag":{readonly:!1,category:"content",rateLimitKey:"products.postContentTag"},"products.updateContentTag":{readonly:!1,category:"content",rateLimitKey:"products.patchContentTag"},"products.deleteContentTag":{readonly:!1,category:"content",rateLimitKey:"products.deleteContentTag"},"products.createNomenclatureLink":{readonly:!1,category:"content",rateLimitKey:"products.postContentTagNomenclatureLink"},"products.getCardsList":{readonly:!0,category:"content",rateLimitKey:"products.postContentGetCardsList"},"products.createErrorList":{readonly:!0,category:"content",rateLimitKey:"products.postContentCardsErrorList"},"products.createCardsUpdate":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsUpdate"},"products.createCardsMovenm":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsMoveNm"},"products.createDeleteTrash":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsDeleteTrash"},"products.createCardsRecover":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsRecover"},"products.getTrashedCards":{readonly:!0,category:"content",rateLimitKey:"products.postContentGetCardsTrash"},"products.getCardsLimits":{readonly:!0,category:"content",rateLimitKey:"products.contentCardsLimits"},"products.createContentBarcode":{readonly:!1,category:"content",rateLimitKey:"products.postContentBarcodes"},"products.createCardsUpload":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsUpload"},"products.createUploadAdd":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsUploadAdd"},"products.createMediaFile":{readonly:!1,category:"content",rateLimitKey:"products.postContentMediaFile"},"products.createMediaSave":{readonly:!1,category:"content",rateLimitKey:"products.postContentMediaSave"},"products.createUploadTask":{readonly:!1,category:"discountsandprices",rateLimitKey:"products.postUploadTask"},"products.createTaskSize":{readonly:!1,category:"discountsandprices",rateLimitKey:"products.postUploadTaskSize"},"products.createTaskClubDiscount":{readonly:!1,category:"discountsandprices",rateLimitKey:"products.postUploadTaskClubDiscount"},"products.getHistoryTasks":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.historyTasks"},"products.getGoodsTask":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.historyGoodsTask"},"products.getBufferTasks":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.bufferTasks"},"products.getBufferGoodsTask":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.bufferGoodsTask"},"products.getGoodsFilter":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.listGoodsFilter"},"products.createGoodsFilter":{readonly:!1,category:"discountsandprices",rateLimitKey:"products.postListGoodsFilter"},"products.getSizeNm":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.listGoodsSizeNm"},"products.getQuarantineGoods":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.quarantineGoods"},"products.getStocks":{readonly:!1,category:"marketplace",rateLimitKey:"products.postStocks"},"products.updateStock":{readonly:!1,category:"marketplace",rateLimitKey:"products.putStocks"},"products.deleteStock":{readonly:!1,category:"marketplace",rateLimitKey:"products.deleteStocks"},"products.offices":{readonly:!0,category:"marketplace",rateLimitKey:"products.offices"},"products.warehouses":{readonly:!0,category:"marketplace",rateLimitKey:"products.warehouses"},"products.createWarehouse":{readonly:!1,category:"marketplace",rateLimitKey:"products.postWarehouses"},"products.updateWarehouse":{readonly:!1,category:"marketplace",rateLimitKey:"products.putWarehouses"},"products.deleteWarehouse":{readonly:!1,category:"marketplace",rateLimitKey:"products.deleteWarehouses"},"products.getWarehousesContact":{readonly:!0,category:"marketplace",rateLimitKey:"products.dbwWarehousesContacts"},"products.updateWarehousesContact":{readonly:!1,category:"marketplace",rateLimitKey:"products.putDbwWarehousesContacts"},"userManagement.createInvite":{readonly:!1,category:"usermanagement",rateLimitKey:"userManagement.createInvite"},"userManagement.getUsers":{readonly:!0,category:"usermanagement",rateLimitKey:"userManagement.getUsers"},"userManagement.updateUserAccess":{readonly:!1,category:"usermanagement",rateLimitKey:"userManagement.updateUserAccess"},"userManagement.deleteUser":{readonly:!1,category:"usermanagement",rateLimitKey:"userManagement.deleteUser"},"ordersFBS.getPassesOffices":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.passesOffices"},"ordersFBS.passes":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.passes"},"ordersFBS.createPass":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.postPasses"},"ordersFBS.updatePass":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putPasses"},"ordersFBS.deletePass":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.deletePasses"},"ordersFBS.getOrdersNew":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.ordersNew"},"ordersFBS.orders":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.orders"},"ordersFBS.createOrdersStatu":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStatus"},"ordersFBS.getOrderStatuses":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStatus"},"ordersFBS.getOrdersReshipment":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.suppliesOrdersReshipment"},"ordersFBS.updateOrdersCancel":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.patchOrdersCancel"},"ordersFBS.createOrdersSticker":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStickers"},"ordersFBS.createStickersCrossBorder":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStickersCrossBorder"},"ordersFBS.createOrdersExternalSticker":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postFilesOrdersExternalStickers"},"ordersFBS.createStatusHistory":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStatusHistory"},"ordersFBS.createOrdersClient":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersClient"},"ordersFBS.getOrdersMetaBulk":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postMarketplaceOrdersMeta"},"ordersFBS.getOrdersMeta":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postMarketplaceOrdersMeta"},"ordersFBS.deleteOrdersMeta":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.deleteOrdersMeta"},"ordersFBS.updateMetaSgtin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaSgtin"},"ordersFBS.updateMetaUin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaUin"},"ordersFBS.updateMetaImei":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaImei"},"ordersFBS.updateMetaGtin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaGtin"},"ordersFBS.updateMetaExpiration":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaExpiration"},"ordersFBS.setCustomsDeclaration":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaCustomsDeclaration"},"ordersFBS.supplies":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.supplies"},"ordersFBS.createSupply":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.postSupplies"},"ordersFBS.updateSuppliesOrder":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.patchSuppliesOrders"},"ordersFBS.addOrdersToSupply":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.patchMarketplaceSuppliesOrders"},"ordersFBS.getSupply":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.getSupply"},"ordersFBS.deleteSupply":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.deleteSupplies"},"ordersFBS.getSuppliesOrder":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.suppliesOrders"},"ordersFBS.getSupplyOrderIds":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.getMarketplaceSuppliesOrderIds"},"ordersFBS.updateSuppliesDeliver":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.patchSuppliesDeliver"},"ordersFBS.getSuppliesBarcode":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.suppliesBarcode"},"ordersFBS.getSuppliesTrbx":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.suppliesTrbx"},"ordersFBS.createSuppliesTrbx":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.postSuppliesTrbx"},"ordersFBS.deleteSuppliesTrbx":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.deleteSuppliesTrbx"},"ordersFBS.createTrbxSticker":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postSuppliesTrbxStickers"},"ordersDBS.getNewOrders":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getNewOrders"},"ordersDBS.getOrders":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getOrders"},"ordersDBS.getGroupsInfo":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getGroupsInfo"},"ordersDBS.getClientInfo":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getClientInfo"},"ordersDBS.getB2BInfo":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getB2BInfo"},"ordersDBS.getDeliveryDates":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getDeliveryDates"},"ordersDBS.getMeta":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getMeta"},"ordersDBS.deleteMeta":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.deleteMeta"},"ordersDBS.deleteMetaBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.deleteMetaBulk"},"ordersDBS.setSgtin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setSgtinBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setSgtinBulk"},"ordersDBS.setUin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setUinBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setUinBulk"},"ordersDBS.setImei":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setImeiBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setImeiBulk"},"ordersDBS.setGtin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setGtinBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setGtinBulk"},"ordersDBS.setCustomsDeclaration":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setCustomsDeclarationBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setCustomsDeclarationBulk"},"ordersDBS.getStatuses":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getStatuses"},"ordersDBS.getStatusesBulk":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getStatusesBulk"},"ordersDBS.confirm":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.confirm"},"ordersDBS.confirmBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.confirmBulk"},"ordersDBS.deliver":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.deliver"},"ordersDBS.deliverBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.deliverBulk"},"ordersDBS.receive":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.receive"},"ordersDBS.receiveBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.receiveBulk"},"ordersDBS.reject":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.reject"},"ordersDBS.rejectBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.rejectBulk"},"ordersDBS.cancel":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.cancel"},"ordersDBS.cancelBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.cancelBulk"},"ordersFBW.getAcceptanceCoefficients":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.acceptanceCoefficients"},"ordersFBW.createAcceptanceOption":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.postAcceptanceOptions"},"ordersFBW.warehouses":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.warehouses"},"ordersFBW.transitTariffs":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.transitTariffs"},"ordersFBW.listSupplies":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.postSupplies"},"ordersFBW.createSupply":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.postSupplies"},"ordersFBW.getSupply":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.supplies"},"ordersFBW.getSuppliesGood":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.suppliesGoods"},"ordersFBW.getSuppliesPackage":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.suppliesPackage"},"promotion.getPromotionCount":{readonly:!0,category:"advert",rateLimitKey:"promotion.advPromotionCount"},"promotion.createPromotionAdvert":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvPromotionAdverts"},"promotion.getAdvertsV2":{readonly:!0,category:"advert",rateLimitKey:"promotion.advertsV2"},"promotion.getAdvConfig":{readonly:!0,category:"advert",rateLimitKey:"promotion.advConfig"},"promotion.createBidsMin":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvBidsMin"},"promotion.getBidsMinV2":{readonly:!0,category:"advert",rateLimitKey:"promotion.bidsMinV1"},"promotion.createAdvSaveAd":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvSaveAd"},"promotion.createSeacatSaveAd":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvSeacatSaveAd"},"promotion.getSupplierSubjects":{readonly:!0,category:"advert",rateLimitKey:"promotion.advSupplierSubjects"},"promotion.createSupplierNm":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvSupplierNms"},"promotion.getAdvDelete":{readonly:!1,category:"advert",rateLimitKey:"promotion.advDelete"},"promotion.createAdvRename":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvRename"},"promotion.getAdvStart":{readonly:!1,category:"advert",rateLimitKey:"promotion.advStart"},"promotion.getAdvPause":{readonly:!1,category:"advert",rateLimitKey:"promotion.advPause"},"promotion.getAdvStop":{readonly:!1,category:"advert",rateLimitKey:"promotion.advStop"},"promotion.updateAdvBid":{readonly:!1,category:"advert",rateLimitKey:"promotion.patchAdvBids"},"promotion.updateAuctionPlacement":{readonly:!1,category:"advert",rateLimitKey:"promotion.putAdvAuctionPlacements"},"promotion.updateAuctionNm":{readonly:!1,category:"advert",rateLimitKey:"promotion.patchAdvAuctionNms"},"promotion.getAdvBalance":{readonly:!0,category:"advert",rateLimitKey:"promotion.advBalance"},"promotion.getAdvBudget":{readonly:!0,category:"advert",rateLimitKey:"promotion.advBudget"},"promotion.createBudgetDeposit":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvBudgetDeposit"},"promotion.getAdvUpd":{readonly:!0,category:"advert",rateLimitKey:"promotion.advUpd"},"promotion.getAdvPayments":{readonly:!0,category:"advert",rateLimitKey:"promotion.advPayments"},"promotion.getSearchSetPlus":{readonly:!1,category:"advert",rateLimitKey:"promotion.advSearchSetPlus"},"promotion.createSearchSetPlu":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvSearchSetPlus"},"promotion.createSearchSetExcluded":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvSearchSetExcluded"},"promotion.getAutoGetnmtoadd":{readonly:!0,category:"advert",rateLimitKey:"promotion.advAutoGetnmtoadd"},"promotion.getAdvCount":{readonly:!0,category:"advert",rateLimitKey:"promotion.advCount"},"promotion.getAdvAdverts":{readonly:!0,category:"advert",rateLimitKey:"promotion.advAdverts"},"promotion.getAdvAdvert":{readonly:!0,category:"advert",rateLimitKey:"promotion.advAdvert"},"promotion.createAdvFullstat":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvFullstats"},"promotion.getAdvFullstats":{readonly:!0,category:"advert",rateLimitKey:"promotion.advFullstats"},"promotion.getAutoStatWords":{readonly:!0,category:"advert",rateLimitKey:"promotion.advAutoStatWords"},"promotion.getStatWords":{readonly:!0,category:"advert",rateLimitKey:"promotion.advStatWords"},"promotion.createAdvStat":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvStats"},"promotion.getCalendarPromotions":{readonly:!0,category:"discountsandprices",rateLimitKey:"promotion.calendarPromotions"},"promotion.getPromotionsDetails":{readonly:!0,category:"discountsandprices",rateLimitKey:"promotion.calendarPromotionsDetails"},"promotion.getPromotionsNomenclatures":{readonly:!0,category:"discountsandprices",rateLimitKey:"promotion.calendarPromotionsNomenclatures"},"promotion.createPromotionsUpload":{readonly:!1,category:"discountsandprices",rateLimitKey:"promotion.postCalendarPromotionsUpload"},"promotion.getNormqueryStats":{readonly:!0,category:"advert",rateLimitKey:"promotion.normqueryStats"},"promotion.getNormqueryBids":{readonly:!0,category:"advert",rateLimitKey:"promotion.normqueryGetBids"},"promotion.setNormqueryBids":{readonly:!1,category:"advert",rateLimitKey:"promotion.normquerySetBids"},"promotion.deleteNormqueryBids":{readonly:!1,category:"advert",rateLimitKey:"promotion.normqueryDeleteBids"},"promotion.getNormqueryMinus":{readonly:!0,category:"advert",rateLimitKey:"promotion.normqueryGetMinus"},"promotion.setNormqueryMinus":{readonly:!1,category:"advert",rateLimitKey:"promotion.normquerySetMinus"},"communications.newFeedbacksQuestions":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.newFeedbacksQuestions"},"communications.getQuestionsCountUnanswered":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.questionsCountUnanswered"},"communications.getQuestionsCount":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.questionsCount"},"communications.questions":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.questions"},"communications.updateQuestion":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.patchQuestions"},"communications.question":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.question"},"communications.getFeedbacksCountUnanswered":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedbacksCountUnanswered"},"communications.getFeedbacksCount":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedbacksCount"},"communications.feedbacks":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedbacks"},"communications.supplierValuations":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.supplierValuations"},"communications.createFeedbacksAction":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.postFeedbacksActions"},"communications.createFeedbacksAnswer":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.postFeedbacksAnswer"},"communications.updateFeedbacksAnswer":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.patchFeedbacksAnswer"},"communications.createOrderReturn":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.postFeedbacksOrderReturn"},"communications.feedback":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedback"},"communications.getFeedbacksArchive":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedbacksArchive"},"communications.templates":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.templates"},"communications.createTemplate":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.postTemplates"},"communications.updateTemplate":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.patchTemplates"},"communications.deleteTemplate":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.deleteTemplates"},"communications.getSellerChats":{readonly:!0,category:"buyerchat",rateLimitKey:"communications.sellerChats"},"communications.getSellerEvents":{readonly:!0,category:"buyerchat",rateLimitKey:"communications.sellerEvents"},"communications.createSellerMessage":{readonly:!1,category:"buyerchat",rateLimitKey:"communications.postSellerMessage"},"communications.getSellerDownload":{readonly:!0,category:"buyerchat",rateLimitKey:"communications.sellerDownload"},"communications.claims":{readonly:!0,category:"returns",rateLimitKey:"communications.claims"},"communications.updateClaim":{readonly:!1,category:"returns",rateLimitKey:"communications.patchClaim"},"communications.getPinnedFeedbacksCount":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.getPinnedFeedbacksCount"},"communications.getPinnedFeedbacksLimits":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.getPinnedFeedbacksLimits"},"communications.getPinnedFeedbacks":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.getPinnedFeedbacks"},"communications.pinFeedback":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.pinFeedback"},"communications.unpinFeedback":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.unpinFeedback"},"tariffs.getTariffsCommission":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.tariffsCommission"},"tariffs.getTariffsBox":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.tariffsBox"},"tariffs.getTariffsPallet":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.tariffsPallet"},"tariffs.getTariffsReturn":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.tariffsReturn"},"tariffs.getAcceptanceCoefficients":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.acceptanceCoefficients"},"analytics.createNmReportDetail":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createNmReportDetail"},"analytics.createDetailHistory":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createDetailHistory"},"analytics.createGroupedHistory":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createGroupedHistory"},"analytics.getSalesFunnelProducts":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getSalesFunnelProducts"},"analytics.getSalesFunnelProductsHistory":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getSalesFunnelProductsHistory"},"analytics.getSalesFunnelGroupedHistory":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getSalesFunnelGroupedHistory"},"analytics.getNmReportDownloads":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getNmReportDownloads"},"analytics.createNmReportDownload":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createNmReportDownload"},"analytics.createDownloadsRetry":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createDownloadsRetry"},"analytics.getDownloadsFile":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getDownloadsFile"},"analytics.createSearchReportReport":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createSearchReportReport"},"analytics.createTableGroup":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createTableGroup"},"analytics.createTableDetail":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createTableDetail"},"analytics.createProductSearchText":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductSearchText"},"analytics.createProductOrder":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductOrder"},"analytics.createProductsGroup":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductsGroup"},"analytics.createProductsProduct":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductsProduct"},"analytics.createProductsSize":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductsSize"},"analytics.createStocksReportOffice":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createStocksReportOffice"},"reports.getSupplierIncomes":{readonly:!0,category:"statistics",rateLimitKey:"reports.supplierIncomes"},"reports.getSupplierStocks":{readonly:!0,category:"statistics",rateLimitKey:"reports.supplierStocks"},"reports.getSupplierOrders":{readonly:!0,category:"statistics",rateLimitKey:"reports.supplierOrders"},"reports.getSupplierSales":{readonly:!0,category:"statistics",rateLimitKey:"reports.supplierSales"},"reports.createAnalyticsExciseReport":{readonly:!1,category:"contentanalytics",rateLimitKey:"reports.createAnalyticsExciseReport"},"reports.warehouseRemains":{readonly:!1,category:"contentanalytics",rateLimitKey:"reports.warehouseRemains"},"reports.getWarehouseRemainsTaskStatus":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getWarehouseRemainsTaskStatus"},"reports.downloadWarehouseRemainsReport":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.downloadWarehouseRemainsReport"},"reports.getAnalyticsAntifraudDetails":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsAntifraudDetails"},"reports.getAnalyticsGoodsLabeling":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsGoodsLabeling"},"reports.acceptanceReport":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.acceptanceReport"},"reports.paidStorage":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.paidStorage"},"reports.getAnalyticsRegionSale":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsRegionSale"},"reports.getBrandShareBrands":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getBrandShareBrands"},"reports.getBannedProductsBlocked":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getBannedProductsBlocked"},"reports.getMeasurementPenalties":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getMeasurementPenalties"},"reports.getWarehouseMeasurementsV2":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getWarehouseMeasurementsV2"},"reports.getDeductions":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getDeductions"},"reports.getTasksStatu":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getWarehouseRemainsTaskStatus"},"reports.getTasksDownload":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.downloadWarehouseRemainsReport"},"reports.getAnalyticsWarehouseMeasurements":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsWarehouseMeasurements"},"reports.getAnalyticsIncorrectAttachments":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsIncorrectAttachments"},"reports.getAnalyticsCharacteristicsChange":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsCharacteristicsChange"},"reports.getAcceptanceReportTaskStatus":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAcceptanceReportTaskStatus"},"reports.downloadAcceptanceReport":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.downloadAcceptanceReport"},"reports.getPaidStorageTaskStatus":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getPaidStorageTaskStatus"},"reports.downloadPaidStorageReport":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.downloadPaidStorageReport"},"reports.getBrandShareParentSubjects":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getBrandShareParentSubjects"},"reports.getAnalyticsBrandShare":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsBrandShare"},"reports.getBannedProductsShadowed":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getBannedProductsShadowed"},"reports.getAnalyticsGoodsReturn":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsGoodsReturn"},"finances.getAccountBalance":{readonly:!0,category:"finance",rateLimitKey:"finances.accountBalance"},"finances.getDocumentsCategories":{readonly:!0,category:"documents",rateLimitKey:"finances.documentsCategories"},"finances.getDocumentsList":{readonly:!0,category:"documents",rateLimitKey:"finances.documentsList"},"finances.getDocumentsDownload":{readonly:!0,category:"documents",rateLimitKey:"finances.documentsDownload"},"finances.createDownloadAll":{readonly:!1,category:"documents",rateLimitKey:"finances.createDownloadAll"},"inStorePickup.getOrdersNew":{readonly:!0,category:"marketplace",rateLimitKey:"in-store-pickup.ordersNew"},"inStorePickup.createOrdersClient":{readonly:!1,category:"marketplace",rateLimitKey:"in-store-pickup.ordersClient"},"inStorePickup.createClientIdentity":{readonly:!1,category:"marketplace",rateLimitKey:"in-store-pickup.clientIdentity"},"inStorePickup.getClickCollectOrders":{readonly:!0,category:"marketplace",rateLimitKey:"in-store-pickup.clickCollectOrders"}};function It(r){const e=U[r];return e?e.readonly:!1}function ai(r){const e=U[r];return e?e.category:void 0}function ni(r){const e=U[r];return e?e.rateLimitKey:void 0}function oi(r){return U[r]}function ci(r){return Object.entries(U).filter(([,e])=>e.category===r).map(([e])=>e)}function ui(){return Object.entries(U).filter(([,r])=>r.readonly).map(([r])=>r)}function li(){return Object.entries(U).filter(([,r])=>!r.readonly).map(([r])=>r)}class di{constructor(e,t){this.config={maxRetries:(e==null?void 0:e.maxRetries)??3,retryDelay:(e==null?void 0:e.retryDelay)??1e3,exponentialBackoff:(e==null?void 0:e.exponentialBackoff)??!0},this.logLevel=t??"warn"}async executeWithRetry(e,t="operation",s){let i;for(let a=0;a<=this.config.maxRetries;a++)try{const n=await e();return a>0&&this.log("info",`Operation succeeded after ${String(a)} retries`,{operationName:t}),n}catch(n){if(i=n,!this.shouldRetry(n,a,s))throw a>0&&this.log("warn",`All retries exhausted for ${t} after ${String(a)} attempts`,{operationName:t,attempts:a,maxRetries:this.config.maxRetries,finalError:n instanceof Error?n.message:String(n)}),n;const o=this.calculateDelay(a);this.log("info",`Retrying ${t} (attempt ${String(a+1)}/${String(this.config.maxRetries)}, waiting ${String(Math.round(o))}ms)`,{operationName:t,attempt:a+1,maxRetries:this.config.maxRetries,delay:Math.round(o)}),this.log("debug",`Retry context for ${t}`,{operationName:t,attempt:a+1,maxRetries:this.config.maxRetries,delay:Math.round(o),errorMessage:n instanceof Error?n.message:String(n),errorType:n instanceof Error?n.constructor.name:typeof n,statusCode:n instanceof G?n.statusCode:void 0,isTimeout:n instanceof G?n.isTimeout:void 0}),await this.sleep(o)}throw this.log("warn",`Max retries exhausted for ${t}`,{maxRetries:this.config.maxRetries}),i||new Error("Unexpected: No error captured after retry exhaustion")}shouldRetry(e,t,s){if(t>=this.config.maxRetries||e instanceof be||e instanceof ve||e instanceof g)return!1;if(s!=null&&s.operationKey){const i=It(s.operationKey);if(!i&&!s.forceRetry)return this.log("info",`Skipping retry for write operation: ${s.operationKey}`,{operationKey:s.operationKey,readonly:i,forceRetry:s.forceRetry??!1}),!1}if(e instanceof Ie)return!0;if(e instanceof G){const i=e.statusCode;return!!(!i||i===0||i>=500&&i<600||e.isTimeout)}return!1}calculateDelay(e){let t;this.config.exponentialBackoff?t=this.config.retryDelay*Math.pow(2,e):t=this.config.retryDelay;const s=1+(Math.random()*.2-.1);return t=t*s,Math.min(t,3e4)}async sleep(e){return new Promise(t=>setTimeout(t,e))}log(e,t,s){const i={debug:0,info:1,warn:2,error:3};if(i[e]<i[this.logLevel])return;({debug:console.debug,info:console.info,warn:console.warn,error:console.error})[e](JSON.stringify({timestamp:new Date().toISOString(),level:e,service:"RetryHandler",message:t,...s??{}}))}}const Ft={"general.ping":{requestsPerMinute:6,intervalSeconds:10,burstLimit:3},"general.communicationsNews":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"general.sellerInfo":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"general.createInvite":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"general.getUsers":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"general.updateUserAccess":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"general.deleteUser":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"general.getJamSubscription":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"general.getSellerRating":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"general.tariffConstructorOptions":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10}},Nt={"products.contentObjectParentAll":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentObjectAll":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentObjectCharcs":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryColors":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryKinds":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryCountries":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectorySeasons":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryVat":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryTnved":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentTags":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentTag":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.patchContentTag":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.deleteContentTag":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentTagNomenclatureLink":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.brands":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"products.postContentGetCardsList":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsErrorList":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"products.postContentCardsUpdate":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"products.postContentCardsMoveNm":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsDeleteTrash":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsRecover":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsDelete":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentGetCardsTrash":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentCardsLimits":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentBarcodes":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsUpload":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"products.postContentCardsUploadAdd":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"products.postContentMediaFile":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentMediaSave":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postUploadTask":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postUploadTaskSize":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postUploadTaskClubDiscount":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postUploadTaskB2bWholesale":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.historyTasks":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.historyGoodsTask":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.bufferTasks":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.bufferGoodsTask":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.listGoodsFilter":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postListGoodsFilter":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.listGoodsSizeNm":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.quarantineGoods":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postStocks":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.putStocks":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.deleteStocks":{requestsPerMinute:10,intervalSeconds:6,burstLimit:2,penaltyMultiplier:10},"products.offices":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.warehouses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.postWarehouses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.putWarehouses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.deleteWarehouses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.dbwWarehousesContacts":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.putDbwWarehousesContacts":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10}},xt={"orders-fbs.ordersNew":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.orders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersStatus":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.suppliesOrdersReshipment":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersStickers":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersStickersCrossBorder":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersStatusHistory":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersClient":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.ordersMeta":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.deleteOrdersMeta":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.supplies":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postSupplies":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.getSupply":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.deleteSupplies":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.suppliesOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.patchSuppliesDeliver":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.suppliesBarcode":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.suppliesTrbx":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postSuppliesTrbx":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.deleteSuppliesTrbx":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postSuppliesTrbxStickers":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.passesOffices":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.passes":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putPasses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.deletePasses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.patchSuppliesOrders":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.patchMarketplaceSuppliesOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.getMarketplaceSuppliesOrderIds":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.patchOrdersCancel":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaSgtin":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaUin":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaImei":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaGtin":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaExpiration":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaCustomsDeclaration":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postMarketplaceOrdersMeta":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postPasses":{requestsPerMinute:.1,intervalSeconds:600,burstLimit:1,penaltyMultiplier:10},"orders-fbs.ordersArchive":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10}},Ut={"orders-fbw.acceptanceCoefficients":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"orders-fbw.postAcceptanceOptions":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"orders-fbw.warehouses":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"orders-fbw.transitTariffs":{requestsPerMinute:6,intervalSeconds:10,burstLimit:10},"orders-fbw.postSupplies":{requestsPerMinute:30,intervalSeconds:2,burstLimit:10},"orders-fbw.supplies":{requestsPerMinute:30,intervalSeconds:2,burstLimit:10},"orders-fbw.suppliesGoods":{requestsPerMinute:30,intervalSeconds:2,burstLimit:10},"orders-fbw.suppliesPackage":{requestsPerMinute:30,intervalSeconds:2,burstLimit:10},"orders-fbw.getClientInfo":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbw.deleteMetaBulkDBW":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"orders-fbw.setSgtinBulkDBW":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-fbw.deliverBulkDBW":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbw.checkMetaValidationDBW":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10}},_t={"orders-dbs.getNewOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getClientInfo":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getStatusesBulk":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getStatuses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getB2BInfo":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.confirmBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.deliverBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.receiveBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.rejectBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.cancelBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.confirm":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.deliver":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.receive":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.reject":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.cancel":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.getMeta":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"orders-dbs.deleteMeta":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setMeta":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getGroupsInfo":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getDeliveryDates":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.deleteMetaBulk":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setSgtinBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setUinBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setImeiBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setGtinBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setCustomsDeclarationBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.checkMetaValidation":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.createOrdersStickers":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10}},$t={"userManagement.createInvite":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"userManagement.getUsers":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"userManagement.updateAccess":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"userManagement.deleteUser":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10}},jt={"finances.accountBalance":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.documentsCategories":{requestsPerMinute:6,intervalSeconds:10,burstLimit:5},"finances.documentsList":{requestsPerMinute:6,intervalSeconds:10,burstLimit:5},"finances.documentsDownload":{requestsPerMinute:6,intervalSeconds:10,burstLimit:5},"finances.createDownloadAll":{requestsPerMinute:1,intervalSeconds:300,burstLimit:5},"finances.salesReportsList":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.salesReportsDetailed":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.salesReportsDetailedByReportId":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.acquiringReportsList":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.acquiringReportsDetailed":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.acquiringReportsDetailedByReportId":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1}},Wt={"promotion.advPromotionCount":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.advConfig":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"promotion.postAdvBidsMin":{requestsPerMinute:20,intervalSeconds:3,burstLimit:5},"promotion.postAdvSaveAd":{requestsPerMinute:3,intervalSeconds:20,burstLimit:5},"promotion.postAdvSeacatSaveAd":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.advSupplierSubjects":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.postAdvSupplierNms":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.advDelete":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.postAdvRename":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.advStart":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.advPause":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.advStop":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.patchAdvBids":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.putAdvAuctionPlacements":{requestsPerMinute:60,intervalSeconds:1,burstLimit:1},"promotion.getBidsRecommendations":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.advBalance":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.advBudget":{requestsPerMinute:240,intervalSeconds:.25,burstLimit:4},"promotion.postAdvBudgetDeposit":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.advUpd":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.advPayments":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.advSearchSetPlus":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"promotion.postAdvSearchSetPlus":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"promotion.postAdvSearchSetExcluded":{requestsPerMinute:120,intervalSeconds:.5,burstLimit:2},"promotion.advAutoGetnmtoadd":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.patchAdvAuctionNms":{requestsPerMinute:60,intervalSeconds:1,burstLimit:1},"promotion.advCount":{requestsPerMinute:600,intervalSeconds:.1,burstLimit:10},"promotion.advAdverts":{requestsPerMinute:600,intervalSeconds:.1,burstLimit:10},"promotion.advAdvert":{requestsPerMinute:600,intervalSeconds:.1,burstLimit:10},"promotion.postAdvFullstats":{requestsPerMinute:1,intervalSeconds:60,burstLimit:5},"promotion.advFullstats":{requestsPerMinute:3,intervalSeconds:20,burstLimit:1},"promotion.advAutoStatWords":{requestsPerMinute:240,intervalSeconds:.25,burstLimit:4},"promotion.advStatWords":{requestsPerMinute:240,intervalSeconds:.25,burstLimit:4},"promotion.postAdvStats":{requestsPerMinute:600,intervalSeconds:.1,burstLimit:10},"promotion.calendarPromotions":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"promotion.calendarPromotionsDetails":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"promotion.calendarPromotionsNomenclatures":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"promotion.postCalendarPromotionsUpload":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"promotion.normqueryStats":{requestsPerMinute:10,intervalSeconds:6,burstLimit:20},"promotion.getNormqueryList":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.getNormqueryStatsV1":{requestsPerMinute:10,intervalSeconds:6,burstLimit:20},"promotion.normqueryGetBids":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.normquerySetBids":{requestsPerMinute:120,intervalSeconds:.5,burstLimit:4},"promotion.normqueryDeleteBids":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.normqueryGetMinus":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.normquerySetMinus":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.v1Config":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"promotion.v1NormqueryBids":{requestsPerMinute:120,intervalSeconds:.5,burstLimit:4},"promotion.advertsV2":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.bidsMinV1":{requestsPerMinute:20,intervalSeconds:3,burstLimit:5},"promotion.getCampaignCount":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.createCampaign":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.getSupplierSubjects":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.getSupplierNms":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.startCampaign":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.pauseCampaign":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.updateBids":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.updateCampaignProducts":{requestsPerMinute:60,intervalSeconds:1,burstLimit:1},"promotion.getMinusPhrases":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.setMinusPhrases":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.getSearchClusterStats":{requestsPerMinute:10,intervalSeconds:6,burstLimit:20},"promotion.getRecommendationsList":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:10},"promotion.setRecommendations":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:10}},Gt={"tariffs.tariffsCommission":{requestsPerMinute:1,intervalSeconds:60,burstLimit:2},"tariffs.tariffsBox":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"tariffs.tariffsPallet":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"tariffs.tariffsReturn":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"tariffs.acceptanceCoefficients":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6}},Ht={"in-store-pickup.clickCollectOrdersNew":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.postClickCollectOrdersClient":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.postClickCollectOrdersClientIdentity":{requestsPerMinute:30,intervalSeconds:2,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.clickCollectOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.checkMetaValidation":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.setCustomsDeclarationBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10},"in-store-pickup.confirmBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.prepareBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.receiveBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.rejectBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.cancelBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.getStatusesBulk":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.getMetaBulk":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.deleteMetaBulk":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.setSgtinBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10},"in-store-pickup.setUinBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10},"in-store-pickup.setImeiBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10},"in-store-pickup.setGtinBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10}},Vt={"analytics.nmReportDownloads":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postNmReportDownloads":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postNmReportDownloadsRetry":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.nmReportDownloadsFile":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportReport":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportTableGroups":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportTableDetails":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportProductSearchTexts":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportProductOrders":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportProductsGroups":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportProductsProducts":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportProductsSizes":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportOffices":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportWbWarehouses":{requestsPerMinute:3,intervalSeconds:20,burstLimit:1},"analytics.postSalesFunnelProducts":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSalesFunnelProductsHistory":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSalesFunnelGroupedHistory":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.itemRating":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3}},zt={"reports.supplierIncomes":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.supplierStocks":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.supplierOrders":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.supplierSales":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.postAnalyticsExciseReport":{requestsPerMinute:0,intervalSeconds:1800,burstLimit:10},"reports.warehouse_remains":{requestsPerMinute:1,intervalSeconds:60,burstLimit:5},"reports.warehouse_remainsTasksStatus":{requestsPerMinute:12,intervalSeconds:5,burstLimit:5},"reports.warehouse_remainsTasksDownload":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.analyticsWarehouseMeasurements":{requestsPerMinute:5,intervalSeconds:12,burstLimit:1},"reports.analyticsAntifraudDetails":{requestsPerMinute:0,intervalSeconds:600,burstLimit:10},"reports.analyticsIncorrectAttachments":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"reports.analyticsGoodsLabeling":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"reports.acceptance_report":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.acceptance_reportTasksStatus":{requestsPerMinute:12,intervalSeconds:5,burstLimit:1},"reports.acceptance_reportTasksDownload":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.paid_storage":{requestsPerMinute:1,intervalSeconds:60,burstLimit:5},"reports.paid_storageTasksStatus":{requestsPerMinute:12,intervalSeconds:5,burstLimit:5},"reports.paid_storageTasksDownload":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.analyticsRegionSale":{requestsPerMinute:6,intervalSeconds:10,burstLimit:5},"reports.analyticsBrandShareBrands":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"reports.analyticsBrandShareParentSubjects":{requestsPerMinute:12,intervalSeconds:5,burstLimit:20},"reports.analyticsBrandShare":{requestsPerMinute:12,intervalSeconds:5,burstLimit:20},"reports.analyticsBannedProductsBlocked":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"reports.analyticsBannedProductsShadowed":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"reports.analyticsGoodsReturn":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"reports.measurementPenalties":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.warehouseMeasurementsV2":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.deductions":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1}},Jt={"communications.newFeedbacksQuestions":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.questionsCountUnanswered":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.questionsCount":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.questions":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.patchQuestions":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.question":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedbacksCountUnanswered":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedbacksCount":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedbacks":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.supplierValuations":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.postFeedbacksActions":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.postFeedbacksAnswer":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.patchFeedbacksAnswer":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.postFeedbacksOrderReturn":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedback":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedbacksArchive":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.templates":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.postTemplates":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.patchTemplates":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.deleteTemplates":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.sellerChats":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"communications.sellerEvents":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"communications.postSellerMessage":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"communications.sellerDownload":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"communications.claims":{requestsPerMinute:20,intervalSeconds:3,burstLimit:10},"communications.patchClaim":{requestsPerMinute:20,intervalSeconds:3,burstLimit:10},"communications.getPinnedFeedbacksCount":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.getPinnedFeedbacksLimits":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.getPinnedFeedbacks":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.pinFeedback":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.unpinFeedback":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6}},Ae={...Ft,...Nt,...xt,...Ut,..._t,...$t,...jt,...Wt,...Gt,...Ht,...Vt,...zt,...Jt},pi={general:.001,products:.01,"orders-fbs":.003,"orders-dbw":.003,"orders-dbs":.003,"click-collect":.003,"in-store-pickup":.003,"orders-fbw":.01,promotion:.02,communications:.05,tariffs:.01,analytics:.05,reports:.01,documents:.01,finances:.01,"user-management":.01},mi=.01;function yi(r){const e={};for(const[t,s]of Object.entries(r)){const i=t.split(".")[0],a=pi[i]??mi;e[t]={...s,requestsPerMinute:Math.max(1,Math.ceil(s.requestsPerMinute*a)),burstLimit:1}}return e}class Xt{constructor(e){this.apiKey=e.apiKey,this.logLevel=e.logLevel??"warn",this.axios=k.create({timeout:e.timeout??3e4,headers:{"Content-Type":"application/json","User-Agent":"WildberriesSDK/0.1.0"}}),this.setupRequestInterceptor();const t=e.tokenType??"personal",s=t==="basic"||t==="test"?yi(Ae):Ae;this.rateLimiter=new ii(s),this.retryHandler=new di(e.retryConfig,this.logLevel)}async get(e,t){return this.retryHandler.executeWithRetry(async()=>{t!=null&&t.rateLimitKey&&await this.rateLimiter.waitForSlot(t.rateLimitKey);try{this.log("debug","GET request",{url:e});const s=await this.axios.get(e,{headers:t==null?void 0:t.headers,params:t==null?void 0:t.params,responseType:t==null?void 0:t.responseType,...(t==null?void 0:t.timeout)!==void 0&&{timeout:t.timeout}});return this.log("debug","GET response",{url:e,status:s.status}),s.data}catch(s){this.transformError(s)}},`GET ${e}`)}async post(e,t,s){return this.retryHandler.executeWithRetry(async()=>{s!=null&&s.rateLimitKey&&await this.rateLimiter.waitForSlot(s.rateLimitKey);try{this.log("debug","POST request",{url:e});const i=await this.axios.post(e,t,{headers:s==null?void 0:s.headers,params:s==null?void 0:s.params,...(s==null?void 0:s.timeout)!==void 0&&{timeout:s.timeout}});return this.log("debug","POST response",{url:e,status:i.status}),i.data}catch(i){this.transformError(i)}},`POST ${e}`)}async put(e,t,s){return this.retryHandler.executeWithRetry(async()=>{s!=null&&s.rateLimitKey&&await this.rateLimiter.waitForSlot(s.rateLimitKey);try{this.log("debug","PUT request",{url:e});const i=await this.axios.put(e,t,{headers:s==null?void 0:s.headers,params:s==null?void 0:s.params,...(s==null?void 0:s.timeout)!==void 0&&{timeout:s.timeout}});return this.log("debug","PUT response",{url:e,status:i.status}),i.data}catch(i){this.transformError(i)}},`PUT ${e}`)}async patch(e,t,s){return this.retryHandler.executeWithRetry(async()=>{s!=null&&s.rateLimitKey&&await this.rateLimiter.waitForSlot(s.rateLimitKey);try{this.log("debug","PATCH request",{url:e});const i=await this.axios.patch(e,t,{headers:s==null?void 0:s.headers,params:s==null?void 0:s.params,...(s==null?void 0:s.timeout)!==void 0&&{timeout:s.timeout}});return this.log("debug","PATCH response",{url:e,status:i.status}),i.data}catch(i){this.transformError(i)}},`PATCH ${e}`)}async delete(e,t,s){return this.retryHandler.executeWithRetry(async()=>{s!=null&&s.rateLimitKey&&await this.rateLimiter.waitForSlot(s.rateLimitKey);try{this.log("debug","DELETE request",{url:e,hasBody:!!t});const i=await this.axios.delete(e,{headers:s==null?void 0:s.headers,params:s==null?void 0:s.params,data:t,...(s==null?void 0:s.timeout)!==void 0&&{timeout:s.timeout}});return this.log("debug","DELETE response",{url:e,status:i.status}),i.data}catch(i){this.transformError(i)}},`DELETE ${e}`)}setupRequestInterceptor(){this.axios.interceptors.request.use(e=>{var t;return e.headers.Authorization=`Bearer ${this.apiKey}`,this.logLevel==="debug"&&this.log("debug","HTTP Request Interceptor",{method:(t=e.method)==null?void 0:t.toUpperCase(),url:e.url,headers:this.sanitizeHeaders(e.headers)}),e})}transformError(e){var l,d,y;if(!k.isAxiosError(e))throw this.log("error","Unknown error occurred",{error:e}),new G("Unknown error occurred",!1,0,e);const t=e;if(!t.response){const m=t.code==="ECONNABORTED"||t.code==="ETIMEDOUT";if(m){const b=((l=t.config)==null?void 0:l.url)??"unknown",p=((d=t.config)==null?void 0:d.timeout)??"unknown";this.log("warn",`Request timed out: ${b} after ${String(p)}ms`,{url:b,timeout:p,code:t.code})}else this.log("error","Network error",{code:t.code,message:t.message});throw new G(m?"Request timed out":"Network error occurred",m,0,t)}const s=t.response.status,i=t.response.data;this.log("warn","HTTP error response",{status:s,url:(y=t.config)==null?void 0:y.url});const a=t.response.headers["content-type"],o=(typeof a=="string"?a:"").includes("application/problem+json"),u=this.extractProblemJsonFields(i,o);if(s===401||s===403){const m=u.detail??u.title??"Authentication failed. Please verify your API key.";throw new be(m,s,i,u.requestId,u.origin,u.timestamp)}if(s===429){const m=this.parseRetryAfter(t.response.headers["retry-after"]),b=u.detail??u.title??`Rate limit exceeded. Retry after ${m.toString()}ms`;throw new Ie(b,m,i,u.requestId,u.origin,u.timestamp)}if(s===409&&i!=null&&typeof i=="object"&&Array.isArray(i.metaDetails)){const m=i,b=typeof m.message=="string"?m.message:u.detail??u.title??"Meta validation failed",p=typeof m.code=="string"?m.code:"Unknown",f=m.metaDetails;throw new ve(b,p,f,i,u.requestId,u.origin,u.timestamp)}if(s===400||s===422){const m=u.detail,b=Et(m);if(m!==void 0&&b)throw new Fe(m,{received:b.received,min:b.min,max:b.max,field:"bid"},i,u.requestId);const p=this.extractFieldErrors(i),f=u.detail??u.title??"Validation failed";throw new g(f,p,s,i,u.requestId)}throw s===406?new Dt(u.detail??"Warehouse is processing — inventory update temporarily unavailable",i,u.requestId,u.origin,u.timestamp):s>=500?new G(`Server error: ${s.toString()}`,!1,s,t):new C(`HTTP error ${s.toString()}`,s,i,u.requestId,u.origin,u.timestamp)}parseRetryAfter(e){if(!e)return 5e3;const t=parseInt(e,10);return isNaN(t)?5e3:t*1e3}extractProblemJsonFields(e,t){const s={};if(!e||typeof e!="object")return s;const i=e,a=typeof i.title=="string"||typeof i.detail=="string";return!t&&!a?s:{title:typeof i.title=="string"?i.title:void 0,detail:typeof i.detail=="string"?i.detail:void 0,code:typeof i.code=="string"?i.code:void 0,requestId:typeof i.requestId=="string"?i.requestId:void 0,origin:typeof i.origin=="string"?i.origin:void 0,status:typeof i.status=="number"?i.status:void 0,statusText:typeof i.statusText=="string"?i.statusText:void 0,timestamp:typeof i.timestamp=="string"?i.timestamp:void 0}}extractFieldErrors(e){if(e&&typeof e=="object"&&"errors"in e&&e.errors&&typeof e.errors=="object")return e.errors}log(e,t,s){const i={debug:0,info:1,warn:2,error:3},a=i[this.logLevel];if(i[e]<a)return;const o={timestamp:new Date().toISOString(),level:e,service:"WildberriesSDK",message:t,meta:this.sanitizeMeta(s)};({debug:console.debug,info:console.info,warn:console.warn,error:console.error})[e](JSON.stringify(o))}sanitizeMeta(e){if(e)try{const t=JSON.parse(JSON.stringify(e));if(t&&typeof t=="object"&&"headers"in t&&t.headers&&typeof t.headers=="object"){const s=t.headers;"Authorization"in s&&(s.Authorization="Bearer ***")}return t}catch{return}}sanitizeHeaders(e){const t={...e};return t.Authorization&&(t.Authorization="Bearer ***"),t}}class Qt{constructor(e){this.client=e}async ping(){return this.client.get("https://common-api.wildberries.ru/ping",{rateLimitKey:"general.ping"})}async news(e){return this.client.get("https://common-api.wildberries.ru/api/communications/v2/news",{params:e?{...e}:void 0,rateLimitKey:"general.communicationsNews"})}async sellerInfo(){return this.client.get("https://common-api.wildberries.ru/api/v1/seller-info",{rateLimitKey:"general.sellerInfo"})}async createInvite(e){return this.client.post("https://user-management-api.wildberries.ru/api/v1/invite",e,{rateLimitKey:"general.createInvite"})}async getUsers(e){return this.client.get("https://user-management-api.wildberries.ru/api/v1/users",{params:e?{...e}:void 0,rateLimitKey:"general.getUsers"})}async updateUserAccess(e){await this.client.put("https://user-management-api.wildberries.ru/api/v1/users/access",e,{rateLimitKey:"general.updateUserAccess"})}async deleteUser(e){await this.client.delete("https://user-management-api.wildberries.ru/api/v1/user",{},{params:{deletedUserID:e},rateLimitKey:"general.deleteUser"})}async getJamSubscription(){return this.client.get("https://common-api.wildberries.ru/api/common/v1/subscriptions",{rateLimitKey:"general.getJamSubscription"})}async getSellerRating(){return this.client.get("https://feedbacks-api.wildberries.ru/api/common/v1/rating",{rateLimitKey:"general.getSellerRating"})}async getTariffConstructorOptions(e){return this.client.get("https://common-api.wildberries.ru/api/common/v1/tariff-constructor/options",{params:e?{...e}:void 0,rateLimitKey:"general.tariffConstructorOptions"})}}const Te=new Set;function se(r,e){Te.has(r)||(Te.add(r),console.warn(e))}function fi(){Te.clear()}const hi={ALL:-1,WITH_PHOTO:1,NO_PHOTO:2};class Yt{constructor(e){this.client=e}async getParentAll(e){return this.client.get("https://content-api.wildberries.ru/content/v2/object/parent/all",{params:e,rateLimitKey:"products.contentObjectParentAll"})}async getObjectAll(e){return this.client.get("https://content-api.wildberries.ru/content/v2/object/all",{params:e,rateLimitKey:"products.contentObjectAll"})}async getObjectCharc(e,t){return this.client.get(`https://content-api.wildberries.ru/content/v2/object/charcs/${e}`,{params:t,rateLimitKey:"products.contentObjectCharcs"})}async getDirectoryColors(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/colors",{params:e,rateLimitKey:"products.contentDirectoryColors"})}async getDirectoryKinds(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/kinds",{params:e,rateLimitKey:"products.contentDirectoryKinds"})}async getDirectoryCountries(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/countries",{params:e,rateLimitKey:"products.contentDirectoryCountries"})}async getDirectorySeasons(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/seasons",{params:e,rateLimitKey:"products.contentDirectorySeasons"})}async getDirectoryVat(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/vat",{params:e,rateLimitKey:"products.contentDirectoryVat"})}async getDirectoryTnved(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/tnved",{params:e,rateLimitKey:"products.contentDirectoryTnved"})}async getBrands(e,t){return this.client.get("https://content-api.wildberries.ru/api/content/v1/brands",{params:{subjectId:e,...t!==void 0&&{next:t}},rateLimitKey:"products.brands"})}async getContentTags(){return this.client.get("https://content-api.wildberries.ru/content/v2/tags",{rateLimitKey:"products.contentTags"})}async createContentTag(e){return this.client.post("https://content-api.wildberries.ru/content/v2/tag",e,{rateLimitKey:"products.postContentTag"})}async updateContentTag(e,t){return this.client.patch(`https://content-api.wildberries.ru/content/v2/tag/${e}`,t,{rateLimitKey:"products.patchContentTag"})}async deleteContentTag(e){return this.client.delete(`https://content-api.wildberries.ru/content/v2/tag/${e}`,void 0,{rateLimitKey:"products.deleteContentTag"})}async createNomenclatureLink(e){return this.client.post("https://content-api.wildberries.ru/content/v2/tag/nomenclature/link",e,{rateLimitKey:"products.postContentTagNomenclatureLink"})}async getCardsList(e,t){var i,a,n,o;((a=(i=e.settings)==null?void 0:i.filter)==null?void 0:a.withPhoto)===0&&se("products.getCardsList:legacy-withphoto-zero",'products.getCardsList: `withPhoto: 0` now returns ALL cards — the 2026-06-16 WB semantic change is live (0 previously meant "only cards without photo"). If you wanted "no photo only", use `WITH_PHOTO_FILTER.NO_PHOTO` (= 2). For explicit "all cards", `WITH_PHOTO_FILTER.ALL` (= -1) is clearer. See docs/guides/withphoto-semantic-migration.md.');const s=100;if((o=(n=e.settings)==null?void 0:n.cursor)!=null&&o.limit){const u=e.settings.cursor.limit;if(u>s)throw new Error(`Invalid cursor limit: ${u}. Maximum allowed is ${s} cards per request. Use pagination to fetch all cards. See: https://salacoste.github.io/daytona-wildberries-typescript-sdk/guides/working-with-product-cards#pagination-limit-restrictions`);if(u<=0)throw new Error(`Invalid cursor limit: ${u}. Limit must be a positive integer (recommended: ${s}).`)}return this.client.post("https://content-api.wildberries.ru/content/v2/get/cards/list",e,{params:t,rateLimitKey:"products.postContentGetCardsList"})}async createErrorList(e,t){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/error/list",e,{params:t,rateLimitKey:"products.postContentCardsErrorList"})}async createCardsUpdate(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/update",e,{rateLimitKey:"products.postContentCardsUpdate"})}async createCardsMovenm(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/moveNm",e,{rateLimitKey:"products.postContentCardsMoveNm"})}async createDeleteTrash(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/delete/trash",e,{rateLimitKey:"products.postContentCardsDeleteTrash"})}async createCardsRecover(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/recover",e,{rateLimitKey:"products.postContentCardsRecover"})}async deleteCardsFromTrash(e){return this.client.post("https://content-api.wildberries.ru/content/v1/cards/delete",e,{rateLimitKey:"products.postContentCardsDelete"})}async getTrashedCards(e,t){return this.client.post("https://content-api.wildberries.ru/content/v2/get/cards/trash",e,{params:t,rateLimitKey:"products.postContentGetCardsTrash"})}async getCardsLimits(){return this.client.get("https://content-api.wildberries.ru/content/v2/cards/limits",{rateLimitKey:"products.contentCardsLimits"})}async createContentBarcode(e){return this.client.post("https://content-api.wildberries.ru/content/v2/barcodes",e,{rateLimitKey:"products.postContentBarcodes"})}async createCardsUpload(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/upload",e,{rateLimitKey:"products.postContentCardsUpload"})}async createUploadAdd(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/upload/add",e,{rateLimitKey:"products.postContentCardsUploadAdd"})}async createMediaFile(e,t,s){return this.client.post("https://content-api.wildberries.ru/content/v3/media/file",s,{rateLimitKey:"products.postContentMediaFile",headers:{"X-Nm-Id":String(e),"X-Photo-Number":String(t)}})}async createMediaSave(e){return this.client.post("https://content-api.wildberries.ru/content/v3/media/save",e,{rateLimitKey:"products.postContentMediaSave"})}async createUploadTask(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/v2/upload/task",{data:e},{rateLimitKey:"products.postUploadTask"})}async createTaskSize(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/v2/upload/task/size",{data:e},{rateLimitKey:"products.postUploadTaskSize"})}async createTaskClubDiscount(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/v2/upload/task/club-discount",{data:e},{rateLimitKey:"products.postUploadTaskClubDiscount"})}async createUploadTaskB2bWholesale(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/discounts-prices/v1/upload/task/b2b/wholesale",e,{rateLimitKey:"products.postUploadTaskB2bWholesale"})}async getHistoryTasks(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/history/tasks",{params:e,rateLimitKey:"products.historyTasks"})}async getGoodsTask(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/history/goods/task",{params:e,rateLimitKey:"products.historyGoodsTask"})}async getBufferTasks(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/buffer/tasks",{params:e,rateLimitKey:"products.bufferTasks"})}async getBufferGoodsTask(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/buffer/goods/task",{params:e,rateLimitKey:"products.bufferGoodsTask"})}async getGoodsFilter(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/list/goods/filter",{params:e,rateLimitKey:"products.listGoodsFilter"})}async createGoodsFilter(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/v2/list/goods/filter",e,{rateLimitKey:"products.postListGoodsFilter"})}async getSizeNm(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/list/goods/size/nm",{params:e,rateLimitKey:"products.listGoodsSizeNm"})}async getQuarantineGoods(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/quarantine/goods",{params:e,rateLimitKey:"products.quarantineGoods"})}async getStocks(e,t){return this.client.post(`https://marketplace-api.wildberries.ru/api/v3/stocks/${e}`,t,{rateLimitKey:"products.postStocks"})}async updateStock(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/stocks/${e}`,t,{rateLimitKey:"products.putStocks"})}async deleteStock(e,t){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/stocks/${e}`,t,{rateLimitKey:"products.deleteStocks"})}async offices(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/offices",{rateLimitKey:"products.offices"})}async warehouses(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/warehouses",{rateLimitKey:"products.warehouses"})}async createWarehouse(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/warehouses",e,{rateLimitKey:"products.postWarehouses"})}async updateWarehouse(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/warehouses/${e}`,t,{rateLimitKey:"products.putWarehouses"})}async deleteWarehouse(e){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/warehouses/${e}`,void 0,{rateLimitKey:"products.deleteWarehouses"})}async getWarehousesContact(e){return this.client.get(`https://marketplace-api.wildberries.ru/api/v3/dbw/warehouses/${e}/contacts`,{rateLimitKey:"products.dbwWarehousesContacts"})}async updateWarehousesContact(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/dbw/warehouses/${e}/contacts`,t,{rateLimitKey:"products.putDbwWarehousesContacts"})}}class Zt{constructor(e){this.client=e}async getPassesOffices(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/passes/offices",{rateLimitKey:"orders-fbs.passesOffices"})}async passes(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/passes",{rateLimitKey:"orders-fbs.passes"})}async createPass(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/passes",e,{rateLimitKey:"orders-fbs.postPasses"})}async updatePass(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/passes/${e}`,t,{rateLimitKey:"orders-fbs.putPasses"})}async deletePass(e){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/passes/${e}`,{rateLimitKey:"orders-fbs.deletePasses"})}async getOrdersNew(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/orders/new",{rateLimitKey:"orders-fbs.ordersNew"})}async orders(e){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/orders",{params:e,rateLimitKey:"orders-fbs.orders"})}async getOrdersReshipment(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/supplies/orders/reshipment",{rateLimitKey:"orders-fbs.suppliesOrdersReshipment"})}async updateOrdersCancel(e){return this.client.patch(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/cancel`,void 0,{rateLimitKey:"orders-fbs.patchOrdersCancel"})}async createOrdersSticker(e,t){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/stickers",t,{params:e,rateLimitKey:"orders-fbs.postOrdersStickers"})}async deleteOrdersMeta(e,t){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta`,{params:t,rateLimitKey:"orders-fbs.deleteOrdersMeta"})}async updateMetaSgtin(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/sgtin`,t,{rateLimitKey:"orders-fbs.putOrdersMetaSgtin"})}async updateMetaUin(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/uin`,t,{rateLimitKey:"orders-fbs.putOrdersMetaUin"})}async updateMetaImei(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/imei`,t,{rateLimitKey:"orders-fbs.putOrdersMetaImei"})}async updateMetaGtin(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/gtin`,t,{rateLimitKey:"orders-fbs.putOrdersMetaGtin"})}async updateMetaExpiration(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/expiration`,t,{rateLimitKey:"orders-fbs.putOrdersMetaExpiration"})}async setCustomsDeclaration(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/marketplace/v3/orders/${e}/meta/customs-declaration`,t,{rateLimitKey:"orders-fbs.putOrdersMetaCustomsDeclaration"})}async createStickersCrossBorder(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/stickers/cross-border",e,{rateLimitKey:"orders-fbs.postOrdersStickersCrossBorder"})}async createStatusHistory(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/status/history",e,{rateLimitKey:"orders-fbs.postOrdersStatusHistory"})}async createOrdersClient(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/client",e,{rateLimitKey:"orders-fbs.postOrdersClient"})}async supplies(e){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/supplies",{params:e,rateLimitKey:"orders-fbs.supplies"})}async createSupply(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/supplies",e,{rateLimitKey:"orders-fbs.postSupplies"})}async getSupply(e){return this.client.get(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}`,{rateLimitKey:"orders-fbs.getSupply"})}async deleteSupply(e){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}`,{rateLimitKey:"orders-fbs.deleteSupplies"})}async updateSuppliesDeliver(e){return this.client.patch(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/deliver`,void 0,{rateLimitKey:"orders-fbs.patchSuppliesDeliver"})}async getSuppliesBarcode(e,t){return this.client.get(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/barcode`,{params:t,rateLimitKey:"orders-fbs.suppliesBarcode"})}async getSuppliesTrbx(e){return this.client.get(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/trbx`,{rateLimitKey:"orders-fbs.suppliesTrbx"})}async createSuppliesTrbx(e,t){return this.client.post(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/trbx`,t,{rateLimitKey:"orders-fbs.postSuppliesTrbx"})}async deleteSuppliesTrbx(e,t){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/trbx`,t,{rateLimitKey:"orders-fbs.deleteSuppliesTrbx"})}async createTrbxSticker(e,t,s){return this.client.post(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/trbx/stickers`,s,{params:t,rateLimitKey:"orders-fbs.postSuppliesTrbxStickers"})}async getOrderStatuses(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/status",e,{rateLimitKey:"orders-fbs.postOrdersStatus"})}async getOrdersMetaBulk(e){return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/orders/meta",e,{rateLimitKey:"orders-fbs.postMarketplaceOrdersMeta"})}async addOrdersToSupply(e,t){return this.client.patch(`https://marketplace-api.wildberries.ru/api/marketplace/v3/supplies/${e}/orders`,t,{rateLimitKey:"orders-fbs.patchMarketplaceSuppliesOrders"})}async getSupplyOrderIds(e){return this.client.get(`https://marketplace-api.wildberries.ru/api/marketplace/v3/supplies/${e}/order-ids`,{rateLimitKey:"orders-fbs.getMarketplaceSuppliesOrderIds"})}async getOrdersArchive(e){return this.client.get("https://marketplace-api.wildberries.ru/api/marketplace/v3/fbs/orders/archive",{params:e,rateLimitKey:"orders-fbs.ordersArchive"})}}class er{constructor(e){this.client=e}async createAcceptanceOption(e,t){return this.client.post("https://supplies-api.wildberries.ru/api/v1/acceptance/options",e,{params:t,rateLimitKey:"orders-fbw.postAcceptanceOptions"})}async warehouses(){return this.client.get("https://supplies-api.wildberries.ru/api/v1/warehouses",{rateLimitKey:"orders-fbw.warehouses"})}async transitTariffs(){return this.client.get("https://supplies-api.wildberries.ru/api/v1/transit-tariffs",{rateLimitKey:"orders-fbw.transitTariffs"})}async listSupplies(e,t){return this.client.post("https://supplies-api.wildberries.ru/api/v1/supplies",e,{params:t,rateLimitKey:"orders-fbw.postSupplies"})}async getSupply(e,t){return this.client.get(`https://supplies-api.wildberries.ru/api/v1/supplies/${e}`,{params:t,rateLimitKey:"orders-fbw.supplies"})}async getSuppliesGood(e,t){return this.client.get(`https://supplies-api.wildberries.ru/api/v1/supplies/${e}/goods`,{params:t,rateLimitKey:"orders-fbw.suppliesGoods"})}async getSuppliesPackage(e){return this.client.get(`https://supplies-api.wildberries.ru/api/v1/supplies/${e}/package`,{rateLimitKey:"orders-fbw.suppliesPackage"})}async getClientInfo(e){if(e.length===0)throw new g("orderIds array cannot be empty");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/client",{orders:e},{rateLimitKey:"orders-fbw.getClientInfo"})}async deleteMetaBulk(e){if(e.orders.length===0)throw new g("orders array cannot be empty");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/meta/delete",e,{rateLimitKey:"orders-fbw.deleteMetaBulkDBW"})}async setSgtinBulk(e){if(e.orders.length===0)throw new g("orders array cannot be empty");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/meta/sgtin",e,{rateLimitKey:"orders-fbw.setSgtinBulkDBW"})}async deliverBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/status/deliver",{orders:e},{rateLimitKey:"orders-fbw.deliverBulkDBW"})}async checkMetaValidation(e){if(e.orders.length===0)throw new g("orders array cannot be empty");if(e.orders.length>1e3)throw new g("orders array cannot exceed 1000 items");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/meta/details",{orders:e.orders},{rateLimitKey:"orders-fbw.checkMetaValidationDBW"})}}class tr{constructor(e){this.client=e}async getAccountBalance(){return this.client.get("https://finance-api.wildberries.ru/api/v1/account/balance",{rateLimitKey:"finances.accountBalance"})}async getDocumentsCategories(e){return this.client.get("https://documents-api.wildberries.ru/api/v1/documents/categories",{params:e,rateLimitKey:"finances.documentsCategories"})}async getDocumentsList(e){return this.client.get("https://documents-api.wildberries.ru/api/v1/documents/list",{params:e,rateLimitKey:"finances.documentsList"})}async getDocumentsDownload(e){return this.client.get("https://documents-api.wildberries.ru/api/v1/documents/download",{params:e,rateLimitKey:"finances.documentsDownload"})}async createDownloadAll(e){return this.client.post("https://documents-api.wildberries.ru/api/v1/documents/download/all",e,{rateLimitKey:"finances.createDownloadAll"})}async getSalesReportsList(e){return this.client.post("https://finance-api.wildberries.ru/api/finance/v1/sales-reports/list",e,{rateLimitKey:"finances.salesReportsList"})}async getSalesReportsDetailed(e){return this.client.post("https://finance-api.wildberries.ru/api/finance/v1/sales-reports/detailed",e,{rateLimitKey:"finances.salesReportsDetailed"})}async getSalesReportsDetailedByReportId(e,t={}){return this.client.post(`https://finance-api.wildberries.ru/api/finance/v1/sales-reports/detailed/${String(e)}`,t,{rateLimitKey:"finances.salesReportsDetailedByReportId"})}async getAcquiringReportsList(e){return this.client.post("https://finance-api.wildberries.ru/api/finance/v1/acquiring/list",e,{rateLimitKey:"finances.acquiringReportsList"})}async getAcquiringReportsDetailed(e){return this.client.post("https://finance-api.wildberries.ru/api/finance/v1/acquiring/detailed",e,{rateLimitKey:"finances.acquiringReportsDetailed"})}async getAcquiringReportsDetailedByReportId(e,t={}){return this.client.post(`https://finance-api.wildberries.ru/api/finance/v1/acquiring/detailed/${String(e)}`,t,{rateLimitKey:"finances.acquiringReportsDetailedByReportId"})}}class rr{constructor(e){this.client=e}async getNmReportDownloads(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v2/nm-report/downloads",{params:e,rateLimitKey:"analytics.nmReportDownloads"})}async createNmReportDownload(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/nm-report/downloads",e,{rateLimitKey:"analytics.postNmReportDownloads"})}async createDownloadsRetry(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/nm-report/downloads/retry",e,{rateLimitKey:"analytics.postNmReportDownloadsRetry"})}async getDownloadsFile(e){return this.client.get(`https://seller-analytics-api.wildberries.ru/api/v2/nm-report/downloads/file/${e}`,{rateLimitKey:"analytics.nmReportDownloadsFile"})}async createSearchReportReport(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/search-report/report",e,{rateLimitKey:"analytics.postSearchReportReport"})}async createTableGroup(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/search-report/table/groups",e,{rateLimitKey:"analytics.postSearchReportTableGroups"})}async createTableDetail(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/search-report/table/details",e,{rateLimitKey:"analytics.postSearchReportTableDetails"})}async createProductSearchText(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/search-report/product/search-texts",e,{rateLimitKey:"analytics.postSearchReportProductSearchTexts"})}async createProductOrder(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/search-report/product/orders",e,{rateLimitKey:"analytics.postSearchReportProductOrders"})}async createProductsGroup(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/stocks-report/products/groups",e,{rateLimitKey:"analytics.postStocksReportProductsGroups"})}async createProductsProduct(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/stocks-report/products/products",e,{rateLimitKey:"analytics.postStocksReportProductsProducts"})}async createProductsSize(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/stocks-report/products/sizes",e,{rateLimitKey:"analytics.postStocksReportProductsSizes"})}async createStocksReportOffice(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v2/stocks-report/offices",e,{rateLimitKey:"analytics.postStocksReportOffices"})}async getSalesFunnelProducts(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/analytics/v3/sales-funnel/products",e,{rateLimitKey:"analytics.postSalesFunnelProducts"})}async getSalesFunnelProductsHistory(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/analytics/v3/sales-funnel/products/history",e,{rateLimitKey:"analytics.postSalesFunnelProductsHistory"})}async getSalesFunnelGroupedHistory(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/analytics/v3/sales-funnel/grouped/history",e,{rateLimitKey:"analytics.postSalesFunnelGroupedHistory"})}async getWbWarehousesStock(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/analytics/v1/stocks-report/wb-warehouses",e??{},{rateLimitKey:"analytics.postStocksReportWbWarehouses"})}async getItemRating(e){return this.client.post("https://seller-analytics-api.wildberries.ru/api/analytics/v1/item-rating",e,{rateLimitKey:"analytics.itemRating"})}}const gi=/^\d+:[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}:[0-9a-f]+$/i,sr={MAX_MESSAGE_LENGTH:1e3,MAX_TOTAL_FILE_SIZE:30*1024*1024,MAX_PER_FILE_SIZE:5*1024*1024,MAX_REPLYSIGN_LENGTH:255},{MAX_MESSAGE_LENGTH:ot,MAX_TOTAL_FILE_SIZE:bi,MAX_PER_FILE_SIZE:vi,MAX_REPLYSIGN_LENGTH:ct}=sr,Si={".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png",".pdf":"application/pdf"};function Li(r){const e=r.toLowerCase();for(const[t,s]of Object.entries(Si))if(e.endsWith(t))return s;return"application/octet-stream"}class ir{constructor(e){this.client=e}async newFeedbacksQuestions(){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/new-feedbacks-questions",{rateLimitKey:"communications.newFeedbacksQuestions"})}async getQuestionsCountUnanswered(){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/questions/count-unanswered",{rateLimitKey:"communications.questionsCountUnanswered"})}async getQuestionsCount(e){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/questions/count",{params:e,rateLimitKey:"communications.questionsCount"})}async questions(e){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/questions",{params:e,rateLimitKey:"communications.questions"})}async updateQuestion(e){return this.client.patch("https://feedbacks-api.wildberries.ru/api/v1/questions",e,{rateLimitKey:"communications.patchQuestions"})}async question(e){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/question",{params:e,rateLimitKey:"communications.question"})}async getFeedbacksCountUnanswered(){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/feedbacks/count-unanswered",{rateLimitKey:"communications.feedbacksCountUnanswered"})}async getFeedbacksCount(e){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/feedbacks/count",{params:e,rateLimitKey:"communications.feedbacksCount"})}async feedbacks(e){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/feedbacks",{params:e,rateLimitKey:"communications.feedbacks"})}async createFeedbacksAnswer(e){return this.client.post("https://feedbacks-api.wildberries.ru/api/v1/feedbacks/answer",e,{rateLimitKey:"communications.postFeedbacksAnswer"})}async updateFeedbacksAnswer(e){return this.client.patch("https://feedbacks-api.wildberries.ru/api/v1/feedbacks/answer",e,{rateLimitKey:"communications.patchFeedbacksAnswer"})}async createOrderReturn(e){return this.client.post("https://feedbacks-api.wildberries.ru/api/v1/feedbacks/order/return",e,{rateLimitKey:"communications.postFeedbacksOrderReturn"})}async feedback(e){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/feedback",{params:e,rateLimitKey:"communications.feedback"})}async getFeedbacksArchive(e){return this.client.get("https://feedbacks-api.wildberries.ru/api/v1/feedbacks/archive",{params:e,rateLimitKey:"communications.feedbacksArchive"})}async getSellerChats(){return this.client.get("https://buyer-chat-api.wildberries.ru/api/v1/seller/chats",{rateLimitKey:"communications.sellerChats"})}async getSellerEvents(e){return this.client.get("https://buyer-chat-api.wildberries.ru/api/v1/seller/events",{params:e,rateLimitKey:"communications.sellerEvents"})}async createSellerMessage(e){if(e==null)throw new g("data is required: pass { replySign, message?, file? }");if(e.replySign==null||typeof e.replySign!="string"||e.replySign.trim().length===0)throw new g("replySign is required (string, non-empty after trim)");if(e.replySign.length>ct)throw new g(`replySign exceeds maxLength ${String(ct)}`);if(e.message&&e.message.length>ot)throw new g(`message exceeds maxLength ${String(ot)}`);if(e.file){let s=0;for(const i of e.file){const a=i instanceof Blob?i.size:i.content.length;if(a>vi)throw new g(`file size exceeds 5 MB (got ${String(a)} bytes). WB limit: 5 MB per file.`);s+=a}if(s>bi)throw new g(`total file size exceeds 30 MB (got ${String(s)} bytes)`)}gi.test(e.replySign)||se("communications.createSellerMessage:legacy-replysign-format","communications.createSellerMessage: `replySign` does not match the expected new-format pattern (version:UUID:signature). WB API rejects old-format `replySign` after 2026-06-04. Refresh via `getSellerChats()` to get current-format values. See docs/guides/chat-replysign-format-migration.md.");const t=new FormData;if(t.append("replySign",e.replySign),e.message&&t.append("message",e.message),e.file)for(const s of e.file)if(s instanceof Blob)t.append("file",s);else{const i=Li(s.filename);t.append("file",new Blob([s.content],{type:i}),s.filename)}return this.client.post("https://buyer-chat-api.wildberries.ru/api/v1/seller/message",t,{rateLimitKey:"communications.postSellerMessage",headers:{"Content-Type":void 0}})}async getSellerDownload(e){return this.client.get(`https://buyer-chat-api.wildberries.ru/api/v1/seller/download/${e}`,{rateLimitKey:"communications.sellerDownload"})}async claims(e){return this.client.get("https://returns-api.wildberries.ru/api/v1/claims",{params:e,rateLimitKey:"communications.claims"})}async updateClaim(e){return this.client.patch("https://returns-api.wildberries.ru/api/v1/claim",e,{rateLimitKey:"communications.patchClaim"})}async getPinnedFeedbacksCount(e){return this.client.get("https://feedbacks-api.wildberries.ru/api/feedbacks/v1/pins/count",{params:e,rateLimitKey:"communications.getPinnedFeedbacksCount"})}async getPinnedFeedbacksLimits(){return this.client.get("https://feedbacks-api.wildberries.ru/api/feedbacks/v1/pins/limits",{rateLimitKey:"communications.getPinnedFeedbacksLimits"})}async getPinnedFeedbacks(e){return this.client.get("https://feedbacks-api.wildberries.ru/api/feedbacks/v1/pins",{params:e,rateLimitKey:"communications.getPinnedFeedbacks"})}async pinFeedback(e){return this.client.post("https://feedbacks-api.wildberries.ru/api/feedbacks/v1/pins",e,{rateLimitKey:"communications.pinFeedback"})}async unpinFeedback(e){return this.client.delete("https://feedbacks-api.wildberries.ru/api/feedbacks/v1/pins",e,{rateLimitKey:"communications.unpinFeedback"})}}class ar{constructor(e){this.client=e}async getSupplierStocks(e){return this.client.get("https://statistics-api.wildberries.ru/api/v1/supplier/stocks",{params:e,rateLimitKey:"reports.supplierStocks"})}async getSupplierOrders(e){return this.client.get("https://statistics-api.wildberries.ru/api/v1/supplier/orders",{params:e,rateLimitKey:"reports.supplierOrders"})}async getSupplierSales(e){return this.client.get("https://statistics-api.wildberries.ru/api/v1/supplier/sales",{params:e,rateLimitKey:"reports.supplierSales"})}async createAnalyticsExciseReport(e,t){return this.client.post("https://seller-analytics-api.wildberries.ru/api/v1/analytics/excise-report",t,{params:e,rateLimitKey:"reports.postAnalyticsExciseReport"})}async warehouseRemains(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/warehouse_remains",{params:e,rateLimitKey:"reports.warehouse_remains"})}async getWarehouseRemainsTaskStatus(e){return this.client.get(`https://seller-analytics-api.wildberries.ru/api/v1/warehouse_remains/tasks/${e}/status`,{rateLimitKey:"reports.warehouse_remainsTasksStatus"})}async downloadWarehouseRemainsReport(e){return this.client.get(`https://seller-analytics-api.wildberries.ru/api/v1/warehouse_remains/tasks/${e}/download`,{rateLimitKey:"reports.warehouse_remainsTasksDownload"})}async getAnalyticsAntifraudDetails(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/analytics/antifraud-details",{params:e,rateLimitKey:"reports.analyticsAntifraudDetails"})}async getAnalyticsGoodsLabeling(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/analytics/goods-labeling",{params:e,rateLimitKey:"reports.analyticsGoodsLabeling"})}async acceptanceReport(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/acceptance_report",{params:e,rateLimitKey:"reports.acceptance_report"})}async getAcceptanceReportTaskStatus(e){return this.client.get(`https://seller-analytics-api.wildberries.ru/api/v1/acceptance_report/tasks/${e}/status`,{rateLimitKey:"reports.acceptance_reportTasksStatus"})}async downloadAcceptanceReport(e){return this.client.get(`https://seller-analytics-api.wildberries.ru/api/v1/acceptance_report/tasks/${e}/download`,{rateLimitKey:"reports.acceptance_reportTasksDownload"})}async paidStorage(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/paid_storage",{params:e,rateLimitKey:"reports.paid_storage"})}async getPaidStorageTaskStatus(e){return this.client.get(`https://seller-analytics-api.wildberries.ru/api/v1/paid_storage/tasks/${e}/status`,{rateLimitKey:"reports.paid_storageTasksStatus"})}async downloadPaidStorageReport(e){return this.client.get(`https://seller-analytics-api.wildberries.ru/api/v1/paid_storage/tasks/${e}/download`,{rateLimitKey:"reports.paid_storageTasksDownload"})}async getAnalyticsRegionSale(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/analytics/region-sale",{params:e,rateLimitKey:"reports.analyticsRegionSale"})}async getBrandShareBrands(){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/analytics/brand-share/brands",{rateLimitKey:"reports.analyticsBrandShareBrands"})}async getBrandShareParentSubjects(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/analytics/brand-share/parent-subjects",{params:e,rateLimitKey:"reports.analyticsBrandShareParentSubjects"})}async getAnalyticsBrandShare(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/analytics/brand-share",{params:e,rateLimitKey:"reports.analyticsBrandShare"})}async getBannedProductsBlocked(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/analytics/banned-products/blocked",{params:e,rateLimitKey:"reports.analyticsBannedProductsBlocked"})}async getBannedProductsShadowed(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/analytics/banned-products/shadowed",{params:e,rateLimitKey:"reports.analyticsBannedProductsShadowed"})}async getAnalyticsGoodsReturn(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/v1/analytics/goods-return",{params:e,rateLimitKey:"reports.analyticsGoodsReturn"})}async getMeasurementPenalties(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/analytics/v1/measurement-penalties",{params:e,rateLimitKey:"reports.measurementPenalties"})}async getWarehouseMeasurementsV2(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/analytics/v1/warehouse-measurements",{params:e,rateLimitKey:"reports.warehouseMeasurementsV2"})}async getDeductions(e){return this.client.get("https://seller-analytics-api.wildberries.ru/api/analytics/v1/deductions",{params:e,rateLimitKey:"reports.deductions"})}}class nr{constructor(e){this.client=e}async getAdvDelete(e){return this.client.get("https://advert-api.wildberries.ru/adv/v0/delete",{params:e,rateLimitKey:"promotion.advDelete"})}async createAdvRename(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/rename",e,{rateLimitKey:"promotion.postAdvRename"})}async getAdvStop(e){return this.client.get("https://advert-api.wildberries.ru/adv/v0/stop",{params:e,rateLimitKey:"promotion.advStop"})}async updateAuctionPlacement(e){return this.client.put("https://advert-api.wildberries.ru/adv/v0/auction/placements",e,{rateLimitKey:"promotion.putAdvAuctionPlacements"})}async getAdvBalance(){return this.client.get("https://advert-api.wildberries.ru/adv/v1/balance",{rateLimitKey:"promotion.advBalance"})}async getAdvBudget(e){return this.client.get("https://advert-api.wildberries.ru/adv/v1/budget",{params:e,rateLimitKey:"promotion.advBudget"})}async createBudgetDeposit(e,t){return this.client.post("https://advert-api.wildberries.ru/adv/v1/budget/deposit",e,{params:t,rateLimitKey:"promotion.postAdvBudgetDeposit"})}async getAdvUpd(e){return this.client.get("https://advert-api.wildberries.ru/adv/v1/upd",{params:e,rateLimitKey:"promotion.advUpd"})}async getAdvPayments(e){return this.client.get("https://advert-api.wildberries.ru/adv/v1/payments",{params:e,rateLimitKey:"promotion.advPayments"})}async updateAuctionNm(e){return this.client.patch("https://advert-api.wildberries.ru/adv/v0/auction/nms",e,{rateLimitKey:"promotion.patchAdvAuctionNms"})}async getAdvCount(){return this.client.get("https://advert-media-api.wildberries.ru/adv/v1/count",{rateLimitKey:"promotion.advCount"})}async getAdvAdverts(e){return this.client.get("https://advert-media-api.wildberries.ru/adv/v1/adverts",{params:e,rateLimitKey:"promotion.advAdverts"})}async getAdvAdvert(e){return this.client.get("https://advert-media-api.wildberries.ru/adv/v1/advert",{params:e,rateLimitKey:"promotion.advAdvert"})}async getAdvFullstats(e){return this.client.get("https://advert-api.wildberries.ru/adv/v3/fullstats",{params:e,rateLimitKey:"promotion.advFullstats"})}async createAdvStat(e){return this.client.post("https://advert-media-api.wildberries.ru/adv/v1/stats",e,{rateLimitKey:"promotion.postAdvStats"})}async getCalendarPromotions(e){return this.client.get("https://dp-calendar-api.wildberries.ru/api/v1/calendar/promotions",{params:e,rateLimitKey:"promotion.calendarPromotions"})}async getPromotionsDetails(e){return this.client.get("https://dp-calendar-api.wildberries.ru/api/v1/calendar/promotions/details",{params:e,rateLimitKey:"promotion.calendarPromotionsDetails"})}async getPromotionsNomenclatures(e){return this.client.get("https://dp-calendar-api.wildberries.ru/api/v1/calendar/promotions/nomenclatures",{params:e,rateLimitKey:"promotion.calendarPromotionsNomenclatures"})}async createPromotionsUpload(){return this.client.post("https://dp-calendar-api.wildberries.ru/api/v1/calendar/promotions/upload",void 0,{rateLimitKey:"promotion.postCalendarPromotionsUpload"})}async getNormqueryStats(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/stats",e,{rateLimitKey:"promotion.normqueryStats"})}async getNormqueryList(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/list",e,{rateLimitKey:"promotion.getNormqueryList"})}async getNormqueryStatsV1(e){return this.client.post("https://advert-api.wildberries.ru/adv/v1/normquery/stats",e,{rateLimitKey:"promotion.getNormqueryStatsV1"})}async getNormqueryBids(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/get-bids",e,{rateLimitKey:"promotion.normqueryGetBids"})}async setNormqueryBids(e){await this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/bids",e,{rateLimitKey:"promotion.normquerySetBids"})}async deleteNormqueryBids(e){await this.client.delete("https://advert-api.wildberries.ru/adv/v0/normquery/bids",e,{rateLimitKey:"promotion.normqueryDeleteBids"})}async getV1Config(){return this.client.get("https://advert-api.wildberries.ru/api/advert/v1/config",{rateLimitKey:"promotion.v1Config"})}async postV1NormqueryBids(e){return this.client.post("https://advert-api.wildberries.ru/api/advert/v1/normquery/bids",e,{rateLimitKey:"promotion.v1NormqueryBids"})}async getNormqueryMinus(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/get-minus",e,{rateLimitKey:"promotion.normqueryGetMinus"})}async setNormqueryMinus(e){await this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/set-minus",e,{rateLimitKey:"promotion.normquerySetMinus"})}async getAdvertsV2(e){return this.client.get("https://advert-api.wildberries.ru/api/advert/v2/adverts",{params:e,rateLimitKey:"promotion.advertsV2"})}async getBidsMinV2(e){return this.client.post("https://advert-api.wildberries.ru/api/advert/v1/bids/min",e,{rateLimitKey:"promotion.bidsMinV1"})}async getBidsRecommendations(e){return this.client.get("https://advert-api.wildberries.ru/api/advert/v0/bids/recommendations",{params:{advertId:e.advertId,nmId:e.nmId},rateLimitKey:"promotion.getBidsRecommendations"})}async getCampaignCount(){return this.client.get("https://advert-api.wildberries.ru/adv/v1/promotion/count",{rateLimitKey:"promotion.getCampaignCount"})}async createCampaign(e){return this.client.post("https://advert-api.wildberries.ru/adv/v2/seacat/save-ad",e,{rateLimitKey:"promotion.createCampaign"})}async getSupplierSubjects(e){return this.client.get("https://advert-api.wildberries.ru/adv/v1/supplier/subjects",{params:e?{...e}:void 0,rateLimitKey:"promotion.getSupplierSubjects"})}async getSupplierNms(e){return this.client.post("https://advert-api.wildberries.ru/adv/v2/supplier/nms",e,{rateLimitKey:"promotion.getSupplierNms"})}async startCampaign(e){return this.client.get("https://advert-api.wildberries.ru/adv/v0/start",{params:{id:e},rateLimitKey:"promotion.startCampaign"})}async pauseCampaign(e){return this.client.get("https://advert-api.wildberries.ru/adv/v0/pause",{params:{id:e},rateLimitKey:"promotion.pauseCampaign"})}async getMinusPhrases(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/get-minus",e,{rateLimitKey:"promotion.getMinusPhrases"})}async setMinusPhrases(e){await this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/set-minus",e,{rateLimitKey:"promotion.setMinusPhrases"})}async getSearchClusterStats(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/stats",e,{rateLimitKey:"promotion.getSearchClusterStats"})}async updateBids(e){return this.client.patch("https://advert-api.wildberries.ru/api/advert/v1/bids",e,{rateLimitKey:"promotion.updateBids"})}async updateCampaignProducts(e){return this.client.patch("https://advert-api.wildberries.ru/adv/v0/auction/nms",{nms:e.campaigns.map(t=>({advert_id:t.advert_id,nms:{add:t.add_nms,delete:t.delete_nms}}))},{rateLimitKey:"promotion.updateCampaignProducts"})}async getRecommendationsList(e){return this.client.post("https://content-api.wildberries.ru/api/content/v1/recommendations/list",e,{rateLimitKey:"promotion.getRecommendationsList"})}async setRecommendations(e){return this.client.post("https://content-api.wildberries.ru/api/content/v1/recommendations/set",e,{rateLimitKey:"promotion.setRecommendations"})}}class or{constructor(e){this.client=e}async getTariffsCommission(e){return this.client.get("https://common-api.wildberries.ru/api/v1/tariffs/commission",{params:e,rateLimitKey:"tariffs.tariffsCommission"})}async getTariffsBox(e){return this.client.get("https://common-api.wildberries.ru/api/v1/tariffs/box",{params:{date:e},rateLimitKey:"tariffs.tariffsBox"})}async getTariffsPallet(e){return this.client.get("https://common-api.wildberries.ru/api/v1/tariffs/pallet",{params:{date:e},rateLimitKey:"tariffs.tariffsPallet"})}async getTariffsReturn(e){return this.client.get("https://common-api.wildberries.ru/api/v1/tariffs/return",{params:{date:e},rateLimitKey:"tariffs.tariffsReturn"})}async getAcceptanceCoefficients(e){return this.client.get("https://common-api.wildberries.ru/api/tariffs/v1/acceptance/coefficients",{params:e,rateLimitKey:"tariffs.acceptanceCoefficients"})}}const A="https://marketplace-api.wildberries.ru";class cr{constructor(e){this.client=e}async getOrdersNew(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/click-collect/orders/new",{rateLimitKey:"in-store-pickup.clickCollectOrdersNew"})}async confirmBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/status/confirm`,{ordersIds:e},{rateLimitKey:"in-store-pickup.confirmBulk"})}async prepareBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/status/prepare`,{ordersIds:e},{rateLimitKey:"in-store-pickup.prepareBulk"})}async createOrdersClient(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/click-collect/orders/client",e,{rateLimitKey:"in-store-pickup.postClickCollectOrdersClient"})}async createClientIdentity(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/click-collect/orders/client/identity",e,{rateLimitKey:"in-store-pickup.postClickCollectOrdersClientIdentity"})}async receiveBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/status/receive`,{ordersIds:e},{rateLimitKey:"in-store-pickup.receiveBulk"})}async rejectBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/status/reject`,{ordersIds:e},{rateLimitKey:"in-store-pickup.rejectBulk"})}async getStatusesBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/status/info`,{ordersIds:e},{rateLimitKey:"in-store-pickup.getStatusesBulk"})}async getClickCollectOrders(e){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/click-collect/orders",{params:e,rateLimitKey:"in-store-pickup.clickCollectOrders"})}async cancelBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/status/cancel`,{ordersIds:e},{rateLimitKey:"in-store-pickup.cancelBulk"})}async getMetaBulk(e){if(e.ordersIds.length===0)throw new g("ordersIds array cannot be empty");if(e.ordersIds.length>1e3)throw new g("ordersIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/meta/details`,e,{rateLimitKey:"in-store-pickup.getMetaBulk"})}async deleteMetaBulk(e){if(e.ordersIds.length===0)throw new g("ordersIds array cannot be empty");if(e.ordersIds.length>1e3)throw new g("ordersIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/meta/delete`,e,{rateLimitKey:"in-store-pickup.deleteMetaBulk"})}async setSgtinBulk(e){return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/meta/sgtin`,e,{rateLimitKey:"in-store-pickup.setSgtinBulk"})}async setUinBulk(e){return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/meta/uin`,e,{rateLimitKey:"in-store-pickup.setUinBulk"})}async setImeiBulk(e){return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/meta/imei`,e,{rateLimitKey:"in-store-pickup.setImeiBulk"})}async setGtinBulk(e){return this.client.post(`${A}/api/marketplace/v3/click-collect/orders/meta/gtin`,e,{rateLimitKey:"in-store-pickup.setGtinBulk"})}async checkMetaValidation(e){if(e.length===0)throw new g("orders array cannot be empty");if(e.length>1e3)throw new g("orders array cannot exceed 1000 items");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/click-collect/orders/meta/details",{ordersIds:e},{rateLimitKey:"in-store-pickup.checkMetaValidation"})}async setCustomsDeclarationBulk(e){return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/click-collect/orders/meta/customs-declaration",e,{rateLimitKey:"in-store-pickup.setCustomsDeclarationBulk"})}}const M="https://marketplace-api.wildberries.ru",wi=30*24*60*60;class ur{constructor(e){this.client=e}async getNewOrders(){return this.client.get(`${M}/api/v3/dbs/orders/new`,{rateLimitKey:"orders-dbs.getNewOrders"})}async getOrders(e){if(e.limit<1||e.limit>1e3)throw new g("limit must be between 1 and 1000");if(e.next<0)throw new g("next must be >= 0");const t=e.dateTo-e.dateFrom;if(t>wi)throw new g("Date range cannot exceed 30 calendar days");if(t<0)throw new g("dateFrom must be less than or equal to dateTo");return this.client.get(`${M}/api/v3/dbs/orders`,{params:{limit:e.limit,next:e.next,dateFrom:e.dateFrom,dateTo:e.dateTo},rateLimitKey:"orders-dbs.getOrders"})}async getClientInfo(e){if(e.length===0)throw new g("orderIds array cannot be empty");return this.client.post(`${M}/api/v3/dbs/orders/client`,{orders:e},{rateLimitKey:"orders-dbs.getClientInfo"})}async getB2BInfo(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${M}/api/marketplace/v3/dbs/orders/b2b/info`,{ordersIds:e},{rateLimitKey:"orders-dbs.getB2BInfo"})}async getGroupsInfo(e){return this.client.post(`${M}/api/v3/dbs/groups/info`,e,{rateLimitKey:"orders-dbs.getGroupsInfo"})}async getDeliveryDates(e){return this.client.post(`${M}/api/v3/dbs/orders/delivery-date`,e,{rateLimitKey:"orders-dbs.getDeliveryDates"})}async deleteMetaBulk(e){return this.client.post(`${M}/api/marketplace/v3/dbs/orders/meta/delete`,e,{rateLimitKey:"orders-dbs.deleteMetaBulk"})}async setSgtinBulk(e){return this.client.post(`${M}/api/marketplace/v3/dbs/orders/meta/sgtin`,e,{rateLimitKey:"orders-dbs.setSgtinBulk"})}async setUinBulk(e){return this.client.post(`${M}/api/marketplace/v3/dbs/orders/meta/uin`,e,{rateLimitKey:"orders-dbs.setUinBulk"})}async setImeiBulk(e){return this.client.post(`${M}/api/marketplace/v3/dbs/orders/meta/imei`,e,{rateLimitKey:"orders-dbs.setImeiBulk"})}async setGtinBulk(e){return this.client.post(`${M}/api/marketplace/v3/dbs/orders/meta/gtin`,e,{rateLimitKey:"orders-dbs.setGtinBulk"})}async setCustomsDeclarationBulk(e){return this.client.post(`${M}/api/marketplace/v3/dbs/orders/meta/customs-declaration`,e,{rateLimitKey:"orders-dbs.setCustomsDeclarationBulk"})}async getStatusesBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${M}/api/marketplace/v3/dbs/orders/status/info`,{orders:e},{rateLimitKey:"orders-dbs.getStatusesBulk"})}async confirmBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${M}/api/marketplace/v3/dbs/orders/status/confirm`,{orders:e},{rateLimitKey:"orders-dbs.confirmBulk"})}async deliverBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${M}/api/marketplace/v3/dbs/orders/status/deliver`,{orders:e},{rateLimitKey:"orders-dbs.deliverBulk"})}async receiveBulk(e){if(e.length===0)throw new g("orders array cannot be empty");if(e.length>1e3)throw new g("orders array cannot exceed 1000 items");for(const t of e){if(t.orderId<=0)throw new g("orderId must be a positive number");if(!t.code||t.code==="")throw new g("code cannot be empty")}return this.client.post(`${M}/api/marketplace/v3/dbs/orders/status/receive`,{orders:e},{rateLimitKey:"orders-dbs.receiveBulk"})}async rejectBulk(e){if(e.length===0)throw new g("orders array cannot be empty");if(e.length>1e3)throw new g("orders array cannot exceed 1000 items");for(const t of e){if(t.orderId<=0)throw new g("orderId must be a positive number");if(!t.code||t.code==="")throw new g("code cannot be empty")}return this.client.post(`${M}/api/marketplace/v3/dbs/orders/status/reject`,{orders:e},{rateLimitKey:"orders-dbs.rejectBulk"})}async cancelBulk(e){if(e.length===0)throw new g("orderIds array cannot be empty");if(e.length>1e3)throw new g("orderIds array cannot exceed 1000 items");return this.client.post(`${M}/api/marketplace/v3/dbs/orders/status/cancel`,{orders:e},{rateLimitKey:"orders-dbs.cancelBulk"})}async checkMetaValidation(e){if(e.orders.length===0)throw new g("orders array cannot be empty");if(e.orders.length>1e3)throw new g("orders array cannot exceed 1000 items");return this.client.post(`${M}/api/marketplace/v3/dbs/orders/meta/details`,e,{rateLimitKey:"orders-dbs.checkMetaValidation"})}async createOrdersStickers(e,t){if(t!=null&&t.orders&&t.orders.length>100)throw new g("orders array cannot exceed 100 items");return this.client.post(`${M}/api/marketplace/v3/dbs/orders/stickers`,t,{params:e,rateLimitKey:"orders-dbs.createOrdersStickers"})}}class lr{constructor(e){this.client=e}async createInvite(e){return this.client.post("https://user-management-api.wildberries.ru/api/v1/invite",e,{rateLimitKey:"userManagement.createInvite"})}async getUsers(e){return this.client.get("https://user-management-api.wildberries.ru/api/v1/users",{params:e?{...e}:void 0,rateLimitKey:"userManagement.getUsers"})}async updateUserAccess(e){return this.client.put("https://user-management-api.wildberries.ru/api/v1/users/access",e,{rateLimitKey:"userManagement.updateAccess"})}async deleteUser(e){return this.client.delete("https://user-management-api.wildberries.ru/api/v1/user",void 0,{params:{deletedUserID:e},rateLimitKey:"userManagement.deleteUser"})}}function pe(r){if(!r)return"other";const e=r.toLowerCase().trim();return e?/повреждени|поврежд|сломан|разбит|потёрт|царапин|деформ|помят/.test(e)?"damage":/брак|дефект|неисправн|не работает|сломалось|не включается/.test(e)?"defect":/не подошёл размер|не подошел размер|не по размеру|размер не подошёл|размер не подошел|маловат|великоват|узк|шир/.test(e)?"wrong_size":/не тот товар|неправильный товар|ошибк[аи] комплект|пришло другое|перепутали/.test(e)?"wrong_item":/срок годности|истёк срок|истек срок|просроч|время.*возврат/.test(e)?"expired":/не соответств|не как на фото|описан|качество|не оправда/.test(e)?"not_as_described":/отказ|раздума|передумал|не понравил|не нужен|вернуть/.test(e)?"customer_refused":"other":"other"}function dr(r){if(r==null||r==="")return 0;const e=parseFloat(r);return Number.isNaN(e)?0:e}function ki(r,e){const t=new Date(r),s=new Date(e);if(isNaN(t.getTime()))throw new Error(`Invalid dateFrom: '${r}' is not a valid date string`);if(isNaN(s.getTime()))throw new Error(`Invalid dateTo: '${e}' is not a valid date string`);const a=(s.getTime()-t.getTime())/(1e3*60*60*24);if(a<0)throw new Error(`dateFrom (${r}) must be <= dateTo (${e})`);if(a>31)throw new Error(`Date range exceeds 31-day limit (got ${Math.round(a)} days). WB getAnalyticsGoodsReturn supports max 31 days. Split your range and call getReturns() multiple times.`)}function Mi(r){return r.isStatusActive===1?"initiated":r.isStatusActive===0&&r.completedDt?"processed":"received"}function Pi(r){const e=[];for(const t of r){if(t.nmId===void 0||!t.orderId&&t.orderId!==0)continue;const s=t.completedDt??t.readyToReturnDt??t.orderDt;s&&e.push({orderId:String(t.orderId),nmId:t.nmId,orderType:"fbo",returnDate:s,returnStatus:Mi(t),returnReason:t.reason??"",returnReasonCode:pe(t.reason??""),returnCategory:"unknown",quantity:1,srid:t.srid})}return e}function Ci(r,e){if(e.length===0)return r;const t=new Map,s=new Map,i=new Map;for(const a of e){const n=a.forPay!==void 0?dr(a.forPay):0;if(a.srid&&t.set(a.srid,(t.get(a.srid)??0)+n),a.orderId!==void 0&&a.nmId!==void 0){const o=`${a.orderId}:${a.nmId}`;s.set(o,(s.get(o)??0)+n),a.srid&&!i.has(o)&&i.set(o,a.srid)}}return r.map(a=>{let n,o;if(a.srid&&t.has(a.srid))n=t.get(a.srid);else{const u=`${a.orderId}:${a.nmId}`;s.has(u)&&(n=s.get(u),o=i.get(u))}return n===void 0?a:{...a,returnAmount:n,srid:a.srid??o}})}function Ki(r){const e=new Set;return r.filter(t=>t.srid?e.has(t.srid)?!1:(e.add(t.srid),!0):!0)}class pr{constructor(e,t,s,i){this.reports=t,this.finances=i}async fetchAllFinanceLines(e,t,s){const n=[];let o=0;for(let u=0;u<5;u++){const l=await this.finances.getSalesReportsDetailed({dateFrom:e,dateTo:t,limit:1e5,rrdId:o});if(l.length===0||(n.push(...l),l.length<1e5))break;const d=l[l.length-1];if(d.rrdId===void 0)break;o=d.rrdId}return n.length>=1e5*5&&s.push(`Finance source truncated at ${n.length} lines (safety cap). Some returnAmount values may be missing for high-volume sellers — narrow your date range and call getReturns() multiple times.`),n}async getReturns(e){ki(e.dateFrom,e.dateTo);const t=e.orderType!=="fbs",s=[];e.orderType!=="fbo"&&(e.includeFbsStatusHistory===!0?s.push("FBS status history fetching is reserved for future implementation in v3.10.0; FBS source skipped"):s.push("FBS status history skipped — pass includeFbsStatusHistory: true to include (currently no-op in v3.10.0)"));const[i,a]=await Promise.allSettled([t?this.reports.getAnalyticsGoodsReturn({dateFrom:e.dateFrom,dateTo:e.dateTo}):Promise.resolve(null),this.fetchAllFinanceLines(e.dateFrom,e.dateTo,s)]),n=[];i.status==="rejected"&&n.push({source:"fbo",error:i.reason instanceof Error?i.reason.message:String(i.reason)}),a.status==="rejected"&&n.push({source:"finance",error:a.reason instanceof Error?a.reason.message:String(a.reason)});const o=i.status==="fulfilled"&&i.value?Pi(i.value.report??[]):[],u=a.status==="fulfilled"?a.value:[],l={sources:{fbo:t?{fetched:o.length,skipped:!1,failed:i.status==="rejected",reason:i.status==="rejected"?"fetch failed":void 0}:{fetched:0,skipped:!0,failed:!1,reason:"orderType filter"},fbs:{fetched:0,skipped:!0,failed:!1,reason:"v3.10.0: implementation deferred"},finance:{fetched:u.length,skipped:!1,failed:a.status==="rejected",reason:a.status==="rejected"?"fetch failed":void 0}}},d=Ci(o,u),y=Ki(d),m=e.nmIds,b=m?y.filter(L=>m.includes(L.nmId)):y;b.sort((L,w)=>w.returnDate.localeCompare(L.returnDate));const p=e.offset??0,f=b.length,h=e.limit??b.length;return{data:b.slice(p,p+h),total:f,warnings:s,partialFailures:n,_meta:l}}async getReturnByOrderId(e,t){if(!e||e.trim()==="")throw new Error("orderId must be a non-empty string");return(await this.getReturns({dateFrom:t.dateFrom,dateTo:t.dateTo,orderType:t.orderType})).data.find(i=>i.orderId===e)??null}async getReturnStats(e){const t=await this.getReturns({dateFrom:e.dateFrom,dateTo:e.dateTo,nmIds:e.nmIds,orderType:e.orderType}),s=new Map;for(const a of t.data){let n;switch(e.groupBy){case"nmId":n=String(a.nmId);break;case"category":n=a.returnCategory;break;case"orderType":n=a.orderType;break;default:{const u=e.groupBy;throw new Error(`Unsupported groupBy value: ${String(u)}`)}}const o=s.get(n)??{count:0,totalAmount:0,pendingFinanceCount:0};o.count++,a.returnAmount!==void 0?o.totalAmount+=a.returnAmount:o.pendingFinanceCount++,s.set(n,o)}const i=Array.from(s.entries()).map(([a,n])=>({key:a,count:n.count,totalAmount:n.totalAmount,pendingFinanceCount:n.pendingFinanceCount}));return i.sort((a,n)=>n.count!==a.count?n.count-a.count:a.key.localeCompare(n.key)),{buckets:i,totalReturns:i.reduce((a,n)=>a+n.count,0),totalAmount:i.reduce((a,n)=>a+n.totalAmount,0),warnings:t.warnings,partialFailures:t.partialFailures,_meta:t._meta}}}const qi=50,mr=100,yr=100,Bi={box:["Короба","QR-поставка с коробами"],pallet:["Монопаллеты"],supersafe:["Суперсейф"]};function x(r,e=0){if(r==null)return e;const t=parseFloat(r);return Number.isFinite(t)?t:e}function Se(r){return Number(r.toFixed(2))}function Ri(r,e,t,s){const i=x(t.storageBaseLiter,0),a=x(t.storageAdditionalLiter,0),n=x(t.storageCoef,mr);let o;s?o=i:o=i+(r-1)*a;const u=o*(n/100)*e;return Se(u)}function Ai(r,e,t){const s=x(e.deliveryBaseLiter,0),i=x(e.deliveryAdditionalLiter,0),a=x(e.deliveryCoef,yr);let n;t?n=s:n=s+(r-1)*i;const o=n*(a/100);return Se(o)}function Ti(r){return r===0?0:Se(r*qi)}function Oi(r,e,t){const s=r.filter(i=>i.warehouseID===e);if(s.length!==0){if(t){const i=Bi[t],a=s.find(n=>i.some(o=>n.boxTypeName===o));if(a)return a}return s[0]}}async function Ei(r,e){const{volume:t,warehouseID:s,days:i,boxType:a}=r;if(t<=0)throw new Error("Volume must be greater than 0");const n=await e();if(n.length===0)throw new Error("No acceptance coefficients available");const o=Oi(n,s,a);if(!o)throw new Error(`Warehouse with ID ${s} not found`);const u=o.coefficient??0;if(u===-1)throw new Error(`Acceptance unavailable for warehouse: ${o.warehouseName}`);const l=a==="pallet"||o.boxTypeName==="Монопаллеты",d=Ti(u),y=Ri(t,i,o,l),m=Ai(t,o,l),b=Se(d+y+m);return{acceptanceCost:d,storageCost:y,logisticsCost:m,totalCost:b,warehouseName:o.warehouseName??"",appliedCoefficients:{acceptance:u,storage:x(o.storageCoef,mr),delivery:x(o.deliveryCoef,yr)}}}function N(r){if(r==null||r==="")return 0;const e=parseFloat(r);return isNaN(e)?0:e}function fr(r,e){if(!r)return!1;const t=r.toLowerCase().trim(),s=e.toLowerCase().trim();return t===s||t.startsWith(s)}function Di(r,e){return r.find(t=>fr(t.warehouseName,e))}function Ii(r,e){return r.find(t=>fr(t.warehouseName,e))}function Fi(r){return r?{deliveryBase:N(r.boxDeliveryBase),deliveryCoef:N(r.boxDeliveryCoefExpr),storageBase:N(r.boxStorageBase),storageCoef:N(r.boxStorageCoefExpr),found:!0}:{deliveryBase:0,deliveryCoef:0,storageBase:0,storageCoef:0,found:!1}}function Ni(r){return r?{deliveryBase:N(r.deliveryBaseLiter),deliveryCoef:N(r.deliveryCoef),storageBase:N(r.storageBaseLiter),storageCoef:N(r.storageCoef),found:!0}:{deliveryBase:0,deliveryCoef:0,storageBase:0,storageCoef:0,found:!1}}function ut(r,e){return r===0?e===0?0:100:(e-r)/r*100}function xi(r,e){return{deliveryBasePercent:ut(r.deliveryBase,e.deliveryBase),storageBasePercent:ut(r.storageBase,e.storageBase)}}function Ui(r,e){if(r.found&&!e.found)return"INVENTORY_CHEAPER";if(!r.found&&e.found)return"SUPPLY_CHEAPER";const t=r.deliveryBase+r.storageBase,s=e.deliveryBase+e.storageBase;return Math.abs(t-s)<1e-4?"EQUAL":s<t?"SUPPLY_CHEAPER":"INVENTORY_CHEAPER"}async function _i(r,e,t){const{warehouseName:s,date:i}=r,[a,n]=await Promise.all([e(),t()]),o=Di(a,s),u=Ii(n,s),l=Fi(o),d=Ni(u);if(!l.found&&!d.found)throw new Error(`Warehouse "${s}" not found`);const y=xi(l,d),m=Ui(l,d);return{warehouseName:s,date:i,inventory:l,supply:d,difference:y,recommendation:m}}function $i(r,e,t){const s=new Set(e.map(a=>a.id));let i=!1;return r.filter(a=>a.isRequiredForCreate===!0).filter(a=>{if(a.existNamedField===!0){if(!t)return i||(se("validateRequiredCharacteristics:legacy-call","validateRequiredCharacteristics: a required characteristic with existNamedField:true was found, but no `namedFields` parameter was provided. Helper may report false positives. Pass the named-field values (brand, height, length, etc.) as the third argument. See CHANGELOG v3.10.2 for migration details."),i=!0),!s.has(a.charcID??-1);const n=a.name?t[a.name]:void 0;return!(n!=null&&n!=="")}return!s.has(a.charcID??-1)})}function ji(r,e,t){if(e.length<2)return{divergentFixedChars:[],identicalVariableChars:[],duplicateVariants:!1};const s=new Map;for(const m of r)m.charcID!==void 0&&s.set(m.charcID,m);const i=new Map;let a=!1;const n=(m,b,p)=>{if(m.existNamedField===!0){const h=t==null?void 0:t[b];if(h===void 0){a||(se("validateMergedCardVariants:legacy-call","validateMergedCardVariants: a required characteristic with existNamedField:true was found, but no `namedFieldsPerVariant` parameter was provided (or the slot for this variant is undefined). Helper may report false positives. Pass the named-field values per variant as the third argument. See CHANGELOG v3.10.2 for migration details."),a=!0);const L=p.characteristics.find(w=>w.id===(m.charcID??-1));return JSON.stringify((L==null?void 0:L.value)??null)}const S=m.name?h[m.name]:void 0;return JSON.stringify(S??null)}const f=p.characteristics.find(h=>h.id===(m.charcID??-1));return JSON.stringify((f==null?void 0:f.value)??null)};for(let m=0;m<e.length;m++){const b=e[m];for(const p of b.characteristics){let f=i.get(p.id);f||(f=new Set,i.set(p.id,f)),f.add(JSON.stringify(p.value))}for(const p of r)if(p.existNamedField===!0&&p.charcID!==void 0){let f=i.get(p.charcID);f||(f=new Set,i.set(p.charcID,f)),f.add(n(p,m,b))}}const o=[],u=[];for(const[m,b]of i){const p=s.get(m);p&&(p.isVariable===!1&&b.size>1&&o.push(p),p.isVariable===!0&&b.size===1&&u.push(p))}const l=r.filter(m=>m.isVariable===!0&&m.charcID!==void 0).map(m=>m.charcID),d=new Set;let y=!1;for(let m=0;m<e.length;m++){const b=e[m],p=l.map(f=>{const h=s.get(f);if((h==null?void 0:h.existNamedField)===!0)return`${f}:${n(h,m,b)}`;const S=b.characteristics.find(L=>L.id===f);return`${f}:${JSON.stringify((S==null?void 0:S.value)??null)}`}).join("|");if(d.has(p)){y=!0;break}d.add(p)}return{divergentFixedChars:o,identicalVariableChars:u,duplicateVariants:y}}function Wi(r,e=[]){const t=[];for(const s of r){const i=s.completedDt??s.readyToReturnDt??s.orderDt;if(s.nmId===void 0||s.orderId===void 0||!i)continue;const a=s.reason??"";t.push({nmId:s.nmId,orderId:s.orderId,returnDate:i,reason:a,reasonCode:pe(a),warehouseName:s.dstOfficeAddress,orderType:"fbo",quantity:1})}for(const s of e){if(s.nmId===void 0||s.orderId===void 0||!s.lastChangeDate)continue;const i=s.reason??"";t.push({nmId:s.nmId,orderId:s.orderId,returnDate:s.lastChangeDate,reason:i,reasonCode:pe(i),warehouseName:s.warehouseName,orderType:"fbs",quantity:s.quantity??1})}return t.sort((s,i)=>i.returnDate.localeCompare(s.returnDate)),t}function Gi(r){if(r.length===0)return"unknown";const t=[...r].sort((l,d)=>l.date.localeCompare(d.date)).map(l=>l.status.toLowerCase()),s=t.includes("delivered"),i=t.includes("returned"),a=t.some(l=>l==="cancelled"||l==="canceled"),n=t.includes("defected"),o=t.some(l=>l==="canceled_by_client"||l==="cancelled_by_client"),u=t.some(l=>l==="confirmed"||l==="assembled");if(s&&i){const l=t.indexOf("delivered");if(t.indexOf("returned")>l)return"return_after_receipt"}if(s&&(n||o)){const l=t.indexOf("delivered");if(Math.min(n?t.indexOf("defected"):1/0,o?(()=>{const y=t.indexOf("canceled_by_client"),m=t.indexOf("cancelled_by_client");return Math.min(y<0?1/0:y,m<0?1/0:m)})():1/0)>l)return"refusal_at_pvz"}return a&&!u?"cancel_before_shipment":"unknown"}function Hi(r,e,t={}){const s=new Map;for(const i of r)s.set(i.nmId,{nmId:i.nmId,buyoutCount:i.buyoutCount,returnCount:0,fboReturnCount:0,fbsReturnCount:0,netRevenue:i.buyoutRevenue,anomalies:[]});for(const i of e){let a=s.get(i.nmId);a||(a={nmId:i.nmId,buyoutCount:0,returnCount:0,fboReturnCount:0,fbsReturnCount:0,netRevenue:void 0,anomalies:[]},s.set(i.nmId,a)),a.returnCount+=i.quantity,i.orderType==="fbo"?a.fboReturnCount+=i.quantity:a.fbsReturnCount+=i.quantity}for(const i of s.values())i.returnCount>i.buyoutCount&&i.buyoutCount>0&&i.anomalies.push({type:"return_without_buyout",nmId:i.nmId,details:`${i.returnCount} returns vs ${i.buyoutCount} buyouts`}),i.buyoutCount>0&&i.returnCount===0&&t.strictTemporalAlignment&&i.anomalies.push({type:"orphan_buyout",nmId:i.nmId,details:`${i.buyoutCount} buyouts with no returns`}),i.buyoutCount===0&&i.returnCount>0&&i.anomalies.push({type:"return_without_buyout",nmId:i.nmId,details:`Return without matching buyout record (${i.returnCount} returns, 0 buyouts)`});return Array.from(s.values()).sort((i,a)=>i.nmId-a.nmId)}function Vi(r){if(r==null||typeof r!="object")return null;if(r instanceof ve)return{code:r.code,message:r.message,metaDetails:r.metaDetails};const e=r;if(e.statusCode!==409)return null;const t=e.response;if(t==null||typeof t!="object")return null;const s=t;if(!Array.isArray(s.metaDetails))return null;const i=typeof s.code=="string"?s.code:"Unknown",a=typeof s.message=="string"?s.message:typeof e.message=="string"?e.message:"Meta validation failed";return{code:i,message:a,metaDetails:s.metaDetails}}function Ne(r){const e=r.normQueries;if(e.length===0)return null;let t=1/0,s=-1/0;for(const i of e)t=Math.min(t,i.reachMin.bidKopecks),s=Math.max(s,i.reachMax.bidKopecks);return{min:t,max:s}}function zi(r,e){const t=Ne(r);if(t!==null&&(e<t.min||e>t.max))throw new Fe(`Bid ${e} is outside the recommended range [${t.min}, ${t.max}] kopecks`,{received:e,min:t.min,max:t.max,field:"bid_kopecks"})}function Ji(r,e){const t=Ne(r);return t===null?e:Math.min(t.max,Math.max(t.min,e))}function Xi(r,e){const t=(e==null?void 0:e.excludeLastDays)??1,s=e==null?void 0:e.windowDays,a=[...Array.isArray(r)?r:r.days].sort((d,y)=>d.date<y.date?-1:d.date>y.date?1:0),n=Math.max(0,Math.min(t,a.length));let o=a.slice(0,a.length-n);s!=null&&s>=0&&(o=o.slice(Math.max(0,o.length-s)));let u=0,l=0;for(const d of o)u+=d.sum,l+=d.sum_price;return{roas:u>0?l/u:null,revenue:l,spend:u,daysUsed:o.length,excludedDays:n}}class hr{constructor(e){if(!e.apiKey||e.apiKey.trim()==="")throw new be("API key is required. Please provide a valid Wildberries API key in the configuration.",401);this.client=new Xt(e);const t=e.tokenType??"personal";(t==="basic"||t==="test")&&console.warn(`[WildberriesSDK] ${t.charAt(0).toUpperCase()+t.slice(1)} token detected. Reduced rate limits apply. Consider upgrading to a Personal or Service token. See https://dev.wildberries.ru/news/281`),this.general=new Qt(this.client),this.products=new Yt(this.client),this.ordersFBS=new Zt(this.client),this.ordersFBW=new er(this.client),this.finances=new tr(this.client),this.analytics=new rr(this.client),this.communications=new ir(this.client),this.reports=new ar(this.client),this.promotion=new nr(this.client),this.tariffs=new or(this.client),this.inStorePickup=new cr(this.client),this.ordersDBS=new ur(this.client),this.userManagement=new lr(this.client),this.returns=new pr(this.client,this.reports,this.ordersFBS,this.finances)}}const Qi=vr.version;exports.ALL_RATE_LIMITS=Ae;exports.AnalyticsModule=rr;exports.AuthenticationError=be;exports.BaseClient=Xt;exports.BidOutOfRangeError=Fe;exports.BudgetExceededError=Xs;exports.COMMUNICATIONS_LIMITS=sr;exports.CampaignNotFoundError=zs;exports.CommunicationsModule=ir;exports.CustomerVerificationError=ti;exports.FinancesModule=tr;exports.GeneralModule=Qt;exports.InStorePickupModule=cr;exports.InvalidBidError=Js;exports.InvalidCampaignStateError=Qs;exports.InvalidOrderStateError=ei;exports.MetaValidationFailError=ve;exports.MetadataValidationError=ri;exports.NetworkError=G;exports.OrdersDbsModule=ur;exports.OrdersFbsModule=Zt;exports.OrdersFbwModule=er;exports.PickupOrderNotFoundError=Zs;exports.ProductsModule=Yt;exports.PromotionModule=nr;exports.RateLimitError=Ie;exports.ReportsModule=ar;exports.ReturnsModule=pr;exports.TariffsModule=or;exports.UserManagementModule=lr;exports.ValidationError=g;exports.WBAPIError=C;exports.WITH_PHOTO_FILTER=hi;exports.WarehouseStocksUpdateBlockError=Dt;exports.WildberriesSDK=hr;exports.analyticsRateLimits=Vt;exports.calculateSupplyCost=Ei;exports.clampBid=Ji;exports.classifyFbsReturnCategory=Gi;exports.classifyReturnReason=pe;exports.communicationsRateLimits=Jt;exports.compareTariffs=_i;exports.computeROAS=Xi;exports.default=hr;exports.enrichReturnsWithType=Wi;exports.extractBidRange=Ne;exports.financesRateLimits=jt;exports.generalRateLimits=Ft;exports.getOperationCategory=ai;exports.getOperationMetadata=oi;exports.getOperationRateLimitKey=ni;exports.getOperationsByCategory=ci;exports.getReadonlyOperations=ui;exports.getWriteOperations=li;exports.inStorePickupRateLimits=Ht;exports.isOperationReadonly=It;exports.operationMetadata=U;exports.ordersDbsRateLimits=_t;exports.ordersFbsRateLimits=xt;exports.ordersFbwRateLimits=Ut;exports.parseBidOutOfRangeDetail=Et;exports.parseMetaValidationFail=Vi;exports.parseMoneyAmount=dr;exports.productsRateLimits=Nt;exports.promotionRateLimits=Wt;exports.reconcileBuyoutsAndReturns=Hi;exports.reportsRateLimits=zt;exports.resetDeprecationWarnings=fi;exports.tariffsRateLimits=Gt;exports.userManagementRateLimits=$t;exports.validateBid=zi;exports.validateMergedCardVariants=ji;exports.validateRequiredCharacteristics=$i;exports.version=Qi;exports.warnOnce=se;
61
+ `)}toJSON(){return{...super.toJSON(),code:this.code,metaDetails:this.metaDetails}}}class ir extends h.WBAPIError{constructor(e,t,s,i,n){super(e,406,t,s,i,n)}getUserMessage(){return`${this.message} The warehouse is processing — retry the inventory update later.`}}class Gi{constructor(e){this.capacity=e.burstLimit??e.requestsPerMinute,this.tokens=this.capacity,this.refillRate=e.requestsPerMinute/6e4,this.lastRefill=Date.now(),this.queue=[]}refill(){const e=Date.now(),s=(e-this.lastRefill)*this.refillRate;this.tokens=Math.min(this.capacity,this.tokens+s),this.lastRefill=e}async consume(){if(this.refill(),this.tokens>=1){this.tokens-=1;return}return new Promise(e=>{this.queue.push(e),this.scheduleNextRelease()})}scheduleNextRelease(){if(this.queue.length===0)return;const e=1/this.refillRate;setTimeout(()=>{if(this.refill(),this.tokens>=1&&this.queue.length>0){this.tokens-=1;const t=this.queue.shift();t&&t(),this.queue.length>0&&this.scheduleNextRelease()}},e)}getAvailableTokens(){return this.refill(),this.tokens}}class zi{constructor(e){this.buckets=new Map,this.config=e??{}}async waitForSlot(e){const t=this.getOrCreateBucket(e);t&&await t.consume()}getOrCreateBucket(e){if(this.buckets.has(e))return this.buckets.get(e)??null;if(!(e in this.config))return null;const t=this.config[e],s=new Gi(t);return this.buckets.set(e,s),s}configure(e,t){this.config[e]=t,this.buckets.delete(e)}getConfiguration(e){return e in this.config?this.config[e]:void 0}canProceed(e){const t=this.getOrCreateBucket(e);return t?t.getAvailableTokens()>=1:!0}getRemainingTokens(e){const t=this.getOrCreateBucket(e);return t?t.getAvailableTokens():1/0}reset(e){e?this.buckets.delete(e):this.buckets.clear()}}const J={"general.ping":{readonly:!0,category:"all",rateLimitKey:"general.ping"},"general.news":{readonly:!0,category:"commonapi",rateLimitKey:"general.communicationsNews"},"general.sellerInfo":{readonly:!0,category:"commonapi",rateLimitKey:"general.sellerInfo"},"products.getParentAll":{readonly:!0,category:"content",rateLimitKey:"products.contentObjectParentAll"},"products.getObjectAll":{readonly:!0,category:"content",rateLimitKey:"products.contentObjectAll"},"products.getObjectCharc":{readonly:!0,category:"content",rateLimitKey:"products.contentObjectCharcs"},"products.getDirectoryColors":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryColors"},"products.getDirectoryKinds":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryKinds"},"products.getDirectoryCountries":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryCountries"},"products.getDirectorySeasons":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectorySeasons"},"products.getDirectoryVat":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryVat"},"products.getDirectoryTnved":{readonly:!0,category:"content",rateLimitKey:"products.contentDirectoryTnved"},"products.getBrands":{readonly:!0,category:"content",rateLimitKey:"products.brands"},"products.getContentTags":{readonly:!0,category:"content",rateLimitKey:"products.contentTags"},"products.createContentTag":{readonly:!1,category:"content",rateLimitKey:"products.postContentTag"},"products.updateContentTag":{readonly:!1,category:"content",rateLimitKey:"products.patchContentTag"},"products.deleteContentTag":{readonly:!1,category:"content",rateLimitKey:"products.deleteContentTag"},"products.createNomenclatureLink":{readonly:!1,category:"content",rateLimitKey:"products.postContentTagNomenclatureLink"},"products.getCardsList":{readonly:!0,category:"content",rateLimitKey:"products.postContentGetCardsList"},"products.createErrorList":{readonly:!0,category:"content",rateLimitKey:"products.postContentCardsErrorList"},"products.createCardsUpdate":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsUpdate"},"products.createCardsMovenm":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsMoveNm"},"products.createDeleteTrash":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsDeleteTrash"},"products.createCardsRecover":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsRecover"},"products.getTrashedCards":{readonly:!0,category:"content",rateLimitKey:"products.postContentGetCardsTrash"},"products.getCardsLimits":{readonly:!0,category:"content",rateLimitKey:"products.contentCardsLimits"},"products.createContentBarcode":{readonly:!1,category:"content",rateLimitKey:"products.postContentBarcodes"},"products.createCardsUpload":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsUpload"},"products.createUploadAdd":{readonly:!1,category:"content",rateLimitKey:"products.postContentCardsUploadAdd"},"products.createMediaFile":{readonly:!1,category:"content",rateLimitKey:"products.postContentMediaFile"},"products.createMediaSave":{readonly:!1,category:"content",rateLimitKey:"products.postContentMediaSave"},"products.createUploadTask":{readonly:!1,category:"discountsandprices",rateLimitKey:"products.postUploadTask"},"products.createTaskSize":{readonly:!1,category:"discountsandprices",rateLimitKey:"products.postUploadTaskSize"},"products.createTaskClubDiscount":{readonly:!1,category:"discountsandprices",rateLimitKey:"products.postUploadTaskClubDiscount"},"products.getHistoryTasks":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.historyTasks"},"products.getGoodsTask":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.historyGoodsTask"},"products.getBufferTasks":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.bufferTasks"},"products.getBufferGoodsTask":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.bufferGoodsTask"},"products.getGoodsFilter":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.listGoodsFilter"},"products.createGoodsFilter":{readonly:!1,category:"discountsandprices",rateLimitKey:"products.postListGoodsFilter"},"products.getSizeNm":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.listGoodsSizeNm"},"products.getQuarantineGoods":{readonly:!0,category:"discountsandprices",rateLimitKey:"products.quarantineGoods"},"products.getStocks":{readonly:!1,category:"marketplace",rateLimitKey:"products.postStocks"},"products.updateStock":{readonly:!1,category:"marketplace",rateLimitKey:"products.putStocks"},"products.deleteStock":{readonly:!1,category:"marketplace",rateLimitKey:"products.deleteStocks"},"products.offices":{readonly:!0,category:"marketplace",rateLimitKey:"products.offices"},"products.warehouses":{readonly:!0,category:"marketplace",rateLimitKey:"products.warehouses"},"products.createWarehouse":{readonly:!1,category:"marketplace",rateLimitKey:"products.postWarehouses"},"products.updateWarehouse":{readonly:!1,category:"marketplace",rateLimitKey:"products.putWarehouses"},"products.deleteWarehouse":{readonly:!1,category:"marketplace",rateLimitKey:"products.deleteWarehouses"},"products.getWarehousesContact":{readonly:!0,category:"marketplace",rateLimitKey:"products.dbwWarehousesContacts"},"products.updateWarehousesContact":{readonly:!1,category:"marketplace",rateLimitKey:"products.putDbwWarehousesContacts"},"userManagement.createInvite":{readonly:!1,category:"usermanagement",rateLimitKey:"userManagement.createInvite"},"userManagement.getUsers":{readonly:!0,category:"usermanagement",rateLimitKey:"userManagement.getUsers"},"userManagement.updateUserAccess":{readonly:!1,category:"usermanagement",rateLimitKey:"userManagement.updateUserAccess"},"userManagement.deleteUser":{readonly:!1,category:"usermanagement",rateLimitKey:"userManagement.deleteUser"},"ordersFBS.getPassesOffices":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.passesOffices"},"ordersFBS.passes":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.passes"},"ordersFBS.createPass":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.postPasses"},"ordersFBS.updatePass":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putPasses"},"ordersFBS.deletePass":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.deletePasses"},"ordersFBS.getOrdersNew":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.ordersNew"},"ordersFBS.orders":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.orders"},"ordersFBS.createOrdersStatu":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStatus"},"ordersFBS.getOrderStatuses":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStatus"},"ordersFBS.getOrdersReshipment":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.suppliesOrdersReshipment"},"ordersFBS.updateOrdersCancel":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.patchOrdersCancel"},"ordersFBS.createOrdersSticker":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStickers"},"ordersFBS.createStickersCrossBorder":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStickersCrossBorder"},"ordersFBS.createOrdersExternalSticker":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postFilesOrdersExternalStickers"},"ordersFBS.createStatusHistory":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersStatusHistory"},"ordersFBS.createOrdersClient":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postOrdersClient"},"ordersFBS.getOrdersMetaBulk":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postMarketplaceOrdersMeta"},"ordersFBS.getOrdersMeta":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postMarketplaceOrdersMeta"},"ordersFBS.deleteOrdersMeta":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.deleteOrdersMeta"},"ordersFBS.updateMetaSgtin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaSgtin"},"ordersFBS.updateMetaUin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaUin"},"ordersFBS.updateMetaImei":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaImei"},"ordersFBS.updateMetaGtin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaGtin"},"ordersFBS.updateMetaExpiration":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaExpiration"},"ordersFBS.setCustomsDeclaration":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.putOrdersMetaCustomsDeclaration"},"ordersFBS.supplies":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.supplies"},"ordersFBS.createSupply":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.postSupplies"},"ordersFBS.updateSuppliesOrder":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.patchSuppliesOrders"},"ordersFBS.addOrdersToSupply":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.patchMarketplaceSuppliesOrders"},"ordersFBS.getSupply":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.getSupply"},"ordersFBS.deleteSupply":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.deleteSupplies"},"ordersFBS.getSuppliesOrder":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.suppliesOrders"},"ordersFBS.getSupplyOrderIds":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.getMarketplaceSuppliesOrderIds"},"ordersFBS.updateSuppliesDeliver":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.patchSuppliesDeliver"},"ordersFBS.getSuppliesBarcode":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.suppliesBarcode"},"ordersFBS.getSuppliesTrbx":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.suppliesTrbx"},"ordersFBS.createSuppliesTrbx":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.postSuppliesTrbx"},"ordersFBS.deleteSuppliesTrbx":{readonly:!1,category:"marketplace",rateLimitKey:"orders-fbs.deleteSuppliesTrbx"},"ordersFBS.createTrbxSticker":{readonly:!0,category:"marketplace",rateLimitKey:"orders-fbs.postSuppliesTrbxStickers"},"ordersDBS.getNewOrders":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getNewOrders"},"ordersDBS.getOrders":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getOrders"},"ordersDBS.getGroupsInfo":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getGroupsInfo"},"ordersDBS.getClientInfo":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getClientInfo"},"ordersDBS.getB2BInfo":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getB2BInfo"},"ordersDBS.getDeliveryDates":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getDeliveryDates"},"ordersDBS.getMeta":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getMeta"},"ordersDBS.deleteMeta":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.deleteMeta"},"ordersDBS.deleteMetaBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.deleteMetaBulk"},"ordersDBS.setSgtin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setSgtinBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setSgtinBulk"},"ordersDBS.setUin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setUinBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setUinBulk"},"ordersDBS.setImei":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setImeiBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setImeiBulk"},"ordersDBS.setGtin":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setGtinBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setGtinBulk"},"ordersDBS.setCustomsDeclaration":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setMeta"},"ordersDBS.setCustomsDeclarationBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.setCustomsDeclarationBulk"},"ordersDBS.getStatuses":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getStatuses"},"ordersDBS.getStatusesBulk":{readonly:!0,category:"marketplace",rateLimitKey:"orders-dbs.getStatusesBulk"},"ordersDBS.confirm":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.confirm"},"ordersDBS.confirmBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.confirmBulk"},"ordersDBS.deliver":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.deliver"},"ordersDBS.deliverBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.deliverBulk"},"ordersDBS.receive":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.receive"},"ordersDBS.receiveBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.receiveBulk"},"ordersDBS.reject":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.reject"},"ordersDBS.rejectBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.rejectBulk"},"ordersDBS.cancel":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.cancel"},"ordersDBS.cancelBulk":{readonly:!1,category:"marketplace",rateLimitKey:"orders-dbs.cancelBulk"},"ordersFBW.getAcceptanceCoefficients":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.acceptanceCoefficients"},"ordersFBW.createAcceptanceOption":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.postAcceptanceOptions"},"ordersFBW.warehouses":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.warehouses"},"ordersFBW.transitTariffs":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.transitTariffs"},"ordersFBW.listSupplies":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.postSupplies"},"ordersFBW.createSupply":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.postSupplies"},"ordersFBW.getSupply":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.supplies"},"ordersFBW.getSuppliesGood":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.suppliesGoods"},"ordersFBW.getSuppliesPackage":{readonly:!0,category:"supplies",rateLimitKey:"orders-fbw.suppliesPackage"},"promotion.getPromotionCount":{readonly:!0,category:"advert",rateLimitKey:"promotion.advPromotionCount"},"promotion.createPromotionAdvert":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvPromotionAdverts"},"promotion.getAdvertsV2":{readonly:!0,category:"advert",rateLimitKey:"promotion.advertsV2"},"promotion.getAdvConfig":{readonly:!0,category:"advert",rateLimitKey:"promotion.advConfig"},"promotion.createBidsMin":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvBidsMin"},"promotion.getBidsMinV2":{readonly:!0,category:"advert",rateLimitKey:"promotion.bidsMinV1"},"promotion.createAdvSaveAd":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvSaveAd"},"promotion.createSeacatSaveAd":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvSeacatSaveAd"},"promotion.getSupplierSubjects":{readonly:!0,category:"advert",rateLimitKey:"promotion.advSupplierSubjects"},"promotion.createSupplierNm":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvSupplierNms"},"promotion.getAdvDelete":{readonly:!1,category:"advert",rateLimitKey:"promotion.advDelete"},"promotion.createAdvRename":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvRename"},"promotion.getAdvStart":{readonly:!1,category:"advert",rateLimitKey:"promotion.advStart"},"promotion.getAdvPause":{readonly:!1,category:"advert",rateLimitKey:"promotion.advPause"},"promotion.getAdvStop":{readonly:!1,category:"advert",rateLimitKey:"promotion.advStop"},"promotion.updateAdvBid":{readonly:!1,category:"advert",rateLimitKey:"promotion.patchAdvBids"},"promotion.updateAuctionPlacement":{readonly:!1,category:"advert",rateLimitKey:"promotion.putAdvAuctionPlacements"},"promotion.updateAuctionNm":{readonly:!1,category:"advert",rateLimitKey:"promotion.patchAdvAuctionNms"},"promotion.getAdvBalance":{readonly:!0,category:"advert",rateLimitKey:"promotion.advBalance"},"promotion.getAdvBudget":{readonly:!0,category:"advert",rateLimitKey:"promotion.advBudget"},"promotion.createBudgetDeposit":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvBudgetDeposit"},"promotion.getAdvUpd":{readonly:!0,category:"advert",rateLimitKey:"promotion.advUpd"},"promotion.getAdvPayments":{readonly:!0,category:"advert",rateLimitKey:"promotion.advPayments"},"promotion.getSearchSetPlus":{readonly:!1,category:"advert",rateLimitKey:"promotion.advSearchSetPlus"},"promotion.createSearchSetPlu":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvSearchSetPlus"},"promotion.createSearchSetExcluded":{readonly:!1,category:"advert",rateLimitKey:"promotion.postAdvSearchSetExcluded"},"promotion.getAutoGetnmtoadd":{readonly:!0,category:"advert",rateLimitKey:"promotion.advAutoGetnmtoadd"},"promotion.getAdvCount":{readonly:!0,category:"advert",rateLimitKey:"promotion.advCount"},"promotion.getAdvAdverts":{readonly:!0,category:"advert",rateLimitKey:"promotion.advAdverts"},"promotion.getAdvAdvert":{readonly:!0,category:"advert",rateLimitKey:"promotion.advAdvert"},"promotion.createAdvFullstat":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvFullstats"},"promotion.getAdvFullstats":{readonly:!0,category:"advert",rateLimitKey:"promotion.advFullstats"},"promotion.getAutoStatWords":{readonly:!0,category:"advert",rateLimitKey:"promotion.advAutoStatWords"},"promotion.getStatWords":{readonly:!0,category:"advert",rateLimitKey:"promotion.advStatWords"},"promotion.createAdvStat":{readonly:!0,category:"advert",rateLimitKey:"promotion.postAdvStats"},"promotion.getCalendarPromotions":{readonly:!0,category:"discountsandprices",rateLimitKey:"promotion.calendarPromotions"},"promotion.getPromotionsDetails":{readonly:!0,category:"discountsandprices",rateLimitKey:"promotion.calendarPromotionsDetails"},"promotion.getPromotionsNomenclatures":{readonly:!0,category:"discountsandprices",rateLimitKey:"promotion.calendarPromotionsNomenclatures"},"promotion.createPromotionsUpload":{readonly:!1,category:"discountsandprices",rateLimitKey:"promotion.postCalendarPromotionsUpload"},"promotion.getNormqueryStats":{readonly:!0,category:"advert",rateLimitKey:"promotion.normqueryStats"},"promotion.getNormqueryBids":{readonly:!0,category:"advert",rateLimitKey:"promotion.normqueryGetBids"},"promotion.setNormqueryBids":{readonly:!1,category:"advert",rateLimitKey:"promotion.normquerySetBids"},"promotion.deleteNormqueryBids":{readonly:!1,category:"advert",rateLimitKey:"promotion.normqueryDeleteBids"},"promotion.getNormqueryMinus":{readonly:!0,category:"advert",rateLimitKey:"promotion.normqueryGetMinus"},"promotion.setNormqueryMinus":{readonly:!1,category:"advert",rateLimitKey:"promotion.normquerySetMinus"},"communications.newFeedbacksQuestions":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.newFeedbacksQuestions"},"communications.getQuestionsCountUnanswered":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.questionsCountUnanswered"},"communications.getQuestionsCount":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.questionsCount"},"communications.questions":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.questions"},"communications.updateQuestion":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.patchQuestions"},"communications.question":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.question"},"communications.getFeedbacksCountUnanswered":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedbacksCountUnanswered"},"communications.getFeedbacksCount":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedbacksCount"},"communications.feedbacks":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedbacks"},"communications.supplierValuations":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.supplierValuations"},"communications.createFeedbacksAction":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.postFeedbacksActions"},"communications.createFeedbacksAnswer":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.postFeedbacksAnswer"},"communications.updateFeedbacksAnswer":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.patchFeedbacksAnswer"},"communications.createOrderReturn":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.postFeedbacksOrderReturn"},"communications.feedback":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedback"},"communications.getFeedbacksArchive":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.feedbacksArchive"},"communications.templates":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.templates"},"communications.createTemplate":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.postTemplates"},"communications.updateTemplate":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.patchTemplates"},"communications.deleteTemplate":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.deleteTemplates"},"communications.getSellerChats":{readonly:!0,category:"buyerchat",rateLimitKey:"communications.sellerChats"},"communications.getSellerEvents":{readonly:!0,category:"buyerchat",rateLimitKey:"communications.sellerEvents"},"communications.createSellerMessage":{readonly:!1,category:"buyerchat",rateLimitKey:"communications.postSellerMessage"},"communications.getSellerDownload":{readonly:!0,category:"buyerchat",rateLimitKey:"communications.sellerDownload"},"communications.claims":{readonly:!0,category:"returns",rateLimitKey:"communications.claims"},"communications.updateClaim":{readonly:!1,category:"returns",rateLimitKey:"communications.patchClaim"},"communications.getPinnedFeedbacksCount":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.getPinnedFeedbacksCount"},"communications.getPinnedFeedbacksLimits":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.getPinnedFeedbacksLimits"},"communications.getPinnedFeedbacks":{readonly:!0,category:"questionsandfeedback",rateLimitKey:"communications.getPinnedFeedbacks"},"communications.pinFeedback":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.pinFeedback"},"communications.unpinFeedback":{readonly:!1,category:"questionsandfeedback",rateLimitKey:"communications.unpinFeedback"},"tariffs.getTariffsCommission":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.tariffsCommission"},"tariffs.getTariffsBox":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.tariffsBox"},"tariffs.getTariffsPallet":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.tariffsPallet"},"tariffs.getTariffsReturn":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.tariffsReturn"},"tariffs.getAcceptanceCoefficients":{readonly:!0,category:"commonapi",rateLimitKey:"tariffs.acceptanceCoefficients"},"analytics.createNmReportDetail":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createNmReportDetail"},"analytics.createDetailHistory":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createDetailHistory"},"analytics.createGroupedHistory":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createGroupedHistory"},"analytics.getSalesFunnelProducts":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getSalesFunnelProducts"},"analytics.getSalesFunnelProductsHistory":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getSalesFunnelProductsHistory"},"analytics.getSalesFunnelGroupedHistory":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getSalesFunnelGroupedHistory"},"analytics.getNmReportDownloads":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getNmReportDownloads"},"analytics.createNmReportDownload":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createNmReportDownload"},"analytics.createDownloadsRetry":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createDownloadsRetry"},"analytics.getDownloadsFile":{readonly:!0,category:"contentanalytics",rateLimitKey:"analytics.getDownloadsFile"},"analytics.createSearchReportReport":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createSearchReportReport"},"analytics.createTableGroup":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createTableGroup"},"analytics.createTableDetail":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createTableDetail"},"analytics.createProductSearchText":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductSearchText"},"analytics.createProductOrder":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductOrder"},"analytics.createProductsGroup":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductsGroup"},"analytics.createProductsProduct":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductsProduct"},"analytics.createProductsSize":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createProductsSize"},"analytics.createStocksReportOffice":{readonly:!1,category:"contentanalytics",rateLimitKey:"analytics.createStocksReportOffice"},"reports.getSupplierIncomes":{readonly:!0,category:"statistics",rateLimitKey:"reports.supplierIncomes"},"reports.getSupplierStocks":{readonly:!0,category:"statistics",rateLimitKey:"reports.supplierStocks"},"reports.getSupplierOrders":{readonly:!0,category:"statistics",rateLimitKey:"reports.supplierOrders"},"reports.getSupplierSales":{readonly:!0,category:"statistics",rateLimitKey:"reports.supplierSales"},"reports.createAnalyticsExciseReport":{readonly:!1,category:"contentanalytics",rateLimitKey:"reports.createAnalyticsExciseReport"},"reports.warehouseRemains":{readonly:!1,category:"contentanalytics",rateLimitKey:"reports.warehouseRemains"},"reports.getWarehouseRemainsTaskStatus":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getWarehouseRemainsTaskStatus"},"reports.downloadWarehouseRemainsReport":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.downloadWarehouseRemainsReport"},"reports.getAnalyticsAntifraudDetails":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsAntifraudDetails"},"reports.getAnalyticsGoodsLabeling":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsGoodsLabeling"},"reports.acceptanceReport":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.acceptanceReport"},"reports.paidStorage":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.paidStorage"},"reports.getAnalyticsRegionSale":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsRegionSale"},"reports.getBrandShareBrands":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getBrandShareBrands"},"reports.getBannedProductsBlocked":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getBannedProductsBlocked"},"reports.getMeasurementPenalties":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getMeasurementPenalties"},"reports.getWarehouseMeasurementsV2":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getWarehouseMeasurementsV2"},"reports.getDeductions":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getDeductions"},"reports.getTasksStatu":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getWarehouseRemainsTaskStatus"},"reports.getTasksDownload":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.downloadWarehouseRemainsReport"},"reports.getAnalyticsWarehouseMeasurements":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsWarehouseMeasurements"},"reports.getAnalyticsIncorrectAttachments":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsIncorrectAttachments"},"reports.getAnalyticsCharacteristicsChange":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsCharacteristicsChange"},"reports.getAcceptanceReportTaskStatus":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAcceptanceReportTaskStatus"},"reports.downloadAcceptanceReport":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.downloadAcceptanceReport"},"reports.getPaidStorageTaskStatus":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getPaidStorageTaskStatus"},"reports.downloadPaidStorageReport":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.downloadPaidStorageReport"},"reports.getBrandShareParentSubjects":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getBrandShareParentSubjects"},"reports.getAnalyticsBrandShare":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsBrandShare"},"reports.getBannedProductsShadowed":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getBannedProductsShadowed"},"reports.getAnalyticsGoodsReturn":{readonly:!0,category:"contentanalytics",rateLimitKey:"reports.getAnalyticsGoodsReturn"},"finances.getAccountBalance":{readonly:!0,category:"finance",rateLimitKey:"finances.accountBalance"},"finances.getDocumentsCategories":{readonly:!0,category:"documents",rateLimitKey:"finances.documentsCategories"},"finances.getDocumentsList":{readonly:!0,category:"documents",rateLimitKey:"finances.documentsList"},"finances.getDocumentsDownload":{readonly:!0,category:"documents",rateLimitKey:"finances.documentsDownload"},"finances.createDownloadAll":{readonly:!1,category:"documents",rateLimitKey:"finances.createDownloadAll"},"inStorePickup.getOrdersNew":{readonly:!0,category:"marketplace",rateLimitKey:"in-store-pickup.ordersNew"},"inStorePickup.createOrdersClient":{readonly:!1,category:"marketplace",rateLimitKey:"in-store-pickup.ordersClient"},"inStorePickup.createClientIdentity":{readonly:!1,category:"marketplace",rateLimitKey:"in-store-pickup.clientIdentity"},"inStorePickup.getClickCollectOrders":{readonly:!0,category:"marketplace",rateLimitKey:"in-store-pickup.clickCollectOrders"}};function nr(r){const e=J[r];return e?e.readonly:!1}function Ji(r){const e=J[r];return e?e.category:void 0}function Xi(r){const e=J[r];return e?e.rateLimitKey:void 0}function Qi(r){return J[r]}function Yi(r){return Object.entries(J).filter(([,e])=>e.category===r).map(([e])=>e)}function Zi(){return Object.entries(J).filter(([,r])=>r.readonly).map(([r])=>r)}function en(){return Object.entries(J).filter(([,r])=>!r.readonly).map(([r])=>r)}class tn{constructor(e,t){this.config={maxRetries:(e==null?void 0:e.maxRetries)??3,retryDelay:(e==null?void 0:e.retryDelay)??1e3,exponentialBackoff:(e==null?void 0:e.exponentialBackoff)??!0},this.logLevel=t??"warn"}async executeWithRetry(e,t="operation",s){let i;for(let n=0;n<=this.config.maxRetries;n++)try{const a=await e();return n>0&&this.log("info",`Operation succeeded after ${String(n)} retries`,{operationName:t}),a}catch(a){if(i=a,!this.shouldRetry(a,n,s))throw n>0&&this.log("warn",`All retries exhausted for ${t} after ${String(n)} attempts`,{operationName:t,attempts:n,maxRetries:this.config.maxRetries,finalError:a instanceof Error?a.message:String(a)}),a;const o=this.calculateDelay(n);this.log("info",`Retrying ${t} (attempt ${String(n+1)}/${String(this.config.maxRetries)}, waiting ${String(Math.round(o))}ms)`,{operationName:t,attempt:n+1,maxRetries:this.config.maxRetries,delay:Math.round(o)}),this.log("debug",`Retry context for ${t}`,{operationName:t,attempt:n+1,maxRetries:this.config.maxRetries,delay:Math.round(o),errorMessage:a instanceof Error?a.message:String(a),errorType:a instanceof Error?a.constructor.name:typeof a,statusCode:a instanceof ee?a.statusCode:void 0,isTimeout:a instanceof ee?a.isTimeout:void 0}),await this.sleep(o)}throw this.log("warn",`Max retries exhausted for ${t}`,{maxRetries:this.config.maxRetries}),i||new Error("Unexpected: No error captured after retry exhaustion")}shouldRetry(e,t,s){if(t>=this.config.maxRetries||e instanceof Oe||e instanceof Ke||e instanceof h.ValidationError)return!1;if(s!=null&&s.operationKey){const i=nr(s.operationKey);if(!i&&!s.forceRetry)return this.log("info",`Skipping retry for write operation: ${s.operationKey}`,{operationKey:s.operationKey,readonly:i,forceRetry:s.forceRetry??!1}),!1}if(e instanceof tt)return!0;if(e instanceof ee){const i=e.statusCode;return!!(!i||i===0||i>=500&&i<600||e.isTimeout)}return!1}calculateDelay(e){let t;this.config.exponentialBackoff?t=this.config.retryDelay*Math.pow(2,e):t=this.config.retryDelay;const s=1+(Math.random()*.2-.1);return t=t*s,Math.min(t,3e4)}async sleep(e){return new Promise(t=>setTimeout(t,e))}log(e,t,s){const i={debug:0,info:1,warn:2,error:3};if(i[e]<i[this.logLevel])return;({debug:console.debug,info:console.info,warn:console.warn,error:console.error})[e](JSON.stringify({timestamp:new Date().toISOString(),level:e,service:"RetryHandler",message:t,...s??{}}))}}const ar={"general.ping":{requestsPerMinute:6,intervalSeconds:10,burstLimit:3},"general.communicationsNews":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"general.sellerInfo":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"general.createInvite":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"general.getUsers":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"general.updateUserAccess":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"general.deleteUser":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"general.getJamSubscription":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"general.getSellerRating":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"general.tariffConstructorOptions":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10}},or={"products.contentObjectParentAll":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentObjectAll":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentObjectCharcs":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryColors":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryKinds":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryCountries":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectorySeasons":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryVat":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentDirectoryTnved":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentTags":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentTag":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.patchContentTag":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.deleteContentTag":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentTagNomenclatureLink":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.brands":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"products.postContentGetCardsList":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsErrorList":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"products.postContentCardsUpdate":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"products.postContentCardsMoveNm":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsDeleteTrash":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsRecover":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsDelete":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentGetCardsTrash":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.contentCardsLimits":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentBarcodes":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentCardsUpload":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"products.postContentCardsUploadAdd":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"products.postContentMediaFile":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postContentMediaSave":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postUploadTask":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postUploadTaskSize":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postUploadTaskClubDiscount":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postUploadTaskB2bWholesale":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.historyTasks":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.historyGoodsTask":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.bufferTasks":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.bufferGoodsTask":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.listGoodsFilter":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postListGoodsFilter":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.listGoodsSizeNm":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.quarantineGoods":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"products.postStocks":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.putStocks":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.deleteStocks":{requestsPerMinute:10,intervalSeconds:6,burstLimit:2,penaltyMultiplier:10},"products.offices":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.warehouses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.postWarehouses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.putWarehouses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.deleteWarehouses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.dbwWarehousesContacts":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"products.putDbwWarehousesContacts":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10}},cr={"orders-fbs.ordersNew":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.orders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersStatus":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.suppliesOrdersReshipment":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersStickers":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersStickersCrossBorder":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersStatusHistory":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postOrdersClient":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.ordersMeta":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.deleteOrdersMeta":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.supplies":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postSupplies":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.getSupply":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.deleteSupplies":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.suppliesOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.patchSuppliesDeliver":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.suppliesBarcode":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.suppliesTrbx":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postSuppliesTrbx":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.deleteSuppliesTrbx":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postSuppliesTrbxStickers":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.passesOffices":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.passes":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putPasses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.deletePasses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.patchSuppliesOrders":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.patchMarketplaceSuppliesOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.getMarketplaceSuppliesOrderIds":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.patchOrdersCancel":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaSgtin":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaUin":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaImei":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaGtin":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaExpiration":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.putOrdersMetaCustomsDeclaration":{requestsPerMinute:1e3,intervalSeconds:.06,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postMarketplaceOrdersMeta":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbs.postPasses":{requestsPerMinute:.1,intervalSeconds:600,burstLimit:1,penaltyMultiplier:10},"orders-fbs.ordersArchive":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10}},ur={"orders-fbw.acceptanceCoefficients":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"orders-fbw.postAcceptanceOptions":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"orders-fbw.warehouses":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"orders-fbw.transitTariffs":{requestsPerMinute:6,intervalSeconds:10,burstLimit:10},"orders-fbw.postSupplies":{requestsPerMinute:30,intervalSeconds:2,burstLimit:10},"orders-fbw.supplies":{requestsPerMinute:30,intervalSeconds:2,burstLimit:10},"orders-fbw.suppliesGoods":{requestsPerMinute:30,intervalSeconds:2,burstLimit:10},"orders-fbw.suppliesPackage":{requestsPerMinute:30,intervalSeconds:2,burstLimit:10},"orders-fbw.getClientInfo":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbw.deleteMetaBulkDBW":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"orders-fbw.setSgtinBulkDBW":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-fbw.deliverBulkDBW":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-fbw.checkMetaValidationDBW":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10}},lr={"orders-dbs.getNewOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getClientInfo":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getStatusesBulk":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getStatuses":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getB2BInfo":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.confirmBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.deliverBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.receiveBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.rejectBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.cancelBulk":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.confirm":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.deliver":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.receive":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.reject":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.cancel":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10,penaltyMultiplier:10},"orders-dbs.getMeta":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"orders-dbs.deleteMeta":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setMeta":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getGroupsInfo":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.getDeliveryDates":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.deleteMetaBulk":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setSgtinBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setUinBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setImeiBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setGtinBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.setCustomsDeclarationBulk":{requestsPerMinute:500,intervalSeconds:.12,burstLimit:20,penaltyMultiplier:10},"orders-dbs.checkMetaValidation":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"orders-dbs.createOrdersStickers":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10}},dr={"userManagement.createInvite":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"userManagement.getUsers":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"userManagement.updateAccess":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"userManagement.deleteUser":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10}},pr={"finances.accountBalance":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.documentsCategories":{requestsPerMinute:6,intervalSeconds:10,burstLimit:5},"finances.documentsList":{requestsPerMinute:6,intervalSeconds:10,burstLimit:5},"finances.documentsDownload":{requestsPerMinute:6,intervalSeconds:10,burstLimit:5},"finances.createDownloadAll":{requestsPerMinute:1,intervalSeconds:300,burstLimit:5},"finances.salesReportsList":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.salesReportsDetailed":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.salesReportsDetailedByReportId":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.acquiringReportsList":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.acquiringReportsDetailed":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"finances.acquiringReportsDetailedByReportId":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1}},mr={"promotion.advPromotionCount":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.advConfig":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"promotion.postAdvBidsMin":{requestsPerMinute:20,intervalSeconds:3,burstLimit:5},"promotion.postAdvSaveAd":{requestsPerMinute:3,intervalSeconds:20,burstLimit:5},"promotion.postAdvSeacatSaveAd":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.advSupplierSubjects":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.postAdvSupplierNms":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.advDelete":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.postAdvRename":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.advStart":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.advPause":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.advStop":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.patchAdvBids":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.putAdvAuctionPlacements":{requestsPerMinute:60,intervalSeconds:1,burstLimit:1},"promotion.getBidsRecommendations":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.advBalance":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.advBudget":{requestsPerMinute:240,intervalSeconds:.25,burstLimit:4},"promotion.postAdvBudgetDeposit":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.advUpd":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.advPayments":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.advSearchSetPlus":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"promotion.postAdvSearchSetPlus":{requestsPerMinute:10,intervalSeconds:6,burstLimit:5},"promotion.postAdvSearchSetExcluded":{requestsPerMinute:120,intervalSeconds:.5,burstLimit:2},"promotion.advAutoGetnmtoadd":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"promotion.patchAdvAuctionNms":{requestsPerMinute:60,intervalSeconds:1,burstLimit:1},"promotion.advCount":{requestsPerMinute:600,intervalSeconds:.1,burstLimit:10},"promotion.advAdverts":{requestsPerMinute:600,intervalSeconds:.1,burstLimit:10},"promotion.advAdvert":{requestsPerMinute:600,intervalSeconds:.1,burstLimit:10},"promotion.postAdvFullstats":{requestsPerMinute:1,intervalSeconds:60,burstLimit:5},"promotion.advFullstats":{requestsPerMinute:3,intervalSeconds:20,burstLimit:1},"promotion.advAutoStatWords":{requestsPerMinute:240,intervalSeconds:.25,burstLimit:4},"promotion.advStatWords":{requestsPerMinute:240,intervalSeconds:.25,burstLimit:4},"promotion.postAdvStats":{requestsPerMinute:600,intervalSeconds:.1,burstLimit:10},"promotion.calendarPromotions":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"promotion.calendarPromotionsDetails":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"promotion.calendarPromotionsNomenclatures":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"promotion.postCalendarPromotionsUpload":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:5},"promotion.normqueryStats":{requestsPerMinute:10,intervalSeconds:6,burstLimit:20},"promotion.getNormqueryList":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.getNormqueryStatsV1":{requestsPerMinute:10,intervalSeconds:6,burstLimit:20},"promotion.normqueryGetBids":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.normquerySetBids":{requestsPerMinute:120,intervalSeconds:.5,burstLimit:4},"promotion.normqueryDeleteBids":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.normqueryGetMinus":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.normquerySetMinus":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.v1Config":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"promotion.v1NormqueryBids":{requestsPerMinute:120,intervalSeconds:.5,burstLimit:4},"promotion.advertsV2":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.bidsMinV1":{requestsPerMinute:20,intervalSeconds:3,burstLimit:5},"promotion.getCampaignCount":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.createCampaign":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.getSupplierSubjects":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.getSupplierNms":{requestsPerMinute:5,intervalSeconds:12,burstLimit:5},"promotion.startCampaign":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.pauseCampaign":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:5},"promotion.updateBids":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.updateCampaignProducts":{requestsPerMinute:60,intervalSeconds:1,burstLimit:1},"promotion.getMinusPhrases":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.setMinusPhrases":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:10},"promotion.getSearchClusterStats":{requestsPerMinute:10,intervalSeconds:6,burstLimit:20},"promotion.getRecommendationsList":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:10},"promotion.setRecommendations":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:10}},yr={"tariffs.tariffsCommission":{requestsPerMinute:1,intervalSeconds:60,burstLimit:2},"tariffs.tariffsBox":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"tariffs.tariffsPallet":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"tariffs.tariffsReturn":{requestsPerMinute:60,intervalSeconds:1,burstLimit:5},"tariffs.acceptanceCoefficients":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6}},fr={"in-store-pickup.clickCollectOrdersNew":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.postClickCollectOrdersClient":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.postClickCollectOrdersClientIdentity":{requestsPerMinute:30,intervalSeconds:2,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.clickCollectOrders":{requestsPerMinute:300,intervalSeconds:.2,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.checkMetaValidation":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.setCustomsDeclarationBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10},"in-store-pickup.confirmBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.prepareBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.receiveBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.rejectBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.cancelBulk":{requestsPerMinute:100,intervalSeconds:.6,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.getStatusesBulk":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.getMetaBulk":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.deleteMetaBulk":{requestsPerMinute:150,intervalSeconds:.4,burstLimit:20,penaltyMultiplier:10},"in-store-pickup.setSgtinBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10},"in-store-pickup.setUinBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10},"in-store-pickup.setImeiBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10},"in-store-pickup.setGtinBulk":{requestsPerMinute:20,intervalSeconds:3,burstLimit:500,penaltyMultiplier:10}},hr={"analytics.nmReportDownloads":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postNmReportDownloads":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postNmReportDownloadsRetry":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.nmReportDownloadsFile":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportReport":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportTableGroups":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportTableDetails":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportProductSearchTexts":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSearchReportProductOrders":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportProductsGroups":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportProductsProducts":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportProductsSizes":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportOffices":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postStocksReportWbWarehouses":{requestsPerMinute:3,intervalSeconds:20,burstLimit:1},"analytics.postSalesFunnelProducts":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSalesFunnelProductsHistory":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.postSalesFunnelGroupedHistory":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.itemRating":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3},"analytics.itemRatingV2":{requestsPerMinute:3,intervalSeconds:20,burstLimit:3}},gr={"reports.supplierIncomes":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.supplierStocks":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.supplierOrders":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.supplierSales":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.postAnalyticsExciseReport":{requestsPerMinute:0,intervalSeconds:1800,burstLimit:10},"reports.warehouse_remains":{requestsPerMinute:1,intervalSeconds:60,burstLimit:5},"reports.warehouse_remainsTasksStatus":{requestsPerMinute:12,intervalSeconds:5,burstLimit:5},"reports.warehouse_remainsTasksDownload":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.analyticsWarehouseMeasurements":{requestsPerMinute:5,intervalSeconds:12,burstLimit:1},"reports.analyticsAntifraudDetails":{requestsPerMinute:0,intervalSeconds:600,burstLimit:10},"reports.analyticsIncorrectAttachments":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"reports.analyticsGoodsLabeling":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"reports.acceptance_report":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.acceptance_reportTasksStatus":{requestsPerMinute:12,intervalSeconds:5,burstLimit:1},"reports.acceptance_reportTasksDownload":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.paid_storage":{requestsPerMinute:1,intervalSeconds:60,burstLimit:5},"reports.paid_storageTasksStatus":{requestsPerMinute:12,intervalSeconds:5,burstLimit:5},"reports.paid_storageTasksDownload":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.analyticsRegionSale":{requestsPerMinute:6,intervalSeconds:10,burstLimit:5},"reports.analyticsBrandShareBrands":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"reports.analyticsBrandShareParentSubjects":{requestsPerMinute:12,intervalSeconds:5,burstLimit:20},"reports.analyticsBrandShare":{requestsPerMinute:12,intervalSeconds:5,burstLimit:20},"reports.analyticsBannedProductsBlocked":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"reports.analyticsBannedProductsShadowed":{requestsPerMinute:6,intervalSeconds:10,burstLimit:6},"reports.analyticsGoodsReturn":{requestsPerMinute:1,intervalSeconds:60,burstLimit:10},"reports.measurementPenalties":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.warehouseMeasurementsV2":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1},"reports.deductions":{requestsPerMinute:1,intervalSeconds:60,burstLimit:1}},br={"communications.newFeedbacksQuestions":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.questionsCountUnanswered":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.questionsCount":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.questions":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.patchQuestions":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.question":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedbacksCountUnanswered":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedbacksCount":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedbacks":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.supplierValuations":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.postFeedbacksActions":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.postFeedbacksAnswer":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.patchFeedbacksAnswer":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.postFeedbacksOrderReturn":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedback":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.feedbacksArchive":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.templates":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.postTemplates":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.patchTemplates":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.deleteTemplates":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.sellerChats":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"communications.sellerEvents":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"communications.postSellerMessage":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"communications.sellerDownload":{requestsPerMinute:60,intervalSeconds:1,burstLimit:10},"communications.claims":{requestsPerMinute:20,intervalSeconds:3,burstLimit:10},"communications.patchClaim":{requestsPerMinute:20,intervalSeconds:3,burstLimit:10},"communications.getPinnedFeedbacksCount":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.getPinnedFeedbacksLimits":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.getPinnedFeedbacks":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.pinFeedback":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6},"communications.unpinFeedback":{requestsPerMinute:180,intervalSeconds:.333,burstLimit:6}},Ge={...ar,...or,...cr,...ur,...lr,...dr,...pr,...mr,...yr,...fr,...hr,...gr,...br},rn={general:.001,products:.01,"orders-fbs":.003,"orders-dbw":.003,"orders-dbs":.003,"click-collect":.003,"in-store-pickup":.003,"orders-fbw":.01,promotion:.02,communications:.05,tariffs:.01,analytics:.05,reports:.01,documents:.01,finances:.01,"user-management":.01},sn=.01;function nn(r){const e={};for(const[t,s]of Object.entries(r)){const i=t.split(".")[0],n=rn[i]??sn;e[t]={...s,requestsPerMinute:Math.max(1,Math.ceil(s.requestsPerMinute*n)),burstLimit:1}}return e}class vr{constructor(e){this.apiKey=e.apiKey,this.logLevel=e.logLevel??"warn",this.axios=R.create({timeout:e.timeout??3e4,headers:{"Content-Type":"application/json","User-Agent":"WildberriesSDK/0.1.0"}}),this.setupRequestInterceptor();const t=e.tokenType??"personal",s=t==="basic"||t==="test"?nn(Ge):Ge;this.rateLimiter=new zi(s),this.retryHandler=new tn(e.retryConfig,this.logLevel)}async get(e,t){return this.retryHandler.executeWithRetry(async()=>{t!=null&&t.rateLimitKey&&await this.rateLimiter.waitForSlot(t.rateLimitKey);try{this.log("debug","GET request",{url:e});const s=await this.axios.get(e,{headers:t==null?void 0:t.headers,params:t==null?void 0:t.params,responseType:t==null?void 0:t.responseType,...(t==null?void 0:t.timeout)!==void 0&&{timeout:t.timeout}});return this.log("debug","GET response",{url:e,status:s.status}),s.data}catch(s){this.transformError(s)}},`GET ${e}`)}async post(e,t,s){return this.retryHandler.executeWithRetry(async()=>{s!=null&&s.rateLimitKey&&await this.rateLimiter.waitForSlot(s.rateLimitKey);try{this.log("debug","POST request",{url:e});const i=await this.axios.post(e,t,{headers:s==null?void 0:s.headers,params:s==null?void 0:s.params,...(s==null?void 0:s.timeout)!==void 0&&{timeout:s.timeout}});return this.log("debug","POST response",{url:e,status:i.status}),i.data}catch(i){this.transformError(i)}},`POST ${e}`)}async put(e,t,s){return this.retryHandler.executeWithRetry(async()=>{s!=null&&s.rateLimitKey&&await this.rateLimiter.waitForSlot(s.rateLimitKey);try{this.log("debug","PUT request",{url:e});const i=await this.axios.put(e,t,{headers:s==null?void 0:s.headers,params:s==null?void 0:s.params,...(s==null?void 0:s.timeout)!==void 0&&{timeout:s.timeout}});return this.log("debug","PUT response",{url:e,status:i.status}),i.data}catch(i){this.transformError(i)}},`PUT ${e}`)}async patch(e,t,s){return this.retryHandler.executeWithRetry(async()=>{s!=null&&s.rateLimitKey&&await this.rateLimiter.waitForSlot(s.rateLimitKey);try{this.log("debug","PATCH request",{url:e});const i=await this.axios.patch(e,t,{headers:s==null?void 0:s.headers,params:s==null?void 0:s.params,...(s==null?void 0:s.timeout)!==void 0&&{timeout:s.timeout}});return this.log("debug","PATCH response",{url:e,status:i.status}),i.data}catch(i){this.transformError(i)}},`PATCH ${e}`)}async delete(e,t,s){return this.retryHandler.executeWithRetry(async()=>{s!=null&&s.rateLimitKey&&await this.rateLimiter.waitForSlot(s.rateLimitKey);try{this.log("debug","DELETE request",{url:e,hasBody:!!t});const i=await this.axios.delete(e,{headers:s==null?void 0:s.headers,params:s==null?void 0:s.params,data:t,...(s==null?void 0:s.timeout)!==void 0&&{timeout:s.timeout}});return this.log("debug","DELETE response",{url:e,status:i.status}),i.data}catch(i){this.transformError(i)}},`DELETE ${e}`)}setupRequestInterceptor(){this.axios.interceptors.request.use(e=>{var t;return e.headers.Authorization=`Bearer ${this.apiKey}`,this.logLevel==="debug"&&this.log("debug","HTTP Request Interceptor",{method:(t=e.method)==null?void 0:t.toUpperCase(),url:e.url,headers:this.sanitizeHeaders(e.headers)}),e})}transformError(e){var l,d,m;if(!R.isAxiosError(e))throw this.log("error","Unknown error occurred",{error:e}),new ee("Unknown error occurred",!1,0,e);const t=e;if(!t.response){const p=t.code==="ECONNABORTED"||t.code==="ETIMEDOUT";if(p){const f=((l=t.config)==null?void 0:l.url)??"unknown",v=((d=t.config)==null?void 0:d.timeout)??"unknown";this.log("warn",`Request timed out: ${f} after ${String(v)}ms`,{url:f,timeout:v,code:t.code})}else this.log("error","Network error",{code:t.code,message:t.message});throw new ee(p?"Request timed out":"Network error occurred",p,0,t)}const s=t.response.status,i=t.response.data;this.log("warn","HTTP error response",{status:s,url:(m=t.config)==null?void 0:m.url});const n=t.response.headers["content-type"],o=(typeof n=="string"?n:"").includes("application/problem+json"),u=this.extractProblemJsonFields(i,o);if(s===401||s===403){const p=u.detail??u.title??"Authentication failed. Please verify your API key.";throw new Oe(p,s,i,u.requestId,u.origin,u.timestamp)}if(s===429){const p=this.parseRetryAfter(t.response.headers["retry-after"]),f=u.detail??u.title??`Rate limit exceeded. Retry after ${p.toString()}ms`;throw new tt(f,p,i,u.requestId,u.origin,u.timestamp)}if(s===409&&i!=null&&typeof i=="object"&&Array.isArray(i.metaDetails)){const p=i,f=typeof p.message=="string"?p.message:u.detail??u.title??"Meta validation failed",v=typeof p.code=="string"?p.code:"Unknown",L=p.metaDetails;throw new Ke(f,v,L,i,u.requestId,u.origin,u.timestamp)}if(s===400||s===422){const p=u.detail,f=sr(p);if(p!==void 0&&f)throw new rt(p,{received:f.received,min:f.min,max:f.max,field:"bid"},i,u.requestId);const v=this.extractFieldErrors(i),L=u.detail??u.title??"Validation failed";throw new h.ValidationError(L,v,s,i,u.requestId)}throw s===406?new ir(u.detail??"Warehouse is processing — inventory update temporarily unavailable",i,u.requestId,u.origin,u.timestamp):s>=500?new ee(`Server error: ${s.toString()}`,!1,s,t):new h.WBAPIError(`HTTP error ${s.toString()}`,s,i,u.requestId,u.origin,u.timestamp)}parseRetryAfter(e){if(!e)return 5e3;const t=parseInt(e,10);return isNaN(t)?5e3:t*1e3}extractProblemJsonFields(e,t){const s={};if(!e||typeof e!="object")return s;const i=e,n=typeof i.title=="string"||typeof i.detail=="string";return!t&&!n?s:{title:typeof i.title=="string"?i.title:void 0,detail:typeof i.detail=="string"?i.detail:void 0,code:typeof i.code=="string"?i.code:void 0,requestId:typeof i.requestId=="string"?i.requestId:void 0,origin:typeof i.origin=="string"?i.origin:void 0,status:typeof i.status=="number"?i.status:void 0,statusText:typeof i.statusText=="string"?i.statusText:void 0,timestamp:typeof i.timestamp=="string"?i.timestamp:void 0}}extractFieldErrors(e){if(e&&typeof e=="object"&&"errors"in e&&e.errors&&typeof e.errors=="object")return e.errors}log(e,t,s){const i={debug:0,info:1,warn:2,error:3},n=i[this.logLevel];if(i[e]<n)return;const o={timestamp:new Date().toISOString(),level:e,service:"WildberriesSDK",message:t,meta:this.sanitizeMeta(s)};({debug:console.debug,info:console.info,warn:console.warn,error:console.error})[e](JSON.stringify(o))}sanitizeMeta(e){if(e)try{const t=JSON.parse(JSON.stringify(e));if(t&&typeof t=="object"&&"headers"in t&&t.headers&&typeof t.headers=="object"){const s=t.headers;"Authorization"in s&&(s.Authorization="Bearer ***")}return t}catch{return}}sanitizeHeaders(e){const t={...e};return t.Authorization&&(t.Authorization="Bearer ***"),t}}class Sr{constructor(e){this.client=e}async ping(){return this.client.get("https://common-api.wildberries.ru/ping",{rateLimitKey:"general.ping"})}async news(e){return this.client.get("https://common-api.wildberries.ru/api/communications/v2/news",{params:e?{...e}:void 0,rateLimitKey:"general.communicationsNews"})}async sellerInfo(){return this.client.get("https://common-api.wildberries.ru/api/v1/seller-info",{rateLimitKey:"general.sellerInfo"})}async createInvite(e){return this.client.post("https://user-management-api.wildberries.ru/api/v1/invite",e,{rateLimitKey:"general.createInvite"})}async getUsers(e){return this.client.get("https://user-management-api.wildberries.ru/api/v1/users",{params:e?{...e}:void 0,rateLimitKey:"general.getUsers"})}async updateUserAccess(e){await this.client.put("https://user-management-api.wildberries.ru/api/v1/users/access",e,{rateLimitKey:"general.updateUserAccess"})}async deleteUser(e){await this.client.delete("https://user-management-api.wildberries.ru/api/v1/user",{},{params:{deletedUserID:e},rateLimitKey:"general.deleteUser"})}async getJamSubscription(){return this.client.get("https://common-api.wildberries.ru/api/common/v1/subscriptions",{rateLimitKey:"general.getJamSubscription"})}async getSellerRating(){return this.client.get("https://feedbacks-api.wildberries.ru/api/common/v1/rating",{rateLimitKey:"general.getSellerRating"})}async getTariffConstructorOptions(e){return this.client.get("https://common-api.wildberries.ru/api/common/v1/tariff-constructor/options",{params:e?{...e}:void 0,rateLimitKey:"general.tariffConstructorOptions"})}}const an={ALL:-1,WITH_PHOTO:1,NO_PHOTO:2};class Lr{constructor(e){this.client=e}async getParentAll(e){return this.client.get("https://content-api.wildberries.ru/content/v2/object/parent/all",{params:e,rateLimitKey:"products.contentObjectParentAll"})}async getObjectAll(e){return this.client.get("https://content-api.wildberries.ru/content/v2/object/all",{params:e,rateLimitKey:"products.contentObjectAll"})}async getObjectCharc(e,t){return this.client.get(`https://content-api.wildberries.ru/content/v2/object/charcs/${e}`,{params:t,rateLimitKey:"products.contentObjectCharcs"})}async getDirectoryColors(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/colors",{params:e,rateLimitKey:"products.contentDirectoryColors"})}async getDirectoryKinds(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/kinds",{params:e,rateLimitKey:"products.contentDirectoryKinds"})}async getDirectoryCountries(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/countries",{params:e,rateLimitKey:"products.contentDirectoryCountries"})}async getDirectorySeasons(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/seasons",{params:e,rateLimitKey:"products.contentDirectorySeasons"})}async getDirectoryVat(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/vat",{params:e,rateLimitKey:"products.contentDirectoryVat"})}async getDirectoryTnved(e){return this.client.get("https://content-api.wildberries.ru/content/v2/directory/tnved",{params:e,rateLimitKey:"products.contentDirectoryTnved"})}async getBrands(e,t){return this.client.get("https://content-api.wildberries.ru/api/content/v1/brands",{params:{subjectId:e,...t!==void 0&&{next:t}},rateLimitKey:"products.brands"})}async getContentTags(){return this.client.get("https://content-api.wildberries.ru/content/v2/tags",{rateLimitKey:"products.contentTags"})}async createContentTag(e){return this.client.post("https://content-api.wildberries.ru/content/v2/tag",e,{rateLimitKey:"products.postContentTag"})}async updateContentTag(e,t){return this.client.patch(`https://content-api.wildberries.ru/content/v2/tag/${e}`,t,{rateLimitKey:"products.patchContentTag"})}async deleteContentTag(e){return this.client.delete(`https://content-api.wildberries.ru/content/v2/tag/${e}`,void 0,{rateLimitKey:"products.deleteContentTag"})}async createNomenclatureLink(e){return this.client.post("https://content-api.wildberries.ru/content/v2/tag/nomenclature/link",e,{rateLimitKey:"products.postContentTagNomenclatureLink"})}async getCardsList(e,t){var i,n,a,o;((n=(i=e.settings)==null?void 0:i.filter)==null?void 0:n.withPhoto)===0&&h.warnOnce("products.getCardsList:legacy-withphoto-zero",'products.getCardsList: `withPhoto: 0` now returns ALL cards — the 2026-06-16 WB semantic change is live (0 previously meant "only cards without photo"). If you wanted "no photo only", use `WITH_PHOTO_FILTER.NO_PHOTO` (= 2). For explicit "all cards", `WITH_PHOTO_FILTER.ALL` (= -1) is clearer. See docs/guides/withphoto-semantic-migration.md.');const s=100;if((o=(a=e.settings)==null?void 0:a.cursor)!=null&&o.limit){const u=e.settings.cursor.limit;if(u>s)throw new Error(`Invalid cursor limit: ${u}. Maximum allowed is ${s} cards per request. Use pagination to fetch all cards. See: https://salacoste.github.io/daytona-wildberries-typescript-sdk/guides/working-with-product-cards#pagination-limit-restrictions`);if(u<=0)throw new Error(`Invalid cursor limit: ${u}. Limit must be a positive integer (recommended: ${s}).`)}return this.client.post("https://content-api.wildberries.ru/content/v2/get/cards/list",e,{params:t,rateLimitKey:"products.postContentGetCardsList"})}async createErrorList(e,t){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/error/list",e,{params:t,rateLimitKey:"products.postContentCardsErrorList"})}async createCardsUpdate(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/update",e,{rateLimitKey:"products.postContentCardsUpdate"})}async createCardsMovenm(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/moveNm",e,{rateLimitKey:"products.postContentCardsMoveNm"})}async createDeleteTrash(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/delete/trash",e,{rateLimitKey:"products.postContentCardsDeleteTrash"})}async createCardsRecover(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/recover",e,{rateLimitKey:"products.postContentCardsRecover"})}async deleteCardsFromTrash(e){return this.client.post("https://content-api.wildberries.ru/content/v1/cards/delete",e,{rateLimitKey:"products.postContentCardsDelete"})}async getTrashedCards(e,t){return this.client.post("https://content-api.wildberries.ru/content/v2/get/cards/trash",e,{params:t,rateLimitKey:"products.postContentGetCardsTrash"})}async getCardsLimits(){return this.client.get("https://content-api.wildberries.ru/content/v2/cards/limits",{rateLimitKey:"products.contentCardsLimits"})}async createContentBarcode(e){return this.client.post("https://content-api.wildberries.ru/content/v2/barcodes",e,{rateLimitKey:"products.postContentBarcodes"})}async createCardsUpload(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/upload",e,{rateLimitKey:"products.postContentCardsUpload"})}async createUploadAdd(e){return this.client.post("https://content-api.wildberries.ru/content/v2/cards/upload/add",e,{rateLimitKey:"products.postContentCardsUploadAdd"})}async createMediaFile(e,t,s){return this.client.post("https://content-api.wildberries.ru/content/v3/media/file",s,{rateLimitKey:"products.postContentMediaFile",headers:{"X-Nm-Id":String(e),"X-Photo-Number":String(t)}})}async createMediaSave(e){return this.client.post("https://content-api.wildberries.ru/content/v3/media/save",e,{rateLimitKey:"products.postContentMediaSave"})}async createUploadTask(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/v2/upload/task",{data:e},{rateLimitKey:"products.postUploadTask"})}async createTaskSize(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/v2/upload/task/size",{data:e},{rateLimitKey:"products.postUploadTaskSize"})}async createTaskClubDiscount(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/v2/upload/task/club-discount",{data:e},{rateLimitKey:"products.postUploadTaskClubDiscount"})}async createUploadTaskB2bWholesale(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/discounts-prices/v1/upload/task/b2b/wholesale",e,{rateLimitKey:"products.postUploadTaskB2bWholesale"})}async getHistoryTasks(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/history/tasks",{params:e,rateLimitKey:"products.historyTasks"})}async getGoodsTask(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/history/goods/task",{params:e,rateLimitKey:"products.historyGoodsTask"})}async getBufferTasks(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/buffer/tasks",{params:e,rateLimitKey:"products.bufferTasks"})}async getBufferGoodsTask(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/buffer/goods/task",{params:e,rateLimitKey:"products.bufferGoodsTask"})}async getGoodsFilter(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/list/goods/filter",{params:e,rateLimitKey:"products.listGoodsFilter"})}async createGoodsFilter(e){return this.client.post("https://discounts-prices-api.wildberries.ru/api/v2/list/goods/filter",e,{rateLimitKey:"products.postListGoodsFilter"})}async getSizeNm(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/list/goods/size/nm",{params:e,rateLimitKey:"products.listGoodsSizeNm"})}async getQuarantineGoods(e){return this.client.get("https://discounts-prices-api.wildberries.ru/api/v2/quarantine/goods",{params:e,rateLimitKey:"products.quarantineGoods"})}async getStocks(e,t){return this.client.post(`https://marketplace-api.wildberries.ru/api/v3/stocks/${e}`,t,{rateLimitKey:"products.postStocks"})}async updateStock(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/stocks/${e}`,t,{rateLimitKey:"products.putStocks"})}async deleteStock(e,t){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/stocks/${e}`,t,{rateLimitKey:"products.deleteStocks"})}async offices(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/offices",{rateLimitKey:"products.offices"})}async warehouses(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/warehouses",{rateLimitKey:"products.warehouses"})}async createWarehouse(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/warehouses",e,{rateLimitKey:"products.postWarehouses"})}async updateWarehouse(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/warehouses/${e}`,t,{rateLimitKey:"products.putWarehouses"})}async deleteWarehouse(e){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/warehouses/${e}`,void 0,{rateLimitKey:"products.deleteWarehouses"})}async getWarehousesContact(e){return this.client.get(`https://marketplace-api.wildberries.ru/api/v3/dbw/warehouses/${e}/contacts`,{rateLimitKey:"products.dbwWarehousesContacts"})}async updateWarehousesContact(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/dbw/warehouses/${e}/contacts`,t,{rateLimitKey:"products.putDbwWarehousesContacts"})}}class wr{constructor(e){this.client=e}async getPassesOffices(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/passes/offices",{rateLimitKey:"orders-fbs.passesOffices"})}async passes(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/passes",{rateLimitKey:"orders-fbs.passes"})}async createPass(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/passes",e,{rateLimitKey:"orders-fbs.postPasses"})}async updatePass(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/passes/${e}`,t,{rateLimitKey:"orders-fbs.putPasses"})}async deletePass(e){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/passes/${e}`,{rateLimitKey:"orders-fbs.deletePasses"})}async getOrdersNew(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/orders/new",{rateLimitKey:"orders-fbs.ordersNew"})}async orders(e){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/orders",{params:e,rateLimitKey:"orders-fbs.orders"})}async getOrdersReshipment(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/supplies/orders/reshipment",{rateLimitKey:"orders-fbs.suppliesOrdersReshipment"})}async updateOrdersCancel(e){return this.client.patch(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/cancel`,void 0,{rateLimitKey:"orders-fbs.patchOrdersCancel"})}async createOrdersSticker(e,t){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/stickers",t,{params:e,rateLimitKey:"orders-fbs.postOrdersStickers"})}async deleteOrdersMeta(e,t){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta`,{params:t,rateLimitKey:"orders-fbs.deleteOrdersMeta"})}async updateMetaSgtin(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/sgtin`,t,{rateLimitKey:"orders-fbs.putOrdersMetaSgtin"})}async updateMetaUin(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/uin`,t,{rateLimitKey:"orders-fbs.putOrdersMetaUin"})}async updateMetaImei(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/imei`,t,{rateLimitKey:"orders-fbs.putOrdersMetaImei"})}async updateMetaGtin(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/gtin`,t,{rateLimitKey:"orders-fbs.putOrdersMetaGtin"})}async updateMetaExpiration(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/v3/orders/${e}/meta/expiration`,t,{rateLimitKey:"orders-fbs.putOrdersMetaExpiration"})}async setCustomsDeclaration(e,t){return this.client.put(`https://marketplace-api.wildberries.ru/api/marketplace/v3/orders/${e}/meta/customs-declaration`,t,{rateLimitKey:"orders-fbs.putOrdersMetaCustomsDeclaration"})}async createStickersCrossBorder(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/stickers/cross-border",e,{rateLimitKey:"orders-fbs.postOrdersStickersCrossBorder"})}async createStatusHistory(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/status/history",e,{rateLimitKey:"orders-fbs.postOrdersStatusHistory"})}async createOrdersClient(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/client",e,{rateLimitKey:"orders-fbs.postOrdersClient"})}async supplies(e){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/supplies",{params:e,rateLimitKey:"orders-fbs.supplies"})}async getSupplies(e){return this.supplies(e)}async createSupply(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/supplies",e,{rateLimitKey:"orders-fbs.postSupplies"})}async getSupply(e){return this.client.get(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}`,{rateLimitKey:"orders-fbs.getSupply"})}async deleteSupply(e){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}`,{rateLimitKey:"orders-fbs.deleteSupplies"})}async updateSuppliesDeliver(e){return this.client.patch(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/deliver`,void 0,{rateLimitKey:"orders-fbs.patchSuppliesDeliver"})}async getSuppliesBarcode(e,t){return this.client.get(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/barcode`,{params:t,rateLimitKey:"orders-fbs.suppliesBarcode"})}async getSuppliesTrbx(e){return this.client.get(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/trbx`,{rateLimitKey:"orders-fbs.suppliesTrbx"})}async createSuppliesTrbx(e,t){return this.client.post(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/trbx`,t,{rateLimitKey:"orders-fbs.postSuppliesTrbx"})}async deleteSuppliesTrbx(e,t){return this.client.delete(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/trbx`,t,{rateLimitKey:"orders-fbs.deleteSuppliesTrbx"})}async createTrbxSticker(e,t,s){return this.client.post(`https://marketplace-api.wildberries.ru/api/v3/supplies/${e}/trbx/stickers`,s,{params:t,rateLimitKey:"orders-fbs.postSuppliesTrbxStickers"})}async getOrderStatuses(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/orders/status",e,{rateLimitKey:"orders-fbs.postOrdersStatus"})}async getOrdersMetaBulk(e){return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/orders/meta",e,{rateLimitKey:"orders-fbs.postMarketplaceOrdersMeta"})}async addOrdersToSupply(e,t){return this.client.patch(`https://marketplace-api.wildberries.ru/api/marketplace/v3/supplies/${e}/orders`,t,{rateLimitKey:"orders-fbs.patchMarketplaceSuppliesOrders"})}async getSupplyOrderIds(e){return this.client.get(`https://marketplace-api.wildberries.ru/api/marketplace/v3/supplies/${e}/order-ids`,{rateLimitKey:"orders-fbs.getMarketplaceSuppliesOrderIds"})}async getOrdersArchive(e){return this.client.get("https://marketplace-api.wildberries.ru/api/marketplace/v3/fbs/orders/archive",{params:e,rateLimitKey:"orders-fbs.ordersArchive"})}}class Mr{constructor(e){this.client=e}async createAcceptanceOption(e,t){return this.client.post("https://supplies-api.wildberries.ru/api/v1/acceptance/options",e,{params:t,rateLimitKey:"orders-fbw.postAcceptanceOptions"})}async warehouses(){return this.client.get("https://supplies-api.wildberries.ru/api/v1/warehouses",{rateLimitKey:"orders-fbw.warehouses"})}async transitTariffs(){return this.client.get("https://supplies-api.wildberries.ru/api/v1/transit-tariffs",{rateLimitKey:"orders-fbw.transitTariffs"})}async listSupplies(e,t){return this.client.post("https://supplies-api.wildberries.ru/api/v1/supplies",e,{params:t,rateLimitKey:"orders-fbw.postSupplies"})}async getSupply(e,t){return this.client.get(`https://supplies-api.wildberries.ru/api/v1/supplies/${e}`,{params:t,rateLimitKey:"orders-fbw.supplies"})}async getSuppliesGood(e,t){return this.client.get(`https://supplies-api.wildberries.ru/api/v1/supplies/${e}/goods`,{params:t,rateLimitKey:"orders-fbw.suppliesGoods"})}async getSuppliesPackage(e){return this.client.get(`https://supplies-api.wildberries.ru/api/v1/supplies/${e}/package`,{rateLimitKey:"orders-fbw.suppliesPackage"})}async getClientInfo(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/client",{orders:e},{rateLimitKey:"orders-fbw.getClientInfo"})}async deleteMetaBulk(e){if(e.orders.length===0)throw new h.ValidationError("orders array cannot be empty");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/meta/delete",e,{rateLimitKey:"orders-fbw.deleteMetaBulkDBW"})}async setSgtinBulk(e){if(e.orders.length===0)throw new h.ValidationError("orders array cannot be empty");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/meta/sgtin",e,{rateLimitKey:"orders-fbw.setSgtinBulkDBW"})}async deliverBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/status/deliver",{orders:e},{rateLimitKey:"orders-fbw.deliverBulkDBW"})}async checkMetaValidation(e){if(e.orders.length===0)throw new h.ValidationError("orders array cannot be empty");if(e.orders.length>1e3)throw new h.ValidationError("orders array cannot exceed 1000 items");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/dbw/orders/meta/details",{orders:e.orders},{rateLimitKey:"orders-fbw.checkMetaValidationDBW"})}}class kr{constructor(e){this.client=e}async getAdvDelete(e){return this.client.get("https://advert-api.wildberries.ru/adv/v0/delete",{params:e,rateLimitKey:"promotion.advDelete"})}async createAdvRename(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/rename",e,{rateLimitKey:"promotion.postAdvRename"})}async getAdvStop(e){return this.client.get("https://advert-api.wildberries.ru/adv/v0/stop",{params:e,rateLimitKey:"promotion.advStop"})}async updateAuctionPlacement(e){return this.client.put("https://advert-api.wildberries.ru/adv/v0/auction/placements",e,{rateLimitKey:"promotion.putAdvAuctionPlacements"})}async getAdvBalance(){return this.client.get("https://advert-api.wildberries.ru/adv/v1/balance",{rateLimitKey:"promotion.advBalance"})}async getAdvBudget(e){return this.client.get("https://advert-api.wildberries.ru/adv/v1/budget",{params:e,rateLimitKey:"promotion.advBudget"})}async createBudgetDeposit(e,t){return this.client.post("https://advert-api.wildberries.ru/adv/v1/budget/deposit",e,{params:t,rateLimitKey:"promotion.postAdvBudgetDeposit"})}async getAdvUpd(e){return this.client.get("https://advert-api.wildberries.ru/adv/v1/upd",{params:e,rateLimitKey:"promotion.advUpd"})}async getAdvPayments(e){return this.client.get("https://advert-api.wildberries.ru/adv/v1/payments",{params:e,rateLimitKey:"promotion.advPayments"})}async updateAuctionNm(e){return this.client.patch("https://advert-api.wildberries.ru/adv/v0/auction/nms",e,{rateLimitKey:"promotion.patchAdvAuctionNms"})}async getAdvCount(){return this.client.get("https://advert-media-api.wildberries.ru/adv/v1/count",{rateLimitKey:"promotion.advCount"})}async getAdvAdverts(e){return this.client.get("https://advert-media-api.wildberries.ru/adv/v1/adverts",{params:e,rateLimitKey:"promotion.advAdverts"})}async getAdvAdvert(e){return this.client.get("https://advert-media-api.wildberries.ru/adv/v1/advert",{params:e,rateLimitKey:"promotion.advAdvert"})}async getAdvFullstats(e){return this.client.get("https://advert-api.wildberries.ru/adv/v3/fullstats",{params:e,rateLimitKey:"promotion.advFullstats"})}async createAdvStat(e){return this.client.post("https://advert-media-api.wildberries.ru/adv/v1/stats",e,{rateLimitKey:"promotion.postAdvStats"})}async getCalendarPromotions(e){return this.client.get("https://dp-calendar-api.wildberries.ru/api/v1/calendar/promotions",{params:e,rateLimitKey:"promotion.calendarPromotions"})}async getPromotionsDetails(e){return this.client.get("https://dp-calendar-api.wildberries.ru/api/v1/calendar/promotions/details",{params:e,rateLimitKey:"promotion.calendarPromotionsDetails"})}async getPromotionsNomenclatures(e){return this.client.get("https://dp-calendar-api.wildberries.ru/api/v1/calendar/promotions/nomenclatures",{params:e,rateLimitKey:"promotion.calendarPromotionsNomenclatures"})}async createPromotionsUpload(){return this.client.post("https://dp-calendar-api.wildberries.ru/api/v1/calendar/promotions/upload",void 0,{rateLimitKey:"promotion.postCalendarPromotionsUpload"})}async getNormqueryStats(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/stats",e,{rateLimitKey:"promotion.normqueryStats"})}async getNormqueryList(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/list",e,{rateLimitKey:"promotion.getNormqueryList"})}async getNormqueryStatsV1(e){return this.client.post("https://advert-api.wildberries.ru/adv/v1/normquery/stats",e,{rateLimitKey:"promotion.getNormqueryStatsV1"})}async getNormqueryBids(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/get-bids",e,{rateLimitKey:"promotion.normqueryGetBids"})}async setNormqueryBids(e){await this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/bids",e,{rateLimitKey:"promotion.normquerySetBids"})}async deleteNormqueryBids(e){await this.client.delete("https://advert-api.wildberries.ru/adv/v0/normquery/bids",e,{rateLimitKey:"promotion.normqueryDeleteBids"})}async getV1Config(){return this.client.get("https://advert-api.wildberries.ru/api/advert/v1/config",{rateLimitKey:"promotion.v1Config"})}async postV1NormqueryBids(e){return this.client.post("https://advert-api.wildberries.ru/api/advert/v1/normquery/bids",e,{rateLimitKey:"promotion.v1NormqueryBids"})}async getNormqueryMinus(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/get-minus",e,{rateLimitKey:"promotion.normqueryGetMinus"})}async setNormqueryMinus(e){await this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/set-minus",e,{rateLimitKey:"promotion.normquerySetMinus"})}async getAdvertsV2(e){return this.client.get("https://advert-api.wildberries.ru/api/advert/v2/adverts",{params:e,rateLimitKey:"promotion.advertsV2"})}async getBidsMinV2(e){return this.client.post("https://advert-api.wildberries.ru/api/advert/v1/bids/min",e,{rateLimitKey:"promotion.bidsMinV1"})}async getBidsRecommendations(e){return this.client.get("https://advert-api.wildberries.ru/api/advert/v0/bids/recommendations",{params:{advertId:e.advertId,nmId:e.nmId},rateLimitKey:"promotion.getBidsRecommendations"})}async getCampaignCount(){return this.client.get("https://advert-api.wildberries.ru/adv/v1/promotion/count",{rateLimitKey:"promotion.getCampaignCount"})}async createCampaign(e){return this.client.post("https://advert-api.wildberries.ru/adv/v2/seacat/save-ad",e,{rateLimitKey:"promotion.createCampaign"})}async getSupplierSubjects(e){return this.client.get("https://advert-api.wildberries.ru/adv/v1/supplier/subjects",{params:e?{...e}:void 0,rateLimitKey:"promotion.getSupplierSubjects"})}async getSupplierNms(e){return this.client.post("https://advert-api.wildberries.ru/adv/v2/supplier/nms",e,{rateLimitKey:"promotion.getSupplierNms"})}async startCampaign(e){return this.client.get("https://advert-api.wildberries.ru/adv/v0/start",{params:{id:e},rateLimitKey:"promotion.startCampaign"})}async pauseCampaign(e){return this.client.get("https://advert-api.wildberries.ru/adv/v0/pause",{params:{id:e},rateLimitKey:"promotion.pauseCampaign"})}async getMinusPhrases(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/get-minus",e,{rateLimitKey:"promotion.getMinusPhrases"})}async setMinusPhrases(e){await this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/set-minus",e,{rateLimitKey:"promotion.setMinusPhrases"})}async getSearchClusterStats(e){return this.client.post("https://advert-api.wildberries.ru/adv/v0/normquery/stats",e,{rateLimitKey:"promotion.getSearchClusterStats"})}async updateBids(e){return this.client.patch("https://advert-api.wildberries.ru/api/advert/v1/bids",e,{rateLimitKey:"promotion.updateBids"})}async updateCampaignProducts(e){return this.client.patch("https://advert-api.wildberries.ru/adv/v0/auction/nms",{nms:e.campaigns.map(t=>({advert_id:t.advert_id,nms:{add:t.add_nms,delete:t.delete_nms}}))},{rateLimitKey:"promotion.updateCampaignProducts"})}async getRecommendationsList(e){return this.client.post("https://content-api.wildberries.ru/api/content/v1/recommendations/list",e,{rateLimitKey:"promotion.getRecommendationsList"})}async setRecommendations(e){return this.client.post("https://content-api.wildberries.ru/api/content/v1/recommendations/set",e,{rateLimitKey:"promotion.setRecommendations"})}}class Pr{constructor(e){this.client=e}async getTariffsCommission(e){return this.client.get("https://common-api.wildberries.ru/api/v1/tariffs/commission",{params:e,rateLimitKey:"tariffs.tariffsCommission"})}async getTariffsBox(e){return this.client.get("https://common-api.wildberries.ru/api/v1/tariffs/box",{params:{date:e},rateLimitKey:"tariffs.tariffsBox"})}async getTariffsPallet(e){return this.client.get("https://common-api.wildberries.ru/api/v1/tariffs/pallet",{params:{date:e},rateLimitKey:"tariffs.tariffsPallet"})}async getTariffsReturn(e){return this.client.get("https://common-api.wildberries.ru/api/v1/tariffs/return",{params:{date:e},rateLimitKey:"tariffs.tariffsReturn"})}async getAcceptanceCoefficients(e){return this.client.get("https://common-api.wildberries.ru/api/tariffs/v1/acceptance/coefficients",{params:e,rateLimitKey:"tariffs.acceptanceCoefficients"})}}const N="https://marketplace-api.wildberries.ru";class Cr{constructor(e){this.client=e}async getOrdersNew(){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/click-collect/orders/new",{rateLimitKey:"in-store-pickup.clickCollectOrdersNew"})}async confirmBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/status/confirm`,{ordersIds:e},{rateLimitKey:"in-store-pickup.confirmBulk"})}async prepareBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/status/prepare`,{ordersIds:e},{rateLimitKey:"in-store-pickup.prepareBulk"})}async createOrdersClient(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/click-collect/orders/client",e,{rateLimitKey:"in-store-pickup.postClickCollectOrdersClient"})}async createClientIdentity(e){return this.client.post("https://marketplace-api.wildberries.ru/api/v3/click-collect/orders/client/identity",e,{rateLimitKey:"in-store-pickup.postClickCollectOrdersClientIdentity"})}async receiveBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/status/receive`,{ordersIds:e},{rateLimitKey:"in-store-pickup.receiveBulk"})}async rejectBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/status/reject`,{ordersIds:e},{rateLimitKey:"in-store-pickup.rejectBulk"})}async getStatusesBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/status/info`,{ordersIds:e},{rateLimitKey:"in-store-pickup.getStatusesBulk"})}async getClickCollectOrders(e){return this.client.get("https://marketplace-api.wildberries.ru/api/v3/click-collect/orders",{params:e,rateLimitKey:"in-store-pickup.clickCollectOrders"})}async cancelBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/status/cancel`,{ordersIds:e},{rateLimitKey:"in-store-pickup.cancelBulk"})}async getMetaBulk(e){if(e.ordersIds.length===0)throw new h.ValidationError("ordersIds array cannot be empty");if(e.ordersIds.length>1e3)throw new h.ValidationError("ordersIds array cannot exceed 1000 items");return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/meta/details`,e,{rateLimitKey:"in-store-pickup.getMetaBulk"})}async deleteMetaBulk(e){if(e.ordersIds.length===0)throw new h.ValidationError("ordersIds array cannot be empty");if(e.ordersIds.length>1e3)throw new h.ValidationError("ordersIds array cannot exceed 1000 items");return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/meta/delete`,e,{rateLimitKey:"in-store-pickup.deleteMetaBulk"})}async setSgtinBulk(e){return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/meta/sgtin`,e,{rateLimitKey:"in-store-pickup.setSgtinBulk"})}async setUinBulk(e){return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/meta/uin`,e,{rateLimitKey:"in-store-pickup.setUinBulk"})}async setImeiBulk(e){return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/meta/imei`,e,{rateLimitKey:"in-store-pickup.setImeiBulk"})}async setGtinBulk(e){return this.client.post(`${N}/api/marketplace/v3/click-collect/orders/meta/gtin`,e,{rateLimitKey:"in-store-pickup.setGtinBulk"})}async checkMetaValidation(e){if(e.length===0)throw new h.ValidationError("orders array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orders array cannot exceed 1000 items");return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/click-collect/orders/meta/details",{ordersIds:e},{rateLimitKey:"in-store-pickup.checkMetaValidation"})}async setCustomsDeclarationBulk(e){return this.client.post("https://marketplace-api.wildberries.ru/api/marketplace/v3/click-collect/orders/meta/customs-declaration",e,{rateLimitKey:"in-store-pickup.setCustomsDeclarationBulk"})}}const A="https://marketplace-api.wildberries.ru",on=720*60*60;class Rr{constructor(e){this.client=e}async getNewOrders(){return this.client.get(`${A}/api/v3/dbs/orders/new`,{rateLimitKey:"orders-dbs.getNewOrders"})}async getOrders(e){if(e.limit<1||e.limit>1e3)throw new h.ValidationError("limit must be between 1 and 1000");if(e.next<0)throw new h.ValidationError("next must be >= 0");const t=e.dateTo-e.dateFrom;if(t>on)throw new h.ValidationError("Date range cannot exceed 30 calendar days");if(t<0)throw new h.ValidationError("dateFrom must be less than or equal to dateTo");return this.client.get(`${A}/api/v3/dbs/orders`,{params:{limit:e.limit,next:e.next,dateFrom:e.dateFrom,dateTo:e.dateTo},rateLimitKey:"orders-dbs.getOrders"})}async getClientInfo(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");return this.client.post(`${A}/api/v3/dbs/orders/client`,{orders:e},{rateLimitKey:"orders-dbs.getClientInfo"})}async getB2BInfo(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/dbs/orders/b2b/info`,{ordersIds:e},{rateLimitKey:"orders-dbs.getB2BInfo"})}async getGroupsInfo(e){return this.client.post(`${A}/api/v3/dbs/groups/info`,e,{rateLimitKey:"orders-dbs.getGroupsInfo"})}async getDeliveryDates(e){return this.client.post(`${A}/api/v3/dbs/orders/delivery-date`,e,{rateLimitKey:"orders-dbs.getDeliveryDates"})}async deleteMetaBulk(e){return this.client.post(`${A}/api/marketplace/v3/dbs/orders/meta/delete`,e,{rateLimitKey:"orders-dbs.deleteMetaBulk"})}async setSgtinBulk(e){return this.client.post(`${A}/api/marketplace/v3/dbs/orders/meta/sgtin`,e,{rateLimitKey:"orders-dbs.setSgtinBulk"})}async setUinBulk(e){return this.client.post(`${A}/api/marketplace/v3/dbs/orders/meta/uin`,e,{rateLimitKey:"orders-dbs.setUinBulk"})}async setImeiBulk(e){return this.client.post(`${A}/api/marketplace/v3/dbs/orders/meta/imei`,e,{rateLimitKey:"orders-dbs.setImeiBulk"})}async setGtinBulk(e){return this.client.post(`${A}/api/marketplace/v3/dbs/orders/meta/gtin`,e,{rateLimitKey:"orders-dbs.setGtinBulk"})}async setCustomsDeclarationBulk(e){return this.client.post(`${A}/api/marketplace/v3/dbs/orders/meta/customs-declaration`,e,{rateLimitKey:"orders-dbs.setCustomsDeclarationBulk"})}async getStatusesBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/dbs/orders/status/info`,{orders:e},{rateLimitKey:"orders-dbs.getStatusesBulk"})}async confirmBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/dbs/orders/status/confirm`,{orders:e},{rateLimitKey:"orders-dbs.confirmBulk"})}async deliverBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/dbs/orders/status/deliver`,{orders:e},{rateLimitKey:"orders-dbs.deliverBulk"})}async receiveBulk(e){if(e.length===0)throw new h.ValidationError("orders array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orders array cannot exceed 1000 items");for(const t of e){if(t.orderId<=0)throw new h.ValidationError("orderId must be a positive number");if(!t.code||t.code==="")throw new h.ValidationError("code cannot be empty")}return this.client.post(`${A}/api/marketplace/v3/dbs/orders/status/receive`,{orders:e},{rateLimitKey:"orders-dbs.receiveBulk"})}async rejectBulk(e){if(e.length===0)throw new h.ValidationError("orders array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orders array cannot exceed 1000 items");for(const t of e){if(t.orderId<=0)throw new h.ValidationError("orderId must be a positive number");if(!t.code||t.code==="")throw new h.ValidationError("code cannot be empty")}return this.client.post(`${A}/api/marketplace/v3/dbs/orders/status/reject`,{orders:e},{rateLimitKey:"orders-dbs.rejectBulk"})}async cancelBulk(e){if(e.length===0)throw new h.ValidationError("orderIds array cannot be empty");if(e.length>1e3)throw new h.ValidationError("orderIds array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/dbs/orders/status/cancel`,{orders:e},{rateLimitKey:"orders-dbs.cancelBulk"})}async checkMetaValidation(e){if(e.orders.length===0)throw new h.ValidationError("orders array cannot be empty");if(e.orders.length>1e3)throw new h.ValidationError("orders array cannot exceed 1000 items");return this.client.post(`${A}/api/marketplace/v3/dbs/orders/meta/details`,e,{rateLimitKey:"orders-dbs.checkMetaValidation"})}async createOrdersStickers(e,t){if(t!=null&&t.orders&&t.orders.length>100)throw new h.ValidationError("orders array cannot exceed 100 items");return this.client.post(`${A}/api/marketplace/v3/dbs/orders/stickers`,t,{params:e,rateLimitKey:"orders-dbs.createOrdersStickers"})}}class Ar{constructor(e){this.client=e}async createInvite(e){return this.client.post("https://user-management-api.wildberries.ru/api/v1/invite",e,{rateLimitKey:"userManagement.createInvite"})}async getUsers(e){return this.client.get("https://user-management-api.wildberries.ru/api/v1/users",{params:e?{...e}:void 0,rateLimitKey:"userManagement.getUsers"})}async updateUserAccess(e){return this.client.put("https://user-management-api.wildberries.ru/api/v1/users/access",e,{rateLimitKey:"userManagement.updateAccess"})}async deleteUser(e){return this.client.delete("https://user-management-api.wildberries.ru/api/v1/user",void 0,{params:{deletedUserID:e},rateLimitKey:"userManagement.deleteUser"})}}function Ae(r){if(!r)return"other";const e=r.toLowerCase().trim();return e?/повреждени|поврежд|сломан|разбит|потёрт|царапин|деформ|помят/.test(e)?"damage":/брак|дефект|неисправн|не работает|сломалось|не включается/.test(e)?"defect":/не подошёл размер|не подошел размер|не по размеру|размер не подошёл|размер не подошел|маловат|великоват|узк|шир/.test(e)?"wrong_size":/не тот товар|неправильный товар|ошибк[аи] комплект|пришло другое|перепутали/.test(e)?"wrong_item":/срок годности|истёк срок|истек срок|просроч|время.*возврат/.test(e)?"expired":/не соответств|не как на фото|описан|качество|не оправда/.test(e)?"not_as_described":/отказ|раздума|передумал|не понравил|не нужен|вернуть/.test(e)?"customer_refused":"other":"other"}function Br(r){if(r==null||r==="")return 0;const e=parseFloat(r);return Number.isNaN(e)?0:e}function cn(r,e){const t=new Date(r),s=new Date(e);if(isNaN(t.getTime()))throw new Error(`Invalid dateFrom: '${r}' is not a valid date string`);if(isNaN(s.getTime()))throw new Error(`Invalid dateTo: '${e}' is not a valid date string`);const n=(s.getTime()-t.getTime())/(1e3*60*60*24);if(n<0)throw new Error(`dateFrom (${r}) must be <= dateTo (${e})`);if(n>31)throw new Error(`Date range exceeds 31-day limit (got ${Math.round(n)} days). WB getAnalyticsGoodsReturn supports max 31 days. Split your range and call getReturns() multiple times.`)}function un(r){return r.isStatusActive===1?"initiated":r.isStatusActive===0&&r.completedDt?"processed":"received"}function ln(r){const e=[];for(const t of r){if(t.nmId===void 0||!t.orderId&&t.orderId!==0)continue;const s=t.completedDt??t.readyToReturnDt??t.orderDt;s&&e.push({orderId:String(t.orderId),nmId:t.nmId,orderType:"fbo",returnDate:s,returnStatus:un(t),returnReason:t.reason??"",returnReasonCode:Ae(t.reason??""),returnCategory:"unknown",quantity:1,srid:t.srid})}return e}function dn(r,e){if(e.length===0)return r;const t=new Map,s=new Map,i=new Map;for(const n of e){const a=n.forPay!==void 0?Br(n.forPay):0;if(n.srid&&t.set(n.srid,(t.get(n.srid)??0)+a),n.orderId!==void 0&&n.nmId!==void 0){const o=`${n.orderId}:${n.nmId}`;s.set(o,(s.get(o)??0)+a),n.srid&&!i.has(o)&&i.set(o,n.srid)}}return r.map(n=>{let a,o;if(n.srid&&t.has(n.srid))a=t.get(n.srid);else{const u=`${n.orderId}:${n.nmId}`;s.has(u)&&(a=s.get(u),o=i.get(u))}return a===void 0?n:{...n,returnAmount:a,srid:n.srid??o}})}function pn(r){const e=new Set;return r.filter(t=>t.srid?e.has(t.srid)?!1:(e.add(t.srid),!0):!0)}class qr{constructor(e,t,s,i){this.reports=t,this.finances=i}async fetchAllFinanceLines(e,t,s){const a=[];let o=0;for(let u=0;u<5;u++){const l=await this.finances.getSalesReportsDetailed({dateFrom:e,dateTo:t,limit:1e5,rrdId:o});if(l.length===0||(a.push(...l),l.length<1e5))break;const d=l[l.length-1];if(d.rrdId===void 0)break;o=d.rrdId}return a.length>=1e5*5&&s.push(`Finance source truncated at ${a.length} lines (safety cap). Some returnAmount values may be missing for high-volume sellers — narrow your date range and call getReturns() multiple times.`),a}async getReturns(e){cn(e.dateFrom,e.dateTo);const t=e.orderType!=="fbs",s=[];e.orderType!=="fbo"&&(e.includeFbsStatusHistory===!0?s.push("FBS status history fetching is reserved for future implementation in v3.10.0; FBS source skipped"):s.push("FBS status history skipped — pass includeFbsStatusHistory: true to include (currently no-op in v3.10.0)"));const[i,n]=await Promise.allSettled([t?this.reports.getAnalyticsGoodsReturn({dateFrom:e.dateFrom,dateTo:e.dateTo}):Promise.resolve(null),this.fetchAllFinanceLines(e.dateFrom,e.dateTo,s)]),a=[];i.status==="rejected"&&a.push({source:"fbo",error:i.reason instanceof Error?i.reason.message:String(i.reason)}),n.status==="rejected"&&a.push({source:"finance",error:n.reason instanceof Error?n.reason.message:String(n.reason)});const o=i.status==="fulfilled"&&i.value?ln(i.value.report??[]):[],u=n.status==="fulfilled"?n.value:[],l={sources:{fbo:t?{fetched:o.length,skipped:!1,failed:i.status==="rejected",reason:i.status==="rejected"?"fetch failed":void 0}:{fetched:0,skipped:!0,failed:!1,reason:"orderType filter"},fbs:{fetched:0,skipped:!0,failed:!1,reason:"v3.10.0: implementation deferred"},finance:{fetched:u.length,skipped:!1,failed:n.status==="rejected",reason:n.status==="rejected"?"fetch failed":void 0}}},d=dn(o,u),m=pn(d),p=e.nmIds,f=p?m.filter(S=>p.includes(S.nmId)):m;f.sort((S,w)=>w.returnDate.localeCompare(S.returnDate));const v=e.offset??0,L=f.length,b=e.limit??f.length;return{data:f.slice(v,v+b),total:L,warnings:s,partialFailures:a,_meta:l}}async getReturnByOrderId(e,t){if(!e||e.trim()==="")throw new Error("orderId must be a non-empty string");return(await this.getReturns({dateFrom:t.dateFrom,dateTo:t.dateTo,orderType:t.orderType})).data.find(i=>i.orderId===e)??null}async getReturnStats(e){const t=await this.getReturns({dateFrom:e.dateFrom,dateTo:e.dateTo,nmIds:e.nmIds,orderType:e.orderType}),s=new Map;for(const n of t.data){let a;switch(e.groupBy){case"nmId":a=String(n.nmId);break;case"category":a=n.returnCategory;break;case"orderType":a=n.orderType;break;default:{const u=e.groupBy;throw new Error(`Unsupported groupBy value: ${String(u)}`)}}const o=s.get(a)??{count:0,totalAmount:0,pendingFinanceCount:0};o.count++,n.returnAmount!==void 0?o.totalAmount+=n.returnAmount:o.pendingFinanceCount++,s.set(a,o)}const i=Array.from(s.entries()).map(([n,a])=>({key:n,count:a.count,totalAmount:a.totalAmount,pendingFinanceCount:a.pendingFinanceCount}));return i.sort((n,a)=>a.count!==n.count?a.count-n.count:n.key.localeCompare(a.key)),{buckets:i,totalReturns:i.reduce((n,a)=>n+a.count,0),totalAmount:i.reduce((n,a)=>n+a.totalAmount,0),warnings:t.warnings,partialFailures:t.partialFailures,_meta:t._meta}}}const mn=50,Er=100,Or=100,yn={box:["Короба","QR-поставка с коробами"],pallet:["Монопаллеты"],supersafe:["Суперсейф"]};function z(r,e=0){if(r==null)return e;const t=parseFloat(r);return Number.isFinite(t)?t:e}function Te(r){return Number(r.toFixed(2))}function fn(r,e,t,s){const i=z(t.storageBaseLiter,0),n=z(t.storageAdditionalLiter,0),a=z(t.storageCoef,Er);let o;s?o=i:o=i+(r-1)*n;const u=o*(a/100)*e;return Te(u)}function hn(r,e,t){const s=z(e.deliveryBaseLiter,0),i=z(e.deliveryAdditionalLiter,0),n=z(e.deliveryCoef,Or);let a;t?a=s:a=s+(r-1)*i;const o=a*(n/100);return Te(o)}function gn(r){return r===0?0:Te(r*mn)}function bn(r,e,t){const s=r.filter(i=>i.warehouseID===e);if(s.length!==0){if(t){const i=yn[t],n=s.find(a=>i.some(o=>a.boxTypeName===o));if(n)return n}return s[0]}}async function vn(r,e){const{volume:t,warehouseID:s,days:i,boxType:n}=r;if(t<=0)throw new Error("Volume must be greater than 0");const a=await e();if(a.length===0)throw new Error("No acceptance coefficients available");const o=bn(a,s,n);if(!o)throw new Error(`Warehouse with ID ${s} not found`);const u=o.coefficient??0;if(u===-1)throw new Error(`Acceptance unavailable for warehouse: ${o.warehouseName}`);const l=n==="pallet"||o.boxTypeName==="Монопаллеты",d=gn(u),m=fn(t,i,o,l),p=hn(t,o,l),f=Te(d+m+p);return{acceptanceCost:d,storageCost:m,logisticsCost:p,totalCost:f,warehouseName:o.warehouseName??"",appliedCoefficients:{acceptance:u,storage:z(o.storageCoef,Er),delivery:z(o.deliveryCoef,Or)}}}function G(r){if(r==null||r==="")return 0;const e=parseFloat(r);return isNaN(e)?0:e}function Kr(r,e){if(!r)return!1;const t=r.toLowerCase().trim(),s=e.toLowerCase().trim();return t===s||t.startsWith(s)}function Sn(r,e){return r.find(t=>Kr(t.warehouseName,e))}function Ln(r,e){return r.find(t=>Kr(t.warehouseName,e))}function wn(r){return r?{deliveryBase:G(r.boxDeliveryBase),deliveryCoef:G(r.boxDeliveryCoefExpr),storageBase:G(r.boxStorageBase),storageCoef:G(r.boxStorageCoefExpr),found:!0}:{deliveryBase:0,deliveryCoef:0,storageBase:0,storageCoef:0,found:!1}}function Mn(r){return r?{deliveryBase:G(r.deliveryBaseLiter),deliveryCoef:G(r.deliveryCoef),storageBase:G(r.storageBaseLiter),storageCoef:G(r.storageCoef),found:!0}:{deliveryBase:0,deliveryCoef:0,storageBase:0,storageCoef:0,found:!1}}function At(r,e){return r===0?e===0?0:100:(e-r)/r*100}function kn(r,e){return{deliveryBasePercent:At(r.deliveryBase,e.deliveryBase),storageBasePercent:At(r.storageBase,e.storageBase)}}function Pn(r,e){if(r.found&&!e.found)return"INVENTORY_CHEAPER";if(!r.found&&e.found)return"SUPPLY_CHEAPER";const t=r.deliveryBase+r.storageBase,s=e.deliveryBase+e.storageBase;return Math.abs(t-s)<1e-4?"EQUAL":s<t?"SUPPLY_CHEAPER":"INVENTORY_CHEAPER"}async function Cn(r,e,t){const{warehouseName:s,date:i}=r,[n,a]=await Promise.all([e(),t()]),o=Sn(n,s),u=Ln(a,s),l=wn(o),d=Mn(u);if(!l.found&&!d.found)throw new Error(`Warehouse "${s}" not found`);const m=kn(l,d),p=Pn(l,d);return{warehouseName:s,date:i,inventory:l,supply:d,difference:m,recommendation:p}}function Rn(r,e,t){const s=new Set(e.map(n=>n.id));let i=!1;return r.filter(n=>n.isRequiredForCreate===!0).filter(n=>{if(n.existNamedField===!0){if(!t)return i||(h.warnOnce("validateRequiredCharacteristics:legacy-call","validateRequiredCharacteristics: a required characteristic with existNamedField:true was found, but no `namedFields` parameter was provided. Helper may report false positives. Pass the named-field values (brand, height, length, etc.) as the third argument. See CHANGELOG v3.10.2 for migration details."),i=!0),!s.has(n.charcID??-1);const a=n.name?t[n.name]:void 0;return!(a!=null&&a!=="")}return!s.has(n.charcID??-1)})}function An(r,e,t){if(e.length<2)return{divergentFixedChars:[],identicalVariableChars:[],duplicateVariants:!1};const s=new Map;for(const p of r)p.charcID!==void 0&&s.set(p.charcID,p);const i=new Map;let n=!1;const a=(p,f,v)=>{if(p.existNamedField===!0){const b=t==null?void 0:t[f];if(b===void 0){n||(h.warnOnce("validateMergedCardVariants:legacy-call","validateMergedCardVariants: a required characteristic with existNamedField:true was found, but no `namedFieldsPerVariant` parameter was provided (or the slot for this variant is undefined). Helper may report false positives. Pass the named-field values per variant as the third argument. See CHANGELOG v3.10.2 for migration details."),n=!0);const S=v.characteristics.find(w=>w.id===(p.charcID??-1));return JSON.stringify((S==null?void 0:S.value)??null)}const y=p.name?b[p.name]:void 0;return JSON.stringify(y??null)}const L=v.characteristics.find(b=>b.id===(p.charcID??-1));return JSON.stringify((L==null?void 0:L.value)??null)};for(let p=0;p<e.length;p++){const f=e[p];for(const v of f.characteristics){let L=i.get(v.id);L||(L=new Set,i.set(v.id,L)),L.add(JSON.stringify(v.value))}for(const v of r)if(v.existNamedField===!0&&v.charcID!==void 0){let L=i.get(v.charcID);L||(L=new Set,i.set(v.charcID,L)),L.add(a(v,p,f))}}const o=[],u=[];for(const[p,f]of i){const v=s.get(p);v&&(v.isVariable===!1&&f.size>1&&o.push(v),v.isVariable===!0&&f.size===1&&u.push(v))}const l=r.filter(p=>p.isVariable===!0&&p.charcID!==void 0).map(p=>p.charcID),d=new Set;let m=!1;for(let p=0;p<e.length;p++){const f=e[p],v=l.map(L=>{const b=s.get(L);if((b==null?void 0:b.existNamedField)===!0)return`${L}:${a(b,p,f)}`;const y=f.characteristics.find(S=>S.id===L);return`${L}:${JSON.stringify((y==null?void 0:y.value)??null)}`}).join("|");if(d.has(v)){m=!0;break}d.add(v)}return{divergentFixedChars:o,identicalVariableChars:u,duplicateVariants:m}}function Bn(r,e=[]){const t=[];for(const s of r){const i=s.completedDt??s.readyToReturnDt??s.orderDt;if(s.nmId===void 0||s.orderId===void 0||!i)continue;const n=s.reason??"";t.push({nmId:s.nmId,orderId:s.orderId,returnDate:i,reason:n,reasonCode:Ae(n),warehouseName:s.dstOfficeAddress,orderType:"fbo",quantity:1})}for(const s of e){if(s.nmId===void 0||s.orderId===void 0||!s.lastChangeDate)continue;const i=s.reason??"";t.push({nmId:s.nmId,orderId:s.orderId,returnDate:s.lastChangeDate,reason:i,reasonCode:Ae(i),warehouseName:s.warehouseName,orderType:"fbs",quantity:s.quantity??1})}return t.sort((s,i)=>i.returnDate.localeCompare(s.returnDate)),t}function qn(r){if(r.length===0)return"unknown";const t=[...r].sort((l,d)=>l.date.localeCompare(d.date)).map(l=>l.status.toLowerCase()),s=t.includes("delivered"),i=t.includes("returned"),n=t.some(l=>l==="cancelled"||l==="canceled"),a=t.includes("defected"),o=t.some(l=>l==="canceled_by_client"||l==="cancelled_by_client"),u=t.some(l=>l==="confirmed"||l==="assembled");if(s&&i){const l=t.indexOf("delivered");if(t.indexOf("returned")>l)return"return_after_receipt"}if(s&&(a||o)){const l=t.indexOf("delivered");if(Math.min(a?t.indexOf("defected"):1/0,o?(()=>{const m=t.indexOf("canceled_by_client"),p=t.indexOf("cancelled_by_client");return Math.min(m<0?1/0:m,p<0?1/0:p)})():1/0)>l)return"refusal_at_pvz"}return n&&!u?"cancel_before_shipment":"unknown"}function En(r,e,t={}){const s=new Map;for(const i of r)s.set(i.nmId,{nmId:i.nmId,buyoutCount:i.buyoutCount,returnCount:0,fboReturnCount:0,fbsReturnCount:0,netRevenue:i.buyoutRevenue,anomalies:[]});for(const i of e){let n=s.get(i.nmId);n||(n={nmId:i.nmId,buyoutCount:0,returnCount:0,fboReturnCount:0,fbsReturnCount:0,netRevenue:void 0,anomalies:[]},s.set(i.nmId,n)),n.returnCount+=i.quantity,i.orderType==="fbo"?n.fboReturnCount+=i.quantity:n.fbsReturnCount+=i.quantity}for(const i of s.values())i.returnCount>i.buyoutCount&&i.buyoutCount>0&&i.anomalies.push({type:"return_without_buyout",nmId:i.nmId,details:`${i.returnCount} returns vs ${i.buyoutCount} buyouts`}),i.buyoutCount>0&&i.returnCount===0&&t.strictTemporalAlignment&&i.anomalies.push({type:"orphan_buyout",nmId:i.nmId,details:`${i.buyoutCount} buyouts with no returns`}),i.buyoutCount===0&&i.returnCount>0&&i.anomalies.push({type:"return_without_buyout",nmId:i.nmId,details:`Return without matching buyout record (${i.returnCount} returns, 0 buyouts)`});return Array.from(s.values()).sort((i,n)=>i.nmId-n.nmId)}function On(r){if(r==null||typeof r!="object")return null;if(r instanceof Ke)return{code:r.code,message:r.message,metaDetails:r.metaDetails};const e=r;if(e.statusCode!==409)return null;const t=e.response;if(t==null||typeof t!="object")return null;const s=t;if(!Array.isArray(s.metaDetails))return null;const i=typeof s.code=="string"?s.code:"Unknown",n=typeof s.message=="string"?s.message:typeof e.message=="string"?e.message:"Meta validation failed";return{code:i,message:n,metaDetails:s.metaDetails}}function st(r){const e=r.normQueries;if(e.length===0)return null;let t=1/0,s=-1/0;for(const i of e)t=Math.min(t,i.reachMin.bidKopecks),s=Math.max(s,i.reachMax.bidKopecks);return{min:t,max:s}}function Kn(r,e){const t=st(r);if(t!==null&&(e<t.min||e>t.max))throw new rt(`Bid ${e} is outside the recommended range [${t.min}, ${t.max}] kopecks`,{received:e,min:t.min,max:t.max,field:"bid_kopecks"})}function Tn(r,e){const t=st(r);return t===null?e:Math.min(t.max,Math.max(t.min,e))}function Dn(r,e){const t=(e==null?void 0:e.excludeLastDays)??1,s=e==null?void 0:e.windowDays,n=[...Array.isArray(r)?r:r.days].sort((d,m)=>d.date<m.date?-1:d.date>m.date?1:0),a=Math.max(0,Math.min(t,n.length));let o=n.slice(0,n.length-a);s!=null&&s>=0&&(o=o.slice(Math.max(0,o.length-s)));let u=0,l=0;for(const d of o)u+=d.sum,l+=d.sum_price;return{roas:u>0?l/u:null,revenue:l,spend:u,daysUsed:o.length,excludedDays:a}}function In(r){const e=r.declared instanceof Map?new Map(r.declared):new Map(Object.entries(r.declared).map(([l,d])=>[Number(l),d])),t=new Map;for(const l of r.accepted){if(l.nmID===void 0)continue;const d=t.get(l.nmID)??0;t.set(l.nmID,d+(l.count??0))}const s=new Set([...e.keys(),...t.keys()]),i=[];let n=0,a=0,o=0,u=0;for(const l of s){const d=e.get(l)??0,m=t.get(l)??0,p=d-m,f=p!==0;i.push({nmId:l,declared:d,accepted:m,delta:p,hasDiscrepancy:f}),n+=d,a+=m,o+=p,f&&(u+=1)}return i.sort((l,d)=>l.nmId-d.nmId),{items:i,totalDeclared:n,totalAccepted:a,totalDelta:o,discrepancyCount:u}}class Tr{constructor(e){if(!e.apiKey||e.apiKey.trim()==="")throw new Oe("API key is required. Please provide a valid Wildberries API key in the configuration.",401);this.client=new vr(e);const t=e.tokenType??"personal";(t==="basic"||t==="test")&&console.warn(`[WildberriesSDK] ${t.charAt(0).toUpperCase()+t.slice(1)} token detected. Reduced rate limits apply. Consider upgrading to a Personal or Service token. See https://dev.wildberries.ru/news/281`),this.general=new Sr(this.client),this.products=new Lr(this.client),this.ordersFBS=new wr(this.client),this.ordersFBW=new Mr(this.client),this.finances=new Bt.FinancesModule(this.client),this.analytics=new qt.AnalyticsModule(this.client),this.communications=new h.CommunicationsModule(this.client),this.reports=new Et.ReportsModule(this.client),this.promotion=new kr(this.client),this.tariffs=new Pr(this.client),this.inStorePickup=new Cr(this.client),this.ordersDBS=new Rr(this.client),this.userManagement=new Ar(this.client),this.returns=new qr(this.client,this.reports,this.ordersFBS,this.finances)}}const Nn=Fr.version;exports.COMMUNICATIONS_LIMITS=h.COMMUNICATIONS_LIMITS;exports.CommunicationsModule=h.CommunicationsModule;exports.ValidationError=h.ValidationError;exports.WBAPIError=h.WBAPIError;exports.resetDeprecationWarnings=h.resetDeprecationWarnings;exports.warnOnce=h.warnOnce;exports.FinancesModule=Bt.FinancesModule;exports.AnalyticsModule=qt.AnalyticsModule;exports.ReportsModule=Et.ReportsModule;exports.ALL_RATE_LIMITS=Ge;exports.AuthenticationError=Oe;exports.BaseClient=vr;exports.BidOutOfRangeError=rt;exports.BudgetExceededError=_i;exports.CampaignNotFoundError=xi;exports.CustomerVerificationError=Wi;exports.GeneralModule=Sr;exports.InStorePickupModule=Cr;exports.InvalidBidError=Fi;exports.InvalidCampaignStateError=Ui;exports.InvalidOrderStateError=Vi;exports.MetaValidationFailError=Ke;exports.MetadataValidationError=Hi;exports.NetworkError=ee;exports.OrdersDbsModule=Rr;exports.OrdersFbsModule=wr;exports.OrdersFbwModule=Mr;exports.PickupOrderNotFoundError=ji;exports.ProductsModule=Lr;exports.PromotionModule=kr;exports.RateLimitError=tt;exports.ReturnsModule=qr;exports.TariffsModule=Pr;exports.UserManagementModule=Ar;exports.WITH_PHOTO_FILTER=an;exports.WarehouseStocksUpdateBlockError=ir;exports.WildberriesSDK=Tr;exports.analyticsRateLimits=hr;exports.calculateSupplyCost=vn;exports.clampBid=Tn;exports.classifyFbsReturnCategory=qn;exports.classifyReturnReason=Ae;exports.communicationsRateLimits=br;exports.compareTariffs=Cn;exports.computeROAS=Dn;exports.default=Tr;exports.enrichReturnsWithType=Bn;exports.extractBidRange=st;exports.financesRateLimits=pr;exports.generalRateLimits=ar;exports.getOperationCategory=Ji;exports.getOperationMetadata=Qi;exports.getOperationRateLimitKey=Xi;exports.getOperationsByCategory=Yi;exports.getReadonlyOperations=Zi;exports.getWriteOperations=en;exports.inStorePickupRateLimits=fr;exports.isOperationReadonly=nr;exports.operationMetadata=J;exports.ordersDbsRateLimits=lr;exports.ordersFbsRateLimits=cr;exports.ordersFbwRateLimits=ur;exports.parseBidOutOfRangeDetail=sr;exports.parseMetaValidationFail=On;exports.parseMoneyAmount=Br;exports.productsRateLimits=or;exports.promotionRateLimits=mr;exports.reconcileAcceptanceDelta=In;exports.reconcileBuyoutsAndReturns=En;exports.reportsRateLimits=gr;exports.tariffsRateLimits=yr;exports.userManagementRateLimits=dr;exports.validateBid=Kn;exports.validateMergedCardVariants=An;exports.validateRequiredCharacteristics=Rn;exports.version=Nn;
67
62
  //# sourceMappingURL=index.cjs.map