@solibo/solibo-sdk 1.57.9 → 1.58.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 (322) hide show
  1. package/Kotlin-DateTime-library-kotlinx-datetime/kotlinx/datetime/internal/format/FieldSpec.mjs +4 -4
  2. package/Kotlin-DateTime-library-kotlinx-datetime/kotlinx/datetime/internal/format/FormatStructure.mjs +1 -1
  3. package/Kotlin-DateTime-library-kotlinx-datetime/kotlinx/datetime/internal/format/Predicate.mjs +2 -2
  4. package/KotlinBigInteger-bignum/com/ionspin/kotlin/bignum/decimal/BigDecimal.mjs +2 -2
  5. package/KotlinBigInteger-bignum/com/ionspin/kotlin/bignum/decimal/BigDecimalExtensions.mjs +2 -2
  6. package/KotlinBigInteger-bignum/com/ionspin/kotlin/bignum/integer/BigInteger.mjs +2 -2
  7. package/KotlinBigInteger-bignum/com/ionspin/kotlin/bignum/integer/BigIntegerExtensions.mjs +2 -2
  8. package/client-core.mjs +71 -7
  9. package/client.d.mts +38 -1
  10. package/core.d.mts +2 -2
  11. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoAesCbc.mjs +1 -1
  12. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoAesCtr.mjs +1 -1
  13. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoAesGcm.mjs +1 -1
  14. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoEcdh.mjs +3 -3
  15. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoEcdsa.mjs +3 -3
  16. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoEdDsa.mjs +2 -2
  17. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoHmac.mjs +1 -1
  18. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoRsaOaep.mjs +3 -3
  19. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoRsaPkcs1.mjs +3 -3
  20. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoRsaPss.mjs +3 -3
  21. package/cryptography-kotlin-cryptography-provider-webcrypto/dev/whyoleg/cryptography/providers/webcrypto/algorithms/WebCryptoXdh.mjs +2 -2
  22. package/kotlin-kotlin-stdlib/kotlin/UInt.mjs +2 -2
  23. package/kotlin-kotlin-stdlib/kotlin/ULong.mjs +2 -2
  24. package/kotlin-kotlin-stdlib/kotlin/UnsignedJs.mjs +2 -2
  25. package/kotlin-kotlin-stdlib/kotlin/time/Duration.mjs +31 -0
  26. package/kotlin-kotlin-stdlib/kotlin/time/DurationUnitJs.mjs +6 -1
  27. package/kotlin-kotlin-stdlib/kotlin/time/MonoTimeSource.mjs +2 -0
  28. package/kotlin-kotlin-stdlib/kotlin/time/TimeSource.mjs +2 -0
  29. package/kotlin-kotlin-stdlib/kotlin/uuid/Uuid.mjs +2 -2
  30. package/kotlin-kotlin-stdlib/kotlin/uuid/UuidJs.mjs +2 -2
  31. package/kotlinx-coroutines-core/kotlinx/coroutines/AbstractCoroutine.mjs +2 -2
  32. package/kotlinx-coroutines-core/kotlinx/coroutines/CancellableContinuation.mjs +2 -2
  33. package/kotlinx-coroutines-core/kotlinx/coroutines/CancellableContinuationImpl.mjs +2 -2
  34. package/kotlinx-coroutines-core/kotlinx/coroutines/CompletableJob.mjs +2 -2
  35. package/kotlinx-coroutines-core/kotlinx/coroutines/CoroutineContext.mjs +2 -2
  36. package/kotlinx-coroutines-core/kotlinx/coroutines/CoroutineDispatcher.mjs +2 -2
  37. package/kotlinx-coroutines-core/kotlinx/coroutines/CoroutineExceptionHandler.mjs +2 -2
  38. package/kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs +2 -2
  39. package/kotlinx-coroutines-core/kotlinx/coroutines/Delay.mjs +2 -2
  40. package/kotlinx-coroutines-core/kotlinx/coroutines/DispatchedTask.mjs +2 -2
  41. package/kotlinx-coroutines-core/kotlinx/coroutines/Dispatchers.mjs +2 -2
  42. package/kotlinx-coroutines-core/kotlinx/coroutines/EventLoop.common.mjs +2 -2
  43. package/kotlinx-coroutines-core/kotlinx/coroutines/EventLoop.mjs +2 -2
  44. package/kotlinx-coroutines-core/kotlinx/coroutines/JSDispatcher.mjs +2 -2
  45. package/kotlinx-coroutines-core/kotlinx/coroutines/Job.mjs +2 -2
  46. package/kotlinx-coroutines-core/kotlinx/coroutines/JobSupport.mjs +2 -2
  47. package/kotlinx-coroutines-core/kotlinx/coroutines/MainCoroutineDispatcher.mjs +2 -2
  48. package/kotlinx-coroutines-core/kotlinx/coroutines/Runnable.mjs +1 -1
  49. package/kotlinx-coroutines-core/kotlinx/coroutines/Timeout.mjs +2 -2
  50. package/kotlinx-coroutines-core/kotlinx/coroutines/Unconfined.mjs +2 -2
  51. package/kotlinx-coroutines-core/kotlinx/coroutines/Window.mjs +2 -2
  52. package/kotlinx-coroutines-core/kotlinx/coroutines/channels/BufferedChannel.mjs +2 -2
  53. package/kotlinx-coroutines-core/kotlinx/coroutines/channels/Channel.mjs +2 -2
  54. package/kotlinx-coroutines-core/kotlinx/coroutines/channels/ChannelCoroutine.mjs +8 -2
  55. package/kotlinx-coroutines-core/kotlinx/coroutines/channels/ConflatedBufferedChannel.mjs +2 -2
  56. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Channels.mjs +128 -2
  57. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Collect.mjs +19 -0
  58. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Context.mjs +50 -0
  59. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Distinct.mjs +215 -0
  60. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Emitters.mjs +4 -4
  61. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/Merge.mjs +111 -0
  62. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/SharedFlow.mjs +2 -273
  63. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/StateFlow.mjs +2 -366
  64. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/AbstractSharedFlow.mjs +2 -144
  65. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/ChannelFlow.mjs +648 -2
  66. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/FlowExceptions.mjs +13 -0
  67. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/Merge.mjs +311 -0
  68. package/kotlinx-coroutines-core/kotlinx/coroutines/flow/internal/NopCollector.mjs +39 -0
  69. package/kotlinx-coroutines-core/kotlinx/coroutines/internal/ConcurrentLinkedList.mjs +2 -2
  70. package/kotlinx-coroutines-core/kotlinx/coroutines/internal/CoroutineExceptionHandlerImpl.common.mjs +2 -2
  71. package/kotlinx-coroutines-core/kotlinx/coroutines/internal/DispatchedContinuation.mjs +2 -2
  72. package/kotlinx-coroutines-core/kotlinx/coroutines/internal/Scopes.mjs +2 -2
  73. package/kotlinx-coroutines-core/kotlinx/coroutines/intrinsics/Undispatched.mjs +2 -2
  74. package/kotlinx-coroutines-core/kotlinx/coroutines/selects/Select.mjs +2 -2
  75. package/kotlinx-coroutines-core/kotlinx/coroutines/sync/Semaphore.mjs +1 -1
  76. package/kotlinx-io-kotlinx-io-core/kotlinx/io/Buffer.mjs +2 -2
  77. package/kotlinx-io-kotlinx-io-core/kotlinx/io/Core.mjs +2 -2
  78. package/kotlinx-io-kotlinx-io-core/kotlinx/io/RealSource.mjs +2 -2
  79. package/kotlinx-io-kotlinx-io-core/kotlinx/io/Segment.mjs +2 -2
  80. package/kotlinx-io-kotlinx-io-core/kotlinx/io/SegmentPool.mjs +2 -2
  81. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/PolymorphicSerializer.mjs +2 -2
  82. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/SealedSerializer.mjs +1 -1
  83. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/Serializers.mjs +2 -2
  84. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/SerializersCache.mjs +2 -2
  85. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/builtins/BuiltinSerializers.mjs +2 -2
  86. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/descriptors/SerialDescriptors.mjs +2 -2
  87. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/encoding/AbstractEncoder.mjs +2 -2
  88. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/AbstractPolymorphicSerializer.mjs +2 -2
  89. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/BuiltInSerializers.mjs +2 -2
  90. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/CollectionSerializers.mjs +2 -2
  91. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/Enums.mjs +2 -2
  92. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/InlineClassDescriptor.mjs +2 -2
  93. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/NoOpEncoder.mjs +2 -2
  94. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/ObjectSerializer.mjs +2 -2
  95. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/Platform.mjs +2 -2
  96. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/PluginGeneratedSerialDescriptor.mjs +2 -2
  97. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/PrimitiveArraysSerializers.mjs +2 -2
  98. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/Primitives.mjs +2 -2
  99. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/Tuples.mjs +2 -2
  100. package/kotlinx-serialization-kotlinx-serialization-core/kotlinx/serialization/internal/ValueClasses.mjs +2 -2
  101. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/Json.mjs +2 -2
  102. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonElement.mjs +2 -2
  103. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonElementSerializers.mjs +2 -2
  104. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/JsonExceptions.mjs +2 -2
  105. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/CommentLexers.mjs +2 -2
  106. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/JsonElementMarker.mjs +1 -1
  107. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/JsonExceptions.mjs +2 -2
  108. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/JsonStreams.mjs +2 -2
  109. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/JsonTreeReader.mjs +2 -2
  110. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/StreamingJsonDecoder.mjs +2 -2
  111. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/StreamingJsonEncoder.mjs +2 -2
  112. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/StringJsonLexer.mjs +2 -2
  113. package/kotlinx-serialization-kotlinx-serialization-json/kotlinx/serialization/json/internal/TreeJsonDecoder.mjs +2 -2
  114. package/ktor-ktor-client-auth/io/ktor/client/plugins/auth/Auth.mjs +1 -1
  115. package/ktor-ktor-client-content-negotiation/io/ktor/client/plugins/contentnegotiation/ContentNegotiation.mjs +2 -2
  116. package/ktor-ktor-client-core/io/ktor/client/call/HttpClientCall.mjs +2 -2
  117. package/ktor-ktor-client-core/io/ktor/client/call/SavedCall.mjs +2 -2
  118. package/ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngine.mjs +2 -2
  119. package/ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngineBase.mjs +2 -2
  120. package/ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngineCapability.mjs +2 -2
  121. package/ktor-ktor-client-core/io/ktor/client/fetch/LibDom.mjs +1 -1
  122. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpCallValidator.mjs +1 -1
  123. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpPlainText.mjs +1 -1
  124. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpRedirect.mjs +1 -1
  125. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpRequestLifecycle.mjs +2 -2
  126. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpRequestRetry.mjs +2 -2
  127. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpSend.mjs +2 -2
  128. package/ktor-ktor-client-core/io/ktor/client/plugins/HttpTimeout.mjs +2 -2
  129. package/ktor-ktor-client-core/io/ktor/client/plugins/SaveBody.mjs +2 -2
  130. package/ktor-ktor-client-core/io/ktor/client/plugins/api/CommonHooks.mjs +2 -2
  131. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCache.mjs +2 -2
  132. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCacheEntry.mjs +2 -2
  133. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCacheLegacy.mjs +2 -2
  134. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/HttpCacheValidation.mjs +2 -2
  135. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/storage/DisabledCacheStorage.mjs +2 -2
  136. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/storage/HttpCacheStorage.mjs +2 -2
  137. package/ktor-ktor-client-core/io/ktor/client/plugins/cache/storage/UnlimitedCacheStorage.mjs +2 -2
  138. package/ktor-ktor-client-core/io/ktor/client/plugins/cookies/HttpCookies.mjs +1 -1
  139. package/ktor-ktor-client-core/io/ktor/client/plugins/observer/ResponseObserver.mjs +1 -1
  140. package/ktor-ktor-client-core/io/ktor/client/request/DefaultHttpRequest.mjs +2 -2
  141. package/ktor-ktor-client-core/io/ktor/client/request/HttpRequest.mjs +2 -2
  142. package/ktor-ktor-client-encoding/io/ktor/client/plugins/compression/ContentEncoding.mjs +1 -1
  143. package/ktor-ktor-client-logging/io/ktor/client/plugins/logging/Logging.mjs +1 -1
  144. package/ktor-ktor-http/io/ktor/http/URLBuilder.mjs +2 -2
  145. package/ktor-ktor-http/io/ktor/http/URLParser.mjs +2 -2
  146. package/ktor-ktor-http/io/ktor/http/URLUtils.mjs +2 -2
  147. package/ktor-ktor-http/io/ktor/http/Url.mjs +2 -2
  148. package/ktor-ktor-http/io/ktor/http/content/CompressedContent.mjs +2 -2
  149. package/ktor-ktor-io/io/ktor/utils/io/ByteChannel.mjs +2 -2
  150. package/ktor-ktor-io/io/ktor/utils/io/ByteChannelScanner.mjs +2 -2
  151. package/ktor-ktor-io/io/ktor/utils/io/ByteReadChannelOperations.mjs +2 -2
  152. package/ktor-ktor-io/io/ktor/utils/io/ByteWriteChannel.mjs +2 -2
  153. package/ktor-ktor-io/io/ktor/utils/io/ByteWriteChannelOperations.mjs +2 -2
  154. package/ktor-ktor-io/io/ktor/utils/io/charsets/Charset.js.mjs +2 -2
  155. package/ktor-ktor-io/io/ktor/utils/io/charsets/Encoding.mjs +2 -2
  156. package/ktor-ktor-io/io/ktor/utils/io/charsets/ISO88591.mjs +2 -2
  157. package/ktor-ktor-utils/io/ktor/util/PlatformUtils.js.mjs +2 -2
  158. package/ktor-ktor-utils/io/ktor/util/PlatformUtils.mjs +2 -2
  159. package/ktor-ktor-utils/io/ktor/util/date/Date.mjs +2 -2
  160. package/ktor-ktor-utils/io/ktor/util/date/DateJs.mjs +2 -2
  161. package/ktor-ktor-utils/io/ktor/util/pipeline/DebugPipelineContext.mjs +2 -2
  162. package/ktor-ktor-utils/io/ktor/util/pipeline/Pipeline.mjs +2 -2
  163. package/ktor-ktor-utils/io/ktor/util/pipeline/PipelineContext.mjs +2 -2
  164. package/ktor-ktor-utils/io/ktor/util/pipeline/SuspendFunctionGun.mjs +2 -2
  165. package/ktor-ktor-websockets/io/ktor/websocket/DefaultWebSocketSession.mjs +2 -2
  166. package/ktor-ktor-websockets/io/ktor/websocket/PingPong.mjs +2 -2
  167. package/ktor-ktor-websockets/io/ktor/websocket/WebSocketChannelsConfig.mjs +11 -2
  168. package/package.json +1 -1
  169. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-4.mjs +5 -5
  170. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-6.mjs +8 -8
  171. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-7.mjs +4 -4
  172. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-8.mjs +21 -21
  173. package/solibo-cycles/Kotlin-DateTime-library-kotlinx-datetime-9.mjs +9 -9
  174. package/solibo-cycles/cryptography-kotlin-cryptography-serialization-asn1-modules-3.mjs +3 -3
  175. package/solibo-cycles/kotlin-kotlin-stdlib-10.mjs +11 -11
  176. package/solibo-cycles/kotlin-kotlin-stdlib-13.mjs +297 -245
  177. package/solibo-cycles/kotlin-kotlin-stdlib-14.mjs +250 -428
  178. package/solibo-cycles/kotlin-kotlin-stdlib-15.mjs +482 -0
  179. package/solibo-cycles/kotlinx-coroutines-core-17.mjs +5576 -3023
  180. package/solibo-cycles/kotlinx-coroutines-core-18.mjs +3500 -365
  181. package/solibo-cycles/kotlinx-coroutines-core-19.mjs +1316 -0
  182. package/solibo-cycles/kotlinx-io-kotlinx-io-core-20.mjs +602 -336
  183. package/solibo-cycles/kotlinx-io-kotlinx-io-core-21.mjs +383 -0
  184. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-22.mjs +4075 -145
  185. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-23.mjs +188 -196
  186. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-24.mjs +186 -360
  187. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-25.mjs +392 -0
  188. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-json-26.mjs +227 -3646
  189. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-json-27.mjs +3638 -143
  190. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-json-28.mjs +179 -0
  191. package/solibo-cycles/ktor-ktor-client-core-29.mjs +3004 -427
  192. package/solibo-cycles/ktor-ktor-client-core-30.mjs +455 -3061
  193. package/solibo-cycles/ktor-ktor-client-core-31.mjs +3176 -0
  194. package/solibo-cycles/{ktor-ktor-http-31.mjs → ktor-ktor-http-32.mjs} +5 -5
  195. package/solibo-cycles/ktor-ktor-io-33.mjs +2950 -342
  196. package/solibo-cycles/ktor-ktor-io-34.mjs +412 -0
  197. package/solibo-cycles/ktor-ktor-utils-35.mjs +557 -312
  198. package/solibo-cycles/ktor-ktor-utils-36.mjs +329 -218
  199. package/solibo-cycles/ktor-ktor-utils-37.mjs +245 -0
  200. package/solibo-cycles/{solibo-sdk-sdk-api-document-39.mjs → solibo-sdk-sdk-api-document-40.mjs} +1 -1
  201. package/solibo-cycles/solibo-sdk-sdk-api-resident-43.mjs +819 -332
  202. package/solibo-cycles/solibo-sdk-sdk-api-resident-44.mjs +745 -1431
  203. package/solibo-cycles/solibo-sdk-sdk-api-resident-45.mjs +1597 -0
  204. package/solibo-cycles/solibo-sdk-sdk-core-47.mjs +1020 -3585
  205. package/solibo-cycles/solibo-sdk-sdk-core-48.mjs +3984 -2184
  206. package/solibo-cycles/solibo-sdk-sdk-core-49.mjs +2634 -580
  207. package/solibo-cycles/solibo-sdk-sdk-core-50.mjs +597 -1902
  208. package/solibo-cycles/solibo-sdk-sdk-core-51.mjs +1873 -943
  209. package/solibo-cycles/solibo-sdk-sdk-core-52.mjs +1147 -9240
  210. package/solibo-cycles/solibo-sdk-sdk-core-53.mjs +8074 -3853
  211. package/solibo-cycles/solibo-sdk-sdk-core-54.mjs +5135 -0
  212. package/solibo-sdk-sdk/no/solibo/oss/sdk/SoliboSDK.mjs +1 -1
  213. package/solibo-sdk-sdk/no/solibo/oss/sdk/api/IntegratedDocumentMutation.export.d.mts +18 -0
  214. package/solibo-sdk-sdk/no/solibo/oss/sdk/api/IntegratedDocumentMutation.mjs +3411 -463
  215. package/solibo-sdk-sdk/no/solibo/oss/sdk/api/MockHomeApi.mjs +874 -707
  216. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewCommunicationCommentPushPayload.mjs +2 -2
  217. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewMessageInConversationPushPayload.mjs +2 -2
  218. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewNeighborhoodPostPushPayload.mjs +2 -2
  219. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewOppslagPushPayload.mjs +2 -2
  220. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/NewPracticalInfoPushPayload.mjs +2 -2
  221. package/solibo-sdk-sdk-api-communication/no/solibo/oss/sdk/api/gen/models/PushNotificationPayload.mjs +2 -2
  222. package/solibo-sdk-sdk-api-document/no/solibo/oss/sdk/api/DocumentUploader.mjs +2 -2
  223. package/solibo-sdk-sdk-api-document/no/solibo/oss/sdk/api/DocumentsApi.mjs +2 -2
  224. package/solibo-sdk-sdk-api-follow-up/no/solibo/oss/sdk/api/gen/models/ExpenseFollowUp.mjs +2 -2
  225. package/solibo-sdk-sdk-api-follow-up/no/solibo/oss/sdk/api/gen/models/FollowUp.mjs +2 -2
  226. package/solibo-sdk-sdk-api-follow-up/no/solibo/oss/sdk/api/gen/models/MeetingProtocolFollowUp.mjs +2 -2
  227. package/solibo-sdk-sdk-api-follow-up/no/solibo/oss/sdk/api/gen/models/SupplierInvoiceFollowUp.mjs +2 -2
  228. package/solibo-sdk-sdk-api-invoicing/no/solibo/oss/sdk/api/gen/models/CreateExternalCustomerCommand.mjs +2 -2
  229. package/solibo-sdk-sdk-api-invoicing/no/solibo/oss/sdk/api/gen/models/CreateExternalOrganizationCustomerCommand.mjs +2 -2
  230. package/solibo-sdk-sdk-api-invoicing/no/solibo/oss/sdk/api/gen/models/CreateExternalPersonCustomerCommand.mjs +2 -2
  231. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/ResidentOperations.mjs +2 -2
  232. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/ResidentsApi.mjs +2 -2
  233. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/CreateOrganizationResidentCommand.mjs +2 -2
  234. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/CreatePersonResidentCommand.mjs +2 -2
  235. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/CreateResidentCommand.mjs +2 -2
  236. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/UpdateOrganizationResidentCommand.mjs +2 -2
  237. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/UpdatePersonResidentCommand.mjs +2 -2
  238. package/solibo-sdk-sdk-api-resident/no/solibo/oss/sdk/api/gen/models/UpdateResidentCommand.mjs +2 -2
  239. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationAltinnError.mjs +2 -2
  240. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationEmailError.mjs +2 -2
  241. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationError.mjs +2 -2
  242. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationPostenError.mjs +2 -2
  243. package/solibo-sdk-sdk-api-third-party-information/no/solibo/oss/sdk/api/gen/models/ThirdPartyInformationProcessError.mjs +2 -2
  244. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/Platform.js.mjs +2 -2
  245. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/SoliboSDKBase.mjs +1 -1
  246. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/EventBus.export.d.mts +3 -1
  247. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/EventBus.mjs +743 -69
  248. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/EventBusAccess.mjs +2 -2
  249. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/EventBusSubscriptions.mjs +75 -25
  250. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/HomeApiBase.export.d.mts +1 -0
  251. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/HomeApiBase.mjs +2 -2
  252. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/infrastructure/ApiClient.mjs +1 -1
  253. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/infrastructure/HttpResponse.mjs +2 -2
  254. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Ack.mjs +2 -2
  255. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/AckedPayload.mjs +2 -2
  256. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Attendance.mjs +2 -2
  257. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/AuthUser.mjs +2 -2
  258. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/BoardParticipant.mjs +2 -2
  259. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ClientUser.mjs +2 -2
  260. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ClientUserParticipant.mjs +2 -2
  261. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ConversationEventPayload.mjs +2 -2
  262. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ConversationMessagePayload.mjs +2 -2
  263. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ConversationTypingPayload.mjs +2 -2
  264. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ConversationUpdatedPayload.mjs +2 -2
  265. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Customer.mjs +2 -2
  266. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/DomainEventPayload.mjs +2 -2
  267. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/EmployeeParticipant.mjs +2 -2
  268. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/EventBusErrorPayload.mjs +2 -2
  269. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/GenericPayload.mjs +2 -2
  270. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/HeartbeatPayload.mjs +2 -2
  271. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/IncomingEventBusMessage.mjs +2 -2
  272. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/InquiryParticipant.mjs +2 -2
  273. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/OrganizationCustomer.mjs +2 -2
  274. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/OrganizationParticipant.mjs +2 -2
  275. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/OrganizationResident.mjs +2 -2
  276. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Participant.mjs +2 -2
  277. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/PersonCustomer.mjs +2 -2
  278. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/PersonParticipant.mjs +2 -2
  279. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/PersonResident.mjs +2 -2
  280. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/PersonUser.mjs +2 -2
  281. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Ping.mjs +2 -2
  282. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Pong.mjs +2 -2
  283. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ReplayCompletePayload.mjs +2 -2
  284. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Resident.mjs +2 -2
  285. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ResidentRelationshipAggregate.mjs +2 -2
  286. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/ResidentRelationshipPeriod.mjs +2 -2
  287. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextAckedPayload.mjs +2 -2
  288. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextClose.mjs +2 -2
  289. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextErrorPayload.mjs +2 -2
  290. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextOpen.mjs +2 -2
  291. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextOpenedPayload.mjs +2 -2
  292. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextPresence.mjs +2 -2
  293. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextPresencePayload.mjs +2 -2
  294. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextSyncedPayload.mjs +2 -2
  295. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextUpdate.mjs +2 -2
  296. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SharedTextUpdatePayload.mjs +2 -2
  297. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Subscribe.mjs +2 -2
  298. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SubscribedPayload.mjs +2 -2
  299. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SubscriptionEndedPayload.mjs +2 -2
  300. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/SupplierContactParticipant.mjs +2 -2
  301. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Typing.mjs +2 -2
  302. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/Unsubscribe.mjs +2 -2
  303. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/api/gen/models/WebSocketPayload.mjs +2 -2
  304. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/auth/Auth.mjs +2 -2
  305. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/auth/SignInResult.mjs +2 -2
  306. package/solibo-sdk-sdk-core/no/solibo/oss/sdk/telemetry/SoliboOpenTelemetry.mjs +1 -1
  307. package/solibo-sdk-sdk.d.mts +22 -1
  308. package/solibo-cycles/kotlinx-coroutines-core-16.mjs +0 -5952
  309. package/solibo-cycles/kotlinx-io-kotlinx-io-core-19.mjs +0 -649
  310. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-core-21.mjs +0 -4140
  311. package/solibo-cycles/kotlinx-serialization-kotlinx-serialization-json-25.mjs +0 -255
  312. package/solibo-cycles/ktor-ktor-client-core-28.mjs +0 -3147
  313. package/solibo-cycles/ktor-ktor-io-32.mjs +0 -3020
  314. package/solibo-cycles/ktor-ktor-utils-34.mjs +0 -601
  315. package/solibo-cycles/solibo-sdk-sdk-api-resident-42.mjs +0 -1398
  316. package/solibo-cycles/solibo-sdk-sdk-core-46.mjs +0 -2166
  317. /package/solibo-cycles/{KotlinBigInteger-bignum-15.mjs → KotlinBigInteger-bignum-16.mjs} +0 -0
  318. /package/solibo-cycles/{ktor-ktor-websockets-37.mjs → ktor-ktor-websockets-38.mjs} +0 -0
  319. /package/solibo-cycles/{solibo-sdk-sdk-api-communication-38.mjs → solibo-sdk-sdk-api-communication-39.mjs} +0 -0
  320. /package/solibo-cycles/{solibo-sdk-sdk-api-follow-up-40.mjs → solibo-sdk-sdk-api-follow-up-41.mjs} +0 -0
  321. /package/solibo-cycles/{solibo-sdk-sdk-api-invoicing-41.mjs → solibo-sdk-sdk-api-invoicing-42.mjs} +0 -0
  322. /package/solibo-cycles/{solibo-sdk-sdk-api-third-party-information-45.mjs → solibo-sdk-sdk-api-third-party-information-46.mjs} +0 -0
