@tiledev/sdk-apptile-live-selling 0.16.0 → 0.16.1

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 (410) hide show
  1. package/dist/attribution.d.ts +2 -16
  2. package/dist/attribution.d.ts.map +1 -1
  3. package/dist/attribution.js +4 -10
  4. package/dist/attribution.js.map +1 -1
  5. package/dist/auctions.d.ts.map +1 -1
  6. package/dist/auctions.js +11 -42
  7. package/dist/auctions.js.map +1 -1
  8. package/dist/cartAttributes.d.ts +0 -10
  9. package/dist/cartAttributes.d.ts.map +1 -1
  10. package/dist/cartAttributes.js +1 -20
  11. package/dist/cartAttributes.js.map +1 -1
  12. package/dist/client.d.ts +2 -51
  13. package/dist/client.d.ts.map +1 -1
  14. package/dist/client.js +23 -123
  15. package/dist/client.js.map +1 -1
  16. package/dist/clips.d.ts +1 -12
  17. package/dist/clips.d.ts.map +1 -1
  18. package/dist/clips.js +6 -114
  19. package/dist/clips.js.map +1 -1
  20. package/dist/commentLinks.d.ts +0 -29
  21. package/dist/commentLinks.d.ts.map +1 -1
  22. package/dist/commentLinks.js.map +1 -1
  23. package/dist/engine.native.d.ts.map +1 -1
  24. package/dist/engine.native.js +845 -17
  25. package/dist/engine.native.js.map +1 -1
  26. package/dist/index.d.ts +4 -48
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +3 -240
  29. package/dist/index.js.map +1 -1
  30. package/dist/polls.d.ts.map +1 -1
  31. package/dist/polls.js +0 -3
  32. package/dist/polls.js.map +1 -1
  33. package/dist/react/LiveSellingProvider.d.ts +1 -54
  34. package/dist/react/LiveSellingProvider.d.ts.map +1 -1
  35. package/dist/react/LiveSellingProvider.js +3 -60
  36. package/dist/react/LiveSellingProvider.js.map +1 -1
  37. package/dist/react/LiveVideoTarget.d.ts.map +1 -1
  38. package/dist/react/LiveVideoTarget.js +3 -41
  39. package/dist/react/LiveVideoTarget.js.map +1 -1
  40. package/dist/react/index.d.ts +3 -30
  41. package/dist/react/index.d.ts.map +1 -1
  42. package/dist/react/index.js +1 -79
  43. package/dist/react/index.js.map +1 -1
  44. package/dist/react/index.web.d.ts +32 -36
  45. package/dist/react/index.web.d.ts.map +1 -1
  46. package/dist/react/index.web.js +122 -102
  47. package/dist/react/index.web.js.map +1 -1
  48. package/dist/react/useAuctionBidGate.d.ts +6 -62
  49. package/dist/react/useAuctionBidGate.d.ts.map +1 -1
  50. package/dist/react/useAuctionBidGate.js +27 -228
  51. package/dist/react/useAuctionBidGate.js.map +1 -1
  52. package/dist/react/useAuctionWins.d.ts +4 -14
  53. package/dist/react/useAuctionWins.d.ts.map +1 -1
  54. package/dist/react/useAuctionWins.js +5 -16
  55. package/dist/react/useAuctionWins.js.map +1 -1
  56. package/dist/react/useClips.d.ts +1 -7
  57. package/dist/react/useClips.d.ts.map +1 -1
  58. package/dist/react/useClips.js +7 -20
  59. package/dist/react/useClips.js.map +1 -1
  60. package/dist/react/useLiveSession.d.ts +3 -15
  61. package/dist/react/useLiveSession.d.ts.map +1 -1
  62. package/dist/react/useLiveSession.js +199 -612
  63. package/dist/react/useLiveSession.js.map +1 -1
  64. package/dist/react/useLiveStreams.d.ts.map +1 -1
  65. package/dist/react/useLiveStreams.js +2 -6
  66. package/dist/react/useLiveStreams.js.map +1 -1
  67. package/dist/react/useOngoingLive.d.ts +0 -1
  68. package/dist/react/useOngoingLive.d.ts.map +1 -1
  69. package/dist/react/useOngoingLive.js +1 -7
  70. package/dist/react/useOngoingLive.js.map +1 -1
  71. package/dist/react/useReplays.d.ts +0 -12
  72. package/dist/react/useReplays.d.ts.map +1 -1
  73. package/dist/react/useReplays.js +24 -56
  74. package/dist/react/useReplays.js.map +1 -1
  75. package/dist/react/useStreamInfo.d.ts +2 -13
  76. package/dist/react/useStreamInfo.d.ts.map +1 -1
  77. package/dist/react/useStreamInfo.js +8 -36
  78. package/dist/react/useStreamInfo.js.map +1 -1
  79. package/dist/replays.d.ts +0 -14
  80. package/dist/replays.d.ts.map +1 -1
  81. package/dist/replays.js +22 -68
  82. package/dist/replays.js.map +1 -1
  83. package/dist/session.d.ts +6 -39
  84. package/dist/session.d.ts.map +1 -1
  85. package/dist/session.js +22 -209
  86. package/dist/session.js.map +1 -1
  87. package/dist/sessionTypes.d.ts +18 -217
  88. package/dist/sessionTypes.d.ts.map +1 -1
  89. package/dist/sessionTypes.js +1 -2
  90. package/dist/sessionTypes.js.map +1 -1
  91. package/dist/streams.d.ts +1 -27
  92. package/dist/streams.d.ts.map +1 -1
  93. package/dist/streams.js +21 -84
  94. package/dist/streams.js.map +1 -1
  95. package/dist/types.d.ts +10 -288
  96. package/dist/types.d.ts.map +1 -1
  97. package/dist/types.js +1 -2
  98. package/dist/types.js.map +1 -1
  99. package/dist/wire.d.ts +0 -31
  100. package/dist/wire.d.ts.map +1 -1
  101. package/dist/wire.js +0 -25
  102. package/dist/wire.js.map +1 -1
  103. package/dist/zego.d.ts +1 -3
  104. package/dist/zego.d.ts.map +1 -1
  105. package/dist/zego.js +1 -1
  106. package/package.json +1 -1
  107. package/dist/auctionComments.d.ts +0 -25
  108. package/dist/auctionComments.d.ts.map +0 -1
  109. package/dist/auctionComments.js +0 -28
  110. package/dist/auctionComments.js.map +0 -1
  111. package/dist/auctionRules.d.ts +0 -77
  112. package/dist/auctionRules.d.ts.map +0 -1
  113. package/dist/auctionRules.js +0 -107
  114. package/dist/auctionRules.js.map +0 -1
  115. package/dist/cartExtension.d.ts +0 -39
  116. package/dist/cartExtension.d.ts.map +0 -1
  117. package/dist/cartExtension.js +0 -51
  118. package/dist/cartExtension.js.map +0 -1
  119. package/dist/checkoutRefused.d.ts +0 -9
  120. package/dist/checkoutRefused.d.ts.map +0 -1
  121. package/dist/checkoutRefused.js +0 -16
  122. package/dist/checkoutRefused.js.map +0 -1
  123. package/dist/clipsPage.d.ts +0 -29
  124. package/dist/clipsPage.d.ts.map +0 -1
  125. package/dist/clipsPage.js +0 -49
  126. package/dist/clipsPage.js.map +0 -1
  127. package/dist/commentHistory.d.ts +0 -70
  128. package/dist/commentHistory.d.ts.map +0 -1
  129. package/dist/commentHistory.js +0 -133
  130. package/dist/commentHistory.js.map +0 -1
  131. package/dist/commentLinkCards.d.ts +0 -11
  132. package/dist/commentLinkCards.d.ts.map +0 -1
  133. package/dist/commentLinkCards.js +0 -70
  134. package/dist/commentLinkCards.js.map +0 -1
  135. package/dist/giveawayPrize.d.ts +0 -13
  136. package/dist/giveawayPrize.d.ts.map +0 -1
  137. package/dist/giveawayPrize.js +0 -18
  138. package/dist/giveawayPrize.js.map +0 -1
  139. package/dist/giveawayPrizeLines.d.ts +0 -120
  140. package/dist/giveawayPrizeLines.d.ts.map +0 -1
  141. package/dist/giveawayPrizeLines.js +0 -97
  142. package/dist/giveawayPrizeLines.js.map +0 -1
  143. package/dist/giveawayPrizes.d.ts +0 -20
  144. package/dist/giveawayPrizes.d.ts.map +0 -1
  145. package/dist/giveawayPrizes.js +0 -50
  146. package/dist/giveawayPrizes.js.map +0 -1
  147. package/dist/giveawayRoster.d.ts +0 -53
  148. package/dist/giveawayRoster.d.ts.map +0 -1
  149. package/dist/giveawayRoster.js +0 -93
  150. package/dist/giveawayRoster.js.map +0 -1
  151. package/dist/heldComments.d.ts +0 -40
  152. package/dist/heldComments.d.ts.map +0 -1
  153. package/dist/heldComments.js +0 -75
  154. package/dist/heldComments.js.map +0 -1
  155. package/dist/hiddenShows.d.ts +0 -44
  156. package/dist/hiddenShows.d.ts.map +0 -1
  157. package/dist/hiddenShows.js +0 -53
  158. package/dist/hiddenShows.js.map +0 -1
  159. package/dist/linkLots.d.ts +0 -64
  160. package/dist/linkLots.d.ts.map +0 -1
  161. package/dist/linkLots.js +0 -84
  162. package/dist/linkLots.js.map +0 -1
  163. package/dist/liveHaptics.d.ts +0 -7
  164. package/dist/liveHaptics.d.ts.map +0 -1
  165. package/dist/liveHaptics.js +0 -11
  166. package/dist/liveHaptics.js.map +0 -1
  167. package/dist/liveHaptics.native.d.ts +0 -7
  168. package/dist/liveHaptics.native.d.ts.map +0 -1
  169. package/dist/liveHaptics.native.js +0 -12
  170. package/dist/liveHaptics.native.js.map +0 -1
  171. package/dist/livePages.d.ts +0 -176
  172. package/dist/livePages.d.ts.map +0 -1
  173. package/dist/livePages.js +0 -216
  174. package/dist/livePages.js.map +0 -1
  175. package/dist/liveRoom.d.ts +0 -21
  176. package/dist/liveRoom.d.ts.map +0 -1
  177. package/dist/liveRoom.js +0 -28
  178. package/dist/liveRoom.js.map +0 -1
  179. package/dist/liveShow.d.ts +0 -65
  180. package/dist/liveShow.d.ts.map +0 -1
  181. package/dist/liveShow.js +0 -65
  182. package/dist/liveShow.js.map +0 -1
  183. package/dist/missedPolls.d.ts +0 -27
  184. package/dist/missedPolls.d.ts.map +0 -1
  185. package/dist/missedPolls.js +0 -16
  186. package/dist/missedPolls.js.map +0 -1
  187. package/dist/pageOptions.d.ts +0 -149
  188. package/dist/pageOptions.d.ts.map +0 -1
  189. package/dist/pageOptions.js +0 -123
  190. package/dist/pageOptions.js.map +0 -1
  191. package/dist/pageTypes.d.ts +0 -185
  192. package/dist/pageTypes.d.ts.map +0 -1
  193. package/dist/pageTypes.js +0 -3
  194. package/dist/pageTypes.js.map +0 -1
  195. package/dist/phoneTaps.d.ts +0 -25
  196. package/dist/phoneTaps.d.ts.map +0 -1
  197. package/dist/phoneTaps.js +0 -47
  198. package/dist/phoneTaps.js.map +0 -1
  199. package/dist/pipWindow.d.ts +0 -85
  200. package/dist/pipWindow.d.ts.map +0 -1
  201. package/dist/pipWindow.js +0 -88
  202. package/dist/pipWindow.js.map +0 -1
  203. package/dist/react/clocks.d.ts +0 -29
  204. package/dist/react/clocks.d.ts.map +0 -1
  205. package/dist/react/clocks.js +0 -124
  206. package/dist/react/clocks.js.map +0 -1
  207. package/dist/react/navigation.d.ts +0 -13
  208. package/dist/react/navigation.d.ts.map +0 -1
  209. package/dist/react/navigation.js +0 -7
  210. package/dist/react/navigation.js.map +0 -1
  211. package/dist/react/platformSession.d.ts +0 -16
  212. package/dist/react/platformSession.d.ts.map +0 -1
  213. package/dist/react/platformSession.js +0 -28
  214. package/dist/react/platformSession.js.map +0 -1
  215. package/dist/react/platformSession.web.d.ts +0 -35
  216. package/dist/react/platformSession.web.d.ts.map +0 -1
  217. package/dist/react/platformSession.web.js +0 -148
  218. package/dist/react/platformSession.web.js.map +0 -1
  219. package/dist/react/replayPlayer.d.ts +0 -83
  220. package/dist/react/replayPlayer.d.ts.map +0 -1
  221. package/dist/react/replayPlayer.js +0 -315
  222. package/dist/react/replayPlayer.js.map +0 -1
  223. package/dist/react/share.d.ts +0 -22
  224. package/dist/react/share.d.ts.map +0 -1
  225. package/dist/react/share.js +0 -45
  226. package/dist/react/share.js.map +0 -1
  227. package/dist/react/shopifyProviders.d.ts +0 -82
  228. package/dist/react/shopifyProviders.d.ts.map +0 -1
  229. package/dist/react/shopifyProviders.js +0 -113
  230. package/dist/react/shopifyProviders.js.map +0 -1
  231. package/dist/react/showPages.d.ts +0 -106
  232. package/dist/react/showPages.d.ts.map +0 -1
  233. package/dist/react/showPages.js +0 -166
  234. package/dist/react/showPages.js.map +0 -1
  235. package/dist/react/showPagesOnDevice.d.ts +0 -18
  236. package/dist/react/showPagesOnDevice.d.ts.map +0 -1
  237. package/dist/react/showPagesOnDevice.js +0 -31
  238. package/dist/react/showPagesOnDevice.js.map +0 -1
  239. package/dist/react/startSignIn.d.ts +0 -3
  240. package/dist/react/startSignIn.d.ts.map +0 -1
  241. package/dist/react/startSignIn.js +0 -19
  242. package/dist/react/startSignIn.js.map +0 -1
  243. package/dist/react/systemPictureInPicture.d.ts +0 -34
  244. package/dist/react/systemPictureInPicture.d.ts.map +0 -1
  245. package/dist/react/systemPictureInPicture.js +0 -93
  246. package/dist/react/systemPictureInPicture.js.map +0 -1
  247. package/dist/react/useAccountName.d.ts +0 -8
  248. package/dist/react/useAccountName.d.ts.map +0 -1
  249. package/dist/react/useAccountName.js +0 -49
  250. package/dist/react/useAccountName.js.map +0 -1
  251. package/dist/react/useClipsPage.d.ts +0 -47
  252. package/dist/react/useClipsPage.d.ts.map +0 -1
  253. package/dist/react/useClipsPage.js +0 -130
  254. package/dist/react/useClipsPage.js.map +0 -1
  255. package/dist/react/useCommentLinkCards.d.ts +0 -6
  256. package/dist/react/useCommentLinkCards.d.ts.map +0 -1
  257. package/dist/react/useCommentLinkCards.js +0 -67
  258. package/dist/react/useCommentLinkCards.js.map +0 -1
  259. package/dist/react/useFeaturedClip.d.ts +0 -15
  260. package/dist/react/useFeaturedClip.d.ts.map +0 -1
  261. package/dist/react/useFeaturedClip.js +0 -52
  262. package/dist/react/useFeaturedClip.js.map +0 -1
  263. package/dist/react/useGiveawayEntry.d.ts +0 -59
  264. package/dist/react/useGiveawayEntry.d.ts.map +0 -1
  265. package/dist/react/useGiveawayEntry.js +0 -170
  266. package/dist/react/useGiveawayEntry.js.map +0 -1
  267. package/dist/react/useGiveawayPrize.d.ts +0 -12
  268. package/dist/react/useGiveawayPrize.d.ts.map +0 -1
  269. package/dist/react/useGiveawayPrize.js +0 -53
  270. package/dist/react/useGiveawayPrize.js.map +0 -1
  271. package/dist/react/useGiveawayPrizes.d.ts +0 -4
  272. package/dist/react/useGiveawayPrizes.d.ts.map +0 -1
  273. package/dist/react/useGiveawayPrizes.js +0 -58
  274. package/dist/react/useGiveawayPrizes.js.map +0 -1
  275. package/dist/react/useHiddenShows.d.ts +0 -10
  276. package/dist/react/useHiddenShows.d.ts.map +0 -1
  277. package/dist/react/useHiddenShows.js +0 -30
  278. package/dist/react/useHiddenShows.js.map +0 -1
  279. package/dist/react/useKeepScreenAwake.d.ts +0 -2
  280. package/dist/react/useKeepScreenAwake.d.ts.map +0 -1
  281. package/dist/react/useKeepScreenAwake.js +0 -34
  282. package/dist/react/useKeepScreenAwake.js.map +0 -1
  283. package/dist/react/useLiveAuction.d.ts +0 -106
  284. package/dist/react/useLiveAuction.d.ts.map +0 -1
  285. package/dist/react/useLiveAuction.js +0 -255
  286. package/dist/react/useLiveAuction.js.map +0 -1
  287. package/dist/react/useLiveChat.d.ts +0 -110
  288. package/dist/react/useLiveChat.d.ts.map +0 -1
  289. package/dist/react/useLiveChat.js +0 -230
  290. package/dist/react/useLiveChat.js.map +0 -1
  291. package/dist/react/useLiveGiveawaysAndPolls.d.ts +0 -95
  292. package/dist/react/useLiveGiveawaysAndPolls.d.ts.map +0 -1
  293. package/dist/react/useLiveGiveawaysAndPolls.js +0 -225
  294. package/dist/react/useLiveGiveawaysAndPolls.js.map +0 -1
  295. package/dist/react/useLivePage.d.ts +0 -136
  296. package/dist/react/useLivePage.d.ts.map +0 -1
  297. package/dist/react/useLivePage.js +0 -319
  298. package/dist/react/useLivePage.js.map +0 -1
  299. package/dist/react/useLiveShop.d.ts +0 -97
  300. package/dist/react/useLiveShop.d.ts.map +0 -1
  301. package/dist/react/useLiveShop.js +0 -197
  302. package/dist/react/useLiveShop.js.map +0 -1
  303. package/dist/react/useLiveShow.d.ts +0 -3
  304. package/dist/react/useLiveShow.d.ts.map +0 -1
  305. package/dist/react/useLiveShow.js +0 -21
  306. package/dist/react/useLiveShow.js.map +0 -1
  307. package/dist/react/useMySilentAuctionBids.d.ts +0 -29
  308. package/dist/react/useMySilentAuctionBids.d.ts.map +0 -1
  309. package/dist/react/useMySilentAuctionBids.js +0 -157
  310. package/dist/react/useMySilentAuctionBids.js.map +0 -1
  311. package/dist/react/useReplayPage.d.ts +0 -155
  312. package/dist/react/useReplayPage.d.ts.map +0 -1
  313. package/dist/react/useReplayPage.js +0 -580
  314. package/dist/react/useReplayPage.js.map +0 -1
  315. package/dist/react/useSilentAuctionLot.d.ts +0 -44
  316. package/dist/react/useSilentAuctionLot.d.ts.map +0 -1
  317. package/dist/react/useSilentAuctionLot.js +0 -168
  318. package/dist/react/useSilentAuctionLot.js.map +0 -1
  319. package/dist/react/useSilentAuctionLots.d.ts +0 -41
  320. package/dist/react/useSilentAuctionLots.d.ts.map +0 -1
  321. package/dist/react/useSilentAuctionLots.js +0 -64
  322. package/dist/react/useSilentAuctionLots.js.map +0 -1
  323. package/dist/react/useSilentAuctionRounds.d.ts +0 -15
  324. package/dist/react/useSilentAuctionRounds.d.ts.map +0 -1
  325. package/dist/react/useSilentAuctionRounds.js +0 -44
  326. package/dist/react/useSilentAuctionRounds.js.map +0 -1
  327. package/dist/replayPages.d.ts +0 -31
  328. package/dist/replayPages.d.ts.map +0 -1
  329. package/dist/replayPages.js +0 -34
  330. package/dist/replayPages.js.map +0 -1
  331. package/dist/shopifyCommerce.d.ts +0 -204
  332. package/dist/shopifyCommerce.d.ts.map +0 -1
  333. package/dist/shopifyCommerce.js +0 -217
  334. package/dist/shopifyCommerce.js.map +0 -1
  335. package/dist/shopifyIdentity.d.ts +0 -61
  336. package/dist/shopifyIdentity.d.ts.map +0 -1
  337. package/dist/shopifyIdentity.js +0 -61
  338. package/dist/shopifyIdentity.js.map +0 -1
  339. package/dist/shopifyIds.d.ts +0 -9
  340. package/dist/shopifyIds.d.ts.map +0 -1
  341. package/dist/shopifyIds.js +0 -18
  342. package/dist/shopifyIds.js.map +0 -1
  343. package/dist/showCredit.d.ts +0 -89
  344. package/dist/showCredit.d.ts.map +0 -1
  345. package/dist/showCredit.js +0 -120
  346. package/dist/showCredit.js.map +0 -1
  347. package/dist/showLinks.d.ts +0 -24
  348. package/dist/showLinks.d.ts.map +0 -1
  349. package/dist/showLinks.js +0 -23
  350. package/dist/showLinks.js.map +0 -1
  351. package/dist/showLots.d.ts +0 -44
  352. package/dist/showLots.d.ts.map +0 -1
  353. package/dist/showLots.js +0 -70
  354. package/dist/showLots.js.map +0 -1
  355. package/dist/showNames.d.ts +0 -77
  356. package/dist/showNames.d.ts.map +0 -1
  357. package/dist/showNames.js +0 -143
  358. package/dist/showNames.js.map +0 -1
  359. package/dist/showPages.d.ts +0 -56
  360. package/dist/showPages.d.ts.map +0 -1
  361. package/dist/showPages.js +0 -48
  362. package/dist/showPages.js.map +0 -1
  363. package/dist/silentAuctionFeed.d.ts +0 -49
  364. package/dist/silentAuctionFeed.d.ts.map +0 -1
  365. package/dist/silentAuctionFeed.js +0 -242
  366. package/dist/silentAuctionFeed.js.map +0 -1
  367. package/dist/silentAuctionRules.d.ts +0 -253
  368. package/dist/silentAuctionRules.d.ts.map +0 -1
  369. package/dist/silentAuctionRules.js +0 -489
  370. package/dist/silentAuctionRules.js.map +0 -1
  371. package/dist/silentAuctions.d.ts +0 -65
  372. package/dist/silentAuctions.d.ts.map +0 -1
  373. package/dist/silentAuctions.js +0 -272
  374. package/dist/silentAuctions.js.map +0 -1
  375. package/dist/storeData.d.ts +0 -16
  376. package/dist/storeData.d.ts.map +0 -1
  377. package/dist/storeData.js +0 -19
  378. package/dist/storeData.js.map +0 -1
  379. package/dist/ui/BubbleFrame.d.ts +0 -38
  380. package/dist/ui/BubbleFrame.d.ts.map +0 -1
  381. package/dist/ui/BubbleFrame.js +0 -181
  382. package/dist/ui/BubbleFrame.js.map +0 -1
  383. package/dist/ui/LiveBubble.d.ts +0 -43
  384. package/dist/ui/LiveBubble.d.ts.map +0 -1
  385. package/dist/ui/LiveBubble.js +0 -116
  386. package/dist/ui/LiveBubble.js.map +0 -1
  387. package/dist/ui/ReplayBubble.d.ts +0 -23
  388. package/dist/ui/ReplayBubble.d.ts.map +0 -1
  389. package/dist/ui/ReplayBubble.js +0 -71
  390. package/dist/ui/ReplayBubble.js.map +0 -1
  391. package/dist/ui.d.ts +0 -27
  392. package/dist/ui.d.ts.map +0 -1
  393. package/dist/ui.js +0 -34
  394. package/dist/ui.js.map +0 -1
  395. package/dist/unreadRoomMessages.d.ts +0 -26
  396. package/dist/unreadRoomMessages.d.ts.map +0 -1
  397. package/dist/unreadRoomMessages.js +0 -62
  398. package/dist/unreadRoomMessages.js.map +0 -1
  399. package/dist/viewerRules.d.ts +0 -38
  400. package/dist/viewerRules.d.ts.map +0 -1
  401. package/dist/viewerRules.js +0 -46
  402. package/dist/viewerRules.js.map +0 -1
  403. package/dist/winsAttribution.d.ts +0 -22
  404. package/dist/winsAttribution.d.ts.map +0 -1
  405. package/dist/winsAttribution.js +0 -49
  406. package/dist/winsAttribution.js.map +0 -1
  407. package/dist/zegoEngine.d.ts +0 -173
  408. package/dist/zegoEngine.d.ts.map +0 -1
  409. package/dist/zegoEngine.js +0 -1069
  410. package/dist/zegoEngine.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"commentHistory.d.ts","sourceRoot":"","sources":["../src/commentHistory.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAiB,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D;;;GAGG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,2BAA2B,QAA6B,CAAC;AAEtE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,OAAQ,CAAC;AAE7C;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAEpC,6CAA6C;AAC7C,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,yEAAyE;IACzE,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAC7C;AAOD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,WAAW,EAAE,CA8B7D;AAED,MAAM,WAAW,qBAAqB;IACpC,iGAAiG;IACjG,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,wGAAwG;IACxG,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,WAAW,EAAE,EACtB,IAAI,EAAE,WAAW,EAAE,EACnB,OAAO,EAAE,qBAAqB,GAC7B,WAAW,EAAE,CA2Bf"}
