@wabot-dev/framework 0.0.12 → 0.0.14

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 (367) hide show
  1. package/dist/src/_virtual/XMLHttpRequest.js +7 -0
  2. package/dist/src/_virtual/_commonjsHelpers.js +32 -0
  3. package/dist/src/_virtual/base64id.js +3 -0
  4. package/dist/src/_virtual/binary.js +3 -0
  5. package/dist/src/_virtual/bom-handling.js +3 -0
  6. package/dist/src/_virtual/broadcast-operator.js +3 -0
  7. package/dist/src/_virtual/browser.js +3 -0
  8. package/dist/src/_virtual/browser2.js +3 -0
  9. package/dist/src/_virtual/browser3.js +3 -0
  10. package/dist/src/_virtual/browser4.js +3 -0
  11. package/dist/src/_virtual/browser5.js +3 -0
  12. package/dist/src/_virtual/buffer-util.js +3 -0
  13. package/dist/src/_virtual/buffer-util2.js +3 -0
  14. package/dist/src/_virtual/buffer-util3.js +3 -0
  15. package/dist/src/_virtual/charset.js +3 -0
  16. package/dist/src/_virtual/charset2.js +3 -0
  17. package/dist/src/_virtual/client.js +3 -0
  18. package/dist/src/_virtual/cluster-adapter.js +3 -0
  19. package/dist/src/_virtual/commons.js +3 -0
  20. package/dist/src/_virtual/dbcs-codec.js +3 -0
  21. package/dist/src/_virtual/decodePacket.js +3 -0
  22. package/dist/src/_virtual/encodePacket.js +3 -0
  23. package/dist/src/_virtual/encoding.js +3 -0
  24. package/dist/src/_virtual/encoding2.js +3 -0
  25. package/dist/src/_virtual/engine.io.js +3 -0
  26. package/dist/src/_virtual/in-memory-adapter.js +3 -0
  27. package/dist/src/_virtual/index.js +7 -0
  28. package/dist/src/_virtual/index10.js +3 -0
  29. package/dist/src/_virtual/index11.js +3 -0
  30. package/dist/src/_virtual/index12.js +3 -0
  31. package/dist/src/_virtual/index13.js +3 -0
  32. package/dist/src/_virtual/index14.js +3 -0
  33. package/dist/src/_virtual/index15.js +3 -0
  34. package/dist/src/_virtual/index16.js +3 -0
  35. package/dist/src/_virtual/index17.js +3 -0
  36. package/dist/src/_virtual/index18.js +3 -0
  37. package/dist/src/_virtual/index19.js +3 -0
  38. package/dist/src/_virtual/index2.js +7 -0
  39. package/dist/src/_virtual/index20.js +3 -0
  40. package/dist/src/_virtual/index21.js +3 -0
  41. package/dist/src/_virtual/index22.js +3 -0
  42. package/dist/src/_virtual/index23.js +3 -0
  43. package/dist/src/_virtual/index24.js +3 -0
  44. package/dist/src/_virtual/index25.js +3 -0
  45. package/dist/src/_virtual/index26.js +3 -0
  46. package/dist/src/_virtual/index27.js +3 -0
  47. package/dist/src/_virtual/index28.js +3 -0
  48. package/dist/src/_virtual/index29.js +3 -0
  49. package/dist/src/_virtual/index3.js +7 -0
  50. package/dist/src/_virtual/index30.js +3 -0
  51. package/dist/src/_virtual/index31.js +3 -0
  52. package/dist/src/_virtual/index32.js +3 -0
  53. package/dist/src/_virtual/index33.js +3 -0
  54. package/dist/src/_virtual/index4.js +3 -0
  55. package/dist/src/_virtual/index5.js +3 -0
  56. package/dist/src/_virtual/index6.js +3 -0
  57. package/dist/src/_virtual/index7.js +3 -0
  58. package/dist/src/_virtual/index8.js +6 -0
  59. package/dist/src/_virtual/index9.js +3 -0
  60. package/dist/src/_virtual/inherits.js +3 -0
  61. package/dist/src/_virtual/inherits_browser.js +3 -0
  62. package/dist/src/_virtual/is-binary.js +3 -0
  63. package/dist/src/_virtual/language.js +3 -0
  64. package/dist/src/_virtual/language2.js +3 -0
  65. package/dist/src/_virtual/mediaType.js +3 -0
  66. package/dist/src/_virtual/mediaType2.js +3 -0
  67. package/dist/src/_virtual/namespace.js +3 -0
  68. package/dist/src/_virtual/node.js +3 -0
  69. package/dist/src/_virtual/node2.js +3 -0
  70. package/dist/src/_virtual/node3.js +3 -0
  71. package/dist/src/_virtual/node4.js +3 -0
  72. package/dist/src/_virtual/node5.js +3 -0
  73. package/dist/src/_virtual/parent-namespace.js +3 -0
  74. package/dist/src/_virtual/polling-jsonp.js +3 -0
  75. package/dist/src/_virtual/polling.js +3 -0
  76. package/dist/src/_virtual/polling2.js +3 -0
  77. package/dist/src/_virtual/receiver.js +3 -0
  78. package/dist/src/_virtual/sbcs-codec.js +3 -0
  79. package/dist/src/_virtual/sender.js +3 -0
  80. package/dist/src/_virtual/server.js +3 -0
  81. package/dist/src/_virtual/socket-types.js +3 -0
  82. package/dist/src/_virtual/socket.js +3 -0
  83. package/dist/src/_virtual/socket2.js +3 -0
  84. package/dist/src/_virtual/stream.js +3 -0
  85. package/dist/src/_virtual/transport.js +3 -0
  86. package/dist/src/_virtual/typed-events.js +3 -0
  87. package/dist/src/_virtual/userver.js +3 -0
  88. package/dist/src/_virtual/utf16.js +3 -0
  89. package/dist/src/_virtual/utf32.js +3 -0
  90. package/dist/src/_virtual/utf7.js +3 -0
  91. package/dist/src/_virtual/uws.js +3 -0
  92. package/dist/src/_virtual/validation.js +3 -0
  93. package/dist/src/_virtual/validation2.js +3 -0
  94. package/dist/src/_virtual/validation3.js +3 -0
  95. package/dist/src/_virtual/websocket-server.js +3 -0
  96. package/dist/src/_virtual/websocket.js +7 -0
  97. package/dist/src/_virtual/websocket2.js +3 -0
  98. package/dist/src/_virtual/websocket3.js +3 -0
  99. package/dist/src/_virtual/webtransport.js +3 -0
  100. package/dist/src/_virtual/yeast.js +3 -0
  101. package/dist/src/channels/cmd/@cmd.js +2 -0
  102. package/dist/src/channels/cmd/CmdChannel.js +2 -0
  103. package/dist/src/channels/telegram/@telegram.js +2 -0
  104. package/dist/src/channels/telegram/TelegramChannel.js +2 -0
  105. package/dist/src/channels/whatsapp/@whatsapp.js +24 -0
  106. package/dist/src/channels/whatsapp/WhatsAppChannel.js +63 -0
  107. package/dist/src/channels/whatsapp/WhatsAppChannelConfig.js +8 -0
  108. package/dist/src/channels/whatsapp/WhatsAppConnection.js +61 -0
  109. package/dist/src/channels/whatsapp/WhatsAppDevConnection.js +61 -0
  110. package/dist/src/channels/whatsapp/WhatsAppProdConnection.js +36 -0
  111. package/dist/src/channels/whatsapp/whatsAppDevSocketContracts.js +9 -0
  112. package/dist/src/controller/express/Express.js +5 -0
  113. package/dist/src/controller/socket.io/SocketIO.js +5 -0
  114. package/dist/src/env/WabotEnv.js +21 -0
  115. package/dist/src/index.d.ts +168 -1
  116. package/dist/src/index.js +12 -0
  117. package/dist/src/logger/Logger.js +65 -0
  118. package/dist/src/node_modules/@socket.io/component-emitter/lib/esm/index.js +171 -0
  119. package/dist/src/node_modules/base64id/lib/base64id.js +117 -0
  120. package/dist/src/node_modules/body-parser/index.js +96 -0
  121. package/dist/src/node_modules/body-parser/lib/read.js +225 -0
  122. package/dist/src/node_modules/body-parser/lib/types/json.js +222 -0
  123. package/dist/src/node_modules/body-parser/lib/types/raw.js +90 -0
  124. package/dist/src/node_modules/body-parser/lib/types/text.js +95 -0
  125. package/dist/src/node_modules/body-parser/lib/types/urlencoded.js +194 -0
  126. package/dist/src/node_modules/body-parser/lib/utils.js +96 -0
  127. package/dist/src/node_modules/bytes/index.js +180 -0
  128. package/dist/src/node_modules/call-bind-apply-helpers/actualApply.js +24 -0
  129. package/dist/src/node_modules/call-bind-apply-helpers/functionApply.js +13 -0
  130. package/dist/src/node_modules/call-bind-apply-helpers/functionCall.js +13 -0
  131. package/dist/src/node_modules/call-bind-apply-helpers/index.js +29 -0
  132. package/dist/src/node_modules/call-bind-apply-helpers/reflectApply.js +13 -0
  133. package/dist/src/node_modules/call-bound/index.js +31 -0
  134. package/dist/src/node_modules/content-type/index.js +235 -0
  135. package/dist/src/node_modules/cookie/index.js +345 -0
  136. package/dist/src/node_modules/cors/lib/index.js +249 -0
  137. package/dist/src/node_modules/debug/src/browser.js +286 -0
  138. package/dist/src/node_modules/debug/src/common.js +303 -0
  139. package/dist/src/node_modules/debug/src/index.js +23 -0
  140. package/dist/src/node_modules/debug/src/node.js +279 -0
  141. package/dist/src/node_modules/depd/index.js +550 -0
  142. package/dist/src/node_modules/dunder-proto/get.js +42 -0
  143. package/dist/src/node_modules/ee-first/index.js +104 -0
  144. package/dist/src/node_modules/engine.io/build/engine.io.js +73 -0
  145. package/dist/src/node_modules/engine.io/build/parser-v3/index.js +429 -0
  146. package/dist/src/node_modules/engine.io/build/parser-v3/utf8.js +198 -0
  147. package/dist/src/node_modules/engine.io/build/server.js +808 -0
  148. package/dist/src/node_modules/engine.io/build/socket.js +469 -0
  149. package/dist/src/node_modules/engine.io/build/transport.js +131 -0
  150. package/dist/src/node_modules/engine.io/build/transports/index.js +37 -0
  151. package/dist/src/node_modules/engine.io/build/transports/polling-jsonp.js +53 -0
  152. package/dist/src/node_modules/engine.io/build/transports/polling.js +346 -0
  153. package/dist/src/node_modules/engine.io/build/transports/websocket.js +106 -0
  154. package/dist/src/node_modules/engine.io/build/transports/webtransport.js +76 -0
  155. package/dist/src/node_modules/engine.io/build/transports-uws/index.js +20 -0
  156. package/dist/src/node_modules/engine.io/build/transports-uws/polling.js +378 -0
  157. package/dist/src/node_modules/engine.io/build/transports-uws/websocket.js +85 -0
  158. package/dist/src/node_modules/engine.io/build/userver.js +292 -0
  159. package/dist/src/node_modules/engine.io/node_modules/accepts/index.js +250 -0
  160. package/dist/src/node_modules/engine.io/node_modules/debug/src/browser.js +285 -0
  161. package/dist/src/node_modules/engine.io/node_modules/debug/src/common.js +285 -0
  162. package/dist/src/node_modules/engine.io/node_modules/debug/src/index.js +23 -0
  163. package/dist/src/node_modules/engine.io/node_modules/debug/src/node.js +279 -0
  164. package/dist/src/node_modules/engine.io/node_modules/mime-db/db.json.js +10704 -0
  165. package/dist/src/node_modules/engine.io/node_modules/mime-db/index.js +24 -0
  166. package/dist/src/node_modules/engine.io/node_modules/mime-types/index.js +202 -0
  167. package/dist/src/node_modules/engine.io/node_modules/negotiator/index.js +96 -0
  168. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/charset.js +179 -0
  169. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/encoding.js +193 -0
  170. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/language.js +188 -0
  171. package/dist/src/node_modules/engine.io/node_modules/negotiator/lib/mediaType.js +304 -0
  172. package/dist/src/node_modules/engine.io/node_modules/ws/index.js +28 -0
  173. package/dist/src/node_modules/engine.io/node_modules/ws/lib/buffer-util.js +142 -0
  174. package/dist/src/node_modules/engine.io/node_modules/ws/lib/constants.js +21 -0
  175. package/dist/src/node_modules/engine.io/node_modules/ws/lib/event-target.js +303 -0
  176. package/dist/src/node_modules/engine.io/node_modules/ws/lib/extension.js +214 -0
  177. package/dist/src/node_modules/engine.io/node_modules/ws/lib/limiter.js +64 -0
  178. package/dist/src/node_modules/engine.io/node_modules/ws/lib/permessage-deflate.js +528 -0
  179. package/dist/src/node_modules/engine.io/node_modules/ws/lib/receiver.js +719 -0
  180. package/dist/src/node_modules/engine.io/node_modules/ws/lib/sender.js +513 -0
  181. package/dist/src/node_modules/engine.io/node_modules/ws/lib/stream.js +170 -0
  182. package/dist/src/node_modules/engine.io/node_modules/ws/lib/subprotocol.js +73 -0
  183. package/dist/src/node_modules/engine.io/node_modules/ws/lib/validation.js +141 -0
  184. package/dist/src/node_modules/engine.io/node_modules/ws/lib/websocket-server.js +559 -0
  185. package/dist/src/node_modules/engine.io/node_modules/ws/lib/websocket.js +1363 -0
  186. package/dist/src/node_modules/engine.io-client/build/esm/contrib/has-cors.js +13 -0
  187. package/dist/src/node_modules/engine.io-client/build/esm/contrib/parseqs.js +36 -0
  188. package/dist/src/node_modules/engine.io-client/build/esm/contrib/parseuri.js +66 -0
  189. package/dist/src/node_modules/engine.io-client/build/esm/globals.node.js +92 -0
  190. package/dist/src/node_modules/engine.io-client/build/esm/index.js +17 -0
  191. package/dist/src/node_modules/engine.io-client/build/esm/socket.js +728 -0
  192. package/dist/src/node_modules/engine.io-client/build/esm/transport.js +143 -0
  193. package/dist/src/node_modules/engine.io-client/build/esm/transports/index.js +11 -0
  194. package/dist/src/node_modules/engine.io-client/build/esm/transports/polling-xhr.js +256 -0
  195. package/dist/src/node_modules/engine.io-client/build/esm/transports/polling-xhr.node.js +21 -0
  196. package/dist/src/node_modules/engine.io-client/build/esm/transports/polling.js +146 -0
  197. package/dist/src/node_modules/engine.io-client/build/esm/transports/websocket.js +107 -0
  198. package/dist/src/node_modules/engine.io-client/build/esm/transports/websocket.node.js +48 -0
  199. package/dist/src/node_modules/engine.io-client/build/esm/transports/webtransport.js +83 -0
  200. package/dist/src/node_modules/engine.io-client/build/esm/util.js +62 -0
  201. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/buffer-util.js +142 -0
  202. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/constants.js +21 -0
  203. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/event-target.js +303 -0
  204. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/extension.js +214 -0
  205. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/limiter.js +64 -0
  206. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/permessage-deflate.js +528 -0
  207. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/receiver.js +719 -0
  208. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/sender.js +513 -0
  209. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/stream.js +170 -0
  210. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/subprotocol.js +73 -0
  211. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/validation.js +141 -0
  212. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/websocket-server.js +559 -0
  213. package/dist/src/node_modules/engine.io-client/node_modules/ws/lib/websocket.js +1363 -0
  214. package/dist/src/node_modules/engine.io-parser/build/cjs/commons.js +29 -0
  215. package/dist/src/node_modules/engine.io-parser/build/cjs/decodePacket.js +70 -0
  216. package/dist/src/node_modules/engine.io-parser/build/cjs/encodePacket.js +51 -0
  217. package/dist/src/node_modules/engine.io-parser/build/cjs/index.js +179 -0
  218. package/dist/src/node_modules/engine.io-parser/build/esm/commons.js +15 -0
  219. package/dist/src/node_modules/engine.io-parser/build/esm/decodePacket.js +58 -0
  220. package/dist/src/node_modules/engine.io-parser/build/esm/encodePacket.js +36 -0
  221. package/dist/src/node_modules/engine.io-parser/build/esm/index.js +158 -0
  222. package/dist/src/node_modules/es-define-property/index.js +23 -0
  223. package/dist/src/node_modules/es-errors/eval.js +13 -0
  224. package/dist/src/node_modules/es-errors/index.js +13 -0
  225. package/dist/src/node_modules/es-errors/range.js +13 -0
  226. package/dist/src/node_modules/es-errors/ref.js +13 -0
  227. package/dist/src/node_modules/es-errors/syntax.js +13 -0
  228. package/dist/src/node_modules/es-errors/type.js +13 -0
  229. package/dist/src/node_modules/es-errors/uri.js +13 -0
  230. package/dist/src/node_modules/es-object-atoms/index.js +13 -0
  231. package/dist/src/node_modules/function-bind/implementation.js +93 -0
  232. package/dist/src/node_modules/function-bind/index.js +16 -0
  233. package/dist/src/node_modules/get-intrinsic/index.js +413 -0
  234. package/dist/src/node_modules/get-proto/Object.getPrototypeOf.js +17 -0
  235. package/dist/src/node_modules/get-proto/Reflect.getPrototypeOf.js +13 -0
  236. package/dist/src/node_modules/get-proto/index.js +40 -0
  237. package/dist/src/node_modules/gopd/gOPD.js +13 -0
  238. package/dist/src/node_modules/gopd/index.js +26 -0
  239. package/dist/src/node_modules/has-symbols/index.js +25 -0
  240. package/dist/src/node_modules/has-symbols/shams.js +54 -0
  241. package/dist/src/node_modules/hasown/index.js +19 -0
  242. package/dist/src/node_modules/http-errors/index.js +306 -0
  243. package/dist/src/node_modules/iconv-lite/encodings/dbcs-codec.js +598 -0
  244. package/dist/src/node_modules/iconv-lite/encodings/dbcs-data.js +206 -0
  245. package/dist/src/node_modules/iconv-lite/encodings/index.js +44 -0
  246. package/dist/src/node_modules/iconv-lite/encodings/internal.js +210 -0
  247. package/dist/src/node_modules/iconv-lite/encodings/sbcs-codec.js +83 -0
  248. package/dist/src/node_modules/iconv-lite/encodings/sbcs-data-generated.js +460 -0
  249. package/dist/src/node_modules/iconv-lite/encodings/sbcs-data.js +187 -0
  250. package/dist/src/node_modules/iconv-lite/encodings/tables/big5-added.json.js +506 -0
  251. package/dist/src/node_modules/iconv-lite/encodings/tables/cp936.json.js +2621 -0
  252. package/dist/src/node_modules/iconv-lite/encodings/tables/cp949.json.js +2380 -0
  253. package/dist/src/node_modules/iconv-lite/encodings/tables/cp950.json.js +729 -0
  254. package/dist/src/node_modules/iconv-lite/encodings/tables/eucjp.json.js +822 -0
  255. package/dist/src/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json.js +424 -0
  256. package/dist/src/node_modules/iconv-lite/encodings/tables/gbk-added.json.js +264 -0
  257. package/dist/src/node_modules/iconv-lite/encodings/tables/shiftjis.json.js +548 -0
  258. package/dist/src/node_modules/iconv-lite/encodings/utf16.js +206 -0
  259. package/dist/src/node_modules/iconv-lite/encodings/utf32.js +329 -0
  260. package/dist/src/node_modules/iconv-lite/encodings/utf7.js +297 -0
  261. package/dist/src/node_modules/iconv-lite/lib/bom-handling.js +61 -0
  262. package/dist/src/node_modules/iconv-lite/lib/index.js +192 -0
  263. package/dist/src/node_modules/iconv-lite/lib/streams.js +120 -0
  264. package/dist/src/node_modules/inherits/inherits.js +21 -0
  265. package/dist/src/node_modules/inherits/inherits_browser.js +38 -0
  266. package/dist/src/node_modules/math-intrinsics/abs.js +13 -0
  267. package/dist/src/node_modules/math-intrinsics/floor.js +13 -0
  268. package/dist/src/node_modules/math-intrinsics/isNaN.js +15 -0
  269. package/dist/src/node_modules/math-intrinsics/max.js +13 -0
  270. package/dist/src/node_modules/math-intrinsics/min.js +13 -0
  271. package/dist/src/node_modules/math-intrinsics/pow.js +13 -0
  272. package/dist/src/node_modules/math-intrinsics/round.js +13 -0
  273. package/dist/src/node_modules/math-intrinsics/sign.js +22 -0
  274. package/dist/src/node_modules/media-typer/index.js +153 -0
  275. package/dist/src/node_modules/mime-db/db.json.js +11656 -0
  276. package/dist/src/node_modules/mime-db/index.js +24 -0
  277. package/dist/src/node_modules/mime-types/index.js +226 -0
  278. package/dist/src/node_modules/mime-types/mimeScore.js +62 -0
  279. package/dist/src/node_modules/ms/index.js +172 -0
  280. package/dist/src/node_modules/object-assign/index.js +99 -0
  281. package/dist/src/node_modules/object-inspect/index.js +557 -0
  282. package/dist/src/node_modules/object-inspect/util.inspect.js +13 -0
  283. package/dist/src/node_modules/on-finished/index.js +245 -0
  284. package/dist/src/node_modules/qs/lib/formats.js +32 -0
  285. package/dist/src/node_modules/qs/lib/index.js +24 -0
  286. package/dist/src/node_modules/qs/lib/parse.js +339 -0
  287. package/dist/src/node_modules/qs/lib/stringify.js +369 -0
  288. package/dist/src/node_modules/qs/lib/utils.js +279 -0
  289. package/dist/src/node_modules/raw-body/index.js +351 -0
  290. package/dist/src/node_modules/safer-buffer/safer.js +88 -0
  291. package/dist/src/node_modules/setprototypeof/index.js +26 -0
  292. package/dist/src/node_modules/side-channel/index.js +58 -0
  293. package/dist/src/node_modules/side-channel-list/index.js +125 -0
  294. package/dist/src/node_modules/side-channel-map/index.js +82 -0
  295. package/dist/src/node_modules/side-channel-weakmap/index.js +99 -0
  296. package/dist/src/node_modules/socket.io/dist/broadcast-operator.js +448 -0
  297. package/dist/src/node_modules/socket.io/dist/client.js +281 -0
  298. package/dist/src/node_modules/socket.io/dist/index.js +837 -0
  299. package/dist/src/node_modules/socket.io/dist/namespace.js +597 -0
  300. package/dist/src/node_modules/socket.io/dist/parent-namespace.js +101 -0
  301. package/dist/src/node_modules/socket.io/dist/socket-types.js +21 -0
  302. package/dist/src/node_modules/socket.io/dist/socket.js +993 -0
  303. package/dist/src/node_modules/socket.io/dist/typed-events.js +92 -0
  304. package/dist/src/node_modules/socket.io/dist/uws.js +149 -0
  305. package/dist/src/node_modules/socket.io/node_modules/accepts/index.js +250 -0
  306. package/dist/src/node_modules/socket.io/node_modules/debug/src/browser.js +285 -0
  307. package/dist/src/node_modules/socket.io/node_modules/debug/src/common.js +285 -0
  308. package/dist/src/node_modules/socket.io/node_modules/debug/src/index.js +23 -0
  309. package/dist/src/node_modules/socket.io/node_modules/debug/src/node.js +279 -0
  310. package/dist/src/node_modules/socket.io/node_modules/mime-db/db.json.js +10704 -0
  311. package/dist/src/node_modules/socket.io/node_modules/mime-db/index.js +24 -0
  312. package/dist/src/node_modules/socket.io/node_modules/mime-types/index.js +202 -0
  313. package/dist/src/node_modules/socket.io/node_modules/negotiator/index.js +96 -0
  314. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/charset.js +179 -0
  315. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/encoding.js +193 -0
  316. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/language.js +188 -0
  317. package/dist/src/node_modules/socket.io/node_modules/negotiator/lib/mediaType.js +304 -0
  318. package/dist/src/node_modules/socket.io/package.json.js +5 -0
  319. package/dist/src/node_modules/socket.io/wrapper.js +5 -0
  320. package/dist/src/node_modules/socket.io-adapter/dist/cluster-adapter.js +689 -0
  321. package/dist/src/node_modules/socket.io-adapter/dist/contrib/yeast.js +64 -0
  322. package/dist/src/node_modules/socket.io-adapter/dist/in-memory-adapter.js +407 -0
  323. package/dist/src/node_modules/socket.io-adapter/dist/index.js +24 -0
  324. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/browser.js +285 -0
  325. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/common.js +285 -0
  326. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/index.js +23 -0
  327. package/dist/src/node_modules/socket.io-adapter/node_modules/debug/src/node.js +279 -0
  328. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/index.js +28 -0
  329. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/buffer-util.js +142 -0
  330. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/constants.js +21 -0
  331. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/event-target.js +303 -0
  332. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/extension.js +214 -0
  333. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/limiter.js +64 -0
  334. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/permessage-deflate.js +528 -0
  335. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/receiver.js +719 -0
  336. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/sender.js +513 -0
  337. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/stream.js +170 -0
  338. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/subprotocol.js +73 -0
  339. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/validation.js +141 -0
  340. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/websocket-server.js +559 -0
  341. package/dist/src/node_modules/socket.io-adapter/node_modules/ws/lib/websocket.js +1363 -0
  342. package/dist/src/node_modules/socket.io-client/build/esm/contrib/backo2.js +68 -0
  343. package/dist/src/node_modules/socket.io-client/build/esm/index.js +50 -0
  344. package/dist/src/node_modules/socket.io-client/build/esm/manager.js +373 -0
  345. package/dist/src/node_modules/socket.io-client/build/esm/on.js +8 -0
  346. package/dist/src/node_modules/socket.io-client/build/esm/socket.js +884 -0
  347. package/dist/src/node_modules/socket.io-client/build/esm/url.js +63 -0
  348. package/dist/src/node_modules/socket.io-parser/build/cjs/binary.js +99 -0
  349. package/dist/src/node_modules/socket.io-parser/build/cjs/index.js +337 -0
  350. package/dist/src/node_modules/socket.io-parser/build/cjs/is-binary.js +65 -0
  351. package/dist/src/node_modules/socket.io-parser/build/esm/binary.js +86 -0
  352. package/dist/src/node_modules/socket.io-parser/build/esm/index.js +314 -0
  353. package/dist/src/node_modules/socket.io-parser/build/esm/is-binary.js +52 -0
  354. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/browser.js +285 -0
  355. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/common.js +285 -0
  356. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/index.js +23 -0
  357. package/dist/src/node_modules/socket.io-parser/node_modules/debug/src/node.js +279 -0
  358. package/dist/src/node_modules/statuses/codes.json.js +67 -0
  359. package/dist/src/node_modules/statuses/index.js +157 -0
  360. package/dist/src/node_modules/toidentifier/index.js +41 -0
  361. package/dist/src/node_modules/type-is/index.js +263 -0
  362. package/dist/src/node_modules/unpipe/index.js +78 -0
  363. package/dist/src/node_modules/vary/index.js +159 -0
  364. package/dist/src/node_modules/xmlhttprequest-ssl/lib/XMLHttpRequest.js +702 -0
  365. package/dist/src/server/runChannel.js +8 -8
  366. package/dist/src/server/runServer.js +41 -2
  367. package/package.json +7 -3