@@ -1,213 +1,2551 @@
1
- // Generated by sdk/scripts/post-process-per-file.js from an import cycle of 2 files; see collapseCycles.
2
- // build/packages/js/ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngine.mjs
1
+ // Generated by sdk/scripts/post-process-per-file.js from an import cycle of 10 files; see collapseCycles.
2
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/request/HttpRequest.mjs
3
3
  import {
4
- get_HttpResponseCancelled3685lnxbzknld as get_HttpResponseCancelled,
5
- get_HttpRequestIsReadyForSending2qftypei374ml as get_HttpRequestIsReadyForSending,
6
- get_HttpResponseReceived23ai4hzotyx3a as get_HttpResponseReceived
7
- } from "../ktor-ktor-client-core/io/ktor/client/utils/ClientEvents.mjs";
8
- import { Unit_instance3kz1zqli6gr1r as Unit_instance } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
4
+ protoOf180f3jzyo7rfj as protoOf,
5
+ toString1pkumu07cwy4m as toString
6
+ } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
9
7
  import {
10
- Key_instancepi2bbb0csu5f as Key_instance,
11
- get_job2zvlvce9o9a29 as get_job,
12
- Job13y4jkazwjho0 as Job
13
- } from "../kotlinx-coroutines-core/kotlinx/coroutines/Job.mjs";
8
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion,
9
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass,
10
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface
11
+ } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
12
+ import { VOID3gxj6tk5isa35 as VOID } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
13
+ import { LinkedHashMap_init_$Create$s27yccuovnls as LinkedHashMap_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/collections/LinkedHashMap.mjs";
14
14
  import {
15
- toString1pkumu07cwy4m as toString,
16
- protoOf180f3jzyo7rfj as protoOf
17
- } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
18
- import { IllegalArgumentException_init_$Create$1gox8sdqs91jy as IllegalArgumentException_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
19
- import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
20
- import { THROW_CCE2g6jy02ryeudk as THROW_CCE } from "../kotlin-kotlin-stdlib/kotlin/hacks.mjs";
21
- import { PipelineContext34fsb0mycu471 as PipelineContext } from "../ktor-ktor-utils/io/ktor/util/pipeline/PipelineContext.mjs";
22
- import { HttpRequestBuilder15f2nnx9sjuv1 as HttpRequestBuilder } from "../ktor-ktor-client-core/io/ktor/client/request/HttpRequest.mjs";
23
- import { PrimitiveClasses_getInstance13wbaztpz3e2d as PrimitiveClasses_getInstance } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/primitives.mjs";
24
- import { arrayOf1akklvh2at202 as arrayOf } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
15
+ URLBuilder2mz8zkz4u9ray as URLBuilder,
16
+ set2p30ouy3vdvg5 as set
17
+ } from "../ktor-ktor-http/io/ktor/http/URLBuilder.mjs";
18
+ import { Companion_getInstance29j9s2wnmk34z as Companion_getInstance } from "../ktor-ktor-http/io/ktor/http/HttpMethod.mjs";
19
+ import { HeadersBuilder3h7sn3kkvu98m as HeadersBuilder } from "../ktor-ktor-http/io/ktor/http/Headers.mjs";
20
+ import { EmptyContent_getInstance1v4yj3cymlz7 as EmptyContent_getInstance } from "../ktor-ktor-client-core/io/ktor/client/utils/Content.mjs";
21
+ import { SupervisorJobythnfxkr3jxc as SupervisorJob } from "../kotlinx-coroutines-core/kotlinx/coroutines/Supervisor.mjs";
22
+ import { AttributesJsFn25rjfgcprgprf as AttributesJsFn } from "../ktor-ktor-utils/io/ktor/util/Attributes.web.mjs";
23
+ import { get_BodyTypeAttributeKey1jqpsdtzeru4e as get_BodyTypeAttributeKey } from "../ktor-ktor-client-core/io/ktor/client/request/RequestBody.mjs";
24
+ import { Unit_instance3kz1zqli6gr1r as Unit_instance } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
25
+ import { OutgoingContent3t2ohmyam9o76 as OutgoingContent } from "../ktor-ktor-http/io/ktor/http/content/OutgoingContent.mjs";
26
+ import { IllegalStateException_init_$Create$38ax6c90susjc as IllegalStateException_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
27
+ import { takeFromkqlcz7c6dx2r as takeFrom } from "../ktor-ktor-http/io/ktor/http/URLUtils.mjs";
28
+ import { appendAlltwnjnu28pmtx as appendAll } from "../ktor-ktor-utils/io/ktor/util/StringValues.mjs";
25
29
  import {
26
- createKType31ecntyyaay3k as createKType,
27
- getStarKTypeProjection316vzroubdy0t as getStarKTypeProjection
28
- } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
30
+ putAll10o0q8e6mgnzr as putAll,
31
+ AttributeKey3aq8ytwgx54f7 as AttributeKey
32
+ } from "../ktor-ktor-utils/io/ktor/util/Attributes.mjs";
33
+ import { CoroutineScopefcb5f5dwqcas as CoroutineScope } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs";
34
+ import { emptySetcxexqki71qfa as emptySet } from "../kotlin-kotlin-stdlib/kotlin/collections/Sets.mjs";
35
+ import { GMTDate36bhedawynxlf as GMTDate } from "../ktor-ktor-utils/io/ktor/util/date/DateJs.mjs";
36
+ import { takeFrom3rd40szpqy350 as takeFrom_0 } from "../ktor-ktor-http/io/ktor/http/URLParser.mjs";
37
+ import { ClientUpgradeContent299vg0lx1tyfp as ClientUpgradeContent } from "../ktor-ktor-client-core/io/ktor/client/request/ClientUpgradeContent.mjs";
38
+ import { getKClass3t8tygqu4lcxf as getKClass } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
39
+ import { isInterface3d6p8outrmvmk as isInterface } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
40
+ import { arrayOf1akklvh2at202 as arrayOf } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
41
+ import { createKType31ecntyyaay3k as createKType } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
29
42
  import { TypeInfo2nbxsuf4v8os2 as TypeInfo } from "../ktor-ktor-utils/io/ktor/util/reflect/Type.mjs";
43
+ function get_ResponseAdapterAttributeKey() {
44
+ _init_properties_HttpRequest_kt__813lx1();
45
+ return ResponseAdapterAttributeKey;
46
+ }
47
+ var ResponseAdapterAttributeKey;
48
+ var CompanionClass;
49
+ function Companion() {
50
+ if (CompanionClass === VOID) {
51
+ let $ = function() {
52
+ };
53
+ initMetadataForCompanion($);
54
+ CompanionClass = $;
55
+ }
56
+ return CompanionClass;
57
+ }
58
+ var Companion_instance;
59
+ function Companion_getInstance_0() {
60
+ return Companion_instance;
61
+ }
62
+ function HttpRequestBuilder$setCapability$lambda() {
63
+ return LinkedHashMap_init_$Create$();
64
+ }
65
+ var HttpRequestBuilderClass;
66
+ function HttpRequestBuilder() {
67
+ if (HttpRequestBuilderClass === VOID) {
68
+ let $ = function() {
69
+ this.url_1 = new (URLBuilder())();
70
+ this.method_1 = Companion_getInstance().Get_1;
71
+ this.headers_1 = new (HeadersBuilder())();
72
+ this.body_1 = EmptyContent_getInstance();
73
+ this.executionContext_1 = SupervisorJob();
74
+ this.attributes_1 = AttributesJsFn(true);
75
+ };
76
+ initMetadataForClass($, "HttpRequestBuilder", HttpRequestBuilder);
77
+ protoOf($).get_headers_ef25jx_k$ = function() {
78
+ return this.headers_1;
79
+ };
80
+ protoOf($).set_bodyType_8pgqkl_k$ = function(value) {
81
+ if (!(value == null)) {
82
+ this.attributes_1.put_gkntno_k$(get_BodyTypeAttributeKey(), value);
83
+ } else {
84
+ this.attributes_1.remove_2btyex_k$(get_BodyTypeAttributeKey());
85
+ }
86
+ };
87
+ protoOf($).get_bodyType_3n7prv_k$ = function() {
88
+ return this.attributes_1.getOrNull_6mjt1v_k$(get_BodyTypeAttributeKey());
89
+ };
90
+ protoOf($).url_gkqa8r_k$ = function(block) {
91
+ return block(this.url_1, this.url_1);
92
+ };
93
+ protoOf($).build_1k0s4u_k$ = function() {
94
+ var tmp = this.url_1.build_1k0s4u_k$();
95
+ var tmp_0 = this.method_1;
96
+ var tmp_1 = this.headers_1.build_1k0s4u_k$();
97
+ var tmp_2 = this.body_1;
98
+ var tmp0_elvis_lhs = tmp_2 instanceof OutgoingContent() ? tmp_2 : null;
99
+ var tmp_3;
100
+ if (tmp0_elvis_lhs == null) {
101
+ var message = "No request transformation found: " + toString(this.body_1);
102
+ throw IllegalStateException_init_$Create$(toString(message));
103
+ } else {
104
+ tmp_3 = tmp0_elvis_lhs;
105
+ }
106
+ return new (HttpRequestData())(tmp, tmp_0, tmp_1, tmp_3, this.executionContext_1, this.attributes_1);
107
+ };
108
+ protoOf($).takeFromWithExecutionContext_gp1ep9_k$ = function(builder) {
109
+ this.executionContext_1 = builder.executionContext_1;
110
+ return this.takeFrom_mkv7jk_k$(builder);
111
+ };
112
+ protoOf($).takeFrom_mkv7jk_k$ = function(builder) {
113
+ this.method_1 = builder.method_1;
114
+ this.body_1 = builder.body_1;
115
+ this.set_bodyType_8pgqkl_k$(builder.get_bodyType_3n7prv_k$());
116
+ takeFrom(this.url_1, builder.url_1);
117
+ this.url_1.encodedPathSegments_1 = this.url_1.encodedPathSegments_1;
118
+ appendAll(this.headers_1, builder.headers_1);
119
+ putAll(this.attributes_1, builder.attributes_1);
120
+ return this;
121
+ };
122
+ protoOf($).setCapability_di4fgr_k$ = function(key, capability) {
123
+ var tmp = get_ENGINE_CAPABILITIES_KEY();
124
+ var capabilities = this.attributes_1.computeIfAbsent_c4qp5i_k$(tmp, HttpRequestBuilder$setCapability$lambda);
125
+ capabilities.put_4fpzoq_k$(key, capability);
126
+ };
127
+ protoOf($).getCapabilityOrNull_welm9h_k$ = function(key) {
128
+ var tmp0_safe_receiver = this.attributes_1.getOrNull_6mjt1v_k$(get_ENGINE_CAPABILITIES_KEY());
129
+ return tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_wei43m_k$(key);
130
+ };
131
+ HttpRequestBuilderClass = $;
132
+ }
133
+ return HttpRequestBuilderClass;
134
+ }
135
+ function get_coroutineContext() {
136
+ return this.get_call_wojxrb_k$().get_coroutineContext_115oqo_k$();
137
+ }
138
+ var HttpRequestClass;
139
+ function HttpRequest() {
140
+ if (HttpRequestClass === VOID) {
141
+ let $ = function() {
142
+ };
143
+ initMetadataForInterface($, "HttpRequest", VOID, VOID, [CoroutineScope()]);
144
+ HttpRequestClass = $;
145
+ }
146
+ return HttpRequestClass;
147
+ }
148
+ function headers(_this__u8e3s4, block) {
149
+ _init_properties_HttpRequest_kt__813lx1();
150
+ var this_0 = _this__u8e3s4.get_headers_ef25jx_k$();
151
+ block(this_0);
152
+ return this_0;
153
+ }
154
+ var HttpRequestDataClass;
155
+ function HttpRequestData() {
156
+ if (HttpRequestDataClass === VOID) {
157
+ let $ = function(url2, method, headers2, body, executionContext, attributes) {
158
+ this.url_1 = url2;
159
+ this.method_1 = method;
160
+ this.headers_1 = headers2;
161
+ this.body_1 = body;
162
+ this.executionContext_1 = executionContext;
163
+ this.attributes_1 = attributes;
164
+ var tmp = this;
165
+ var tmp0_safe_receiver = this.attributes_1.getOrNull_6mjt1v_k$(get_ENGINE_CAPABILITIES_KEY());
166
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_keys_wop4xp_k$();
167
+ tmp.requiredCapabilities_1 = tmp1_elvis_lhs == null ? emptySet() : tmp1_elvis_lhs;
168
+ };
169
+ initMetadataForClass($, "HttpRequestData");
170
+ protoOf($).toString = function() {
171
+ return "HttpRequestData(url=" + this.url_1.toString() + ", method=" + this.method_1.toString() + ")";
172
+ };
173
+ HttpRequestDataClass = $;
174
+ }
175
+ return HttpRequestDataClass;
176
+ }
177
+ var HttpResponseDataClass;
178
+ function HttpResponseData() {
179
+ if (HttpResponseDataClass === VOID) {
180
+ let $ = function(statusCode, requestTime, headers2, version, body, callContext) {
181
+ this.statusCode_1 = statusCode;
182
+ this.requestTime_1 = requestTime;
183
+ this.headers_1 = headers2;
184
+ this.version_1 = version;
185
+ this.body_1 = body;
186
+ this.callContext_1 = callContext;
187
+ this.responseTime_1 = GMTDate();
188
+ };
189
+ initMetadataForClass($, "HttpResponseData");
190
+ protoOf($).toString = function() {
191
+ return "HttpResponseData=(statusCode=" + this.statusCode_1.toString() + ")";
192
+ };
193
+ HttpResponseDataClass = $;
194
+ }
195
+ return HttpResponseDataClass;
196
+ }
197
+ var ResponseAdapterClass;
198
+ function ResponseAdapter() {
199
+ if (ResponseAdapterClass === VOID) {
200
+ let $ = function() {
201
+ };
202
+ initMetadataForInterface($, "ResponseAdapter");
203
+ ResponseAdapterClass = $;
204
+ }
205
+ return ResponseAdapterClass;
206
+ }
207
+ function url(_this__u8e3s4, scheme, host, port, path, block) {
208
+ scheme = scheme === VOID ? null : scheme;
209
+ host = host === VOID ? null : host;
210
+ port = port === VOID ? null : port;
211
+ path = path === VOID ? null : path;
212
+ var tmp;
213
+ if (block === VOID) {
214
+ tmp = url$lambda;
215
+ } else {
216
+ tmp = block;
217
+ }
218
+ block = tmp;
219
+ _init_properties_HttpRequest_kt__813lx1();
220
+ set(_this__u8e3s4.url_1, scheme, host, port, path, block);
221
+ }
222
+ function url_0(_this__u8e3s4, urlString) {
223
+ _init_properties_HttpRequest_kt__813lx1();
224
+ takeFrom_0(_this__u8e3s4.url_1, urlString);
225
+ }
226
+ function isUpgradeRequest(_this__u8e3s4) {
227
+ _init_properties_HttpRequest_kt__813lx1();
228
+ var tmp = _this__u8e3s4.body_1;
229
+ return tmp instanceof ClientUpgradeContent();
230
+ }
231
+ function url$lambda(_this__u8e3s4) {
232
+ _init_properties_HttpRequest_kt__813lx1();
233
+ return Unit_instance;
234
+ }
235
+ var properties_initialized_HttpRequest_kt_zh09pz;
236
+ function _init_properties_HttpRequest_kt__813lx1() {
237
+ if (!properties_initialized_HttpRequest_kt_zh09pz) {
238
+ properties_initialized_HttpRequest_kt_zh09pz = true;
239
+ var name = "ResponseAdapterAttributeKey";
240
+ var tmp = getKClass(ResponseAdapter());
241
+ var tmp_0 = false ? isInterface(null, ResponseAdapter()) : false;
242
+ var tmp_1;
243
+ try {
244
+ tmp_1 = createKType(getKClass(ResponseAdapter()), arrayOf([]), false);
245
+ } catch ($p) {
246
+ var tmp_2;
247
+ if ($p instanceof Error) {
248
+ var _unused_var__etf5q3 = $p;
249
+ tmp_2 = null;
250
+ } else {
251
+ throw $p;
252
+ }
253
+ tmp_1 = tmp_2;
254
+ }
255
+ var tmp$ret$2 = tmp_1;
256
+ var tmp$ret$1 = new (TypeInfo())(tmp, tmp_0, tmp$ret$2);
257
+ ResponseAdapterAttributeKey = new (AttributeKey())(name, tmp$ret$1);
258
+ }
259
+ }
260
+ Companion_instance = new (Companion())();
261
+
262
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/request/DefaultHttpRequest.mjs
263
+ import { protoOf180f3jzyo7rfj as protoOf2 } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
264
+ import { initMetadataForClassbxx6q50dy2s7 as initMetadataForClass2 } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
265
+ import { VOID3gxj6tk5isa35 as VOID2 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
266
+ var DefaultHttpRequestClass;
267
+ function DefaultHttpRequest() {
268
+ if (DefaultHttpRequestClass === VOID2) {
269
+ let $ = function(call, data) {
270
+ this.call_1 = call;
271
+ this.method_1 = data.method_1;
272
+ this.url_1 = data.url_1;
273
+ this.content_1 = data.body_1;
274
+ this.headers_1 = data.headers_1;
275
+ this.attributes_1 = data.attributes_1;
276
+ };
277
+ initMetadataForClass2($, "DefaultHttpRequest", VOID2, VOID2, [HttpRequest()]);
278
+ protoOf2($).get_call_wojxrb_k$ = function() {
279
+ return this.call_1;
280
+ };
281
+ protoOf2($).get_coroutineContext_115oqo_k$ = function() {
282
+ return this.get_call_wojxrb_k$().get_coroutineContext_115oqo_k$();
283
+ };
284
+ protoOf2($).get_method_gl8esq_k$ = function() {
285
+ return this.method_1;
286
+ };
287
+ protoOf2($).get_url_18iuii_k$ = function() {
288
+ return this.url_1;
289
+ };
290
+ protoOf2($).get_content_h02jrk_k$ = function() {
291
+ return this.content_1;
292
+ };
293
+ protoOf2($).get_headers_ef25jx_k$ = function() {
294
+ return this.headers_1;
295
+ };
296
+ protoOf2($).get_attributes_dgqof4_k$ = function() {
297
+ return this.attributes_1;
298
+ };
299
+ DefaultHttpRequestClass = $;
300
+ }
301
+ return DefaultHttpRequestClass;
302
+ }
303
+
304
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/call/HttpClientCall.mjs
305
+ import { DefaultHttpResponse2wnrinzo0twhn as DefaultHttpResponse } from "../ktor-ktor-client-core/io/ktor/client/statement/DefaultHttpResponse.mjs";
306
+ import { Unit_instance3kz1zqli6gr1r as Unit_instance2 } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
307
+ import { ByteReadChannel2wzou76jce72d as ByteReadChannel } from "../ktor-ktor-io/io/ktor/utils/io/ByteReadChannel.mjs";
308
+ import { isInterface3d6p8outrmvmk as isInterface2 } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
30
309
  import {
31
- OutgoingContent3t2ohmyam9o76 as OutgoingContent,
32
- NullBody_instance22vwyocs8eppk as NullBody_instance
33
- } from "../ktor-ktor-http/io/ktor/http/content/OutgoingContent.mjs";
34
- import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
35
- import { HttpClientCall_init_$Create$l01lehg8js2a as HttpClientCall_init_$Create$ } from "../ktor-ktor-client-core/io/ktor/client/call/HttpClientCall.mjs";
310
+ protoOf180f3jzyo7rfj as protoOf3,
311
+ objectCreate1ve4bgxiu4x98 as objectCreate,
312
+ equals2au1ep9vhcato as equals,
313
+ captureStack1fzi4aczwc4hg as captureStack,
314
+ defineProp3ur6h3slcvq4x as defineProp,
315
+ toString1pkumu07cwy4m as toString2
316
+ } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
317
+ import { PrimitiveClasses_getInstance13wbaztpz3e2d as PrimitiveClasses_getInstance } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/primitives.mjs";
318
+ import { arrayOf1akklvh2at202 as arrayOf2 } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
319
+ import { createKType31ecntyyaay3k as createKType2 } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
320
+ import { TypeInfo2nbxsuf4v8os2 as TypeInfo2 } from "../ktor-ktor-utils/io/ktor/util/reflect/Type.mjs";
321
+ import { AttributeKey3aq8ytwgx54f7 as AttributeKey2 } from "../ktor-ktor-utils/io/ktor/util/Attributes.mjs";
36
322
  import {
37
- initMetadataForLambda3af3he42mmnh as initMetadataForLambda,
323
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion2,
38
324
  initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine,
39
- initMetadataForInterface1egvbzx539z91 as initMetadataForInterface
325
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass3
40
326
  } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
41
- import { VOID3gxj6tk5isa35 as VOID } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
42
- import { constructCallableReference23y65rf941mch as constructCallableReference } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
43
- import { CoroutineScopefcb5f5dwqcas as CoroutineScope } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs";
44
- import { isInterface3d6p8outrmvmk as isInterface } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
45
- import { KtorCallContextElementudwxlrp3zgdl as KtorCallContextElement } from "../ktor-ktor-client-core/io/ktor/client/engine/Utils.mjs";
46
- import { asyncz02dsa2nb2zt as async } from "../kotlinx-coroutines-core/kotlinx/coroutines/Builders.common.mjs";
47
- import { emptySetcxexqki71qfa as emptySet } from "../kotlin-kotlin-stdlib/kotlin/collections/Sets.mjs";
48
- import { Phases_getInstance2rx62p874ogj4 as Phases_getInstance } from "../ktor-ktor-client-core/io/ktor/client/request/HttpRequestPipeline.mjs";
49
- import { AutoCloseable1l5p57f9lp7kv as AutoCloseable } from "../kotlin-kotlin-stdlib/kotlin/AutoCloseableJs.mjs";
50
- import { ArrayList_init_$Create$2xrifdqz5xirg as ArrayList_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/collections/ArrayListJs.mjs";
327
+ import { VOID3gxj6tk5isa35 as VOID3 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
328
+ import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
329
+ import { instanceOf2cx3k00nj6a0p as instanceOf } from "../ktor-ktor-utils/io/ktor/util/reflect/TypeInfo.web.mjs";
330
+ import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
331
+ import { HttpResponseContainer3r9yzy4mwwvc9 as HttpResponseContainer } from "../ktor-ktor-client-core/io/ktor/client/statement/HttpResponsePipeline.mjs";
332
+ import { NullBody_instance22vwyocs8eppk as NullBody_instance } from "../ktor-ktor-http/io/ktor/http/content/OutgoingContent.mjs";
333
+ import { getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
51
334
  import {
52
- HttpHeaders_getInstance1avhj7ffsen7f as HttpHeaders_getInstance,
53
- UnsafeHeaderException3ncvrrp48xjzq as UnsafeHeaderException
54
- } from "../ktor-ktor-http/io/ktor/http/HttpHeaders.mjs";
335
+ cancel2ztysw4v4hav6 as cancel,
336
+ CoroutineScopefcb5f5dwqcas as CoroutineScope2
337
+ } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs";
338
+ import { ensureNotNull1e947j3ixpazm as ensureNotNull } from "../kotlin-kotlin-stdlib/kotlin/hacks.mjs";
339
+ import { atomic$boolean$1iggki4z65a2h as atomic$boolean$1 } from "../kotlinx-atomicfu/kotlinx/atomicfu/AtomicFU.mjs";
340
+ import { throwUninitializedPropertyAccessException14fok093f3k3t as throwUninitializedPropertyAccessException } from "../kotlin-kotlin-stdlib/kotlin/internal/ThrowHelpers.mjs";
55
341
  import {
56
- CancellationException3b36o9qz53rgr as CancellationException,
57
- CancellationException_init_$Create$1flhbcsrur0zx as CancellationException_init_$Create$
58
- } from "../kotlin-kotlin-stdlib/kotlin/coroutines/cancellation/CancellationException.mjs";
59
- import { CoroutineName2g5zosw74tf0f as CoroutineName } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineName.mjs";
60
- import { HttpClientConfigo6p492ed655g as HttpClientConfig } from "../ktor-ktor-client-core/io/ktor/client/HttpClientConfig.mjs";
61
- import { getKClass3t8tygqu4lcxf as getKClass } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
62
- import { AttributeKey3aq8ytwgx54f7 as AttributeKey } from "../ktor-ktor-utils/io/ktor/util/Attributes.mjs";
63
- function get_CALL_COROUTINE() {
64
- _init_properties_HttpClientEngine_kt__h91z5h();
65
- return CALL_COROUTINE;
66
- }
67
- var CALL_COROUTINE;
68
- function get_CLIENT_CONFIG() {
69
- _init_properties_HttpClientEngine_kt__h91z5h();
70
- return CLIENT_CONFIG;
71
- }
72
- var CLIENT_CONFIG;
73
- function HttpClientEngine$install$slambda$lambda($client, $response) {
74
- return function(it) {
75
- var tmp;
76
- if (!(it == null)) {
77
- $client.monitor_1.raise_3e7w7u_k$(get_HttpResponseCancelled(), $response);
78
- tmp = Unit_instance;
79
- }
80
- return Unit_instance;
81
- };
342
+ IllegalStateExceptionkoljg5n0nrlr as IllegalStateException,
343
+ IllegalStateException_init_$Init$38llzty5natso as IllegalStateException_init_$Init$,
344
+ UnsupportedOperationException2tkumpmhredt3 as UnsupportedOperationException,
345
+ UnsupportedOperationException_init_$Init$34t5zk7ve7eye as UnsupportedOperationException_init_$Init$
346
+ } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
347
+ import { get_request3dwcif5y0fvf1 as get_request } from "../ktor-ktor-client-core/io/ktor/client/statement/HttpResponse.mjs";
348
+ import { trimIndent1qytc1wvt8suh as trimIndent } from "../kotlin-kotlin-stdlib/kotlin/text/Indent.mjs";
349
+ function HttpClientCall_init_$Init$(client, requestData, responseData, $this) {
350
+ HttpClientCall().call($this, client);
351
+ $this.request_1 = new (DefaultHttpRequest())($this, requestData);
352
+ $this.response_1 = new (DefaultHttpResponse())($this, responseData);
353
+ $this.get_attributes_dgqof4_k$().remove_2btyex_k$(Companion_getInstance2().CustomResponse_1);
354
+ var tmp = responseData.body_1;
355
+ if (!isInterface2(tmp, ByteReadChannel())) {
356
+ $this.get_attributes_dgqof4_k$().put_gkntno_k$(Companion_getInstance2().CustomResponse_1, responseData.body_1);
357
+ }
358
+ return $this;
359
+ }
360
+ function HttpClientCall_init_$Create$(client, requestData, responseData) {
361
+ return HttpClientCall_init_$Init$(client, requestData, responseData, objectCreate(protoOf3(HttpClientCall())));
362
+ }
363
+ var CompanionClass2;
364
+ function Companion2() {
365
+ if (CompanionClass2 === VOID3) {
366
+ let $ = function() {
367
+ Companion_instance2 = this;
368
+ var tmp = this;
369
+ var name = "CustomResponse";
370
+ var tmp_0 = PrimitiveClasses_getInstance().get_anyClass_x0jl4l_k$();
371
+ var tmp_1 = false;
372
+ var tmp_2;
373
+ try {
374
+ tmp_2 = createKType2(PrimitiveClasses_getInstance().get_anyClass_x0jl4l_k$(), arrayOf2([]), false);
375
+ } catch ($p) {
376
+ var tmp_3;
377
+ if ($p instanceof Error) {
378
+ var _unused_var__etf5q3 = $p;
379
+ tmp_3 = null;
380
+ } else {
381
+ throw $p;
382
+ }
383
+ tmp_2 = tmp_3;
384
+ }
385
+ var tmp$ret$2 = tmp_2;
386
+ var tmp$ret$1 = new (TypeInfo2())(tmp_0, tmp_1, tmp$ret$2);
387
+ tmp.CustomResponse_1 = new (AttributeKey2())(name, tmp$ret$1);
388
+ };
389
+ initMetadataForCompanion2($);
390
+ CompanionClass2 = $;
391
+ }
392
+ return CompanionClass2;
393
+ }
394
+ var Companion_instance2;
395
+ function Companion_getInstance2() {
396
+ if (Companion_instance2 == null)
397
+ new (Companion2())();
398
+ return Companion_instance2;
399
+ }
400
+ var $bodyNullableCOROUTINE$Class;
401
+ function $bodyNullableCOROUTINE$() {
402
+ if ($bodyNullableCOROUTINE$Class === VOID3) {
403
+ let $ = function(_this__u8e3s4, info, resultContinuation) {
404
+ CoroutineImpl().call(this, resultContinuation);
405
+ this._this__u8e3s4__1 = _this__u8e3s4;
406
+ this.info_1 = info;
407
+ };
408
+ initMetadataForCoroutine($, CoroutineImpl());
409
+ protoOf3($).doResume_5yljmg_k$ = function() {
410
+ var suspendResult = this.result_1;
411
+ $sm: do
412
+ try {
413
+ var tmp = this.state_1;
414
+ switch (tmp) {
415
+ case 0:
416
+ this.exceptionState_1 = 5;
417
+ this.exceptionState_1 = 4;
418
+ if (instanceOf(this._this__u8e3s4__1.get_response_xlk07e_k$(), this.info_1.type_1))
419
+ return this._this__u8e3s4__1.get_response_xlk07e_k$();
420
+ if (!this._this__u8e3s4__1.get_allowDoubleReceive_um1gnm_k$() && !get_isSaved(this._this__u8e3s4__1.get_response_xlk07e_k$()) && !this._this__u8e3s4__1.received_1.atomicfu$compareAndSet(false, true)) {
421
+ throw new (DoubleReceiveException())(this._this__u8e3s4__1);
422
+ }
423
+ var tmp0_elvis_lhs = this._this__u8e3s4__1.get_attributes_dgqof4_k$().getOrNull_6mjt1v_k$(Companion_getInstance2().CustomResponse_1);
424
+ if (tmp0_elvis_lhs == null) {
425
+ this.state_1 = 1;
426
+ suspendResult = this._this__u8e3s4__1.getResponseContent_9qb5np_k$(this);
427
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
428
+ return suspendResult;
429
+ }
430
+ continue $sm;
431
+ } else {
432
+ this.WHEN_RESULT0__1 = tmp0_elvis_lhs;
433
+ this.state_1 = 2;
434
+ continue $sm;
435
+ }
436
+ case 1:
437
+ this.WHEN_RESULT0__1 = suspendResult;
438
+ this.state_1 = 2;
439
+ continue $sm;
440
+ case 2:
441
+ var responseData = this.WHEN_RESULT0__1;
442
+ var subject = new (HttpResponseContainer())(this.info_1, responseData);
443
+ this.state_1 = 3;
444
+ suspendResult = this._this__u8e3s4__1.client_1.responsePipeline_1.execute_qsx0hz_k$(this._this__u8e3s4__1, subject, this);
445
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
446
+ return suspendResult;
447
+ }
448
+ continue $sm;
449
+ case 3:
450
+ var this_0 = suspendResult.response_1;
451
+ var tmp_0;
452
+ if (!equals(this_0, NullBody_instance)) {
453
+ tmp_0 = this_0;
454
+ } else {
455
+ tmp_0 = null;
456
+ }
457
+ var result = tmp_0;
458
+ if (!(result == null) && !instanceOf(result, this.info_1.type_1)) {
459
+ var from = getKClassFromExpression(result);
460
+ var to = this.info_1.type_1;
461
+ throw new (NoTransformationFoundException())(this._this__u8e3s4__1.get_response_xlk07e_k$(), from, to);
462
+ }
463
+ return result;
464
+ case 4:
465
+ this.exceptionState_1 = 5;
466
+ var tmp_1 = this.exception_1;
467
+ if (tmp_1 instanceof Error) {
468
+ var cause = this.exception_1;
469
+ cancel(this._this__u8e3s4__1.get_response_xlk07e_k$(), "Receive failed", cause);
470
+ throw cause;
471
+ } else {
472
+ throw this.exception_1;
473
+ }
474
+ case 5:
475
+ throw this.exception_1;
476
+ }
477
+ } catch ($p) {
478
+ var e = $p;
479
+ if (this.exceptionState_1 === 5) {
480
+ throw e;
481
+ } else {
482
+ this.state_1 = this.exceptionState_1;
483
+ this.exception_1 = e;
484
+ }
485
+ }
486
+ while (true);
487
+ };
488
+ $bodyNullableCOROUTINE$Class = $;
489
+ }
490
+ return $bodyNullableCOROUTINE$Class;
491
+ }
492
+ var $bodyCOROUTINE$Class;
493
+ function $bodyCOROUTINE$() {
494
+ if ($bodyCOROUTINE$Class === VOID3) {
495
+ let $ = function(_this__u8e3s4, info, resultContinuation) {
496
+ CoroutineImpl().call(this, resultContinuation);
497
+ this._this__u8e3s4__1 = _this__u8e3s4;
498
+ this.info_1 = info;
499
+ };
500
+ initMetadataForCoroutine($, CoroutineImpl());
501
+ protoOf3($).doResume_5yljmg_k$ = function() {
502
+ var suspendResult = this.result_1;
503
+ $sm: do
504
+ try {
505
+ var tmp = this.state_1;
506
+ switch (tmp) {
507
+ case 0:
508
+ this.exceptionState_1 = 2;
509
+ this.state_1 = 1;
510
+ suspendResult = this._this__u8e3s4__1.bodyNullable_wn8z59_k$(this.info_1, this);
511
+ if (suspendResult === get_COROUTINE_SUSPENDED()) {
512
+ return suspendResult;
513
+ }
514
+ continue $sm;
515
+ case 1:
516
+ var ARGUMENT = suspendResult;
517
+ return ensureNotNull(ARGUMENT);
518
+ case 2:
519
+ throw this.exception_1;
520
+ }
521
+ } catch ($p) {
522
+ var e = $p;
523
+ if (this.exceptionState_1 === 2) {
524
+ throw e;
525
+ } else {
526
+ this.state_1 = this.exceptionState_1;
527
+ this.exception_1 = e;
528
+ }
529
+ }
530
+ while (true);
531
+ };
532
+ $bodyCOROUTINE$Class = $;
533
+ }
534
+ return $bodyCOROUTINE$Class;
535
+ }
536
+ var HttpClientCallClass;
537
+ function HttpClientCall() {
538
+ if (HttpClientCallClass === VOID3) {
539
+ let $ = function(client) {
540
+ Companion_getInstance2();
541
+ this.client_1 = client;
542
+ this.received_1 = atomic$boolean$1(false);
543
+ this.allowDoubleReceive_1 = false;
544
+ };
545
+ initMetadataForClass3($, "HttpClientCall", VOID3, VOID3, [CoroutineScope2()], [0, 1]);
546
+ protoOf3($).get_coroutineContext_115oqo_k$ = function() {
547
+ return this.get_response_xlk07e_k$().get_coroutineContext_115oqo_k$();
548
+ };
549
+ protoOf3($).get_attributes_dgqof4_k$ = function() {
550
+ return this.get_request_jdwg4m_k$().get_attributes_dgqof4_k$();
551
+ };
552
+ protoOf3($).get_request_jdwg4m_k$ = function() {
553
+ var tmp = this.request_1;
554
+ if (!(tmp == null))
555
+ return tmp;
556
+ else {
557
+ throwUninitializedPropertyAccessException("request");
558
+ }
559
+ };
560
+ protoOf3($).get_response_xlk07e_k$ = function() {
561
+ var tmp = this.response_1;
562
+ if (!(tmp == null))
563
+ return tmp;
564
+ else {
565
+ throwUninitializedPropertyAccessException("response");
566
+ }
567
+ };
568
+ protoOf3($).get_allowDoubleReceive_um1gnm_k$ = function() {
569
+ return this.allowDoubleReceive_1;
570
+ };
571
+ protoOf3($).getResponseContent_9qb5np_k$ = function($completion) {
572
+ return this.get_response_xlk07e_k$().get_rawContent_u3f8li_k$();
573
+ };
574
+ protoOf3($).bodyNullable_wn8z59_k$ = function(info, $completion) {
575
+ var tmp = new ($bodyNullableCOROUTINE$())(this, info, $completion);
576
+ tmp.result_1 = Unit_instance2;
577
+ tmp.exception_1 = null;
578
+ return tmp.doResume_5yljmg_k$();
579
+ };
580
+ protoOf3($).body_3ijhx3_k$ = function(info, $completion) {
581
+ var tmp = new ($bodyCOROUTINE$())(this, info, $completion);
582
+ tmp.result_1 = Unit_instance2;
583
+ tmp.exception_1 = null;
584
+ return tmp.doResume_5yljmg_k$();
585
+ };
586
+ protoOf3($).toString = function() {
587
+ return "HttpClientCall[" + this.get_request_jdwg4m_k$().get_url_18iuii_k$().toString() + ", " + this.get_response_xlk07e_k$().get_status_jnf6d7_k$().toString() + "]";
588
+ };
589
+ protoOf3($).setResponse_vjp6c2_k$ = function(response) {
590
+ this.response_1 = response;
591
+ };
592
+ HttpClientCallClass = $;
593
+ }
594
+ return HttpClientCallClass;
595
+ }
596
+ var DoubleReceiveExceptionClass;
597
+ function DoubleReceiveException() {
598
+ if (DoubleReceiveExceptionClass === VOID3) {
599
+ let $ = function(call) {
600
+ IllegalStateException_init_$Init$(this);
601
+ captureStack(this, DoubleReceiveException());
602
+ this.message_1 = "Response already received: " + call.toString();
603
+ delete this.message;
604
+ };
605
+ initMetadataForClass3($, "DoubleReceiveException", VOID3, IllegalStateException());
606
+ protoOf3($).get_message_h23axq_k$ = function() {
607
+ return this.message_1;
608
+ };
609
+ defineProp(protoOf3($), "message", function() {
610
+ return this.get_message_h23axq_k$();
611
+ });
612
+ DoubleReceiveExceptionClass = $;
613
+ }
614
+ return DoubleReceiveExceptionClass;
615
+ }
616
+ var NoTransformationFoundExceptionClass;
617
+ function NoTransformationFoundException() {
618
+ if (NoTransformationFoundExceptionClass === VOID3) {
619
+ let $ = function(response, from, to) {
620
+ UnsupportedOperationException_init_$Init$(this);
621
+ captureStack(this, NoTransformationFoundException());
622
+ this.message_1 = trimIndent("\n Expected response body of the type '" + toString2(to) + "' but was '" + toString2(from) + "'\n In response from `" + get_request(response).get_url_18iuii_k$().toString() + "`\n Response status `" + response.get_status_jnf6d7_k$().toString() + "`\n Response header `ContentType: " + response.get_headers_ef25jx_k$().get_6bo4tg_k$("Content-Type") + "` \n Request header `Accept: " + get_request(response).get_headers_ef25jx_k$().get_6bo4tg_k$("Accept") + "`\n \n You can read how to resolve NoTransformationFoundException at FAQ: \n https://ktor.io/docs/faq.html#no-transformation-found-exception\n ");
623
+ delete this.message;
624
+ };
625
+ initMetadataForClass3($, "NoTransformationFoundException", VOID3, UnsupportedOperationException());
626
+ protoOf3($).get_message_h23axq_k$ = function() {
627
+ return this.message_1;
628
+ };
629
+ defineProp(protoOf3($), "message", function() {
630
+ return this.get_message_h23axq_k$();
631
+ });
632
+ NoTransformationFoundExceptionClass = $;
633
+ }
634
+ return NoTransformationFoundExceptionClass;
635
+ }
636
+
637
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/call/SavedCall.mjs
638
+ import { Unit_instance3kz1zqli6gr1r as Unit_instance3 } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
639
+ import { contentLength2suzxu1lzutku as contentLength } from "../ktor-ktor-http/io/ktor/http/HttpMessageProperties.mjs";
640
+ import { fromInt2ii0rejb1w62w as fromInt } from "../kotlin-kotlin-stdlib/kotlin/js/internal/longAsBigInt/longAsBigInt.mjs";
641
+ import { checkContentLength1q7i15kkn2eie as checkContentLength } from "../ktor-ktor-client-core/io/ktor/client/call/utils.mjs";
642
+ import { protoOf180f3jzyo7rfj as protoOf4 } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
643
+ import {
644
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass4,
645
+ initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine2
646
+ } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
647
+ import { VOID3gxj6tk5isa35 as VOID4 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
648
+ import { HttpResponse1532ob1hsse1y as HttpResponse } from "../ktor-ktor-client-core/io/ktor/client/statement/HttpResponse.mjs";
649
+ import { ByteReadChannel1cb89sbyipkce as ByteReadChannel2 } from "../ktor-ktor-io/io/ktor/utils/io/ByteChannelCtor.mjs";
650
+ import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl2 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
651
+ import { readBuffery45c0omfxhxc as readBuffer } from "../ktor-ktor-io/io/ktor/utils/io/ByteReadChannelOperations.mjs";
652
+ import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED2 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
653
+ import { readByteArray1ri21h2rciakw as readByteArray } from "../kotlinx-io-kotlinx-io-core/kotlinx/io/Sources.mjs";
654
+ function save(_this__u8e3s4, $completion) {
655
+ var tmp = new ($saveCOROUTINE$())(_this__u8e3s4, $completion);
656
+ tmp.result_1 = Unit_instance3;
657
+ tmp.exception_1 = null;
658
+ return tmp.doResume_5yljmg_k$();
659
+ }
660
+ var SavedHttpCallClass;
661
+ function SavedHttpCall() {
662
+ if (SavedHttpCallClass === VOID4) {
663
+ let $ = function(client, request, response, responseBody) {
664
+ HttpClientCall().call(this, client);
665
+ this.responseBody_1 = responseBody;
666
+ this.request_1 = new (SavedHttpRequest())(this, request);
667
+ this.response_1 = new (SavedHttpResponse())(this, this.responseBody_1, response);
668
+ checkContentLength(contentLength(response), fromInt(this.responseBody_1.length), request.get_method_gl8esq_k$());
669
+ this.allowDoubleReceive_2 = true;
670
+ };
671
+ initMetadataForClass4($, "SavedHttpCall", VOID4, HttpClientCall(), VOID4, [0, 1]);
672
+ protoOf4($).get_allowDoubleReceive_um1gnm_k$ = function() {
673
+ return this.allowDoubleReceive_2;
674
+ };
675
+ SavedHttpCallClass = $;
676
+ }
677
+ return SavedHttpCallClass;
678
+ }
679
+ var SavedHttpRequestClass;
680
+ function SavedHttpRequest() {
681
+ if (SavedHttpRequestClass === VOID4) {
682
+ let $ = function(call, origin) {
683
+ this.$$delegate_0__1 = origin;
684
+ this.call_1 = call;
685
+ };
686
+ initMetadataForClass4($, "SavedHttpRequest", VOID4, VOID4, [HttpRequest()]);
687
+ protoOf4($).get_call_wojxrb_k$ = function() {
688
+ return this.call_1;
689
+ };
690
+ protoOf4($).get_coroutineContext_115oqo_k$ = function() {
691
+ return this.$$delegate_0__1.get_coroutineContext_115oqo_k$();
692
+ };
693
+ protoOf4($).get_method_gl8esq_k$ = function() {
694
+ return this.$$delegate_0__1.get_method_gl8esq_k$();
695
+ };
696
+ protoOf4($).get_url_18iuii_k$ = function() {
697
+ return this.$$delegate_0__1.get_url_18iuii_k$();
698
+ };
699
+ protoOf4($).get_attributes_dgqof4_k$ = function() {
700
+ return this.$$delegate_0__1.get_attributes_dgqof4_k$();
701
+ };
702
+ protoOf4($).get_content_h02jrk_k$ = function() {
703
+ return this.$$delegate_0__1.get_content_h02jrk_k$();
704
+ };
705
+ protoOf4($).get_headers_ef25jx_k$ = function() {
706
+ return this.$$delegate_0__1.get_headers_ef25jx_k$();
707
+ };
708
+ SavedHttpRequestClass = $;
709
+ }
710
+ return SavedHttpRequestClass;
711
+ }
712
+ var SavedHttpResponseClass;
713
+ function SavedHttpResponse() {
714
+ if (SavedHttpResponseClass === VOID4) {
715
+ let $ = function(call, body, origin) {
716
+ HttpResponse().call(this);
717
+ this.call_1 = call;
718
+ this.body_1 = body;
719
+ this.status_1 = origin.get_status_jnf6d7_k$();
720
+ this.version_1 = origin.get_version_72w4j3_k$();
721
+ this.requestTime_1 = origin.get_requestTime_wwxhg3_k$();
722
+ this.responseTime_1 = origin.get_responseTime_scfvg7_k$();
723
+ this.headers_1 = origin.get_headers_ef25jx_k$();
724
+ this.coroutineContext_1 = origin.get_coroutineContext_115oqo_k$();
725
+ };
726
+ initMetadataForClass4($, "SavedHttpResponse", VOID4, HttpResponse());
727
+ protoOf4($).get_call_wojxrb_k$ = function() {
728
+ return this.call_1;
729
+ };
730
+ protoOf4($).get_status_jnf6d7_k$ = function() {
731
+ return this.status_1;
732
+ };
733
+ protoOf4($).get_version_72w4j3_k$ = function() {
734
+ return this.version_1;
735
+ };
736
+ protoOf4($).get_requestTime_wwxhg3_k$ = function() {
737
+ return this.requestTime_1;
738
+ };
739
+ protoOf4($).get_responseTime_scfvg7_k$ = function() {
740
+ return this.responseTime_1;
741
+ };
742
+ protoOf4($).get_headers_ef25jx_k$ = function() {
743
+ return this.headers_1;
744
+ };
745
+ protoOf4($).get_coroutineContext_115oqo_k$ = function() {
746
+ return this.coroutineContext_1;
747
+ };
748
+ protoOf4($).get_rawContent_u3f8li_k$ = function() {
749
+ return ByteReadChannel2(this.body_1);
750
+ };
751
+ SavedHttpResponseClass = $;
752
+ }
753
+ return SavedHttpResponseClass;
754
+ }
755
+ var $saveCOROUTINE$Class;
756
+ function $saveCOROUTINE$() {
757
+ if ($saveCOROUTINE$Class === VOID4) {
758
+ let $ = function(_this__u8e3s4, resultContinuation) {
759
+ CoroutineImpl2().call(this, resultContinuation);
760
+ this._this__u8e3s4__1 = _this__u8e3s4;
761
+ };
762
+ initMetadataForCoroutine2($, CoroutineImpl2());
763
+ protoOf4($).doResume_5yljmg_k$ = function() {
764
+ var suspendResult = this.result_1;
765
+ $sm: do
766
+ try {
767
+ var tmp = this.state_1;
768
+ switch (tmp) {
769
+ case 0:
770
+ this.exceptionState_1 = 2;
771
+ var tmp_0 = this._this__u8e3s4__1;
772
+ if (tmp_0 instanceof SavedHttpCall())
773
+ return this._this__u8e3s4__1;
774
+ this.state_1 = 1;
775
+ suspendResult = readBuffer(this._this__u8e3s4__1.get_response_xlk07e_k$().get_rawContent_u3f8li_k$(), this);
776
+ if (suspendResult === get_COROUTINE_SUSPENDED2()) {
777
+ return suspendResult;
778
+ }
779
+ continue $sm;
780
+ case 1:
781
+ var ARGUMENT = suspendResult;
782
+ var responseBody = readByteArray(ARGUMENT);
783
+ return new (SavedHttpCall())(this._this__u8e3s4__1.client_1, this._this__u8e3s4__1.get_request_jdwg4m_k$(), this._this__u8e3s4__1.get_response_xlk07e_k$(), responseBody);
784
+ case 2:
785
+ throw this.exception_1;
786
+ }
787
+ } catch ($p) {
788
+ var e = $p;
789
+ if (this.exceptionState_1 === 2) {
790
+ throw e;
791
+ } else {
792
+ this.state_1 = this.exceptionState_1;
793
+ this.exception_1 = e;
794
+ }
795
+ }
796
+ while (true);
797
+ };
798
+ $saveCOROUTINE$Class = $;
799
+ }
800
+ return $saveCOROUTINE$Class;
801
+ }
802
+
803
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/plugins/SaveBody.mjs
804
+ import { KProperty02ce7r476m8633 as KProperty0 } from "../kotlin-kotlin-stdlib/kotlin/reflect/KPropertyJs.mjs";
805
+ import {
806
+ getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef,
807
+ constructCallableReference23y65rf941mch as constructCallableReference
808
+ } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
809
+ import { VOID3gxj6tk5isa35 as VOID5 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
810
+ import {
811
+ Unit_instance3kz1zqli6gr1r as Unit_instance4,
812
+ Unitkvevlwgzwiuc as Unit
813
+ } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
814
+ import { Exceptiondt2hlxn7j7vw as Exception } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
815
+ import { CancellationException3b36o9qz53rgr as CancellationException } from "../kotlin-kotlin-stdlib/kotlin/coroutines/cancellation/CancellationException.mjs";
816
+ import { protoOf180f3jzyo7rfj as protoOf5 } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
817
+ import {
818
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass5,
819
+ initMetadataForLambda3af3he42mmnh as initMetadataForLambda
820
+ } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
821
+ import { KtorSimpleLogger1xdphsp5l4e48 as KtorSimpleLogger } from "../ktor-ktor-utils/io/ktor/util/logging/KtorSimpleLogger.web.mjs";
822
+ import { Phases_getInstance1g6ty5i2ownsw as Phases_getInstance } from "../ktor-ktor-client-core/io/ktor/client/statement/HttpResponsePipeline.mjs";
823
+ import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl3 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
824
+ import { THROW_CCE2g6jy02ryeudk as THROW_CCE } from "../kotlin-kotlin-stdlib/kotlin/hacks.mjs";
825
+ import { PipelineContext34fsb0mycu471 as PipelineContext } from "../ktor-ktor-utils/io/ktor/util/pipeline/PipelineContext.mjs";
826
+ import { HttpResponse1532ob1hsse1y as HttpResponse2 } from "../ktor-ktor-client-core/io/ktor/client/statement/HttpResponse.mjs";
827
+ import { get_isTraceEnabled82xibuu04nxp as get_isTraceEnabled } from "../ktor-ktor-utils/io/ktor/util/logging/Logger.web.mjs";
828
+ import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED3 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
829
+ import { getKClass3t8tygqu4lcxf as getKClass2 } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
830
+ import { arrayOf1akklvh2at202 as arrayOf3 } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
831
+ import { createKType31ecntyyaay3k as createKType3 } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
832
+ import { TypeInfo2nbxsuf4v8os2 as TypeInfo3 } from "../ktor-ktor-utils/io/ktor/util/reflect/Type.mjs";
833
+ import { AttributeKey3aq8ytwgx54f7 as AttributeKey3 } from "../ktor-ktor-utils/io/ktor/util/Attributes.mjs";
834
+ import { lazy2hsh8ze7j6ikd as lazy } from "../kotlin-kotlin-stdlib/kotlin/kotlin.mjs";
835
+ import {
836
+ createClientPlugin16sdkdabbewya as createClientPlugin,
837
+ createClientPluginjwpvufjows5r as createClientPlugin_0
838
+ } from "../ktor-ktor-client-core/io/ktor/client/plugins/api/CreatePluginUtils.mjs";
839
+ function get_SKIP_SAVE_BODY() {
840
+ _init_properties_SaveBody_kt__lbc3fj();
841
+ return SKIP_SAVE_BODY;
842
+ }
843
+ var SKIP_SAVE_BODY;
844
+ function get_RESPONSE_BODY_SAVED() {
845
+ _init_properties_SaveBody_kt__lbc3fj();
846
+ return RESPONSE_BODY_SAVED;
847
+ }
848
+ var RESPONSE_BODY_SAVED;
849
+ function get_LOGGER() {
850
+ _init_properties_SaveBody_kt__lbc3fj();
851
+ var tmp0 = LOGGER$delegate;
852
+ var tmp = KProperty0();
853
+ getPropertyCallableRef("LOGGER", 0, tmp, _get_LOGGER_$ref_77hhxy(), null);
854
+ return tmp0.get_value_j01efc_k$();
855
+ }
856
+ var LOGGER$delegate;
857
+ function get_SaveBody() {
858
+ _init_properties_SaveBody_kt__lbc3fj();
859
+ return SaveBody;
860
+ }
861
+ var SaveBody;
862
+ var SaveBodyPlugin;
863
+ function get_isSaved(_this__u8e3s4) {
864
+ _init_properties_SaveBody_kt__lbc3fj();
865
+ return _this__u8e3s4.get_call_wojxrb_k$().get_attributes_dgqof4_k$().contains_du0289_k$(get_RESPONSE_BODY_SAVED());
866
+ }
867
+ function tryCancelBody(_this__u8e3s4, e) {
868
+ e = e === VOID5 ? null : e;
869
+ _init_properties_SaveBody_kt__lbc3fj();
870
+ var byteChannel = _this__u8e3s4.get_rawContent_u3f8li_k$();
871
+ if (!byteChannel.get_isClosedForRead_ajcc1s_k$()) {
872
+ try {
873
+ byteChannel.cancel_9i2dv0_k$(e);
874
+ } catch ($p) {
875
+ if ($p instanceof CancellationException()) {
876
+ var cause = $p;
877
+ throw cause;
878
+ } else {
879
+ if ($p instanceof Exception()) {
880
+ var cause_0 = $p;
881
+ get_LOGGER().debug_2dc8ew_k$("Failed to cancel response body", cause_0);
882
+ } else {
883
+ throw $p;
884
+ }
885
+ }
886
+ }
887
+ }
888
+ }
889
+ var SaveBodyPluginConfigClass;
890
+ function SaveBodyPluginConfig() {
891
+ if (SaveBodyPluginConfigClass === VOID5) {
892
+ let $ = function() {
893
+ this.disabled_1 = false;
894
+ };
895
+ initMetadataForClass5($, "SaveBodyPluginConfig", SaveBodyPluginConfig);
896
+ SaveBodyPluginConfigClass = $;
897
+ }
898
+ return SaveBodyPluginConfigClass;
899
+ }
900
+ function skipSaveBody(_this__u8e3s4) {
901
+ _init_properties_SaveBody_kt__lbc3fj();
902
+ _this__u8e3s4.attributes_1.put_gkntno_k$(get_SKIP_SAVE_BODY(), Unit_instance4);
903
+ }
904
+ function LOGGER$delegate$lambda() {
905
+ _init_properties_SaveBody_kt__lbc3fj();
906
+ return KtorSimpleLogger("io.ktor.client.plugins.SaveBody");
907
+ }
908
+ function _get_LOGGER_$ref_77hhxy() {
909
+ return constructCallableReference(function() {
910
+ return get_LOGGER();
911
+ }, 0, 0, 39);
912
+ }
913
+ function SaveBody$lambda($this$createClientPlugin) {
914
+ _init_properties_SaveBody_kt__lbc3fj();
915
+ var tmp = Phases_getInstance().Before_1;
916
+ $this$createClientPlugin.client_1.receivePipeline_1.intercept_k21bv3_k$(tmp, SaveBody$lambda$slambda_0(null));
917
+ return Unit_instance4;
918
+ }
919
+ var SaveBody$lambda$slambdaClass;
920
+ function SaveBody$lambda$slambda() {
921
+ if (SaveBody$lambda$slambdaClass === VOID5) {
922
+ let $ = function(resultContinuation) {
923
+ CoroutineImpl3().call(this, resultContinuation);
924
+ };
925
+ initMetadataForLambda($, CoroutineImpl3(), VOID5, [2]);
926
+ protoOf5($).invoke_s06q6e_k$ = function($this$intercept, response, $completion) {
927
+ var tmp = this.create_c1uav6_k$($this$intercept, response, $completion);
928
+ tmp.result_1 = Unit_instance4;
929
+ tmp.exception_1 = null;
930
+ return tmp.doResume_5yljmg_k$();
931
+ };
932
+ protoOf5($).invoke_4tzzq6_k$ = function(p1, p2, $completion) {
933
+ var tmp = p1 instanceof PipelineContext() ? p1 : THROW_CCE();
934
+ return this.invoke_s06q6e_k$(tmp, p2 instanceof HttpResponse2() ? p2 : THROW_CCE(), $completion);
935
+ };
936
+ protoOf5($).doResume_5yljmg_k$ = function() {
937
+ var suspendResult = this.result_1;
938
+ $sm: do
939
+ try {
940
+ var tmp = this.state_1;
941
+ switch (tmp) {
942
+ case 0:
943
+ this.exceptionState_1 = 7;
944
+ this.call3__1 = this.response_1.get_call_wojxrb_k$();
945
+ this.attributes0__1 = this.call3__1.get_attributes_dgqof4_k$();
946
+ if (this.attributes0__1.contains_du0289_k$(get_SKIP_SAVE_BODY())) {
947
+ var this_0 = get_LOGGER();
948
+ if (get_isTraceEnabled(this_0)) {
949
+ this_0.trace_fti9bv_k$("Skipping body saving for " + this.call3__1.get_request_jdwg4m_k$().get_url_18iuii_k$().toString());
950
+ }
951
+ return Unit_instance4;
952
+ }
953
+ this.failure1__1 = null;
954
+ this.state_1 = 1;
955
+ continue $sm;
956
+ case 1:
957
+ this.exceptionState_1 = 4;
958
+ this.exceptionState_1 = 3;
959
+ var this_1 = get_LOGGER();
960
+ if (get_isTraceEnabled(this_1)) {
961
+ this_1.trace_fti9bv_k$("Saving body for " + this.call3__1.get_request_jdwg4m_k$().get_url_18iuii_k$().toString());
962
+ }
963
+ this.state_1 = 2;
964
+ suspendResult = save(this.call3__1, this);
965
+ if (suspendResult === get_COROUTINE_SUSPENDED3()) {
966
+ return suspendResult;
967
+ }
968
+ continue $sm;
969
+ case 2:
970
+ this.tmp$ret$02__1 = suspendResult.get_response_xlk07e_k$();
971
+ this.exceptionState_1 = 7;
972
+ this.state_1 = 5;
973
+ continue $sm;
974
+ case 3:
975
+ this.exceptionState_1 = 4;
976
+ var tmp_0 = this.exception_1;
977
+ if (tmp_0 instanceof Error) {
978
+ var e = this.exception_1;
979
+ var tmp_1 = this;
980
+ this.failure1__1 = e;
981
+ throw e;
982
+ } else {
983
+ throw this.exception_1;
984
+ }
985
+ case 4:
986
+ this.exceptionState_1 = 7;
987
+ var t = this.exception_1;
988
+ tryCancelBody(this.response_1, this.failure1__1);
989
+ throw t;
990
+ case 5:
991
+ var tmp_2 = this.tmp$ret$02__1;
992
+ this.exceptionState_1 = 7;
993
+ tryCancelBody(this.response_1, this.failure1__1);
994
+ var savedResponse = tmp_2;
995
+ this.attributes0__1.put_gkntno_k$(get_RESPONSE_BODY_SAVED(), Unit_instance4);
996
+ this.state_1 = 6;
997
+ suspendResult = this.$this$intercept_1.proceedWith_i5skhv_k$(savedResponse, this);
998
+ if (suspendResult === get_COROUTINE_SUSPENDED3()) {
999
+ return suspendResult;
1000
+ }
1001
+ continue $sm;
1002
+ case 6:
1003
+ return Unit_instance4;
1004
+ case 7:
1005
+ throw this.exception_1;
1006
+ }
1007
+ } catch ($p) {
1008
+ var e_0 = $p;
1009
+ if (this.exceptionState_1 === 7) {
1010
+ throw e_0;
1011
+ } else {
1012
+ this.state_1 = this.exceptionState_1;
1013
+ this.exception_1 = e_0;
1014
+ }
1015
+ }
1016
+ while (true);
1017
+ };
1018
+ protoOf5($).create_c1uav6_k$ = function($this$intercept, response, completion) {
1019
+ var i = new (SaveBody$lambda$slambda())(completion);
1020
+ i.$this$intercept_1 = $this$intercept;
1021
+ i.response_1 = response;
1022
+ return i;
1023
+ };
1024
+ SaveBody$lambda$slambdaClass = $;
1025
+ }
1026
+ return SaveBody$lambda$slambdaClass;
1027
+ }
1028
+ function SaveBody$lambda$slambda_0(resultContinuation) {
1029
+ var i = new (SaveBody$lambda$slambda())(resultContinuation);
1030
+ return constructCallableReference(function($this$intercept, response, $completion) {
1031
+ return i.invoke_s06q6e_k$($this$intercept, response, $completion);
1032
+ }, 2);
1033
+ }
1034
+ function SaveBodyPluginConfig$_init_$ref_lwjaof() {
1035
+ return constructCallableReference(function() {
1036
+ return new (SaveBodyPluginConfig())();
1037
+ }, 0, 0, 40, "<init>");
1038
+ }
1039
+ function SaveBodyPlugin$lambda($this$createClientPlugin) {
1040
+ _init_properties_SaveBody_kt__lbc3fj();
1041
+ if ($this$createClientPlugin.pluginConfig_1.disabled_1) {
1042
+ get_LOGGER().warn_mz9voc_k$("It is no longer possible to disable body saving for all requests. Use client.prepareRequest(...).execute { ... } syntax to prevent saving the body in memory.\n\nThis API is deprecated and will be removed in Ktor 4.0.0\nIf you were relying on this functionality, share your use case by commenting on this issue: https://youtrack.jetbrains.com/issue/KTOR-8367/");
1043
+ } else {
1044
+ get_LOGGER().warn_mz9voc_k$("The SaveBodyPlugin plugin is deprecated and can be safely removed. Request bodies are now saved in memory by default for all non-streaming responses.");
1045
+ }
1046
+ return Unit_instance4;
1047
+ }
1048
+ var properties_initialized_SaveBody_kt_hzvee7;
1049
+ function _init_properties_SaveBody_kt__lbc3fj() {
1050
+ if (!properties_initialized_SaveBody_kt_hzvee7) {
1051
+ properties_initialized_SaveBody_kt_hzvee7 = true;
1052
+ var name = "SkipSaveBody";
1053
+ var tmp = getKClass2(Unit());
1054
+ var tmp_0 = null instanceof Unit();
1055
+ var tmp_1;
1056
+ try {
1057
+ tmp_1 = createKType3(getKClass2(Unit()), arrayOf3([]), false);
1058
+ } catch ($p) {
1059
+ var tmp_2;
1060
+ if ($p instanceof Error) {
1061
+ var _unused_var__etf5q3 = $p;
1062
+ tmp_2 = null;
1063
+ } else {
1064
+ throw $p;
1065
+ }
1066
+ tmp_1 = tmp_2;
1067
+ }
1068
+ var tmp$ret$2 = tmp_1;
1069
+ var tmp$ret$1 = new (TypeInfo3())(tmp, tmp_0, tmp$ret$2);
1070
+ SKIP_SAVE_BODY = new (AttributeKey3())(name, tmp$ret$1);
1071
+ var name_0 = "ResponseBodySaved";
1072
+ var tmp_3 = getKClass2(Unit());
1073
+ var tmp_4 = null instanceof Unit();
1074
+ var tmp_5;
1075
+ try {
1076
+ tmp_5 = createKType3(getKClass2(Unit()), arrayOf3([]), false);
1077
+ } catch ($p_0) {
1078
+ var tmp_6;
1079
+ if ($p_0 instanceof Error) {
1080
+ var _unused_var__etf5q3_0 = $p_0;
1081
+ tmp_6 = null;
1082
+ } else {
1083
+ throw $p_0;
1084
+ }
1085
+ tmp_5 = tmp_6;
1086
+ }
1087
+ var tmp$ret$2_0 = tmp_5;
1088
+ var tmp$ret$1_0 = new (TypeInfo3())(tmp_3, tmp_4, tmp$ret$2_0);
1089
+ RESPONSE_BODY_SAVED = new (AttributeKey3())(name_0, tmp$ret$1_0);
1090
+ LOGGER$delegate = lazy(LOGGER$delegate$lambda);
1091
+ SaveBody = createClientPlugin("SaveBody", SaveBody$lambda);
1092
+ var tmp_7 = SaveBodyPluginConfig$_init_$ref_lwjaof();
1093
+ SaveBodyPlugin = createClientPlugin_0("DoubleReceivePlugin", tmp_7, SaveBodyPlugin$lambda);
1094
+ }
1095
+ }
1096
+
1097
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/plugins/HttpRequestRetry.mjs
1098
+ import { Default_getInstancee1f46otjvolq as Default_getInstance } from "../kotlin-kotlin-stdlib/kotlin/random/Random.mjs";
1099
+ import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl4 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
1100
+ import {
1101
+ Unit_instance3kz1zqli6gr1r as Unit_instance5,
1102
+ Unitkvevlwgzwiuc as Unit2
1103
+ } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
1104
+ import { protoOf180f3jzyo7rfj as protoOf6 } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
1105
+ import { THROW_CCE2g6jy02ryeudk as THROW_CCE2 } from "../kotlin-kotlin-stdlib/kotlin/hacks.mjs";
1106
+ import { delayp0o4nsccwai as delay } from "../kotlinx-coroutines-core/kotlinx/coroutines/Delay.mjs";
1107
+ import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED4 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
1108
+ import {
1109
+ initMetadataForLambda3af3he42mmnh as initMetadataForLambda2,
1110
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass6,
1111
+ initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine3
1112
+ } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
1113
+ import { VOID3gxj6tk5isa35 as VOID6 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
1114
+ import { constructCallableReference23y65rf941mch as constructCallableReference2 } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
1115
+ import { CancellationException3b36o9qz53rgr as CancellationException2 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/cancellation/CancellationException.mjs";
1116
+ import { toLongOrNullutqivezb0wx1 as toLongOrNull } from "../kotlin-kotlin-stdlib/kotlin/text/StringNumberConversions.mjs";
1117
+ import {
1118
+ fromInt2ii0rejb1w62w as fromInt2,
1119
+ multiply2k9eolhnz1bjv as multiply,
1120
+ toNumber2e2hj9zugjwi2 as toNumber,
1121
+ numberToLong2pakxeg38estk as numberToLong,
1122
+ add2suhfggl4zvkk as add
1123
+ } from "../kotlin-kotlin-stdlib/kotlin/js/internal/longAsBigInt/longAsBigInt.mjs";
1124
+ import { throwUninitializedPropertyAccessException14fok093f3k3t as throwUninitializedPropertyAccessException2 } from "../kotlin-kotlin-stdlib/kotlin/internal/ThrowHelpers.mjs";
1125
+ import { IllegalStateException_init_$Create$38ax6c90susjc as IllegalStateException_init_$Create$2 } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
1126
+ import { unwrapCancellationException1zvbmufui4i9c as unwrapCancellationException } from "../ktor-ktor-client-core/io/ktor/client/utils/ExceptionUtils.nonJvm.mjs";
1127
+ import {
1128
+ ConnectTimeoutException35w4gpuoa1015 as ConnectTimeoutException,
1129
+ SocketTimeoutException2zstjwq2yf3s9 as SocketTimeoutException
1130
+ } from "../ktor-ktor-client-core/io/ktor/client/network/sockets/TimeoutExceptions.nonJvm.mjs";
1131
+ import { CompletableJob1w6swnu15iclo as CompletableJob } from "../kotlinx-coroutines-core/kotlinx/coroutines/CompletableJob.mjs";
1132
+ import { isInterface3d6p8outrmvmk as isInterface3 } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
1133
+ import { OnRequestContext1tmu5b6bhlblg as OnRequestContext } from "../ktor-ktor-client-core/io/ktor/client/plugins/api/KtorCallContexts.mjs";
1134
+ import { get_isTraceEnabled82xibuu04nxp as get_isTraceEnabled2 } from "../ktor-ktor-utils/io/ktor/util/logging/Logger.web.mjs";
1135
+ import {
1136
+ Companion_instancejy2056q2ma5w as Companion_instance3,
1137
+ _Result___init__impl__xyqfz832zdzqrocazzs as _Result___init__impl__xyqfz8,
1138
+ createFailure8paxfkfa5dc7 as createFailure,
1139
+ Result__exceptionOrNull_impl_p6xea93txwfmg154xda as Result__exceptionOrNull_impl_p6xea9
1140
+ } from "../kotlin-kotlin-stdlib/kotlin/Result.mjs";
1141
+ import { canceldn4b3cdqcfny as cancel2 } from "../ktor-ktor-io/io/ktor/utils/io/ByteReadChannel.mjs";
1142
+ import { KtorSimpleLogger1xdphsp5l4e48 as KtorSimpleLogger2 } from "../ktor-ktor-utils/io/ktor/util/logging/KtorSimpleLogger.web.mjs";
1143
+ import { EventDefinition1fymk8xrdelhn as EventDefinition } from "../ktor-ktor-events/io/ktor/events/Events.mjs";
1144
+ import { createClientPluginjwpvufjows5r as createClientPlugin2 } from "../ktor-ktor-client-core/io/ktor/client/plugins/api/CreatePluginUtils.mjs";
1145
+ import { PrimitiveClasses_getInstance13wbaztpz3e2d as PrimitiveClasses_getInstance2 } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/primitives.mjs";
1146
+ import { arrayOf1akklvh2at202 as arrayOf4 } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
1147
+ import {
1148
+ createKType31ecntyyaay3k as createKType4,
1149
+ createInvariantKTypeProjection3h5364czc0a8w as createInvariantKTypeProjection
1150
+ } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
1151
+ import { TypeInfo2nbxsuf4v8os2 as TypeInfo4 } from "../ktor-ktor-utils/io/ktor/util/reflect/Type.mjs";
1152
+ import { AttributeKey3aq8ytwgx54f7 as AttributeKey4 } from "../ktor-ktor-utils/io/ktor/util/Attributes.mjs";
1153
+ import { getKClass3t8tygqu4lcxf as getKClass3 } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
1154
+ import { HttpResponse1532ob1hsse1y as HttpResponse3 } from "../ktor-ktor-client-core/io/ktor/client/statement/HttpResponse.mjs";
1155
+ function get_LOGGER2() {
1156
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1157
+ return LOGGER;
1158
+ }
1159
+ var LOGGER;
1160
+ function get_HttpRequestRetryEvent() {
1161
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1162
+ return HttpRequestRetryEvent;
1163
+ }
1164
+ var HttpRequestRetryEvent;
1165
+ function get_HttpRequestRetry() {
1166
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1167
+ return HttpRequestRetry;
1168
+ }
1169
+ var HttpRequestRetry;
1170
+ function get_MaxRetriesPerRequestAttributeKey() {
1171
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1172
+ return MaxRetriesPerRequestAttributeKey;
1173
+ }
1174
+ var MaxRetriesPerRequestAttributeKey;
1175
+ function get_ShouldRetryPerRequestAttributeKey() {
1176
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1177
+ return ShouldRetryPerRequestAttributeKey;
1178
+ }
1179
+ var ShouldRetryPerRequestAttributeKey;
1180
+ function get_ShouldRetryOnExceptionPerRequestAttributeKey() {
1181
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1182
+ return ShouldRetryOnExceptionPerRequestAttributeKey;
1183
+ }
1184
+ var ShouldRetryOnExceptionPerRequestAttributeKey;
1185
+ function get_ModifyRequestPerRequestAttributeKey() {
1186
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1187
+ return ModifyRequestPerRequestAttributeKey;
1188
+ }
1189
+ var ModifyRequestPerRequestAttributeKey;
1190
+ function get_RetryDelayPerRequestAttributeKey() {
1191
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1192
+ return RetryDelayPerRequestAttributeKey;
1193
+ }
1194
+ var RetryDelayPerRequestAttributeKey;
1195
+ function randomMs($this, randomizationMs) {
1196
+ return randomizationMs === 0n ? 0n : Default_getInstance().nextLong_6yjhyj_k$(randomizationMs);
1197
+ }
1198
+ var HttpRequestRetryConfig$delay$slambdaClass;
1199
+ function HttpRequestRetryConfig$delay$slambda() {
1200
+ if (HttpRequestRetryConfig$delay$slambdaClass === VOID6) {
1201
+ let $ = function(resultContinuation) {
1202
+ CoroutineImpl4().call(this, resultContinuation);
1203
+ };
1204
+ initMetadataForLambda2($, CoroutineImpl4(), VOID6, [1]);
1205
+ protoOf6($).invoke_1nntbp_k$ = function(it, $completion) {
1206
+ var tmp = this.create_oyhxmv_k$(it, $completion);
1207
+ tmp.result_1 = Unit_instance5;
1208
+ tmp.exception_1 = null;
1209
+ return tmp.doResume_5yljmg_k$();
1210
+ };
1211
+ protoOf6($).invoke_qns8j1_k$ = function(p1, $completion) {
1212
+ return this.invoke_1nntbp_k$((!(p1 == null) ? typeof p1 === "bigint" : false) ? p1 : THROW_CCE2(), $completion);
1213
+ };
1214
+ protoOf6($).doResume_5yljmg_k$ = function() {
1215
+ var suspendResult = this.result_1;
1216
+ $sm: do
1217
+ try {
1218
+ var tmp = this.state_1;
1219
+ switch (tmp) {
1220
+ case 0:
1221
+ this.exceptionState_1 = 2;
1222
+ this.state_1 = 1;
1223
+ suspendResult = delay(this.it_1, this);
1224
+ if (suspendResult === get_COROUTINE_SUSPENDED4()) {
1225
+ return suspendResult;
1226
+ }
1227
+ continue $sm;
1228
+ case 1:
1229
+ return Unit_instance5;
1230
+ case 2:
1231
+ throw this.exception_1;
1232
+ }
1233
+ } catch ($p) {
1234
+ var e = $p;
1235
+ if (this.exceptionState_1 === 2) {
1236
+ throw e;
1237
+ } else {
1238
+ this.state_1 = this.exceptionState_1;
1239
+ this.exception_1 = e;
1240
+ }
1241
+ }
1242
+ while (true);
1243
+ };
1244
+ protoOf6($).create_oyhxmv_k$ = function(it, completion) {
1245
+ var i = new (HttpRequestRetryConfig$delay$slambda())(completion);
1246
+ i.it_1 = it;
1247
+ return i;
1248
+ };
1249
+ HttpRequestRetryConfig$delay$slambdaClass = $;
1250
+ }
1251
+ return HttpRequestRetryConfig$delay$slambdaClass;
1252
+ }
1253
+ function HttpRequestRetryConfig$delay$slambda_0(resultContinuation) {
1254
+ var i = new (HttpRequestRetryConfig$delay$slambda())(resultContinuation);
1255
+ return constructCallableReference2(function(it, $completion) {
1256
+ return i.invoke_1nntbp_k$(it, $completion);
1257
+ }, 1);
1258
+ }
1259
+ function HttpRequestRetryConfig$modifyRequest$lambda(_this__u8e3s4, it) {
1260
+ return Unit_instance5;
1261
+ }
1262
+ function HttpRequestRetryConfig$retryOnException$lambda($retryOnTimeout) {
1263
+ return function($this$retryOnExceptionIf, _unused_var__etf5q3, cause) {
1264
+ var tmp;
1265
+ if (isTimeoutException(cause)) {
1266
+ tmp = $retryOnTimeout;
1267
+ } else {
1268
+ if (cause instanceof CancellationException2()) {
1269
+ tmp = false;
1270
+ } else {
1271
+ tmp = true;
1272
+ }
1273
+ }
1274
+ return tmp;
1275
+ };
1276
+ }
1277
+ function HttpRequestRetryConfig$retryOnServerErrors$lambda($this$retryIf, _unused_var__etf5q3, response) {
1278
+ var it = response.get_status_jnf6d7_k$().value_1;
1279
+ return 500 <= it ? it <= 599 : false;
1280
+ }
1281
+ function HttpRequestRetryConfig$delayMillis$lambda($respectRetryAfterHeader, $block) {
1282
+ return function(_this__u8e3s4, it) {
1283
+ var tmp;
1284
+ if ($respectRetryAfterHeader) {
1285
+ var tmp0_safe_receiver = _this__u8e3s4.response_1;
1286
+ var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_headers_ef25jx_k$();
1287
+ var tmp2_safe_receiver = tmp1_safe_receiver == null ? null : tmp1_safe_receiver.get_6bo4tg_k$("Retry-After");
1288
+ var tmp3_safe_receiver = tmp2_safe_receiver == null ? null : toLongOrNull(tmp2_safe_receiver);
1289
+ var tmp_0;
1290
+ if (tmp3_safe_receiver == null) {
1291
+ tmp_0 = null;
1292
+ } else {
1293
+ tmp_0 = multiply(tmp3_safe_receiver, fromInt2(1e3));
1294
+ }
1295
+ var retryAfter = tmp_0;
1296
+ var tmp0 = $block(_this__u8e3s4, it);
1297
+ var b = retryAfter == null ? 0n : retryAfter;
1298
+ tmp = tmp0 >= b ? tmp0 : b;
1299
+ } else {
1300
+ tmp = $block(_this__u8e3s4, it);
1301
+ }
1302
+ return tmp;
1303
+ };
1304
+ }
1305
+ function HttpRequestRetryConfig$exponentialDelay$lambda($base, $baseDelayMs, $maxDelayMs, this$0, $randomizationMs) {
1306
+ return function($this$delayMillis, retry) {
1307
+ var tmp0 = $base;
1308
+ var n = retry - 1 | 0;
1309
+ var tmp$ret$0 = Math.pow(tmp0, n);
1310
+ var tmp0_0 = numberToLong(tmp$ret$0 * toNumber($baseDelayMs));
1311
+ var b = $maxDelayMs;
1312
+ var delay3 = tmp0_0 <= b ? tmp0_0 : b;
1313
+ return add(delay3, randomMs(this$0, $randomizationMs));
1314
+ };
1315
+ }
1316
+ var HttpRequestRetryConfigClass;
1317
+ function HttpRequestRetryConfig() {
1318
+ if (HttpRequestRetryConfigClass === VOID6) {
1319
+ let $ = function() {
1320
+ var tmp = this;
1321
+ tmp.delay_1 = HttpRequestRetryConfig$delay$slambda_0(null);
1322
+ var tmp_0 = this;
1323
+ tmp_0.modifyRequest_1 = HttpRequestRetryConfig$modifyRequest$lambda;
1324
+ this.maxRetries_1 = 0;
1325
+ this.retryOnExceptionOrServerErrors_vs25gx_k$(3);
1326
+ this.exponentialDelay$default_gkwfsg_k$();
1327
+ };
1328
+ initMetadataForClass6($, "HttpRequestRetryConfig", HttpRequestRetryConfig);
1329
+ protoOf6($).get_shouldRetry_o4gxfl_k$ = function() {
1330
+ var tmp = this.shouldRetry_1;
1331
+ if (!(tmp == null))
1332
+ return tmp;
1333
+ else {
1334
+ throwUninitializedPropertyAccessException2("shouldRetry");
1335
+ }
1336
+ };
1337
+ protoOf6($).get_shouldRetryOnException_5ctz93_k$ = function() {
1338
+ var tmp = this.shouldRetryOnException_1;
1339
+ if (!(tmp == null))
1340
+ return tmp;
1341
+ else {
1342
+ throwUninitializedPropertyAccessException2("shouldRetryOnException");
1343
+ }
1344
+ };
1345
+ protoOf6($).get_delayMillis_llob4d_k$ = function() {
1346
+ var tmp = this.delayMillis_1;
1347
+ if (!(tmp == null))
1348
+ return tmp;
1349
+ else {
1350
+ throwUninitializedPropertyAccessException2("delayMillis");
1351
+ }
1352
+ };
1353
+ protoOf6($).modifyRequest_6qlpaw_k$ = function(block) {
1354
+ this.modifyRequest_1 = block;
1355
+ };
1356
+ protoOf6($).retryIf_sig7v0_k$ = function(maxRetries, block) {
1357
+ if (!(maxRetries === -1))
1358
+ this.maxRetries_1 = maxRetries;
1359
+ this.shouldRetry_1 = block;
1360
+ };
1361
+ protoOf6($).retryOnExceptionIf_wpc295_k$ = function(maxRetries, block) {
1362
+ if (!(maxRetries === -1))
1363
+ this.maxRetries_1 = maxRetries;
1364
+ this.shouldRetryOnException_1 = block;
1365
+ };
1366
+ protoOf6($).retryOnExceptionIf$default_s26x3m_k$ = function(maxRetries, block, $super) {
1367
+ maxRetries = maxRetries === VOID6 ? -1 : maxRetries;
1368
+ var tmp;
1369
+ if ($super === VOID6) {
1370
+ this.retryOnExceptionIf_wpc295_k$(maxRetries, block);
1371
+ tmp = Unit_instance5;
1372
+ } else {
1373
+ tmp = $super.retryOnExceptionIf_wpc295_k$.call(this, maxRetries, block);
1374
+ }
1375
+ return tmp;
1376
+ };
1377
+ protoOf6($).retryOnException_34fdi3_k$ = function(maxRetries, retryOnTimeout) {
1378
+ this.retryOnExceptionIf_wpc295_k$(maxRetries, HttpRequestRetryConfig$retryOnException$lambda(retryOnTimeout));
1379
+ };
1380
+ protoOf6($).retryOnException$default_fu1qg9_k$ = function(maxRetries, retryOnTimeout, $super) {
1381
+ maxRetries = maxRetries === VOID6 ? -1 : maxRetries;
1382
+ retryOnTimeout = retryOnTimeout === VOID6 ? false : retryOnTimeout;
1383
+ var tmp;
1384
+ if ($super === VOID6) {
1385
+ this.retryOnException_34fdi3_k$(maxRetries, retryOnTimeout);
1386
+ tmp = Unit_instance5;
1387
+ } else {
1388
+ tmp = $super.retryOnException_34fdi3_k$.call(this, maxRetries, retryOnTimeout);
1389
+ }
1390
+ return tmp;
1391
+ };
1392
+ protoOf6($).retryOnServerErrors_n8g6l_k$ = function(maxRetries) {
1393
+ this.retryIf_sig7v0_k$(maxRetries, HttpRequestRetryConfig$retryOnServerErrors$lambda);
1394
+ };
1395
+ protoOf6($).retryOnExceptionOrServerErrors_vs25gx_k$ = function(maxRetries) {
1396
+ this.retryOnServerErrors_n8g6l_k$(maxRetries);
1397
+ this.retryOnException$default_fu1qg9_k$(maxRetries);
1398
+ };
1399
+ protoOf6($).delayMillis_83rww5_k$ = function(respectRetryAfterHeader, block) {
1400
+ var tmp = this;
1401
+ tmp.delayMillis_1 = HttpRequestRetryConfig$delayMillis$lambda(respectRetryAfterHeader, block);
1402
+ };
1403
+ protoOf6($).exponentialDelay_uk8dy1_k$ = function(base, baseDelayMs, maxDelayMs, randomizationMs, respectRetryAfterHeader) {
1404
+ if (!(base > 0)) {
1405
+ throw IllegalStateException_init_$Create$2("Check failed.");
1406
+ }
1407
+ if (!(baseDelayMs > 0n)) {
1408
+ throw IllegalStateException_init_$Create$2("Check failed.");
1409
+ }
1410
+ if (!(maxDelayMs > 0n)) {
1411
+ throw IllegalStateException_init_$Create$2("Check failed.");
1412
+ }
1413
+ if (!(randomizationMs >= 0n)) {
1414
+ throw IllegalStateException_init_$Create$2("Check failed.");
1415
+ }
1416
+ this.delayMillis_83rww5_k$(respectRetryAfterHeader, HttpRequestRetryConfig$exponentialDelay$lambda(base, baseDelayMs, maxDelayMs, this, randomizationMs));
1417
+ };
1418
+ protoOf6($).exponentialDelay$default_gkwfsg_k$ = function(base, baseDelayMs, maxDelayMs, randomizationMs, respectRetryAfterHeader, $super) {
1419
+ base = base === VOID6 ? 2 : base;
1420
+ baseDelayMs = baseDelayMs === VOID6 ? 1000n : baseDelayMs;
1421
+ maxDelayMs = maxDelayMs === VOID6 ? 60000n : maxDelayMs;
1422
+ randomizationMs = randomizationMs === VOID6 ? 1000n : randomizationMs;
1423
+ respectRetryAfterHeader = respectRetryAfterHeader === VOID6 ? true : respectRetryAfterHeader;
1424
+ var tmp;
1425
+ if ($super === VOID6) {
1426
+ this.exponentialDelay_uk8dy1_k$(base, baseDelayMs, maxDelayMs, randomizationMs, respectRetryAfterHeader);
1427
+ tmp = Unit_instance5;
1428
+ } else {
1429
+ tmp = $super.exponentialDelay_uk8dy1_k$.call(this, base, baseDelayMs, maxDelayMs, randomizationMs, respectRetryAfterHeader);
1430
+ }
1431
+ return tmp;
1432
+ };
1433
+ HttpRequestRetryConfigClass = $;
1434
+ }
1435
+ return HttpRequestRetryConfigClass;
1436
+ }
1437
+ var HttpRetryShouldRetryContextClass;
1438
+ function HttpRetryShouldRetryContext() {
1439
+ if (HttpRetryShouldRetryContextClass === VOID6) {
1440
+ let $ = function(retryCount) {
1441
+ this.retryCount_1 = retryCount;
1442
+ };
1443
+ initMetadataForClass6($, "HttpRetryShouldRetryContext");
1444
+ HttpRetryShouldRetryContextClass = $;
1445
+ }
1446
+ return HttpRetryShouldRetryContextClass;
1447
+ }
1448
+ var HttpRetryModifyRequestContextClass;
1449
+ function HttpRetryModifyRequestContext() {
1450
+ if (HttpRetryModifyRequestContextClass === VOID6) {
1451
+ let $ = function(request, response, cause, retryCount) {
1452
+ this.request_1 = request;
1453
+ this.response_1 = response;
1454
+ this.cause_1 = cause;
1455
+ this.retryCount_1 = retryCount;
1456
+ };
1457
+ initMetadataForClass6($, "HttpRetryModifyRequestContext");
1458
+ HttpRetryModifyRequestContextClass = $;
1459
+ }
1460
+ return HttpRetryModifyRequestContextClass;
1461
+ }
1462
+ var HttpRetryEventDataClass;
1463
+ function HttpRetryEventData() {
1464
+ if (HttpRetryEventDataClass === VOID6) {
1465
+ let $ = function(request, retryCount, response, cause) {
1466
+ this.request_1 = request;
1467
+ this.retryCount_1 = retryCount;
1468
+ this.response_1 = response;
1469
+ this.cause_1 = cause;
1470
+ };
1471
+ initMetadataForClass6($, "HttpRetryEventData");
1472
+ HttpRetryEventDataClass = $;
1473
+ }
1474
+ return HttpRetryEventDataClass;
1475
+ }
1476
+ var HttpRetryDelayContextClass;
1477
+ function HttpRetryDelayContext() {
1478
+ if (HttpRetryDelayContextClass === VOID6) {
1479
+ let $ = function(request, response, cause) {
1480
+ this.request_1 = request;
1481
+ this.response_1 = response;
1482
+ this.cause_1 = cause;
1483
+ };
1484
+ initMetadataForClass6($, "HttpRetryDelayContext");
1485
+ HttpRetryDelayContextClass = $;
1486
+ }
1487
+ return HttpRetryDelayContextClass;
1488
+ }
1489
+ function throwOnInvalidResponseBody(_this__u8e3s4, $completion) {
1490
+ var tmp = new ($throwOnInvalidResponseBodyCOROUTINE$())(_this__u8e3s4, $completion);
1491
+ tmp.result_1 = Unit_instance5;
1492
+ tmp.exception_1 = null;
1493
+ return tmp.doResume_5yljmg_k$();
1494
+ }
1495
+ function isTimeoutException(_this__u8e3s4) {
1496
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1497
+ var exception = unwrapCancellationException(_this__u8e3s4);
1498
+ var tmp;
1499
+ var tmp_0;
1500
+ if (exception instanceof HttpRequestTimeoutException()) {
1501
+ tmp_0 = true;
1502
+ } else {
1503
+ tmp_0 = exception instanceof ConnectTimeoutException();
1504
+ }
1505
+ if (tmp_0) {
1506
+ tmp = true;
1507
+ } else {
1508
+ tmp = exception instanceof SocketTimeoutException();
1509
+ }
1510
+ return tmp;
1511
+ }
1512
+ function HttpRequestRetryConfig$_init_$ref_mqbboi() {
1513
+ return constructCallableReference2(function() {
1514
+ return new (HttpRequestRetryConfig())();
1515
+ }, 0, 0, 37, "<init>");
1516
+ }
1517
+ function HttpRequestRetry$lambda($this$createClientPlugin) {
1518
+ _init_properties_HttpRequestRetry_kt__h4xjtt();
1519
+ var shouldRetry = $this$createClientPlugin.pluginConfig_1.get_shouldRetry_o4gxfl_k$();
1520
+ var shouldRetryOnException = $this$createClientPlugin.pluginConfig_1.get_shouldRetryOnException_5ctz93_k$();
1521
+ var delayMillis = $this$createClientPlugin.pluginConfig_1.get_delayMillis_llob4d_k$();
1522
+ var delay3 = $this$createClientPlugin.pluginConfig_1.delay_1;
1523
+ var maxRetries = $this$createClientPlugin.pluginConfig_1.maxRetries_1;
1524
+ var modifyRequest = $this$createClientPlugin.pluginConfig_1.modifyRequest_1;
1525
+ $this$createClientPlugin.onRequest_fk8bil_k$(HttpRequestRetry$lambda$slambda_0(maxRetries, null));
1526
+ var tmp = Send_instance;
1527
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HttpRequestRetry$lambda$slambda_2(shouldRetry, shouldRetryOnException, maxRetries, delayMillis, modifyRequest, $this$createClientPlugin, delay3, null));
1528
+ return Unit_instance5;
1529
+ }
1530
+ function HttpRequestRetry$lambda$prepareRequest$lambda($subRequest) {
1531
+ return function(cause) {
1532
+ var tmp = $subRequest.executionContext_1;
1533
+ var subRequestJob = isInterface3(tmp, CompletableJob()) ? tmp : THROW_CCE2();
1534
+ if (cause == null) {
1535
+ subRequestJob.complete_9ww6vb_k$();
1536
+ } else {
1537
+ subRequestJob.completeExceptionally_xyzekf_k$(cause);
1538
+ }
1539
+ return Unit_instance5;
1540
+ };
1541
+ }
1542
+ function invoke$shouldRetry(retryCount, maxRetries, shouldRetry, call) {
1543
+ return retryCount < maxRetries && shouldRetry(new (HttpRetryShouldRetryContext())(retryCount + 1 | 0), call.get_request_jdwg4m_k$(), call.get_response_xlk07e_k$());
1544
+ }
1545
+ function invoke$shouldRetryOnException(retryCount, maxRetries, shouldRetry, subRequest, cause) {
1546
+ return retryCount < maxRetries && shouldRetry(new (HttpRetryShouldRetryContext())(retryCount + 1 | 0), subRequest, cause);
1547
+ }
1548
+ function invoke$prepareRequest(request) {
1549
+ var subRequest = new (HttpRequestBuilder())().takeFrom_mkv7jk_k$(request);
1550
+ var tmp = request.executionContext_1;
1551
+ tmp.invokeOnCompletion_n6cffu_k$(HttpRequestRetry$lambda$prepareRequest$lambda(subRequest));
1552
+ return subRequest;
1553
+ }
1554
+ var HttpRequestRetry$lambda$slambdaClass;
1555
+ function HttpRequestRetry$lambda$slambda() {
1556
+ if (HttpRequestRetry$lambda$slambdaClass === VOID6) {
1557
+ let $ = function($maxRetries, resultContinuation) {
1558
+ this.$maxRetries_1 = $maxRetries;
1559
+ CoroutineImpl4().call(this, resultContinuation);
1560
+ };
1561
+ initMetadataForLambda2($, CoroutineImpl4(), VOID6, [3]);
1562
+ protoOf6($).invoke_572pd7_k$ = function($this$onRequest, request, _unused_var__etf5q3, $completion) {
1563
+ var tmp = this.create_2brvp3_k$($this$onRequest, request, _unused_var__etf5q3, $completion);
1564
+ tmp.result_1 = Unit_instance5;
1565
+ tmp.exception_1 = null;
1566
+ return tmp.doResume_5yljmg_k$();
1567
+ };
1568
+ protoOf6($).invoke_ihdh7y_k$ = function(p1, p2, p3, $completion) {
1569
+ var tmp = p1 instanceof OnRequestContext() ? p1 : THROW_CCE2();
1570
+ var tmp_0 = p2 instanceof HttpRequestBuilder() ? p2 : THROW_CCE2();
1571
+ return this.invoke_572pd7_k$(tmp, tmp_0, !(p3 == null) ? p3 : THROW_CCE2(), $completion);
1572
+ };
1573
+ protoOf6($).doResume_5yljmg_k$ = function() {
1574
+ var suspendResult = this.result_1;
1575
+ $sm: do
1576
+ try {
1577
+ var tmp = this.state_1;
1578
+ if (tmp === 0) {
1579
+ this.exceptionState_1 = 1;
1580
+ var tmp0_elvis_lhs = this.request_1.attributes_1.getOrNull_6mjt1v_k$(get_MaxRetriesPerRequestAttributeKey());
1581
+ var maxRetriesValue = tmp0_elvis_lhs == null ? this.$maxRetries_1 : tmp0_elvis_lhs;
1582
+ this.request_1.attributes_1.put_gkntno_k$(get_MaxRetriesPerRequestAttributeKey(), maxRetriesValue);
1583
+ return Unit_instance5;
1584
+ } else if (tmp === 1) {
1585
+ throw this.exception_1;
1586
+ }
1587
+ } catch ($p) {
1588
+ var e = $p;
1589
+ throw e;
1590
+ }
1591
+ while (true);
1592
+ };
1593
+ protoOf6($).create_2brvp3_k$ = function($this$onRequest, request, _unused_var__etf5q3, completion) {
1594
+ var i = new (HttpRequestRetry$lambda$slambda())(this.$maxRetries_1, completion);
1595
+ i.$this$onRequest_1 = $this$onRequest;
1596
+ i.request_1 = request;
1597
+ i._unused_var__etf5q3__1 = _unused_var__etf5q3;
1598
+ return i;
1599
+ };
1600
+ HttpRequestRetry$lambda$slambdaClass = $;
1601
+ }
1602
+ return HttpRequestRetry$lambda$slambdaClass;
1603
+ }
1604
+ function HttpRequestRetry$lambda$slambda_0($maxRetries, resultContinuation) {
1605
+ var i = new (HttpRequestRetry$lambda$slambda())($maxRetries, resultContinuation);
1606
+ return constructCallableReference2(function($this$onRequest, request, _unused_var__etf5q3, $completion) {
1607
+ return i.invoke_572pd7_k$($this$onRequest, request, _unused_var__etf5q3, $completion);
1608
+ }, 3);
1609
+ }
1610
+ var HttpRequestRetry$lambda$slambdaClass_0;
1611
+ function HttpRequestRetry$lambda$slambda_1() {
1612
+ if (HttpRequestRetry$lambda$slambdaClass_0 === VOID6) {
1613
+ let $ = function($shouldRetry, $shouldRetryOnException, $maxRetries, $delayMillis, $modifyRequest, $this_createClientPlugin, $delay, resultContinuation) {
1614
+ this.$shouldRetry_1 = $shouldRetry;
1615
+ this.$shouldRetryOnException_1 = $shouldRetryOnException;
1616
+ this.$maxRetries_1 = $maxRetries;
1617
+ this.$delayMillis_1 = $delayMillis;
1618
+ this.$modifyRequest_1 = $modifyRequest;
1619
+ this.$this_createClientPlugin_1 = $this_createClientPlugin;
1620
+ this.$delay_1 = $delay;
1621
+ CoroutineImpl4().call(this, resultContinuation);
1622
+ };
1623
+ initMetadataForLambda2($, CoroutineImpl4(), VOID6, [2]);
1624
+ protoOf6($).invoke_nc6r0k_k$ = function($this$on, request, $completion) {
1625
+ var tmp = this.create_v0j3o4_k$($this$on, request, $completion);
1626
+ tmp.result_1 = Unit_instance5;
1627
+ tmp.exception_1 = null;
1628
+ return tmp.doResume_5yljmg_k$();
1629
+ };
1630
+ protoOf6($).invoke_4tzzq6_k$ = function(p1, p2, $completion) {
1631
+ var tmp = p1 instanceof Sender_0() ? p1 : THROW_CCE2();
1632
+ return this.invoke_nc6r0k_k$(tmp, p2 instanceof HttpRequestBuilder() ? p2 : THROW_CCE2(), $completion);
1633
+ };
1634
+ protoOf6($).doResume_5yljmg_k$ = function() {
1635
+ var suspendResult = this.result_1;
1636
+ $sm: do
1637
+ try {
1638
+ var tmp = this.state_1;
1639
+ switch (tmp) {
1640
+ case 0:
1641
+ this.exceptionState_1 = 8;
1642
+ this.retryCount1__1 = 0;
1643
+ var tmp_0 = this;
1644
+ var tmp0_elvis_lhs = this.request_1.attributes_1.getOrNull_6mjt1v_k$(get_ShouldRetryPerRequestAttributeKey());
1645
+ tmp_0.shouldRetry8__1 = tmp0_elvis_lhs == null ? this.$shouldRetry_1 : tmp0_elvis_lhs;
1646
+ var tmp_1 = this;
1647
+ var tmp1_elvis_lhs = this.request_1.attributes_1.getOrNull_6mjt1v_k$(get_ShouldRetryOnExceptionPerRequestAttributeKey());
1648
+ tmp_1.shouldRetryOnException6__1 = tmp1_elvis_lhs == null ? this.$shouldRetryOnException_1 : tmp1_elvis_lhs;
1649
+ var tmp_2 = this;
1650
+ var tmp2_elvis_lhs = this.request_1.attributes_1.getOrNull_6mjt1v_k$(get_MaxRetriesPerRequestAttributeKey());
1651
+ tmp_2.maxRetries7__1 = tmp2_elvis_lhs == null ? this.$maxRetries_1 : tmp2_elvis_lhs;
1652
+ var tmp_3 = this;
1653
+ var tmp3_elvis_lhs = this.request_1.attributes_1.getOrNull_6mjt1v_k$(get_RetryDelayPerRequestAttributeKey());
1654
+ tmp_3.delayMillis2__1 = tmp3_elvis_lhs == null ? this.$delayMillis_1 : tmp3_elvis_lhs;
1655
+ var tmp_4 = this;
1656
+ var tmp4_elvis_lhs = this.request_1.attributes_1.getOrNull_6mjt1v_k$(get_ModifyRequestPerRequestAttributeKey());
1657
+ tmp_4.modifyRequest9__1 = tmp4_elvis_lhs == null ? this.$modifyRequest_1 : tmp4_elvis_lhs;
1658
+ this.lastRetryData3__1 = null;
1659
+ this.state_1 = 1;
1660
+ continue $sm;
1661
+ case 1:
1662
+ if (false) {
1663
+ this.state_1 = 9;
1664
+ continue $sm;
1665
+ }
1666
+ this.subRequest5__1 = invoke$prepareRequest(this.request_1);
1667
+ this.exceptionState_1 = 5;
1668
+ if (!(this.lastRetryData3__1 == null)) {
1669
+ var modifyRequestContext = new (HttpRetryModifyRequestContext())(this.request_1, this.lastRetryData3__1.response_1, this.lastRetryData3__1.cause_1, this.lastRetryData3__1.retryCount_1);
1670
+ this.modifyRequest9__1(modifyRequestContext, this.subRequest5__1);
1671
+ }
1672
+ this.state_1 = 2;
1673
+ suspendResult = this.$this$on_1.proceed_g307xy_k$(this.subRequest5__1, this);
1674
+ if (suspendResult === get_COROUTINE_SUSPENDED4()) {
1675
+ return suspendResult;
1676
+ }
1677
+ continue $sm;
1678
+ case 2:
1679
+ this.call0__1 = suspendResult;
1680
+ if (!invoke$shouldRetry(this.retryCount1__1, this.maxRetries7__1, this.shouldRetry8__1, this.call0__1)) {
1681
+ this.state_1 = 4;
1682
+ suspendResult = throwOnInvalidResponseBody(this.call0__1.get_response_xlk07e_k$(), this);
1683
+ if (suspendResult === get_COROUTINE_SUSPENDED4()) {
1684
+ return suspendResult;
1685
+ }
1686
+ continue $sm;
1687
+ } else {
1688
+ this.state_1 = 3;
1689
+ continue $sm;
1690
+ }
1691
+ case 3:
1692
+ var tmp_5 = this;
1693
+ this.retryCount1__1 = this.retryCount1__1 + 1 | 0;
1694
+ tmp_5.TRY_RESULT4__1 = new (HttpRetryEventData())(this.subRequest5__1, this.retryCount1__1, this.call0__1.get_response_xlk07e_k$(), null);
1695
+ this.exceptionState_1 = 8;
1696
+ this.state_1 = 6;
1697
+ continue $sm;
1698
+ case 4:
1699
+ this.exceptionState_1 = 8;
1700
+ this.state_1 = 9;
1701
+ continue $sm;
1702
+ case 5:
1703
+ this.exceptionState_1 = 8;
1704
+ var tmp_6 = this.exception_1;
1705
+ if (tmp_6 instanceof Error) {
1706
+ var cause = this.exception_1;
1707
+ var tmp_7 = this;
1708
+ if (!invoke$shouldRetryOnException(this.retryCount1__1, this.maxRetries7__1, this.shouldRetryOnException6__1, this.subRequest5__1, cause)) {
1709
+ throw cause;
1710
+ }
1711
+ this.retryCount1__1 = this.retryCount1__1 + 1 | 0;
1712
+ tmp_7.TRY_RESULT4__1 = new (HttpRetryEventData())(this.subRequest5__1, this.retryCount1__1, null, cause);
1713
+ this.state_1 = 6;
1714
+ continue $sm;
1715
+ } else {
1716
+ throw this.exception_1;
1717
+ }
1718
+ case 6:
1719
+ this.exceptionState_1 = 8;
1720
+ var retryData = this.TRY_RESULT4__1;
1721
+ this.lastRetryData3__1 = retryData;
1722
+ this.$this_createClientPlugin_1.client_1.monitor_1.raise_3e7w7u_k$(get_HttpRequestRetryEvent(), this.lastRetryData3__1);
1723
+ var delayContext = new (HttpRetryDelayContext())(this.lastRetryData3__1.request_1, this.lastRetryData3__1.response_1, this.lastRetryData3__1.cause_1);
1724
+ this.state_1 = 7;
1725
+ suspendResult = this.$delay_1(this.delayMillis2__1(delayContext, this.retryCount1__1), this);
1726
+ if (suspendResult === get_COROUTINE_SUSPENDED4()) {
1727
+ return suspendResult;
1728
+ }
1729
+ continue $sm;
1730
+ case 7:
1731
+ var this_0 = get_LOGGER2();
1732
+ if (get_isTraceEnabled2(this_0)) {
1733
+ this_0.trace_fti9bv_k$("Retrying request " + this.request_1.url_1.toString() + " attempt: " + this.retryCount1__1);
1734
+ }
1735
+ this.state_1 = 1;
1736
+ continue $sm;
1737
+ case 8:
1738
+ throw this.exception_1;
1739
+ case 9:
1740
+ return this.call0__1;
1741
+ }
1742
+ } catch ($p) {
1743
+ var e = $p;
1744
+ if (this.exceptionState_1 === 8) {
1745
+ throw e;
1746
+ } else {
1747
+ this.state_1 = this.exceptionState_1;
1748
+ this.exception_1 = e;
1749
+ }
1750
+ }
1751
+ while (true);
1752
+ };
1753
+ protoOf6($).create_v0j3o4_k$ = function($this$on, request, completion) {
1754
+ var i = new (HttpRequestRetry$lambda$slambda_1())(this.$shouldRetry_1, this.$shouldRetryOnException_1, this.$maxRetries_1, this.$delayMillis_1, this.$modifyRequest_1, this.$this_createClientPlugin_1, this.$delay_1, completion);
1755
+ i.$this$on_1 = $this$on;
1756
+ i.request_1 = request;
1757
+ return i;
1758
+ };
1759
+ HttpRequestRetry$lambda$slambdaClass_0 = $;
1760
+ }
1761
+ return HttpRequestRetry$lambda$slambdaClass_0;
1762
+ }
1763
+ function HttpRequestRetry$lambda$slambda_2($shouldRetry, $shouldRetryOnException, $maxRetries, $delayMillis, $modifyRequest, $this_createClientPlugin, $delay, resultContinuation) {
1764
+ var i = new (HttpRequestRetry$lambda$slambda_1())($shouldRetry, $shouldRetryOnException, $maxRetries, $delayMillis, $modifyRequest, $this_createClientPlugin, $delay, resultContinuation);
1765
+ return constructCallableReference2(function($this$on, request, $completion) {
1766
+ return i.invoke_nc6r0k_k$($this$on, request, $completion);
1767
+ }, 2);
1768
+ }
1769
+ var $throwOnInvalidResponseBodyCOROUTINE$Class;
1770
+ function $throwOnInvalidResponseBodyCOROUTINE$() {
1771
+ if ($throwOnInvalidResponseBodyCOROUTINE$Class === VOID6) {
1772
+ let $ = function(_this__u8e3s4, resultContinuation) {
1773
+ CoroutineImpl4().call(this, resultContinuation);
1774
+ this._this__u8e3s4__1 = _this__u8e3s4;
1775
+ };
1776
+ initMetadataForCoroutine3($, CoroutineImpl4());
1777
+ protoOf6($).doResume_5yljmg_k$ = function() {
1778
+ var suspendResult = this.result_1;
1779
+ $sm: do
1780
+ try {
1781
+ var tmp = this.state_1;
1782
+ switch (tmp) {
1783
+ case 0:
1784
+ this.exceptionState_1 = 6;
1785
+ if (get_isSaved(this._this__u8e3s4__1)) {
1786
+ this.$this$run0__1 = this._this__u8e3s4__1.get_rawContent_u3f8li_k$();
1787
+ this.state_1 = 1;
1788
+ continue $sm;
1789
+ } else {
1790
+ this.WHEN_RESULT1__1 = false;
1791
+ this.state_1 = 4;
1792
+ continue $sm;
1793
+ }
1794
+ case 1:
1795
+ this.exceptionState_1 = 5;
1796
+ this.state_1 = 2;
1797
+ suspendResult = this.$this$run0__1.awaitContent$default_rxihsg_k$(VOID6, this);
1798
+ if (suspendResult === get_COROUTINE_SUSPENDED4()) {
1799
+ return suspendResult;
1800
+ }
1801
+ continue $sm;
1802
+ case 2:
1803
+ this.tmp$ret$02__1 = suspendResult;
1804
+ this.exceptionState_1 = 6;
1805
+ this.state_1 = 3;
1806
+ continue $sm;
1807
+ case 3:
1808
+ var tmp_0 = this.tmp$ret$02__1;
1809
+ this.exceptionState_1 = 6;
1810
+ var this_0 = this.$this$run0__1;
1811
+ var tmp_1;
1812
+ try {
1813
+ cancel2(this_0);
1814
+ tmp_1 = _Result___init__impl__xyqfz8(Unit_instance5);
1815
+ } catch ($p) {
1816
+ var tmp_2;
1817
+ if ($p instanceof Error) {
1818
+ var e = $p;
1819
+ tmp_2 = _Result___init__impl__xyqfz8(createFailure(e));
1820
+ } else {
1821
+ throw $p;
1822
+ }
1823
+ tmp_1 = tmp_2;
1824
+ }
1825
+ var this_1 = tmp_1;
1826
+ var tmp0_safe_receiver = Result__exceptionOrNull_impl_p6xea9(this_1);
1827
+ if (tmp0_safe_receiver == null)
1828
+ null;
1829
+ else {
1830
+ get_LOGGER2().debug_2dc8ew_k$("Failed to close response body channel", tmp0_safe_receiver);
1831
+ }
1832
+ this.WHEN_RESULT1__1 = tmp_0;
1833
+ this.state_1 = 4;
1834
+ continue $sm;
1835
+ case 4:
1836
+ return this.WHEN_RESULT1__1;
1837
+ case 5:
1838
+ this.exceptionState_1 = 6;
1839
+ var t = this.exception_1;
1840
+ var this_2 = this.$this$run0__1;
1841
+ var tmp_3;
1842
+ try {
1843
+ cancel2(this_2);
1844
+ tmp_3 = _Result___init__impl__xyqfz8(Unit_instance5);
1845
+ } catch ($p_0) {
1846
+ var tmp_4;
1847
+ if ($p_0 instanceof Error) {
1848
+ var e_0 = $p_0;
1849
+ tmp_4 = _Result___init__impl__xyqfz8(createFailure(e_0));
1850
+ } else {
1851
+ throw $p_0;
1852
+ }
1853
+ tmp_3 = tmp_4;
1854
+ }
1855
+ var this_3 = tmp_3;
1856
+ var tmp0_safe_receiver_0 = Result__exceptionOrNull_impl_p6xea9(this_3);
1857
+ if (tmp0_safe_receiver_0 == null)
1858
+ null;
1859
+ else {
1860
+ get_LOGGER2().debug_2dc8ew_k$("Failed to close response body channel", tmp0_safe_receiver_0);
1861
+ }
1862
+ throw t;
1863
+ case 6:
1864
+ throw this.exception_1;
1865
+ }
1866
+ } catch ($p_1) {
1867
+ var e_1 = $p_1;
1868
+ if (this.exceptionState_1 === 6) {
1869
+ throw e_1;
1870
+ } else {
1871
+ this.state_1 = this.exceptionState_1;
1872
+ this.exception_1 = e_1;
1873
+ }
1874
+ }
1875
+ while (true);
1876
+ };
1877
+ $throwOnInvalidResponseBodyCOROUTINE$Class = $;
1878
+ }
1879
+ return $throwOnInvalidResponseBodyCOROUTINE$Class;
1880
+ }
1881
+ var properties_initialized_HttpRequestRetry_kt_jcpv6l;
1882
+ function _init_properties_HttpRequestRetry_kt__h4xjtt() {
1883
+ if (!properties_initialized_HttpRequestRetry_kt_jcpv6l) {
1884
+ properties_initialized_HttpRequestRetry_kt_jcpv6l = true;
1885
+ LOGGER = KtorSimpleLogger2("io.ktor.client.plugins.HttpRequestRetry");
1886
+ HttpRequestRetryEvent = new (EventDefinition())();
1887
+ var tmp = HttpRequestRetryConfig$_init_$ref_mqbboi();
1888
+ HttpRequestRetry = createClientPlugin2("RetryFeature", tmp, HttpRequestRetry$lambda);
1889
+ var name = "MaxRetriesPerRequestAttributeKey";
1890
+ var tmp_0 = PrimitiveClasses_getInstance2().get_intClass_mw4y9a_k$();
1891
+ var tmp_1 = false ? false : false;
1892
+ var tmp_2;
1893
+ try {
1894
+ tmp_2 = createKType4(PrimitiveClasses_getInstance2().get_intClass_mw4y9a_k$(), arrayOf4([]), false);
1895
+ } catch ($p) {
1896
+ var tmp_3;
1897
+ if ($p instanceof Error) {
1898
+ var _unused_var__etf5q3 = $p;
1899
+ tmp_3 = null;
1900
+ } else {
1901
+ throw $p;
1902
+ }
1903
+ tmp_2 = tmp_3;
1904
+ }
1905
+ var tmp$ret$2 = tmp_2;
1906
+ var tmp$ret$1 = new (TypeInfo4())(tmp_0, tmp_1, tmp$ret$2);
1907
+ MaxRetriesPerRequestAttributeKey = new (AttributeKey4())(name, tmp$ret$1);
1908
+ var name_0 = "ShouldRetryPerRequestAttributeKey";
1909
+ var tmp_4 = PrimitiveClasses_getInstance2().functionClass(3);
1910
+ var tmp_5 = false ? false : false;
1911
+ var tmp_6;
1912
+ try {
1913
+ tmp_6 = createKType4(PrimitiveClasses_getInstance2().functionClass(3), arrayOf4([createInvariantKTypeProjection(createKType4(getKClass3(HttpRetryShouldRetryContext()), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(getKClass3(HttpRequest()), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(getKClass3(HttpResponse3()), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(PrimitiveClasses_getInstance2().get_booleanClass_d285fr_k$(), arrayOf4([]), false))]), false);
1914
+ } catch ($p_0) {
1915
+ var tmp_7;
1916
+ if ($p_0 instanceof Error) {
1917
+ var _unused_var__etf5q3_0 = $p_0;
1918
+ tmp_7 = null;
1919
+ } else {
1920
+ throw $p_0;
1921
+ }
1922
+ tmp_6 = tmp_7;
1923
+ }
1924
+ var tmp$ret$2_0 = tmp_6;
1925
+ var tmp$ret$1_0 = new (TypeInfo4())(tmp_4, tmp_5, tmp$ret$2_0);
1926
+ ShouldRetryPerRequestAttributeKey = new (AttributeKey4())(name_0, tmp$ret$1_0);
1927
+ var name_1 = "ShouldRetryOnExceptionPerRequestAttributeKey";
1928
+ var tmp_8 = PrimitiveClasses_getInstance2().functionClass(3);
1929
+ var tmp_9 = false ? false : false;
1930
+ var tmp_10;
1931
+ try {
1932
+ tmp_10 = createKType4(PrimitiveClasses_getInstance2().functionClass(3), arrayOf4([createInvariantKTypeProjection(createKType4(getKClass3(HttpRetryShouldRetryContext()), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(getKClass3(HttpRequestBuilder()), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(PrimitiveClasses_getInstance2().get_throwableClass_ee1a8x_k$(), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(PrimitiveClasses_getInstance2().get_booleanClass_d285fr_k$(), arrayOf4([]), false))]), false);
1933
+ } catch ($p_1) {
1934
+ var tmp_11;
1935
+ if ($p_1 instanceof Error) {
1936
+ var _unused_var__etf5q3_1 = $p_1;
1937
+ tmp_11 = null;
1938
+ } else {
1939
+ throw $p_1;
1940
+ }
1941
+ tmp_10 = tmp_11;
1942
+ }
1943
+ var tmp$ret$2_1 = tmp_10;
1944
+ var tmp$ret$1_1 = new (TypeInfo4())(tmp_8, tmp_9, tmp$ret$2_1);
1945
+ ShouldRetryOnExceptionPerRequestAttributeKey = new (AttributeKey4())(name_1, tmp$ret$1_1);
1946
+ var name_2 = "ModifyRequestPerRequestAttributeKey";
1947
+ var tmp_12 = PrimitiveClasses_getInstance2().functionClass(2);
1948
+ var tmp_13 = false ? false : false;
1949
+ var tmp_14;
1950
+ try {
1951
+ tmp_14 = createKType4(PrimitiveClasses_getInstance2().functionClass(2), arrayOf4([createInvariantKTypeProjection(createKType4(getKClass3(HttpRetryModifyRequestContext()), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(getKClass3(HttpRequestBuilder()), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(getKClass3(Unit2()), arrayOf4([]), false))]), false);
1952
+ } catch ($p_2) {
1953
+ var tmp_15;
1954
+ if ($p_2 instanceof Error) {
1955
+ var _unused_var__etf5q3_2 = $p_2;
1956
+ tmp_15 = null;
1957
+ } else {
1958
+ throw $p_2;
1959
+ }
1960
+ tmp_14 = tmp_15;
1961
+ }
1962
+ var tmp$ret$2_2 = tmp_14;
1963
+ var tmp$ret$1_2 = new (TypeInfo4())(tmp_12, tmp_13, tmp$ret$2_2);
1964
+ ModifyRequestPerRequestAttributeKey = new (AttributeKey4())(name_2, tmp$ret$1_2);
1965
+ var name_3 = "RetryDelayPerRequestAttributeKey";
1966
+ var tmp_16 = PrimitiveClasses_getInstance2().functionClass(2);
1967
+ var tmp_17 = false ? false : false;
1968
+ var tmp_18;
1969
+ try {
1970
+ tmp_18 = createKType4(PrimitiveClasses_getInstance2().functionClass(2), arrayOf4([createInvariantKTypeProjection(createKType4(getKClass3(HttpRetryDelayContext()), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(PrimitiveClasses_getInstance2().get_intClass_mw4y9a_k$(), arrayOf4([]), false)), createInvariantKTypeProjection(createKType4(PrimitiveClasses_getInstance2().get_longClass_a79cj7_k$(), arrayOf4([]), false))]), false);
1971
+ } catch ($p_3) {
1972
+ var tmp_19;
1973
+ if ($p_3 instanceof Error) {
1974
+ var _unused_var__etf5q3_3 = $p_3;
1975
+ tmp_19 = null;
1976
+ } else {
1977
+ throw $p_3;
1978
+ }
1979
+ tmp_18 = tmp_19;
1980
+ }
1981
+ var tmp$ret$2_3 = tmp_18;
1982
+ var tmp$ret$1_3 = new (TypeInfo4())(tmp_16, tmp_17, tmp$ret$2_3);
1983
+ RetryDelayPerRequestAttributeKey = new (AttributeKey4())(name_3, tmp$ret$1_3);
1984
+ }
1985
+ }
1986
+
1987
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/plugins/HttpSend.mjs
1988
+ import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl5 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
1989
+ import { Unit_instance3kz1zqli6gr1r as Unit_instance6 } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
1990
+ import {
1991
+ protoOf180f3jzyo7rfj as protoOf7,
1992
+ toString1pkumu07cwy4m as toString3,
1993
+ captureStack1fzi4aczwc4hg as captureStack2
1994
+ } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
1995
+ import { THROW_CCE2g6jy02ryeudk as THROW_CCE3 } from "../kotlin-kotlin-stdlib/kotlin/hacks.mjs";
1996
+ import { PipelineContext34fsb0mycu471 as PipelineContext2 } from "../ktor-ktor-utils/io/ktor/util/pipeline/PipelineContext.mjs";
1997
+ import {
1998
+ OutgoingContent3t2ohmyam9o76 as OutgoingContent2,
1999
+ NullBody_instance22vwyocs8eppk as NullBody_instance2
2000
+ } from "../ktor-ktor-http/io/ktor/http/content/OutgoingContent.mjs";
2001
+ import {
2002
+ getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression2,
2003
+ getKClass3t8tygqu4lcxf as getKClass4
2004
+ } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
2005
+ import { contentType2zzm38yxo3syt as contentType } from "../ktor-ktor-http/io/ktor/http/HttpMessageProperties.mjs";
2006
+ import {
2007
+ toString30pk9tzaqopn as toString_0,
2008
+ arrayOf1akklvh2at202 as arrayOf5
2009
+ } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
2010
+ import { trimMarginhyd3fsmh8iev as trimMargin } from "../kotlin-kotlin-stdlib/kotlin/text/Indent.mjs";
2011
+ import {
2012
+ IllegalStateException_init_$Create$38ax6c90susjc as IllegalStateException_init_$Create$3,
2013
+ IllegalStateExceptionkoljg5n0nrlr as IllegalStateException2,
2014
+ IllegalStateException_init_$Init$2lydy6bjiiso9 as IllegalStateException_init_$Init$2
2015
+ } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
2016
+ import { createKType31ecntyyaay3k as createKType5 } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
2017
+ import { TypeInfo2nbxsuf4v8os2 as TypeInfo5 } from "../ktor-ktor-utils/io/ktor/util/reflect/Type.mjs";
2018
+ import { reversed22y3au42jl32b as reversed } from "../kotlin-kotlin-stdlib/kotlin/collections/_Collections.mjs";
2019
+ import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED5 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
2020
+ import {
2021
+ initMetadataForLambda3af3he42mmnh as initMetadataForLambda3,
2022
+ initMetadataForCoroutine1i7lbatuf5bnt as initMetadataForCoroutine4,
2023
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass7,
2024
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject,
2025
+ initMetadataForInterface1egvbzx539z91 as initMetadataForInterface2
2026
+ } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
2027
+ import { VOID3gxj6tk5isa35 as VOID7 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
2028
+ import { constructCallableReference23y65rf941mch as constructCallableReference3 } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
2029
+ import { cancel36mj9lv3a0whl as cancel3 } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs";
2030
+ import { AttributeKey3aq8ytwgx54f7 as AttributeKey5 } from "../ktor-ktor-utils/io/ktor/util/Attributes.mjs";
2031
+ import { Phases_getInstance1dciif7svdqxc as Phases_getInstance2 } from "../ktor-ktor-client-core/io/ktor/client/request/HttpRequestPipeline.mjs";
2032
+ import { ArrayList_init_$Create$2xrifdqz5xirg as ArrayList_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/collections/ArrayListJs.mjs";
2033
+ var HttpSend$Plugin$install$slambdaClass;
2034
+ function HttpSend$Plugin$install$slambda() {
2035
+ if (HttpSend$Plugin$install$slambdaClass === VOID7) {
2036
+ let $ = function($plugin, $scope, resultContinuation) {
2037
+ this.$plugin_1 = $plugin;
2038
+ this.$scope_1 = $scope;
2039
+ CoroutineImpl5().call(this, resultContinuation);
2040
+ };
2041
+ initMetadataForLambda3($, CoroutineImpl5(), VOID7, [2]);
2042
+ protoOf7($).invoke_wpcgmu_k$ = function($this$intercept, content, $completion) {
2043
+ var tmp = this.create_l3tkcm_k$($this$intercept, content, $completion);
2044
+ tmp.result_1 = Unit_instance6;
2045
+ tmp.exception_1 = null;
2046
+ return tmp.doResume_5yljmg_k$();
2047
+ };
2048
+ protoOf7($).invoke_4tzzq6_k$ = function(p1, p2, $completion) {
2049
+ var tmp = p1 instanceof PipelineContext2() ? p1 : THROW_CCE3();
2050
+ return this.invoke_wpcgmu_k$(tmp, !(p2 == null) ? p2 : THROW_CCE3(), $completion);
2051
+ };
2052
+ protoOf7($).doResume_5yljmg_k$ = function() {
2053
+ var suspendResult = this.result_1;
2054
+ $sm: do
2055
+ try {
2056
+ var tmp = this.state_1;
2057
+ switch (tmp) {
2058
+ case 0:
2059
+ this.exceptionState_1 = 3;
2060
+ var tmp_0 = this.content_1;
2061
+ if (!(tmp_0 instanceof OutgoingContent2())) {
2062
+ var message = trimMargin("\n|Fail to prepare request body for sending. \n|The body type is: " + toString3(getKClassFromExpression2(this.content_1)) + ", with Content-Type: " + toString_0(contentType(this.$this$intercept_1.context_1)) + ".\n|\n|If you expect serialized body, please check that you have installed the corresponding plugin(like `ContentNegotiation`) and set `Content-Type` header.");
2063
+ throw IllegalStateException_init_$Create$3(toString3(message));
2064
+ }
2065
+ var tmp0 = this.$this$intercept_1.context_1;
2066
+ var body = this.content_1;
2067
+ if (body == null) {
2068
+ tmp0.body_1 = NullBody_instance2;
2069
+ var tmp_1 = getKClass4(OutgoingContent2());
2070
+ var tmp_2 = null instanceof OutgoingContent2();
2071
+ var tmp_3;
2072
+ try {
2073
+ tmp_3 = createKType5(getKClass4(OutgoingContent2()), arrayOf5([]), false);
2074
+ } catch ($p) {
2075
+ var tmp_4;
2076
+ if ($p instanceof Error) {
2077
+ var _unused_var__etf5q3 = $p;
2078
+ tmp_4 = null;
2079
+ } else {
2080
+ throw $p;
2081
+ }
2082
+ tmp_3 = tmp_4;
2083
+ }
2084
+ tmp0.set_bodyType_8pgqkl_k$(new (TypeInfo5())(tmp_1, tmp_2, tmp_3));
2085
+ } else {
2086
+ if (body instanceof OutgoingContent2()) {
2087
+ tmp0.body_1 = body;
2088
+ tmp0.set_bodyType_8pgqkl_k$(null);
2089
+ } else {
2090
+ tmp0.body_1 = body;
2091
+ var tmp_5 = getKClass4(OutgoingContent2());
2092
+ var tmp_6 = null instanceof OutgoingContent2();
2093
+ var tmp_7;
2094
+ try {
2095
+ tmp_7 = createKType5(getKClass4(OutgoingContent2()), arrayOf5([]), false);
2096
+ } catch ($p_0) {
2097
+ var tmp_8;
2098
+ if ($p_0 instanceof Error) {
2099
+ var _unused_var__etf5q3_0 = $p_0;
2100
+ tmp_8 = null;
2101
+ } else {
2102
+ throw $p_0;
2103
+ }
2104
+ tmp_7 = tmp_8;
2105
+ }
2106
+ tmp0.set_bodyType_8pgqkl_k$(new (TypeInfo5())(tmp_5, tmp_6, tmp_7));
2107
+ }
2108
+ }
2109
+ var maxRetries = this.$this$intercept_1.context_1.attributes_1.getOrNull_6mjt1v_k$(get_MaxRetriesPerRequestAttributeKey());
2110
+ var tmp_9;
2111
+ if (!(maxRetries == null) && maxRetries >= this.$plugin_1.maxSendCount_1) {
2112
+ var tmp_10;
2113
+ if (maxRetries < 2147483647) {
2114
+ tmp_10 = maxRetries + 1 | 0;
2115
+ } else {
2116
+ tmp_10 = maxRetries;
2117
+ }
2118
+ tmp_9 = tmp_10;
2119
+ } else {
2120
+ tmp_9 = this.$plugin_1.maxSendCount_1;
2121
+ }
2122
+ var maxSendCount = tmp_9;
2123
+ var realSender = new (DefaultSender())(maxSendCount, this.$scope_1);
2124
+ var interceptedSender = realSender;
2125
+ var _iterator__ex2g4s = reversed(this.$plugin_1.interceptors_1).iterator_jk1svi_k$();
2126
+ while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
2127
+ var interceptor = _iterator__ex2g4s.next_20eer_k$();
2128
+ interceptedSender = new (InterceptedSender())(interceptor, interceptedSender);
2129
+ }
2130
+ this.state_1 = 1;
2131
+ suspendResult = interceptedSender.execute_utzngx_k$(this.$this$intercept_1.context_1, this);
2132
+ if (suspendResult === get_COROUTINE_SUSPENDED5()) {
2133
+ return suspendResult;
2134
+ }
2135
+ continue $sm;
2136
+ case 1:
2137
+ var call = suspendResult;
2138
+ this.state_1 = 2;
2139
+ suspendResult = this.$this$intercept_1.proceedWith_i5skhv_k$(call, this);
2140
+ if (suspendResult === get_COROUTINE_SUSPENDED5()) {
2141
+ return suspendResult;
2142
+ }
2143
+ continue $sm;
2144
+ case 2:
2145
+ return Unit_instance6;
2146
+ case 3:
2147
+ throw this.exception_1;
2148
+ }
2149
+ } catch ($p_1) {
2150
+ var e = $p_1;
2151
+ if (this.exceptionState_1 === 3) {
2152
+ throw e;
2153
+ } else {
2154
+ this.state_1 = this.exceptionState_1;
2155
+ this.exception_1 = e;
2156
+ }
2157
+ }
2158
+ while (true);
2159
+ };
2160
+ protoOf7($).create_l3tkcm_k$ = function($this$intercept, content, completion) {
2161
+ var i = new (HttpSend$Plugin$install$slambda())(this.$plugin_1, this.$scope_1, completion);
2162
+ i.$this$intercept_1 = $this$intercept;
2163
+ i.content_1 = content;
2164
+ return i;
2165
+ };
2166
+ HttpSend$Plugin$install$slambdaClass = $;
2167
+ }
2168
+ return HttpSend$Plugin$install$slambdaClass;
2169
+ }
2170
+ function HttpSend$Plugin$install$slambda_0($plugin, $scope, resultContinuation) {
2171
+ var i = new (HttpSend$Plugin$install$slambda())($plugin, $scope, resultContinuation);
2172
+ return constructCallableReference3(function($this$intercept, content, $completion) {
2173
+ return i.invoke_wpcgmu_k$($this$intercept, content, $completion);
2174
+ }, 2);
2175
+ }
2176
+ var $executeCOROUTINE$Class;
2177
+ function $executeCOROUTINE$() {
2178
+ if ($executeCOROUTINE$Class === VOID7) {
2179
+ let $ = function(_this__u8e3s4, requestBuilder, resultContinuation) {
2180
+ CoroutineImpl5().call(this, resultContinuation);
2181
+ this._this__u8e3s4__1 = _this__u8e3s4;
2182
+ this.requestBuilder_1 = requestBuilder;
2183
+ };
2184
+ initMetadataForCoroutine4($, CoroutineImpl5());
2185
+ protoOf7($).doResume_5yljmg_k$ = function() {
2186
+ var suspendResult = this.result_1;
2187
+ $sm: do
2188
+ try {
2189
+ var tmp = this.state_1;
2190
+ switch (tmp) {
2191
+ case 0:
2192
+ this.exceptionState_1 = 2;
2193
+ var tmp0_safe_receiver = this._this__u8e3s4__1.currentCall_1;
2194
+ if (tmp0_safe_receiver == null)
2195
+ null;
2196
+ else {
2197
+ cancel3(tmp0_safe_receiver);
2198
+ }
2199
+ if (this._this__u8e3s4__1.sentCount_1 >= this._this__u8e3s4__1.maxSendCount_1) {
2200
+ throw new (SendCountExceedException())("Max send count " + this._this__u8e3s4__1.maxSendCount_1 + " exceeded. Consider increasing the property maxSendCount if more is required.");
2201
+ }
2202
+ var _unary__edvuaz = this._this__u8e3s4__1.sentCount_1;
2203
+ this._this__u8e3s4__1.sentCount_1 = _unary__edvuaz + 1 | 0;
2204
+ this.state_1 = 1;
2205
+ suspendResult = this._this__u8e3s4__1.client_1.sendPipeline_1.execute_qsx0hz_k$(this.requestBuilder_1, this.requestBuilder_1.body_1, this);
2206
+ if (suspendResult === get_COROUTINE_SUSPENDED5()) {
2207
+ return suspendResult;
2208
+ }
2209
+ continue $sm;
2210
+ case 1:
2211
+ var sendResult = suspendResult;
2212
+ var tmp1_elvis_lhs = sendResult instanceof HttpClientCall() ? sendResult : null;
2213
+ var tmp_0;
2214
+ if (tmp1_elvis_lhs == null) {
2215
+ var message = "Failed to execute send pipeline. Expected [HttpClientCall], but received " + toString3(sendResult);
2216
+ throw IllegalStateException_init_$Create$3(toString3(message));
2217
+ } else {
2218
+ tmp_0 = tmp1_elvis_lhs;
2219
+ }
2220
+ var call = tmp_0;
2221
+ this._this__u8e3s4__1.currentCall_1 = call;
2222
+ return call;
2223
+ case 2:
2224
+ throw this.exception_1;
2225
+ }
2226
+ } catch ($p) {
2227
+ var e = $p;
2228
+ if (this.exceptionState_1 === 2) {
2229
+ throw e;
2230
+ } else {
2231
+ this.state_1 = this.exceptionState_1;
2232
+ this.exception_1 = e;
2233
+ }
2234
+ }
2235
+ while (true);
2236
+ };
2237
+ $executeCOROUTINE$Class = $;
2238
+ }
2239
+ return $executeCOROUTINE$Class;
2240
+ }
2241
+ var ConfigClass;
2242
+ function Config() {
2243
+ if (ConfigClass === VOID7) {
2244
+ let $ = function() {
2245
+ this.maxSendCount_1 = 20;
2246
+ };
2247
+ initMetadataForClass7($, "Config", Config);
2248
+ ConfigClass = $;
2249
+ }
2250
+ return ConfigClass;
2251
+ }
2252
+ var PluginClass;
2253
+ function Plugin() {
2254
+ if (PluginClass === VOID7) {
2255
+ let $ = function() {
2256
+ Plugin_instance = this;
2257
+ var tmp = this;
2258
+ var name = "HttpSend";
2259
+ var tmp_0 = getKClass4(HttpSend());
2260
+ var tmp_1 = null instanceof HttpSend();
2261
+ var tmp_2;
2262
+ try {
2263
+ tmp_2 = createKType5(getKClass4(HttpSend()), arrayOf5([]), false);
2264
+ } catch ($p) {
2265
+ var tmp_3;
2266
+ if ($p instanceof Error) {
2267
+ var _unused_var__etf5q3 = $p;
2268
+ tmp_3 = null;
2269
+ } else {
2270
+ throw $p;
2271
+ }
2272
+ tmp_2 = tmp_3;
2273
+ }
2274
+ var tmp$ret$2 = tmp_2;
2275
+ var tmp$ret$1 = new (TypeInfo5())(tmp_0, tmp_1, tmp$ret$2);
2276
+ tmp.key_1 = new (AttributeKey5())(name, tmp$ret$1);
2277
+ };
2278
+ initMetadataForObject($, "Plugin");
2279
+ protoOf7($).get_key_18j28a_k$ = function() {
2280
+ return this.key_1;
2281
+ };
2282
+ protoOf7($).prepare_dfz635_k$ = function(block) {
2283
+ var this_0 = new (Config())();
2284
+ block(this_0);
2285
+ var config = this_0;
2286
+ return new (HttpSend())(config.maxSendCount_1);
2287
+ };
2288
+ protoOf7($).prepare_t1xtpw_k$ = function(block) {
2289
+ return this.prepare_dfz635_k$(block);
2290
+ };
2291
+ protoOf7($).install_ockxa1_k$ = function(plugin2, scope) {
2292
+ var tmp = Phases_getInstance2().Send_1;
2293
+ scope.requestPipeline_1.intercept_k21bv3_k$(tmp, HttpSend$Plugin$install$slambda_0(plugin2, scope, null));
2294
+ };
2295
+ protoOf7($).install_blfu15_k$ = function(plugin2, scope) {
2296
+ return this.install_ockxa1_k$(plugin2 instanceof HttpSend() ? plugin2 : THROW_CCE3(), scope);
2297
+ };
2298
+ PluginClass = $;
2299
+ }
2300
+ return PluginClass;
2301
+ }
2302
+ var Plugin_instance;
2303
+ function Plugin_getInstance() {
2304
+ if (Plugin_instance == null)
2305
+ new (Plugin())();
2306
+ return Plugin_instance;
2307
+ }
2308
+ var InterceptedSenderClass;
2309
+ function InterceptedSender() {
2310
+ if (InterceptedSenderClass === VOID7) {
2311
+ let $ = function(interceptor, nextSender) {
2312
+ this.interceptor_1 = interceptor;
2313
+ this.nextSender_1 = nextSender;
2314
+ };
2315
+ initMetadataForClass7($, "InterceptedSender", VOID7, VOID7, [Sender()], [1]);
2316
+ protoOf7($).execute_utzngx_k$ = function(requestBuilder, $completion) {
2317
+ return this.interceptor_1(this.nextSender_1, requestBuilder, $completion);
2318
+ };
2319
+ InterceptedSenderClass = $;
2320
+ }
2321
+ return InterceptedSenderClass;
2322
+ }
2323
+ var DefaultSenderClass;
2324
+ function DefaultSender() {
2325
+ if (DefaultSenderClass === VOID7) {
2326
+ let $ = function(maxSendCount, client) {
2327
+ this.maxSendCount_1 = maxSendCount;
2328
+ this.client_1 = client;
2329
+ this.sentCount_1 = 0;
2330
+ this.currentCall_1 = null;
2331
+ };
2332
+ initMetadataForClass7($, "DefaultSender", VOID7, VOID7, [Sender()], [1]);
2333
+ protoOf7($).execute_utzngx_k$ = function(requestBuilder, $completion) {
2334
+ var tmp = new ($executeCOROUTINE$())(this, requestBuilder, $completion);
2335
+ tmp.result_1 = Unit_instance6;
2336
+ tmp.exception_1 = null;
2337
+ return tmp.doResume_5yljmg_k$();
2338
+ };
2339
+ DefaultSenderClass = $;
2340
+ }
2341
+ return DefaultSenderClass;
2342
+ }
2343
+ var HttpSendClass;
2344
+ function HttpSend() {
2345
+ if (HttpSendClass === VOID7) {
2346
+ let $ = function(maxSendCount) {
2347
+ Plugin_getInstance();
2348
+ maxSendCount = maxSendCount === VOID7 ? 20 : maxSendCount;
2349
+ this.maxSendCount_1 = maxSendCount;
2350
+ var tmp = this;
2351
+ tmp.interceptors_1 = ArrayList_init_$Create$();
2352
+ };
2353
+ initMetadataForClass7($, "HttpSend");
2354
+ protoOf7($).intercept_abqmrc_k$ = function(block) {
2355
+ this.interceptors_1.add_utx5q5_k$(block);
2356
+ };
2357
+ HttpSendClass = $;
2358
+ }
2359
+ return HttpSendClass;
82
2360
  }
83
- function _get_closed__iwkfs1($this) {
84
- var tmp0_safe_receiver = $this.get_coroutineContext_115oqo_k$().get_y2st91_k$(Key_instance);
85
- var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_isActive_quafmh_k$();
86
- return !(tmp1_elvis_lhs == null ? false : tmp1_elvis_lhs);
2361
+ var SenderClass;
2362
+ function Sender() {
2363
+ if (SenderClass === VOID7) {
2364
+ let $ = function() {
2365
+ };
2366
+ initMetadataForInterface2($, "Sender", VOID7, VOID7, VOID7, [1]);
2367
+ SenderClass = $;
2368
+ }
2369
+ return SenderClass;
87
2370
  }
88
- function executeWithinCallContext($this, requestData, $completion) {
89
- var tmp = new ($executeWithinCallContextCOROUTINE$())($this, requestData, $completion);
90
- tmp.result_1 = Unit_instance;
91
- tmp.exception_1 = null;
92
- return tmp.doResume_5yljmg_k$();
2371
+ var SendCountExceedExceptionClass;
2372
+ function SendCountExceedException() {
2373
+ if (SendCountExceedExceptionClass === VOID7) {
2374
+ let $ = function(message) {
2375
+ IllegalStateException_init_$Init$2(message, this);
2376
+ captureStack2(this, SendCountExceedException());
2377
+ };
2378
+ initMetadataForClass7($, "SendCountExceedException", VOID7, IllegalStateException2());
2379
+ SendCountExceedExceptionClass = $;
2380
+ }
2381
+ return SendCountExceedExceptionClass;
93
2382
  }
94
- function checkExtensions($this, requestData) {
95
- var _iterator__ex2g4s = requestData.requiredCapabilities_1.iterator_jk1svi_k$();
96
- while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
97
- var requestedExtension = _iterator__ex2g4s.next_20eer_k$();
98
- if (!$this.get_supportedCapabilities_gwz15x_k$().contains_aljjnj_k$(requestedExtension)) {
99
- var message = "Engine doesn't support " + toString(requestedExtension);
100
- throw IllegalArgumentException_init_$Create$(toString(message));
101
- }
2383
+
2384
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/plugins/api/CommonHooks.mjs
2385
+ import { protoOf180f3jzyo7rfj as protoOf8 } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
2386
+ import { CoroutineScopefcb5f5dwqcas as CoroutineScope3 } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs";
2387
+ import {
2388
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass8,
2389
+ initMetadataForLambda3af3he42mmnh as initMetadataForLambda4,
2390
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject2
2391
+ } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
2392
+ import { VOID3gxj6tk5isa35 as VOID8 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
2393
+ import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl6 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
2394
+ import { Unit_instance3kz1zqli6gr1r as Unit_instance7 } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
2395
+ import { THROW_CCE2g6jy02ryeudk as THROW_CCE4 } from "../kotlin-kotlin-stdlib/kotlin/hacks.mjs";
2396
+ import {
2397
+ isInterface3d6p8outrmvmk as isInterface4,
2398
+ isSuspendFunction153vlp5l2npj9 as isSuspendFunction
2399
+ } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
2400
+ import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED6 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
2401
+ import { constructCallableReference23y65rf941mch as constructCallableReference4 } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
2402
+ import { plugin3vxt624hnu3pv as plugin } from "../ktor-ktor-client-core/io/ktor/client/plugins/HttpClientPlugin.mjs";
2403
+ import { PipelineContext34fsb0mycu471 as PipelineContext3 } from "../ktor-ktor-utils/io/ktor/util/pipeline/PipelineContext.mjs";
2404
+ import { Phases_getInstance1dciif7svdqxc as Phases_getInstance3 } from "../ktor-ktor-client-core/io/ktor/client/request/HttpRequestPipeline.mjs";
2405
+ var SenderClass2;
2406
+ function Sender_0() {
2407
+ if (SenderClass2 === VOID8) {
2408
+ let $ = function(httpSendSender, coroutineContext) {
2409
+ this.httpSendSender_1 = httpSendSender;
2410
+ this.coroutineContext_1 = coroutineContext;
2411
+ };
2412
+ initMetadataForClass8($, "Sender", VOID8, VOID8, [CoroutineScope3()], [1]);
2413
+ protoOf8($).get_coroutineContext_115oqo_k$ = function() {
2414
+ return this.coroutineContext_1;
2415
+ };
2416
+ protoOf8($).proceed_g307xy_k$ = function(requestBuilder, $completion) {
2417
+ return this.httpSendSender_1.execute_utzngx_k$(requestBuilder, $completion);
2418
+ };
2419
+ SenderClass2 = $;
102
2420
  }
2421
+ return SenderClass2;
103
2422
  }
104
- var HttpClientEngine$install$slambdaClass;
105
- function HttpClientEngine$install$slambda() {
106
- if (HttpClientEngine$install$slambdaClass === VOID) {
107
- let $ = function($client, this$0, resultContinuation) {
2423
+ var Send$install$slambdaClass;
2424
+ function Send$install$slambda() {
2425
+ if (Send$install$slambdaClass === VOID8) {
2426
+ let $ = function($handler, $client, resultContinuation) {
2427
+ this.$handler_1 = $handler;
108
2428
  this.$client_1 = $client;
109
- this.this$0__1 = this$0;
110
- CoroutineImpl().call(this, resultContinuation);
2429
+ CoroutineImpl6().call(this, resultContinuation);
111
2430
  };
112
- initMetadataForLambda($, CoroutineImpl(), VOID, [2]);
113
- protoOf($).invoke_wpcgmu_k$ = function($this$intercept, content, $completion) {
114
- var tmp = this.create_l3tkcm_k$($this$intercept, content, $completion);
115
- tmp.result_1 = Unit_instance;
2431
+ initMetadataForLambda4($, CoroutineImpl6(), VOID8, [2]);
2432
+ protoOf8($).invoke_3g07tk_k$ = function($this$intercept, request, $completion) {
2433
+ var tmp = this.create_wps5aw_k$($this$intercept, request, $completion);
2434
+ tmp.result_1 = Unit_instance7;
116
2435
  tmp.exception_1 = null;
117
2436
  return tmp.doResume_5yljmg_k$();
118
2437
  };
119
- protoOf($).invoke_4tzzq6_k$ = function(p1, p2, $completion) {
120
- var tmp = p1 instanceof PipelineContext() ? p1 : THROW_CCE();
121
- return this.invoke_wpcgmu_k$(tmp, !(p2 == null) ? p2 : THROW_CCE(), $completion);
2438
+ protoOf8($).invoke_4tzzq6_k$ = function(p1, p2, $completion) {
2439
+ var tmp = (!(p1 == null) ? isInterface4(p1, Sender()) : false) ? p1 : THROW_CCE4();
2440
+ return this.invoke_3g07tk_k$(tmp, p2 instanceof HttpRequestBuilder() ? p2 : THROW_CCE4(), $completion);
122
2441
  };
123
- protoOf($).doResume_5yljmg_k$ = function() {
2442
+ protoOf8($).doResume_5yljmg_k$ = function() {
124
2443
  var suspendResult = this.result_1;
125
2444
  $sm: do
126
2445
  try {
127
2446
  var tmp = this.state_1;
128
2447
  switch (tmp) {
129
2448
  case 0:
130
- this.exceptionState_1 = 3;
131
- var this_0 = new (HttpRequestBuilder())();
132
- this_0.takeFromWithExecutionContext_gp1ep9_k$(this.$this$intercept_1.context_1);
133
- var body = this.content_1;
134
- if (body == null) {
135
- this_0.body_1 = NullBody_instance;
136
- var tmp_0 = PrimitiveClasses_getInstance().get_anyClass_x0jl4l_k$();
137
- var tmp_1 = false;
138
- var tmp_2;
139
- try {
140
- tmp_2 = createKType(PrimitiveClasses_getInstance().get_anyClass_x0jl4l_k$(), arrayOf([]), false);
141
- } catch ($p) {
142
- var tmp_3;
143
- if ($p instanceof Error) {
144
- var _unused_var__etf5q3 = $p;
145
- tmp_3 = null;
146
- } else {
147
- throw $p;
148
- }
149
- tmp_2 = tmp_3;
150
- }
151
- this_0.set_bodyType_8pgqkl_k$(new (TypeInfo())(tmp_0, tmp_1, tmp_2));
152
- } else {
153
- if (body instanceof OutgoingContent()) {
154
- this_0.body_1 = body;
155
- this_0.set_bodyType_8pgqkl_k$(null);
156
- } else {
157
- this_0.body_1 = body;
158
- var tmp_4 = PrimitiveClasses_getInstance().get_anyClass_x0jl4l_k$();
159
- var tmp_5 = false;
160
- var tmp_6;
161
- try {
162
- tmp_6 = createKType(PrimitiveClasses_getInstance().get_anyClass_x0jl4l_k$(), arrayOf([]), false);
163
- } catch ($p_0) {
164
- var tmp_7;
165
- if ($p_0 instanceof Error) {
166
- var _unused_var__etf5q3_0 = $p_0;
167
- tmp_7 = null;
168
- } else {
169
- throw $p_0;
170
- }
171
- tmp_6 = tmp_7;
172
- }
173
- this_0.set_bodyType_8pgqkl_k$(new (TypeInfo())(tmp_4, tmp_5, tmp_6));
174
- }
175
- }
176
- var builder = this_0;
177
- this.$client_1.monitor_1.raise_3e7w7u_k$(get_HttpRequestIsReadyForSending(), builder);
178
- var tmp_8 = this;
179
- var this_1 = builder.build_1k0s4u_k$();
180
- this_1.attributes_1.put_gkntno_k$(get_CLIENT_CONFIG(), this.$client_1.config_1);
181
- tmp_8.requestData0__1 = this_1;
182
- validateHeaders(this.requestData0__1);
183
- checkExtensions(this.this$0__1, this.requestData0__1);
2449
+ this.exceptionState_1 = 2;
184
2450
  this.state_1 = 1;
185
- suspendResult = executeWithinCallContext(this.this$0__1, this.requestData0__1, this);
186
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
2451
+ suspendResult = this.$handler_1(new (Sender_0())(this.$this$intercept_1, this.$client_1.coroutineContext_1), this.request_1, this);
2452
+ if (suspendResult === get_COROUTINE_SUSPENDED6()) {
187
2453
  return suspendResult;
188
2454
  }
189
2455
  continue $sm;
190
2456
  case 1:
191
- var responseData = suspendResult;
192
- var call = HttpClientCall_init_$Create$(this.$client_1, this.requestData0__1, responseData);
193
- var response = call.get_response_xlk07e_k$();
194
- this.$client_1.monitor_1.raise_3e7w7u_k$(get_HttpResponseReceived(), response);
195
- var tmp_9 = get_job(response.get_coroutineContext_115oqo_k$());
196
- tmp_9.invokeOnCompletion_n6cffu_k$(HttpClientEngine$install$slambda$lambda(this.$client_1, response));
197
- this.state_1 = 2;
198
- suspendResult = this.$this$intercept_1.proceedWith_i5skhv_k$(call, this);
199
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
2457
+ return suspendResult;
2458
+ case 2:
2459
+ throw this.exception_1;
2460
+ }
2461
+ } catch ($p) {
2462
+ var e = $p;
2463
+ if (this.exceptionState_1 === 2) {
2464
+ throw e;
2465
+ } else {
2466
+ this.state_1 = this.exceptionState_1;
2467
+ this.exception_1 = e;
2468
+ }
2469
+ }
2470
+ while (true);
2471
+ };
2472
+ protoOf8($).create_wps5aw_k$ = function($this$intercept, request, completion) {
2473
+ var i = new (Send$install$slambda())(this.$handler_1, this.$client_1, completion);
2474
+ i.$this$intercept_1 = $this$intercept;
2475
+ i.request_1 = request;
2476
+ return i;
2477
+ };
2478
+ Send$install$slambdaClass = $;
2479
+ }
2480
+ return Send$install$slambdaClass;
2481
+ }
2482
+ function Send$install$slambda_0($handler, $client, resultContinuation) {
2483
+ var i = new (Send$install$slambda())($handler, $client, resultContinuation);
2484
+ return constructCallableReference4(function($this$intercept, request, $completion) {
2485
+ return i.invoke_3g07tk_k$($this$intercept, request, $completion);
2486
+ }, 2);
2487
+ }
2488
+ var SendClass;
2489
+ function Send() {
2490
+ if (SendClass === VOID8) {
2491
+ let $ = function() {
2492
+ };
2493
+ initMetadataForObject2($, "Send");
2494
+ protoOf8($).install_leuazd_k$ = function(client, handler) {
2495
+ var tmp = plugin(client, Plugin_getInstance());
2496
+ tmp.intercept_abqmrc_k$(Send$install$slambda_0(handler, client, null));
2497
+ };
2498
+ protoOf8($).install_lt2lq8_k$ = function(client, handler) {
2499
+ return this.install_leuazd_k$(client, (!(handler == null) ? isSuspendFunction(handler, 2) : false) ? handler : THROW_CCE4());
2500
+ };
2501
+ SendClass = $;
2502
+ }
2503
+ return SendClass;
2504
+ }
2505
+ var Send_instance;
2506
+ function Send_getInstance() {
2507
+ return Send_instance;
2508
+ }
2509
+ var SetupRequest$install$slambdaClass;
2510
+ function SetupRequest$install$slambda() {
2511
+ if (SetupRequest$install$slambdaClass === VOID8) {
2512
+ let $ = function($handler, resultContinuation) {
2513
+ this.$handler_1 = $handler;
2514
+ CoroutineImpl6().call(this, resultContinuation);
2515
+ };
2516
+ initMetadataForLambda4($, CoroutineImpl6(), VOID8, [2]);
2517
+ protoOf8($).invoke_wpcgmu_k$ = function($this$intercept, it, $completion) {
2518
+ var tmp = this.create_l3tkcm_k$($this$intercept, it, $completion);
2519
+ tmp.result_1 = Unit_instance7;
2520
+ tmp.exception_1 = null;
2521
+ return tmp.doResume_5yljmg_k$();
2522
+ };
2523
+ protoOf8($).invoke_4tzzq6_k$ = function(p1, p2, $completion) {
2524
+ var tmp = p1 instanceof PipelineContext3() ? p1 : THROW_CCE4();
2525
+ return this.invoke_wpcgmu_k$(tmp, !(p2 == null) ? p2 : THROW_CCE4(), $completion);
2526
+ };
2527
+ protoOf8($).doResume_5yljmg_k$ = function() {
2528
+ var suspendResult = this.result_1;
2529
+ $sm: do
2530
+ try {
2531
+ var tmp = this.state_1;
2532
+ switch (tmp) {
2533
+ case 0:
2534
+ this.exceptionState_1 = 2;
2535
+ this.state_1 = 1;
2536
+ suspendResult = this.$handler_1(this.$this$intercept_1.context_1, this);
2537
+ if (suspendResult === get_COROUTINE_SUSPENDED6()) {
200
2538
  return suspendResult;
201
2539
  }
202
2540
  continue $sm;
2541
+ case 1:
2542
+ return Unit_instance7;
203
2543
  case 2:
204
- return Unit_instance;
205
- case 3:
206
2544
  throw this.exception_1;
207
2545
  }
208
- } catch ($p_1) {
209
- var e = $p_1;
210
- if (this.exceptionState_1 === 3) {
2546
+ } catch ($p) {
2547
+ var e = $p;
2548
+ if (this.exceptionState_1 === 2) {
211
2549
  throw e;
212
2550
  } else {
213
2551
  this.state_1 = this.exceptionState_1;
@@ -216,41 +2554,352 @@ function HttpClientEngine$install$slambda() {
216
2554
  }
217
2555
  while (true);
218
2556
  };
219
- protoOf($).create_l3tkcm_k$ = function($this$intercept, content, completion) {
220
- var i = new (HttpClientEngine$install$slambda())(this.$client_1, this.this$0__1, completion);
2557
+ protoOf8($).create_l3tkcm_k$ = function($this$intercept, it, completion) {
2558
+ var i = new (SetupRequest$install$slambda())(this.$handler_1, completion);
221
2559
  i.$this$intercept_1 = $this$intercept;
222
- i.content_1 = content;
2560
+ i.it_1 = it;
223
2561
  return i;
224
2562
  };
225
- HttpClientEngine$install$slambdaClass = $;
2563
+ SetupRequest$install$slambdaClass = $;
226
2564
  }
227
- return HttpClientEngine$install$slambdaClass;
2565
+ return SetupRequest$install$slambdaClass;
228
2566
  }
229
- function HttpClientEngine$install$slambda_0($client, this$0, resultContinuation) {
230
- var i = new (HttpClientEngine$install$slambda())($client, this$0, resultContinuation);
231
- return constructCallableReference(function($this$intercept, content, $completion) {
232
- return i.invoke_wpcgmu_k$($this$intercept, content, $completion);
2567
+ function SetupRequest$install$slambda_0($handler, resultContinuation) {
2568
+ var i = new (SetupRequest$install$slambda())($handler, resultContinuation);
2569
+ return constructCallableReference4(function($this$intercept, it, $completion) {
2570
+ return i.invoke_wpcgmu_k$($this$intercept, it, $completion);
233
2571
  }, 2);
234
2572
  }
235
- var HttpClientEngine$executeWithinCallContext$slambdaClass;
236
- function HttpClientEngine$executeWithinCallContext$slambda() {
237
- if (HttpClientEngine$executeWithinCallContext$slambdaClass === VOID) {
238
- let $ = function(this$0, $requestData, resultContinuation) {
239
- this.this$0__1 = this$0;
240
- this.$requestData_1 = $requestData;
241
- CoroutineImpl().call(this, resultContinuation);
2573
+ var SetupRequestClass;
2574
+ function SetupRequest() {
2575
+ if (SetupRequestClass === VOID8) {
2576
+ let $ = function() {
2577
+ };
2578
+ initMetadataForObject2($, "SetupRequest");
2579
+ protoOf8($).install_4bq0dz_k$ = function(client, handler) {
2580
+ var tmp = Phases_getInstance3().Before_1;
2581
+ client.requestPipeline_1.intercept_k21bv3_k$(tmp, SetupRequest$install$slambda_0(handler, null));
2582
+ };
2583
+ protoOf8($).install_lt2lq8_k$ = function(client, handler) {
2584
+ return this.install_4bq0dz_k$(client, (!(handler == null) ? isSuspendFunction(handler, 1) : false) ? handler : THROW_CCE4());
2585
+ };
2586
+ SetupRequestClass = $;
2587
+ }
2588
+ return SetupRequestClass;
2589
+ }
2590
+ var SetupRequest_instance;
2591
+ function SetupRequest_getInstance() {
2592
+ return SetupRequest_instance;
2593
+ }
2594
+ Send_instance = new (Send())();
2595
+ SetupRequest_instance = new (SetupRequest())();
2596
+
2597
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/plugins/HttpTimeout.mjs
2598
+ import { VOID3gxj6tk5isa35 as VOID9 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
2599
+ import {
2600
+ protoOf180f3jzyo7rfj as protoOf9,
2601
+ objectCreate1ve4bgxiu4x98 as objectCreate2,
2602
+ toString1pkumu07cwy4m as toString4,
2603
+ hashCodeq5arwsb9dgti as hashCode,
2604
+ captureStack1fzi4aczwc4hg as captureStack3
2605
+ } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
2606
+ import { IllegalArgumentException_init_$Create$1gox8sdqs91jy as IllegalArgumentException_init_$Create$ } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
2607
+ import { Unit_instance3kz1zqli6gr1r as Unit_instance8 } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
2608
+ import {
2609
+ getKClass3t8tygqu4lcxf as getKClass5,
2610
+ getKClassFromExpression348iqjl4fnx2f as getKClassFromExpression3
2611
+ } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
2612
+ import { arrayOf1akklvh2at202 as arrayOf6 } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
2613
+ import { createKType31ecntyyaay3k as createKType6 } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
2614
+ import { TypeInfo2nbxsuf4v8os2 as TypeInfo6 } from "../ktor-ktor-utils/io/ktor/util/reflect/Type.mjs";
2615
+ import { AttributeKey3aq8ytwgx54f7 as AttributeKey6 } from "../ktor-ktor-utils/io/ktor/util/Attributes.mjs";
2616
+ import {
2617
+ initMetadataForCompanion1wyw17z38v6ac as initMetadataForCompanion3,
2618
+ initMetadataForClassbxx6q50dy2s7 as initMetadataForClass9,
2619
+ initMetadataForObject1cxne3s9w65el as initMetadataForObject3,
2620
+ initMetadataForLambda3af3he42mmnh as initMetadataForLambda5
2621
+ } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
2622
+ import {
2623
+ THROW_CCE2g6jy02ryeudk as THROW_CCE5,
2624
+ ensureNotNull1e947j3ixpazm as ensureNotNull2
2625
+ } from "../kotlin-kotlin-stdlib/kotlin/hacks.mjs";
2626
+ import {
2627
+ IOException1wyutdmfe71nu as IOException,
2628
+ IOException_init_$Init$dftcwzvixao1 as IOException_init_$Init$
2629
+ } from "../kotlinx-io-kotlinx-io-core/kotlinx/io/-PlatformJs.mjs";
2630
+ import { CopyableThrowable1mvc99jcyvivf as CopyableThrowable } from "../kotlinx-coroutines-core/kotlinx/coroutines/Debug.common.mjs";
2631
+ import { ClientUpgradeContent299vg0lx1tyfp as ClientUpgradeContent2 } from "../ktor-ktor-client-core/io/ktor/client/request/ClientUpgradeContent.mjs";
2632
+ import { isWebsocket1w1xog9vfgwm1 as isWebsocket } from "../ktor-ktor-http/io/ktor/http/URLProtocol.mjs";
2633
+ import { SSEClientContent14bbfeddoyr65 as SSEClientContent } from "../ktor-ktor-client-core/io/ktor/client/plugins/sse/SSEClientContent.mjs";
2634
+ import { CoroutineName2g5zosw74tf0f as CoroutineName } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineName.mjs";
2635
+ import { launch1c91vkjzdi9sd as launch } from "../kotlinx-coroutines-core/kotlinx/coroutines/Builders.common.mjs";
2636
+ import { constructCallableReference23y65rf941mch as constructCallableReference5 } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
2637
+ import { CoroutineImpl2sn3kjnwmfr10 as CoroutineImpl7 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/CoroutineImpl.mjs";
2638
+ import { get_COROUTINE_SUSPENDED3ujt3p13qm4iy as get_COROUTINE_SUSPENDED7 } from "../kotlin-kotlin-stdlib/kotlin/coroutines/intrinsics/Intrinsics.mjs";
2639
+ import { CoroutineScopefcb5f5dwqcas as CoroutineScope4 } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineScope.mjs";
2640
+ import { isInterface3d6p8outrmvmk as isInterface5 } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
2641
+ import {
2642
+ Companion_getInstance2jahap30xtp3t as Companion_getInstance3,
2643
+ toDurationba1nlt78o6vu as toDuration
2644
+ } from "../kotlin-kotlin-stdlib/kotlin/time/Duration.mjs";
2645
+ import { DurationUnit_MILLISECONDS_getInstancedq9xrzm1t8sm as DurationUnit_MILLISECONDS_getInstance } from "../kotlin-kotlin-stdlib/kotlin/time/DurationUnitJs.mjs";
2646
+ import { delay2kng7ucb3aj62 as delay2 } from "../kotlinx-coroutines-core/kotlinx/coroutines/Delay.mjs";
2647
+ import { get_isTraceEnabled82xibuu04nxp as get_isTraceEnabled3 } from "../ktor-ktor-utils/io/ktor/util/logging/Logger.web.mjs";
2648
+ import { cancel1xim2hrvjmwpn as cancel4 } from "../kotlinx-coroutines-core/kotlinx/coroutines/Job.mjs";
2649
+ import { KtorSimpleLogger1xdphsp5l4e48 as KtorSimpleLogger3 } from "../ktor-ktor-utils/io/ktor/util/logging/KtorSimpleLogger.web.mjs";
2650
+ import { createClientPluginjwpvufjows5r as createClientPlugin3 } from "../ktor-ktor-client-core/io/ktor/client/plugins/api/CreatePluginUtils.mjs";
2651
+ var imul = Math.imul;
2652
+ function get_LOGGER3() {
2653
+ _init_properties_HttpTimeout_kt__pucqrr();
2654
+ return LOGGER2;
2655
+ }
2656
+ var LOGGER2;
2657
+ function get_HttpTimeout() {
2658
+ _init_properties_HttpTimeout_kt__pucqrr();
2659
+ return HttpTimeout;
2660
+ }
2661
+ var HttpTimeout;
2662
+ function HttpTimeoutConfig_init_$Init$(requestTimeoutMillis, connectTimeoutMillis, socketTimeoutMillis, $this) {
2663
+ requestTimeoutMillis = requestTimeoutMillis === VOID9 ? null : requestTimeoutMillis;
2664
+ connectTimeoutMillis = connectTimeoutMillis === VOID9 ? null : connectTimeoutMillis;
2665
+ socketTimeoutMillis = socketTimeoutMillis === VOID9 ? null : socketTimeoutMillis;
2666
+ HttpTimeoutConfig().call($this);
2667
+ $this.set_requestTimeoutMillis_9cb75s_k$(requestTimeoutMillis);
2668
+ $this.set_connectTimeoutMillis_48d5dx_k$(connectTimeoutMillis);
2669
+ $this.set_socketTimeoutMillis_faj43m_k$(socketTimeoutMillis);
2670
+ return $this;
2671
+ }
2672
+ function HttpTimeoutConfig_init_$Create$(requestTimeoutMillis, connectTimeoutMillis, socketTimeoutMillis) {
2673
+ return HttpTimeoutConfig_init_$Init$(requestTimeoutMillis, connectTimeoutMillis, socketTimeoutMillis, objectCreate2(protoOf9(HttpTimeoutConfig())));
2674
+ }
2675
+ function checkTimeoutValue($this, value) {
2676
+ if (!(value == null || value > 0n)) {
2677
+ var message = "Only positive timeout values are allowed, for infinite timeout use HttpTimeoutConfig.INFINITE_TIMEOUT_MS";
2678
+ throw IllegalArgumentException_init_$Create$(toString4(message));
2679
+ }
2680
+ return value;
2681
+ }
2682
+ var CompanionClass3;
2683
+ function Companion3() {
2684
+ if (CompanionClass3 === VOID9) {
2685
+ let $ = function() {
2686
+ Companion_instance4 = this;
2687
+ this.INFINITE_TIMEOUT_MS_1 = 9223372036854775807n;
2688
+ var tmp = this;
2689
+ var name = "TimeoutConfiguration";
2690
+ var tmp_0 = getKClass5(HttpTimeoutConfig());
2691
+ var tmp_1 = null instanceof HttpTimeoutConfig();
2692
+ var tmp_2;
2693
+ try {
2694
+ tmp_2 = createKType6(getKClass5(HttpTimeoutConfig()), arrayOf6([]), false);
2695
+ } catch ($p) {
2696
+ var tmp_3;
2697
+ if ($p instanceof Error) {
2698
+ var _unused_var__etf5q3 = $p;
2699
+ tmp_3 = null;
2700
+ } else {
2701
+ throw $p;
2702
+ }
2703
+ tmp_2 = tmp_3;
2704
+ }
2705
+ var tmp$ret$2 = tmp_2;
2706
+ var tmp$ret$1 = new (TypeInfo6())(tmp_0, tmp_1, tmp$ret$2);
2707
+ tmp.key_1 = new (AttributeKey6())(name, tmp$ret$1);
2708
+ };
2709
+ initMetadataForCompanion3($);
2710
+ CompanionClass3 = $;
2711
+ }
2712
+ return CompanionClass3;
2713
+ }
2714
+ var Companion_instance4;
2715
+ function Companion_getInstance_02() {
2716
+ if (Companion_instance4 == null)
2717
+ new (Companion3())();
2718
+ return Companion_instance4;
2719
+ }
2720
+ var HttpTimeoutConfigClass;
2721
+ function HttpTimeoutConfig() {
2722
+ if (HttpTimeoutConfigClass === VOID9) {
2723
+ let $ = function() {
2724
+ Companion_getInstance_02();
2725
+ this._requestTimeoutMillis_1 = 0n;
2726
+ this._connectTimeoutMillis_1 = 0n;
2727
+ this._socketTimeoutMillis_1 = 0n;
2728
+ };
2729
+ initMetadataForClass9($, "HttpTimeoutConfig", HttpTimeoutConfig_init_$Create$);
2730
+ protoOf9($).set_requestTimeoutMillis_9cb75s_k$ = function(value) {
2731
+ this._requestTimeoutMillis_1 = checkTimeoutValue(this, value);
2732
+ };
2733
+ protoOf9($).get_requestTimeoutMillis_rgkxdt_k$ = function() {
2734
+ return this._requestTimeoutMillis_1;
2735
+ };
2736
+ protoOf9($).set_connectTimeoutMillis_48d5dx_k$ = function(value) {
2737
+ this._connectTimeoutMillis_1 = checkTimeoutValue(this, value);
2738
+ };
2739
+ protoOf9($).get_connectTimeoutMillis_jog9kq_k$ = function() {
2740
+ return this._connectTimeoutMillis_1;
2741
+ };
2742
+ protoOf9($).set_socketTimeoutMillis_faj43m_k$ = function(value) {
2743
+ this._socketTimeoutMillis_1 = checkTimeoutValue(this, value);
2744
+ };
2745
+ protoOf9($).get_socketTimeoutMillis_3uzxud_k$ = function() {
2746
+ return this._socketTimeoutMillis_1;
2747
+ };
2748
+ protoOf9($).equals = function(other) {
2749
+ if (this === other)
2750
+ return true;
2751
+ if (other == null || !getKClassFromExpression3(this).equals(getKClassFromExpression3(other)))
2752
+ return false;
2753
+ if (!(other instanceof HttpTimeoutConfig()))
2754
+ THROW_CCE5();
2755
+ if (!(this._requestTimeoutMillis_1 == other._requestTimeoutMillis_1))
2756
+ return false;
2757
+ if (!(this._connectTimeoutMillis_1 == other._connectTimeoutMillis_1))
2758
+ return false;
2759
+ if (!(this._socketTimeoutMillis_1 == other._socketTimeoutMillis_1))
2760
+ return false;
2761
+ return true;
2762
+ };
2763
+ protoOf9($).hashCode = function() {
2764
+ var tmp0_safe_receiver = this._requestTimeoutMillis_1;
2765
+ var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : hashCode(tmp0_safe_receiver);
2766
+ var result = tmp1_elvis_lhs == null ? 0 : tmp1_elvis_lhs;
2767
+ var tmp = imul(31, result);
2768
+ var tmp0_safe_receiver_0 = this._connectTimeoutMillis_1;
2769
+ var tmp1_elvis_lhs_0 = tmp0_safe_receiver_0 == null ? null : hashCode(tmp0_safe_receiver_0);
2770
+ result = tmp + (tmp1_elvis_lhs_0 == null ? 0 : tmp1_elvis_lhs_0) | 0;
2771
+ var tmp_0 = imul(31, result);
2772
+ var tmp0_safe_receiver_1 = this._socketTimeoutMillis_1;
2773
+ var tmp1_elvis_lhs_1 = tmp0_safe_receiver_1 == null ? null : hashCode(tmp0_safe_receiver_1);
2774
+ result = tmp_0 + (tmp1_elvis_lhs_1 == null ? 0 : tmp1_elvis_lhs_1) | 0;
2775
+ return result;
2776
+ };
2777
+ HttpTimeoutConfigClass = $;
2778
+ }
2779
+ return HttpTimeoutConfigClass;
2780
+ }
2781
+ var HttpTimeoutCapabilityClass;
2782
+ function HttpTimeoutCapability() {
2783
+ if (HttpTimeoutCapabilityClass === VOID9) {
2784
+ let $ = function() {
2785
+ };
2786
+ initMetadataForObject3($, "HttpTimeoutCapability", VOID9, VOID9, [HttpClientEngineCapability()]);
2787
+ protoOf9($).toString = function() {
2788
+ return "HttpTimeoutCapability";
2789
+ };
2790
+ protoOf9($).hashCode = function() {
2791
+ return 2058496954;
2792
+ };
2793
+ protoOf9($).equals = function(other) {
2794
+ if (this === other)
2795
+ return true;
2796
+ if (!(other instanceof HttpTimeoutCapability()))
2797
+ return false;
2798
+ return true;
2799
+ };
2800
+ HttpTimeoutCapabilityClass = $;
2801
+ }
2802
+ return HttpTimeoutCapabilityClass;
2803
+ }
2804
+ var HttpTimeoutCapability_instance;
2805
+ function HttpTimeoutCapability_getInstance() {
2806
+ return HttpTimeoutCapability_instance;
2807
+ }
2808
+ function HttpRequestTimeoutException_init_$Init$(request, $this) {
2809
+ var tmp = request.url_1.buildString_xr87oh_k$();
2810
+ var tmp0_safe_receiver = request.getCapabilityOrNull_welm9h_k$(HttpTimeoutCapability_instance);
2811
+ HttpRequestTimeoutException().call($this, tmp, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.get_requestTimeoutMillis_rgkxdt_k$());
2812
+ return $this;
2813
+ }
2814
+ function HttpRequestTimeoutException_init_$Create$(request) {
2815
+ var tmp = HttpRequestTimeoutException_init_$Init$(request, objectCreate2(protoOf9(HttpRequestTimeoutException())));
2816
+ captureStack3(tmp, HttpRequestTimeoutException_init_$Create$);
2817
+ return tmp;
2818
+ }
2819
+ var HttpRequestTimeoutExceptionClass;
2820
+ function HttpRequestTimeoutException() {
2821
+ if (HttpRequestTimeoutExceptionClass === VOID9) {
2822
+ let $ = function(url2, timeoutMillis, cause) {
2823
+ cause = cause === VOID9 ? null : cause;
2824
+ IOException_init_$Init$("Request timeout has expired [url=" + url2 + ", request_timeout=" + toString4(timeoutMillis == null ? "unknown" : timeoutMillis) + " ms]", cause, this);
2825
+ captureStack3(this, HttpRequestTimeoutException());
2826
+ this.url_1 = url2;
2827
+ this.timeoutMillis_1 = timeoutMillis;
2828
+ };
2829
+ initMetadataForClass9($, "HttpRequestTimeoutException", VOID9, IOException(), [CopyableThrowable()]);
2830
+ protoOf9($).createCopy_mmw9ld_k$ = function() {
2831
+ return new (HttpRequestTimeoutException())(this.url_1, this.timeoutMillis_1, this.cause);
242
2832
  };
243
- initMetadataForLambda($, CoroutineImpl(), VOID, [1]);
244
- protoOf($).invoke_hvk5sg_k$ = function($this$async, $completion) {
245
- var tmp = this.create_rcuf4x_k$($this$async, $completion);
246
- tmp.result_1 = Unit_instance;
2833
+ HttpRequestTimeoutExceptionClass = $;
2834
+ }
2835
+ return HttpRequestTimeoutExceptionClass;
2836
+ }
2837
+ function get_supportsRequestTimeout(_this__u8e3s4) {
2838
+ _init_properties_HttpTimeout_kt__pucqrr();
2839
+ var tmp;
2840
+ var tmp_0;
2841
+ if (!isWebsocket(_this__u8e3s4.url_1.get_protocol_mv93kx_k$())) {
2842
+ var tmp_1 = _this__u8e3s4.body_1;
2843
+ tmp_0 = !(tmp_1 instanceof ClientUpgradeContent2());
2844
+ } else {
2845
+ tmp_0 = false;
2846
+ }
2847
+ if (tmp_0) {
2848
+ var tmp_2 = _this__u8e3s4.body_1;
2849
+ tmp = !(tmp_2 instanceof SSEClientContent());
2850
+ } else {
2851
+ tmp = false;
2852
+ }
2853
+ return tmp;
2854
+ }
2855
+ function applyRequestTimeout(_this__u8e3s4, request, requestTimeout) {
2856
+ _init_properties_HttpTimeout_kt__pucqrr();
2857
+ if (requestTimeout == null || requestTimeout === 9223372036854775807n)
2858
+ return Unit_instance8;
2859
+ var executionContext = request.executionContext_1;
2860
+ var tmp = new (CoroutineName())("request-timeout");
2861
+ var killer = launch(_this__u8e3s4, tmp, VOID9, applyRequestTimeout$slambda_0(requestTimeout, request, executionContext, null));
2862
+ var tmp_0 = request.executionContext_1;
2863
+ tmp_0.invokeOnCompletion_n6cffu_k$(applyRequestTimeout$lambda(killer));
2864
+ }
2865
+ function HttpTimeoutConfig$_init_$ref_dl1k0m() {
2866
+ return constructCallableReference5(function() {
2867
+ return HttpTimeoutConfig_init_$Create$();
2868
+ }, 0, 0, 38);
2869
+ }
2870
+ function HttpTimeout$lambda($this$createClientPlugin) {
2871
+ _init_properties_HttpTimeout_kt__pucqrr();
2872
+ var requestTimeoutMillis = $this$createClientPlugin.pluginConfig_1.get_requestTimeoutMillis_rgkxdt_k$();
2873
+ var connectTimeoutMillis = $this$createClientPlugin.pluginConfig_1.get_connectTimeoutMillis_jog9kq_k$();
2874
+ var socketTimeoutMillis = $this$createClientPlugin.pluginConfig_1.get_socketTimeoutMillis_3uzxud_k$();
2875
+ var tmp = Send_instance;
2876
+ $this$createClientPlugin.on_z1oiz_k$(tmp, HttpTimeout$lambda$slambda_0(connectTimeoutMillis, socketTimeoutMillis, requestTimeoutMillis, null));
2877
+ return Unit_instance8;
2878
+ }
2879
+ function invoke$hasNotNullTimeouts(requestTimeoutMillis, connectTimeoutMillis, socketTimeoutMillis, supportsRequestTimeout) {
2880
+ return supportsRequestTimeout && !(requestTimeoutMillis == null) || !(connectTimeoutMillis == null) || !(socketTimeoutMillis == null);
2881
+ }
2882
+ var HttpTimeout$lambda$slambdaClass;
2883
+ function HttpTimeout$lambda$slambda() {
2884
+ if (HttpTimeout$lambda$slambdaClass === VOID9) {
2885
+ let $ = function($connectTimeoutMillis, $socketTimeoutMillis, $requestTimeoutMillis, resultContinuation) {
2886
+ this.$connectTimeoutMillis_1 = $connectTimeoutMillis;
2887
+ this.$socketTimeoutMillis_1 = $socketTimeoutMillis;
2888
+ this.$requestTimeoutMillis_1 = $requestTimeoutMillis;
2889
+ CoroutineImpl7().call(this, resultContinuation);
2890
+ };
2891
+ initMetadataForLambda5($, CoroutineImpl7(), VOID9, [2]);
2892
+ protoOf9($).invoke_nc6r0k_k$ = function($this$on, request, $completion) {
2893
+ var tmp = this.create_v0j3o4_k$($this$on, request, $completion);
2894
+ tmp.result_1 = Unit_instance8;
247
2895
  tmp.exception_1 = null;
248
2896
  return tmp.doResume_5yljmg_k$();
249
2897
  };
250
- protoOf($).invoke_qns8j1_k$ = function(p1, $completion) {
251
- return this.invoke_hvk5sg_k$((!(p1 == null) ? isInterface(p1, CoroutineScope()) : false) ? p1 : THROW_CCE(), $completion);
2898
+ protoOf9($).invoke_4tzzq6_k$ = function(p1, p2, $completion) {
2899
+ var tmp = p1 instanceof Sender_0() ? p1 : THROW_CCE5();
2900
+ return this.invoke_nc6r0k_k$(tmp, p2 instanceof HttpRequestBuilder() ? p2 : THROW_CCE5(), $completion);
252
2901
  };
253
- protoOf($).doResume_5yljmg_k$ = function() {
2902
+ protoOf9($).doResume_5yljmg_k$ = function() {
254
2903
  var suspendResult = this.result_1;
255
2904
  $sm: do
256
2905
  try {
@@ -258,12 +2907,29 @@ function HttpClientEngine$executeWithinCallContext$slambda() {
258
2907
  switch (tmp) {
259
2908
  case 0:
260
2909
  this.exceptionState_1 = 2;
261
- if (_get_closed__iwkfs1(this.this$0__1)) {
262
- throw new (ClientEngineClosedException())();
2910
+ var supportsRequestTimeout = get_supportsRequestTimeout(this.request_1);
2911
+ var configuration = this.request_1.getCapabilityOrNull_welm9h_k$(HttpTimeoutCapability_instance);
2912
+ if (configuration == null && invoke$hasNotNullTimeouts(this.$requestTimeoutMillis_1, this.$connectTimeoutMillis_1, this.$socketTimeoutMillis_1, supportsRequestTimeout)) {
2913
+ configuration = HttpTimeoutConfig_init_$Create$();
2914
+ this.request_1.setCapability_di4fgr_k$(HttpTimeoutCapability_instance, configuration);
2915
+ }
2916
+ var tmp0_safe_receiver = configuration;
2917
+ if (tmp0_safe_receiver == null)
2918
+ null;
2919
+ else {
2920
+ var tmp0_elvis_lhs = tmp0_safe_receiver.get_connectTimeoutMillis_jog9kq_k$();
2921
+ tmp0_safe_receiver.set_connectTimeoutMillis_48d5dx_k$(tmp0_elvis_lhs == null ? this.$connectTimeoutMillis_1 : tmp0_elvis_lhs);
2922
+ var tmp1_elvis_lhs = tmp0_safe_receiver.get_socketTimeoutMillis_3uzxud_k$();
2923
+ tmp0_safe_receiver.set_socketTimeoutMillis_faj43m_k$(tmp1_elvis_lhs == null ? this.$socketTimeoutMillis_1 : tmp1_elvis_lhs);
2924
+ if (supportsRequestTimeout) {
2925
+ var tmp2_elvis_lhs = tmp0_safe_receiver.get_requestTimeoutMillis_rgkxdt_k$();
2926
+ tmp0_safe_receiver.set_requestTimeoutMillis_9cb75s_k$(tmp2_elvis_lhs == null ? this.$requestTimeoutMillis_1 : tmp2_elvis_lhs);
2927
+ applyRequestTimeout(this.$this$on_1, this.request_1, tmp0_safe_receiver.get_requestTimeoutMillis_rgkxdt_k$());
2928
+ }
263
2929
  }
264
2930
  this.state_1 = 1;
265
- suspendResult = this.this$0__1.execute_bvjlbk_k$(this.$requestData_1, this);
266
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
2931
+ suspendResult = this.$this$on_1.proceed_g307xy_k$(this.request_1, this);
2932
+ if (suspendResult === get_COROUTINE_SUSPENDED7()) {
267
2933
  return suspendResult;
268
2934
  }
269
2935
  continue $sm;
@@ -283,61 +2949,71 @@ function HttpClientEngine$executeWithinCallContext$slambda() {
283
2949
  }
284
2950
  while (true);
285
2951
  };
286
- protoOf($).create_rcuf4x_k$ = function($this$async, completion) {
287
- var i = new (HttpClientEngine$executeWithinCallContext$slambda())(this.this$0__1, this.$requestData_1, completion);
288
- i.$this$async_1 = $this$async;
2952
+ protoOf9($).create_v0j3o4_k$ = function($this$on, request, completion) {
2953
+ var i = new (HttpTimeout$lambda$slambda())(this.$connectTimeoutMillis_1, this.$socketTimeoutMillis_1, this.$requestTimeoutMillis_1, completion);
2954
+ i.$this$on_1 = $this$on;
2955
+ i.request_1 = request;
289
2956
  return i;
290
2957
  };
291
- HttpClientEngine$executeWithinCallContext$slambdaClass = $;
2958
+ HttpTimeout$lambda$slambdaClass = $;
292
2959
  }
293
- return HttpClientEngine$executeWithinCallContext$slambdaClass;
2960
+ return HttpTimeout$lambda$slambdaClass;
294
2961
  }
295
- function HttpClientEngine$executeWithinCallContext$slambda_0(this$0, $requestData, resultContinuation) {
296
- var i = new (HttpClientEngine$executeWithinCallContext$slambda())(this$0, $requestData, resultContinuation);
297
- return constructCallableReference(function($this$async, $completion) {
298
- return i.invoke_hvk5sg_k$($this$async, $completion);
299
- }, 1);
2962
+ function HttpTimeout$lambda$slambda_0($connectTimeoutMillis, $socketTimeoutMillis, $requestTimeoutMillis, resultContinuation) {
2963
+ var i = new (HttpTimeout$lambda$slambda())($connectTimeoutMillis, $socketTimeoutMillis, $requestTimeoutMillis, resultContinuation);
2964
+ return constructCallableReference5(function($this$on, request, $completion) {
2965
+ return i.invoke_nc6r0k_k$($this$on, request, $completion);
2966
+ }, 2);
300
2967
  }
301
- var $executeWithinCallContextCOROUTINE$Class;
302
- function $executeWithinCallContextCOROUTINE$() {
303
- if ($executeWithinCallContextCOROUTINE$Class === VOID) {
304
- let $ = function(_this__u8e3s4, requestData, resultContinuation) {
305
- CoroutineImpl().call(this, resultContinuation);
306
- this._this__u8e3s4__1 = _this__u8e3s4;
307
- this.requestData_1 = requestData;
2968
+ var applyRequestTimeout$slambdaClass;
2969
+ function applyRequestTimeout$slambda() {
2970
+ if (applyRequestTimeout$slambdaClass === VOID9) {
2971
+ let $ = function($requestTimeout, $request, $executionContext, resultContinuation) {
2972
+ this.$requestTimeout_1 = $requestTimeout;
2973
+ this.$request_1 = $request;
2974
+ this.$executionContext_1 = $executionContext;
2975
+ CoroutineImpl7().call(this, resultContinuation);
308
2976
  };
309
- initMetadataForCoroutine($, CoroutineImpl());
310
- protoOf($).doResume_5yljmg_k$ = function() {
2977
+ initMetadataForLambda5($, CoroutineImpl7(), VOID9, [1]);
2978
+ protoOf9($).invoke_d9fzmj_k$ = function($this$launch, $completion) {
2979
+ var tmp = this.create_rcuf4x_k$($this$launch, $completion);
2980
+ tmp.result_1 = Unit_instance8;
2981
+ tmp.exception_1 = null;
2982
+ return tmp.doResume_5yljmg_k$();
2983
+ };
2984
+ protoOf9($).invoke_qns8j1_k$ = function(p1, $completion) {
2985
+ return this.invoke_d9fzmj_k$((!(p1 == null) ? isInterface5(p1, CoroutineScope4()) : false) ? p1 : THROW_CCE5(), $completion);
2986
+ };
2987
+ protoOf9($).doResume_5yljmg_k$ = function() {
311
2988
  var suspendResult = this.result_1;
312
2989
  $sm: do
313
2990
  try {
314
2991
  var tmp = this.state_1;
315
2992
  switch (tmp) {
316
2993
  case 0:
317
- this.exceptionState_1 = 3;
2994
+ this.exceptionState_1 = 2;
318
2995
  this.state_1 = 1;
319
- suspendResult = createCallContext(this._this__u8e3s4__1, this.requestData_1.executionContext_1, this);
320
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
2996
+ Companion_getInstance3();
2997
+ var this_0 = this.$requestTimeout_1;
2998
+ suspendResult = delay2(toDuration(this_0, DurationUnit_MILLISECONDS_getInstance()), this);
2999
+ if (suspendResult === get_COROUTINE_SUSPENDED7()) {
321
3000
  return suspendResult;
322
3001
  }
323
3002
  continue $sm;
324
3003
  case 1:
325
- var callContext = suspendResult;
326
- var context = callContext.plus_s13ygv_k$(new (KtorCallContextElement())(callContext));
327
- this.state_1 = 2;
328
- suspendResult = async(this._this__u8e3s4__1, context, VOID, HttpClientEngine$executeWithinCallContext$slambda_0(this._this__u8e3s4__1, this.requestData_1, null)).await_4rdzbx_k$(this);
329
- if (suspendResult === get_COROUTINE_SUSPENDED()) {
330
- return suspendResult;
3004
+ var cause = HttpRequestTimeoutException_init_$Create$(this.$request_1);
3005
+ var this_1 = get_LOGGER3();
3006
+ if (get_isTraceEnabled3(this_1)) {
3007
+ this_1.trace_fti9bv_k$("Request timeout: " + this.$request_1.url_1.toString());
331
3008
  }
332
- continue $sm;
3009
+ cancel4(this.$executionContext_1, ensureNotNull2(cause.message), cause);
3010
+ return Unit_instance8;
333
3011
  case 2:
334
- return suspendResult;
335
- case 3:
336
3012
  throw this.exception_1;
337
3013
  }
338
3014
  } catch ($p) {
339
3015
  var e = $p;
340
- if (this.exceptionState_1 === 3) {
3016
+ if (this.exceptionState_1 === 2) {
341
3017
  throw e;
342
3018
  } else {
343
3019
  this.state_1 = this.exceptionState_1;
@@ -346,88 +3022,81 @@ function $executeWithinCallContextCOROUTINE$() {
346
3022
  }
347
3023
  while (true);
348
3024
  };
349
- $executeWithinCallContextCOROUTINE$Class = $;
3025
+ protoOf9($).create_rcuf4x_k$ = function($this$launch, completion) {
3026
+ var i = new (applyRequestTimeout$slambda())(this.$requestTimeout_1, this.$request_1, this.$executionContext_1, completion);
3027
+ i.$this$launch_1 = $this$launch;
3028
+ return i;
3029
+ };
3030
+ applyRequestTimeout$slambdaClass = $;
350
3031
  }
351
- return $executeWithinCallContextCOROUTINE$Class;
352
- }
353
- function get_supportedCapabilities() {
354
- return emptySet();
3032
+ return applyRequestTimeout$slambdaClass;
355
3033
  }
356
- function install(client) {
357
- var tmp = Phases_getInstance().Engine_1;
358
- client.sendPipeline_1.intercept_k21bv3_k$(tmp, HttpClientEngine$install$slambda_0(client, this, null));
3034
+ function applyRequestTimeout$slambda_0($requestTimeout, $request, $executionContext, resultContinuation) {
3035
+ var i = new (applyRequestTimeout$slambda())($requestTimeout, $request, $executionContext, resultContinuation);
3036
+ return constructCallableReference5(function($this$launch, $completion) {
3037
+ return i.invoke_d9fzmj_k$($this$launch, $completion);
3038
+ }, 1);
359
3039
  }
360
- var HttpClientEngineClass;
361
- function HttpClientEngine() {
362
- if (HttpClientEngineClass === VOID) {
363
- let $ = function() {
364
- };
365
- initMetadataForInterface($, "HttpClientEngine", VOID, VOID, [CoroutineScope(), AutoCloseable()], [1]);
366
- HttpClientEngineClass = $;
367
- }
368
- return HttpClientEngineClass;
369
- }
370
- function validateHeaders(request) {
371
- _init_properties_HttpClientEngine_kt__h91z5h();
372
- var requestHeaders = request.headers_1;
373
- var tmp0 = requestHeaders.names_1q9mbs_k$();
374
- var destination = ArrayList_init_$Create$();
375
- var _iterator__ex2g4s = tmp0.iterator_jk1svi_k$();
376
- while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
377
- var element = _iterator__ex2g4s.next_20eer_k$();
378
- if (HttpHeaders_getInstance().UnsafeHeadersList_1.contains_aljjnj_k$(element)) {
379
- destination.add_utx5q5_k$(element);
380
- }
381
- }
382
- var unsafeRequestHeaders = destination;
383
- if (!unsafeRequestHeaders.isEmpty_y1axqb_k$()) {
384
- throw new (UnsafeHeaderException())(toString(unsafeRequestHeaders));
385
- }
3040
+ function applyRequestTimeout$lambda($killer) {
3041
+ return function(it) {
3042
+ $killer.cancel$default_8haxne_k$();
3043
+ return Unit_instance8;
3044
+ };
386
3045
  }
387
- function createCallContext(_this__u8e3s4, parentJob, $completion) {
388
- var callJob = Job(parentJob);
389
- var callContext = _this__u8e3s4.get_coroutineContext_115oqo_k$().plus_s13ygv_k$(callJob).plus_s13ygv_k$(get_CALL_COROUTINE());
390
- $l$block: {
391
- var tmp0_elvis_lhs = $completion.get_context_h02k06_k$().get_y2st91_k$(Key_instance);
392
- var tmp;
393
- if (tmp0_elvis_lhs == null) {
394
- break $l$block;
395
- } else {
396
- tmp = tmp0_elvis_lhs;
397
- }
398
- var userJob = tmp;
399
- var cleanupHandler = userJob.invokeOnCompletion$default_1v3utx_k$(true, VOID, createCallContext$lambda(callJob));
400
- callJob.invokeOnCompletion_n6cffu_k$(createCallContext$lambda_0(cleanupHandler));
3046
+ var properties_initialized_HttpTimeout_kt_9oyjbd;
3047
+ function _init_properties_HttpTimeout_kt__pucqrr() {
3048
+ if (!properties_initialized_HttpTimeout_kt_9oyjbd) {
3049
+ properties_initialized_HttpTimeout_kt_9oyjbd = true;
3050
+ LOGGER2 = KtorSimpleLogger3("io.ktor.client.plugins.HttpTimeout");
3051
+ var tmp = HttpTimeoutConfig$_init_$ref_dl1k0m();
3052
+ HttpTimeout = createClientPlugin3("HttpTimeout", tmp, HttpTimeout$lambda);
401
3053
  }
402
- return callContext;
403
3054
  }
404
- function createCallContext$lambda($callJob) {
405
- return function(cause) {
406
- if (cause == null)
407
- return Unit_instance;
408
- var tmp1_elvis_lhs = cause instanceof CancellationException() ? cause : null;
409
- var cancellation = tmp1_elvis_lhs == null ? CancellationException_init_$Create$(cause.message) : tmp1_elvis_lhs;
410
- $callJob.cancel_hkmm2i_k$(cancellation);
411
- return Unit_instance;
412
- };
3055
+ HttpTimeoutCapability_instance = new (HttpTimeoutCapability())();
3056
+
3057
+ // build/packages/js/ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngineCapability.mjs
3058
+ import { protoOf180f3jzyo7rfj as protoOf10 } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
3059
+ import { initMetadataForInterface1egvbzx539z91 as initMetadataForInterface3 } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
3060
+ import { VOID3gxj6tk5isa35 as VOID10 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
3061
+ import { KtMutableMap1kqeifoi36kpz as KtMutableMap } from "../kotlin-kotlin-stdlib/kotlin/collections/Collections.mjs";
3062
+ import { getKClass3t8tygqu4lcxf as getKClass6 } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/reflection.mjs";
3063
+ import { isInterface3d6p8outrmvmk as isInterface6 } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
3064
+ import {
3065
+ getStarKTypeProjection316vzroubdy0t as getStarKTypeProjection,
3066
+ createKType31ecntyyaay3k as createKType7,
3067
+ createInvariantKTypeProjection3h5364czc0a8w as createInvariantKTypeProjection2
3068
+ } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/KTypeHelpers.mjs";
3069
+ import { arrayOf1akklvh2at202 as arrayOf7 } from "../kotlin-kotlin-stdlib/kotlin/Library.mjs";
3070
+ import { PrimitiveClasses_getInstance13wbaztpz3e2d as PrimitiveClasses_getInstance3 } from "../kotlin-kotlin-stdlib/kotlin/reflect/js/internal/primitives.mjs";
3071
+ import { TypeInfo2nbxsuf4v8os2 as TypeInfo7 } from "../ktor-ktor-utils/io/ktor/util/reflect/Type.mjs";
3072
+ import { AttributeKey3aq8ytwgx54f7 as AttributeKey7 } from "../ktor-ktor-utils/io/ktor/util/Attributes.mjs";
3073
+ import { setOf1u3mizs95ngxo as setOf } from "../kotlin-kotlin-stdlib/kotlin/collections/collectionJs.mjs";
3074
+ function get_ENGINE_CAPABILITIES_KEY() {
3075
+ _init_properties_HttpClientEngineCapability_kt__ifvyst();
3076
+ return ENGINE_CAPABILITIES_KEY;
413
3077
  }
414
- function createCallContext$lambda_0($cleanupHandler) {
415
- return function(it) {
416
- $cleanupHandler.dispose_3nnxhr_k$();
417
- return Unit_instance;
418
- };
3078
+ var ENGINE_CAPABILITIES_KEY;
3079
+ var DEFAULT_CAPABILITIES;
3080
+ var HttpClientEngineCapabilityClass;
3081
+ function HttpClientEngineCapability() {
3082
+ if (HttpClientEngineCapabilityClass === VOID10) {
3083
+ let $ = function() {
3084
+ };
3085
+ initMetadataForInterface3($, "HttpClientEngineCapability");
3086
+ HttpClientEngineCapabilityClass = $;
3087
+ }
3088
+ return HttpClientEngineCapabilityClass;
419
3089
  }
420
- var properties_initialized_HttpClientEngine_kt_5uiebb;
421
- function _init_properties_HttpClientEngine_kt__h91z5h() {
422
- if (!properties_initialized_HttpClientEngine_kt_5uiebb) {
423
- properties_initialized_HttpClientEngine_kt_5uiebb = true;
424
- CALL_COROUTINE = new (CoroutineName())("call-context");
425
- var name = "client-config";
426
- var tmp = getKClass(HttpClientConfig());
427
- var tmp_0 = null instanceof HttpClientConfig();
3090
+ var properties_initialized_HttpClientEngineCapability_kt_qarzcf;
3091
+ function _init_properties_HttpClientEngineCapability_kt__ifvyst() {
3092
+ if (!properties_initialized_HttpClientEngineCapability_kt_qarzcf) {
3093
+ properties_initialized_HttpClientEngineCapability_kt_qarzcf = true;
3094
+ var name = "EngineCapabilities";
3095
+ var tmp = getKClass6(KtMutableMap());
3096
+ var tmp_0 = false ? isInterface6(null, KtMutableMap()) : false;
428
3097
  var tmp_1;
429
3098
  try {
430
- tmp_1 = createKType(getKClass(HttpClientConfig()), arrayOf([getStarKTypeProjection()]), false);
3099
+ tmp_1 = createKType7(getKClass6(KtMutableMap()), arrayOf7([createInvariantKTypeProjection2(createKType7(getKClass6(HttpClientEngineCapability()), arrayOf7([getStarKTypeProjection()]), false)), createInvariantKTypeProjection2(createKType7(PrimitiveClasses_getInstance3().get_anyClass_x0jl4l_k$(), arrayOf7([]), false))]), false);
431
3100
  } catch ($p) {
432
3101
  var tmp_2;
433
3102
  if ($p instanceof Error) {
@@ -439,132 +3108,40 @@ function _init_properties_HttpClientEngine_kt__h91z5h() {
439
3108
  tmp_1 = tmp_2;
440
3109
  }
441
3110
  var tmp$ret$2 = tmp_1;
442
- var tmp$ret$1 = new (TypeInfo())(tmp, tmp_0, tmp$ret$2);
443
- CLIENT_CONFIG = new (AttributeKey())(name, tmp$ret$1);
444
- }
445
- }
446
-
447
- // build/packages/js/ktor-ktor-client-core/io/ktor/client/engine/HttpClientEngineBase.mjs
448
- import {
449
- IllegalStateExceptionkoljg5n0nrlr as IllegalStateException,
450
- IllegalStateException_init_$Init$2lydy6bjiiso9 as IllegalStateException_init_$Init$
451
- } from "../kotlin-kotlin-stdlib/kotlin/exceptions.mjs";
452
- import { VOID3gxj6tk5isa35 as VOID2 } from "../kotlin-kotlin-stdlib/kotlin/js/void.mjs";
453
- import {
454
- captureStack1fzi4aczwc4hg as captureStack,
455
- protoOf180f3jzyo7rfj as protoOf2,
456
- defineProp3ur6h3slcvq4x as defineProp
457
- } from "../kotlin-kotlin-stdlib/kotlin/js/coreRuntime.mjs";
458
- import { initMetadataForClassbxx6q50dy2s7 as initMetadataForClass } from "../kotlin-kotlin-stdlib/kotlin/js/metadataUtils.mjs";
459
- import { ioDispatcher3b9pa3x0duop as ioDispatcher } from "../ktor-ktor-io/io/ktor/utils/io/IODispatcher.web.mjs";
460
- import {
461
- constructCallableReference23y65rf941mch as constructCallableReference2,
462
- getPropertyCallableRef3hckxc0xueiaj as getPropertyCallableRef
463
- } from "../kotlin-kotlin-stdlib/kotlin/js/reflectRuntime.mjs";
464
- import { SilentSupervisorlzoikirj0zeo as SilentSupervisor } from "../ktor-ktor-utils/io/ktor/util/CoroutinesUtils.mjs";
465
- import { CoroutineName2g5zosw74tf0f as CoroutineName2 } from "../kotlinx-coroutines-core/kotlinx/coroutines/CoroutineName.mjs";
466
- import {
467
- atomic$boolean$1iggki4z65a2h as atomic$boolean$1,
468
- atomic$int$11d5swdyn6j0pu as atomic$int$1
469
- } from "../kotlinx-atomicfu/kotlinx/atomicfu/AtomicFU.mjs";
470
- import { lazy2hsh8ze7j6ikd as lazy } from "../kotlin-kotlin-stdlib/kotlin/kotlin.mjs";
471
- import { KProperty1ca4yb4wlo496 as KProperty1 } from "../kotlin-kotlin-stdlib/kotlin/reflect/KPropertyJs.mjs";
472
- import { Unit_instance3kz1zqli6gr1r as Unit_instance2 } from "../kotlin-kotlin-stdlib/kotlin/Unit.mjs";
473
- import { Key_instancepi2bbb0csu5f as Key_instance2 } from "../kotlinx-coroutines-core/kotlinx/coroutines/Job.mjs";
474
- import { CompletableJob1w6swnu15iclo as CompletableJob } from "../kotlinx-coroutines-core/kotlinx/coroutines/CompletableJob.mjs";
475
- import { isInterface3d6p8outrmvmk as isInterface2 } from "../kotlin-kotlin-stdlib/kotlin/js/typeCheckUtils.mjs";
476
- var ClientEngineClosedExceptionClass;
477
- function ClientEngineClosedException() {
478
- if (ClientEngineClosedExceptionClass === VOID2) {
479
- let $ = function(cause) {
480
- cause = cause === VOID2 ? null : cause;
481
- IllegalStateException_init_$Init$("Client already closed", this);
482
- captureStack(this, ClientEngineClosedException());
483
- this.cause_1 = cause;
484
- delete this.cause;
485
- };
486
- initMetadataForClass($, "ClientEngineClosedException", ClientEngineClosedException, IllegalStateException());
487
- protoOf2($).get_cause_iplhs0_k$ = function() {
488
- return this.cause_1;
489
- };
490
- defineProp(protoOf2($), "cause", function() {
491
- return this.get_cause_iplhs0_k$();
492
- });
493
- ClientEngineClosedExceptionClass = $;
494
- }
495
- return ClientEngineClosedExceptionClass;
496
- }
497
- function HttpClientEngineBase$dispatcher$delegate$lambda(this$0) {
498
- return function() {
499
- var tmp0_elvis_lhs = this$0.get_config_c0698r_k$().dispatcher_1;
500
- return tmp0_elvis_lhs == null ? ioDispatcher() : tmp0_elvis_lhs;
501
- };
502
- }
503
- function HttpClientEngineBase$_get_dispatcher_$ref_kz5x8v() {
504
- return constructCallableReference2(function(p0) {
505
- return p0.get_dispatcher_usy1bk_k$();
506
- }, 1, 0, 29);
507
- }
508
- function HttpClientEngineBase$coroutineContext$delegate$lambda(this$0) {
509
- return function() {
510
- return SilentSupervisor().plus_s13ygv_k$(this$0.get_dispatcher_usy1bk_k$()).plus_s13ygv_k$(new (CoroutineName2())(this$0.engineName_1 + "-context"));
511
- };
512
- }
513
- function HttpClientEngineBase$_get_coroutineContext_$ref_p82ehr() {
514
- return constructCallableReference2(function(p0) {
515
- return p0.get_coroutineContext_115oqo_k$();
516
- }, 1, 0, 30);
517
- }
518
- var HttpClientEngineBaseClass;
519
- function HttpClientEngineBase() {
520
- if (HttpClientEngineBaseClass === VOID2) {
521
- let $ = function(engineName) {
522
- this.engineName_1 = engineName;
523
- this.closed_1 = atomic$boolean$1(false);
524
- this.clientRefCount_1 = atomic$int$1(0);
525
- var tmp = this;
526
- tmp.dispatcher$delegate_1 = lazy(HttpClientEngineBase$dispatcher$delegate$lambda(this));
527
- var tmp_0 = this;
528
- tmp_0.coroutineContext$delegate_1 = lazy(HttpClientEngineBase$coroutineContext$delegate$lambda(this));
529
- };
530
- initMetadataForClass($, "HttpClientEngineBase", VOID2, VOID2, [HttpClientEngine()], [1]);
531
- protoOf2($).get_dispatcher_usy1bk_k$ = function() {
532
- var tmp0 = this.dispatcher$delegate_1;
533
- var tmp = KProperty1();
534
- getPropertyCallableRef("dispatcher", 1, tmp, HttpClientEngineBase$_get_dispatcher_$ref_kz5x8v(), null);
535
- return tmp0.get_value_j01efc_k$();
536
- };
537
- protoOf2($).get_coroutineContext_115oqo_k$ = function() {
538
- var tmp0 = this.coroutineContext$delegate_1;
539
- var tmp = KProperty1();
540
- getPropertyCallableRef("coroutineContext", 1, tmp, HttpClientEngineBase$_get_coroutineContext_$ref_p82ehr(), null);
541
- return tmp0.get_value_j01efc_k$();
542
- };
543
- protoOf2($).close_yn9xrc_k$ = function() {
544
- if (!this.closed_1.atomicfu$compareAndSet(false, true))
545
- return Unit_instance2;
546
- var tmp = this.get_coroutineContext_115oqo_k$().get_y2st91_k$(Key_instance2);
547
- var tmp0_elvis_lhs = (!(tmp == null) ? isInterface2(tmp, CompletableJob()) : false) ? tmp : null;
548
- var tmp_0;
549
- if (tmp0_elvis_lhs == null) {
550
- return Unit_instance2;
551
- } else {
552
- tmp_0 = tmp0_elvis_lhs;
553
- }
554
- var requestJob = tmp_0;
555
- requestJob.complete_9ww6vb_k$();
556
- };
557
- protoOf2($).get_supportedCapabilities_gwz15x_k$ = get_supportedCapabilities;
558
- protoOf2($).install_55cq5g_k$ = install;
559
- HttpClientEngineBaseClass = $;
3111
+ var tmp$ret$1 = new (TypeInfo7())(tmp, tmp_0, tmp$ret$2);
3112
+ ENGINE_CAPABILITIES_KEY = new (AttributeKey7())(name, tmp$ret$1);
3113
+ DEFAULT_CAPABILITIES = setOf(HttpTimeoutCapability_instance);
560
3114
  }
561
- return HttpClientEngineBaseClass;
562
3115
  }
563
3116
  export {
564
- ClientEngineClosedException as ClientEngineClosedException1qtw9cl0kd5fk,
565
- HttpClientEngine as HttpClientEngine3f41d0b7i209y,
566
- HttpClientEngineBase as HttpClientEngineBase2tgisnw4e4drr,
567
- get_CLIENT_CONFIG as get_CLIENT_CONFIG1oazdiwjd1qe0,
568
- get_supportedCapabilities as get_supportedCapabilities36x6e2ixit204,
569
- install as install34ed8l0uhurm0
3117
+ DefaultHttpRequest as DefaultHttpRequest19v463zllbymg,
3118
+ HttpClientCall as HttpClientCall2j6myj8ctykar,
3119
+ HttpClientCall_init_$Create$ as HttpClientCall_init_$Create$l01lehg8js2a,
3120
+ HttpClientEngineCapability as HttpClientEngineCapability33x11oaa7ywe5,
3121
+ HttpRequest as HttpRequest3fsc4149kgwfg,
3122
+ HttpRequestBuilder as HttpRequestBuilder15f2nnx9sjuv1,
3123
+ HttpRequestData as HttpRequestData1zrez3by0aur2,
3124
+ HttpRequestTimeoutException as HttpRequestTimeoutException19335ch7q7rkf,
3125
+ HttpResponseData as HttpResponseData2dozo5khuplr6,
3126
+ HttpTimeoutCapability_instance as HttpTimeoutCapability_instance202wzu4l72tz3,
3127
+ Plugin_getInstance as Plugin_getInstancedvtd2m29fslb,
3128
+ SavedHttpCall as SavedHttpCall36iotslsp8nj5,
3129
+ Send_instance as Send_instance1oebf6ttzyqzk,
3130
+ Sender_0 as Sender1wtdgti85uk42,
3131
+ Sender as Sender4pyqqer9k7up,
3132
+ SetupRequest_instance as SetupRequest_instance2zzqkp8zxmw91,
3133
+ get_ENGINE_CAPABILITIES_KEY as get_ENGINE_CAPABILITIES_KEYr1fjz8liznxo,
3134
+ get_HttpRequestRetry as get_HttpRequestRetry3m7x7jck45t4l,
3135
+ get_HttpTimeout as get_HttpTimeout3mcrbvfnvmyx2,
3136
+ get_MaxRetriesPerRequestAttributeKey as get_MaxRetriesPerRequestAttributeKey13gphm9kuo852,
3137
+ get_ResponseAdapterAttributeKey as get_ResponseAdapterAttributeKey1ll13ywinsgvd,
3138
+ get_SaveBody as get_SaveBody3aignvhtsnvcr,
3139
+ get_coroutineContext as get_coroutineContext1djaai1ellg0c,
3140
+ get_isSaved as get_isSaved1yor47kvbhumv,
3141
+ headers as headers24pki7ce1busg,
3142
+ isUpgradeRequest as isUpgradeRequest3msdo2i9hxs68,
3143
+ save as save1hc0jjdmqj6mp,
3144
+ skipSaveBody as skipSaveBodyqewhiekddpy3,
3145
+ url as url1ln4fngdmzeq5,
3146
+ url_0 as url2l6iw5ri21nxb
570
3147
  };