@@ -1,133 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HOST_SELF_NAME = exports.DUPLICATE_ROW_WINDOW_MS = exports.COMMENT_HISTORY_FETCH_LIMIT = exports.COMMENT_HISTORY_WINDOW = void 0;
4
- exports.toCommentHistory = toCommentHistory;
5
- exports.mergeCommentHistory = mergeCommentHistory;
6
- /**
7
- * What the room said before this viewer arrived — ported from Freckled Poppy's `liveCommentHistory.ts`
8
- * and the merge on its Live screen.
9
- *
10
- * A live room's comments arrive over the Zego room and nowhere else, so the pane started EMPTY every
11
- * time the session did — and the session starts from nothing on every launch. A shopper who reopens the
12
- * app comes back to a show they were part of and cannot see a word of it.
13
- *
14
- * `/live-streaming/comments?streaming_id=…` closes that gap: anonymous, company header only, newest
15
- * first, and **filled while the show is on air** (for a finished recording the same route answers an
16
- * empty list; a replay's chat comes from the CDN file instead — see `replays.comments`).
17
- *
18
- * Pure, so it is tested without a room: `toCommentHistory` reads the gateway's rows, and
19
- * `mergeCommentHistory` puts them in front of what the room has delivered since.
20
- */
21
- const showNames_1 = require("./showNames");
22
- /**
23
- * How many of the most recent lines to hand over. The pane shows a handful and scrolls; a rejoining
24
- * shopper wants the tail of the conversation, not an hour of it.
25
- */
26
- exports.COMMENT_HISTORY_WINDOW = 40;
27
- /**
28
- * Asked for wider than the window because the gateway stores every line two to four times: forty
29
- * lines can take four times as many rows, and a tighter read would come back with ten.
30
- */
31
- exports.COMMENT_HISTORY_FETCH_LIMIT = exports.COMMENT_HISTORY_WINDOW * 4;
32
- /**
33
- * Two identical lines closer together than this are the store's own copies, not someone saying the
34
- * same thing twice. Generous — the copies seen land milliseconds apart — because the costs are
35
- * lopsided: collapsing a genuine repeat loses one line, keeping the copies makes the pane look broken.
36
- */
37
- exports.DUPLICATE_ROW_WINDOW_MS = 5000;
38
- /**
39
- * The name the host dashboard stores the host's OWN lines under. The room broadcasts the same lines
40
- * under the brand (`LiveStream.hostName`), and a shopper reading "You" would think they had said it.
41
- */
42
- exports.HOST_SELF_NAME = 'You';
43
- function toCommentSource(source) {
44
- const upper = source === null || source === void 0 ? void 0 : source.trim().toUpperCase();
45
- return upper === 'HOST' || upper === 'MODERATOR' || upper === 'TIP' ? upper : 'USER';
46
- }
47
- /**
48
- * The gateway's rows as comments, oldest first, the last `COMMENT_HISTORY_WINDOW` of them.
49
- *
50
- * - Muted lines and empty lines are left out.
51
- * - Sorted rather than reversed: the wire is newest first today, but the order is the service's to
52
- * change. Ties keep the order they arrived in.
53
- * - A run of identical lines (same speaker, same words) within `DUPLICATE_ROW_WINDOW_MS` of the last
54
- * one kept is one line.
55
- * - `isOwn` is false on every line: each stored row carries the HOST account's `user_id`, viewer lines
56
- * included, so nothing says which device wrote it. `mergeCommentHistory` re-marks by name.
57
- */
58
- function toCommentHistory(rows) {
59
- var _a, _b;
60
- if (!Array.isArray(rows))
61
- return [];
62
- const said = rows
63
- .map((raw, index) => ({ raw, index }))
64
- .filter((row) => !!row.raw && typeof row.raw.comment === 'string' && !!row.raw.comment.trim() && !row.raw.muted)
65
- .map((row) => { var _a; return ({ ...row, atMs: Number((_a = row.raw.relative_timestamp) !== null && _a !== void 0 ? _a : 0) || 0 }); })
66
- .sort((a, b) => a.atMs - b.atMs || a.index - b.index);
67
- const lastSaidAt = new Map();
68
- const kept = [];
69
- for (const { raw, index, atMs } of said) {
70
- const text = String(raw.comment);
71
- // Never an email: the stored rows keep whatever an older app published (`publicName`).
72
- const userName = (_a = (0, showNames_1.publicName)(raw.user_name)) !== null && _a !== void 0 ? _a : 'Anonymous';
73
- const sameLine = `${userName}\u0000${text}`;
74
- const previous = lastSaidAt.get(sameLine);
75
- if (previous !== undefined && atMs - previous <= exports.DUPLICATE_ROW_WINDOW_MS)
76
- continue;
77
- lastSaidAt.set(sameLine, atMs);
78
- kept.push({
79
- id: `history-${(_b = raw.comment_id) !== null && _b !== void 0 ? _b : index}`,
80
- text,
81
- userName,
82
- source: toCommentSource(raw.source),
83
- isOwn: false,
84
- });
85
- }
86
- return kept.slice(-exports.COMMENT_HISTORY_WINDOW);
87
- }
88
- /**
89
- * History in front of the comments the room has delivered, with nothing said twice.
90
- *
91
- * - A history line is the stored copy of a delivered line when the same speaker says the same words.
92
- * "You" counts as the host for that comparison, because the dashboard stores the host's lines as
93
- * "You" while the room broadcasts them under the brand — the duplicated "won the Giveaway" line.
94
- * - A history line is also the copy of one of this device's own delivered lines when the words match,
95
- * whatever name it carries: a comment sent in the same moment as a sign-in can carry another name.
96
- * - **Each delivered line stands for one stored copy, the newest one not yet matched** (ENG-969,
97
- * 2026-10-22). Matching by words alone dropped every earlier line that said the same thing: the host
98
- * sent a link, then the same link again, and the first one disappeared. Order can't decide it either:
99
- * the stored order of the host's own lines differs from the room's.
100
- * - A kept "You" line is renamed to the host, and a kept USER line under this device's name is marked
101
- * `isOwn`.
102
- *
103
- * Returns `live` itself when there is nothing to add, so an unchanged list costs no render.
104
- */
105
- function mergeCommentHistory(history, live, context) {
106
- var _a, _b;
107
- if (!history.length)
108
- return live;
109
- const host = ((_a = context.hostName) === null || _a === void 0 ? void 0 : _a.trim()) || null;
110
- const ownName = ((_b = context.ownName) === null || _b === void 0 ? void 0 : _b.trim()) || null;
111
- const speaker = (name) => {
112
- const trimmed = name.trim();
113
- return trimmed === exports.HOST_SELF_NAME && host ? host : trimmed;
114
- };
115
- const sameLine = (comment) => `${speaker(comment.userName)}\u0000${comment.text}`;
116
- const isCopyOf = (stored, delivered) => sameLine(stored) === sameLine(delivered) || (delivered.isOwn && stored.text === delivered.text);
117
- // Newest first, so a line said twice is matched with its own stored copy and the earlier one stays.
118
- const notYetMatched = [...live];
119
- const earlier = [];
120
- for (let index = history.length - 1; index >= 0; index -= 1) {
121
- const comment = history[index];
122
- const copyOf = notYetMatched.findIndex((delivered) => isCopyOf(comment, delivered));
123
- if (copyOf >= 0) {
124
- notYetMatched.splice(copyOf, 1);
125
- continue;
126
- }
127
- const userName = speaker(comment.userName);
128
- const isOwn = comment.isOwn || (comment.source === 'USER' && !!ownName && userName === ownName);
129
- earlier.unshift(userName === comment.userName && isOwn === comment.isOwn ? comment : { ...comment, userName, isOwn });
130
- }
131
- return earlier.length ? [...earlier, ...live] : live;
132
- }
133
- //# sourceMappingURL=commentHistory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commentHistory.js","sourceRoot":"","sources":["../src/commentHistory.ts"],"names":[],"mappings":";;;AAuEA,4CA8BC;AA0BD,kDA+BC;AA9JD;;;;;;;;;;;;;;GAcG;AACH,2CAAyC;AAGzC;;;GAGG;AACU,QAAA,sBAAsB,GAAG,EAAE,CAAC;AAEzC;;;GAGG;AACU,QAAA,2BAA2B,GAAG,8BAAsB,GAAG,CAAC,CAAC;AAEtE;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,IAAK,CAAC;AAE7C;;;GAGG;AACU,QAAA,cAAc,GAAG,KAAK,CAAC;AAcpC,SAAS,eAAe,CAAC,MAAiC;IACxD,MAAM,KAAK,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,GAAG,WAAW,EAAE,CAAC;IAC3C,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,WAAW,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;AACvF,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,gBAAgB,CAAC,IAAa;;IAC5C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,CAAC;IACpC,MAAM,IAAI,GAAI,IAAqC;SAChD,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;SACrC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AAoG;IACpG,MAAM,aAAa,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAChC,MAAM,OAAO,GAAkB,EAAE,CAAC;IAClC,KAAK,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;QACpF,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;YAChB,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAChC,SAAS;QACX,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,OAAO,IAAI,QAAQ,KAAK,OAAO,CAAC,CAAC;QAChG,OAAO,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,QAAQ,IAAI,KAAK,KAAK,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACxH,CAAC;IACD,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACvD,CAAC"}
@@ -1,11 +0,0 @@
1
- import type { CommentLink, CommentLinkCard } from './commentLinks';
2
- /**
3
- * What is known about a link's card: the card, null when there is none (an outside link, or a store
4
- * link that doesn't resolve), or undefined when it hasn't been asked yet.
5
- */
6
- export declare function cachedCommentLinkCard(link: CommentLink): CommentLinkCard | null | undefined;
7
- /** A link's card, asking the commerce adapter the first time. Null when it has none. Never rejects. */
8
- export declare function resolveCommentLinkCard(link: CommentLink): Promise<CommentLinkCard | null>;
9
- /** Forget every card: a store switch, or a test. */
10
- export declare function clearCommentLinkCards(): void;
11
- //# sourceMappingURL=commentLinkCards.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commentLinkCards.d.ts","sourceRoot":"","sources":["../src/commentLinkCards.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAoB,MAAM,gBAAgB,CAAC;AAUrF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,GAAG,eAAe,GAAG,IAAI,GAAG,SAAS,CAG3F;AAED,uGAAuG;AACvG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CA0BzF;AAED,oDAAoD;AACpD,wBAAgB,qBAAqB,IAAI,IAAI,CAG5C"}
@@ -1,70 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cachedCommentLinkCard = cachedCommentLinkCard;
4
- exports.resolveCommentLinkCard = resolveCommentLinkCard;
5
- exports.clearCommentLinkCards = clearCommentLinkCards;
6
- /**
7
- * Store links in comments, as cards (0.12.0, moved from Sparkl's app on 2026-10-17: "added in the SDK").
8
- *
9
- * The commerce adapter builds a card (`CommerceAdapter.commentLinkCard`); this file asks it once per
10
- * link and remembers the answer for the session, so a link pasted into twenty comments, or into the
11
- * next show, costs one read. `useCommentLinkCards` is the screen's way in.
12
- *
13
- * - **An answer is kept:** a card, or a definite "no such product" (null).
14
- * - **A failure isn't** (offline, a 5xx): the next comment carrying the link asks again. Keeping it as
15
- * null hid that link's card in every show for the rest of the session (Sparkl, before 33.2.0).
16
- * - **One read per link at a time:** a second ask while the first is out shares it.
17
- * - **An outside link never asks:** it is somebody else's site, and the host's own unfurled card
18
- * (`LiveComment.urlPreview`) is the only thing that can describe it.
19
- */
20
- const client_1 = require("./client");
21
- const cards = new Map();
22
- const inFlight = new Map();
23
- /** One entry per thing a card shows: a product, one of its variants, or a collection. */
24
- function cardKey(link) {
25
- var _a;
26
- return link.kind === 'product' ? `product:${link.handle}:${(_a = link.variantId) !== null && _a !== void 0 ? _a : ''}` : `collection:${link.handle}`;
27
- }
28
- /**
29
- * What is known about a link's card: the card, null when there is none (an outside link, or a store
30
- * link that doesn't resolve), or undefined when it hasn't been asked yet.
31
- */
32
- function cachedCommentLinkCard(link) {
33
- if (link.kind === 'external')
34
- return null;
35
- return cards.get(cardKey(link));
36
- }
37
- /** A link's card, asking the commerce adapter the first time. Null when it has none. Never rejects. */
38
- function resolveCommentLinkCard(link) {
39
- var _a, _b;
40
- if (link.kind === 'external')
41
- return Promise.resolve(null);
42
- const build = (_a = (0, client_1.getCommerce)()) === null || _a === void 0 ? void 0 : _a.commentLinkCard;
43
- if (!build)
44
- return Promise.resolve(null);
45
- const key = cardKey(link);
46
- if (cards.has(key))
47
- return Promise.resolve((_b = cards.get(key)) !== null && _b !== void 0 ? _b : null);
48
- const pending = inFlight.get(key);
49
- if (pending)
50
- return pending;
51
- const request = build(link)
52
- .then((card) => {
53
- cards.set(key, card);
54
- return card;
55
- }, (caught) => {
56
- (0, client_1.getLogger)().error(caught, { at: 'commentLinkCards.resolve', url: link.url });
57
- return null;
58
- })
59
- .finally(() => {
60
- inFlight.delete(key);
61
- });
62
- inFlight.set(key, request);
63
- return request;
64
- }
65
- /** Forget every card: a store switch, or a test. */
66
- function clearCommentLinkCards() {
67
- cards.clear();
68
- inFlight.clear();
69
- }
70
- //# sourceMappingURL=commentLinkCards.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commentLinkCards.js","sourceRoot":"","sources":["../src/commentLinkCards.ts"],"names":[],"mappings":";;AA6BA,sDAGC;AAGD,wDA0BC;AAGD,sDAGC;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AAC,IAAI,CAAC;SACxB,IAAI,CACH,CAAC,IAAI,EAAE,EAAE;QACP,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC,EACD,CAAC,MAAe,EAAE,EAAE;QAClB,IAAA,kBAAS,GAAE,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,0BAA0B,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC,CACF;SACA,OAAO,CAAC,GAAG,EAAE;QACZ,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;IACL,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAC3B,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,oDAAoD;AACpD,SAAgB,qBAAqB;IACnC,KAAK,CAAC,KAAK,EAAE,CAAC;IACd,QAAQ,CAAC,KAAK,EAAE,CAAC;AACnB,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * The giveaway's prize in the catalogue (0.9.0, "SDK move 8"): which of the product's variants is the
3
- * one given away. The record names it by the gateway's bare id (`"44145257709883"`); the catalogue by
4
- * its own (a Shopify GID, `gid://shopify/ProductVariant/44145257709883`). `useGiveawayPrize` is the hook.
5
- *
6
- * Pure, so it loads in plain Node for tests and in an app's own test runner.
7
- */
8
- import type { LiveProduct, LiveProductVariant } from './sessionTypes';
9
- /** A variant id from the giveaway's record against the catalogue's: the same variant? Equal, or ending in `/` and the id. */
10
- export declare function isTheVariant(recordVariantId: string | null | undefined, catalogueVariantId: string): boolean;
11
- /** The given-away variant among the product's, or null when the record names none or the product doesn't have it. */
12
- export declare function givenAwayVariant(product: Pick<LiveProduct, 'variants'> | null | undefined, recordVariantId: string | null | undefined): LiveProductVariant | null;
13
- //# sourceMappingURL=giveawayPrize.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"giveawayPrize.d.ts","sourceRoot":"","sources":["../src/giveawayPrize.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEtE,6HAA6H;AAC7H,wBAAgB,YAAY,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAG5G;AAED,qHAAqH;AACrH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG,IAAI,GAAG,SAAS,EACzD,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACzC,kBAAkB,GAAG,IAAI,CAG3B"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isTheVariant = isTheVariant;
4
- exports.givenAwayVariant = givenAwayVariant;
5
- /** A variant id from the giveaway's record against the catalogue's: the same variant? Equal, or ending in `/` and the id. */
6
- function isTheVariant(recordVariantId, catalogueVariantId) {
7
- if (!recordVariantId)
8
- return false;
9
- return catalogueVariantId === recordVariantId || catalogueVariantId.endsWith(`/${recordVariantId}`);
10
- }
11
- /** The given-away variant among the product's, or null when the record names none or the product doesn't have it. */
12
- function givenAwayVariant(product, recordVariantId) {
13
- var _a;
14
- if (!product)
15
- return null;
16
- return (_a = product.variants.find((variant) => isTheVariant(recordVariantId, variant.id))) !== null && _a !== void 0 ? _a : null;
17
- }
18
- //# sourceMappingURL=giveawayPrize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"giveawayPrize.js","sourceRoot":"","sources":["../src/giveawayPrize.ts"],"names":[],"mappings":";;AAUA,oCAGC;AAGD,4CAMC;AAbD,6HAA6H;AAC7H,SAAgB,YAAY,CAAC,eAA0C,EAAE,kBAA0B;IACjG,IAAI,CAAC,eAAe;QAAE,OAAO,KAAK,CAAC;IACnC,OAAO,kBAAkB,KAAK,eAAe,IAAI,kBAAkB,CAAC,QAAQ,CAAC,IAAI,eAAe,EAAE,CAAC,CAAC;AACtG,CAAC;AAED,qHAAqH;AACrH,SAAgB,gBAAgB,CAC9B,OAAyD,EACzD,eAA0C;;IAE1C,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAC1B,OAAO,MAAA,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,mCAAI,IAAI,CAAC;AAC/F,CAAC"}
@@ -1,120 +0,0 @@
1
- /**
2
- * A giveaway prize in the shopping cart.
3
- *
4
- * The live-selling service adds a won prize to the winner's cart, stamped with a line attribute, and
5
- * the store's cart transform makes that line free. The cart has to recognise the line (no stepper, no
6
- * remove) and show what it costs.
7
- */
8
- import type { ShopifyMoney } from './shopifyCommerce';
9
- /**
10
- * The keys a prize line is stamped with, both in use: `_isGiveawayItem`, which the live-selling
11
- * service writes on the prize it adds to a winner's cart (seen on real lines: Freckled Poppy
12
- * 2026-09-07, Amore 2026-10-05), and `_giveawayItem`, which Freckled Poppy's auction cart writes.
13
- */
14
- export declare const GIVEAWAY_PRIZE_KEYS: readonly string[];
15
- /**
16
- * The key to stamp a prize with (0.14.0, moved from amore-v2's `src/core/providers/liveSelling.tsx`):
17
- * `_isGiveawayItem`, the platform's. The live-selling service stamps it on the prize it adds to a
18
- * winner's cart, the order webhook settles giveaway claims by it, and an app's wins checkout writes it
19
- * (`ShopifyLiveSellingProvider`'s and `createShopifyLiveCommerce`'s `prizeWriteKey`). It only marks
20
- * the line as a prize (a card of its own, no stepper or bin); the prize's `GIVEAWAY-…` discount code is
21
- * what makes it free. Amore's since 2026-10-05; K-Marie's since 2026-10-19, which wrote `_giveawayItem`
22
- * before (`GIVEAWAY_PRIZE_KEYS` still reads both).
23
- */
24
- export declare const GIVEAWAY_PRIZE_KEY = "_isGiveawayItem";
25
- export interface GiveawayPrizeLineOptions {
26
- /** The keys that mark a prize on this store. Defaults to `GIVEAWAY_PRIZE_KEYS`, both spellings. */
27
- keys?: readonly string[];
28
- }
29
- /**
30
- * Whether a cart line is stamped as a giveaway prize: any of `keys`, with any value but `"false"` (the
31
- * service's value isn't documented, and a stamped line is a prize).
32
- *
33
- * The stamp proves a prize, never a price: the store's repricing may not have run (Freckled Poppy saw
34
- * stamped lines charged in full, 2026-09-15), so show the line's price with `prizeLinePrice`.
35
- */
36
- export declare function isGiveawayPrizeLine(line: {
37
- attributes?: readonly {
38
- key: string;
39
- value?: string | null;
40
- }[] | null;
41
- }, options?: GiveawayPrizeLineOptions): boolean;
42
- /** What a prize line costs now. */
43
- export interface PrizeLinePrice {
44
- /** The price of one unit now: the line's total shared over its quantity. */
45
- nowPerUnit: ShopifyMoney;
46
- /** The line costs nothing: the store has made it free. */
47
- costsNothing: boolean;
48
- /** It costs less than the unit price, so show the unit price struck through beside it. */
49
- repriced: boolean;
50
- }
51
- /**
52
- * What a prize line costs now, per unit. The store makes a prize free by zeroing the line's total, not
53
- * its unit price: Shopify's `amountPerQuantity` stays the full price ($9.00 on a $0.00 line, Amore
54
- * 2026-10-05; $4.00 on $0.00, Freckled Poppy 2026-09-07). So the line's total, shared over its units,
55
- * is the price.
56
- */
57
- export declare function prizeLinePrice(line: {
58
- quantity: number;
59
- cost: {
60
- totalAmount: ShopifyMoney;
61
- };
62
- merchandise: {
63
- price: ShopifyMoney;
64
- };
65
- }): PrizeLinePrice;
66
- /**
67
- * The name the live-selling service gives each giveaway win's discount code: `GIVEAWAY-` and a number
68
- * (seen on Amore's store: `GIVEAWAY-1791199646184` and `GIVEAWAY-1791201000218` on 2026-10-06,
69
- * `GIVEAWAY-1791449255616` on 2026-10-08). Matched whatever the case.
70
- */
71
- export declare const GIVEAWAY_CODE_PREFIX = "GIVEAWAY-";
72
- /** Whether a discount code is a giveaway win's: it starts with `GIVEAWAY_CODE_PREFIX`. */
73
- export declare function isGiveawayCode(code: string | null | undefined): boolean;
74
- /** A cart line as `prizesCoveredByGiveawayCodes` reads it. sdk-shopify's `CartLine` (0.12 and up) fits. */
75
- export interface CartLineForGiveawayCodes {
76
- quantity: number;
77
- attributes?: readonly {
78
- key: string;
79
- value?: string | null;
80
- }[] | null;
81
- cost: {
82
- totalAmount: ShopifyMoney;
83
- };
84
- merchandise: {
85
- price: ShopifyMoney;
86
- };
87
- /** Each discount's share of the line (sdk-shopify 0.12's `line.discounts`). */
88
- discounts?: readonly {
89
- amount: ShopifyMoney;
90
- code: string | null;
91
- }[] | null;
92
- }
93
- /**
94
- * Whether the giveaway codes on a cart pay for its prizes in full, wherever Shopify put their money.
95
- *
96
- * A giveaway's code takes the prize's price off its size, and Shopify spreads it over every line of
97
- * that size. With the prize and a paid line of the same size in the cart, a $20 code took $10 off each
98
- * (Amore, 2026-10-08): the prize line alone looks half-paid, though the cart's total is right. So the
99
- * codes are added up across the whole cart and compared with the full price of the prizes that still
100
- * cost something. When they cover it, every prize is in fact free and its card can say so. When they
101
- * don't, the prizes' true prices stand: two prizes of one size whose codes don't stack got $29 off for
102
- * $58 of prizes (Amore, 2026-10-06).
103
- *
104
- * Prizes the store already made free (their line costs nothing) aren't counted, and neither is what a
105
- * code took off them, so one prize's code can't stand in for another's. True when no prize still costs
106
- * anything. Pass the same `keys` as to `isGiveawayPrizeLine`.
107
- */
108
- export declare function prizesCoveredByGiveawayCodes(lines: readonly CartLineForGiveawayCodes[], options?: GiveawayPrizeLineOptions): boolean;
109
- /**
110
- * The variant ids of the prizes among a customer's wins: what `useAuctionWins().giveawayVariantIds`
111
- * holds. A cart checks a line's variant against it to show a prize the host put in the shopping cart
112
- * with no stamp as a prize.
113
- */
114
- export declare function giveawayVariantIdsOf(wins: readonly {
115
- isGiveaway: boolean;
116
- variant: {
117
- id: string;
118
- };
119
- }[]): ReadonlySet<string>;
120
- //# sourceMappingURL=giveawayPrizeLines.d.ts.map
@@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;AAC3G,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,SAAS;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,GAAG,IAAI,CAAC;IACtE,IAAI,EAAE;QAAE,WAAW,EAAE,YAAY,CAAA;KAAE,CAAC;IACpC,WAAW,EAAE;QAAE,KAAK,EAAE,YAAY,CAAA;KAAE,CAAC;IACrC,+EAA+E;IAC/E,SAAS,CAAC,EAAE,SAAS;QAAE,MAAM,EAAE,YAAY,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,EAAE,GAAG,IAAI,CAAC;CAC7E;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,SAAS,wBAAwB,EAAE,EAC1C,OAAO,GAAE,wBAA6B,GACrC,OAAO,CAYT;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,SAAS;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAAE,GAChE,WAAW,CAAC,MAAM,CAAC,CAErB"}
@@ -1,97 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GIVEAWAY_CODE_PREFIX = exports.GIVEAWAY_PRIZE_KEY = exports.GIVEAWAY_PRIZE_KEYS = void 0;
4
- exports.isGiveawayPrizeLine = isGiveawayPrizeLine;
5
- exports.prizeLinePrice = prizeLinePrice;
6
- exports.isGiveawayCode = isGiveawayCode;
7
- exports.prizesCoveredByGiveawayCodes = prizesCoveredByGiveawayCodes;
8
- exports.giveawayVariantIdsOf = giveawayVariantIdsOf;
9
- /**
10
- * The keys a prize line is stamped with, both in use: `_isGiveawayItem`, which the live-selling
11
- * service writes on the prize it adds to a winner's cart (seen on real lines: Freckled Poppy
12
- * 2026-09-07, Amore 2026-10-05), and `_giveawayItem`, which Freckled Poppy's auction cart writes.
13
- */
14
- exports.GIVEAWAY_PRIZE_KEYS = ['_isGiveawayItem', '_giveawayItem'];
15
- /**
16
- * The key to stamp a prize with (0.14.0, moved from amore-v2's `src/core/providers/liveSelling.tsx`):
17
- * `_isGiveawayItem`, the platform's. The live-selling service stamps it on the prize it adds to a
18
- * winner's cart, the order webhook settles giveaway claims by it, and an app's wins checkout writes it
19
- * (`ShopifyLiveSellingProvider`'s and `createShopifyLiveCommerce`'s `prizeWriteKey`). It only marks
20
- * the line as a prize (a card of its own, no stepper or bin); the prize's `GIVEAWAY-…` discount code is
21
- * what makes it free. Amore's since 2026-10-05; K-Marie's since 2026-10-19, which wrote `_giveawayItem`
22
- * before (`GIVEAWAY_PRIZE_KEYS` still reads both).
23
- */
24
- exports.GIVEAWAY_PRIZE_KEY = '_isGiveawayItem';
25
- /**
26
- * Whether a cart line is stamped as a giveaway prize: any of `keys`, with any value but `"false"` (the
27
- * service's value isn't documented, and a stamped line is a prize).
28
- *
29
- * The stamp proves a prize, never a price: the store's repricing may not have run (Freckled Poppy saw
30
- * stamped lines charged in full, 2026-09-15), so show the line's price with `prizeLinePrice`.
31
- */
32
- function isGiveawayPrizeLine(line, options = {}) {
33
- var _a, _b;
34
- const keys = (_a = options.keys) !== null && _a !== void 0 ? _a : exports.GIVEAWAY_PRIZE_KEYS;
35
- return ((_b = line.attributes) !== null && _b !== void 0 ? _b : []).some((attribute) => keys.includes(attribute.key) && attribute.value !== 'false');
36
- }
37
- /**
38
- * What a prize line costs now, per unit. The store makes a prize free by zeroing the line's total, not
39
- * its unit price: Shopify's `amountPerQuantity` stays the full price ($9.00 on a $0.00 line, Amore
40
- * 2026-10-05; $4.00 on $0.00, Freckled Poppy 2026-09-07). So the line's total, shared over its units,
41
- * is the price.
42
- */
43
- function prizeLinePrice(line) {
44
- const total = Number(line.cost.totalAmount.amount);
45
- const perUnit = line.quantity > 0 ? total / line.quantity : total;
46
- return {
47
- nowPerUnit: { amount: perUnit.toFixed(2), currencyCode: line.cost.totalAmount.currencyCode },
48
- costsNothing: total === 0,
49
- repriced: perUnit < Number(line.merchandise.price.amount),
50
- };
51
- }
52
- /**
53
- * The name the live-selling service gives each giveaway win's discount code: `GIVEAWAY-` and a number
54
- * (seen on Amore's store: `GIVEAWAY-1791199646184` and `GIVEAWAY-1791201000218` on 2026-10-06,
55
- * `GIVEAWAY-1791449255616` on 2026-10-08). Matched whatever the case.
56
- */
57
- exports.GIVEAWAY_CODE_PREFIX = 'GIVEAWAY-';
58
- /** Whether a discount code is a giveaway win's: it starts with `GIVEAWAY_CODE_PREFIX`. */
59
- function isGiveawayCode(code) {
60
- return typeof code === 'string' && code.toUpperCase().startsWith(exports.GIVEAWAY_CODE_PREFIX);
61
- }
62
- /**
63
- * Whether the giveaway codes on a cart pay for its prizes in full, wherever Shopify put their money.
64
- *
65
- * A giveaway's code takes the prize's price off its size, and Shopify spreads it over every line of
66
- * that size. With the prize and a paid line of the same size in the cart, a $20 code took $10 off each
67
- * (Amore, 2026-10-08): the prize line alone looks half-paid, though the cart's total is right. So the
68
- * codes are added up across the whole cart and compared with the full price of the prizes that still
69
- * cost something. When they cover it, every prize is in fact free and its card can say so. When they
70
- * don't, the prizes' true prices stand: two prizes of one size whose codes don't stack got $29 off for
71
- * $58 of prizes (Amore, 2026-10-06).
72
- *
73
- * Prizes the store already made free (their line costs nothing) aren't counted, and neither is what a
74
- * code took off them, so one prize's code can't stand in for another's. True when no prize still costs
75
- * anything. Pass the same `keys` as to `isGiveawayPrizeLine`.
76
- */
77
- function prizesCoveredByGiveawayCodes(lines, options = {}) {
78
- const cents = (money) => Math.round(Number(money.amount) * 100);
79
- const isFreePrize = (line) => isGiveawayPrizeLine(line, options) && cents(line.cost.totalAmount) <= 0;
80
- const prizesToPayFor = lines.filter((line) => isGiveawayPrizeLine(line, options) && !isFreePrize(line));
81
- const owed = prizesToPayFor.reduce((sum, line) => sum + cents(line.merchandise.price) * line.quantity, 0);
82
- const takenOffByGiveawayCodes = lines
83
- .filter((line) => !isFreePrize(line))
84
- .flatMap((line) => { var _a; return (_a = line.discounts) !== null && _a !== void 0 ? _a : []; })
85
- .filter((discount) => isGiveawayCode(discount.code))
86
- .reduce((sum, discount) => sum + cents(discount.amount), 0);
87
- return takenOffByGiveawayCodes >= owed;
88
- }
89
- /**
90
- * The variant ids of the prizes among a customer's wins: what `useAuctionWins().giveawayVariantIds`
91
- * holds. A cart checks a line's variant against it to show a prize the host put in the shopping cart
92
- * with no stamp as a prize.
93
- */
94
- function giveawayVariantIdsOf(wins) {
95
- return new Set(wins.filter((win) => win.isGiveaway).map((win) => win.variant.id));
96
- }
97
- //# sourceMappingURL=giveawayPrizeLines.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"giveawayPrizeLines.js","sourceRoot":"","sources":["../src/giveawayPrizeLines.ts"],"names":[],"mappings":";;;AAuCA,kDAMC;AAkBD,wCAYC;AAUD,wCAEC;AA2BD,oEAeC;AAOD,oDAIC;AAnID;;;;GAIG;AACU,QAAA,mBAAmB,GAAsB,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;AAE3F;;;;;;;;GAQG;AACU,QAAA,kBAAkB,GAAG,iBAAiB,CAAC;AAOpD;;;;;;GAMG;AACH,SAAgB,mBAAmB,CACjC,IAA+E,EAC/E,UAAoC,EAAE;;IAEtC,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,IAAI,mCAAI,2BAAmB,CAAC;IACjD,OAAO,CAAC,MAAA,IAAI,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC;AAClH,CAAC;AAYD;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,IAI9B;IACC,MAAM,KA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AAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IACxG,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC1G,MAAM,uBAAuB,GAAG,KAAK;SAClC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;SACpC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,WAAC,OAAA,MAAA,IAAI,CAAC,SAAS,mCAAI,EAAE,CAAA,EAAA,CAAC;SACvC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;SACnD,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9D,OAAO,uBAAuB,IAAI,IAAI,CAAC;AACzC,CAAC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAClC,IAAiE;IAEjE,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AACpF,CAAC"}
@@ -1,20 +0,0 @@
1
- export interface GiveawayPrizesConfig {
2
- /** The giveaway service's base URL. */
3
- url: string;
4
- /** The store's Apptile app id, which the service files claims under. */
5
- appId: string;
6
- }
7
- export interface GiveawayPrizeCollection {
8
- /** Prizes owed, delivered or not. */
9
- pending: number;
10
- /** Claims that landed in the cart on this call: re-read the cart when there are any. */
11
- delivered: string[];
12
- }
13
- /** The service's answer, read. A 409 (the cart is gone) and any other refusal: nothing collected. */
14
- export declare function prizeCollectionFrom(status: number, body: unknown): GiveawayPrizeCollection | null;
15
- /**
16
- * Collects what `customerId` (Shopify's numeric id or GID) has won into `cartId`, or reports what is owed
17
- * when there is no cart. Null when unconfigured, refused or unreachable; never throws.
18
- */
19
- export declare function collectGiveawayPrizes(customerId: string, cartId: string | null): Promise<GiveawayPrizeCollection | null>;
20
- //# sourceMappingURL=giveawayPrizes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"giveawayPrizes.d.ts","sourceRoot":"","sources":["../src/giveawayPrizes.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,oBAAoB;IACnC,uCAAuC;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,qGAAqG;AACrG,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,uBAAuB,GAAG,IAAI,CAOjG;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAoB9H"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.prizeCollectionFrom = prizeCollectionFrom;
4
- exports.collectGiveawayPrizes = collectGiveawayPrizes;
5
- /**
6
- * Giveaway prizes onto the shopper's current cart (0.16.0). A won prize stays a claim on Apptile's
7
- * giveaway service until an order pays for it, so it can go into whatever cart the shopper has now
8
- * (the one they entered with is usually checked out by then). Given a cart, the service adds the line,
9
- * its code and its prize stamp, and says what it delivered; without one it only says what is owed.
10
- */
11
- const client_1 = require("./client");
12
- /** The service's answer, read. A 409 (the cart is gone) and any other refusal: nothing collected. */
13
- function prizeCollectionFrom(status, body) {
14
- if (status < 200 || status >= 300)
15
- return null;
16
- const record = (body !== null && body !== void 0 ? body : {});
17
- return {
18
- pending: typeof record.pending === 'number' ? record.pending : 0,
19
- delivered: Array.isArray(record.delivered) ? record.delivered.filter((key) => typeof key === 'string') : [],
20
- };
21
- }
22
- /**
23
- * Collects what `customerId` (Shopify's numeric id or GID) has won into `cartId`, or reports what is owed
24
- * when there is no cart. Null when unconfigured, refused or unreachable; never throws.
25
- */
26
- async function collectGiveawayPrizes(customerId, cartId) {
27
- const config = (0, client_1.isConfigured)() ? (0, client_1.getConfig)().giveawayPrizes : undefined;
28
- if (!(config === null || config === void 0 ? void 0 : config.url) || !customerId)
29
- return null;
30
- const url = `${config.url.replace(/\/$/, '')}/hydrate`;
31
- try {
32
- return await (0, client_1.withRequestTimeout)(url, async (signal) => {
33
- const response = await fetch(url, {
34
- method: 'POST',
35
- headers: { 'content-type': 'application/json' },
36
- body: JSON.stringify({ appId: config.appId, customerId: customerId.split('/').pop(), cartId }),
37
- signal,
38
- });
39
- const body = await response.json().catch(() => null);
40
- if (!response.ok && response.status !== 409)
41
- (0, client_1.getLogger)().error(new Error(`giveaway prizes refused: ${response.status}`), { at: 'giveawayPrizes' });
42
- return prizeCollectionFrom(response.status, body);
43
- });
44
- }
45
- catch (caught) {
46
- (0, client_1.getLogger)().error(caught, { at: 'giveawayPrizes' });
47
- return null;
48
- }
49
- }
50
- //# sourceMappingURL=giveawayPrizes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"giveawayPrizes.js","sourceRoot":"","sources":["../src/giveawayPrizes.ts"],"names":[],"mappings":";;AAuBA,kDAOC;AAMD,sDAoBC;AAxDD;;;;;GAKG;AACH,qCAAkF;AAgBlF,qGAAqG;AACrG,SAAgB,mBAAmB,CA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