@cloudbase/js-sdk 3.4.6 → 3.4.7

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 (779) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/ai/dist/index.esm.js +2 -3
  3. package/ai/dist/index.esm.js.map +1 -0
  4. package/ai/dist/index.js +2 -21
  5. package/ai/dist/index.js.map +1 -0
  6. package/apis/dist/index.esm.js +2 -3
  7. package/apis/dist/index.esm.js.map +1 -0
  8. package/apis/dist/index.js +2 -21
  9. package/apis/dist/index.js.map +1 -0
  10. package/app/dist/index.esm.js +2 -11
  11. package/app/dist/index.esm.js.map +1 -0
  12. package/app/dist/index.js +2 -18
  13. package/app/dist/index.js.map +1 -0
  14. package/auth/dist/index.esm.js +3 -8
  15. package/auth/dist/index.esm.js.LICENSE.txt +12 -0
  16. package/auth/dist/index.esm.js.map +1 -0
  17. package/auth/dist/index.js +3 -13
  18. package/auth/dist/index.js.LICENSE.txt +12 -0
  19. package/auth/dist/index.js.map +1 -0
  20. package/cloudrun/dist/index.esm.js +2 -3
  21. package/cloudrun/dist/index.esm.js.map +1 -0
  22. package/cloudrun/dist/index.js +2 -21
  23. package/cloudrun/dist/index.js.map +1 -0
  24. package/container/dist/index.esm.js +2 -8
  25. package/container/dist/index.esm.js.map +1 -0
  26. package/container/dist/index.js +2 -13
  27. package/container/dist/index.js.map +1 -0
  28. package/database/package.json +34 -4
  29. package/dist/index.cjs.js +3 -38
  30. package/dist/index.cjs.js.LICENSE.txt +12 -0
  31. package/dist/index.cjs.js.map +1 -0
  32. package/dist/index.esm.js +3 -33
  33. package/dist/index.esm.js.LICENSE.txt +12 -0
  34. package/dist/index.esm.js.map +1 -0
  35. package/functions/dist/index.esm.js +2 -8
  36. package/functions/dist/index.esm.js.map +1 -0
  37. package/functions/dist/index.js +2 -13
  38. package/functions/dist/index.js.map +1 -0
  39. package/miniprogram_dist/ai.js +1 -1
  40. package/miniprogram_dist/apis.js +1 -1
  41. package/miniprogram_dist/app.js +1 -1
  42. package/miniprogram_dist/auth.js +1 -1
  43. package/miniprogram_dist/cloudrun.js +1 -1
  44. package/miniprogram_dist/container.js +1 -1
  45. package/miniprogram_dist/database.js +1 -1
  46. package/miniprogram_dist/functions.js +1 -1
  47. package/miniprogram_dist/index.js +1 -1
  48. package/miniprogram_dist/model.js +1 -1
  49. package/miniprogram_dist/mysql.js +1 -1
  50. package/miniprogram_dist/oauth.js +2 -1
  51. package/miniprogram_dist/realtime.js +1 -1
  52. package/miniprogram_dist/storage.js +1 -1
  53. package/model/dist/index.esm.js +2 -3
  54. package/model/dist/index.esm.js.map +1 -0
  55. package/model/dist/index.js +2 -21
  56. package/model/dist/index.js.map +1 -0
  57. package/mysql/dist/index.esm.js +2 -3
  58. package/mysql/dist/index.esm.js.map +1 -0
  59. package/mysql/dist/index.js +2 -21
  60. package/mysql/dist/index.js.map +1 -0
  61. package/oauth/dist/index.esm.js +3 -3
  62. package/oauth/dist/index.esm.js.LICENSE.txt +12 -0
  63. package/oauth/dist/index.esm.js.map +1 -0
  64. package/oauth/dist/index.js +3 -21
  65. package/oauth/dist/index.js.LICENSE.txt +12 -0
  66. package/oauth/dist/index.js.map +1 -0
  67. package/package.json +29 -47
  68. package/realtime/dist/index.esm.js +2 -8
  69. package/realtime/dist/index.esm.js.map +1 -0
  70. package/realtime/dist/index.js +2 -13
  71. package/realtime/dist/index.js.map +1 -0
  72. package/storage/dist/index.esm.js +2 -4
  73. package/storage/dist/index.esm.js.map +1 -0
  74. package/storage/dist/index.js +2 -9
  75. package/storage/dist/index.js.map +1 -0
  76. package/types/analytics.d.ts +51 -0
  77. package/types/container.d.ts +93 -0
  78. package/{node_modules/@cloudbase/types → types}/package.json +1 -1
  79. package/{node_modules/@cloudbase/utilities → utilities}/package.json +2 -2
  80. package/ai/src/index.d.ts +0 -1
  81. package/ai/src/index.ts +0 -1
  82. package/apis/src/index.d.ts +0 -1
  83. package/apis/src/index.ts +0 -1
  84. package/app/src/index.ts +0 -17
  85. package/auth/src/index.d.ts +0 -2
  86. package/auth/src/index.ts +0 -8
  87. package/cloudrun/src/index.d.ts +0 -1
  88. package/cloudrun/src/index.ts +0 -1
  89. package/container/src/index.d.ts +0 -2
  90. package/container/src/index.ts +0 -8
  91. package/database/dist/index.d.ts +0 -3
  92. package/database/dist/index.esm.js +0 -503
  93. package/database/dist/index.js +0 -509
  94. package/database/src/index.d.ts +0 -3
  95. package/database/src/index.ts +0 -486
  96. package/functions/src/index.d.ts +0 -2
  97. package/functions/src/index.ts +0 -8
  98. package/model/src/index.d.ts +0 -1
  99. package/model/src/index.ts +0 -1
  100. package/mysql/src/index.d.ts +0 -1
  101. package/mysql/src/index.ts +0 -1
  102. package/node_modules/@cloudbase/ai/.eslintrc.js +0 -15
  103. package/node_modules/@cloudbase/ai/dist/cjs/AI.d.ts +0 -27
  104. package/node_modules/@cloudbase/ai/dist/cjs/AI.js +0 -224
  105. package/node_modules/@cloudbase/ai/dist/cjs/bot/index.d.ts +0 -41
  106. package/node_modules/@cloudbase/ai/dist/cjs/bot/index.js +0 -376
  107. package/node_modules/@cloudbase/ai/dist/cjs/bot/types.d.ts +0 -144
  108. package/node_modules/@cloudbase/ai/dist/cjs/bot/types.js +0 -3
  109. package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/index.d.ts +0 -2
  110. package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/index.js +0 -6
  111. package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/parse.d.ts +0 -2
  112. package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/parse.js +0 -126
  113. package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/stream.d.ts +0 -5
  114. package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/stream.js +0 -40
  115. package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/types.d.ts +0 -16
  116. package/node_modules/@cloudbase/ai/dist/cjs/eventsource_parser/types.js +0 -3
  117. package/node_modules/@cloudbase/ai/dist/cjs/index.d.ts +0 -40
  118. package/node_modules/@cloudbase/ai/dist/cjs/index.js +0 -187
  119. package/node_modules/@cloudbase/ai/dist/cjs/models/Ark/index.d.ts +0 -10
  120. package/node_modules/@cloudbase/ai/dist/cjs/models/Ark/index.js +0 -130
  121. package/node_modules/@cloudbase/ai/dist/cjs/models/Ark/type.d.ts +0 -71
  122. package/node_modules/@cloudbase/ai/dist/cjs/models/Ark/type.js +0 -3
  123. package/node_modules/@cloudbase/ai/dist/cjs/models/DashScope/index.d.ts +0 -10
  124. package/node_modules/@cloudbase/ai/dist/cjs/models/DashScope/index.js +0 -130
  125. package/node_modules/@cloudbase/ai/dist/cjs/models/DashScope/type.d.ts +0 -74
  126. package/node_modules/@cloudbase/ai/dist/cjs/models/DashScope/type.js +0 -3
  127. package/node_modules/@cloudbase/ai/dist/cjs/models/DeepSeek/index.d.ts +0 -10
  128. package/node_modules/@cloudbase/ai/dist/cjs/models/DeepSeek/index.js +0 -126
  129. package/node_modules/@cloudbase/ai/dist/cjs/models/Default/index.d.ts +0 -10
  130. package/node_modules/@cloudbase/ai/dist/cjs/models/Default/index.js +0 -122
  131. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/index.d.ts +0 -10
  132. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/index.js +0 -135
  133. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/type.d.ts +0 -74
  134. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/type.js +0 -3
  135. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/util.d.ts +0 -4
  136. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuan/util.js +0 -56
  137. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanBeta/index.d.ts +0 -10
  138. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanBeta/index.js +0 -127
  139. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanExp/index.d.ts +0 -10
  140. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanExp/index.js +0 -125
  141. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanOpen/index.d.ts +0 -10
  142. package/node_modules/@cloudbase/ai/dist/cjs/models/HunYuanOpen/index.js +0 -127
  143. package/node_modules/@cloudbase/ai/dist/cjs/models/Moonshot/index.d.ts +0 -10
  144. package/node_modules/@cloudbase/ai/dist/cjs/models/Moonshot/index.js +0 -130
  145. package/node_modules/@cloudbase/ai/dist/cjs/models/Moonshot/type.d.ts +0 -85
  146. package/node_modules/@cloudbase/ai/dist/cjs/models/Moonshot/type.js +0 -3
  147. package/node_modules/@cloudbase/ai/dist/cjs/models/Yi/index.d.ts +0 -10
  148. package/node_modules/@cloudbase/ai/dist/cjs/models/Yi/index.js +0 -133
  149. package/node_modules/@cloudbase/ai/dist/cjs/models/Yi/type.d.ts +0 -75
  150. package/node_modules/@cloudbase/ai/dist/cjs/models/Yi/type.js +0 -3
  151. package/node_modules/@cloudbase/ai/dist/cjs/models/ZhiPu/index.d.ts +0 -10
  152. package/node_modules/@cloudbase/ai/dist/cjs/models/ZhiPu/index.js +0 -139
  153. package/node_modules/@cloudbase/ai/dist/cjs/models/ZhiPu/type.d.ts +0 -71
  154. package/node_modules/@cloudbase/ai/dist/cjs/models/ZhiPu/type.js +0 -3
  155. package/node_modules/@cloudbase/ai/dist/cjs/models/image-model.d.ts +0 -18
  156. package/node_modules/@cloudbase/ai/dist/cjs/models/image-model.js +0 -85
  157. package/node_modules/@cloudbase/ai/dist/cjs/models/index.d.ts +0 -26
  158. package/node_modules/@cloudbase/ai/dist/cjs/models/index.js +0 -42
  159. package/node_modules/@cloudbase/ai/dist/cjs/models/model.d.ts +0 -40
  160. package/node_modules/@cloudbase/ai/dist/cjs/models/model.js +0 -481
  161. package/node_modules/@cloudbase/ai/dist/cjs/type.d.ts +0 -190
  162. package/node_modules/@cloudbase/ai/dist/cjs/type.js +0 -10
  163. package/node_modules/@cloudbase/ai/dist/cjs/utils.d.ts +0 -38
  164. package/node_modules/@cloudbase/ai/dist/cjs/utils.js +0 -263
  165. package/node_modules/@cloudbase/ai/dist/esm/AI.d.ts +0 -27
  166. package/node_modules/@cloudbase/ai/dist/esm/AI.js +0 -198
  167. package/node_modules/@cloudbase/ai/dist/esm/bot/index.d.ts +0 -41
  168. package/node_modules/@cloudbase/ai/dist/esm/bot/index.js +0 -373
  169. package/node_modules/@cloudbase/ai/dist/esm/bot/types.d.ts +0 -144
  170. package/node_modules/@cloudbase/ai/dist/esm/bot/types.js +0 -2
  171. package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/index.d.ts +0 -2
  172. package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/index.js +0 -2
  173. package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/parse.d.ts +0 -2
  174. package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/parse.js +0 -122
  175. package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/stream.d.ts +0 -5
  176. package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/stream.js +0 -37
  177. package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/types.d.ts +0 -16
  178. package/node_modules/@cloudbase/ai/dist/esm/eventsource_parser/types.js +0 -2
  179. package/node_modules/@cloudbase/ai/dist/esm/index.d.ts +0 -40
  180. package/node_modules/@cloudbase/ai/dist/esm/index.js +0 -152
  181. package/node_modules/@cloudbase/ai/dist/esm/models/Ark/index.d.ts +0 -10
  182. package/node_modules/@cloudbase/ai/dist/esm/models/Ark/index.js +0 -127
  183. package/node_modules/@cloudbase/ai/dist/esm/models/Ark/type.d.ts +0 -71
  184. package/node_modules/@cloudbase/ai/dist/esm/models/Ark/type.js +0 -2
  185. package/node_modules/@cloudbase/ai/dist/esm/models/DashScope/index.d.ts +0 -10
  186. package/node_modules/@cloudbase/ai/dist/esm/models/DashScope/index.js +0 -127
  187. package/node_modules/@cloudbase/ai/dist/esm/models/DashScope/type.d.ts +0 -74
  188. package/node_modules/@cloudbase/ai/dist/esm/models/DashScope/type.js +0 -2
  189. package/node_modules/@cloudbase/ai/dist/esm/models/DeepSeek/index.d.ts +0 -10
  190. package/node_modules/@cloudbase/ai/dist/esm/models/DeepSeek/index.js +0 -123
  191. package/node_modules/@cloudbase/ai/dist/esm/models/Default/index.d.ts +0 -10
  192. package/node_modules/@cloudbase/ai/dist/esm/models/Default/index.js +0 -119
  193. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/index.d.ts +0 -10
  194. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/index.js +0 -132
  195. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/type.d.ts +0 -74
  196. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/type.js +0 -2
  197. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/util.d.ts +0 -4
  198. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuan/util.js +0 -51
  199. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanBeta/index.d.ts +0 -10
  200. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanBeta/index.js +0 -124
  201. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanExp/index.d.ts +0 -10
  202. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanExp/index.js +0 -122
  203. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanOpen/index.d.ts +0 -10
  204. package/node_modules/@cloudbase/ai/dist/esm/models/HunYuanOpen/index.js +0 -124
  205. package/node_modules/@cloudbase/ai/dist/esm/models/Moonshot/index.d.ts +0 -10
  206. package/node_modules/@cloudbase/ai/dist/esm/models/Moonshot/index.js +0 -127
  207. package/node_modules/@cloudbase/ai/dist/esm/models/Moonshot/type.d.ts +0 -85
  208. package/node_modules/@cloudbase/ai/dist/esm/models/Moonshot/type.js +0 -2
  209. package/node_modules/@cloudbase/ai/dist/esm/models/Yi/index.d.ts +0 -10
  210. package/node_modules/@cloudbase/ai/dist/esm/models/Yi/index.js +0 -130
  211. package/node_modules/@cloudbase/ai/dist/esm/models/Yi/type.d.ts +0 -75
  212. package/node_modules/@cloudbase/ai/dist/esm/models/Yi/type.js +0 -2
  213. package/node_modules/@cloudbase/ai/dist/esm/models/ZhiPu/index.d.ts +0 -10
  214. package/node_modules/@cloudbase/ai/dist/esm/models/ZhiPu/index.js +0 -136
  215. package/node_modules/@cloudbase/ai/dist/esm/models/ZhiPu/type.d.ts +0 -71
  216. package/node_modules/@cloudbase/ai/dist/esm/models/ZhiPu/type.js +0 -2
  217. package/node_modules/@cloudbase/ai/dist/esm/models/image-model.d.ts +0 -18
  218. package/node_modules/@cloudbase/ai/dist/esm/models/image-model.js +0 -82
  219. package/node_modules/@cloudbase/ai/dist/esm/models/index.d.ts +0 -26
  220. package/node_modules/@cloudbase/ai/dist/esm/models/index.js +0 -27
  221. package/node_modules/@cloudbase/ai/dist/esm/models/model.d.ts +0 -40
  222. package/node_modules/@cloudbase/ai/dist/esm/models/model.js +0 -478
  223. package/node_modules/@cloudbase/ai/dist/esm/type.d.ts +0 -190
  224. package/node_modules/@cloudbase/ai/dist/esm/type.js +0 -7
  225. package/node_modules/@cloudbase/ai/dist/esm/utils.d.ts +0 -38
  226. package/node_modules/@cloudbase/ai/dist/esm/utils.js +0 -252
  227. package/node_modules/@cloudbase/ai/dist/miniprogram/index.js +0 -2
  228. package/node_modules/@cloudbase/ai/dist/miniprogram/index.js.LICENSE.txt +0 -22
  229. package/node_modules/@cloudbase/ai/package.json +0 -32
  230. package/node_modules/@cloudbase/apis/.eslintrc.js +0 -15
  231. package/node_modules/@cloudbase/apis/dist/cjs/callApis.d.ts +0 -20
  232. package/node_modules/@cloudbase/apis/dist/cjs/callApis.js +0 -154
  233. package/node_modules/@cloudbase/apis/dist/cjs/index.d.ts +0 -5
  234. package/node_modules/@cloudbase/apis/dist/cjs/index.js +0 -53
  235. package/node_modules/@cloudbase/apis/dist/cjs/type.d.ts +0 -14
  236. package/node_modules/@cloudbase/apis/dist/cjs/type.js +0 -3
  237. package/node_modules/@cloudbase/apis/dist/esm/callApis.d.ts +0 -20
  238. package/node_modules/@cloudbase/apis/dist/esm/callApis.js +0 -148
  239. package/node_modules/@cloudbase/apis/dist/esm/index.d.ts +0 -5
  240. package/node_modules/@cloudbase/apis/dist/esm/index.js +0 -35
  241. package/node_modules/@cloudbase/apis/dist/esm/type.d.ts +0 -14
  242. package/node_modules/@cloudbase/apis/dist/esm/type.js +0 -2
  243. package/node_modules/@cloudbase/apis/dist/miniprogram/index.js +0 -1
  244. package/node_modules/@cloudbase/apis/package.json +0 -28
  245. package/node_modules/@cloudbase/app/.eslintrc.js +0 -12
  246. package/node_modules/@cloudbase/app/dist/cjs/constants/common.d.ts +0 -38
  247. package/node_modules/@cloudbase/app/dist/cjs/constants/common.js +0 -103
  248. package/node_modules/@cloudbase/app/dist/cjs/index.d.ts +0 -65
  249. package/node_modules/@cloudbase/app/dist/cjs/index.js +0 -340
  250. package/node_modules/@cloudbase/app/dist/cjs/index.node.d.ts +0 -6
  251. package/node_modules/@cloudbase/app/dist/cjs/index.node.js +0 -27
  252. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/constants.d.ts +0 -33
  253. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/constants.js +0 -38
  254. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/context.d.ts +0 -17
  255. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/context.js +0 -189
  256. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/index.d.ts +0 -25
  257. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/index.js +0 -150
  258. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/metadata.d.ts +0 -14
  259. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/metadata.js +0 -130
  260. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/request.d.ts +0 -41
  261. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/request.js +0 -521
  262. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/tool.d.ts +0 -2
  263. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/tool.js +0 -354
  264. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/types.d.ts +0 -102
  265. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/types.js +0 -3
  266. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/utils.d.ts +0 -37
  267. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/utils.js +0 -286
  268. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/wx.d.ts +0 -39
  269. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter-node/wx.js +0 -272
  270. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter.d.ts +0 -3
  271. package/node_modules/@cloudbase/app/dist/cjs/libs/adapter.js +0 -163
  272. package/node_modules/@cloudbase/app/dist/cjs/libs/cache.d.ts +0 -6
  273. package/node_modules/@cloudbase/app/dist/cjs/libs/cache.js +0 -38
  274. package/node_modules/@cloudbase/app/dist/cjs/libs/component.d.ts +0 -3
  275. package/node_modules/@cloudbase/app/dist/cjs/libs/component.js +0 -126
  276. package/node_modules/@cloudbase/app/dist/cjs/libs/lang.d.ts +0 -23
  277. package/node_modules/@cloudbase/app/dist/cjs/libs/lang.js +0 -59
  278. package/node_modules/@cloudbase/app/dist/cjs/libs/request.d.ts +0 -62
  279. package/node_modules/@cloudbase/app/dist/cjs/libs/request.js +0 -480
  280. package/node_modules/@cloudbase/app/dist/esm/constants/common.d.ts +0 -38
  281. package/node_modules/@cloudbase/app/dist/esm/constants/common.js +0 -91
  282. package/node_modules/@cloudbase/app/dist/esm/index.d.ts +0 -65
  283. package/node_modules/@cloudbase/app/dist/esm/index.js +0 -335
  284. package/node_modules/@cloudbase/app/dist/esm/index.node.d.ts +0 -6
  285. package/node_modules/@cloudbase/app/dist/esm/index.node.js +0 -19
  286. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/constants.d.ts +0 -33
  287. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/constants.js +0 -35
  288. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/context.d.ts +0 -17
  289. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/context.js +0 -181
  290. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/index.d.ts +0 -25
  291. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/index.js +0 -120
  292. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/metadata.d.ts +0 -14
  293. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/metadata.js +0 -123
  294. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/request.d.ts +0 -41
  295. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/request.js +0 -495
  296. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/tool.d.ts +0 -2
  297. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/tool.js +0 -350
  298. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/types.d.ts +0 -102
  299. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/types.js +0 -2
  300. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/utils.d.ts +0 -37
  301. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/utils.js +0 -264
  302. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/wx.d.ts +0 -39
  303. package/node_modules/@cloudbase/app/dist/esm/libs/adapter-node/wx.js +0 -237
  304. package/node_modules/@cloudbase/app/dist/esm/libs/adapter.d.ts +0 -3
  305. package/node_modules/@cloudbase/app/dist/esm/libs/adapter.js +0 -136
  306. package/node_modules/@cloudbase/app/dist/esm/libs/cache.d.ts +0 -6
  307. package/node_modules/@cloudbase/app/dist/esm/libs/cache.js +0 -32
  308. package/node_modules/@cloudbase/app/dist/esm/libs/component.d.ts +0 -3
  309. package/node_modules/@cloudbase/app/dist/esm/libs/component.js +0 -121
  310. package/node_modules/@cloudbase/app/dist/esm/libs/lang.d.ts +0 -23
  311. package/node_modules/@cloudbase/app/dist/esm/libs/lang.js +0 -54
  312. package/node_modules/@cloudbase/app/dist/esm/libs/request.d.ts +0 -62
  313. package/node_modules/@cloudbase/app/dist/esm/libs/request.js +0 -475
  314. package/node_modules/@cloudbase/app/dist/miniprogram/index.js +0 -2
  315. package/node_modules/@cloudbase/app/dist/miniprogram/index.js.LICENSE.txt +0 -7
  316. package/node_modules/@cloudbase/app/package.json +0 -59
  317. package/node_modules/@cloudbase/auth/.eslintrc.js +0 -15
  318. package/node_modules/@cloudbase/auth/dist/cjs/adapter.d.ts +0 -2
  319. package/node_modules/@cloudbase/auth/dist/cjs/adapter.js +0 -272
  320. package/node_modules/@cloudbase/auth/dist/cjs/index.d.ts +0 -283
  321. package/node_modules/@cloudbase/auth/dist/cjs/index.js +0 -3018
  322. package/node_modules/@cloudbase/auth/dist/cjs/type.d.ts +0 -258
  323. package/node_modules/@cloudbase/auth/dist/cjs/type.js +0 -6
  324. package/node_modules/@cloudbase/auth/dist/cjs/utilities.d.ts +0 -7
  325. package/node_modules/@cloudbase/auth/dist/cjs/utilities.js +0 -23
  326. package/node_modules/@cloudbase/auth/dist/cjs/utils.d.ts +0 -5
  327. package/node_modules/@cloudbase/auth/dist/cjs/utils.js +0 -60
  328. package/node_modules/@cloudbase/auth/dist/cjs/v1-compat.d.ts +0 -77
  329. package/node_modules/@cloudbase/auth/dist/cjs/v1-compat.js +0 -423
  330. package/node_modules/@cloudbase/auth/dist/esm/adapter.d.ts +0 -2
  331. package/node_modules/@cloudbase/auth/dist/esm/adapter.js +0 -268
  332. package/node_modules/@cloudbase/auth/dist/esm/index.d.ts +0 -283
  333. package/node_modules/@cloudbase/auth/dist/esm/index.js +0 -3008
  334. package/node_modules/@cloudbase/auth/dist/esm/type.d.ts +0 -258
  335. package/node_modules/@cloudbase/auth/dist/esm/type.js +0 -3
  336. package/node_modules/@cloudbase/auth/dist/esm/utilities.d.ts +0 -7
  337. package/node_modules/@cloudbase/auth/dist/esm/utilities.js +0 -8
  338. package/node_modules/@cloudbase/auth/dist/esm/utils.d.ts +0 -5
  339. package/node_modules/@cloudbase/auth/dist/esm/utils.js +0 -52
  340. package/node_modules/@cloudbase/auth/dist/esm/v1-compat.d.ts +0 -77
  341. package/node_modules/@cloudbase/auth/dist/esm/v1-compat.js +0 -419
  342. package/node_modules/@cloudbase/auth/dist/miniprogram/index.js +0 -1
  343. package/node_modules/@cloudbase/auth/package.json +0 -31
  344. package/node_modules/@cloudbase/cloudrun/.eslintrc.js +0 -15
  345. package/node_modules/@cloudbase/cloudrun/dist/cjs/index.d.ts +0 -4
  346. package/node_modules/@cloudbase/cloudrun/dist/cjs/index.js +0 -154
  347. package/node_modules/@cloudbase/cloudrun/dist/esm/index.d.ts +0 -4
  348. package/node_modules/@cloudbase/cloudrun/dist/esm/index.js +0 -149
  349. package/node_modules/@cloudbase/cloudrun/package.json +0 -30
  350. package/node_modules/@cloudbase/container/.eslintrc.js +0 -15
  351. package/node_modules/@cloudbase/container/.prettierrc.js +0 -41
  352. package/node_modules/@cloudbase/container/dist/cjs/constants/index.d.ts +0 -1
  353. package/node_modules/@cloudbase/container/dist/cjs/constants/index.js +0 -5
  354. package/node_modules/@cloudbase/container/dist/cjs/go_wams_exec.d.ts +0 -2
  355. package/node_modules/@cloudbase/container/dist/cjs/go_wams_exec.js +0 -538
  356. package/node_modules/@cloudbase/container/dist/cjs/index.d.ts +0 -13
  357. package/node_modules/@cloudbase/container/dist/cjs/index.js +0 -343
  358. package/node_modules/@cloudbase/container/dist/cjs/utils/index.d.ts +0 -3
  359. package/node_modules/@cloudbase/container/dist/cjs/utils/index.js +0 -83
  360. package/node_modules/@cloudbase/container/dist/cjs/utils/loader.d.ts +0 -8
  361. package/node_modules/@cloudbase/container/dist/cjs/utils/loader.js +0 -186
  362. package/node_modules/@cloudbase/container/dist/cjs/utils/request.d.ts +0 -12
  363. package/node_modules/@cloudbase/container/dist/cjs/utils/request.js +0 -106
  364. package/node_modules/@cloudbase/container/dist/esm/constants/index.d.ts +0 -1
  365. package/node_modules/@cloudbase/container/dist/esm/constants/index.js +0 -2
  366. package/node_modules/@cloudbase/container/dist/esm/go_wams_exec.d.ts +0 -2
  367. package/node_modules/@cloudbase/container/dist/esm/go_wams_exec.js +0 -536
  368. package/node_modules/@cloudbase/container/dist/esm/index.d.ts +0 -13
  369. package/node_modules/@cloudbase/container/dist/esm/index.js +0 -338
  370. package/node_modules/@cloudbase/container/dist/esm/utils/index.d.ts +0 -3
  371. package/node_modules/@cloudbase/container/dist/esm/utils/index.js +0 -77
  372. package/node_modules/@cloudbase/container/dist/esm/utils/loader.d.ts +0 -8
  373. package/node_modules/@cloudbase/container/dist/esm/utils/loader.js +0 -178
  374. package/node_modules/@cloudbase/container/dist/esm/utils/request.d.ts +0 -12
  375. package/node_modules/@cloudbase/container/dist/esm/utils/request.js +0 -102
  376. package/node_modules/@cloudbase/container/package.json +0 -30
  377. package/node_modules/@cloudbase/database/README.md +0 -119
  378. package/node_modules/@cloudbase/database/package.json +0 -36
  379. package/node_modules/@cloudbase/database/tsconfig.test.json +0 -15
  380. package/node_modules/@cloudbase/functions/.eslintrc.js +0 -15
  381. package/node_modules/@cloudbase/functions/dist/cjs/index.d.ts +0 -2
  382. package/node_modules/@cloudbase/functions/dist/cjs/index.js +0 -223
  383. package/node_modules/@cloudbase/functions/dist/esm/index.d.ts +0 -2
  384. package/node_modules/@cloudbase/functions/dist/esm/index.js +0 -219
  385. package/node_modules/@cloudbase/functions/package.json +0 -32
  386. package/node_modules/@cloudbase/model/.eslintrc.js +0 -15
  387. package/node_modules/@cloudbase/model/dist/cjs/index.d.ts +0 -5
  388. package/node_modules/@cloudbase/model/dist/cjs/index.js +0 -144
  389. package/node_modules/@cloudbase/model/dist/esm/index.d.ts +0 -5
  390. package/node_modules/@cloudbase/model/dist/esm/index.js +0 -125
  391. package/node_modules/@cloudbase/model/package.json +0 -29
  392. package/node_modules/@cloudbase/mysql/.eslintrc.js +0 -6
  393. package/node_modules/@cloudbase/mysql/dist/cjs/index.d.ts +0 -4
  394. package/node_modules/@cloudbase/mysql/dist/cjs/index.d.ts.map +0 -1
  395. package/node_modules/@cloudbase/mysql/dist/cjs/index.js +0 -173
  396. package/node_modules/@cloudbase/mysql/dist/esm/index.d.ts +0 -3
  397. package/node_modules/@cloudbase/mysql/dist/esm/index.js +0 -155
  398. package/node_modules/@cloudbase/mysql/package.json +0 -30
  399. package/node_modules/@cloudbase/oauth/.eslintrc.js +0 -15
  400. package/node_modules/@cloudbase/oauth/dist/cjs/auth/apis.d.ts +0 -142
  401. package/node_modules/@cloudbase/oauth/dist/cjs/auth/apis.js +0 -1280
  402. package/node_modules/@cloudbase/oauth/dist/cjs/auth/auth-error.d.ts +0 -22
  403. package/node_modules/@cloudbase/oauth/dist/cjs/auth/auth-error.js +0 -278
  404. package/node_modules/@cloudbase/oauth/dist/cjs/auth/consts.d.ts +0 -139
  405. package/node_modules/@cloudbase/oauth/dist/cjs/auth/consts.js +0 -147
  406. package/node_modules/@cloudbase/oauth/dist/cjs/auth/models.d.ts +0 -557
  407. package/node_modules/@cloudbase/oauth/dist/cjs/auth/models.js +0 -3
  408. package/node_modules/@cloudbase/oauth/dist/cjs/captcha/captcha-dom.d.ts +0 -3
  409. package/node_modules/@cloudbase/oauth/dist/cjs/captcha/captcha-dom.js +0 -223
  410. package/node_modules/@cloudbase/oauth/dist/cjs/captcha/captcha.d.ts +0 -42
  411. package/node_modules/@cloudbase/oauth/dist/cjs/captcha/captcha.js +0 -205
  412. package/node_modules/@cloudbase/oauth/dist/cjs/index.d.ts +0 -22
  413. package/node_modules/@cloudbase/oauth/dist/cjs/index.js +0 -107
  414. package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/consts.d.ts +0 -20
  415. package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/consts.js +0 -26
  416. package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/interface.d.ts +0 -15
  417. package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/interface.js +0 -10
  418. package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/models.d.ts +0 -74
  419. package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/models.js +0 -3
  420. package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/oauth2client.d.ts +0 -129
  421. package/node_modules/@cloudbase/oauth/dist/cjs/oauth2client/oauth2client.js +0 -1174
  422. package/node_modules/@cloudbase/oauth/dist/cjs/utils/base64.d.ts +0 -9
  423. package/node_modules/@cloudbase/oauth/dist/cjs/utils/base64.js +0 -112
  424. package/node_modules/@cloudbase/oauth/dist/cjs/utils/encrypt.d.ts +0 -4
  425. package/node_modules/@cloudbase/oauth/dist/cjs/utils/encrypt.js +0 -26
  426. package/node_modules/@cloudbase/oauth/dist/cjs/utils/encryptlong/index.d.ts +0 -546
  427. package/node_modules/@cloudbase/oauth/dist/cjs/utils/encryptlong/index.js +0 -2982
  428. package/node_modules/@cloudbase/oauth/dist/cjs/utils/function/single-promise.d.ts +0 -6
  429. package/node_modules/@cloudbase/oauth/dist/cjs/utils/function/single-promise.js +0 -94
  430. package/node_modules/@cloudbase/oauth/dist/cjs/utils/index.d.ts +0 -2
  431. package/node_modules/@cloudbase/oauth/dist/cjs/utils/index.js +0 -56
  432. package/node_modules/@cloudbase/oauth/dist/cjs/utils/mp.d.ts +0 -2
  433. package/node_modules/@cloudbase/oauth/dist/cjs/utils/mp.js +0 -66
  434. package/node_modules/@cloudbase/oauth/dist/cjs/utils/urlSearchParams.d.ts +0 -13
  435. package/node_modules/@cloudbase/oauth/dist/cjs/utils/urlSearchParams.js +0 -66
  436. package/node_modules/@cloudbase/oauth/dist/cjs/utils/uuid.d.ts +0 -1
  437. package/node_modules/@cloudbase/oauth/dist/cjs/utils/uuid.js +0 -12
  438. package/node_modules/@cloudbase/oauth/dist/esm/auth/apis.d.ts +0 -142
  439. package/node_modules/@cloudbase/oauth/dist/esm/auth/apis.js +0 -768
  440. package/node_modules/@cloudbase/oauth/dist/esm/auth/auth-error.d.ts +0 -22
  441. package/node_modules/@cloudbase/oauth/dist/esm/auth/auth-error.js +0 -255
  442. package/node_modules/@cloudbase/oauth/dist/esm/auth/consts.d.ts +0 -139
  443. package/node_modules/@cloudbase/oauth/dist/esm/auth/consts.js +0 -144
  444. package/node_modules/@cloudbase/oauth/dist/esm/auth/models.d.ts +0 -557
  445. package/node_modules/@cloudbase/oauth/dist/esm/auth/models.js +0 -2
  446. package/node_modules/@cloudbase/oauth/dist/esm/captcha/captcha-dom.d.ts +0 -3
  447. package/node_modules/@cloudbase/oauth/dist/esm/captcha/captcha-dom.js +0 -130
  448. package/node_modules/@cloudbase/oauth/dist/esm/captcha/captcha.d.ts +0 -42
  449. package/node_modules/@cloudbase/oauth/dist/esm/captcha/captcha.js +0 -104
  450. package/node_modules/@cloudbase/oauth/dist/esm/index.d.ts +0 -22
  451. package/node_modules/@cloudbase/oauth/dist/esm/index.js +0 -64
  452. package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/consts.d.ts +0 -20
  453. package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/consts.js +0 -22
  454. package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/interface.d.ts +0 -15
  455. package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/interface.js +0 -3
  456. package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/models.d.ts +0 -74
  457. package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/models.js +0 -2
  458. package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/oauth2client.d.ts +0 -129
  459. package/node_modules/@cloudbase/oauth/dist/esm/oauth2client/oauth2client.js +0 -711
  460. package/node_modules/@cloudbase/oauth/dist/esm/utils/base64.d.ts +0 -9
  461. package/node_modules/@cloudbase/oauth/dist/esm/utils/base64.js +0 -104
  462. package/node_modules/@cloudbase/oauth/dist/esm/utils/encrypt.d.ts +0 -4
  463. package/node_modules/@cloudbase/oauth/dist/esm/utils/encrypt.js +0 -18
  464. package/node_modules/@cloudbase/oauth/dist/esm/utils/encryptlong/index.d.ts +0 -546
  465. package/node_modules/@cloudbase/oauth/dist/esm/utils/encryptlong/index.js +0 -2953
  466. package/node_modules/@cloudbase/oauth/dist/esm/utils/function/single-promise.d.ts +0 -6
  467. package/node_modules/@cloudbase/oauth/dist/esm/utils/function/single-promise.js +0 -34
  468. package/node_modules/@cloudbase/oauth/dist/esm/utils/index.d.ts +0 -2
  469. package/node_modules/@cloudbase/oauth/dist/esm/utils/index.js +0 -51
  470. package/node_modules/@cloudbase/oauth/dist/esm/utils/mp.d.ts +0 -2
  471. package/node_modules/@cloudbase/oauth/dist/esm/utils/mp.js +0 -61
  472. package/node_modules/@cloudbase/oauth/dist/esm/utils/urlSearchParams.d.ts +0 -13
  473. package/node_modules/@cloudbase/oauth/dist/esm/utils/urlSearchParams.js +0 -58
  474. package/node_modules/@cloudbase/oauth/dist/esm/utils/uuid.d.ts +0 -1
  475. package/node_modules/@cloudbase/oauth/dist/esm/utils/uuid.js +0 -8
  476. package/node_modules/@cloudbase/oauth/dist/miniprogram/index.js +0 -1
  477. package/node_modules/@cloudbase/oauth/package.json +0 -20
  478. package/node_modules/@cloudbase/realtime/.eslintrc.js +0 -15
  479. package/node_modules/@cloudbase/realtime/dist/cjs/common.d.ts +0 -4
  480. package/node_modules/@cloudbase/realtime/dist/cjs/common.js +0 -22
  481. package/node_modules/@cloudbase/realtime/dist/cjs/error.d.ts +0 -36
  482. package/node_modules/@cloudbase/realtime/dist/cjs/error.js +0 -106
  483. package/node_modules/@cloudbase/realtime/dist/cjs/index.d.ts +0 -2
  484. package/node_modules/@cloudbase/realtime/dist/cjs/index.js +0 -36
  485. package/node_modules/@cloudbase/realtime/dist/cjs/listener.d.ts +0 -14
  486. package/node_modules/@cloudbase/realtime/dist/cjs/listener.js +0 -18
  487. package/node_modules/@cloudbase/realtime/dist/cjs/message.d.ts +0 -3
  488. package/node_modules/@cloudbase/realtime/dist/cjs/message.js +0 -13
  489. package/node_modules/@cloudbase/realtime/dist/cjs/snapshot.d.ts +0 -17
  490. package/node_modules/@cloudbase/realtime/dist/cjs/snapshot.js +0 -45
  491. package/node_modules/@cloudbase/realtime/dist/cjs/utils.d.ts +0 -1
  492. package/node_modules/@cloudbase/realtime/dist/cjs/utils.js +0 -9
  493. package/node_modules/@cloudbase/realtime/dist/cjs/virtual-websocket-client.d.ts +0 -62
  494. package/node_modules/@cloudbase/realtime/dist/cjs/virtual-websocket-client.js +0 -960
  495. package/node_modules/@cloudbase/realtime/dist/cjs/websocket-client.d.ts +0 -78
  496. package/node_modules/@cloudbase/realtime/dist/cjs/websocket-client.js +0 -750
  497. package/node_modules/@cloudbase/realtime/dist/cjs/ws-event.d.ts +0 -126
  498. package/node_modules/@cloudbase/realtime/dist/cjs/ws-event.js +0 -141
  499. package/node_modules/@cloudbase/realtime/dist/esm/common.d.ts +0 -4
  500. package/node_modules/@cloudbase/realtime/dist/esm/common.js +0 -15
  501. package/node_modules/@cloudbase/realtime/dist/esm/error.d.ts +0 -36
  502. package/node_modules/@cloudbase/realtime/dist/esm/error.js +0 -100
  503. package/node_modules/@cloudbase/realtime/dist/esm/index.d.ts +0 -2
  504. package/node_modules/@cloudbase/realtime/dist/esm/index.js +0 -32
  505. package/node_modules/@cloudbase/realtime/dist/esm/listener.d.ts +0 -14
  506. package/node_modules/@cloudbase/realtime/dist/esm/listener.js +0 -15
  507. package/node_modules/@cloudbase/realtime/dist/esm/message.d.ts +0 -3
  508. package/node_modules/@cloudbase/realtime/dist/esm/message.js +0 -8
  509. package/node_modules/@cloudbase/realtime/dist/esm/snapshot.d.ts +0 -17
  510. package/node_modules/@cloudbase/realtime/dist/esm/snapshot.js +0 -42
  511. package/node_modules/@cloudbase/realtime/dist/esm/utils.d.ts +0 -1
  512. package/node_modules/@cloudbase/realtime/dist/esm/utils.js +0 -5
  513. package/node_modules/@cloudbase/realtime/dist/esm/virtual-websocket-client.d.ts +0 -62
  514. package/node_modules/@cloudbase/realtime/dist/esm/virtual-websocket-client.js +0 -954
  515. package/node_modules/@cloudbase/realtime/dist/esm/websocket-client.d.ts +0 -78
  516. package/node_modules/@cloudbase/realtime/dist/esm/websocket-client.js +0 -747
  517. package/node_modules/@cloudbase/realtime/dist/esm/ws-event.d.ts +0 -126
  518. package/node_modules/@cloudbase/realtime/dist/esm/ws-event.js +0 -137
  519. package/node_modules/@cloudbase/realtime/package.json +0 -29
  520. package/node_modules/@cloudbase/storage/.eslintrc.js +0 -15
  521. package/node_modules/@cloudbase/storage/dist/cjs/index.d.ts +0 -195
  522. package/node_modules/@cloudbase/storage/dist/cjs/index.js +0 -1426
  523. package/node_modules/@cloudbase/storage/dist/cjs/supabase/errors.d.ts +0 -20
  524. package/node_modules/@cloudbase/storage/dist/cjs/supabase/errors.js +0 -65
  525. package/node_modules/@cloudbase/storage/dist/cjs/supabase/types.d.ts +0 -64
  526. package/node_modules/@cloudbase/storage/dist/cjs/supabase/types.js +0 -3
  527. package/node_modules/@cloudbase/storage/dist/esm/index.d.ts +0 -195
  528. package/node_modules/@cloudbase/storage/dist/esm/index.js +0 -1422
  529. package/node_modules/@cloudbase/storage/dist/esm/supabase/errors.d.ts +0 -20
  530. package/node_modules/@cloudbase/storage/dist/esm/supabase/errors.js +0 -61
  531. package/node_modules/@cloudbase/storage/dist/esm/supabase/types.d.ts +0 -64
  532. package/node_modules/@cloudbase/storage/dist/esm/supabase/types.js +0 -2
  533. package/node_modules/@cloudbase/storage/package.json +0 -28
  534. package/node_modules/@cloudbase/types/index.js +0 -1
  535. package/node_modules/@cloudbase/utilities/.eslintrc.js +0 -15
  536. package/oauth/src/index.d.ts +0 -1
  537. package/oauth/src/index.ts +0 -1
  538. package/realtime/src/index.d.ts +0 -2
  539. package/realtime/src/index.ts +0 -8
  540. package/storage/src/index.d.ts +0 -2
  541. package/storage/src/index.js +0 -5
  542. package/storage/src/index.ts +0 -4
  543. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/aggregate.d.ts +0 -0
  544. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/aggregate.js +0 -0
  545. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/collection.d.ts +0 -0
  546. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/collection.js +0 -0
  547. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/command.d.ts +0 -0
  548. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/command.js +0 -0
  549. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/logic.d.ts +0 -0
  550. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/logic.js +0 -0
  551. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/query.d.ts +0 -0
  552. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/query.js +0 -0
  553. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/update.d.ts +0 -0
  554. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/commands/update.js +0 -0
  555. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/config/app.config.d.ts +0 -0
  556. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/config/app.config.js +0 -0
  557. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/config/error.config.d.ts +0 -0
  558. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/config/error.config.js +0 -0
  559. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/const/code.d.ts +0 -0
  560. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/const/code.js +0 -0
  561. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/constant.d.ts +0 -0
  562. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/constant.js +0 -0
  563. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/document.d.ts +0 -0
  564. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/document.js +0 -0
  565. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/index.d.ts +0 -0
  566. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/index.js +0 -0
  567. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/interface.d.ts +0 -0
  568. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/interface.js +0 -0
  569. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/lineString.d.ts +0 -0
  570. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/lineString.js +0 -0
  571. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiLineString.d.ts +0 -0
  572. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiLineString.js +0 -0
  573. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiPoint.d.ts +0 -0
  574. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiPoint.js +0 -0
  575. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiPolygon.d.ts +0 -0
  576. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/multiPolygon.js +0 -0
  577. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/point.d.ts +0 -0
  578. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/point.js +0 -0
  579. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/polygon.d.ts +0 -0
  580. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/geo/polygon.js +0 -0
  581. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/helper/symbol.d.ts +0 -0
  582. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/helper/symbol.js +0 -0
  583. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/index.d.ts +0 -0
  584. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/index.js +0 -0
  585. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/lib/util.d.ts +0 -0
  586. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/lib/util.js +0 -0
  587. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/operator-map.d.ts +0 -0
  588. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/operator-map.js +0 -0
  589. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/query.d.ts +0 -0
  590. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/query.js +0 -0
  591. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/regexp/index.d.ts +0 -0
  592. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/regexp/index.js +0 -0
  593. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/common.d.ts +0 -0
  594. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/common.js +0 -0
  595. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/datatype.d.ts +0 -0
  596. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/datatype.js +0 -0
  597. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/query.d.ts +0 -0
  598. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/query.js +0 -0
  599. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/update.d.ts +0 -0
  600. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serializer/update.js +0 -0
  601. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serverDate/index.d.ts +0 -0
  602. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/serverDate/index.js +0 -0
  603. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/collection.d.ts +0 -0
  604. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/collection.js +0 -0
  605. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/document.d.ts +0 -0
  606. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/document.js +0 -0
  607. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/index.d.ts +0 -0
  608. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/index.js +0 -0
  609. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/query.d.ts +0 -0
  610. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/transaction/query.js +0 -0
  611. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/typings/index.d.ts +0 -0
  612. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/typings/index.js +0 -0
  613. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/typings/realtime.d.ts +0 -0
  614. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/typings/realtime.js +0 -0
  615. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/util.d.ts +0 -0
  616. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/util.js +0 -0
  617. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/error.d.ts +0 -0
  618. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/error.js +0 -0
  619. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/msg.d.ts +0 -0
  620. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/msg.js +0 -0
  621. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/symbol.d.ts +0 -0
  622. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/symbol.js +0 -0
  623. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/type.d.ts +0 -0
  624. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/type.js +0 -0
  625. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/utils.d.ts +0 -0
  626. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/utils/utils.js +0 -0
  627. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/validate.d.ts +0 -0
  628. /package/{node_modules/@cloudbase/database → database}/dist/commonjs/validate.js +0 -0
  629. /package/{node_modules/@cloudbase/database → database}/dist/esm/aggregate.d.ts +0 -0
  630. /package/{node_modules/@cloudbase/database → database}/dist/esm/aggregate.js +0 -0
  631. /package/{node_modules/@cloudbase/database → database}/dist/esm/collection.d.ts +0 -0
  632. /package/{node_modules/@cloudbase/database → database}/dist/esm/collection.js +0 -0
  633. /package/{node_modules/@cloudbase/database → database}/dist/esm/command.d.ts +0 -0
  634. /package/{node_modules/@cloudbase/database → database}/dist/esm/command.js +0 -0
  635. /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/logic.d.ts +0 -0
  636. /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/logic.js +0 -0
  637. /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/query.d.ts +0 -0
  638. /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/query.js +0 -0
  639. /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/update.d.ts +0 -0
  640. /package/{node_modules/@cloudbase/database → database}/dist/esm/commands/update.js +0 -0
  641. /package/{node_modules/@cloudbase/database → database}/dist/esm/config/app.config.d.ts +0 -0
  642. /package/{node_modules/@cloudbase/database → database}/dist/esm/config/app.config.js +0 -0
  643. /package/{node_modules/@cloudbase/database → database}/dist/esm/config/error.config.d.ts +0 -0
  644. /package/{node_modules/@cloudbase/database → database}/dist/esm/config/error.config.js +0 -0
  645. /package/{node_modules/@cloudbase/database → database}/dist/esm/const/code.d.ts +0 -0
  646. /package/{node_modules/@cloudbase/database → database}/dist/esm/const/code.js +0 -0
  647. /package/{node_modules/@cloudbase/database → database}/dist/esm/constant.d.ts +0 -0
  648. /package/{node_modules/@cloudbase/database → database}/dist/esm/constant.js +0 -0
  649. /package/{node_modules/@cloudbase/database → database}/dist/esm/document.d.ts +0 -0
  650. /package/{node_modules/@cloudbase/database → database}/dist/esm/document.js +0 -0
  651. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/index.d.ts +0 -0
  652. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/index.js +0 -0
  653. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/interface.d.ts +0 -0
  654. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/interface.js +0 -0
  655. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/lineString.d.ts +0 -0
  656. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/lineString.js +0 -0
  657. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiLineString.d.ts +0 -0
  658. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiLineString.js +0 -0
  659. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiPoint.d.ts +0 -0
  660. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiPoint.js +0 -0
  661. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiPolygon.d.ts +0 -0
  662. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/multiPolygon.js +0 -0
  663. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/point.d.ts +0 -0
  664. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/point.js +0 -0
  665. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/polygon.d.ts +0 -0
  666. /package/{node_modules/@cloudbase/database → database}/dist/esm/geo/polygon.js +0 -0
  667. /package/{node_modules/@cloudbase/database → database}/dist/esm/helper/symbol.d.ts +0 -0
  668. /package/{node_modules/@cloudbase/database → database}/dist/esm/helper/symbol.js +0 -0
  669. /package/{node_modules/@cloudbase/database → database}/dist/esm/index.d.ts +0 -0
  670. /package/{node_modules/@cloudbase/database → database}/dist/esm/index.js +0 -0
  671. /package/{node_modules/@cloudbase/database → database}/dist/esm/lib/util.d.ts +0 -0
  672. /package/{node_modules/@cloudbase/database → database}/dist/esm/lib/util.js +0 -0
  673. /package/{node_modules/@cloudbase/database → database}/dist/esm/operator-map.d.ts +0 -0
  674. /package/{node_modules/@cloudbase/database → database}/dist/esm/operator-map.js +0 -0
  675. /package/{node_modules/@cloudbase/database → database}/dist/esm/query.d.ts +0 -0
  676. /package/{node_modules/@cloudbase/database → database}/dist/esm/query.js +0 -0
  677. /package/{node_modules/@cloudbase/database → database}/dist/esm/regexp/index.d.ts +0 -0
  678. /package/{node_modules/@cloudbase/database → database}/dist/esm/regexp/index.js +0 -0
  679. /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/common.d.ts +0 -0
  680. /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/common.js +0 -0
  681. /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/datatype.d.ts +0 -0
  682. /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/datatype.js +0 -0
  683. /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/query.d.ts +0 -0
  684. /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/query.js +0 -0
  685. /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/update.d.ts +0 -0
  686. /package/{node_modules/@cloudbase/database → database}/dist/esm/serializer/update.js +0 -0
  687. /package/{node_modules/@cloudbase/database → database}/dist/esm/serverDate/index.d.ts +0 -0
  688. /package/{node_modules/@cloudbase/database → database}/dist/esm/serverDate/index.js +0 -0
  689. /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/collection.d.ts +0 -0
  690. /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/collection.js +0 -0
  691. /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/document.d.ts +0 -0
  692. /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/document.js +0 -0
  693. /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/index.d.ts +0 -0
  694. /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/index.js +0 -0
  695. /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/query.d.ts +0 -0
  696. /package/{node_modules/@cloudbase/database → database}/dist/esm/transaction/query.js +0 -0
  697. /package/{node_modules/@cloudbase/database → database}/dist/esm/typings/index.d.ts +0 -0
  698. /package/{node_modules/@cloudbase/database → database}/dist/esm/typings/index.js +0 -0
  699. /package/{node_modules/@cloudbase/database → database}/dist/esm/typings/realtime.d.ts +0 -0
  700. /package/{node_modules/@cloudbase/database → database}/dist/esm/typings/realtime.js +0 -0
  701. /package/{node_modules/@cloudbase/database → database}/dist/esm/util.d.ts +0 -0
  702. /package/{node_modules/@cloudbase/database → database}/dist/esm/util.js +0 -0
  703. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/error.d.ts +0 -0
  704. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/error.js +0 -0
  705. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/msg.d.ts +0 -0
  706. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/msg.js +0 -0
  707. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/symbol.d.ts +0 -0
  708. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/symbol.js +0 -0
  709. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/type.d.ts +0 -0
  710. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/type.js +0 -0
  711. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/utils.d.ts +0 -0
  712. /package/{node_modules/@cloudbase/database → database}/dist/esm/utils/utils.js +0 -0
  713. /package/{node_modules/@cloudbase/database → database}/dist/esm/validate.d.ts +0 -0
  714. /package/{node_modules/@cloudbase/database → database}/dist/esm/validate.js +0 -0
  715. /package/{app/src → dist}/index.d.ts +0 -0
  716. /package/{node_modules/@cloudbase/types → types}/auth.d.ts +0 -0
  717. /package/{node_modules/@cloudbase/types → types}/cache.d.ts +0 -0
  718. /package/{node_modules/@cloudbase/types → types}/cloudrun.d.ts +0 -0
  719. /package/{node_modules/@cloudbase/types → types}/component.d.ts +0 -0
  720. /package/{node_modules/@cloudbase/types → types}/database.d.ts +0 -0
  721. /package/{node_modules/@cloudbase/types → types}/events.d.ts +0 -0
  722. /package/{node_modules/@cloudbase/types → types}/functions.d.ts +0 -0
  723. /package/{node_modules/@cloudbase/types → types}/index.d.ts +0 -0
  724. /package/{node_modules/@cloudbase/types → types}/realtime.d.ts +0 -0
  725. /package/{node_modules/@cloudbase/types → types}/request.d.ts +0 -0
  726. /package/{node_modules/@cloudbase/types → types}/storage.d.ts +0 -0
  727. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/adapters/index.d.ts +0 -0
  728. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/adapters/index.js +0 -0
  729. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/adapters/platforms/web.d.ts +0 -0
  730. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/adapters/platforms/web.js +0 -0
  731. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/common.d.ts +0 -0
  732. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/common.js +0 -0
  733. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/errors.d.ts +0 -0
  734. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/errors.js +0 -0
  735. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/index.d.ts +0 -0
  736. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/constants/index.js +0 -0
  737. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/helpers/decorators.d.ts +0 -0
  738. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/helpers/decorators.js +0 -0
  739. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/helpers/index.d.ts +0 -0
  740. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/helpers/index.js +0 -0
  741. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/index.d.ts +0 -0
  742. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/index.js +0 -0
  743. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/abortController.d.ts +0 -0
  744. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/abortController.js +0 -0
  745. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/cache.d.ts +0 -0
  746. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/cache.js +0 -0
  747. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/events.d.ts +0 -0
  748. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/events.js +0 -0
  749. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/langEvent.d.ts +0 -0
  750. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/langEvent.js +0 -0
  751. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/util.d.ts +0 -0
  752. /package/{node_modules/@cloudbase/utilities → utilities}/dist/cjs/libs/util.js +0 -0
  753. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/adapters/index.d.ts +0 -0
  754. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/adapters/index.js +0 -0
  755. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/adapters/platforms/web.d.ts +0 -0
  756. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/adapters/platforms/web.js +0 -0
  757. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/common.d.ts +0 -0
  758. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/common.js +0 -0
  759. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/errors.d.ts +0 -0
  760. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/errors.js +0 -0
  761. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/index.d.ts +0 -0
  762. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/constants/index.js +0 -0
  763. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/helpers/decorators.d.ts +0 -0
  764. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/helpers/decorators.js +0 -0
  765. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/helpers/index.d.ts +0 -0
  766. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/helpers/index.js +0 -0
  767. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/index.d.ts +0 -0
  768. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/index.js +0 -0
  769. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/abortController.d.ts +0 -0
  770. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/abortController.js +0 -0
  771. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/cache.d.ts +0 -0
  772. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/cache.js +0 -0
  773. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/events.d.ts +0 -0
  774. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/events.js +0 -0
  775. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/langEvent.d.ts +0 -0
  776. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/langEvent.js +0 -0
  777. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/util.d.ts +0 -0
  778. /package/{node_modules/@cloudbase/utilities → utilities}/dist/esm/libs/util.js +0 -0
  779. /package/{node_modules/@cloudbase/utilities → utilities}/dist/miniprogram/index.js +0 -0
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cloudbase_realtime",[],t):"object"==typeof exports?exports.cloudbase_realtime=t():e.cloudbase_realtime=t()}("undefined"!=typeof window?window:this,(()=>(()=>{var e={1246:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerRealtime=void 0;var n=r(9063);t.registerRealtime=n.registerRealtime;try{window.registerRealtime=t.registerRealtime}catch(e){}},9300:(e,t,r)=>{var n=r(8663)(r(8594),"DataView");e.exports=n},2648:(e,t,r)=>{var n=r(6253),o=r(1629),i=r(7332),s=r(4641),a=r(4383);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},819:(e,t,r)=>{var n=r(3371),o=r(5827),i=r(4662),s=r(8109),a=r(5660);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},1107:(e,t,r)=>{var n=r(8663)(r(8594),"Map");e.exports=n},705:(e,t,r)=>{var n=r(256),o=r(2462),i=r(7718),s=r(1477),a=r(5466);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},40:(e,t,r)=>{var n=r(8663)(r(8594),"Promise");e.exports=n},2482:(e,t,r)=>{var n=r(8663)(r(8594),"Set");e.exports=n},6912:(e,t,r)=>{var n=r(819),o=r(1363),i=r(5406),s=r(3145),a=r(8189),c=r(7502);function u(e){var t=this.__data__=new n(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=s,u.prototype.has=a,u.prototype.set=c,e.exports=u},8190:(e,t,r)=>{var n=r(8594).Symbol;e.exports=n},563:(e,t,r)=>{var n=r(8594).Uint8Array;e.exports=n},2538:(e,t,r)=>{var n=r(8663)(r(8594),"WeakMap");e.exports=n},1043:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},4799:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[o++]=s)}return i}},7471:(e,t,r)=>{var n=r(8056),o=r(1819),i=r(7396),s=r(9153),a=r(4607),c=r(5780),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),l=!r&&o(e),h=!r&&!l&&s(e),d=!r&&!l&&!h&&c(e),p=r||l||h||d,f=p?n(e.length,String):[],v=f.length;for(var E in e)!t&&!u.call(e,E)||p&&("length"==E||h&&("offset"==E||"parent"==E)||d&&("buffer"==E||"byteLength"==E||"byteOffset"==E)||a(E,v))||f.push(E);return f}},534:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}},3246:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},4067:(e,t,r)=>{var n=r(4622),o=r(6344),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var s=e[t];i.call(e,t)&&o(s,r)&&(void 0!==r||t in e)||n(e,t,r)}},2694:(e,t,r)=>{var n=r(6344);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},2457:(e,t,r)=>{var n=r(1560),o=r(5683);e.exports=function(e,t){return e&&n(t,o(t),e)}},2489:(e,t,r)=>{var n=r(1560),o=r(4344);e.exports=function(e,t){return e&&n(t,o(t),e)}},4622:(e,t,r)=>{var n=r(3446);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},4420:(e,t,r)=>{var n=r(6912),o=r(1043),i=r(4067),s=r(2457),a=r(2489),c=r(2579),u=r(7895),l=r(801),h=r(6538),d=r(1984),p=r(3573),f=r(3434),v=r(2054),E=r(3822),g=r(2792),I=r(7396),b=r(9153),m=r(4583),w=r(2861),y=r(3493),_=r(5683),S=r(4344),T="[object Arguments]",A="[object Function]",R="[object Object]",C={};C[T]=C["[object Array]"]=C["[object ArrayBuffer]"]=C["[object DataView]"]=C["[object Boolean]"]=C["[object Date]"]=C["[object Float32Array]"]=C["[object Float64Array]"]=C["[object Int8Array]"]=C["[object Int16Array]"]=C["[object Int32Array]"]=C["[object Map]"]=C["[object Number]"]=C[R]=C["[object RegExp]"]=C["[object Set]"]=C["[object String]"]=C["[object Symbol]"]=C["[object Uint8Array]"]=C["[object Uint8ClampedArray]"]=C["[object Uint16Array]"]=C["[object Uint32Array]"]=!0,C["[object Error]"]=C[A]=C["[object WeakMap]"]=!1,e.exports=function e(t,r,x,D,N,O){var L,W=1&r,j=2&r,P=4&r;if(x&&(L=N?x(t,D,N,O):x(t)),void 0!==L)return L;if(!w(t))return t;var M=I(t);if(M){if(L=v(t),!W)return u(t,L)}else{var k=f(t),B=k==A||"[object GeneratorFunction]"==k;if(b(t))return c(t,W);if(k==R||k==T||B&&!N){if(L=j||B?{}:g(t),!W)return j?h(t,a(L,t)):l(t,s(L,t))}else{if(!C[k])return N?t:{};L=E(t,k,W)}}O||(O=new n);var K=O.get(t);if(K)return K;O.set(t,L),y(t)?t.forEach((function(n){L.add(e(n,r,x,n,t,O))})):m(t)&&t.forEach((function(n,o){L.set(o,e(n,r,x,o,t,O))}));var q=M?void 0:(P?j?p:d:j?S:_)(t);return o(q||t,(function(n,o){q&&(n=t[o=n]),i(L,o,e(n,r,x,o,t,O))})),L}},2726:(e,t,r)=>{var n=r(2861),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},8081:(e,t,r)=>{var n=r(1380),o=r(82);e.exports=function(e,t){for(var r=0,i=(t=n(t,e)).length;null!=e&&r<i;)e=e[o(t[r++])];return r&&r==i?e:void 0}},3052:(e,t,r)=>{var n=r(3246),o=r(7396);e.exports=function(e,t,r){var i=t(e);return o(e)?i:n(i,r(e))}},8072:(e,t,r)=>{var n=r(8190),o=r(835),i=r(8786),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?o(e):i(e)}},4315:(e,t,r)=>{var n=r(8072),o=r(5834);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},277:(e,t,r)=>{var n=r(3434),o=r(5834);e.exports=function(e){return o(e)&&"[object Map]"==n(e)}},5836:(e,t,r)=>{var n=r(470),o=r(8178),i=r(2861),s=r(3288),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,h=u.hasOwnProperty,d=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?d:a).test(s(e))}},2887:(e,t,r)=>{var n=r(3434),o=r(5834);e.exports=function(e){return o(e)&&"[object Set]"==n(e)}},1349:(e,t,r)=>{var n=r(8072),o=r(6970),i=r(5834),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!s[n(e)]}},1265:(e,t,r)=>{var n=r(3848),o=r(9161),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},2075:(e,t,r)=>{var n=r(2861),o=r(3848),i=r(3854),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=o(e),r=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&r.push(a);return r}},5433:(e,t,r)=>{var n=r(4067),o=r(1380),i=r(4607),s=r(2861),a=r(82);e.exports=function(e,t,r,c){if(!s(e))return e;for(var u=-1,l=(t=o(t,e)).length,h=l-1,d=e;null!=d&&++u<l;){var p=a(t[u]),f=r;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(u!=h){var v=d[p];void 0===(f=c?c(v,p,d):void 0)&&(f=s(v)?v:i(t[u+1])?[]:{})}n(d,p,f),d=d[p]}return e}},5770:e=>{e.exports=function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}},8056:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},1169:(e,t,r)=>{var n=r(8190),o=r(534),i=r(7396),s=r(3596),a=n?n.prototype:void 0,c=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(s(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},7254:e=>{e.exports=function(e){return function(t){return e(t)}}},1366:(e,t,r)=>{var n=r(1380),o=r(1711),i=r(7668),s=r(82);e.exports=function(e,t){return t=n(t,e),null==(e=i(e,t))||delete e[s(o(t))]}},1380:(e,t,r)=>{var n=r(7396),o=r(7090),i=r(2254),s=r(6189);e.exports=function(e,t){return n(e)?e:o(e,t)?[e]:i(s(e))}},2219:(e,t,r)=>{var n=r(563);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},2579:(e,t,r)=>{e=r.nmd(e);var n=r(8594),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}},5892:(e,t,r)=>{var n=r(2219);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},8778:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},5380:(e,t,r)=>{var n=r(8190),o=n?n.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},5639:(e,t,r)=>{var n=r(2219);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},7895:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},1560:(e,t,r)=>{var n=r(4067),o=r(4622);e.exports=function(e,t,r,i){var s=!r;r||(r={});for(var a=-1,c=t.length;++a<c;){var u=t[a],l=i?i(r[u],e[u],u,r,e):void 0;void 0===l&&(l=e[u]),s?o(r,u,l):n(r,u,l)}return r}},801:(e,t,r)=>{var n=r(1560),o=r(18);e.exports=function(e,t){return n(e,o(e),t)}},6538:(e,t,r)=>{var n=r(1560),o=r(4546);e.exports=function(e,t){return n(e,o(e),t)}},2289:(e,t,r)=>{var n=r(8594)["__core-js_shared__"];e.exports=n},3446:(e,t,r)=>{var n=r(8663),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},5177:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},1984:(e,t,r)=>{var n=r(3052),o=r(18),i=r(5683);e.exports=function(e){return n(e,i,o)}},3573:(e,t,r)=>{var n=r(3052),o=r(4546),i=r(4344);e.exports=function(e){return n(e,i,o)}},3261:(e,t,r)=>{var n=r(9491);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},8663:(e,t,r)=>{var n=r(5836),o=r(9040);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},8591:(e,t,r)=>{var n=r(8952)(Object.getPrototypeOf,Object);e.exports=n},835:(e,t,r)=>{var n=r(8190),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var o=s.call(e);return n&&(t?e[a]=r:delete e[a]),o}},18:(e,t,r)=>{var n=r(4799),o=r(8861),i=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),n(s(e),(function(t){return i.call(e,t)})))}:o;e.exports=a},4546:(e,t,r)=>{var n=r(3246),o=r(8591),i=r(18),s=r(8861),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=o(e);return t}:s;e.exports=a},3434:(e,t,r)=>{var n=r(9300),o=r(1107),i=r(40),s=r(2482),a=r(2538),c=r(8072),u=r(3288),l="[object Map]",h="[object Promise]",d="[object Set]",p="[object WeakMap]",f="[object DataView]",v=u(n),E=u(o),g=u(i),I=u(s),b=u(a),m=c;(n&&m(new n(new ArrayBuffer(1)))!=f||o&&m(new o)!=l||i&&m(i.resolve())!=h||s&&m(new s)!=d||a&&m(new a)!=p)&&(m=function(e){var t=c(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case v:return f;case E:return l;case g:return h;case I:return d;case b:return p}return t}),e.exports=m},9040:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},6253:(e,t,r)=>{var n=r(1934);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},1629:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7332:(e,t,r)=>{var n=r(1934),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},4641:(e,t,r)=>{var n=r(1934),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},4383:(e,t,r)=>{var n=r(1934);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},2054:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},3822:(e,t,r)=>{var n=r(2219),o=r(5892),i=r(8778),s=r(5380),a=r(5639);e.exports=function(e,t,r){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,r);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Symbol]":return s(e)}}},2792:(e,t,r)=>{var n=r(2726),o=r(8591),i=r(3848);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(o(e))}},4607:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},7090:(e,t,r)=>{var n=r(7396),o=r(3596),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!o(e))||s.test(e)||!i.test(e)||null!=t&&e in Object(t)}},9491:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},8178:(e,t,r)=>{var n,o=r(2289),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},3848:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},3371:e=>{e.exports=function(){this.__data__=[],this.size=0}},5827:(e,t,r)=>{var n=r(2694),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},4662:(e,t,r)=>{var n=r(2694);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},8109:(e,t,r)=>{var n=r(2694);e.exports=function(e){return n(this.__data__,e)>-1}},5660:(e,t,r)=>{var n=r(2694);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},256:(e,t,r)=>{var n=r(2648),o=r(819),i=r(1107);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},2462:(e,t,r)=>{var n=r(3261);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},7718:(e,t,r)=>{var n=r(3261);e.exports=function(e){return n(this,e).get(e)}},1477:(e,t,r)=>{var n=r(3261);e.exports=function(e){return n(this,e).has(e)}},5466:(e,t,r)=>{var n=r(3261);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},3624:(e,t,r)=>{var n=r(426);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},1934:(e,t,r)=>{var n=r(8663)(Object,"create");e.exports=n},9161:(e,t,r)=>{var n=r(8952)(Object.keys,Object);e.exports=n},3854:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},7510:(e,t,r)=>{e=r.nmd(e);var n=r(5177),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&n.process,a=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},8786:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},8952:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},7668:(e,t,r)=>{var n=r(8081),o=r(5770);e.exports=function(e,t){return t.length<2?e:n(e,o(t,0,-1))}},8594:(e,t,r)=>{var n=r(5177),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},1363:(e,t,r)=>{var n=r(819);e.exports=function(){this.__data__=new n,this.size=0}},5406:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},3145:e=>{e.exports=function(e){return this.__data__.get(e)}},8189:e=>{e.exports=function(e){return this.__data__.has(e)}},7502:(e,t,r)=>{var n=r(819),o=r(1107),i=r(705);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(s)}return r.set(e,t),this.size=r.size,this}},2254:(e,t,r)=>{var n=r(3624),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,s=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,r,n,o){t.push(n?o.replace(i,"$1"):r||e)})),t}));e.exports=s},82:(e,t,r)=>{var n=r(3596);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},3288:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7657:(e,t,r)=>{var n=r(4420);e.exports=function(e){return n(e,5)}},6344:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},1819:(e,t,r)=>{var n=r(4315),o=r(5834),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},7396:e=>{var t=Array.isArray;e.exports=t},9369:(e,t,r)=>{var n=r(470),o=r(6970);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},9153:(e,t,r)=>{e=r.nmd(e);var n=r(8594),o=r(3791),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,a=s&&s.exports===i?n.Buffer:void 0,c=(a?a.isBuffer:void 0)||o;e.exports=c},470:(e,t,r)=>{var n=r(8072),o=r(2861);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},6970:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4583:(e,t,r)=>{var n=r(277),o=r(7254),i=r(7510),s=i&&i.isMap,a=s?o(s):n;e.exports=a},2861:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5834:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3493:(e,t,r)=>{var n=r(2887),o=r(7254),i=r(7510),s=i&&i.isSet,a=s?o(s):n;e.exports=a},3596:(e,t,r)=>{var n=r(8072),o=r(5834);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},5780:(e,t,r)=>{var n=r(1349),o=r(7254),i=r(7510),s=i&&i.isTypedArray,a=s?o(s):n;e.exports=a},5683:(e,t,r)=>{var n=r(7471),o=r(1265),i=r(9369);e.exports=function(e){return i(e)?n(e):o(e)}},4344:(e,t,r)=>{var n=r(7471),o=r(2075),i=r(9369);e.exports=function(e){return i(e)?n(e,!0):o(e)}},1711:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},426:(e,t,r)=>{var n=r(705);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=e.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(o.Cache||n),r}o.Cache=n,e.exports=o},8705:(e,t,r)=>{var n=r(5433);e.exports=function(e,t,r){return null==e?e:n(e,t,r)}},8861:e=>{e.exports=function(){return[]}},3791:e=>{e.exports=function(){return!1}},6189:(e,t,r)=>{var n=r(1169);e.exports=function(e){return null==e?"":n(e)}},8712:(e,t,r)=>{var n=r(1366);e.exports=function(e,t){return null==e||n(e,t)}},9063:(e,t,r)=>{"use strict";r.r(t),r.d(t,{registerRealtime:()=>q});var n=r(8705),o=r.n(n),i=r(8712),s=r.n(i),a=r(7657),c=r.n(a);function u(e){return void 0===e&&(e=""),"".concat(e?"".concat(e,"_"):"").concat(+new Date,"_").concat(Math.random())}var l,h,d=function(e){this.close=e.close,this.onChange=e.onChange,this.onError=e.onError,e.debug&&Object.defineProperty(this,"virtualClient",{get:function(){return e.virtualClient}})},p=function(e){var t,r,n=e.id,o=e.docChanges,i=e.docs,s=e.msgType,a=e.type;Object.defineProperties(this,{id:{get:function(){return n},enumerable:!0},docChanges:{get:function(){return t||(t=JSON.parse(JSON.stringify(o))),t},enumerable:!0},docs:{get:function(){return r||(r=JSON.parse(JSON.stringify(i))),r},enumerable:!0},msgType:{get:function(){return s},enumerable:!0},type:{get:function(){return a},enumerable:!0}})},f=(l=function(e,t){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},l(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}l(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),v=function(e){function t(t){var r=e.call(this,"Watch Error ".concat(JSON.stringify(t.msgData)," (requestid: ").concat(t.requestId,")"))||this;return r.isRealtimeErrorMessageError=!0,r.payload=t,r}return f(t,e),t}(Error),E=function(e){return null==e?void 0:e.isRealtimeErrorMessageError},g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="timeout",t.payload=null,t.generic=!0,t}return f(t,e),t}(Error),I=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cancelled",t.payload=null,t.generic=!0,t}return f(t,e),t}(Error),b=function(e){function t(t){var r=e.call(this,t.errMsg)||this;return r.errCode="UNKNOWN_ERROR",Object.defineProperties(r,{message:{get:function(){return"errCode: ".concat(this.errCode," ").concat(m[this.errCode]||""," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e}}}),r.errCode=t.errCode||"UNKNOWN_ERROR",r.errMsg=t.errMsg,r}return f(t,e),Object.defineProperty(t.prototype,"message",{get:function(){return"errCode: ".concat(this.errCode," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e},enumerable:!1,configurable:!0}),t}(Error),m={UNKNOWN_ERROR:"UNKNOWN_ERROR",SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG:"SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG",SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA:"SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED",SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL",SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR:"SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR"},w=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},y=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},_=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},S=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))};!function(e){e.LOGGINGIN="LOGGINGIN",e.INITING="INITING",e.REBUILDING="REBUILDING",e.ACTIVE="ACTIVE",e.ERRORED="ERRORED",e.CLOSING="CLOSING",e.CLOSED="CLOSED",e.PAUSED="PAUSED",e.RESUMING="RESUMING"}(h||(h={}));var T=function(){function e(e){var t=this;this.watchStatus=h.INITING,this.wsLogin=function(e,r){return y(t,void 0,void 0,(function(){var t;return _(this,(function(n){switch(n.label){case 0:return this.watchStatus=h.LOGGINGIN,[4,this.login(e,r)];case 1:return t=n.sent(),this.envId||(this.envId=t.envId),[2,t]}}))}))},this.initWatch=function(e){return y(t,void 0,void 0,(function(){var t,r=this;return _(this,(function(n){switch(n.label){case 0:if(null!==this.initWatchPromise&&void 0!==this.initWatchPromise)return[2,this.initWatchPromise];this.initWatchPromise=new Promise((function(t,n){y(r,void 0,void 0,(function(){var r,o,i,s,a,c,l,d,f,v;return _(this,(function(E){switch(E.label){case 0:return E.trys.push([0,3,,4]),this.watchStatus===h.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:return r=E.sent().envId,this.watchStatus===h.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=h.INITING,o={watchId:this.watchId,requestId:u(),msgType:"INIT_WATCH",msgData:{envId:r,collName:this.collectionName,query:this.query,limit:this.limit,orderBy:this.orderBy}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:1e4})]);case 2:if(i=E.sent(),s=i.msgData,a=s.events,c=s.currEvent,this.sessionInfo={queryID:i.msgData.queryID,currentEventId:c-1,currentDocs:[]},a.length>0){for(l=0,d=a;l<d.length;l++)d[l].ID=c;this.handleServerEvents(i)}else this.sessionInfo.currentEventId=c,f=new p({id:c,docChanges:[],docs:[],type:"init"}),this.listener.onChange(f),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=h.ACTIVE,this.availableRetries.INIT_WATCH=2,t(),[3,4];case 3:return v=E.sent(),this.handleWatchEstablishmentError(v,{operationName:"INIT_WATCH",resolve:t,reject:n}),[3,4];case 4:return[2]}}))}))})),t=!1,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.initWatchPromise];case 2:return n.sent(),t=!0,[3,4];case 3:return this.initWatchPromise=void 0,[7];case 4:return console.log("[realtime] initWatch ".concat(t?"success":"fail")),[2]}}))}))},this.rebuildWatch=function(e){return y(t,void 0,void 0,(function(){var t,r=this;return _(this,(function(n){switch(n.label){case 0:if(null!==this.rebuildWatchPromise&&void 0!==this.rebuildWatchPromise)return[2,this.rebuildWatchPromise];this.rebuildWatchPromise=new Promise((function(t,n){y(r,void 0,void 0,(function(){var r,o,i,s;return _(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),this.watchStatus===h.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:if(r=a.sent().envId,!this.sessionInfo)throw new Error("can not rebuildWatch without a successful initWatch (lack of sessionInfo)");return this.watchStatus===h.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=h.REBUILDING,o={watchId:this.watchId,requestId:u(),msgType:"REBUILD_WATCH",msgData:{envId:r,collName:this.collectionName,queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!1,timeout:1e4})]);case 2:return i=a.sent(),this.handleServerEvents(i),this.watchStatus=h.ACTIVE,this.availableRetries.REBUILD_WATCH=2,t(),[3,4];case 3:return s=a.sent(),this.handleWatchEstablishmentError(s,{operationName:"REBUILD_WATCH",resolve:t,reject:n}),[3,4];case 4:return[2]}}))}))})),t=!1,n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.rebuildWatchPromise];case 2:return n.sent(),t=!0,[3,4];case 3:return this.rebuildWatchPromise=void 0,[7];case 4:return console.log("[realtime] rebuildWatch ".concat(t?"success":"fail")),[2]}}))}))},this.handleWatchEstablishmentError=function(e,r){return y(t,void 0,void 0,(function(){var t,n,o,i=this;return _(this,(function(s){return t="INIT_WATCH"===r.operationName,n=function(){i.closeWithError(new b({errCode:t?m.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:m.SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL,errMsg:e})),r.reject(e)},o=function(e){i.useRetryTicket(r.operationName)?t?(i.initWatchPromise=void 0,r.resolve(i.initWatch(e))):(i.rebuildWatchPromise=void 0,r.resolve(i.rebuildWatch(e))):n()},this.handleCommonError(e,{onSignError:function(){return o(!0)},onTimeoutError:function(){return o(!1)},onNotRetryableError:n,onCancelledError:r.reject,onUnknownError:function(){y(i,void 0,void 0,(function(){var e,t=this;return _(this,(function(n){switch(n.label){case 0:return n.trys.push([0,8,,9]),e=function(){return y(t,void 0,void 0,(function(){return _(this,(function(e){switch(e.label){case 0:return this.pause(),[4,this.onceWSConnected()];case 1:return e.sent(),o(!0),[2]}}))}))},this.isWSConnected()?[3,2]:[4,e()];case 1:return n.sent(),[3,7];case 2:return[4,w(100)];case 3:return n.sent(),this.watchStatus!==h.PAUSED?[3,4]:(r.reject(new I("".concat(r.operationName," cancelled due to pause after unknownError"))),[3,7]);case 4:return this.isWSConnected()?[3,6]:[4,e()];case 5:return n.sent(),[3,7];case 6:o(!1),n.label=7;case 7:return[3,9];case 8:return n.sent(),o(!0),[3,9];case 9:return[2]}}))}))}}),[2]}))}))},this.closeWatch=function(){return y(t,void 0,void 0,(function(){var e,t,r;return _(this,(function(n){switch(n.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==h.ACTIVE)return this.watchStatus=h.CLOSED,this.onWatchClose(this,e),[2];n.label=1;case 1:return n.trys.push([1,3,4,5]),this.watchStatus=h.CLOSING,t={watchId:this.watchId,requestId:u(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return n.sent(),this.sessionInfo=void 0,this.watchStatus=h.CLOSED,[3,5];case 3:return r=n.sent(),this.closeWithError(new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL,errMsg:r})),[3,5];case 4:return this.onWatchClose(this,e),[7];case 5:return[2]}}))}))},this.scheduleSendACK=function(){t.clearACKSchedule(),t.ackTimeoutId=setTimeout((function(){t.waitExpectedTimeoutId?t.scheduleSendACK():t.sendACK()}),1e4)},this.clearACKSchedule=function(){t.ackTimeoutId&&clearTimeout(t.ackTimeoutId)},this.sendACK=function(){return y(t,void 0,void 0,(function(){var e,t,r;return _(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.watchStatus!==h.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:u(),msgType:"CHECK_LAST",msgData:{queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:e})]):(console.warn("[realtime listener] can not send ack without a successful initWatch (lack of sessionInfo)"),[2]);case 1:return n.sent(),this.scheduleSendACK(),[3,3];case 2:if(t=n.sent(),E(t))switch((r=t.payload).msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return this.rebuildWatch(),[2];case"QUERYID_INVALID_ERROR":case"SYS_ERR":case"INVALIID_ENV":case"COLLECTION_PERMISSION_DENIED":return this.closeWithError(new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:r.msgData.code})),[2]}return this.availableRetries.CHECK_LAST&&this.availableRetries.CHECK_LAST>0?(this.availableRetries.CHECK_LAST-=1,this.scheduleSendACK()):this.closeWithError(new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}}))}))},this.handleCommonError=function(e,t){if(E(e))switch(e.payload.msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return void t.onSignError(e);default:return void t.onNotRetryableError(e)}else{if(function(e){return"timeout"===e.type}(e))return void t.onTimeoutError(e);if(function(e){return"cancelled"===e.type}(e))return void t.onCancelledError(e)}t.onUnknownError(e)},this.watchId="watchid_".concat(+new Date,"_").concat(Math.random()),this.envId=e.envId,this.collectionName=e.collectionName,this.query=e.query,this.limit=e.limit,this.orderBy=e.orderBy,this.send=e.send,this.login=e.login,this.isWSConnected=e.isWSConnected,this.onceWSConnected=e.onceWSConnected,this.getWaitExpectedTimeoutLength=e.getWaitExpectedTimeoutLength,this.onWatchStart=e.onWatchStart,this.onWatchClose=e.onWatchClose,this.debug=e.debug,this.availableRetries={INIT_WATCH:2,REBUILD_WATCH:2,CHECK_LAST:2},this.listener=new d({close:function(){t.closeWatch()},onChange:e.onChange,onError:e.onError,debug:this.debug,virtualClient:this}),this.initWatch()}return e.prototype.onMessage=function(e){var t=this;switch(this.watchStatus){case h.PAUSED:if("ERROR"!==e.msgType)return;break;case h.LOGGINGIN:case h.INITING:case h.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while ".concat(this.watchStatus));case h.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case h.ERRORED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has ended with error")}if(this.sessionInfo)switch(this.scheduleSendACK(),e.msgType){case"NEXT_EVENT":console.warn("nextevent ".concat(e.msgData.currEvent," ignored"),e),this.handleServerEvents(e);break;case"CHECK_EVENT":this.sessionInfo.currentEventId<e.msgData.currEvent&&(this.sessionInfo.expectEventId=e.msgData.currEvent,this.clearWaitExpectedEvent(),this.waitExpectedTimeoutId=setTimeout((function(){t.rebuildWatch()}),this.getWaitExpectedTimeoutLength()),console.log("[realtime] waitExpectedTimeoutLength ".concat(this.getWaitExpectedTimeoutLength())));break;case"ERROR":this.closeWithError(new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG,errMsg:"".concat(e.msgData.code," - ").concat(e.msgData.message)}));break;default:console.warn("[realtime listener] virtual client receive unexpected msg ".concat(e.msgType,": "),e)}else console.warn("[realtime listener] internal non-fatal error: sessionInfo not found while message is received.")},e.prototype.closeWithError=function(e){var t;this.watchStatus=h.ERRORED,this.clearACKSchedule(),this.listener.onError(e),this.onWatchClose(this,(null===(t=this.sessionInfo)||void 0===t?void 0:t.queryID)||""),console.log("[realtime] client closed (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.pause=function(){this.watchStatus=h.PAUSED,console.log("[realtime] client paused (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.resume=function(){return y(this,void 0,void 0,(function(){var e;return _(this,(function(t){switch(t.label){case 0:this.watchStatus=h.RESUMING,console.log("[realtime] client resuming with ".concat(this.sessionInfo?"REBUILD_WATCH":"INIT_WATCH"," (").concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")")),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.sessionInfo?this.rebuildWatch():this.initWatch()];case 2:return t.sent(),console.log("[realtime] client successfully resumed (".concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")")),[3,4];case 3:return e=t.sent(),console.error("[realtime] client resume failed (".concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")"),e),[3,4];case 4:return[2]}}))}))},e.prototype.useRetryTicket=function(e){return!!(this.availableRetries[e]&&this.availableRetries[e]>0)&&(this.availableRetries[e]-=1,console.log("[realtime] ".concat(e," use a retry ticket, now only ").concat(this.availableRetries[e]," retry left")),!0)},e.prototype.handleServerEvents=function(e){return y(this,void 0,void 0,(function(){var t;return _(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.scheduleSendACK(),[4,this.handleServerEventsInternel(e)];case 1:return r.sent(),this.postHandleServerEventsValidityCheck(e),[3,3];case 2:throw t=r.sent(),console.error("[realtime listener] internal non-fatal error: handle server events failed with error: ",t),t;case 3:return[2]}}))}))},e.prototype.handleServerEventsInternel=function(e){return y(this,void 0,void 0,(function(){var t,r,n,i,a,u,l,h,d,f,v,E;return _(this,(function(g){switch(g.label){case 0:if(t=e.requestId,r=e.msgData.events,n=e.msgType,!r.length||!this.sessionInfo)return[2];i=this.sessionInfo;try{a=r.map(A)}catch(e){return this.closeWithError(new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}u=S([],i.currentDocs,!0),l=!1,h=function(r,h){var f,v,E,g,I,w,y,T,A,R,C,x;return _(this,(function(_){switch(_.label){case 0:return f=a[r],i.currentEventId>=f.id?(!a[r-1]||f.id>a[r-1].id?console.warn("[realtime] duplicate event received, cur ".concat(i.currentEventId," but got ").concat(f.id)):console.error("[realtime listener] server non-fatal error: events out of order (the latter event's id is smaller than that of the former) (requestId ".concat(t,")")),[2,"continue"]):[3,1];case 1:if(i.currentEventId!==f.id-1)return[3,2];switch(f.dataType){case"update":if(!f.doc)switch(f.queueType){case"update":case"dequeue":if(v=u.find((function(e){return e._id===f.docId})),v){if(E=c()(v),f.updatedFields&&Object.keys(f.updatedFields).forEach((function(e){o()(E,e,f.updatedFields[e])})),f.removedFields)for(g=0,I=f.removedFields;g<I.length;g++)w=I[g],s()(E,w);f.doc=E}else console.error("[realtime listener] internal non-fatal server error: unexpected update dataType event where no doc is associated.");break;case"enqueue":throw T=new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="update" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),d.closeWithError(T),T}break;case"replace":if(!f.doc)throw T=new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '.concat(e.requestId,")")}),d.closeWithError(T),T;break;case"remove":(y=u.find((function(e){return e._id===f.docId})))?f.doc=y:console.error("[realtime listener] internal non-fatal server error: unexpected remove event where no doc is associated.");break;case"limit":if(!f.doc)switch(f.queueType){case"dequeue":(y=u.find((function(e){return e._id===f.docId})))?f.doc=y:console.error("[realtime listener] internal non-fatal server error: unexpected limit dataType event where no doc is associated.");break;case"enqueue":throw T=new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="limit" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),d.closeWithError(T),T}}switch(f.queueType){case"init":l?u.push(f.doc):(l=!0,u=[f.doc]);break;case"enqueue":u.push(f.doc);break;case"dequeue":A=u.findIndex((function(e){return e._id===f.docId})),A>-1?u.splice(A,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":A=u.findIndex((function(e){return e._id===f.docId})),A>-1?u[A]=f.doc:console.error("[realtime listener] internal non-fatal server error: unexpected queueType update event where no doc is associated.")}return(r===h-1||a[r+1]&&a[r+1].id!==f.id)&&(R=S([],u,!0),C=a.slice(0,r+1).filter((function(e){return e.id===f.id})),d.sessionInfo.currentEventId=f.id,d.sessionInfo.currentDocs=u,x=new p({id:f.id,docChanges:C,docs:R,msgType:n}),d.listener.onChange(x)),[3,4];case 2:return console.warn("[realtime listener] event received is out of order, cur ".concat(d.sessionInfo.currentEventId," but got ").concat(f.id)),[4,d.rebuildWatch()];case 3:return _.sent(),[2,{value:void 0}];case 4:return[2]}}))},d=this,f=0,v=a.length,g.label=1;case 1:return f<v?[5,h(f,v)]:[3,4];case 2:if("object"==typeof(E=g.sent()))return[2,E.value];g.label=3;case 3:return f++,[3,1];case 4:return[2]}}))}))},e.prototype.postHandleServerEventsValidityCheck=function(e){this.sessionInfo?(this.sessionInfo.expectEventId&&this.sessionInfo.currentEventId>=this.sessionInfo.expectEventId&&this.clearWaitExpectedEvent(),this.sessionInfo.currentEventId<e.msgData.currEvent&&console.warn("[realtime listener] internal non-fatal error: client eventId does not match with server event id after server event handling")):console.error("[realtime listener] internal non-fatal error: sessionInfo lost after server event handling, this should never occur")},e.prototype.clearWaitExpectedEvent=function(){this.waitExpectedTimeoutId&&(clearTimeout(this.waitExpectedTimeoutId),this.waitExpectedTimeoutId=void 0)},e}();function A(e){var t={id:e.ID,dataType:e.DataType,queueType:e.QueueType,docId:e.DocID,doc:e.Doc&&"{}"!==e.Doc?JSON.parse(e.Doc):void 0};return"update"===e.DataType&&(e.UpdatedFields&&(t.updatedFields=JSON.parse(e.UpdatedFields)),(e.removedFields||e.RemovedFields)&&(t.removedFields=JSON.parse(e.removedFields))),t}var R,C={1e3:{code:1e3,name:"Normal Closure",description:"Normal closure; the connection successfully completed whatever purpose for which it was created."},1001:{code:1001,name:"Going Away",description:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{code:1002,name:"Protocol Error",description:"The endpoint is terminating the connection due to a protocol error."},1003:{code:1003,name:"Unsupported Data",description:"The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data)."},1005:{code:1005,name:"No Status Received",description:"Indicates that no status code was provided even though one was expected."},1006:{code:1006,name:"Abnormal Closure",description:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{code:1007,name:"Invalid frame payload data",description:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{code:1008,name:"Policy Violation",description:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{code:1009,name:"Message too big",description:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{code:1010,name:"Missing Extension",description:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{code:1011,name:"Internal Error",description:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{code:1012,name:"Service Restart",description:"The server is terminating the connection because it is restarting."},1013:{code:1013,name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{code:1014,name:"Bad Gateway",description:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{code:1015,name:"TLS Handshake",description:"Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},3e3:{code:3e3,name:"Reconnect WebSocket",description:"The client is terminating the connection because it wants to reconnect"},3001:{code:3001,name:"No Realtime Listeners",description:"The client is terminating the connection because no more realtime listeners exist"},3002:{code:3002,name:"Heartbeat Ping Error",description:"The client is terminating the connection due to its failure in sending heartbeat messages"},3003:{code:3003,name:"Heartbeat Pong Timeout Error",description:"The client is terminating the connection because no heartbeat response is received from the server"},3050:{code:3050,name:"Server Close",description:"The client is terminating the connection because no heartbeat response is received from the server"}};!function(e){e[e.NormalClosure=1e3]="NormalClosure",e[e.GoingAway=1001]="GoingAway",e[e.ProtocolError=1002]="ProtocolError",e[e.UnsupportedData=1003]="UnsupportedData",e[e.NoStatusReceived=1005]="NoStatusReceived",e[e.AbnormalClosure=1006]="AbnormalClosure",e[e.InvalidFramePayloadData=1007]="InvalidFramePayloadData",e[e.PolicyViolation=1008]="PolicyViolation",e[e.MessageTooBig=1009]="MessageTooBig",e[e.MissingExtension=1010]="MissingExtension",e[e.InternalError=1011]="InternalError",e[e.ServiceRestart=1012]="ServiceRestart",e[e.TryAgainLater=1013]="TryAgainLater",e[e.BadGateway=1014]="BadGateway",e[e.TLSHandshake=1015]="TLSHandshake",e[e.ReconnectWebSocket=3e3]="ReconnectWebSocket",e[e.NoRealtimeListeners=3001]="NoRealtimeListeners",e[e.HeartbeatPingError=3002]="HeartbeatPingError",e[e.HeartbeatPongTimeoutError=3003]="HeartbeatPongTimeoutError",e[e.NoAuthentication=3050]="NoAuthentication"}(R||(R={}));var x=function(e,t){var r=C[e],n=r?"".concat(r.name,", code ").concat(e,", reason ").concat(t||r.description):"code ".concat(e);return new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:n})},D=null,N="web";function O(){return D}function L(){return N}function W(e){N=e}var j=function(){return j=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},j.apply(this,arguments)},P=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},M=function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},k=function(){function e(e){var t=this;this.virtualWSClient=new Set,this.queryIdClientMap=new Map,this.watchIdClientMap=new Map,this.pingFailed=0,this.pongMissed=0,this.logins=new Map,this.wsReadySubsribers=[],this.wsResponseWait=new Map,this.rttObserved=[],this.send=function(e){return P(t,void 0,void 0,(function(){var t=this;return M(this,(function(r){return[2,new Promise((function(r,n){P(t,void 0,void 0,(function(){var t,o,i,s,a,c,u,l,h=this;return M(this,(function(d){switch(d.label){case 0:o=!1,i=!1,s=function(e){o=!0,t&&clearTimeout(t),r(e)},a=function(e){i=!0,t&&clearTimeout(t),n(e)},e.timeout&&(t=setTimeout((function(){P(h,void 0,void 0,(function(){return M(this,(function(e){switch(e.label){case 0:return o&&i?[3,2]:[4,w(0)];case 1:e.sent(),o&&i||a(new g("wsclient.send timedout")),e.label=2;case 2:return[2]}}))}))}),e.timeout)),d.label=1;case 1:return d.trys.push([1,8,,9]),void 0===this.wsInitPromise&&null===this.wsInitPromise?[3,3]:[4,this.wsInitPromise];case 2:d.sent(),d.label=3;case 3:if(!this.ws)return a(new Error("invalid state: ws connection not exists, can not send message")),[2];if(1!==this.ws.readyState)return a(new Error("ws readyState invalid: ".concat(this.ws.readyState,", can not send message"))),[2];e.waitResponse&&(c={resolve:s,reject:a,skipOnMessage:e.skipOnMessage},this.wsResponseWait.set(e.msg.requestId,c)),d.label=4;case 4:return d.trys.push([4,6,,7]),[4,this.ws.send(JSON.stringify(e.msg))];case 5:return d.sent(),e.waitResponse||s(void 0),[3,7];case 6:return(u=d.sent())&&(a(u),e.waitResponse&&this.wsResponseWait.delete(e.msg.requestId)),[3,7];case 7:return[3,9];case 8:return l=d.sent(),a(l),[3,9];case 9:return[2]}}))}))}))]}))}))},this.closeAllClients=function(e){t.virtualWSClient.forEach((function(t){t.closeWithError(e)}))},this.pauseClients=function(e){(e||t.virtualWSClient).forEach((function(e){e.pause()}))},this.resumeClients=function(e){(e||t.virtualWSClient).forEach((function(e){e.resume()}))},this.initWebSocketConnection=function(e,r){return void 0===r&&(r=t.maxReconnect),P(t,void 0,void 0,(function(){var t=this;return M(this,(function(n){switch(n.label){case 0:if(e&&this.reconnectState)return[2];if(e&&(this.reconnectState=!0),void 0!==this.wsInitPromise&&null!==this.wsInitPromise)return[2,this.wsInitPromise];e&&this.pauseClients(),this.close(R.ReconnectWebSocket),this.wsInitPromise=new Promise((function(n,o){P(t,void 0,void 0,(function(){var t,i,s=this;return M(this,(function(a){switch(a.label){case 0:return a.trys.push([0,6,,11]),[4,this.getWsSign()];case 1:return t=a.sent(),[4,new Promise((function(e){var r=t.wsUrl||"wss://tcb-ws.tencentcloudapi.com",n=O();s.ws=n?new n(r):new WebSocket(r),e(void 0)}))];case 2:return a.sent(),this.ws.connect?[4,this.ws.connect()]:[3,4];case 3:a.sent(),a.label=4;case 4:return[4,this.initWebSocketEvent()];case 5:return a.sent(),n(),e&&(this.resumeClients(),this.reconnectState=!1),[3,11];case 6:return i=a.sent(),console.error("[realtime] initWebSocketConnection connect fail",i),r>0?(this.wsInitPromise=void 0,[4,w(this.reconnectInterval)]):[3,9];case 7:a.sent(),e&&(this.reconnectState=!1),a.label=8;case 8:return n(this.initWebSocketConnection(e,r-1)),[3,10];case 9:o(i),e&&this.closeAllClients(new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL,errMsg:i})),a.label=10;case 10:return[3,11];case 11:return[2]}}))}))})),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,this.wsInitPromise];case 2:return n.sent(),this.wsReadySubsribers.forEach((function(e){return(0,e.resolve)()})),[3,5];case 3:return n.sent(),this.wsReadySubsribers.forEach((function(e){return(0,e.reject)()})),[3,5];case 4:return this.wsInitPromise=void 0,this.wsReadySubsribers=[],[7];case 5:return[2]}}))}))},this.initWebSocketEvent=function(){return new Promise((function(e,r){if(!t.ws)throw new Error("can not initWebSocketEvent, ws not exists");var n=!1;t.ws.onopen=function(t){console.warn("[realtime] ws event: open",t),n=!0,e()},t.ws.onerror=function(e){t.logins=new Map,n?(console.error("[realtime] ws event: error",e),t.clearHeartbeat(),t.virtualWSClient.forEach((function(t){return t.closeWithError(new b({errCode:m.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR,errMsg:e}))}))):(console.error("[realtime] ws open failed with ws event: error",e),r(e))},t.ws.onclose=function(e){switch(console.warn("[realtime] ws event: close",e),t.logins=new Map,t.clearHeartbeat(),e.code){case R.ReconnectWebSocket:case R.NoRealtimeListeners:break;case R.HeartbeatPingError:case R.HeartbeatPongTimeoutError:case R.NormalClosure:case R.AbnormalClosure:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(x(e.code));break;case R.NoAuthentication:t.closeAllClients(x(e.code,e.reason));break;default:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients(x(e.code))}},t.ws.onmessage=function(e){var r,n,o=(null===(r=e.data)||void 0===r?void 0:r.data)||e.data;t.heartbeat();try{n="string"==typeof o?JSON.parse(o):o}catch(e){throw new Error("[realtime] onMessage parse res.data error: ".concat(e))}if("ERROR"===n.msgType){var i=null;t.virtualWSClient.forEach((function(e){e.watchId===n.watchId&&(i=e)})),i&&i.listener.onError(n)}var s=t.wsResponseWait.get(n.requestId);if(s){try{"ERROR"===n.msgType?s.reject(new v(n)):s.resolve(n)}catch(e){console.error("ws onMessage responseWaitSpec.resolve(msg) errored:",e)}finally{t.wsResponseWait.delete(n.requestId)}if(s.skipOnMessage)return}if("PONG"!==n.msgType){var a=n.watchId&&t.watchIdClientMap.get(n.watchId);if(a)a.onMessage(n);else switch(console.error("[realtime] no realtime listener found responsible for watchId ".concat(n.watchId,": "),n),n.msgType){case"INIT_EVENT":case"NEXT_EVENT":case"CHECK_EVENT":(a=t.queryIdClientMap.get(n.msgData.queryID))&&a.onMessage(n);break;default:for(var c=0,u=Array.from(t.watchIdClientMap.entries());c<u.length;c++){u[c][1].onMessage(n);break}}}else if(t.lastPingSendTS){var l=Date.now()-t.lastPingSendTS;if(l>1e4)return void console.warn("[realtime] untrusted rtt observed: ".concat(l));t.rttObserved.length>=3&&t.rttObserved.splice(0,t.rttObserved.length-3+1),t.rttObserved.push(l)}},t.heartbeat()}))},this.isWSConnected=function(){return Boolean(t.ws&&1===t.ws.readyState)},this.onceWSConnected=function(){return P(t,void 0,void 0,(function(){var e=this;return M(this,(function(t){return this.isWSConnected()?[2]:null!==this.wsInitPromise&&void 0!==this.wsInitPromise?[2,this.wsInitPromise]:[2,new Promise((function(t,r){e.wsReadySubsribers.push({resolve:t,reject:r})}))]}))}))},this.webLogin=function(e,r){return P(t,void 0,void 0,(function(){var t,n,o,i,s,a,c,l,h=this;return M(this,(function(d){switch(d.label){case 0:if(!r)if(e){if(t=this.logins.get(e)){if(t.loggedIn&&t.loginResult)return[2,t.loginResult];if(null!==t.loggingInPromise&&void 0!==t.loggingInPromise)return[2,t.loggingInPromise]}}else if(null!==(null==(n=this.logins.get(""))?void 0:n.loggingInPromise)&&void 0!==(null==n?void 0:n.loggingInPromise))return[2,n.loggingInPromise];o=new Promise((function(e,t){P(h,void 0,void 0,(function(){var r,n,o,i,s;return M(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.getWsSign()];case 1:return r=a.sent(),n={envId:r.envId||"",accessToken:"",referrer:"web",sdkVersion:"",dataVersion:""},o={watchId:void 0,requestId:u(),msgType:"LOGIN",msgData:n,exMsgData:{runtime:L(),signStr:r.signStr,secretVersion:r.secretVersion}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:5e3})];case 2:return(i=a.sent()).msgData.code?t(new Error("".concat(i.msgData.code," ").concat(i.msgData.message))):e({envId:r.envId}),[3,4];case 3:return s=a.sent(),t(s),[3,4];case 4:return[2]}}))}))})),i=e&&this.logins.get(e),s=Date.now(),i?(i.loggedIn=!1,i.loggingInPromise=o,i.loginStartTS=s):(i={loggedIn:!1,loggingInPromise:o,loginStartTS:s},this.logins.set(e||"",i)),d.label=1;case 1:return d.trys.push([1,3,,4]),[4,o];case 2:if(a=d.sent(),(c=e&&this.logins.get(e))&&c===i&&c.loginStartTS===s)return i.loggedIn=!0,i.loggingInPromise=void 0,i.loginStartTS=void 0,i.loginResult=a,[2,a];if(c){if(c.loggedIn&&c.loginResult)return[2,c.loginResult];if(null!==c.loggingInPromise&&void 0!==c.loggingInPromise)return[2,c.loggingInPromise];throw new Error("ws unexpected login info")}throw new Error("ws login info reset");case 3:throw l=d.sent(),i.loggedIn=!1,i.loggingInPromise=void 0,i.loginStartTS=void 0,i.loginResult=void 0,l;case 4:return[2]}}))}))},this.getWsSign=function(){return P(t,void 0,void 0,(function(){var e,t,r,n,o,i,s;return M(this,(function(a){switch(a.label){case 0:return this.wsSign&&this.wsSign.expiredTs>Date.now()?[2,this.wsSign]:(e=Date.now()+6e4,[4,this.context.appConfig.request.send("auth.wsWebSign",{runtime:L()})]);case 1:if((t=a.sent()).code)throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败: ".concat(t.code));if(t.data)return r=t.data,n=r.signStr,o=r.wsUrl,i=r.secretVersion,s=r.envId,[2,{signStr:n,wsUrl:o,secretVersion:i,envId:s,expiredTs:e}];throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败")}}))}))},this.getWaitExpectedTimeoutLength=function(){return t.rttObserved.length?t.rttObserved.reduce((function(e,t){return e+t}))/t.rttObserved.length*1.5:5e3},this.ping=function(){return P(t,void 0,void 0,(function(){var e;return M(this,(function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:u(),msgType:"PING",msgData:null},[4,this.send({msg:e})];case 1:return t.sent(),[2]}}))}))},this.onWatchStart=function(e,r){t.queryIdClientMap.set(r,e)},this.onWatchClose=function(e,r){r&&t.queryIdClientMap.delete(r),t.watchIdClientMap.delete(e.watchId),t.virtualWSClient.delete(e),t.virtualWSClient.size||t.close(R.NoRealtimeListeners)},this.maxReconnect=e.maxReconnect||5,this.reconnectInterval=e.reconnectInterval||1e4,this.context=e.context}return e.prototype.clearHeartbeat=function(){this.pingTimeoutId&&clearTimeout(this.pingTimeoutId),this.pongTimeoutId&&clearTimeout(this.pongTimeoutId)},e.prototype.close=function(e){this.clearHeartbeat(),this.ws&&(this.ws.close(e,C[e].name),this.ws=void 0)},e.prototype.watch=function(e){this.ws||void 0!==this.wsInitPromise&&null!==this.wsInitPromise||this.initWebSocketConnection(!1);var t=new T(j(j({},e),{send:this.send,login:this.webLogin,isWSConnected:this.isWSConnected,onceWSConnected:this.onceWSConnected,getWaitExpectedTimeoutLength:this.getWaitExpectedTimeoutLength,onWatchStart:this.onWatchStart,onWatchClose:this.onWatchClose,debug:!0}));return this.virtualWSClient.add(t),this.watchIdClientMap.set(t.watchId,t),t.listener},e.prototype.heartbeat=function(e){var t=this;this.clearHeartbeat(),this.pingTimeoutId=setTimeout((function(){P(t,void 0,void 0,(function(){var e=this;return M(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this.ws&&1===this.ws.readyState?(this.lastPingSendTS=Date.now(),[4,this.ping()]):[2];case 1:return t.sent(),this.pingFailed=0,this.pongTimeoutId=setTimeout((function(){console.error("pong timed out"),e.pongMissed<2?(e.pongMissed+=1,e.heartbeat(!0)):e.initWebSocketConnection(!0)}),this.context.appConfig.realtimePongWaitTimeout),[3,3];case 2:return t.sent(),this.pingFailed<2?(this.pingFailed+=1,this.heartbeat()):this.close(R.HeartbeatPingError),[3,3];case 3:return[2]}}))}))}),e?0:this.context.appConfig.realtimePingInterval)},e}(),B={target:"database",entity:function(){var e,t=this.platform,r=t.adapter,n=t.runtime;e=r.wsClass,D=e,W(n)}},K={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=k}};try{cloudbase.registerComponent(K),cloudbase.registerHook(B)}catch(e){}function q(e){try{e.registerComponent(K),e.registerHook(B)}catch(e){console.warn(e)}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n](i,i.exports,r),i.loaded=!0,i.exports}return r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(1246)})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cloudbase_realtime",[],t):"object"==typeof exports?exports.cloudbase_realtime=t():e.cloudbase_realtime=t()}("undefined"!=typeof window?window:this,(()=>(()=>{var e={8037:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerRealtime=void 0;var n=r(7209);t.registerRealtime=n.registerRealtime;try{window.registerRealtime=t.registerRealtime}catch(e){}},6511:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setRuntime=t.getRuntime=t.setWsClass=t.getWsClass=void 0;var r=null,n="web";t.getWsClass=function(){return r},t.setWsClass=function(e){r=e},t.getRuntime=function(){return n},t.setRuntime=function(e){n=e}},2917:function(e,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.ERR_CODE=t.CloudSDKError=t.isCancelledError=t.CancelledError=t.isTimeoutError=t.TimeoutError=t.isRealtimeErrorMessageError=t.RealtimeErrorMessageError=void 0;var o=function(e){function t(t){var r=e.call(this,"Watch Error ".concat(JSON.stringify(t.msgData)," (requestid: ").concat(t.requestId,")"))||this;return r.isRealtimeErrorMessageError=!0,r.payload=t,r}return n(t,e),t}(Error);t.RealtimeErrorMessageError=o,t.isRealtimeErrorMessageError=function(e){return null==e?void 0:e.isRealtimeErrorMessageError};var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="timeout",t.payload=null,t.generic=!0,t}return n(t,e),t}(Error);t.TimeoutError=i,t.isTimeoutError=function(e){return"timeout"===e.type};var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type="cancelled",t.payload=null,t.generic=!0,t}return n(t,e),t}(Error);t.CancelledError=s,t.isCancelledError=function(e){return"cancelled"===e.type};var a=function(e){function r(r){var n=e.call(this,r.errMsg)||this;return n.errCode="UNKNOWN_ERROR",Object.defineProperties(n,{message:{get:function(){return"errCode: ".concat(this.errCode," ").concat(t.ERR_CODE[this.errCode]||""," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e}}}),n.errCode=r.errCode||"UNKNOWN_ERROR",n.errMsg=r.errMsg,n}return n(r,e),Object.defineProperty(r.prototype,"message",{get:function(){return"errCode: ".concat(this.errCode," | errMsg: ").concat(this.errMsg)},set:function(e){this.errMsg=e},enumerable:!1,configurable:!0}),r}(Error);t.CloudSDKError=a,t.ERR_CODE={UNKNOWN_ERROR:"UNKNOWN_ERROR",SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL",SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG:"SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG",SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA:"SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR",SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED:"SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED",SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL:"SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL",SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR:"SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR"}},7209:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.registerRealtime=void 0;var n=r(2347),o=r(6511),i={target:"database",entity:function(){var e=this.platform,t=e.adapter,r=e.runtime;(0,o.setWsClass)(t.wsClass),(0,o.setRuntime)(r)}},s={name:"realtime",IIFE:!0,entity:function(){this.prototype.wsClientClass=n.RealtimeWebSocketClient}};try{cloudbase.registerComponent(s),cloudbase.registerHook(i)}catch(e){}t.registerRealtime=function(e){try{e.registerComponent(s),e.registerHook(i)}catch(e){console.warn(e)}}},1601:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RealtimeListener=void 0;t.RealtimeListener=function(e){this.close=e.close,this.onChange=e.onChange,this.onError=e.onError,e.debug&&Object.defineProperty(this,"virtualClient",{get:function(){return e.virtualClient}})}},3994:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isInitEventMessage=t.genRequestId=void 0,t.genRequestId=function(e){return void 0===e&&(e=""),"".concat(e?"".concat(e,"_"):"").concat(+new Date,"_").concat(Math.random())},t.isInitEventMessage=function(e){return"INIT_EVENT"===e.msgType}},9770:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Snapshot=void 0;t.Snapshot=function(e){var t,r,n=e.id,o=e.docChanges,i=e.docs,s=e.msgType,a=e.type;Object.defineProperties(this,{id:{get:function(){return n},enumerable:!0},docChanges:{get:function(){return t||(t=JSON.parse(JSON.stringify(o))),t},enumerable:!0},docs:{get:function(){return r||(r=JSON.parse(JSON.stringify(i))),r},enumerable:!0},msgType:{get:function(){return s},enumerable:!0},type:{get:function(){return a},enumerable:!0}})}},7589:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sleep=void 0,t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))}},4151:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.VirtualWebSocketClient=void 0;var a,c=s(r(6765)),u=s(r(7195)),l=s(r(9850)),d=r(3994),h=r(1601),p=r(9770),f=r(2917),v=r(7589);!function(e){e.LOGGINGIN="LOGGINGIN",e.INITING="INITING",e.REBUILDING="REBUILDING",e.ACTIVE="ACTIVE",e.ERRORED="ERRORED",e.CLOSING="CLOSING",e.CLOSED="CLOSED",e.PAUSED="PAUSED",e.RESUMING="RESUMING"}(a||(a={}));var E=function(){function e(e){var t=this;this.watchStatus=a.INITING,this.wsLogin=function(e,r){return n(t,void 0,Promise,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return this.watchStatus=a.LOGGINGIN,[4,this.login(e,r)];case 1:return t=n.sent(),this.envId||(this.envId=t.envId),[2,t]}}))}))},this.initWatch=function(e){return n(t,void 0,Promise,(function(){var t,r=this;return o(this,(function(i){switch(i.label){case 0:if(null!==this.initWatchPromise&&void 0!==this.initWatchPromise)return[2,this.initWatchPromise];this.initWatchPromise=new Promise((function(t,i){n(r,void 0,void 0,(function(){var r,n,s,c,u,l,h,f,v,E;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.watchStatus===a.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:return r=o.sent().envId,this.watchStatus===a.PAUSED?(console.log("[realtime] initWatch cancelled on pause"),[2,t()]):(this.watchStatus=a.INITING,n={watchId:this.watchId,requestId:(0,d.genRequestId)(),msgType:"INIT_WATCH",msgData:{envId:r,collName:this.collectionName,query:this.query,limit:this.limit,orderBy:this.orderBy}},[4,this.send({msg:n,waitResponse:!0,skipOnMessage:!0,timeout:1e4})]);case 2:if(s=o.sent(),c=s.msgData,u=c.events,l=c.currEvent,this.sessionInfo={queryID:s.msgData.queryID,currentEventId:l-1,currentDocs:[]},u.length>0){for(h=0,f=u;h<f.length;h++)f[h].ID=l;this.handleServerEvents(s)}else this.sessionInfo.currentEventId=l,v=new p.Snapshot({id:l,docChanges:[],docs:[],type:"init"}),this.listener.onChange(v),this.scheduleSendACK();return this.onWatchStart(this,this.sessionInfo.queryID),this.watchStatus=a.ACTIVE,this.availableRetries.INIT_WATCH=2,t(),[3,4];case 3:return E=o.sent(),this.handleWatchEstablishmentError(E,{operationName:"INIT_WATCH",resolve:t,reject:i}),[3,4];case 4:return[2]}}))}))})),t=!1,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,this.initWatchPromise];case 2:return i.sent(),t=!0,[3,4];case 3:return this.initWatchPromise=void 0,[7];case 4:return console.log("[realtime] initWatch ".concat(t?"success":"fail")),[2]}}))}))},this.rebuildWatch=function(e){return n(t,void 0,Promise,(function(){var t,r=this;return o(this,(function(i){switch(i.label){case 0:if(null!==this.rebuildWatchPromise&&void 0!==this.rebuildWatchPromise)return[2,this.rebuildWatchPromise];this.rebuildWatchPromise=new Promise((function(t,i){n(r,void 0,void 0,(function(){var r,n,s,c;return o(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),this.watchStatus===a.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):[4,this.wsLogin(this.envId,e)];case 1:if(r=o.sent().envId,!this.sessionInfo)throw new Error("can not rebuildWatch without a successful initWatch (lack of sessionInfo)");return this.watchStatus===a.PAUSED?(console.log("[realtime] rebuildWatch cancelled on pause"),[2,t()]):(this.watchStatus=a.REBUILDING,n={watchId:this.watchId,requestId:(0,d.genRequestId)(),msgType:"REBUILD_WATCH",msgData:{envId:r,collName:this.collectionName,queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:n,waitResponse:!0,skipOnMessage:!1,timeout:1e4})]);case 2:return s=o.sent(),this.handleServerEvents(s),this.watchStatus=a.ACTIVE,this.availableRetries.REBUILD_WATCH=2,t(),[3,4];case 3:return c=o.sent(),this.handleWatchEstablishmentError(c,{operationName:"REBUILD_WATCH",resolve:t,reject:i}),[3,4];case 4:return[2]}}))}))})),t=!1,i.label=1;case 1:return i.trys.push([1,,3,4]),[4,this.rebuildWatchPromise];case 2:return i.sent(),t=!0,[3,4];case 3:return this.rebuildWatchPromise=void 0,[7];case 4:return console.log("[realtime] rebuildWatch ".concat(t?"success":"fail")),[2]}}))}))},this.handleWatchEstablishmentError=function(e,r){return n(t,void 0,void 0,(function(){var t,i,s,c=this;return o(this,(function(u){return t="INIT_WATCH"===r.operationName,i=function(){c.closeWithError(new f.CloudSDKError({errCode:t?f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_INIT_WATCH_FAIL:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_REBUILD_WATCH_FAIL,errMsg:e})),r.reject(e)},s=function(e){c.useRetryTicket(r.operationName)?t?(c.initWatchPromise=void 0,r.resolve(c.initWatch(e))):(c.rebuildWatchPromise=void 0,r.resolve(c.rebuildWatch(e))):i()},this.handleCommonError(e,{onSignError:function(){return s(!0)},onTimeoutError:function(){return s(!1)},onNotRetryableError:i,onCancelledError:r.reject,onUnknownError:function(){n(c,void 0,void 0,(function(){var e,t=this;return o(this,(function(i){switch(i.label){case 0:return i.trys.push([0,8,,9]),e=function(){return n(t,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return this.pause(),[4,this.onceWSConnected()];case 1:return e.sent(),s(!0),[2]}}))}))},this.isWSConnected()?[3,2]:[4,e()];case 1:return i.sent(),[3,7];case 2:return[4,(0,v.sleep)(100)];case 3:return i.sent(),this.watchStatus!==a.PAUSED?[3,4]:(r.reject(new f.CancelledError("".concat(r.operationName," cancelled due to pause after unknownError"))),[3,7]);case 4:return this.isWSConnected()?[3,6]:[4,e()];case 5:return i.sent(),[3,7];case 6:s(!1),i.label=7;case 7:return[3,9];case 8:return i.sent(),s(!0),[3,9];case 9:return[2]}}))}))}}),[2]}))}))},this.closeWatch=function(){return n(t,void 0,void 0,(function(){var e,t,r;return o(this,(function(n){switch(n.label){case 0:if(e=this.sessionInfo?this.sessionInfo.queryID:"",this.watchStatus!==a.ACTIVE)return this.watchStatus=a.CLOSED,this.onWatchClose(this,e),[2];n.label=1;case 1:return n.trys.push([1,3,4,5]),this.watchStatus=a.CLOSING,t={watchId:this.watchId,requestId:(0,d.genRequestId)(),msgType:"CLOSE_WATCH",msgData:null},[4,this.send({msg:t})];case 2:return n.sent(),this.sessionInfo=void 0,this.watchStatus=a.CLOSED,[3,5];case 3:return r=n.sent(),this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_CLOSE_WATCH_FAIL,errMsg:r})),[3,5];case 4:return this.onWatchClose(this,e),[7];case 5:return[2]}}))}))},this.scheduleSendACK=function(){t.clearACKSchedule(),t.ackTimeoutId=setTimeout((function(){t.waitExpectedTimeoutId?t.scheduleSendACK():t.sendACK()}),1e4)},this.clearACKSchedule=function(){t.ackTimeoutId&&clearTimeout(t.ackTimeoutId)},this.sendACK=function(){return n(t,void 0,Promise,(function(){var e,t,r;return o(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.watchStatus!==a.ACTIVE?(this.scheduleSendACK(),[2]):this.sessionInfo?(e={watchId:this.watchId,requestId:(0,d.genRequestId)(),msgType:"CHECK_LAST",msgData:{queryID:this.sessionInfo.queryID,eventID:this.sessionInfo.currentEventId}},[4,this.send({msg:e})]):(console.warn("[realtime listener] can not send ack without a successful initWatch (lack of sessionInfo)"),[2]);case 1:return n.sent(),this.scheduleSendACK(),[3,3];case 2:if(t=n.sent(),(0,f.isRealtimeErrorMessageError)(t))switch((r=t.payload).msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return this.rebuildWatch(),[2];case"QUERYID_INVALID_ERROR":case"SYS_ERR":case"INVALIID_ENV":case"COLLECTION_PERMISSION_DENIED":return this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:r.msgData.code})),[2]}return this.availableRetries.CHECK_LAST&&this.availableRetries.CHECK_LAST>0?(this.availableRetries.CHECK_LAST-=1,this.scheduleSendACK()):this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_CHECK_LAST_FAIL,errMsg:t})),[3,3];case 3:return[2]}}))}))},this.handleCommonError=function(e,t){if((0,f.isRealtimeErrorMessageError)(e))switch(e.payload.msgData.code){case"CHECK_LOGIN_FAILED":case"SIGN_EXPIRED_ERROR":case"SIGN_INVALID_ERROR":case"SIGN_PARAM_INVALID":return void t.onSignError(e);default:return void t.onNotRetryableError(e)}else{if((0,f.isTimeoutError)(e))return void t.onTimeoutError(e);if((0,f.isCancelledError)(e))return void t.onCancelledError(e)}t.onUnknownError(e)},this.watchId="watchid_".concat(+new Date,"_").concat(Math.random()),this.envId=e.envId,this.collectionName=e.collectionName,this.query=e.query,this.limit=e.limit,this.orderBy=e.orderBy,this.send=e.send,this.login=e.login,this.isWSConnected=e.isWSConnected,this.onceWSConnected=e.onceWSConnected,this.getWaitExpectedTimeoutLength=e.getWaitExpectedTimeoutLength,this.onWatchStart=e.onWatchStart,this.onWatchClose=e.onWatchClose,this.debug=e.debug,this.availableRetries={INIT_WATCH:2,REBUILD_WATCH:2,CHECK_LAST:2},this.listener=new h.RealtimeListener({close:function(){t.closeWatch()},onChange:e.onChange,onError:e.onError,debug:this.debug,virtualClient:this}),this.initWatch()}return e.prototype.onMessage=function(e){var t=this;switch(this.watchStatus){case a.PAUSED:if("ERROR"!==e.msgType)return;break;case a.LOGGINGIN:case a.INITING:case a.REBUILDING:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received while ".concat(this.watchStatus));case a.CLOSED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has closed");case a.ERRORED:return void console.warn("[realtime listener] internal non-fatal error: unexpected message received when the watch has ended with error")}if(this.sessionInfo)switch(this.scheduleSendACK(),e.msgType){case"NEXT_EVENT":console.warn("nextevent ".concat(e.msgData.currEvent," ignored"),e),this.handleServerEvents(e);break;case"CHECK_EVENT":this.sessionInfo.currentEventId<e.msgData.currEvent&&(this.sessionInfo.expectEventId=e.msgData.currEvent,this.clearWaitExpectedEvent(),this.waitExpectedTimeoutId=setTimeout((function(){t.rebuildWatch()}),this.getWaitExpectedTimeoutLength()),console.log("[realtime] waitExpectedTimeoutLength ".concat(this.getWaitExpectedTimeoutLength())));break;case"ERROR":this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_SERVER_ERROR_MSG,errMsg:"".concat(e.msgData.code," - ").concat(e.msgData.message)}));break;default:console.warn("[realtime listener] virtual client receive unexpected msg ".concat(e.msgType,": "),e)}else console.warn("[realtime listener] internal non-fatal error: sessionInfo not found while message is received.")},e.prototype.closeWithError=function(e){var t;this.watchStatus=a.ERRORED,this.clearACKSchedule(),this.listener.onError(e),this.onWatchClose(this,(null===(t=this.sessionInfo)||void 0===t?void 0:t.queryID)||""),console.log("[realtime] client closed (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.pause=function(){this.watchStatus=a.PAUSED,console.log("[realtime] client paused (".concat(this.collectionName," ").concat(this.query,") (watchId ").concat(this.watchId,")"))},e.prototype.resume=function(){return n(this,void 0,Promise,(function(){var e;return o(this,(function(t){switch(t.label){case 0:this.watchStatus=a.RESUMING,console.log("[realtime] client resuming with ".concat(this.sessionInfo?"REBUILD_WATCH":"INIT_WATCH"," (").concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")")),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.sessionInfo?this.rebuildWatch():this.initWatch()];case 2:return t.sent(),console.log("[realtime] client successfully resumed (".concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")")),[3,4];case 3:return e=t.sent(),console.error("[realtime] client resume failed (".concat(this.collectionName," ").concat(this.query,") (").concat(this.watchId,")"),e),[3,4];case 4:return[2]}}))}))},e.prototype.useRetryTicket=function(e){return!!(this.availableRetries[e]&&this.availableRetries[e]>0)&&(this.availableRetries[e]-=1,console.log("[realtime] ".concat(e," use a retry ticket, now only ").concat(this.availableRetries[e]," retry left")),!0)},e.prototype.handleServerEvents=function(e){return n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),this.scheduleSendACK(),[4,this.handleServerEventsInternel(e)];case 1:return r.sent(),this.postHandleServerEventsValidityCheck(e),[3,3];case 2:throw t=r.sent(),console.error("[realtime listener] internal non-fatal error: handle server events failed with error: ",t),t;case 3:return[2]}}))}))},e.prototype.handleServerEventsInternel=function(e){return n(this,void 0,void 0,(function(){var t,r,n,s,a,d,h,v,E,_,m,I;return o(this,(function(b){switch(b.label){case 0:if(t=e.requestId,r=e.msgData.events,n=e.msgType,!r.length||!this.sessionInfo)return[2];s=this.sessionInfo;try{a=r.map(g)}catch(e){return this.closeWithError(new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_RECEIVE_INVALID_SERVER_DATA,errMsg:e})),[2]}d=i([],s.currentDocs,!0),h=!1,v=function(r,v){var g,_,m,I,b,y,w,S,T,C,R,A;return o(this,(function(o){switch(o.label){case 0:return g=a[r],s.currentEventId>=g.id?(!a[r-1]||g.id>a[r-1].id?console.warn("[realtime] duplicate event received, cur ".concat(s.currentEventId," but got ").concat(g.id)):console.error("[realtime listener] server non-fatal error: events out of order (the latter event's id is smaller than that of the former) (requestId ".concat(t,")")),[2,"continue"]):[3,1];case 1:if(s.currentEventId!==g.id-1)return[3,2];switch(g.dataType){case"update":if(!g.doc)switch(g.queueType){case"update":case"dequeue":if(_=d.find((function(e){return e._id===g.docId})),_){if(m=(0,l.default)(_),g.updatedFields&&Object.keys(g.updatedFields).forEach((function(e){(0,c.default)(m,e,g.updatedFields[e])})),g.removedFields)for(I=0,b=g.removedFields;I<b.length;I++)y=b[I],(0,u.default)(m,y);g.doc=m}else console.error("[realtime listener] internal non-fatal server error: unexpected update dataType event where no doc is associated.");break;case"enqueue":throw S=new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="update" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),E.closeWithError(S),S}break;case"replace":if(!g.doc)throw S=new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="replace" (requestId '.concat(e.requestId,")")}),E.closeWithError(S),S;break;case"remove":(w=d.find((function(e){return e._id===g.docId})))?g.doc=w:console.error("[realtime listener] internal non-fatal server error: unexpected remove event where no doc is associated.");break;case"limit":if(!g.doc)switch(g.queueType){case"dequeue":(w=d.find((function(e){return e._id===g.docId})))?g.doc=w:console.error("[realtime listener] internal non-fatal server error: unexpected limit dataType event where no doc is associated.");break;case"enqueue":throw S=new f.CloudSDKError({errCode:f.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_UNEXPECTED_FATAL_ERROR,errMsg:'HandleServerEvents: full doc is not provided with dataType="limit" and queueType="enqueue" (requestId '.concat(e.requestId,")")}),E.closeWithError(S),S}}switch(g.queueType){case"init":h?d.push(g.doc):(h=!0,d=[g.doc]);break;case"enqueue":d.push(g.doc);break;case"dequeue":T=d.findIndex((function(e){return e._id===g.docId})),T>-1?d.splice(T,1):console.error("[realtime listener] internal non-fatal server error: unexpected dequeue event where no doc is associated.");break;case"update":T=d.findIndex((function(e){return e._id===g.docId})),T>-1?d[T]=g.doc:console.error("[realtime listener] internal non-fatal server error: unexpected queueType update event where no doc is associated.")}return(r===v-1||a[r+1]&&a[r+1].id!==g.id)&&(C=i([],d,!0),R=a.slice(0,r+1).filter((function(e){return e.id===g.id})),E.sessionInfo.currentEventId=g.id,E.sessionInfo.currentDocs=d,A=new p.Snapshot({id:g.id,docChanges:R,docs:C,msgType:n}),E.listener.onChange(A)),[3,4];case 2:return console.warn("[realtime listener] event received is out of order, cur ".concat(E.sessionInfo.currentEventId," but got ").concat(g.id)),[4,E.rebuildWatch()];case 3:return o.sent(),[2,{value:void 0}];case 4:return[2]}}))},E=this,_=0,m=a.length,b.label=1;case 1:return _<m?[5,v(_,m)]:[3,4];case 2:if("object"==typeof(I=b.sent()))return[2,I.value];b.label=3;case 3:return _++,[3,1];case 4:return[2]}}))}))},e.prototype.postHandleServerEventsValidityCheck=function(e){this.sessionInfo?(this.sessionInfo.expectEventId&&this.sessionInfo.currentEventId>=this.sessionInfo.expectEventId&&this.clearWaitExpectedEvent(),this.sessionInfo.currentEventId<e.msgData.currEvent&&console.warn("[realtime listener] internal non-fatal error: client eventId does not match with server event id after server event handling")):console.error("[realtime listener] internal non-fatal error: sessionInfo lost after server event handling, this should never occur")},e.prototype.clearWaitExpectedEvent=function(){this.waitExpectedTimeoutId&&(clearTimeout(this.waitExpectedTimeoutId),this.waitExpectedTimeoutId=void 0)},e}();function g(e){var t={id:e.ID,dataType:e.DataType,queueType:e.QueueType,docId:e.DocID,doc:e.Doc&&"{}"!==e.Doc?JSON.parse(e.Doc):void 0};return"update"===e.DataType&&(e.UpdatedFields&&(t.updatedFields=JSON.parse(e.UpdatedFields)),(e.removedFields||e.RemovedFields)&&(t.removedFields=JSON.parse(e.removedFields))),t}t.VirtualWebSocketClient=E},2347:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function a(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.RealtimeWebSocketClient=void 0;var s=r(4151),a=r(3994),c=r(636),u=r(2917),l=r(6511),d=r(7589),h=function(){function e(e){var t=this;this.virtualWSClient=new Set,this.queryIdClientMap=new Map,this.watchIdClientMap=new Map,this.pingFailed=0,this.pongMissed=0,this.logins=new Map,this.wsReadySubsribers=[],this.wsResponseWait=new Map,this.rttObserved=[],this.send=function(e){return o(t,void 0,Promise,(function(){var t=this;return i(this,(function(r){return[2,new Promise((function(r,n){o(t,void 0,void 0,(function(){var t,s,a,c,l,h,p,f,v=this;return i(this,(function(E){switch(E.label){case 0:s=!1,a=!1,c=function(e){s=!0,t&&clearTimeout(t),r(e)},l=function(e){a=!0,t&&clearTimeout(t),n(e)},e.timeout&&(t=setTimeout((function(){o(v,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return s&&a?[3,2]:[4,(0,d.sleep)(0)];case 1:e.sent(),s&&a||l(new u.TimeoutError("wsclient.send timedout")),e.label=2;case 2:return[2]}}))}))}),e.timeout)),E.label=1;case 1:return E.trys.push([1,8,,9]),void 0===this.wsInitPromise&&null===this.wsInitPromise?[3,3]:[4,this.wsInitPromise];case 2:E.sent(),E.label=3;case 3:if(!this.ws)return l(new Error("invalid state: ws connection not exists, can not send message")),[2];if(1!==this.ws.readyState)return l(new Error("ws readyState invalid: ".concat(this.ws.readyState,", can not send message"))),[2];e.waitResponse&&(h={resolve:c,reject:l,skipOnMessage:e.skipOnMessage},this.wsResponseWait.set(e.msg.requestId,h)),E.label=4;case 4:return E.trys.push([4,6,,7]),[4,this.ws.send(JSON.stringify(e.msg))];case 5:return E.sent(),e.waitResponse||c(void 0),[3,7];case 6:return(p=E.sent())&&(l(p),e.waitResponse&&this.wsResponseWait.delete(e.msg.requestId)),[3,7];case 7:return[3,9];case 8:return f=E.sent(),l(f),[3,9];case 9:return[2]}}))}))}))]}))}))},this.closeAllClients=function(e){t.virtualWSClient.forEach((function(t){t.closeWithError(e)}))},this.pauseClients=function(e){(e||t.virtualWSClient).forEach((function(e){e.pause()}))},this.resumeClients=function(e){(e||t.virtualWSClient).forEach((function(e){e.resume()}))},this.initWebSocketConnection=function(e,r){return void 0===r&&(r=t.maxReconnect),o(t,void 0,Promise,(function(){var t=this;return i(this,(function(n){switch(n.label){case 0:if(e&&this.reconnectState)return[2];if(e&&(this.reconnectState=!0),void 0!==this.wsInitPromise&&null!==this.wsInitPromise)return[2,this.wsInitPromise];e&&this.pauseClients(),this.close(c.CloseEventCode.ReconnectWebSocket),this.wsInitPromise=new Promise((function(n,s){o(t,void 0,void 0,(function(){var t,o,a=this;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,6,,11]),[4,this.getWsSign()];case 1:return t=i.sent(),[4,new Promise((function(e){var r=t.wsUrl||"wss://tcb-ws.tencentcloudapi.com",n=(0,l.getWsClass)();a.ws=n?new n(r):new WebSocket(r),e(void 0)}))];case 2:return i.sent(),this.ws.connect?[4,this.ws.connect()]:[3,4];case 3:i.sent(),i.label=4;case 4:return[4,this.initWebSocketEvent()];case 5:return i.sent(),n(),e&&(this.resumeClients(),this.reconnectState=!1),[3,11];case 6:return o=i.sent(),console.error("[realtime] initWebSocketConnection connect fail",o),r>0?(this.wsInitPromise=void 0,[4,(0,d.sleep)(this.reconnectInterval)]):[3,9];case 7:i.sent(),e&&(this.reconnectState=!1),i.label=8;case 8:return n(this.initWebSocketConnection(e,r-1)),[3,10];case 9:s(o),e&&this.closeAllClients(new u.CloudSDKError({errCode:u.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_RECONNECT_WATCH_FAIL,errMsg:o})),i.label=10;case 10:return[3,11];case 11:return[2]}}))}))})),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,this.wsInitPromise];case 2:return n.sent(),this.wsReadySubsribers.forEach((function(e){return(0,e.resolve)()})),[3,5];case 3:return n.sent(),this.wsReadySubsribers.forEach((function(e){return(0,e.reject)()})),[3,5];case 4:return this.wsInitPromise=void 0,this.wsReadySubsribers=[],[7];case 5:return[2]}}))}))},this.initWebSocketEvent=function(){return new Promise((function(e,r){if(!t.ws)throw new Error("can not initWebSocketEvent, ws not exists");var n=!1;t.ws.onopen=function(t){console.warn("[realtime] ws event: open",t),n=!0,e()},t.ws.onerror=function(e){t.logins=new Map,n?(console.error("[realtime] ws event: error",e),t.clearHeartbeat(),t.virtualWSClient.forEach((function(t){return t.closeWithError(new u.CloudSDKError({errCode:u.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_ERROR,errMsg:e}))}))):(console.error("[realtime] ws open failed with ws event: error",e),r(e))},t.ws.onclose=function(e){switch(console.warn("[realtime] ws event: close",e),t.logins=new Map,t.clearHeartbeat(),e.code){case c.CloseEventCode.ReconnectWebSocket:case c.CloseEventCode.NoRealtimeListeners:break;case c.CloseEventCode.HeartbeatPingError:case c.CloseEventCode.HeartbeatPongTimeoutError:case c.CloseEventCode.NormalClosure:case c.CloseEventCode.AbnormalClosure:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients((0,c.getWSCloseError)(e.code));break;case c.CloseEventCode.NoAuthentication:t.closeAllClients((0,c.getWSCloseError)(e.code,e.reason));break;default:t.maxReconnect>0?t.initWebSocketConnection(!0,t.maxReconnect):t.closeAllClients((0,c.getWSCloseError)(e.code))}},t.ws.onmessage=function(e){var r,n,o=(null===(r=e.data)||void 0===r?void 0:r.data)||e.data;t.heartbeat();try{n="string"==typeof o?JSON.parse(o):o}catch(e){throw new Error("[realtime] onMessage parse res.data error: ".concat(e))}if("ERROR"===n.msgType){var i=null;t.virtualWSClient.forEach((function(e){e.watchId===n.watchId&&(i=e)})),i&&i.listener.onError(n)}var s=t.wsResponseWait.get(n.requestId);if(s){try{"ERROR"===n.msgType?s.reject(new u.RealtimeErrorMessageError(n)):s.resolve(n)}catch(e){console.error("ws onMessage responseWaitSpec.resolve(msg) errored:",e)}finally{t.wsResponseWait.delete(n.requestId)}if(s.skipOnMessage)return}if("PONG"!==n.msgType){var a=n.watchId&&t.watchIdClientMap.get(n.watchId);if(a)a.onMessage(n);else switch(console.error("[realtime] no realtime listener found responsible for watchId ".concat(n.watchId,": "),n),n.msgType){case"INIT_EVENT":case"NEXT_EVENT":case"CHECK_EVENT":(a=t.queryIdClientMap.get(n.msgData.queryID))&&a.onMessage(n);break;default:for(var c=0,l=Array.from(t.watchIdClientMap.entries());c<l.length;c++){l[c][1].onMessage(n);break}}}else if(t.lastPingSendTS){var d=Date.now()-t.lastPingSendTS;if(d>1e4)return void console.warn("[realtime] untrusted rtt observed: ".concat(d));t.rttObserved.length>=3&&t.rttObserved.splice(0,t.rttObserved.length-3+1),t.rttObserved.push(d)}},t.heartbeat()}))},this.isWSConnected=function(){return Boolean(t.ws&&1===t.ws.readyState)},this.onceWSConnected=function(){return o(t,void 0,Promise,(function(){var e=this;return i(this,(function(t){return this.isWSConnected()?[2]:null!==this.wsInitPromise&&void 0!==this.wsInitPromise?[2,this.wsInitPromise]:[2,new Promise((function(t,r){e.wsReadySubsribers.push({resolve:t,reject:r})}))]}))}))},this.webLogin=function(e,r){return o(t,void 0,Promise,(function(){var t,n,s,c,u,d,h,p,f=this;return i(this,(function(v){switch(v.label){case 0:if(!r)if(e){if(t=this.logins.get(e)){if(t.loggedIn&&t.loginResult)return[2,t.loginResult];if(null!==t.loggingInPromise&&void 0!==t.loggingInPromise)return[2,t.loggingInPromise]}}else if(null!==(null==(n=this.logins.get(""))?void 0:n.loggingInPromise)&&void 0!==(null==n?void 0:n.loggingInPromise))return[2,n.loggingInPromise];s=new Promise((function(e,t){o(f,void 0,void 0,(function(){var r,n,o,s,c;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.getWsSign()];case 1:return r=i.sent(),n={envId:r.envId||"",accessToken:"",referrer:"web",sdkVersion:"",dataVersion:""},o={watchId:void 0,requestId:(0,a.genRequestId)(),msgType:"LOGIN",msgData:n,exMsgData:{runtime:(0,l.getRuntime)(),signStr:r.signStr,secretVersion:r.secretVersion}},[4,this.send({msg:o,waitResponse:!0,skipOnMessage:!0,timeout:5e3})];case 2:return(s=i.sent()).msgData.code?t(new Error("".concat(s.msgData.code," ").concat(s.msgData.message))):e({envId:r.envId}),[3,4];case 3:return c=i.sent(),t(c),[3,4];case 4:return[2]}}))}))})),c=e&&this.logins.get(e),u=Date.now(),c?(c.loggedIn=!1,c.loggingInPromise=s,c.loginStartTS=u):(c={loggedIn:!1,loggingInPromise:s,loginStartTS:u},this.logins.set(e||"",c)),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,s];case 2:if(d=v.sent(),(h=e&&this.logins.get(e))&&h===c&&h.loginStartTS===u)return c.loggedIn=!0,c.loggingInPromise=void 0,c.loginStartTS=void 0,c.loginResult=d,[2,d];if(h){if(h.loggedIn&&h.loginResult)return[2,h.loginResult];if(null!==h.loggingInPromise&&void 0!==h.loggingInPromise)return[2,h.loggingInPromise];throw new Error("ws unexpected login info")}throw new Error("ws login info reset");case 3:throw p=v.sent(),c.loggedIn=!1,c.loggingInPromise=void 0,c.loginStartTS=void 0,c.loginResult=void 0,p;case 4:return[2]}}))}))},this.getWsSign=function(){return o(t,void 0,Promise,(function(){var e,t,r,n,o,s,a;return i(this,(function(i){switch(i.label){case 0:return this.wsSign&&this.wsSign.expiredTs>Date.now()?[2,this.wsSign]:(e=Date.now()+6e4,[4,this.context.appConfig.request.send("auth.wsWebSign",{runtime:(0,l.getRuntime)()})]);case 1:if((t=i.sent()).code)throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败: ".concat(t.code));if(t.data)return r=t.data,n=r.signStr,o=r.wsUrl,s=r.secretVersion,a=r.envId,[2,{signStr:n,wsUrl:o,secretVersion:s,envId:a,expiredTs:e}];throw new Error("[tcb-js-sdk] 获取实时数据推送登录票据失败")}}))}))},this.getWaitExpectedTimeoutLength=function(){return t.rttObserved.length?t.rttObserved.reduce((function(e,t){return e+t}))/t.rttObserved.length*1.5:5e3},this.ping=function(){return o(t,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return e={watchId:void 0,requestId:(0,a.genRequestId)(),msgType:"PING",msgData:null},[4,this.send({msg:e})];case 1:return t.sent(),[2]}}))}))},this.onWatchStart=function(e,r){t.queryIdClientMap.set(r,e)},this.onWatchClose=function(e,r){r&&t.queryIdClientMap.delete(r),t.watchIdClientMap.delete(e.watchId),t.virtualWSClient.delete(e),t.virtualWSClient.size||t.close(c.CloseEventCode.NoRealtimeListeners)},this.maxReconnect=e.maxReconnect||5,this.reconnectInterval=e.reconnectInterval||1e4,this.context=e.context}return e.prototype.clearHeartbeat=function(){this.pingTimeoutId&&clearTimeout(this.pingTimeoutId),this.pongTimeoutId&&clearTimeout(this.pongTimeoutId)},e.prototype.close=function(e){this.clearHeartbeat(),this.ws&&(this.ws.close(e,c.CLOSE_EVENT_CODE_INFO[e].name),this.ws=void 0)},e.prototype.watch=function(e){this.ws||void 0!==this.wsInitPromise&&null!==this.wsInitPromise||this.initWebSocketConnection(!1);var t=new s.VirtualWebSocketClient(n(n({},e),{send:this.send,login:this.webLogin,isWSConnected:this.isWSConnected,onceWSConnected:this.onceWSConnected,getWaitExpectedTimeoutLength:this.getWaitExpectedTimeoutLength,onWatchStart:this.onWatchStart,onWatchClose:this.onWatchClose,debug:!0}));return this.virtualWSClient.add(t),this.watchIdClientMap.set(t.watchId,t),t.listener},e.prototype.heartbeat=function(e){var t=this;this.clearHeartbeat(),this.pingTimeoutId=setTimeout((function(){o(t,void 0,void 0,(function(){var e=this;return i(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),this.ws&&1===this.ws.readyState?(this.lastPingSendTS=Date.now(),[4,this.ping()]):[2];case 1:return t.sent(),this.pingFailed=0,this.pongTimeoutId=setTimeout((function(){console.error("pong timed out"),e.pongMissed<2?(e.pongMissed+=1,e.heartbeat(!0)):e.initWebSocketConnection(!0)}),this.context.appConfig.realtimePongWaitTimeout),[3,3];case 2:return t.sent(),this.pingFailed<2?(this.pingFailed+=1,this.heartbeat()):this.close(c.CloseEventCode.HeartbeatPingError),[3,3];case 3:return[2]}}))}))}),e?0:this.context.appConfig.realtimePingInterval)},e}();t.RealtimeWebSocketClient=h},636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getWSCloseError=t.CloseEventCode=t.CLOSE_EVENT_CODE_INFO=void 0;var n,o=r(2917);t.CLOSE_EVENT_CODE_INFO={1e3:{code:1e3,name:"Normal Closure",description:"Normal closure; the connection successfully completed whatever purpose for which it was created."},1001:{code:1001,name:"Going Away",description:"The endpoint is going away, either because of a server failure or because the browser is navigating away from the page that opened the connection."},1002:{code:1002,name:"Protocol Error",description:"The endpoint is terminating the connection due to a protocol error."},1003:{code:1003,name:"Unsupported Data",description:"The connection is being terminated because the endpoint received data of a type it cannot accept (for example, a text-only endpoint received binary data)."},1005:{code:1005,name:"No Status Received",description:"Indicates that no status code was provided even though one was expected."},1006:{code:1006,name:"Abnormal Closure",description:"Used to indicate that a connection was closed abnormally (that is, with no close frame being sent) when a status code is expected."},1007:{code:1007,name:"Invalid frame payload data",description:"The endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-UTF-8 data within a text message)."},1008:{code:1008,name:"Policy Violation",description:"The endpoint is terminating the connection because it received a message that violates its policy. This is a generic status code, used when codes 1003 and 1009 are not suitable."},1009:{code:1009,name:"Message too big",description:"The endpoint is terminating the connection because a data frame was received that is too large."},1010:{code:1010,name:"Missing Extension",description:"The client is terminating the connection because it expected the server to negotiate one or more extension, but the server didn't."},1011:{code:1011,name:"Internal Error",description:"The server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request."},1012:{code:1012,name:"Service Restart",description:"The server is terminating the connection because it is restarting."},1013:{code:1013,name:"Try Again Later",description:"The server is terminating the connection due to a temporary condition, e.g. it is overloaded and is casting off some of its clients."},1014:{code:1014,name:"Bad Gateway",description:"The server was acting as a gateway or proxy and received an invalid response from the upstream server. This is similar to 502 HTTP Status Code."},1015:{code:1015,name:"TLS Handshake",description:"Indicates that the connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified)."},3e3:{code:3e3,name:"Reconnect WebSocket",description:"The client is terminating the connection because it wants to reconnect"},3001:{code:3001,name:"No Realtime Listeners",description:"The client is terminating the connection because no more realtime listeners exist"},3002:{code:3002,name:"Heartbeat Ping Error",description:"The client is terminating the connection due to its failure in sending heartbeat messages"},3003:{code:3003,name:"Heartbeat Pong Timeout Error",description:"The client is terminating the connection because no heartbeat response is received from the server"},3050:{code:3050,name:"Server Close",description:"The client is terminating the connection because no heartbeat response is received from the server"}},(n=t.CloseEventCode||(t.CloseEventCode={}))[n.NormalClosure=1e3]="NormalClosure",n[n.GoingAway=1001]="GoingAway",n[n.ProtocolError=1002]="ProtocolError",n[n.UnsupportedData=1003]="UnsupportedData",n[n.NoStatusReceived=1005]="NoStatusReceived",n[n.AbnormalClosure=1006]="AbnormalClosure",n[n.InvalidFramePayloadData=1007]="InvalidFramePayloadData",n[n.PolicyViolation=1008]="PolicyViolation",n[n.MessageTooBig=1009]="MessageTooBig",n[n.MissingExtension=1010]="MissingExtension",n[n.InternalError=1011]="InternalError",n[n.ServiceRestart=1012]="ServiceRestart",n[n.TryAgainLater=1013]="TryAgainLater",n[n.BadGateway=1014]="BadGateway",n[n.TLSHandshake=1015]="TLSHandshake",n[n.ReconnectWebSocket=3e3]="ReconnectWebSocket",n[n.NoRealtimeListeners=3001]="NoRealtimeListeners",n[n.HeartbeatPingError=3002]="HeartbeatPingError",n[n.HeartbeatPongTimeoutError=3003]="HeartbeatPongTimeoutError",n[n.NoAuthentication=3050]="NoAuthentication",t.getWSCloseError=function(e,r){var n=t.CLOSE_EVENT_CODE_INFO[e],i=n?"".concat(n.name,", code ").concat(e,", reason ").concat(r||n.description):"code ".concat(e);return new o.CloudSDKError({errCode:o.ERR_CODE.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,errMsg:i})}},9515:(e,t,r)=>{var n=r(8761)(r(7772),"DataView");e.exports=n},9612:(e,t,r)=>{var n=r(2118),o=r(6909),i=r(8138),s=r(4174),a=r(7942);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},235:(e,t,r)=>{var n=r(3945),o=r(1846),i=r(8028),s=r(2344),a=r(4769);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},326:(e,t,r)=>{var n=r(8761)(r(7772),"Map");e.exports=n},6738:(e,t,r)=>{var n=r(2411),o=r(6417),i=r(6928),s=r(9493),a=r(4150);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}c.prototype.clear=n,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},2760:(e,t,r)=>{var n=r(8761)(r(7772),"Promise");e.exports=n},2143:(e,t,r)=>{var n=r(8761)(r(7772),"Set");e.exports=n},6571:(e,t,r)=>{var n=r(235),o=r(5243),i=r(2858),s=r(4417),a=r(8605),c=r(1418);function u(e){var t=this.__data__=new n(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=i,u.prototype.get=s,u.prototype.has=a,u.prototype.set=c,e.exports=u},857:(e,t,r)=>{var n=r(7772).Symbol;e.exports=n},9162:(e,t,r)=>{var n=r(7772).Uint8Array;e.exports=n},3215:(e,t,r)=>{var n=r(8761)(r(7772),"WeakMap");e.exports=n},2517:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},7552:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,i=[];++r<n;){var s=e[r];t(s,r,e)&&(i[o++]=s)}return i}},1634:(e,t,r)=>{var n=r(6473),o=r(9631),i=r(6152),s=r(3226),a=r(9045),c=r(7598),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=i(e),l=!r&&o(e),d=!r&&!l&&s(e),h=!r&&!l&&!d&&c(e),p=r||l||d||h,f=p?n(e.length,String):[],v=f.length;for(var E in e)!t&&!u.call(e,E)||p&&("length"==E||d&&("offset"==E||"parent"==E)||h&&("buffer"==E||"byteLength"==E||"byteOffset"==E)||a(E,v))||f.push(E);return f}},343:e=>{e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}},5067:e=>{e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},91:(e,t,r)=>{var n=r(3940),o=r(1225),i=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var s=e[t];i.call(e,t)&&o(s,r)&&(void 0!==r||t in e)||n(e,t,r)}},2218:(e,t,r)=>{var n=r(1225);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},7993:(e,t,r)=>{var n=r(752),o=r(249);e.exports=function(e,t){return e&&n(t,o(t),e)}},5906:(e,t,r)=>{var n=r(752),o=r(8582);e.exports=function(e,t){return e&&n(t,o(t),e)}},3940:(e,t,r)=>{var n=r(3043);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},8874:(e,t,r)=>{var n=r(6571),o=r(2517),i=r(91),s=r(7993),a=r(5906),c=r(2175),u=r(1522),l=r(7680),d=r(9987),h=r(3483),p=r(6939),f=r(940),v=r(9917),E=r(8222),g=r(8725),_=r(6152),m=r(3226),I=r(4714),b=r(9259),y=r(3679),w=r(249),S=r(8582),T="[object Arguments]",C="[object Function]",R="[object Object]",A={};A[T]=A["[object Array]"]=A["[object ArrayBuffer]"]=A["[object DataView]"]=A["[object Boolean]"]=A["[object Date]"]=A["[object Float32Array]"]=A["[object Float64Array]"]=A["[object Int8Array]"]=A["[object Int16Array]"]=A["[object Int32Array]"]=A["[object Map]"]=A["[object Number]"]=A[R]=A["[object RegExp]"]=A["[object Set]"]=A["[object String]"]=A["[object Symbol]"]=A["[object Uint8Array]"]=A["[object Uint8ClampedArray]"]=A["[object Uint16Array]"]=A["[object Uint32Array]"]=!0,A["[object Error]"]=A[C]=A["[object WeakMap]"]=!1,e.exports=function e(t,r,D,x,O,N){var W,L=1&r,j=2&r,P=4&r;if(D&&(W=O?D(t,x,O,N):D(t)),void 0!==W)return W;if(!b(t))return t;var M=_(t);if(M){if(W=v(t),!L)return u(t,W)}else{var k=f(t),K=k==C||"[object GeneratorFunction]"==k;if(m(t))return c(t,L);if(k==R||k==T||K&&!O){if(W=j||K?{}:g(t),!L)return j?d(t,a(W,t)):l(t,s(W,t))}else{if(!A[k])return O?t:{};W=E(t,k,L)}}N||(N=new n);var q=N.get(t);if(q)return q;N.set(t,W),y(t)?t.forEach((function(n){W.add(e(n,r,D,n,t,N))})):I(t)&&t.forEach((function(n,o){W.set(o,e(n,r,D,o,t,N))}));var B=M?void 0:(P?j?p:h:j?S:w)(t);return o(B||t,(function(n,o){B&&(n=t[o=n]),i(W,o,e(n,r,D,o,t,N))})),W}},9413:(e,t,r)=>{var n=r(9259),o=Object.create,i=function(){function e(){}return function(t){if(!n(t))return{};if(o)return o(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=i},3324:(e,t,r)=>{var n=r(7297),o=r(3812);e.exports=function(e,t){for(var r=0,i=(t=n(t,e)).length;null!=e&&r<i;)e=e[o(t[r++])];return r&&r==i?e:void 0}},1897:(e,t,r)=>{var n=r(5067),o=r(6152);e.exports=function(e,t,r){var i=t(e);return o(e)?i:n(i,r(e))}},3366:(e,t,r)=>{var n=r(857),o=r(2107),i=r(7157),s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?o(e):i(e)}},5183:(e,t,r)=>{var n=r(3366),o=r(5125);e.exports=function(e){return o(e)&&"[object Arguments]"==n(e)}},4511:(e,t,r)=>{var n=r(940),o=r(5125);e.exports=function(e){return o(e)&&"[object Map]"==n(e)}},6840:(e,t,r)=>{var n=r(1049),o=r(7394),i=r(9259),s=r(7035),a=/^\[object .+?Constructor\]$/,c=Function.prototype,u=Object.prototype,l=c.toString,d=u.hasOwnProperty,h=RegExp("^"+l.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(n(e)?h:a).test(s(e))}},8436:(e,t,r)=>{var n=r(940),o=r(5125);e.exports=function(e){return o(e)&&"[object Set]"==n(e)}},5522:(e,t,r)=>{var n=r(3366),o=r(1158),i=r(5125),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!s[n(e)]}},6411:(e,t,r)=>{var n=r(6001),o=r(4248),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))i.call(e,r)&&"constructor"!=r&&t.push(r);return t}},8390:(e,t,r)=>{var n=r(9259),o=r(6001),i=r(2966),s=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=o(e),r=[];for(var a in e)("constructor"!=a||!t&&s.call(e,a))&&r.push(a);return r}},2857:(e,t,r)=>{var n=r(91),o=r(7297),i=r(9045),s=r(9259),a=r(3812);e.exports=function(e,t,r,c){if(!s(e))return e;for(var u=-1,l=(t=o(t,e)).length,d=l-1,h=e;null!=h&&++u<l;){var p=a(t[u]),f=r;if("__proto__"===p||"constructor"===p||"prototype"===p)return e;if(u!=d){var v=h[p];void 0===(f=c?c(v,p,h):void 0)&&(f=s(v)?v:i(t[u+1])?[]:{})}n(h,p,f),h=h[p]}return e}},9872:e=>{e.exports=function(e,t,r){var n=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(r=r>o?o:r)<0&&(r+=o),o=t>r?0:r-t>>>0,t>>>=0;for(var i=Array(o);++n<o;)i[n]=e[n+t];return i}},6473:e=>{e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},1054:(e,t,r)=>{var n=r(857),o=r(343),i=r(6152),s=r(4795),a=n?n.prototype:void 0,c=a?a.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(i(t))return o(t,e)+"";if(s(t))return c?c.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r}},7826:e=>{e.exports=function(e){return function(t){return e(t)}}},9078:(e,t,r)=>{var n=r(7297),o=r(6974),i=r(2721),s=r(3812);e.exports=function(e,t){return t=n(t,e),null==(e=i(e,t))||delete e[s(o(t))]}},7297:(e,t,r)=>{var n=r(6152),o=r(1401),i=r(4452),s=r(6188);e.exports=function(e,t){return n(e)?e:o(e,t)?[e]:i(s(e))}},9882:(e,t,r)=>{var n=r(9162);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},2175:(e,t,r)=>{e=r.nmd(e);var n=r(7772),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=a?a(r):new e.constructor(r);return e.copy(n),n}},4727:(e,t,r)=>{var n=r(9882);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},6058:e=>{var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},169:(e,t,r)=>{var n=r(857),o=n?n.prototype:void 0,i=o?o.valueOf:void 0;e.exports=function(e){return i?Object(i.call(e)):{}}},6190:(e,t,r)=>{var n=r(9882);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},1522:e=>{e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},752:(e,t,r)=>{var n=r(91),o=r(3940);e.exports=function(e,t,r,i){var s=!r;r||(r={});for(var a=-1,c=t.length;++a<c;){var u=t[a],l=i?i(r[u],e[u],u,r,e):void 0;void 0===l&&(l=e[u]),s?o(r,u,l):n(r,u,l)}return r}},7680:(e,t,r)=>{var n=r(752),o=r(633);e.exports=function(e,t){return n(e,o(e),t)}},9987:(e,t,r)=>{var n=r(752),o=r(2680);e.exports=function(e,t){return n(e,o(e),t)}},4019:(e,t,r)=>{var n=r(7772)["__core-js_shared__"];e.exports=n},3043:(e,t,r)=>{var n=r(8761),o=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=o},1242:(e,t,r)=>{var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},3483:(e,t,r)=>{var n=r(1897),o=r(633),i=r(249);e.exports=function(e){return n(e,i,o)}},6939:(e,t,r)=>{var n=r(1897),o=r(2680),i=r(8582);e.exports=function(e){return n(e,i,o)}},7937:(e,t,r)=>{var n=r(8304);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},8761:(e,t,r)=>{var n=r(6840),o=r(8109);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},7353:(e,t,r)=>{var n=r(241)(Object.getPrototypeOf,Object);e.exports=n},2107:(e,t,r)=>{var n=r(857),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=n?n.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),r=e[a];try{e[a]=void 0;var n=!0}catch(e){}var o=s.call(e);return n&&(t?e[a]=r:delete e[a]),o}},633:(e,t,r)=>{var n=r(7552),o=r(981),i=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),n(s(e),(function(t){return i.call(e,t)})))}:o;e.exports=a},2680:(e,t,r)=>{var n=r(5067),o=r(7353),i=r(633),s=r(981),a=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,i(e)),e=o(e);return t}:s;e.exports=a},940:(e,t,r)=>{var n=r(9515),o=r(326),i=r(2760),s=r(2143),a=r(3215),c=r(3366),u=r(7035),l="[object Map]",d="[object Promise]",h="[object Set]",p="[object WeakMap]",f="[object DataView]",v=u(n),E=u(o),g=u(i),_=u(s),m=u(a),I=c;(n&&I(new n(new ArrayBuffer(1)))!=f||o&&I(new o)!=l||i&&I(i.resolve())!=d||s&&I(new s)!=h||a&&I(new a)!=p)&&(I=function(e){var t=c(e),r="[object Object]"==t?e.constructor:void 0,n=r?u(r):"";if(n)switch(n){case v:return f;case E:return l;case g:return d;case _:return h;case m:return p}return t}),e.exports=I},8109:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},2118:(e,t,r)=>{var n=r(9191);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},6909:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},8138:(e,t,r)=>{var n=r(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return o.call(t,e)?t[e]:void 0}},4174:(e,t,r)=>{var n=r(9191),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},7942:(e,t,r)=>{var n=r(9191);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},9917:e=>{var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},8222:(e,t,r)=>{var n=r(9882),o=r(4727),i=r(6058),s=r(169),a=r(6190);e.exports=function(e,t,r){var c=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return o(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return a(e,r);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return i(e);case"[object Symbol]":return s(e)}}},8725:(e,t,r)=>{var n=r(9413),o=r(7353),i=r(6001);e.exports=function(e){return"function"!=typeof e.constructor||i(e)?{}:n(o(e))}},9045:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},1401:(e,t,r)=>{var n=r(6152),o=r(4795),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!o(e))||s.test(e)||!i.test(e)||null!=t&&e in Object(t)}},8304:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7394:(e,t,r)=>{var n,o=r(4019),i=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!i&&i in e}},6001:e=>{var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},3945:e=>{e.exports=function(){this.__data__=[],this.size=0}},1846:(e,t,r)=>{var n=r(2218),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():o.call(t,r,1),--this.size,0))}},8028:(e,t,r)=>{var n=r(2218);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},2344:(e,t,r)=>{var n=r(2218);e.exports=function(e){return n(this.__data__,e)>-1}},4769:(e,t,r)=>{var n=r(2218);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},2411:(e,t,r)=>{var n=r(9612),o=r(235),i=r(326);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(i||o),string:new n}}},6417:(e,t,r)=>{var n=r(7937);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},6928:(e,t,r)=>{var n=r(7937);e.exports=function(e){return n(this,e).get(e)}},9493:(e,t,r)=>{var n=r(7937);e.exports=function(e){return n(this,e).has(e)}},4150:(e,t,r)=>{var n=r(7937);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},7777:(e,t,r)=>{var n=r(733);e.exports=function(e){var t=n(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}},9191:(e,t,r)=>{var n=r(8761)(Object,"create");e.exports=n},4248:(e,t,r)=>{var n=r(241)(Object.keys,Object);e.exports=n},2966:e=>{e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},4146:(e,t,r)=>{e=r.nmd(e);var n=r(1242),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&n.process,a=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},7157:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},241:e=>{e.exports=function(e,t){return function(r){return e(t(r))}}},2721:(e,t,r)=>{var n=r(3324),o=r(9872);e.exports=function(e,t){return t.length<2?e:n(e,o(t,0,-1))}},7772:(e,t,r)=>{var n=r(1242),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();e.exports=i},5243:(e,t,r)=>{var n=r(235);e.exports=function(){this.__data__=new n,this.size=0}},2858:e=>{e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},4417:e=>{e.exports=function(e){return this.__data__.get(e)}},8605:e=>{e.exports=function(e){return this.__data__.has(e)}},1418:(e,t,r)=>{var n=r(235),o=r(326),i=r(6738);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var s=r.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++r.size,this;r=this.__data__=new i(s)}return r.set(e,t),this.size=r.size,this}},4452:(e,t,r)=>{var n=r(7777),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,s=n((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,r,n,o){t.push(n?o.replace(i,"$1"):r||e)})),t}));e.exports=s},3812:(e,t,r)=>{var n=r(4795);e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7035:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},9850:(e,t,r)=>{var n=r(8874);e.exports=function(e){return n(e,5)}},1225:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},9631:(e,t,r)=>{var n=r(5183),o=r(5125),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,c=n(function(){return arguments}())?n:function(e){return o(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},6152:e=>{var t=Array.isArray;e.exports=t},7878:(e,t,r)=>{var n=r(1049),o=r(1158);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},3226:(e,t,r)=>{e=r.nmd(e);var n=r(7772),o=r(6330),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,a=s&&s.exports===i?n.Buffer:void 0,c=(a?a.isBuffer:void 0)||o;e.exports=c},1049:(e,t,r)=>{var n=r(3366),o=r(9259);e.exports=function(e){if(!o(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1158:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},4714:(e,t,r)=>{var n=r(4511),o=r(7826),i=r(4146),s=i&&i.isMap,a=s?o(s):n;e.exports=a},9259:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},5125:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},3679:(e,t,r)=>{var n=r(8436),o=r(7826),i=r(4146),s=i&&i.isSet,a=s?o(s):n;e.exports=a},4795:(e,t,r)=>{var n=r(3366),o=r(5125);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==n(e)}},7598:(e,t,r)=>{var n=r(5522),o=r(7826),i=r(4146),s=i&&i.isTypedArray,a=s?o(s):n;e.exports=a},249:(e,t,r)=>{var n=r(1634),o=r(6411),i=r(7878);e.exports=function(e){return i(e)?n(e):o(e)}},8582:(e,t,r)=>{var n=r(1634),o=r(8390),i=r(7878);e.exports=function(e){return i(e)?n(e,!0):o(e)}},6974:e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},733:(e,t,r)=>{var n=r(6738);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var s=e.apply(this,n);return r.cache=i.set(o,s)||i,s};return r.cache=new(o.Cache||n),r}o.Cache=n,e.exports=o},6765:(e,t,r)=>{var n=r(2857);e.exports=function(e,t,r){return null==e?e:n(e,t,r)}},981:e=>{e.exports=function(){return[]}},6330:e=>{e.exports=function(){return!1}},6188:(e,t,r)=>{var n=r(1054);e.exports=function(e){return null==e?"":n(e)}},7195:(e,t,r)=>{var n=r(9078);e.exports=function(e,t){return null==e||n(e,t)}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(8037)})()));
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("cloudbase_storage",[],e):"object"==typeof exports?exports.cloudbase_storage=e():t.cloudbase_storage=e()}("undefined"!=typeof window?window:this,(()=>(()=>{"use strict";var t={272:(t,e,r)=>{r.r(e),r.d(e,{COMPONENT_NAME:()=>J,CloudbaseStorage:()=>K,SupabaseFileAPILikeStorage:()=>Q,registerStorage:()=>Z});var o,n,i=(o=function(t,e){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},o(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),s=function(t){function e(e){var r=t.call(this,e)||this;return r.__isStorageError=!0,r.name="StorageError",r}return i(e,t),e}(Error);function a(t){return"object"==typeof t&&null!==t&&"__isStorageError"in t}(function(t){function e(e,r,o){var n=t.call(this,e)||this;return n.name="StorageApiError",n.status=r,n.statusCode=o,n}i(e,t),e.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}})(s),i((function(t,e){var r=n.call(this,t)||this;return r.name="StorageUnknownError",r.originalError=e,r}),n=s);var c="@cloudbase/js-sdk";function u(){return c}var l,d={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"};!function(t){t.local="local",t.none="none",t.session="session"}(l||(l={}));function f(t){return"string"==typeof t}function p(t,e){console.warn("[".concat(u(),"][").concat(t,"]:").concat(e))}var h,y=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),m=function(){return m=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},m.apply(this,arguments)},g=function(t,e,r,o){return new(r||(r=Promise))((function(n,i){function s(t){try{c(o.next(t))}catch(t){i(t)}}function a(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((o=o.apply(t,e||[])).next())}))},v=function(t,e){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,o&&(n=2&a[0]?o.return:a[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,a[1])).done)return n;switch(o=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],o=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};!function(t){function e(e){var r=t.call(this)||this,o=e.timeout,n=e.timeoutMsg,i=e.restrictedMethods;return r.timeout=o||0,r.timeoutMsg=n||"请求超时",r.restrictedMethods=i||["get","post","upload","download"],r}y(e,t),e.prototype.get=function(t){return this.request(m(m({},t),{method:"get"}),this.restrictedMethods.includes("get"))},e.prototype.post=function(t){return this.request(m(m({},t),{method:"post"}),this.restrictedMethods.includes("post"))},e.prototype.put=function(t){return this.request(m(m({},t),{method:"put"}))},e.prototype.upload=function(t){var e=t.data,r=t.file,o=t.name,n=t.method,i=t.headers,s=void 0===i?{}:i,a={post:"post",put:"put"}[null==n?void 0:n.toLowerCase()]||"put",c=new FormData;return"post"===a?(Object.keys(e).forEach((function(t){c.append(t,e[t])})),c.append("key",o),c.append("file",r),this.request(m(m({},t),{data:c,method:a}),this.restrictedMethods.includes("upload"))):this.request(m(m({},t),{method:"put",headers:s,body:r}),this.restrictedMethods.includes("upload"))},e.prototype.download=function(t){return g(this,void 0,void 0,(function(){var e,r,o,n;return v(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.get(m(m({},t),{headers:{},responseType:"blob"}))];case 1:return e=i.sent().data,r=window.URL.createObjectURL(new Blob([e])),o=decodeURIComponent(new URL(t.url).pathname.split("/").pop()||""),(n=document.createElement("a")).href=r,n.setAttribute("download",o),n.style.display="none",document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(r),document.body.removeChild(n),[3,3];case 2:return i.sent(),[3,3];case 3:return[2,new Promise((function(e){e({statusCode:200,tempFilePath:t.url})}))]}}))}))},e.prototype.fetch=function(t){var e;return g(this,void 0,void 0,(function(){var r,o,n,i,s,a,c,u,l,d,f,p,h,y=this;return v(this,(function(w){switch(w.label){case 0:return r=new AbortController,o=t.url,n=t.enableAbort,i=void 0!==n&&n,s=t.stream,a=void 0!==s&&s,c=t.signal,u=t.timeout,l=t.shouldThrowOnError,d=void 0===l||l,f=null!=u?u:this.timeout,c&&(c.aborted&&r.abort(),c.addEventListener("abort",(function(){return r.abort()}))),p=null,i&&f&&(p=setTimeout((function(){console.warn(y.timeoutMsg),r.abort(new Error(y.timeoutMsg))}),f)),[4,fetch(o,m(m({},t),{signal:r.signal})).then((function(t){return g(y,void 0,void 0,(function(){var e,r,o;return v(this,(function(n){switch(n.label){case 0:return clearTimeout(p),d?t.ok?(e=t,[3,3]):[3,1]:[3,4];case 1:return o=(r=Promise).reject,[4,t.json()];case 2:e=o.apply(r,[n.sent()]),n.label=3;case 3:return[2,e];case 4:return[2,t]}}))}))})).catch((function(t){if(clearTimeout(p),d)return Promise.reject(t)}))];case 1:return h=w.sent(),[2,{data:a?h.body:(null===(e=h.headers.get("content-type"))||void 0===e?void 0:e.includes("application/json"))?h.json():h.text(),statusCode:h.status,header:h.headers}]}}))}))},e.prototype.request=function(t,e){var r=this;void 0===e&&(e=!1);var o=String(t.method).toLowerCase()||"get";return new Promise((function(n){var i,s,a,c=t.url,u=t.headers,l=void 0===u?{}:u,d=t.data,f=t.responseType,p=t.withCredentials,h=t.body,y=t.onUploadProgress,m=function(t,e,r){void 0===r&&(r={});var o=/\?/.test(e),n="";return Object.keys(r).forEach((function(t){""===n?!o&&(e+="?"):n+="&",n+="".concat(t,"=").concat(encodeURIComponent(r[t]))})),/^http(s)?:\/\//.test(e+=n)?e:"".concat(t).concat(e)}("https:",c,"get"===o?d:{}),g=new XMLHttpRequest;g.open(o,m),f&&(g.responseType=f),Object.keys(l).forEach((function(t){g.setRequestHeader(t,l[t])})),y&&g.upload.addEventListener("progress",y),g.onreadystatechange=function(){var t={};if(4===g.readyState){var e=g.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};e.forEach((function(t){var e=t.split(": "),o=e.shift().toLowerCase(),n=e.join(": ");r[o]=n})),t.header=r,t.statusCode=g.status;try{t.data="blob"===f?g.response:JSON.parse(g.responseText)}catch(e){t.data="blob"===f?g.response:g.responseText}clearTimeout(i),n(t)}},e&&r.timeout&&(i=setTimeout((function(){console.warn(r.timeoutMsg),g.abort()}),r.timeout)),a=d,s="[object FormData]"===Object.prototype.toString.call(a)?d:"application/x-www-form-urlencoded"===l["content-type"]?function(t){void 0===t&&(t={});var e=[];return Object.keys(t).forEach((function(r){e.push("".concat(r,"=").concat(encodeURIComponent(t[r])))})),e.join("&")}(d):h||(d?JSON.stringify(d):void 0),p&&(g.withCredentials=!0),g.send(s)}))}}((function(){})),function(t){t.WEB="web",t.WX_MP="wx_mp"}(h||(h={}));var w=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),b=function(t,e,r,o){return new(r||(r=Promise))((function(n,i){function s(t){try{c(o.next(t))}catch(t){i(t)}}function a(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((o=o.apply(t,e||[])).next())}))},I=function(t,e){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,o&&(n=2&a[0]?o.return:a[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,a[1])).done)return n;switch(o=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],o=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}},O=function(t){function e(e){var r=t.call(this)||this;return r.root=e,e.tcbCacheObject||(e.tcbCacheObject={}),r}return w(e,t),e.prototype.setItem=function(t,e){this.root.tcbCacheObject[t]=e},e.prototype.getItem=function(t){return this.root.tcbCacheObject[t]},e.prototype.removeItem=function(t){delete this.root.tcbCacheObject[t]},e.prototype.clear=function(){delete this.root.tcbCacheObject},e}((function(){}));!function(){function t(t){this.keys={};var e=t.persistence,r=t.platformInfo,o=void 0===r?{}:r,n=t.keys,i=void 0===n?{}:n;this.platformInfo=o,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||e,this.storage=function(t,e){switch(t){case"local":default:return e.localStorage?e.localStorage:(p(d.INVALID_PARAMS,"localStorage is not supported on current platform"),new O(e.root));case"none":return new O(e.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=i)}Object.defineProperty(t.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),t.prototype.setStore=function(t,e,r){if("async"!==this.mode){if(this.storage)try{var o={version:r||"localCachev1",content:e};this.storage.setItem(t,JSON.stringify(o))}catch(t){throw new Error(JSON.stringify({code:d.OPERATION_FAIL,msg:"[".concat(u(),"][").concat(d.OPERATION_FAIL,"]setStore failed"),info:t}))}}else p(d.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},t.prototype.setStoreAsync=function(t,e,r){return b(this,void 0,void 0,(function(){var o;return I(this,(function(n){switch(n.label){case 0:if(!this.storage)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),o={version:r||"localCachev1",content:e},[4,this.storage.setItem(t,JSON.stringify(o))];case 2:return n.sent(),[3,4];case 3:return n.sent(),[2];case 4:return[2]}}))}))},t.prototype.getStore=function(t,e){var r;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(t){return""}e=e||"localCachev1";var o=this.storage.getItem(t);return o&&o.indexOf(e)>=0?JSON.parse(o).content:""}p(d.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},t.prototype.getStoreAsync=function(t,e){var r;return b(this,void 0,void 0,(function(){var o;return I(this,(function(n){switch(n.label){case 0:try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return[2,{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(t){return[2,""]}return e=e||"localCachev1",[4,this.storage.getItem(t)];case 1:return(o=n.sent())&&o.indexOf(e)>=0?[2,JSON.parse(o).content]:[2,""]}}))}))},t.prototype.removeStore=function(t){"async"!==this.mode?this.storage.removeItem(t):p(d.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},t.prototype.removeStoreAsync=function(t){return b(this,void 0,void 0,(function(){return I(this,(function(e){switch(e.label){case 0:return[4,this.storage.removeItem(t)];case 1:return e.sent(),[2]}}))}))}}();var _=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),S=function(t,e){this.data=e||null,this.name=t},L=function(t){function e(e,r){var o=t.call(this,"error",{error:e,data:r})||this;return o.error=e,o}return _(e,t),e}(S),F=function(){function t(){this.listeners={}}return t.prototype.on=function(t,e){return function(t,e,r){r[t]=r[t]||[],r[t].push(e)}(t,e,this.listeners),this},t.prototype.off=function(t,e){return function(t,e,r){if(null==r?void 0:r[t]){var o=r[t].indexOf(e);-1!==o&&r[t].splice(o,1)}}(t,e,this.listeners),this},t.prototype.fire=function(t,e){if(t instanceof L)return console.error(t.error),this;var r=f(t)?new S(t,e||{}):t,o=r.name;if(this.listens(o)){r.target=this;for(var n=0,i=this.listeners[o]?function(t,e,r){if(r||2===arguments.length)for(var o,n=0,i=e.length;n<i;n++)!o&&n in e||(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}([],this.listeners[o],!0):[];n<i.length;n++)i[n].call(this,r)}return this},t.prototype.listens=function(t){return this.listeners[t]&&this.listeners[t].length>0},t}();function P(t){this.message=t}function R(t){this.message=t}new F,new F,"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox"),P.prototype=new Error,P.prototype.name="InvalidCharacterError","undefined"!=typeof window&&window.atob&&window.atob.bind(window),R.prototype=new Error,R.prototype.name="InvalidTokenError";var A,E=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}}(),C=function(){return C=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},C.apply(this,arguments)},U=function(t,e,r,o){var n,i=arguments.length,s=i<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,o);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,r,s):n(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},j=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},N=function(t,e,r,o){return new(r||(r=Promise))((function(n,i){function s(t){try{c(o.next(t))}catch(t){i(t)}}function a(t){try{c(o.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}c((o=o.apply(t,e||[])).next())}))},T=function(t,e){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,o&&(n=2&a[0]?o.return:a[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,a[1])).done)return n;switch(o=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,o=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(t){a=[6,t],o=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}};!function(t){t.put="put",t.post="post"}(A||(A={}));var D=u,x=d,M="https://support.qq.com/products/148793",k=function(t){return"[object Array]"===Object.prototype.toString.call(t)},q=f,W=function(t,e,r){if(void 0===r&&(r=null),t&&"function"==typeof t)return t(e,r);if(e)throw e;return r},B=function(t){return t.mode,t.customInfo,t.title,t.messages,function(t,e,r){}},J="storage",V=function(t,e,r){return N(void 0,void 0,void 0,(function(){var o,n,i;return T(this,(function(s){switch(s.label){case 0:return[4,t.gateWay({path:"storages",name:"get-objects-upload-info",data:[C({objectId:e.path},e.headers?{signedHeader:Object.keys(e.headers).reduce((function(t,r){var o;return C(C({},t),((o={})[r]=[e.headers[r]],o))}),{})}:{})]},r)];case 1:return o=s.sent(),n=(null===(i=o.data)||void 0===i?void 0:i[0])||{},[2,o=C(C({},o),{data:C(C({},n.code?C({},n):{}),{authorization:n.authorization,token:n.token,url:n.uploadUrl,fileId:n.cloudObjectId,cosFileId:n.cloudObjectMeta,download_url:n.downloadUrl})})]}}))}))},z=function(t,e,r){return N(void 0,void 0,void 0,(function(){var o,n;return T(this,(function(i){switch(i.label){case 0:return[4,t.gateWay({path:"storages",name:"get-objects-download-info",data:e.convertedFileList.map((function(t){return{cloudObjectId:t.fileid}}))},r)];case 1:return o=i.sent(),[2,o=C(C({},o),{data:{download_list:null===(n=o.data)||void 0===n?void 0:n.map((function(t){return{code:t.code||"SUCCESS",message:t.message,fileid:t.cloudObjectId,download_url:t.downloadUrl,fileID:t.cloudObjectId,tempFileURL:t.downloadUrl}}))}})]}}))}))},G=function(t,e,r){return N(void 0,void 0,void 0,(function(){var o,n;return T(this,(function(i){switch(i.label){case 0:return[4,t.gateWay({path:"storages",name:"delete-objects",data:e.fileList.map((function(t){return{cloudObjectId:t}}))},r)];case 1:return o=i.sent(),[2,o=C(C({},o),{data:{delete_list:null===(n=o.data)||void 0===n?void 0:n.map((function(t){return{code:t.code||"SUCCESS",fileID:t.cloudObjectId,message:t.message}}))}})]}}))}))},H=function(t,e,r){return N(void 0,void 0,void 0,(function(){var o,n;return T(this,(function(i){switch(i.label){case 0:return[4,t.gateWay({path:"storages",name:"copy-objects",data:e.convertedFileList.map((function(t){return{srcPath:t.src_path,dstPath:t.dst_path,overwrite:t.overwrite,removeOriginal:t.remove_original}}))},r)];case 1:return o=i.sent(),[2,o=C(C({},o),{data:{copy_list:null===(n=o.data)||void 0===n?void 0:n.map((function(t){return{code:t.code||"SUCCESS",fileID:t.cloudObjectId,message:t.message}}))}})]}}))}))},K=function(){function t(){}return t.prototype.isGateWay=function(){return"GATEWAY"===(this.config.endPointMode||"CLOUD_API")},t.prototype.uploadFile=function(t,e){return N(this,void 0,void 0,(function(){var r,o,n,i,s,a,c,u,l,d,f,p,h,y,m,g,v,w,b,I,O,_,S,L;return T(this,(function(F){switch(F.label){case 0:if(r=t.cloudPath,o=t.filePath,n=t.onUploadProgress,_=t.method,i=void 0===_?"put":_,S=t.headers,s=void 0===S?{}:S,a=t.fileContent,!q(r)||!o&&!a)throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".uploadFile] invalid params")}));return c={put:A.put,post:A.post}[i.toLocaleLowerCase()]||A.put,[4,this.getUploadMetadata({cloudPath:r,method:c,headers:c===A.put?s:void 0,customReqOpts:t.customReqOpts})];case 1:return u=F.sent(),l=u.data,d=u.requestId,f=l.url,p=l.authorization,h=l.token,y=l.fileId,m=l.cosFileId,g=l.download_url,w=C(C({},v={url:f,file:o,name:r,onUploadProgress:n,fileContent:a,fileId:y,requestId:d}),{method:A.put,headers:C(C({},s),{authorization:p,"x-cos-meta-fileid":m,"x-cos-security-token":h})}),b=C(C({},v),{method:A.post,data:{key:r,signature:p,"x-cos-meta-fileid":m,success_action_status:"201","x-cos-security-token":h}}),(L={})[A.put]={params:w,isSuccess:function(t){return t>=200&&t<300}},L[A.post]={params:b,isSuccess:function(t){return 201===t}},I=L,[4,this.request.upload(I[c].params)];case 2:return O=F.sent(),I[c].isSuccess(O.statusCode)?[2,W(e,null,{fileID:y,download_url:g,requestId:d})]:[2,W(e,new Error("[".concat(D(),"][").concat(x.OPERATION_FAIL,"][").concat(J,"]:").concat(O.data)))]}}))}))},t.prototype.getUploadMetadata=function(t,e){return N(this,void 0,void 0,(function(){var r,o,n,i,s,a,c,u;return T(this,(function(l){switch(l.label){case 0:if(r=t.cloudPath,o=t.method,n=t.headers,!q(r))throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".getUploadMetadata] invalid cloudPath")}));i=this.request,s="storage.getUploadMetadata",l.label=1;case 1:return l.trys.push([1,6,,7]),a=void 0,c={path:r},o&&(c.method=o),o===A.put&&n&&(c.headers=n),this.isGateWay()?[4,V(i,c,t.customReqOpts)]:[3,3];case 2:return a=l.sent(),[3,5];case 3:return[4,i.send(s,c,t.customReqOpts)];case 4:a=l.sent(),l.label=5;case 5:return[2,W(e,null,a)];case 6:return u=l.sent(),[2,W(e,u)];case 7:return[2]}}))}))},t.prototype.deleteFile=function(t,e){return N(this,void 0,void 0,(function(){var r,o,n,i,s,a,c,u;return T(this,(function(l){switch(l.label){case 0:if(!(r=t.fileList)||!k(r)||0===r.length)throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".deleteFile] fileList must not be empty")}));for(o=0,n=r;o<n.length;o++)if(!(i=n[o])||!q(i))throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".deleteFile] fileID must be string")}));return s="storage.batchDeleteFile",a=this.request,c={},this.isGateWay()?[4,G(a,{fileList:r},t.customReqOpts)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,a.send(s,{fileid_list:r},t.customReqOpts)];case 3:c=l.sent(),l.label=4;case 4:return c.code?[2,W(e,null,c)]:(u={fileList:c.data.delete_list,requestId:c.requestId},[2,W(e,null,u)])}}))}))},t.prototype.getTempFileURL=function(t,e){return N(this,void 0,void 0,(function(){var r,o,n,i,s,a,c,u;return T(this,(function(l){switch(l.label){case 0:if(!(r=t.fileList)||!k(r)||0===r.length)throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".getTempFileURL] fileList must not be empty")}));for(o=[],n=0,i=r;n<i.length;n++)if(s=i[n],d=s,"[object Object]"===Object.prototype.toString.call(d)){if(!Object.prototype.hasOwnProperty.call(s,"fileID"))throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".getTempFileURL] file info must include fileID")}));o.push({fileid:s.fileID,max_age:s.maxAge||7200})}else{if(!q(s))throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".getTempFileURL] invalid fileList")}));o.push({fileid:s})}return a="storage.batchGetDownloadUrl",c=this.request,u={},this.isGateWay()?[4,z(c,{convertedFileList:o},t.customReqOpts)]:[3,2];case 1:return u=l.sent(),[3,4];case 2:return[4,c.send(a,{file_list:o},t.customReqOpts)];case 3:u=l.sent(),l.label=4;case 4:return u.code?[2,W(e,null,u)]:[2,W(e,null,{fileList:u.data.download_list,requestId:u.requestId})]}var d}))}))},t.prototype.downloadFile=function(t,e){return N(this,void 0,void 0,(function(){var r,o,n,i,s,a;return T(this,(function(c){switch(c.label){case 0:if(r=t.fileID,!q(r))throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".getTempFileURL] fileID must be string")}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:r,maxAge:600}],customReqOpts:t.customReqOpts})];case 1:return o=c.sent(),"SUCCESS"!==(n=o.fileList[0]).code?[2,W(e,n)]:(i=this.request,s=encodeURI(n.download_url),[4,i.download({url:s,tempFilePath:t.tempFilePath})]);case 2:return a=c.sent(),[2,W(e,null,a)]}}))}))},t.prototype.copyFile=function(t,e){return N(this,void 0,void 0,(function(){var r,o,n,i,s,a,c,u,l;return T(this,(function(d){switch(d.label){case 0:if(!(r=t.fileList)||!k(r)||0===r.length)throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".copyFile] fileList must not be empty")}));for(o=[],n=0,i=r;n<i.length;n++){if(s=i[n],a=s.srcPath,c=s.dstPath,!a||!c||"string"!=typeof a||"string"!=typeof c)throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".copyFile] srcPath and dstPath may not be empty")}));if(a===c)throw new Error(JSON.stringify({code:x.INVALID_PARAMS,msg:"[".concat(J,".copyFile] srcPath and dstPath can not be the same")}));o.push({src_path:a,dst_path:c,overwrite:s.overwrite,remove_original:s.removeOriginal})}return u=this.request,l={},this.isGateWay()?[4,H(u,{convertedFileList:o},t.customReqOpts)]:[3,2];case 1:return l=d.sent(),[3,4];case 2:return[4,u.send("storage.batchCopyFile",{file_list:o},t.customReqOpts)];case 3:l=d.sent(),d.label=4;case 4:return l.code?[2,W(e,null,l)]:[2,W(e,null,{fileList:l.data.copy_list,requestId:l.requestId})]}}))}))},t.prototype.getFileInfo=function(t){var e;return N(this,void 0,void 0,(function(){var r,o=this;return T(this,(function(n){switch(n.label){case 0:return[4,this.getTempFileURL(t)];case 1:return(null==(r=n.sent())?void 0:r.fileList)&&(null===(e=null==r?void 0:r.fileList)||void 0===e?void 0:e.length)>0?[4,Promise.all(r.fileList.map((function(t){return N(o,void 0,void 0,(function(){var e,r,o,n,i;return T(this,(function(s){switch(s.label){case 0:if("SUCCESS"!==t.code)return[2,{code:t.code,fileID:t.fileID,tempFileURL:t.tempFileURL,message:t.message}];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.request.fetch({url:t.tempFileURL,method:"HEAD"})];case 2:return e=s.sent(),r=e.header,Headers&&r instanceof Headers&&(r=Object.fromEntries(e.header.entries())),o=parseInt(r["content-length"])||0,n=r["content-type"]||"",[400,404].includes(Number(e.statusCode))?[2,{code:"FILE_NOT_FOUND",fileID:t.fileID,tempFileURL:t.tempFileURL,message:"file not found"}]:[2,{code:t.code,fileID:t.fileID,tempFileURL:t.tempFileURL,cloudId:t.fileID,fileName:t.fileID.split("/").pop(),contentType:n,mime:n.split(";")[0].trim(),size:o,etag:r.etag||"",lastModified:r["last-modified"]||"",cacheControl:r["cache-control"]||""}];case 3:return i=s.sent(),[2,{code:"FETCH_FILE_INFO_ERROR",fileID:t.fileID,tempFileURL:t.tempFileURL,message:i.message}];case 4:return[2]}}))}))})))]:[3,3];case 2:return[2,{fileList:n.sent(),requestId:r.requestId}];case 3:return[2,{fileList:[],requestId:r.requestId}]}}))}))},U([B({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(M)]}),j("design:type",Function),j("design:paramtypes",[Object,Function]),j("design:returntype",Promise)],t.prototype,"uploadFile",null),U([B({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(M)]}),j("design:type",Function),j("design:paramtypes",[Object,Function]),j("design:returntype",Promise)],t.prototype,"getUploadMetadata",null),U([B({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(M)]}),j("design:type",Function),j("design:paramtypes",[Object,Function]),j("design:returntype",Promise)],t.prototype,"deleteFile",null),U([B({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(M)]}),j("design:type",Function),j("design:paramtypes",[Object,Function]),j("design:returntype",Promise)],t.prototype,"getTempFileURL",null),U([B({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(M)]}),j("design:type",Function),j("design:paramtypes",[Object,Function]),j("design:returntype",Promise)],t.prototype,"downloadFile",null),U([B({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(M)]}),j("design:type",Function),j("design:paramtypes",[Object,Function]),j("design:returntype",Promise)],t.prototype,"copyFile",null),t}(),X=new K,Y={name:J,entity:{uploadFile:X.uploadFile,deleteFile:X.deleteFile,getTempFileURL:X.getTempFileURL,downloadFile:X.downloadFile,getUploadMetadata:X.getUploadMetadata,copyFile:X.copyFile,getFileInfo:X.getFileInfo,isGateWay:X.isGateWay}},Q=function(t){function e(e){var r=t.call(this)||this;return r.shouldThrowOnError=!1,r.bucketId="",r.context=e,r}return E(e,t),Object.defineProperty(e.prototype,"config",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){var t;return null===(t=this.context)||void 0===t?void 0:t.request},enumerable:!1,configurable:!0}),e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.from=function(t){return this.bucketId=t||"",this},e.prototype.upload=function(t,e,r){return N(this,void 0,void 0,(function(){var o,n,i,s,c,u,l,d,f;return T(this,(function(p){switch(p.label){case 0:o=C({upsert:!0},r),n=o.cacheControl,i=o.contentType,s=o.metadata,p.label=1;case 1:return p.trys.push([1,3,,4]),c=this._getCloudPath(t),u={cloudPath:c,filePath:e},(n||i||s)&&(l={},n&&(l["cache-control"]=n),i&&(l["content-type"]=i),s&&(l["x-cos-metadata-metadata"]=this.toBase64(JSON.stringify(s))),u.headers=l),[4,this.uploadFile(u)];case 2:if(!(d=p.sent()).fileID)throw new Error(JSON.stringify({code:x.OPERATION_FAIL,msg:"[".concat(J,".update] no fileID returned")}));return[2,{data:{id:d.fileID,path:t,fullPath:t},error:null}];case 3:if(f=p.sent(),this.shouldThrowOnError)throw f;if(a(f))return[2,{data:null,error:f}];throw f;case 4:return[2]}}))}))},e.prototype.uploadToSignedUrl=function(t,e,r,o){return N(this,void 0,void 0,(function(){return T(this,(function(e){return[2,this.upload(t,r,o)]}))}))},e.prototype.createSignedUploadUrl=function(t){return N(this,void 0,void 0,(function(){var e,r,o;return T(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=this._getCloudPath(t),[4,this.getUploadMetadata({cloudPath:e})];case 1:return[2,{data:{signedUrl:(r=n.sent().data).url,token:r.token,path:t,authorization:r.authorization,id:r.fileId,cosFileId:r.cosFileId,downloadUrl:r.download_url},error:null}];case 2:if(o=n.sent(),this.shouldThrowOnError)throw o;return[2,{data:null,error:o instanceof s?o:new s(o.message)}];case 3:return[2]}}))}))},e.prototype.update=function(t,e,r){return N(this,void 0,void 0,(function(){return T(this,(function(o){return[2,this.upload(t,e,C(C({},r),{upsert:!0}))]}))}))},e.prototype.move=function(t,e){return N(this,void 0,void 0,(function(){var r,o;return T(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.copyFile({fileList:[{srcPath:this._getCloudPath(t),dstPath:this._getCloudPath(e),overwrite:!0,removeOriginal:!0}]})];case 1:if((r=n.sent()).fileList[0].code&&"SUCCESS"!==r.fileList[0].code)throw new s(r.fileList[0].message||"Move failed");return[2,{data:{message:"File moved from ".concat(t," to ").concat(e)},error:null}];case 2:if(o=n.sent(),this.shouldThrowOnError)throw o;if(a(o))return[2,{data:null,error:o}];throw o;case 3:return[2]}}))}))},e.prototype.copy=function(t,e){return N(this,void 0,void 0,(function(){var r,o;return T(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.copyFile({fileList:[{srcPath:this._getCloudPath(t),dstPath:this._getCloudPath(e),overwrite:!0,removeOriginal:!1}]})];case 1:if((r=n.sent()).fileList[0].code&&"SUCCESS"!==r.fileList[0].code)throw new s(r.fileList[0].message||"Copy failed");return[2,{data:{path:this._getCloudPath(e)},error:null}];case 2:if(o=n.sent(),this.shouldThrowOnError)throw o;if(a(o))return[2,{data:null,error:o}];throw o;case 3:return[2]}}))}))},e.prototype.createSignedUrl=function(t,e,r){return N(this,void 0,void 0,(function(){var o,n,i,c,u,l,d;return T(this,(function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),o=this._normalizeCloudId(t),[4,this.getTempFileURL({fileList:[{fileID:o,maxAge:e}]})];case 1:if("SUCCESS"!==(n=f.sent()).fileList[0].code)throw new s("Failed to create signed URL: [".concat(n.fileList[0].code,"] ").concat(n.fileList[0].fileID));return i=n.fileList[0].download_url,c=[],void 0!==(null==r?void 0:r.download)&&("string"==typeof r.download?c.push("download=".concat(encodeURIComponent(r.download))):!0===r.download&&c.push("download=true")),(null==r?void 0:r.transform)&&(u=this._transformOptsToQueryString(r.transform))&&c.push(u),c.length>0&&(l=i.includes("?")?"&":"?",i="".concat(i).concat(l).concat(c.join("&"))),[2,{data:{signedUrl:i},error:null}];case 2:if(d=f.sent(),this.shouldThrowOnError)throw d;if(a(d))return[2,{data:null,error:d}];throw d;case 3:return[2]}}))}))},e.prototype.createSignedUrls=function(t,e){return N(this,void 0,void 0,(function(){var r,o,n=this;return T(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=t.map((function(t){return{fileID:n._normalizeCloudId(t),maxAge:e}})),[4,this.getTempFileURL({fileList:r})];case 1:return[2,{data:i.sent().fileList.map((function(e,r){return{path:t[r],signedUrl:e.tempFileURL||"",error:"SUCCESS"===e.code?null:e.message}})),error:null}];case 2:if(o=i.sent(),this.shouldThrowOnError)throw o;if(a(o))return[2,{data:null,error:o}];throw o;case 3:return[2]}}))}))},e.prototype.download=function(t,e){return N(this,void 0,void 0,(function(){var r,o,n=this;return T(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),o={},[4,N(n,void 0,void 0,(function(){var r,o,n,i;return T(this,(function(a){switch(a.label){case 0:return[4,this.createSignedUrl(t,600,{transform:e})];case 1:if((r=a.sent()).error)throw r.error;return o=encodeURI(null===(i=r.data)||void 0===i?void 0:i.signedUrl),[4,this.request.reqClass.get({url:o,headers:{},responseType:"blob"})];case 2:if(!(n=a.sent().data))throw new s("Download failed: no file content");return[2,new Blob([n])]}}))}))];case 1:return[2,(o.data=i.sent(),o.error=null,o)];case 2:if(r=i.sent(),this.shouldThrowOnError)throw r;if(a(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},e.prototype.info=function(t){return N(this,void 0,void 0,(function(){var e,r,o,n,i,a,c,u;return T(this,(function(l){switch(l.label){case 0:return l.trys.push([0,2,,3]),e=t.startsWith("cloud://"),r=e?this._extractPathFromFileId(t):t,o=e?this._extractBucketFromFileId(t):this.bucketId,[4,this.getFileInfo({fileList:[this._normalizeCloudId(t)]})];case 1:if(n=l.sent(),"SUCCESS"!==(i=n.fileList[0]).code)throw new s(i.message);return a=(new Date).toISOString(),c=(i.lastModified?new Date(i.lastModified):new Date).toISOString(),[2,{data:{id:i.fileID,version:"1",name:r,bucketId:o,updatedAt:c,createdAt:c,lastAccessedAt:a,size:i.size,cacheControl:i.cacheControl,contentType:i.contentType,etag:i.etag,lastModified:c,metadata:{}},error:null}];case 2:if(u=l.sent(),this.shouldThrowOnError)throw u;return[2,{data:null,error:u instanceof s?u:new s(u.message)}];case 3:return[2]}}))}))},e.prototype.exists=function(t){return N(this,void 0,void 0,(function(){var e,r,o;return T(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getFileInfo({fileList:[this._normalizeCloudId(t)]})];case 1:if(e=n.sent(),"FILE_NOT_FOUND"===(r=e.fileList[0]).code)return[2,{data:!1,error:null}];if("SUCCESS"!==r.code)throw new s(r.message);return[2,{data:!0,error:null}];case 2:if(o=n.sent(),this.shouldThrowOnError)throw o;if(a(o))return[2,{data:null,error:o}];throw o;case 3:return[2]}}))}))},e.prototype.getPublicUrl=function(t,e){return N(this,void 0,void 0,(function(){var r;return T(this,(function(o){switch(o.label){case 0:return[4,this.createSignedUrl(t,600,e)];case 1:return(r=o.sent()).data?[2,{data:{publicUrl:r.data.signedUrl}}]:[2,{data:null,error:r.error}]}}))}))},e.prototype.remove=function(t){return N(this,void 0,void 0,(function(){var e,r,o,n,i,c,u,l,d,f,p=this;return T(this,(function(h){switch(h.label){case 0:for(h.trys.push([0,3,,4]),e=10,r=[],o=0;o<t.length;o+=e)r.push(t.slice(o,o+e));return[4,Promise.all(r.map((function(t){return Promise.all(t.map((function(t){return p.info(t)})))})))];case 1:return n=h.sent(),i=new Map,n.flat().forEach((function(r,o){r.data&&i.set(t[Math.floor(o/e)*e+o%e],r.data)})),c=t.map((function(t){return p._normalizeCloudId(t)})),[4,this.deleteFile({fileList:c})];case 2:if(u=h.sent(),(l=u.fileList.filter((function(t){return"SUCCESS"!==t.code}))).length>0)throw new s("Delete failed for ".concat(l.length," file(s)"));return d=(new Date).toISOString(),[2,{data:t.map((function(t){var e=i.get(t);return{name:null==e?void 0:e.name,id:null==e?void 0:e.id,bucket_id:null==e?void 0:e.bucketId,owner:void 0,updated_at:(null==e?void 0:e.updatedAt)||d,created_at:null==e?void 0:e.createdAt,last_accessed_at:(null==e?void 0:e.lastAccessedAt)||d,metadata:(null==e?void 0:e.metadata)||{},buckets:{id:null==e?void 0:e.bucketId,name:null==e?void 0:e.bucketId,owner:void 0,public:!1,created_at:"",updated_at:d}}})),error:null}];case 3:if(f=h.sent(),this.shouldThrowOnError)throw f;if(a(f))return[2,{data:null,error:f}];throw f;case 4:return[2]}}))}))},e.prototype.list=function(){return N(this,void 0,void 0,(function(){return T(this,(function(t){throw new s("Not implemented")}))}))},e.prototype._getCloudPath=function(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")},e.prototype._normalizeCloudId=function(t){var e;if(/^cloud:\/\//.test(t))return t;var r=this._getCloudPath(t);if(!this.bucketId)throw new s("bucketId is not set");var o=(null===(e=this.config)||void 0===e?void 0:e.env)||"";return o?"cloud://".concat(o,".").concat(this.bucketId,"/").concat(r):void 0},e.prototype.toBase64=function(t){return"undefined"!=typeof Buffer?Buffer.from(t).toString("base64"):btoa(t)},e.prototype._transformOptsToQueryString=function(t){var e=["imageMogr2"];if(t.width||t.height){var r=t.width||"",o=t.height||"";"fill"===t.resize?e.push("thumbnail/".concat(r,"x").concat(o,"!")):"contain"===t.resize?e.push("thumbnail/".concat(r,"x").concat(o)):e.push("thumbnail/".concat(r,"x").concat(o,"^"))}if(t.format&&"origin"!==t.format&&e.push("format/".concat(t.format)),void 0!==t.quality){var n=Math.max(1,Math.min(100,t.quality));e.push("quality/".concat(n))}return e.join("/")},e.prototype._extractPathFromFileId=function(t){var e=t.replace(/^cloud:\/\//,"").split("/");return e.length<2?t:e.slice(1).join("/")},e.prototype._extractBucketFromFileId=function(t){var e=t.replace(/^cloud:\/\//,"").split("/");if(e.length<1)return"";var r=e[0],o=r.indexOf(".");return-1===o?r:r.substring(o+1)},e}(K),$={name:"".concat(J,"/supabase"),IIFE:!0,entity:function(){var t=new WeakMap;Object.defineProperty(this.prototype,"storage",{get:function(){if(t.has(this))return t.get(this);var e=this,r=new Proxy({},{get:function(t,r){return"config"===r?e.config:"request"===r?e.request:void 0}}),o=new Q(r);return t.set(this,o),o},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(Y),cloudbase.registerComponent($)}catch(P){}function Z(t){try{t.registerComponent(Y),t.registerComponent($)}catch(t){console.warn(t)}}try{window.registerStorage=Z}catch(P){}}},e={};function r(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,r),i.exports}r.d=(t,e)=>{for(var o in e)r.o(e,o)&&!r.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{var t=o;Object.defineProperty(t,"__esModule",{value:!0}),t.registerStorage=void 0;var e=r(272);t.registerStorage=e.registerStorage})(),o})()));
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("cloudbase_storage",[],t):"object"==typeof exports?exports.cloudbase_storage=t():e.cloudbase_storage=t()}("undefined"!=typeof window?window:this,(()=>(()=>{var e={829:(e,t,r)=>{"use strict";var o;r.r(t),r.d(t,{AbstractSDKRequest:()=>n,AbstractStorage:()=>i,StorageType:()=>o,formatUrl:()=>a}),function(e){e.local="local",e.none="none",e.session="session"}(o||(o={}));var n=function(){},i=function(){};function a(e,t,r){void 0===r&&(r={});var o=/\?/.test(t),n="";for(var i in r)""===n?!o&&(t+="?"):n+="&",n+=i+"="+encodeURIComponent(r[i]);return/^http(s)?\:\/\//.test(t+=n)?t:""+e+t}},456:function(e,t,r){"use strict";var o,n=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)},a=this&&this.__decorate||function(e,t,r,o){var n,i=arguments.length,a=i<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,o);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(i<3?n(a):i>3?n(t,r,a):n(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},c=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.registerStorage=t.SupabaseFileAPILikeStorage=t.CloudbaseStorage=t.COMPONENT_NAME=void 0;var l,d=r(957),f=r(877),p=r(388);!function(e){e.put="put",e.post="post"}(l||(l={}));var h=f.constants.getSdkName,g=f.constants.ERRORS,y=f.constants.COMMUNITY_SITE_URL,m=f.utils.isArray,v=f.utils.isString,b=f.utils.isPalinObject,w=f.utils.execCallback,O=f.helpers.catchErrorsDecorator;t.COMPONENT_NAME="storage";var _=function(e,t,r){return c(void 0,void 0,void 0,(function(){var o,n,a;return u(this,(function(s){switch(s.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-upload-info",data:[i({objectId:t.path},t.headers?{signedHeader:Object.keys(t.headers).reduce((function(e,r){var o;return i(i({},e),((o={})[r]=[t.headers[r]],o))}),{})}:{})]},r)];case 1:return o=s.sent(),n=(null===(a=o.data)||void 0===a?void 0:a[0])||{},[2,o=i(i({},o),{data:i(i({},n.code?i({},n):{}),{authorization:n.authorization,token:n.token,url:n.uploadUrl,fileId:n.cloudObjectId,cosFileId:n.cloudObjectMeta,download_url:n.downloadUrl})})]}}))}))},S=function(e,t,r){return c(void 0,void 0,void 0,(function(){var o,n;return u(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"get-objects-download-info",data:t.convertedFileList.map((function(e){return{cloudObjectId:e.fileid}}))},r)];case 1:return o=a.sent(),[2,o=i(i({},o),{data:{download_list:null===(n=o.data)||void 0===n?void 0:n.map((function(e){return{code:e.code||"SUCCESS",message:e.message,fileid:e.cloudObjectId,download_url:e.downloadUrl,fileID:e.cloudObjectId,tempFileURL:e.downloadUrl}}))}})]}}))}))},I=function(e,t,r){return c(void 0,void 0,void 0,(function(){var o,n;return u(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"delete-objects",data:t.fileList.map((function(e){return{cloudObjectId:e}}))},r)];case 1:return o=a.sent(),[2,o=i(i({},o),{data:{delete_list:null===(n=o.data)||void 0===n?void 0:n.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},E=function(e,t,r){return c(void 0,void 0,void 0,(function(){var o,n;return u(this,(function(a){switch(a.label){case 0:return[4,e.gateWay({path:"storages",name:"copy-objects",data:t.convertedFileList.map((function(e){return{srcPath:e.src_path,dstPath:e.dst_path,overwrite:e.overwrite,removeOriginal:e.remove_original}}))},r)];case 1:return o=a.sent(),[2,o=i(i({},o),{data:{copy_list:null===(n=o.data)||void 0===n?void 0:n.map((function(e){return{code:e.code||"SUCCESS",fileID:e.cloudObjectId,message:e.message}}))}})]}}))}))},P=t.CloudbaseStorage=function(){function e(){}var r,o,n,d,f,P,N,C,R,j,A,L,F,M,U,x;return e.prototype.isGateWay=function(){return"GATEWAY"===(this.config.endPointMode||"CLOUD_API")},e.prototype.uploadFile=function(e,r){return c(this,void 0,Promise,(function(){var o,n,a,s,c,d,f,p,y,m,b,O,_,S,I,E,P,N,C,R,j,A,L,F;return u(this,(function(u){switch(u.label){case 0:if(o=e.cloudPath,n=e.filePath,a=e.onUploadProgress,A=e.method,s=void 0===A?"put":A,L=e.headers,c=void 0===L?{}:L,d=e.fileContent,!v(o)||!n&&!d)throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".uploadFile] invalid params")}));return f={put:l.put,post:l.post}[s.toLocaleLowerCase()]||l.put,[4,this.getUploadMetadata({cloudPath:o,method:f,headers:f===l.put?c:void 0,customReqOpts:e.customReqOpts})];case 1:return p=u.sent(),y=p.data,m=p.requestId,b=y.url,O=y.authorization,_=y.token,S=y.fileId,I=y.cosFileId,E=y.download_url,N=i(i({},P={url:b,file:n,name:o,onUploadProgress:a,fileContent:d,fileId:S,requestId:m}),{method:l.put,headers:i(i({},c),{authorization:O,"x-cos-meta-fileid":I,"x-cos-security-token":_})}),C=i(i({},P),{method:l.post,data:{key:o,signature:O,"x-cos-meta-fileid":I,success_action_status:"201","x-cos-security-token":_}}),(F={})[l.put]={params:N,isSuccess:function(e){return e>=200&&e<300}},F[l.post]={params:C,isSuccess:function(e){return 201===e}},R=F,[4,this.request.upload(R[f].params)];case 2:return j=u.sent(),R[f].isSuccess(j.statusCode)?[2,w(r,null,{fileID:S,download_url:E,requestId:m})]:[2,w(r,new Error("[".concat(h(),"][").concat(g.OPERATION_FAIL,"][").concat(t.COMPONENT_NAME,"]:").concat(j.data)))]}}))}))},e.prototype.getUploadMetadata=function(e,r){return c(this,void 0,Promise,(function(){var o,n,i,a,s,c,d,f;return u(this,(function(u){switch(u.label){case 0:if(o=e.cloudPath,n=e.method,i=e.headers,!v(o))throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getUploadMetadata] invalid cloudPath")}));a=this.request,s="storage.getUploadMetadata",u.label=1;case 1:return u.trys.push([1,6,,7]),c=void 0,d={path:o},n&&(d.method=n),n===l.put&&i&&(d.headers=i),this.isGateWay()?[4,_(a,d,e.customReqOpts)]:[3,3];case 2:return c=u.sent(),[3,5];case 3:return[4,a.send(s,d,e.customReqOpts)];case 4:c=u.sent(),u.label=5;case 5:return[2,w(r,null,c)];case 6:return f=u.sent(),[2,w(r,f)];case 7:return[2]}}))}))},e.prototype.deleteFile=function(e,r){return c(this,void 0,Promise,(function(){var o,n,i,a,s,c,l,d;return u(this,(function(u){switch(u.label){case 0:if(!(o=e.fileList)||!m(o)||0===o.length)throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".deleteFile] fileList must not be empty")}));for(n=0,i=o;n<i.length;n++)if(!(a=i[n])||!v(a))throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".deleteFile] fileID must be string")}));return s="storage.batchDeleteFile",c=this.request,l={},this.isGateWay()?[4,I(c,{fileList:o},e.customReqOpts)]:[3,2];case 1:return l=u.sent(),[3,4];case 2:return[4,c.send(s,{fileid_list:o},e.customReqOpts)];case 3:l=u.sent(),u.label=4;case 4:return l.code?[2,w(r,null,l)]:(d={fileList:l.data.delete_list,requestId:l.requestId},[2,w(r,null,d)])}}))}))},e.prototype.getTempFileURL=function(e,r){return c(this,void 0,Promise,(function(){var o,n,i,a,s,c,l,d;return u(this,(function(u){switch(u.label){case 0:if(!(o=e.fileList)||!m(o)||0===o.length)throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] fileList must not be empty")}));for(n=[],i=0,a=o;i<a.length;i++)if(s=a[i],b(s)){if(!Object.prototype.hasOwnProperty.call(s,"fileID"))throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] file info must include fileID")}));n.push({fileid:s.fileID,max_age:s.maxAge||7200})}else{if(!v(s))throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] invalid fileList")}));n.push({fileid:s})}return c="storage.batchGetDownloadUrl",l=this.request,d={},this.isGateWay()?[4,S(l,{convertedFileList:n},e.customReqOpts)]:[3,2];case 1:return d=u.sent(),[3,4];case 2:return[4,l.send(c,{file_list:n},e.customReqOpts)];case 3:d=u.sent(),u.label=4;case 4:return d.code?[2,w(r,null,d)]:[2,w(r,null,{fileList:d.data.download_list,requestId:d.requestId})]}}))}))},e.prototype.downloadFile=function(e,r){return c(this,void 0,Promise,(function(){var o,n,i,a,s,c;return u(this,(function(u){switch(u.label){case 0:if(o=e.fileID,!v(o))throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".getTempFileURL] fileID must be string")}));return[4,this.getTempFileURL.call(this,{fileList:[{fileID:o,maxAge:600}],customReqOpts:e.customReqOpts})];case 1:return n=u.sent(),"SUCCESS"!==(i=n.fileList[0]).code?[2,w(r,i)]:(a=this.request,s=encodeURI(i.download_url),[4,a.download({url:s,tempFilePath:e.tempFilePath})]);case 2:return c=u.sent(),[2,w(r,null,c)]}}))}))},e.prototype.copyFile=function(e,r){return c(this,void 0,Promise,(function(){var o,n,i,a,s,c,l,d,f;return u(this,(function(u){switch(u.label){case 0:if(!(o=e.fileList)||!m(o)||0===o.length)throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".copyFile] fileList must not be empty")}));for(n=[],i=0,a=o;i<a.length;i++){if(s=a[i],c=s.srcPath,l=s.dstPath,!c||!l||"string"!=typeof c||"string"!=typeof l)throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".copyFile] srcPath and dstPath may not be empty")}));if(c===l)throw new Error(JSON.stringify({code:g.INVALID_PARAMS,msg:"[".concat(t.COMPONENT_NAME,".copyFile] srcPath and dstPath can not be the same")}));n.push({src_path:c,dst_path:l,overwrite:s.overwrite,remove_original:s.removeOriginal})}return d=this.request,f={},this.isGateWay()?[4,E(d,{convertedFileList:n},e.customReqOpts)]:[3,2];case 1:return f=u.sent(),[3,4];case 2:return[4,d.send("storage.batchCopyFile",{file_list:n},e.customReqOpts)];case 3:f=u.sent(),u.label=4;case 4:return f.code?[2,w(r,null,f)]:[2,w(r,null,{fileList:f.data.copy_list,requestId:f.requestId})]}}))}))},e.prototype.getFileInfo=function(e){var t;return c(this,void 0,Promise,(function(){var r,o=this;return u(this,(function(n){switch(n.label){case 0:return[4,this.getTempFileURL(e)];case 1:return(null==(r=n.sent())?void 0:r.fileList)&&(null===(t=null==r?void 0:r.fileList)||void 0===t?void 0:t.length)>0?[4,Promise.all(r.fileList.map((function(e){return c(o,void 0,void 0,(function(){var t,r,o,n,i;return u(this,(function(a){switch(a.label){case 0:if("SUCCESS"!==e.code)return[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,message:e.message}];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this.request.fetch({url:e.tempFileURL,method:"HEAD"})];case 2:return t=a.sent(),r=t.header,Headers&&r instanceof Headers&&(r=Object.fromEntries(t.header.entries())),o=parseInt(r["content-length"])||0,n=r["content-type"]||"",[400,404].includes(Number(t.statusCode))?[2,{code:"FILE_NOT_FOUND",fileID:e.fileID,tempFileURL:e.tempFileURL,message:"file not found"}]:[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,cloudId:e.fileID,fileName:e.fileID.split("/").pop(),contentType:n,mime:n.split(";")[0].trim(),size:o,etag:r.etag||"",lastModified:r["last-modified"]||"",cacheControl:r["cache-control"]||""}];case 3:return i=a.sent(),[2,{code:"FETCH_FILE_INFO_ERROR",fileID:e.fileID,tempFileURL:e.tempFileURL,message:i.message}];case 4:return[2]}}))}))})))]:[3,3];case 2:return[2,{fileList:n.sent(),requestId:r.requestId}];case 3:return[2,{fileList:[],requestId:r.requestId}]}}))}))},a([O({customInfo:{className:"Cloudbase",methodName:"uploadFile"},title:"上传文件失败",messages:["请确认以下各项:"," 1 - 调用 uploadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(y)]}),s("design:type",Function),s("design:paramtypes",[Object,"function"==typeof(r="undefined"!=typeof Function&&Function)?r:Object]),s("design:returntype","function"==typeof(o="undefined"!=typeof Promise&&Promise)?o:Object)],e.prototype,"uploadFile",null),a([O({customInfo:{className:"Cloudbase",methodName:"getUploadMetadata"},title:"获取上传元信息失败",messages:["请确认以下各项:"," 1 - 调用 getUploadMetadata() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(y)]}),s("design:type",Function),s("design:paramtypes",[Object,"function"==typeof(n="undefined"!=typeof Function&&Function)?n:Object]),s("design:returntype","function"==typeof(d="undefined"!=typeof Promise&&Promise)?d:Object)],e.prototype,"getUploadMetadata",null),a([O({customInfo:{className:"Cloudbase",methodName:"deleteFile"},title:"删除文件失败",messages:["请确认以下各项:"," 1 - 调用 deleteFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(y)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(f=void 0!==p.ICloudbaseDeleteFileParams&&p.ICloudbaseDeleteFileParams)?f:Object,"function"==typeof(P="undefined"!=typeof Function&&Function)?P:Object]),s("design:returntype","function"==typeof(N="undefined"!=typeof Promise&&Promise)?N:Object)],e.prototype,"deleteFile",null),a([O({customInfo:{className:"Cloudbase",methodName:"getTempFileURL"},title:"获取文件下载链接",messages:["请确认以下各项:"," 1 - 调用 getTempFileURL() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(y)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(C=void 0!==p.ICloudbaseGetTempFileURLParams&&p.ICloudbaseGetTempFileURLParams)?C:Object,"function"==typeof(R="undefined"!=typeof Function&&Function)?R:Object]),s("design:returntype","function"==typeof(j="undefined"!=typeof Promise&&Promise)?j:Object)],e.prototype,"getTempFileURL",null),a([O({customInfo:{className:"Cloudbase",methodName:"downloadFile"},title:"下载文件失败",messages:["请确认以下各项:"," 1 - 调用 downloadFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(y)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(A=void 0!==p.ICloudbaseDownloadFileParams&&p.ICloudbaseDownloadFileParams)?A:Object,"function"==typeof(L="undefined"!=typeof Function&&Function)?L:Object]),s("design:returntype","function"==typeof(F="undefined"!=typeof Promise&&Promise)?F:Object)],e.prototype,"downloadFile",null),a([O({customInfo:{className:"Cloudbase",methodName:"copyFile"},title:"批量复制文件",messages:["请确认以下各项:"," 1 - 调用 copyFile() 的语法或参数是否正确"," 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety"," 3 - 云存储安全规则是否限制了当前登录状态访问","如果问题依然存在,建议到官方问答社区提问或寻找帮助:".concat(y)]}),s("design:type",Function),s("design:paramtypes",["function"==typeof(M=void 0!==p.ICloudbaseCopyFileParams&&p.ICloudbaseCopyFileParams)?M:Object,"function"==typeof(U="undefined"!=typeof Function&&Function)?U:Object]),s("design:returntype","function"==typeof(x="undefined"!=typeof Promise&&Promise)?x:Object)],e.prototype,"copyFile",null),e}(),N=new P,C={name:t.COMPONENT_NAME,entity:{uploadFile:N.uploadFile,deleteFile:N.deleteFile,getTempFileURL:N.getTempFileURL,downloadFile:N.downloadFile,getUploadMetadata:N.getUploadMetadata,copyFile:N.copyFile,getFileInfo:N.getFileInfo,isGateWay:N.isGateWay}},R=function(e){function r(t){var r=e.call(this)||this;return r.shouldThrowOnError=!1,r.bucketId="",r.context=t,r}return n(r,e),Object.defineProperty(r.prototype,"config",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.config},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"request",{get:function(){var e;return null===(e=this.context)||void 0===e?void 0:e.request},enumerable:!1,configurable:!0}),r.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},r.prototype.from=function(e){return this.bucketId=e||"",this},r.prototype.upload=function(e,r,o){return c(this,void 0,Promise,(function(){var n,a,s,c,l,f,p,h,y;return u(this,(function(u){switch(u.label){case 0:n=i({upsert:!0},o),a=n.cacheControl,s=n.contentType,c=n.metadata,u.label=1;case 1:return u.trys.push([1,3,,4]),l=this._getCloudPath(e),f={cloudPath:l,filePath:r},(a||s||c)&&(p={},a&&(p["cache-control"]=a),s&&(p["content-type"]=s),c&&(p["x-cos-metadata-metadata"]=this.toBase64(JSON.stringify(c))),f.headers=p),[4,this.uploadFile(f)];case 2:if(!(h=u.sent()).fileID)throw new Error(JSON.stringify({code:g.OPERATION_FAIL,msg:"[".concat(t.COMPONENT_NAME,".update] no fileID returned")}));return[2,{data:{id:h.fileID,path:e,fullPath:e},error:null}];case 3:if(y=u.sent(),this.shouldThrowOnError)throw y;if((0,d.isStorageError)(y))return[2,{data:null,error:y}];throw y;case 4:return[2]}}))}))},r.prototype.uploadToSignedUrl=function(e,t,r,o){return c(this,void 0,Promise,(function(){return u(this,(function(t){return[2,this.upload(e,r,o)]}))}))},r.prototype.createSignedUploadUrl=function(e){return c(this,void 0,Promise,(function(){var t,r,o;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),t=this._getCloudPath(e),[4,this.getUploadMetadata({cloudPath:t})];case 1:return[2,{data:{signedUrl:(r=n.sent().data).url,token:r.token,path:e,authorization:r.authorization,id:r.fileId,cosFileId:r.cosFileId,downloadUrl:r.download_url},error:null}];case 2:if(o=n.sent(),this.shouldThrowOnError)throw o;return[2,{data:null,error:o instanceof d.StorageError?o:new d.StorageError(o.message)}];case 3:return[2]}}))}))},r.prototype.update=function(e,t,r){return c(this,void 0,Promise,(function(){return u(this,(function(o){return[2,this.upload(e,t,i(i({},r),{upsert:!0}))]}))}))},r.prototype.move=function(e,t){return c(this,void 0,Promise,(function(){var r,o;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.copyFile({fileList:[{srcPath:this._getCloudPath(e),dstPath:this._getCloudPath(t),overwrite:!0,removeOriginal:!0}]})];case 1:if((r=n.sent()).fileList[0].code&&"SUCCESS"!==r.fileList[0].code)throw new d.StorageError(r.fileList[0].message||"Move failed");return[2,{data:{message:"File moved from ".concat(e," to ").concat(t)},error:null}];case 2:if(o=n.sent(),this.shouldThrowOnError)throw o;if((0,d.isStorageError)(o))return[2,{data:null,error:o}];throw o;case 3:return[2]}}))}))},r.prototype.copy=function(e,t){return c(this,void 0,Promise,(function(){var r,o;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.copyFile({fileList:[{srcPath:this._getCloudPath(e),dstPath:this._getCloudPath(t),overwrite:!0,removeOriginal:!1}]})];case 1:if((r=n.sent()).fileList[0].code&&"SUCCESS"!==r.fileList[0].code)throw new d.StorageError(r.fileList[0].message||"Copy failed");return[2,{data:{path:this._getCloudPath(t)},error:null}];case 2:if(o=n.sent(),this.shouldThrowOnError)throw o;if((0,d.isStorageError)(o))return[2,{data:null,error:o}];throw o;case 3:return[2]}}))}))},r.prototype.createSignedUrl=function(e,t,r){return c(this,void 0,Promise,(function(){var o,n,i,a,s,c,l;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),o=this._normalizeCloudId(e),[4,this.getTempFileURL({fileList:[{fileID:o,maxAge:t}]})];case 1:if("SUCCESS"!==(n=u.sent()).fileList[0].code)throw new d.StorageError("Failed to create signed URL: [".concat(n.fileList[0].code,"] ").concat(n.fileList[0].fileID));return i=n.fileList[0].download_url,a=[],void 0!==(null==r?void 0:r.download)&&("string"==typeof r.download?a.push("download=".concat(encodeURIComponent(r.download))):!0===r.download&&a.push("download=true")),(null==r?void 0:r.transform)&&(s=this._transformOptsToQueryString(r.transform))&&a.push(s),a.length>0&&(c=i.includes("?")?"&":"?",i="".concat(i).concat(c).concat(a.join("&"))),[2,{data:{signedUrl:i},error:null}];case 2:if(l=u.sent(),this.shouldThrowOnError)throw l;if((0,d.isStorageError)(l))return[2,{data:null,error:l}];throw l;case 3:return[2]}}))}))},r.prototype.createSignedUrls=function(e,t){return c(this,void 0,Promise,(function(){var r,o,n=this;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),r=e.map((function(e){return{fileID:n._normalizeCloudId(e),maxAge:t}})),[4,this.getTempFileURL({fileList:r})];case 1:return[2,{data:i.sent().fileList.map((function(t,r){return{path:e[r],signedUrl:t.tempFileURL||"",error:"SUCCESS"===t.code?null:t.message}})),error:null}];case 2:if(o=i.sent(),this.shouldThrowOnError)throw o;if((0,d.isStorageError)(o))return[2,{data:null,error:o}];throw o;case 3:return[2]}}))}))},r.prototype.download=function(e,t){return c(this,void 0,Promise,(function(){var r,o,n=this;return u(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),o={},[4,c(n,void 0,void 0,(function(){var r,o,n,i;return u(this,(function(a){switch(a.label){case 0:return[4,this.createSignedUrl(e,600,{transform:t})];case 1:if((r=a.sent()).error)throw r.error;return o=encodeURI(null===(i=r.data)||void 0===i?void 0:i.signedUrl),[4,this.request.reqClass.get({url:o,headers:{},responseType:"blob"})];case 2:if(!(n=a.sent().data))throw new d.StorageError("Download failed: no file content");return[2,new Blob([n])]}}))}))];case 1:return[2,(o.data=i.sent(),o.error=null,o)];case 2:if(r=i.sent(),this.shouldThrowOnError)throw r;if((0,d.isStorageError)(r))return[2,{data:null,error:r}];throw r;case 3:return[2]}}))}))},r.prototype.info=function(e){return c(this,void 0,Promise,(function(){var t,r,o,n,i,a,s,c;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),t=e.startsWith("cloud://"),r=t?this._extractPathFromFileId(e):e,o=t?this._extractBucketFromFileId(e):this.bucketId,[4,this.getFileInfo({fileList:[this._normalizeCloudId(e)]})];case 1:if(n=u.sent(),"SUCCESS"!==(i=n.fileList[0]).code)throw new d.StorageError(i.message);return a=(new Date).toISOString(),s=(i.lastModified?new Date(i.lastModified):new Date).toISOString(),[2,{data:{id:i.fileID,version:"1",name:r,bucketId:o,updatedAt:s,createdAt:s,lastAccessedAt:a,size:i.size,cacheControl:i.cacheControl,contentType:i.contentType,etag:i.etag,lastModified:s,metadata:{}},error:null}];case 2:if(c=u.sent(),this.shouldThrowOnError)throw c;return[2,{data:null,error:c instanceof d.StorageError?c:new d.StorageError(c.message)}];case 3:return[2]}}))}))},r.prototype.exists=function(e){return c(this,void 0,Promise,(function(){var t,r,o;return u(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getFileInfo({fileList:[this._normalizeCloudId(e)]})];case 1:if(t=n.sent(),"FILE_NOT_FOUND"===(r=t.fileList[0]).code)return[2,{data:!1,error:null}];if("SUCCESS"!==r.code)throw new d.StorageError(r.message);return[2,{data:!0,error:null}];case 2:if(o=n.sent(),this.shouldThrowOnError)throw o;if((0,d.isStorageError)(o))return[2,{data:null,error:o}];throw o;case 3:return[2]}}))}))},r.prototype.getPublicUrl=function(e,t){return c(this,void 0,Promise,(function(){var r;return u(this,(function(o){switch(o.label){case 0:return[4,this.createSignedUrl(e,600,t)];case 1:return(r=o.sent()).data?[2,{data:{publicUrl:r.data.signedUrl}}]:[2,{data:null,error:r.error}]}}))}))},r.prototype.remove=function(e){return c(this,void 0,Promise,(function(){var t,r,o,n,i,a,s,c,l,f,p=this;return u(this,(function(u){switch(u.label){case 0:for(u.trys.push([0,3,,4]),t=10,r=[],o=0;o<e.length;o+=t)r.push(e.slice(o,o+t));return[4,Promise.all(r.map((function(e){return Promise.all(e.map((function(e){return p.info(e)})))})))];case 1:return n=u.sent(),i=new Map,n.flat().forEach((function(r,o){r.data&&i.set(e[Math.floor(o/t)*t+o%t],r.data)})),a=e.map((function(e){return p._normalizeCloudId(e)})),[4,this.deleteFile({fileList:a})];case 2:if(s=u.sent(),(c=s.fileList.filter((function(e){return"SUCCESS"!==e.code}))).length>0)throw new d.StorageError("Delete failed for ".concat(c.length," file(s)"));return l=(new Date).toISOString(),[2,{data:e.map((function(e){var t=i.get(e);return{name:null==t?void 0:t.name,id:null==t?void 0:t.id,bucket_id:null==t?void 0:t.bucketId,owner:void 0,updated_at:(null==t?void 0:t.updatedAt)||l,created_at:null==t?void 0:t.createdAt,last_accessed_at:(null==t?void 0:t.lastAccessedAt)||l,metadata:(null==t?void 0:t.metadata)||{},buckets:{id:null==t?void 0:t.bucketId,name:null==t?void 0:t.bucketId,owner:void 0,public:!1,created_at:"",updated_at:l}}})),error:null}];case 3:if(f=u.sent(),this.shouldThrowOnError)throw f;if((0,d.isStorageError)(f))return[2,{data:null,error:f}];throw f;case 4:return[2]}}))}))},r.prototype.list=function(){return c(this,void 0,void 0,(function(){return u(this,(function(e){throw new d.StorageError("Not implemented")}))}))},r.prototype._getCloudPath=function(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")},r.prototype._normalizeCloudId=function(e){var t;if(/^cloud:\/\//.test(e))return e;var r=this._getCloudPath(e);if(!this.bucketId)throw new d.StorageError("bucketId is not set");var o=(null===(t=this.config)||void 0===t?void 0:t.env)||"";return o?"cloud://".concat(o,".").concat(this.bucketId,"/").concat(r):void 0},r.prototype.toBase64=function(e){return"undefined"!=typeof Buffer?Buffer.from(e).toString("base64"):btoa(e)},r.prototype._transformOptsToQueryString=function(e){var t=["imageMogr2"];if(e.width||e.height){var r=e.width||"",o=e.height||"";"fill"===e.resize?t.push("thumbnail/".concat(r,"x").concat(o,"!")):"contain"===e.resize?t.push("thumbnail/".concat(r,"x").concat(o)):t.push("thumbnail/".concat(r,"x").concat(o,"^"))}if(e.format&&"origin"!==e.format&&t.push("format/".concat(e.format)),void 0!==e.quality){var n=Math.max(1,Math.min(100,e.quality));t.push("quality/".concat(n))}return t.join("/")},r.prototype._extractPathFromFileId=function(e){var t=e.replace(/^cloud:\/\//,"").split("/");return t.length<2?e:t.slice(1).join("/")},r.prototype._extractBucketFromFileId=function(e){var t=e.replace(/^cloud:\/\//,"").split("/");if(t.length<1)return"";var r=t[0],o=r.indexOf(".");return-1===o?r:r.substring(o+1)},r}(P);t.SupabaseFileAPILikeStorage=R;var j={name:"".concat(t.COMPONENT_NAME,"/supabase"),IIFE:!0,entity:function(){var e=new WeakMap;Object.defineProperty(this.prototype,"storage",{get:function(){if(e.has(this))return e.get(this);var t=this,r=new Proxy({},{get:function(e,r){return"config"===r?t.config:"request"===r?t.request:void 0}}),o=new R(r);return e.set(this,o),o},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(C),cloudbase.registerComponent(j)}catch(e){}function A(e){try{e.registerComponent(C),e.registerComponent(j)}catch(e){console.warn(e)}}t.registerStorage=A;try{window.registerStorage=A}catch(e){}},957:function(e,t){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function o(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(o.prototype=t.prototype,new o)});Object.defineProperty(t,"__esModule",{value:!0}),t.StorageUnknownError=t.StorageApiError=t.isStorageError=t.StorageError=void 0;var n=function(e){function t(t){var r=e.call(this,t)||this;return r.__isStorageError=!0,r.name="StorageError",r}return o(t,e),t}(Error);t.StorageError=n,t.isStorageError=function(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e};var i=function(e){function t(t,r,o){var n=e.call(this,t)||this;return n.name="StorageApiError",n.status=r,n.statusCode=o,n}return o(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},t}(n);t.StorageApiError=i;var a=function(e){function t(t,r){var o=e.call(this,t)||this;return o.name="StorageUnknownError",o.originalError=r,o}return o(t,e),t}(n);t.StorageUnknownError=a},563:function(e,t,r){"use strict";var o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)},n=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useDefaultAdapter=t.useAdapters=t.RUNTIME=void 0;var s,c=a(r(92)),u=r(962);!function(e){e.WEB="web",e.WX_MP="wx_mp"}(s=t.RUNTIME||(t.RUNTIME={})),t.useAdapters=function(e,t){for(var r=0,n=(0,u.isArray)(e)?e:[e];r<n.length;r++){var i=n[r],a=i.isMatch,s=i.genAdapter,c=i.runtime;if(a())return{adapter:o({isMatch:a},s(t)),runtime:c}}},t.useDefaultAdapter=function(){return{adapter:o({},c.genAdapter()),runtime:s.WEB}}},92:function(e,t,r){"use strict";var o,n=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.WebRequest=t.genAdapter=void 0;var c=r(829),u=r(962),l=r(464),d=function(e){function t(t){var r=e.call(this)||this,o=t.timeout,n=t.timeoutMsg,i=t.restrictedMethods;return r.timeout=o||0,r.timeoutMsg=n||"请求超时",r.restrictedMethods=i||["get","post","upload","download"],r}return n(t,e),t.prototype.get=function(e){return this.request(i(i({},e),{method:"get"}),this.restrictedMethods.includes("get"))},t.prototype.post=function(e){return this.request(i(i({},e),{method:"post"}),this.restrictedMethods.includes("post"))},t.prototype.put=function(e){return this.request(i(i({},e),{method:"put"}))},t.prototype.upload=function(e){var t=e.data,r=e.file,o=e.name,n=e.method,a=e.headers,s=void 0===a?{}:a,c={post:"post",put:"put"}[null==n?void 0:n.toLowerCase()]||"put",u=new FormData;return"post"===c?(Object.keys(t).forEach((function(e){u.append(e,t[e])})),u.append("key",o),u.append("file",r),this.request(i(i({},e),{data:u,method:c}),this.restrictedMethods.includes("upload"))):this.request(i(i({},e),{method:"put",headers:s,body:r}),this.restrictedMethods.includes("upload"))},t.prototype.download=function(e){return a(this,void 0,Promise,(function(){var t,r,o,n;return s(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(i(i({},e),{headers:{},responseType:"blob"}))];case 1:return t=a.sent().data,r=window.URL.createObjectURL(new Blob([t])),o=decodeURIComponent(new URL(e.url).pathname.split("/").pop()||""),(n=document.createElement("a")).href=r,n.setAttribute("download",o),n.style.display="none",document.body.appendChild(n),n.click(),window.URL.revokeObjectURL(r),document.body.removeChild(n),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise((function(t){t({statusCode:200,tempFilePath:e.url})}))]}}))}))},t.prototype.fetch=function(e){var t;return a(this,void 0,Promise,(function(){var r,o,n,c,u,l,d,f,p,h,g,y,m,v=this;return s(this,(function(b){switch(b.label){case 0:return r=new AbortController,o=e.url,n=e.enableAbort,c=void 0!==n&&n,u=e.stream,l=void 0!==u&&u,d=e.signal,f=e.timeout,p=e.shouldThrowOnError,h=void 0===p||p,g=null!=f?f:this.timeout,d&&(d.aborted&&r.abort(),d.addEventListener("abort",(function(){return r.abort()}))),y=null,c&&g&&(y=setTimeout((function(){console.warn(v.timeoutMsg),r.abort(new Error(v.timeoutMsg))}),g)),[4,fetch(o,i(i({},e),{signal:r.signal})).then((function(e){return a(v,void 0,void 0,(function(){var t,r,o;return s(this,(function(n){switch(n.label){case 0:return clearTimeout(y),h?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return o=(r=Promise).reject,[4,e.json()];case 2:t=o.apply(r,[n.sent()]),n.label=3;case 3:return[2,t];case 4:return[2,e]}}))}))})).catch((function(e){if(clearTimeout(y),h)return Promise.reject(e)}))];case 1:return m=b.sent(),[2,{data:l?m.body:(null===(t=m.headers.get("content-type"))||void 0===t?void 0:t.includes("application/json"))?m.json():m.text(),statusCode:m.status,header:m.headers}]}}))}))},t.prototype.request=function(e,t){var r=this;void 0===t&&(t=!1);var o=String(e.method).toLowerCase()||"get";return new Promise((function(n){var i,a,s=e.url,c=e.headers,d=void 0===c?{}:c,f=e.data,p=e.responseType,h=e.withCredentials,g=e.body,y=e.onUploadProgress,m=(0,u.formatUrl)((0,l.getProtocol)(),s,"get"===o?f:{}),v=new XMLHttpRequest;v.open(o,m),p&&(v.responseType=p),Object.keys(d).forEach((function(e){v.setRequestHeader(e,d[e])})),y&&v.upload.addEventListener("progress",y),v.onreadystatechange=function(){var e={};if(4===v.readyState){var t=v.getAllResponseHeaders().trim().split(/[\r\n]+/),r={};t.forEach((function(e){var t=e.split(": "),o=t.shift().toLowerCase(),n=t.join(": ");r[o]=n})),e.header=r,e.statusCode=v.status;try{e.data="blob"===p?v.response:JSON.parse(v.responseText)}catch(t){e.data="blob"===p?v.response:v.responseText}clearTimeout(i),n(e)}},t&&r.timeout&&(i=setTimeout((function(){console.warn(r.timeoutMsg),v.abort()}),r.timeout)),a=(0,u.isFormData)(f)?f:"application/x-www-form-urlencoded"===d["content-type"]?(0,u.toQueryString)(f):g||(f?JSON.stringify(f):void 0),h&&(v.withCredentials=!0),v.send(a)}))},t}(c.AbstractSDKRequest);t.WebRequest=d,t.genAdapter=function(){return{type:"default",root:window,reqClass:d,wsClass:WebSocket,localStorage}}},464:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.COMMUNITY_SITE_URL=t.IS_DEBUG_MODE=t.getProtocol=t.setProtocol=t.getSdkName=t.setSdkName=void 0;var r="@cloudbase/js-sdk";t.setSdkName=function(e){r=e},t.getSdkName=function(){return r};var o="https:";t.setProtocol=function(e){o=e},t.getProtocol=function(){return o},t.IS_DEBUG_MODE=!1,t.COMMUNITY_SITE_URL="https://support.qq.com/products/148793"},519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ERRORS=void 0,t.ERRORS={INVALID_PARAMS:"INVALID_PARAMS",INVALID_SYNTAX:"INVALID_SYNTAX",INVALID_OPERATION:"INVALID_OPERATION",OPERATION_FAIL:"OPERATION_FAIL",NETWORK_ERROR:"NETWORK_ERROR",UNKOWN_ERROR:"UNKOWN_ERROR"}},778:function(e,t,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.OATUH_LOGINTYPE=void 0,n(r(464),t),n(r(519),t),t.OATUH_LOGINTYPE="constants"},517:function(e,t,r){"use strict";var o=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},n=this&&this.__generator||function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.catchErrorsDecorator=void 0;var i=r(962),a=r(778),s=!1;"undefined"!=typeof navigator&&navigator.userAgent&&(s=-1!==navigator.userAgent.indexOf("Firefox"));var c=s?/(\.js\/)?__decorate(\$\d+)?<@.*\d$/:/(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,u=/https?:\/\/.+:\d*\/.*\.js:\d+:\d+/;function l(e){var t=e.err,r=e.className,o=e.methodName,n=e.sourceLink;if(!n)return null;var i,a=t.stack.split("\n"),c=s?/^catchErrorsDecorator\/<\/descriptor.value@.*\d$/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(o,"\\]\\s*\\(.*\\)$")),l=s?/^catchErrorsDecorator\/<\/descriptor.value/:new RegExp("".concat(r,"\\.descriptor.value\\s*\\[as\\s").concat(o,"\\]")),d=a.findIndex((function(e){return c.test(e)}));if(-1!==d){var f=a.filter((function(e,t){return t>d}));f.unshift(a[d].replace(l,"".concat(r,".").concat(o)).replace(u,n)),(i=new Error).stack="".concat(s?"@debugger":"Error","\n").concat(f.join("\n"))}return i}t.catchErrorsDecorator=function(e){var t=e.mode,r=void 0===t?"async":t,s=e.customInfo,d=void 0===s?{}:s,f=e.title,p=e.messages,h=void 0===p?[]:p;return function(e,t,s){if(a.IS_DEBUG_MODE){var p=d.className||e.constructor.name,g=d.methodName||t,y=s.value,m=function(){var e="",t=(new Error).stack.split("\n"),r=t.findIndex((function(e){return c.test(e)}));if(-1!==r){var o=u.exec(t[r+1]||"");e=o?o[0]:""}return e}();s.value="sync"===r?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=l({err:new Error,className:p,methodName:g,sourceLink:m});try{return y.apply(this,e)}catch(e){var o=e,n=e.message,a=e.error,s=e.error_description,c={title:f||"".concat(p,".").concat(g," failed"),content:[{type:"error",body:e}]};if(n&&/^\{.*\}$/.test(n)){var u=JSON.parse(n);c.subtitle=n,u.code&&(r?(r.code=u.code,r.msg=u.msg):(e.code=u.code,e.message=u.msg),o=r||e,c.content=h.map((function(e){return{type:"info",body:e}})))}throw a&&s&&(c.subtitle=s,r?(r.code=a,r.msg=s):(e.code=a,e.message=s),o=r||e,c.content=h.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(c),o}}:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o(this,void 0,void 0,(function(){var t,r,o,a,s,c,u,d;return n(this,(function(n){switch(n.label){case 0:t=l({err:new Error,className:p,methodName:g,sourceLink:m}),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,y.apply(this,e)];case 2:return[2,n.sent()];case 3:throw r=n.sent(),o=r,a=r.message,s=r.error,c=r.error_description,u={title:f||"".concat(p,".").concat(g," failed"),content:[{type:"error",body:r}]},a&&/^\{.*\}$/.test(a)&&(d=JSON.parse(a),u.subtitle=d,d.code&&(t?(t.code=d.code,t.message=d.msg):(r.code=d.code,r.message=d.msg),o=t||r,u.content=h.map((function(e){return{type:"info",body:e}})))),s&&c&&(u.subtitle=c,t?(t.code=s,t.msg=c):(r.code=s,r.message=c),o=t||r,u.content=h.map((function(e){return{type:"info",body:e}}))),(0,i.printGroupLog)(u),o;case 4:return[2]}}))}))}}}}},260:function(e,t,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(517),t)},877:function(e,t,r){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&o(t,e,r);return n(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.langEvent=t.AbortController=t.jwt=t.helpers=t.utils=t.events=t.cache=t.adapters=t.constants=void 0;var s=i(r(778));t.constants=s;var c=i(r(563));t.adapters=c;var u=i(r(865));t.cache=u;var l=i(r(940));t.events=l;var d=i(r(991));t.langEvent=d;var f=i(r(962));t.utils=f;var p=i(r(260));t.helpers=p;var h=a(r(644));t.AbortController=h.default;var g={decode:a(r(949)).default};t.jwt=g},644:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){var e=this;this.listeners=[],this.signal={aborted:!1,addEventListener:function(t,r){"abort"===t&&e.listeners.push(r)}}}return e.prototype.abort=function(){this.signal.aborted||(this.signal.aborted=!0,this.listeners.forEach((function(e){return e()})))},e}();t.default=r},865:function(e,t,r){"use strict";var o,n=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,o,n,i,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,o&&(n=2&s[0]?o.return:s[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,s[1])).done)return n;switch(o=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((n=(n=a.trys).length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudbaseCache=void 0;var s=r(829),c=r(962),u=r(778),l=function(e){function t(t){var r=e.call(this)||this;return r.root=t,t.tcbCacheObject||(t.tcbCacheObject={}),r}return n(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(s.AbstractStorage),d=function(){function e(e){this.keys={};var t=e.persistence,r=e.platformInfo,o=void 0===r?{}:r,n=e.keys,i=void 0===n?{}:n;this.platformInfo=o,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case"local":default:return t.localStorage?t.localStorage:((0,c.printWarn)(u.ERRORS.INVALID_PARAMS,"localStorage is not supported on current platform"),new l(t.root));case"none":return new l(t.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=i)}return Object.defineProperty(e.prototype,"mode",{get:function(){return this.storage.mode||"sync"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,r){if("async"!==this.mode){if(this.storage)try{var o={version:r||"localCachev1",content:t};this.storage.setItem(e,JSON.stringify(o))}catch(e){throw new Error(JSON.stringify({code:u.ERRORS.OPERATION_FAIL,msg:"[".concat((0,u.getSdkName)(),"][").concat(u.ERRORS.OPERATION_FAIL,"]setStore failed"),info:e}))}}else(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use setStoreAsync insteed")},e.prototype.setStoreAsync=function(e,t,r){return i(this,void 0,void 0,(function(){var o;return a(this,(function(n){switch(n.label){case 0:if(!this.storage)return[2];n.label=1;case 1:return n.trys.push([1,3,,4]),o={version:r||"localCachev1",content:t},[4,this.storage.setItem(e,JSON.stringify(o))];case 2:return n.sent(),[3,4];case 3:return n.sent(),[2];case 4:return[2]}}))}))},e.prototype.getStore=function(e,t){var r;if("async"!==this.mode){try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return""}catch(e){return""}t=t||"localCachev1";var o=this.storage.getItem(e);return o&&o.indexOf(t)>=0?JSON.parse(o).content:""}(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use getStoreAsync insteed")},e.prototype.getStoreAsync=function(e,t){var r;return i(this,void 0,void 0,(function(){var o;return a(this,(function(n){switch(n.label){case 0:try{if("undefined"!=typeof process&&(null===(r={IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0})||void 0===r?void 0:r.tcb_token))return[2,{IS_MP_BUILD:!0,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,""]}catch(e){return[2,""]}return t=t||"localCachev1",[4,this.storage.getItem(e)];case 1:return(o=n.sent())&&o.indexOf(t)>=0?[2,JSON.parse(o).content]:[2,""]}}))}))},e.prototype.removeStore=function(e){"async"!==this.mode?this.storage.removeItem(e):(0,c.printWarn)(u.ERRORS.INVALID_OPERATION,"current platform's storage is asynchronous, please use removeStoreAsync insteed")},e.prototype.removeStoreAsync=function(e){return i(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}}))}))},e}();t.CloudbaseCache=d},940:function(e,t,r){"use strict";var o,n=this&&this.__extends||(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},o(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__spreadArray||function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.removeEventListener=t.activateEvent=t.addEventListener=t.CloudbaseEventEmitter=t.IErrorEvent=t.CloudbaseEvent=void 0;var a=r(962),s=function(e,t){this.data=t||null,this.name=e};t.CloudbaseEvent=s;var c=function(e){function t(t,r){var o=e.call(this,"error",{error:t,data:r})||this;return o.error=t,o}return n(t,e),t}(s);t.IErrorEvent=c;var u=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,r){r[e]=r[e]||[],r[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,r){if(null==r?void 0:r[e]){var o=r[e].indexOf(t);-1!==o&&r[e].splice(o,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if((0,a.isInstanceOf)(e,c))return console.error(e.error),this;var r=(0,a.isString)(e)?new s(e,t||{}):e,o=r.name;if(this.listens(o)){r.target=this;for(var n=0,u=this.listeners[o]?i([],this.listeners[o],!0):[];n<u.length;n++)u[n].call(this,r)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();t.CloudbaseEventEmitter=u;var l=new u;t.addEventListener=function(e,t){l.on(e,t)},t.activateEvent=function(e,t){void 0===t&&(t={}),l.fire(e,t)},t.removeEventListener=function(e,t){l.off(e,t)}},991:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LANG_CHANGE_EVENT=t.bus=void 0;var o=r(940);t.bus=new o.CloudbaseEventEmitter,t.LANG_CHANGE_EVENT="lang_change"},962:function(e,t,r){"use strict";var o=this&&this.__rest||function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r};Object.defineProperty(t,"__esModule",{value:!0}),t.parseCaptcha=t.parseQueryString=t.transformPhone=t.sleep=t.printGroupLog=t.throwError=t.printInfo=t.printError=t.printWarn=t.execCallback=t.createPromiseCallback=t.removeParam=t.getHash=t.getQuery=t.toQueryString=t.formatUrl=t.generateRequestId=t.genSeqId=t.isFormData=t.isInstanceOf=t.isNull=t.isPalinObject=t.isUndefined=t.isString=t.isArray=void 0;var n=r(778);t.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},t.isString=function(e){return"string"==typeof e},t.isUndefined=function(e){return void 0===e},t.isPalinObject=function(e){return"[object Object]"===Object.prototype.toString.call(e)},t.isNull=function(e){return"[object Null]"===Object.prototype.toString.call(e)},t.isInstanceOf=function(e,t){return e instanceof t},t.isFormData=function(e){return"[object FormData]"===Object.prototype.toString.call(e)},t.genSeqId=function(){return Math.random().toString(16).slice(2)},t.generateRequestId=function(){var e=(new Date).getTime(),t=(null===Date||void 0===Date?void 0:Date.now)&&1e3*Date.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(r){var o=16*Math.random();return e>0?(o=(e+o)%16|0,e=Math.floor(e/16)):(o=(t+o)%16|0,t=Math.floor(t/16)),("x"===r?o:7&o|8).toString(16)}))},t.formatUrl=function(e,t,r){void 0===r&&(r={});var o=/\?/.test(t),n="";return Object.keys(r).forEach((function(e){""===n?!o&&(t+="?"):n+="&",n+="".concat(e,"=").concat(encodeURIComponent(r[e]))})),/^http(s)?:\/\//.test(t+=n)?t:"".concat(e).concat(t)},t.toQueryString=function(e){void 0===e&&(e={});var t=[];return Object.keys(e).forEach((function(r){t.push("".concat(r,"=").concat(encodeURIComponent(e[r])))})),t.join("&")},t.getQuery=function(e,t){if("undefined"==typeof window)return!1;var r=t||decodeURIComponent(window.location.search),o=new RegExp("(^|&)".concat(e,"=([^&]*)(&|$)")),n=r.substr(r.indexOf("?")+1).match(o);return null!=n?n[2]:""},t.getHash=function(e){if("undefined"==typeof window)return"";var t=window.location.hash.match(new RegExp("[#?&/]".concat(e,"=([^&#]*)")));return t?t[1]:""},t.removeParam=function(e,t){var r=t.split("?")[0],o=[],n=-1!==t.indexOf("?")?t.split("?")[1]:"";if(""!==n){for(var i=(o=n.split("&")).length-1;i>=0;i-=1)o[i].split("=")[0]===e&&o.splice(i,1);r="".concat(r,"?").concat(o.join("&"))}return r},t.createPromiseCallback=function(){var e={};if(!Promise){(e=function(){}).promise={};var t=function(){throw new Error('Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.')};return Object.defineProperty(e.promise,"then",{get:t}),Object.defineProperty(e.promise,"catch",{get:t}),e}var r=new Promise((function(t,r){e=function(e,o){return e?r(e):t(o)}}));return e.promise=r,e},t.execCallback=function(e,t,r){if(void 0===r&&(r=null),e&&"function"==typeof e)return e(t,r);if(t)throw t;return r},t.printWarn=function(e,t){console.warn("[".concat((0,n.getSdkName)(),"][").concat(e,"]:").concat(t))},t.printError=function(e,t){console.error({code:e,msg:"[".concat((0,n.getSdkName)(),"][").concat(e,"]:").concat(t)})},t.printInfo=function(e,t){console.log("[".concat((0,n.getSdkName)(),"][").concat(e,"]:").concat(t))},t.throwError=function(e,t){throw new Error(JSON.stringify({code:e,msg:"[".concat((0,n.getSdkName)(),"][").concat(e,"]:").concat(t)}))},t.printGroupLog=function(e){var t,r=e.title,o=e.subtitle,n=void 0===o?"":o,i=e.content,a=void 0===i?[]:i,s=e.printTrace,c=void 0!==s&&s,u=e.collapsed;void 0!==u&&u?(console.groupCollapsed||console.error)(r,n):(console.group||console.error)(r,n);for(var l=0,d=a;l<d.length;l++){var f=d[l],p=f.type,h=f.body;switch(p){case"info":console.log(h);break;case"warn":console.warn(h);break;case"error":console.error(h)}}c&&(console.trace||console.log)("stack trace:"),null===(t=console.groupEnd)||void 0===t||t.call(console)},t.sleep=function(e){return void 0===e&&(e=0),new Promise((function(t){return setTimeout(t,e)}))},t.transformPhone=function(e){return"+86".concat(e)},t.parseQueryString=function(e){e=e.replace(/^\?/,"");var t={};return e.split("&").forEach((function(e){var r=e.split("="),o=r[0],n=r[1];o=decodeURIComponent(o),n=decodeURIComponent(n),o&&(t[o]?Array.isArray(t[o])?t[o].push(n):t[o]=[t[o],n]:t[o]=n)})),t},t.parseCaptcha=function(e){var r={},n=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(n){e=n[1];var i=n[2];i&&(r=(0,t.parseQueryString)(i))}var a=r.token,s=o(r,["token"]);return/^data:/.test(e)&&!a?{error:"invalid_argument",error_description:"invalid captcha data: ".concat(e)}:a?{state:s.state,token:a,captchaData:e}:{error:"unimplemented",error_description:"need to impl captcha data"}}},388:e=>{e.exports={}},949:(e,t,r)=>{"use strict";function o(e){this.message=e}r.r(t),r.d(t,{InvalidTokenError:()=>a,default:()=>s}),o.prototype=new Error,o.prototype.name="InvalidCharacterError";var n="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new o("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,a=0,s="";n=t.charAt(a++);~n&&(r=i%4?64*r+n:n,i++%4)?s+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return s};function i(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(n(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return n(t)}}function a(e){this.message=e}a.prototype=new Error,a.prototype.name="InvalidTokenError";const s=function(e,t){if("string"!=typeof e)throw new a("Invalid token specified");var r=!0===(t=t||{}).header?0:1;try{return JSON.parse(i(e.split(".")[r]))}catch(e){throw new a("Invalid token specified: "+e.message)}}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o].call(i.exports,i,i.exports,r),i.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";var e=o;Object.defineProperty(e,"__esModule",{value:!0}),e.registerStorage=void 0;var t=r(456);e.registerStorage=t.registerStorage})(),o})()));