@@ -0,0 +1,245 @@
1
+ import { __module as onFinished } from '../../_virtual/index10.js';
2
+ import { __require as requireEeFirst } from '../ee-first/index.js';
3
+
4
+ /*!
5
+ * on-finished
6
+ * Copyright(c) 2013 Jonathan Ong
7
+ * Copyright(c) 2014 Douglas Christopher Wilson
8
+ * MIT Licensed
9
+ */
10
+
11
+ var hasRequiredOnFinished;
12
+
13
+ function requireOnFinished () {
14
+ if (hasRequiredOnFinished) return onFinished.exports;
15
+ hasRequiredOnFinished = 1;
16
+
17
+ /**
18
+ * Module exports.
19
+ * @public
20
+ */
21
+
22
+ onFinished.exports = onFinished$1;
23
+ onFinished.exports.isFinished = isFinished;
24
+
25
+ /**
26
+ * Module dependencies.
27
+ * @private
28
+ */
29
+
30
+ var asyncHooks = tryRequireAsyncHooks();
31
+ var first = requireEeFirst();
32
+
33
+ /**
34
+ * Variables.
35
+ * @private
36
+ */
37
+
38
+ /* istanbul ignore next */
39
+ var defer = typeof setImmediate === 'function'
40
+ ? setImmediate
41
+ : function (fn) { process.nextTick(fn.bind.apply(fn, arguments)); };
42
+
43
+ /**
44
+ * Invoke callback when the response has finished, useful for
45
+ * cleaning up resources afterwards.
46
+ *
47
+ * @param {object} msg
48
+ * @param {function} listener
49
+ * @return {object}
50
+ * @public
51
+ */
52
+
53
+ function onFinished$1 (msg, listener) {
54
+ if (isFinished(msg) !== false) {
55
+ defer(listener, null, msg);
56
+ return msg
57
+ }
58
+
59
+ // attach the listener to the message
60
+ attachListener(msg, wrap(listener));
61
+
62
+ return msg
63
+ }
64
+
65
+ /**
66
+ * Determine if message is already finished.
67
+ *
68
+ * @param {object} msg
69
+ * @return {boolean}
70
+ * @public
71
+ */
72
+
73
+ function isFinished (msg) {
74
+ var socket = msg.socket;
75
+
76
+ if (typeof msg.finished === 'boolean') {
77
+ // OutgoingMessage
78
+ return Boolean(msg.finished || (socket && !socket.writable))
79
+ }
80
+
81
+ if (typeof msg.complete === 'boolean') {
82
+ // IncomingMessage
83
+ return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable))
84
+ }
85
+
86
+ // don't know
87
+ return undefined
88
+ }
89
+
90
+ /**
91
+ * Attach a finished listener to the message.
92
+ *
93
+ * @param {object} msg
94
+ * @param {function} callback
95
+ * @private
96
+ */
97
+
98
+ function attachFinishedListener (msg, callback) {
99
+ var eeMsg;
100
+ var eeSocket;
101
+ var finished = false;
102
+
103
+ function onFinish (error) {
104
+ eeMsg.cancel();
105
+ eeSocket.cancel();
106
+
107
+ finished = true;
108
+ callback(error);
109
+ }
110
+
111
+ // finished on first message event
112
+ eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish);
113
+
114
+ function onSocket (socket) {
115
+ // remove listener
116
+ msg.removeListener('socket', onSocket);
117
+
118
+ if (finished) return
119
+ if (eeMsg !== eeSocket) return
120
+
121
+ // finished on first socket event
122
+ eeSocket = first([[socket, 'error', 'close']], onFinish);
123
+ }
124
+
125
+ if (msg.socket) {
126
+ // socket already assigned
127
+ onSocket(msg.socket);
128
+ return
129
+ }
130
+
131
+ // wait for socket to be assigned
132
+ msg.on('socket', onSocket);
133
+
134
+ if (msg.socket === undefined) {
135
+ // istanbul ignore next: node.js 0.8 patch
136
+ patchAssignSocket(msg, onSocket);
137
+ }
138
+ }
139
+
140
+ /**
141
+ * Attach the listener to the message.
142
+ *
143
+ * @param {object} msg
144
+ * @return {function}
145
+ * @private
146
+ */
147
+
148
+ function attachListener (msg, listener) {
149
+ var attached = msg.__onFinished;
150
+
151
+ // create a private single listener with queue
152
+ if (!attached || !attached.queue) {
153
+ attached = msg.__onFinished = createListener(msg);
154
+ attachFinishedListener(msg, attached);
155
+ }
156
+
157
+ attached.queue.push(listener);
158
+ }
159
+
160
+ /**
161
+ * Create listener on message.
162
+ *
163
+ * @param {object} msg
164
+ * @return {function}
165
+ * @private
166
+ */
167
+
168
+ function createListener (msg) {
169
+ function listener (err) {
170
+ if (msg.__onFinished === listener) msg.__onFinished = null;
171
+ if (!listener.queue) return
172
+
173
+ var queue = listener.queue;
174
+ listener.queue = null;
175
+
176
+ for (var i = 0; i < queue.length; i++) {
177
+ queue[i](err, msg);
178
+ }
179
+ }
180
+
181
+ listener.queue = [];
182
+
183
+ return listener
184
+ }
185
+
186
+ /**
187
+ * Patch ServerResponse.prototype.assignSocket for node.js 0.8.
188
+ *
189
+ * @param {ServerResponse} res
190
+ * @param {function} callback
191
+ * @private
192
+ */
193
+
194
+ // istanbul ignore next: node.js 0.8 patch
195
+ function patchAssignSocket (res, callback) {
196
+ var assignSocket = res.assignSocket;
197
+
198
+ if (typeof assignSocket !== 'function') return
199
+
200
+ // res.on('socket', callback) is broken in 0.8
201
+ res.assignSocket = function _assignSocket (socket) {
202
+ assignSocket.call(this, socket);
203
+ callback(socket);
204
+ };
205
+ }
206
+
207
+ /**
208
+ * Try to require async_hooks
209
+ * @private
210
+ */
211
+
212
+ function tryRequireAsyncHooks () {
213
+ try {
214
+ return require('async_hooks')
215
+ } catch (e) {
216
+ return {}
217
+ }
218
+ }
219
+
220
+ /**
221
+ * Wrap function with async resource, if possible.
222
+ * AsyncResource.bind static method backported.
223
+ * @private
224
+ */
225
+
226
+ function wrap (fn) {
227
+ var res;
228
+
229
+ // create anonymous resource
230
+ if (asyncHooks.AsyncResource) {
231
+ res = new asyncHooks.AsyncResource(fn.name || 'bound-anonymous-fn');
232
+ }
233
+
234
+ // incompatible node.js
235
+ if (!res || !res.runInAsyncScope) {
236
+ return fn
237
+ }
238
+
239
+ // return bound function
240
+ return res.runInAsyncScope.bind(res, fn, null)
241
+ }
242
+ return onFinished.exports;
243
+ }
244
+
245
+ export { requireOnFinished as __require };
@@ -0,0 +1,32 @@
1
+ var formats;
2
+ var hasRequiredFormats;
3
+
4
+ function requireFormats () {
5
+ if (hasRequiredFormats) return formats;
6
+ hasRequiredFormats = 1;
7
+
8
+ var replace = String.prototype.replace;
9
+ var percentTwenties = /%20/g;
10
+
11
+ var Format = {
12
+ RFC1738: 'RFC1738',
13
+ RFC3986: 'RFC3986'
14
+ };
15
+
16
+ formats = {
17
+ 'default': Format.RFC3986,
18
+ formatters: {
19
+ RFC1738: function (value) {
20
+ return replace.call(value, percentTwenties, '+');
21
+ },
22
+ RFC3986: function (value) {
23
+ return String(value);
24
+ }
25
+ },
26
+ RFC1738: Format.RFC1738,
27
+ RFC3986: Format.RFC3986
28
+ };
29
+ return formats;
30
+ }
31
+
32
+ export { requireFormats as __require };
@@ -0,0 +1,24 @@
1
+ import { __require as requireStringify } from './stringify.js';
2
+ import { __require as requireParse } from './parse.js';
3
+ import { __require as requireFormats } from './formats.js';
4
+
5
+ var lib;
6
+ var hasRequiredLib;
7
+
8
+ function requireLib () {
9
+ if (hasRequiredLib) return lib;
10
+ hasRequiredLib = 1;
11
+
12
+ var stringify = /*@__PURE__*/ requireStringify();
13
+ var parse = /*@__PURE__*/ requireParse();
14
+ var formats = /*@__PURE__*/ requireFormats();
15
+
16
+ lib = {
17
+ formats: formats,
18
+ parse: parse,
19
+ stringify: stringify
20
+ };
21
+ return lib;
22
+ }
23
+
24
+ export { requireLib as __require };
@@ -0,0 +1,339 @@
1
+ import { __require as requireUtils } from './utils.js';
2
+
3
+ var parse;
4
+ var hasRequiredParse;
5
+
6
+ function requireParse () {
7
+ if (hasRequiredParse) return parse;
8
+ hasRequiredParse = 1;
9
+
10
+ var utils = /*@__PURE__*/ requireUtils();
11
+
12
+ var has = Object.prototype.hasOwnProperty;
13
+ var isArray = Array.isArray;
14
+
15
+ var defaults = {
16
+ allowDots: false,
17
+ allowEmptyArrays: false,
18
+ allowPrototypes: false,
19
+ allowSparse: false,
20
+ arrayLimit: 20,
21
+ charset: 'utf-8',
22
+ charsetSentinel: false,
23
+ comma: false,
24
+ decodeDotInKeys: false,
25
+ decoder: utils.decode,
26
+ delimiter: '&',
27
+ depth: 5,
28
+ duplicates: 'combine',
29
+ ignoreQueryPrefix: false,
30
+ interpretNumericEntities: false,
31
+ parameterLimit: 1000,
32
+ parseArrays: true,
33
+ plainObjects: false,
34
+ strictDepth: false,
35
+ strictNullHandling: false,
36
+ throwOnLimitExceeded: false
37
+ };
38
+
39
+ var interpretNumericEntities = function (str) {
40
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
41
+ return String.fromCharCode(parseInt(numberStr, 10));
42
+ });
43
+ };
44
+
45
+ var parseArrayValue = function (val, options, currentArrayLength) {
46
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
47
+ return val.split(',');
48
+ }
49
+
50
+ if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
51
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
52
+ }
53
+
54
+ return val;
55
+ };
56
+
57
+ // This is what browsers will submit when the ✓ character occurs in an
58
+ // application/x-www-form-urlencoded body and the encoding of the page containing
59
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
60
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
61
+ // the ✓ character, such as us-ascii.
62
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
63
+
64
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
65
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
66
+
67
+ var parseValues = function parseQueryStringValues(str, options) {
68
+ var obj = { __proto__: null };
69
+
70
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
71
+ cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
72
+
73
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
74
+ var parts = cleanStr.split(
75
+ options.delimiter,
76
+ options.throwOnLimitExceeded ? limit + 1 : limit
77
+ );
78
+
79
+ if (options.throwOnLimitExceeded && parts.length > limit) {
80
+ throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
81
+ }
82
+
83
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
84
+ var i;
85
+
86
+ var charset = options.charset;
87
+ if (options.charsetSentinel) {
88
+ for (i = 0; i < parts.length; ++i) {
89
+ if (parts[i].indexOf('utf8=') === 0) {
90
+ if (parts[i] === charsetSentinel) {
91
+ charset = 'utf-8';
92
+ } else if (parts[i] === isoSentinel) {
93
+ charset = 'iso-8859-1';
94
+ }
95
+ skipIndex = i;
96
+ i = parts.length; // The eslint settings do not allow break;
97
+ }
98
+ }
99
+ }
100
+
101
+ for (i = 0; i < parts.length; ++i) {
102
+ if (i === skipIndex) {
103
+ continue;
104
+ }
105
+ var part = parts[i];
106
+
107
+ var bracketEqualsPos = part.indexOf(']=');
108
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
109
+
110
+ var key;
111
+ var val;
112
+ if (pos === -1) {
113
+ key = options.decoder(part, defaults.decoder, charset, 'key');
114
+ val = options.strictNullHandling ? null : '';
115
+ } else {
116
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
117
+
118
+ val = utils.maybeMap(
119
+ parseArrayValue(
120
+ part.slice(pos + 1),
121
+ options,
122
+ isArray(obj[key]) ? obj[key].length : 0
123
+ ),
124
+ function (encodedVal) {
125
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
126
+ }
127
+ );
128
+ }
129
+
130
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
131
+ val = interpretNumericEntities(String(val));
132
+ }
133
+
134
+ if (part.indexOf('[]=') > -1) {
135
+ val = isArray(val) ? [val] : val;
136
+ }
137
+
138
+ var existing = has.call(obj, key);
139
+ if (existing && options.duplicates === 'combine') {
140
+ obj[key] = utils.combine(obj[key], val);
141
+ } else if (!existing || options.duplicates === 'last') {
142
+ obj[key] = val;
143
+ }
144
+ }
145
+
146
+ return obj;
147
+ };
148
+
149
+ var parseObject = function (chain, val, options, valuesParsed) {
150
+ var currentArrayLength = 0;
151
+ if (chain.length > 0 && chain[chain.length - 1] === '[]') {
152
+ var parentKey = chain.slice(0, -1).join('');
153
+ currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
154
+ }
155
+
156
+ var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
157
+
158
+ for (var i = chain.length - 1; i >= 0; --i) {
159
+ var obj;
160
+ var root = chain[i];
161
+
162
+ if (root === '[]' && options.parseArrays) {
163
+ obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
164
+ ? []
165
+ : utils.combine([], leaf);
166
+ } else {
167
+ obj = options.plainObjects ? { __proto__: null } : {};
168
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
169
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
170
+ var index = parseInt(decodedRoot, 10);
171
+ if (!options.parseArrays && decodedRoot === '') {
172
+ obj = { 0: leaf };
173
+ } else if (
174
+ !isNaN(index)
175
+ && root !== decodedRoot
176
+ && String(index) === decodedRoot
177
+ && index >= 0
178
+ && (options.parseArrays && index <= options.arrayLimit)
179
+ ) {
180
+ obj = [];
181
+ obj[index] = leaf;
182
+ } else if (decodedRoot !== '__proto__') {
183
+ obj[decodedRoot] = leaf;
184
+ }
185
+ }
186
+
187
+ leaf = obj;
188
+ }
189
+
190
+ return leaf;
191
+ };
192
+
193
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
194
+ if (!givenKey) {
195
+ return;
196
+ }
197
+
198
+ // Transform dot notation to bracket notation
199
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
200
+
201
+ // The regex chunks
202
+
203
+ var brackets = /(\[[^[\]]*])/;
204
+ var child = /(\[[^[\]]*])/g;
205
+
206
+ // Get the parent
207
+
208
+ var segment = options.depth > 0 && brackets.exec(key);
209
+ var parent = segment ? key.slice(0, segment.index) : key;
210
+
211
+ // Stash the parent if it exists
212
+
213
+ var keys = [];
214
+ if (parent) {
215
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
216
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
217
+ if (!options.allowPrototypes) {
218
+ return;
219
+ }
220
+ }
221
+
222
+ keys.push(parent);
223
+ }
224
+
225
+ // Loop through children appending to the array until we hit depth
226
+
227
+ var i = 0;
228
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
229
+ i += 1;
230
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
231
+ if (!options.allowPrototypes) {
232
+ return;
233
+ }
234
+ }
235
+ keys.push(segment[1]);
236
+ }
237
+
238
+ // If there's a remainder, check strictDepth option for throw, else just add whatever is left
239
+
240
+ if (segment) {
241
+ if (options.strictDepth === true) {
242
+ throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
243
+ }
244
+ keys.push('[' + key.slice(segment.index) + ']');
245
+ }
246
+
247
+ return parseObject(keys, val, options, valuesParsed);
248
+ };
249
+
250
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
251
+ if (!opts) {
252
+ return defaults;
253
+ }
254
+
255
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
256
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
257
+ }
258
+
259
+ if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
260
+ throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
261
+ }
262
+
263
+ if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
264
+ throw new TypeError('Decoder has to be a function.');
265
+ }
266
+
267
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
268
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
269
+ }
270
+
271
+ if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {
272
+ throw new TypeError('`throwOnLimitExceeded` option must be a boolean');
273
+ }
274
+
275
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
276
+
277
+ var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
278
+
279
+ if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
280
+ throw new TypeError('The duplicates option must be either combine, first, or last');
281
+ }
282
+
283
+ var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
284
+
285
+ return {
286
+ allowDots: allowDots,
287
+ allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
288
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
289
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
290
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
291
+ charset: charset,
292
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
293
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
294
+ decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
295
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
296
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
297
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
298
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
299
+ duplicates: duplicates,
300
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
301
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
302
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
303
+ parseArrays: opts.parseArrays !== false,
304
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
305
+ strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
306
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
307
+ throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
308
+ };
309
+ };
310
+
311
+ parse = function (str, opts) {
312
+ var options = normalizeParseOptions(opts);
313
+
314
+ if (str === '' || str === null || typeof str === 'undefined') {
315
+ return options.plainObjects ? { __proto__: null } : {};
316
+ }
317
+
318
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
319
+ var obj = options.plainObjects ? { __proto__: null } : {};
320
+
321
+ // Iterate over the keys and setup the new object
322
+
323
+ var keys = Object.keys(tempObj);
324
+ for (var i = 0; i < keys.length; ++i) {
325
+ var key = keys[i];
326
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
327
+ obj = utils.merge(obj, newObj, options);
328
+ }
329
+
330
+ if (options.allowSparse === true) {
331
+ return obj;
332
+ }
333
+
334
+ return utils.compact(obj);
335
+ };
336
+ return parse;
337
+ }
338
+
339
+ export { requireParse as __require };