@beamimpact/web-sdk 1.56.3 → 1.57.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 (398) hide show
  1. package/dist/chunks/_share-dialog-dependencies-BEUnzuWq.esm.js +2 -0
  2. package/dist/chunks/{_share-dialog-dependencies-Bk60ibnw.esm.js.map → _share-dialog-dependencies-BEUnzuWq.esm.js.map} +1 -1
  3. package/dist/chunks/{order-page-CSEjG6ma.esm.d.ts → cart-CKltrzQt.esm.d.ts} +22 -34
  4. package/dist/chunks/css-card-grid-CiqEjkwR.esm.js +21 -0
  5. package/dist/chunks/css-card-grid-CiqEjkwR.esm.js.map +1 -0
  6. package/dist/chunks/handlebars-B_i-to-h.esm.js +23 -0
  7. package/dist/chunks/handlebars-B_i-to-h.esm.js.map +1 -0
  8. package/dist/chunks/index-B4xKTDaF.esm.js +2 -0
  9. package/dist/chunks/index-B4xKTDaF.esm.js.map +1 -0
  10. package/dist/chunks/{index-C_u1FXtO.esm.d.ts → index-BAROgNYE.esm.d.ts} +7 -10
  11. package/dist/chunks/{index-BLlSL37B.esm.d.ts → index-BH3YaPLG.esm.d.ts} +1 -1
  12. package/dist/chunks/index-BHglsF5j.esm.js +2 -0
  13. package/dist/chunks/index-BHglsF5j.esm.js.map +1 -0
  14. package/dist/chunks/index-BgalrCS_.esm.js +32 -0
  15. package/dist/chunks/index-BgalrCS_.esm.js.map +1 -0
  16. package/dist/chunks/{index-hghrT7Z_.esm.d.ts → index-BoIHE1tC.esm.d.ts} +3 -0
  17. package/dist/chunks/index-C60Vejym.esm.js +32 -0
  18. package/dist/chunks/index-C60Vejym.esm.js.map +1 -0
  19. package/dist/chunks/{index-DDCtGN21.esm.d.ts → index-C6a13iqC.esm.d.ts} +3 -5
  20. package/dist/chunks/index-D6aFJ4cU.esm.js +2 -0
  21. package/dist/chunks/index-D6aFJ4cU.esm.js.map +1 -0
  22. package/dist/chunks/index-Dm-K2MLY.esm.js +31 -0
  23. package/dist/chunks/index-Dm-K2MLY.esm.js.map +1 -0
  24. package/dist/chunks/{index-BEEmYYxP.esm.js → index-DqhM4Yoj.esm.js} +11 -11
  25. package/dist/chunks/index-DqhM4Yoj.esm.js.map +1 -0
  26. package/dist/chunks/{index-UMeAzKTG.esm.js → index-HqfLVFOU.esm.js} +11 -11
  27. package/dist/chunks/index-HqfLVFOU.esm.js.map +1 -0
  28. package/dist/chunks/index-MAMeVd6l.esm.js +2 -0
  29. package/dist/chunks/index-MAMeVd6l.esm.js.map +1 -0
  30. package/dist/chunks/{index-DyUuvdr3.esm.d.ts → index-OYSJ-2mk.esm.d.ts} +1 -1
  31. package/dist/chunks/{index-BY5lSRmw.esm.d.ts → index-mBTWm4YP.esm.d.ts} +2 -2
  32. package/dist/chunks/{lit-JRlupCB5.esm.js → lit-BEag9MFp.esm.js} +2 -2
  33. package/dist/chunks/{lit-JRlupCB5.esm.js.map → lit-BEag9MFp.esm.js.map} +1 -1
  34. package/dist/chunks/{lodash-BSs6Il-c.esm.js → lodash-CrMU6wKg.esm.js} +2 -2
  35. package/dist/chunks/{lodash-BSs6Il-c.esm.js.map → lodash-CrMU6wKg.esm.js.map} +1 -1
  36. package/dist/chunks/{promo-pill-label-D_4zJ7uy.esm.js → promo-pill-label-5HmbDVmU.esm.js} +2 -2
  37. package/dist/chunks/{promo-pill-label-D_4zJ7uy.esm.js.map → promo-pill-label-5HmbDVmU.esm.js.map} +1 -1
  38. package/dist/chunks/{responsive-CIV4sFdH.esm.js → responsive-aN8P5PqD.esm.js} +2 -2
  39. package/dist/chunks/{responsive-CIV4sFdH.esm.js.map → responsive-aN8P5PqD.esm.js.map} +1 -1
  40. package/dist/chunks/{routes-OxC3Ah30.esm.d.ts → routes-D6Gtw6kZ.esm.d.ts} +1 -1
  41. package/dist/chunks/share-button-5gfPmeEh.esm.js +54 -0
  42. package/dist/chunks/share-button-5gfPmeEh.esm.js.map +1 -0
  43. package/dist/chunks/{share-button-Dzc7loia.esm.js → share-button-C4yPLL_t.esm.js} +2 -2
  44. package/dist/chunks/{share-button-DkTpGZk1.esm.js.map → share-button-C4yPLL_t.esm.js.map} +1 -1
  45. package/dist/chunks/{update-cart-DWgFuC7U.esm.d.ts → update-cart-DoJGAdoU.esm.d.ts} +2 -3
  46. package/dist/chunks/utils-C5hmbxa4.esm.js +2 -0
  47. package/dist/chunks/utils-C5hmbxa4.esm.js.map +1 -0
  48. package/dist/chunks/{openapi-spec-B4z4_CMq.esm.d.ts → utils-COGFpDER.esm.d.ts} +597 -11
  49. package/dist/chunks/{vendor-ckSdd6aH.esm.js → vendor-DUOg5fL-.esm.js} +2 -2
  50. package/dist/chunks/{vendor-ckSdd6aH.esm.js.map → vendor-DUOg5fL-.esm.js.map} +1 -1
  51. package/dist/components/beam-partner-logos.d.ts +3 -1
  52. package/dist/components/beam-partner-logos.esm.js +1 -1
  53. package/dist/components/beam-partner-logos.js +1 -1
  54. package/dist/components/community-impact.d.ts +3 -2
  55. package/dist/components/community-impact.esm.js +6 -6
  56. package/dist/components/community-impact.esm.js.map +1 -1
  57. package/dist/components/community-impact.js +6 -6
  58. package/dist/components/community-impact.js.map +1 -1
  59. package/dist/components/cumulative-impact.d.ts +3 -2
  60. package/dist/components/cumulative-impact.esm.js +11 -11
  61. package/dist/components/cumulative-impact.esm.js.map +1 -1
  62. package/dist/components/cumulative-impact.js +11 -11
  63. package/dist/components/cumulative-impact.js.map +1 -1
  64. package/dist/components/impact-overview.d.ts +3 -2
  65. package/dist/components/impact-overview.esm.js +5 -5
  66. package/dist/components/impact-overview.esm.js.map +1 -1
  67. package/dist/components/impact-overview.js +5 -5
  68. package/dist/components/impact-overview.js.map +1 -1
  69. package/dist/components/index.d.ts +5 -5
  70. package/dist/components/index.esm.js +1 -1
  71. package/dist/components/index.js +1 -1
  72. package/dist/components/post-purchase.d.ts +3 -4
  73. package/dist/components/post-purchase.esm.js +1 -31
  74. package/dist/components/post-purchase.esm.js.map +1 -1
  75. package/dist/components/post-purchase.js +1 -31
  76. package/dist/components/post-purchase.js.map +1 -1
  77. package/dist/components/product-details-page.d.ts +4 -2
  78. package/dist/components/product-details-page.esm.js +4 -4
  79. package/dist/components/product-details-page.esm.js.map +1 -1
  80. package/dist/components/product-details-page.js +4 -4
  81. package/dist/components/product-details-page.js.map +1 -1
  82. package/dist/components/redeem-transaction.d.ts +3 -4
  83. package/dist/components/redeem-transaction.esm.js +1 -1
  84. package/dist/components/redeem-transaction.js +1 -1
  85. package/dist/components/select-nonprofit.d.ts +3 -4
  86. package/dist/components/select-nonprofit.esm.js +12 -12
  87. package/dist/components/select-nonprofit.esm.js.map +1 -1
  88. package/dist/components/select-nonprofit.js +12 -12
  89. package/dist/components/select-nonprofit.js.map +1 -1
  90. package/dist/components/select-subscription-nonprofit.d.ts +3 -2
  91. package/dist/components/select-subscription-nonprofit.esm.js +11 -11
  92. package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
  93. package/dist/components/select-subscription-nonprofit.js +11 -11
  94. package/dist/components/select-subscription-nonprofit.js.map +1 -1
  95. package/dist/components/shopify.d.ts +9 -12
  96. package/dist/components/shopify.esm.js +1 -1
  97. package/dist/components/shopify.esm.js.map +1 -1
  98. package/dist/components/shopify.js +1 -1
  99. package/dist/components/shopify.js.map +1 -1
  100. package/dist/components/social-share.d.ts +3 -2
  101. package/dist/components/social-share.esm.js +2 -2
  102. package/dist/components/social-share.esm.js.map +1 -1
  103. package/dist/components/social-share.js +2 -2
  104. package/dist/components/social-share.js.map +1 -1
  105. package/dist/components/subscriber-select-nonprofit.d.ts +59 -0
  106. package/dist/components/subscriber-select-nonprofit.esm.js +137 -0
  107. package/dist/components/subscriber-select-nonprofit.esm.js.map +1 -0
  108. package/dist/components/subscriber-select-nonprofit.js +137 -0
  109. package/dist/components/subscriber-select-nonprofit.js.map +1 -0
  110. package/dist/components/subscription-impact.d.ts +3 -2
  111. package/dist/components/subscription-impact.esm.js +6 -6
  112. package/dist/components/subscription-impact.esm.js.map +1 -1
  113. package/dist/components/subscription-impact.js +6 -6
  114. package/dist/components/subscription-impact.js.map +1 -1
  115. package/dist/components/subscription-management.d.ts +4 -5
  116. package/dist/components/subscription-management.esm.js +3 -3
  117. package/dist/components/subscription-management.esm.js.map +1 -1
  118. package/dist/components/subscription-management.js +3 -3
  119. package/dist/components/subscription-management.js.map +1 -1
  120. package/dist/index.d.ts +39 -38
  121. package/dist/index.esm.js +1 -1
  122. package/dist/index.js +1 -1
  123. package/dist/integrations/beam.d.ts +3 -1
  124. package/dist/integrations/beam.esm.js +1 -1
  125. package/dist/integrations/beam.esm.js.map +1 -1
  126. package/dist/integrations/beam.js +1 -1
  127. package/dist/integrations/beam.js.map +1 -1
  128. package/dist/integrations/cart.d.ts +4 -4
  129. package/dist/integrations/cart.esm.js +1 -1
  130. package/dist/integrations/cart.js +1 -1
  131. package/dist/integrations/logs.d.ts +4 -2
  132. package/dist/integrations/logs.esm.js +1 -1
  133. package/dist/integrations/logs.js +1 -1
  134. package/dist/integrations/promoManager.d.ts +3 -1
  135. package/dist/integrations/promoManager.esm.js +1 -1
  136. package/dist/integrations/promoManager.esm.js.map +1 -1
  137. package/dist/integrations/promoManager.js +1 -1
  138. package/dist/integrations/promoManager.js.map +1 -1
  139. package/dist/integrations/session.d.ts +1 -1
  140. package/dist/integrations/session.esm.js +1 -1
  141. package/dist/integrations/session.js +1 -1
  142. package/dist/integrations/shopify-order.d.ts +38 -0
  143. package/dist/integrations/shopify-order.esm.js +2 -0
  144. package/dist/integrations/shopify-order.esm.js.map +1 -0
  145. package/dist/integrations/shopify-order.js +2 -0
  146. package/dist/integrations/shopify-order.js.map +1 -0
  147. package/dist/integrations/shopify.d.ts +5 -12
  148. package/dist/integrations/shopify.esm.js +1 -1
  149. package/dist/integrations/shopify.js +1 -1
  150. package/dist/integrations/statsig.d.ts +3 -1
  151. package/dist/integrations/statsig.esm.js +3 -3
  152. package/dist/integrations/statsig.esm.js.map +1 -1
  153. package/dist/integrations/statsig.js +3 -3
  154. package/dist/integrations/statsig.js.map +1 -1
  155. package/dist/integrations/utils.d.ts +1 -14
  156. package/dist/integrations/utils.esm.js +1 -1
  157. package/dist/integrations/utils.js +1 -1
  158. package/dist/react/beam-partner-logos.d.ts +3 -1
  159. package/dist/react/beam-partner-logos.esm.js +1 -1
  160. package/dist/react/beam-partner-logos.js +1 -1
  161. package/dist/react/community-impact.d.ts +3 -2
  162. package/dist/react/community-impact.esm.js +1 -1
  163. package/dist/react/community-impact.esm.js.map +1 -1
  164. package/dist/react/community-impact.js +1 -1
  165. package/dist/react/community-impact.js.map +1 -1
  166. package/dist/react/cumulative-impact.d.ts +3 -2
  167. package/dist/react/cumulative-impact.esm.js +1 -1
  168. package/dist/react/cumulative-impact.esm.js.map +1 -1
  169. package/dist/react/cumulative-impact.js +1 -1
  170. package/dist/react/cumulative-impact.js.map +1 -1
  171. package/dist/react/impact-overview.d.ts +3 -2
  172. package/dist/react/impact-overview.esm.js +1 -1
  173. package/dist/react/impact-overview.esm.js.map +1 -1
  174. package/dist/react/impact-overview.js +1 -1
  175. package/dist/react/impact-overview.js.map +1 -1
  176. package/dist/react/index.d.ts +6 -7
  177. package/dist/react/index.esm.js +1 -1
  178. package/dist/react/index.js +1 -1
  179. package/dist/react/post-purchase.d.ts +3 -4
  180. package/dist/react/post-purchase.esm.js +1 -1
  181. package/dist/react/post-purchase.esm.js.map +1 -1
  182. package/dist/react/post-purchase.js +1 -1
  183. package/dist/react/post-purchase.js.map +1 -1
  184. package/dist/react/product-details-page.d.ts +4 -2
  185. package/dist/react/product-details-page.esm.js +1 -1
  186. package/dist/react/product-details-page.esm.js.map +1 -1
  187. package/dist/react/product-details-page.js +1 -1
  188. package/dist/react/product-details-page.js.map +1 -1
  189. package/dist/react/redeem-transaction.d.ts +3 -6
  190. package/dist/react/redeem-transaction.esm.js +1 -1
  191. package/dist/react/redeem-transaction.esm.js.map +1 -1
  192. package/dist/react/redeem-transaction.js +1 -1
  193. package/dist/react/redeem-transaction.js.map +1 -1
  194. package/dist/react/select-nonprofit.d.ts +3 -6
  195. package/dist/react/select-nonprofit.esm.js +1 -1
  196. package/dist/react/select-nonprofit.esm.js.map +1 -1
  197. package/dist/react/select-nonprofit.js +1 -1
  198. package/dist/react/select-nonprofit.js.map +1 -1
  199. package/dist/react/select-subscription-nonprofit.d.ts +3 -6
  200. package/dist/react/select-subscription-nonprofit.esm.js +1 -1
  201. package/dist/react/select-subscription-nonprofit.esm.js.map +1 -1
  202. package/dist/react/select-subscription-nonprofit.js +1 -1
  203. package/dist/react/select-subscription-nonprofit.js.map +1 -1
  204. package/dist/react/shopify.d.ts +2 -2
  205. package/dist/react/shopify.esm.js +1 -1
  206. package/dist/react/shopify.esm.js.map +1 -1
  207. package/dist/react/shopify.js +1 -1
  208. package/dist/react/shopify.js.map +1 -1
  209. package/dist/react/social-share.d.ts +3 -2
  210. package/dist/react/social-share.esm.js +1 -1
  211. package/dist/react/social-share.esm.js.map +1 -1
  212. package/dist/react/social-share.js +1 -1
  213. package/dist/react/social-share.js.map +1 -1
  214. package/dist/react/subscriber-select-nonprofit.d.ts +14 -0
  215. package/dist/react/subscriber-select-nonprofit.esm.js +2 -0
  216. package/dist/react/subscriber-select-nonprofit.esm.js.map +1 -0
  217. package/dist/react/subscriber-select-nonprofit.js +2 -0
  218. package/dist/react/subscriber-select-nonprofit.js.map +1 -0
  219. package/dist/react/subscription-impact.d.ts +3 -2
  220. package/dist/react/subscription-impact.esm.js +1 -1
  221. package/dist/react/subscription-impact.esm.js.map +1 -1
  222. package/dist/react/subscription-impact.js +1 -1
  223. package/dist/react/subscription-impact.js.map +1 -1
  224. package/dist/react/subscription-management.d.ts +4 -5
  225. package/dist/react/subscription-management.esm.js +1 -1
  226. package/dist/react/subscription-management.esm.js.map +1 -1
  227. package/dist/react/subscription-management.js +1 -1
  228. package/dist/react/subscription-management.js.map +1 -1
  229. package/dist/utils/beam-errors.d.ts +3 -1
  230. package/dist/utils/beam-errors.esm.js +1 -1
  231. package/dist/utils/beam-errors.js +1 -1
  232. package/dist/utils/cart.d.ts +3 -18
  233. package/dist/utils/cart.esm.js +1 -1
  234. package/dist/utils/cart.esm.js.map +1 -1
  235. package/dist/utils/cart.js +1 -1
  236. package/dist/utils/cart.js.map +1 -1
  237. package/dist/utils/clear-beam-storage.d.ts +3 -0
  238. package/dist/utils/clear-beam-storage.esm.js +2 -0
  239. package/dist/utils/clear-beam-storage.esm.js.map +1 -0
  240. package/dist/utils/clear-beam-storage.js +2 -0
  241. package/dist/utils/clear-beam-storage.js.map +1 -0
  242. package/dist/utils/cookies.d.ts +3 -18
  243. package/dist/utils/cookies.esm.js +1 -1
  244. package/dist/utils/cookies.esm.js.map +1 -1
  245. package/dist/utils/cookies.js +1 -1
  246. package/dist/utils/cookies.js.map +1 -1
  247. package/dist/utils/debounce.esm.js +1 -1
  248. package/dist/utils/debounce.js +1 -1
  249. package/dist/utils/events.d.ts +3 -5
  250. package/dist/utils/events.esm.js +1 -1
  251. package/dist/utils/events.js +1 -1
  252. package/dist/utils/is-equal.esm.js +1 -1
  253. package/dist/utils/is-equal.js +1 -1
  254. package/dist/utils/local-storage.d.ts +3 -19
  255. package/dist/utils/local-storage.esm.js +1 -1
  256. package/dist/utils/local-storage.esm.js.map +1 -1
  257. package/dist/utils/local-storage.js +1 -1
  258. package/dist/utils/local-storage.js.map +1 -1
  259. package/dist/utils/logger.d.ts +3 -8
  260. package/dist/utils/logger.esm.js +1 -1
  261. package/dist/utils/logger.esm.js.map +1 -1
  262. package/dist/utils/logger.js +1 -1
  263. package/dist/utils/logger.js.map +1 -1
  264. package/dist/utils/makeApiKeyHeader.d.ts +3 -5
  265. package/dist/utils/makeApiKeyHeader.esm.js +1 -1
  266. package/dist/utils/makeApiKeyHeader.esm.js.map +1 -1
  267. package/dist/utils/makeApiKeyHeader.js +1 -1
  268. package/dist/utils/makeApiKeyHeader.js.map +1 -1
  269. package/dist/utils/memoize-last.d.ts +3 -17
  270. package/dist/utils/memoize-last.esm.js +1 -1
  271. package/dist/utils/memoize-last.esm.js.map +1 -1
  272. package/dist/utils/memoize-last.js +1 -1
  273. package/dist/utils/memoize-last.js.map +1 -1
  274. package/dist/utils/network-listeners.d.ts +3 -3
  275. package/dist/utils/network-listeners.esm.js +1 -1
  276. package/dist/utils/network-listeners.esm.js.map +1 -1
  277. package/dist/utils/network-listeners.js +1 -1
  278. package/dist/utils/network-listeners.js.map +1 -1
  279. package/dist/utils/promoManager.d.ts +3 -111
  280. package/dist/utils/promoManager.esm.js +1 -1
  281. package/dist/utils/promoManager.esm.js.map +1 -1
  282. package/dist/utils/promoManager.js +1 -1
  283. package/dist/utils/promoManager.js.map +1 -1
  284. package/dist/utils/remote-session.d.ts +3 -9
  285. package/dist/utils/remote-session.esm.js +1 -1
  286. package/dist/utils/remote-session.esm.js.map +1 -1
  287. package/dist/utils/remote-session.js +1 -1
  288. package/dist/utils/remote-session.js.map +1 -1
  289. package/dist/utils/wait-for-element.d.ts +3 -5
  290. package/dist/utils/wait-for-element.esm.js +1 -1
  291. package/dist/utils/wait-for-element.esm.js.map +1 -1
  292. package/dist/utils/wait-for-element.js +1 -1
  293. package/dist/utils/wait-for-element.js.map +1 -1
  294. package/package.json +9 -6
  295. package/dist/chunks/_share-dialog-dependencies-Bk60ibnw.esm.js +0 -2
  296. package/dist/chunks/_share-dialog-dependencies-D6vA_2f6.esm.js +0 -2
  297. package/dist/chunks/_share-dialog-dependencies-D6vA_2f6.esm.js.map +0 -1
  298. package/dist/chunks/beam-errors-Ci0d3926.esm.js +0 -2
  299. package/dist/chunks/beam-errors-Ci0d3926.esm.js.map +0 -1
  300. package/dist/chunks/beam-errors-DUQ9pK2V.esm.d.ts +0 -46
  301. package/dist/chunks/cart-contents-CEoSx3y4.esm.d.ts +0 -18
  302. package/dist/chunks/cart-contents-DkoytiZh.esm.js +0 -2
  303. package/dist/chunks/cart-contents-DkoytiZh.esm.js.map +0 -1
  304. package/dist/chunks/css-card-grid-DixMt6ek.esm.js +0 -20
  305. package/dist/chunks/css-card-grid-DixMt6ek.esm.js.map +0 -1
  306. package/dist/chunks/enforce-config-DHnpgqSK.esm.js +0 -3
  307. package/dist/chunks/enforce-config-DHnpgqSK.esm.js.map +0 -1
  308. package/dist/chunks/enforce-config-DUbQnaLO.esm.js +0 -3
  309. package/dist/chunks/enforce-config-DUbQnaLO.esm.js.map +0 -1
  310. package/dist/chunks/events-COWOQoLW.esm.js +0 -2
  311. package/dist/chunks/events-COWOQoLW.esm.js.map +0 -1
  312. package/dist/chunks/events-Dwqfqbij.esm.d.ts +0 -214
  313. package/dist/chunks/index-8rOpG9kf.esm.js +0 -2
  314. package/dist/chunks/index-8rOpG9kf.esm.js.map +0 -1
  315. package/dist/chunks/index-B1GmdVT3.esm.js +0 -2
  316. package/dist/chunks/index-B1GmdVT3.esm.js.map +0 -1
  317. package/dist/chunks/index-B2dxbh1d.esm.js +0 -2
  318. package/dist/chunks/index-B2dxbh1d.esm.js.map +0 -1
  319. package/dist/chunks/index-BEEmYYxP.esm.js.map +0 -1
  320. package/dist/chunks/index-BIEV1MH0.esm.js +0 -2
  321. package/dist/chunks/index-BIEV1MH0.esm.js.map +0 -1
  322. package/dist/chunks/index-BaWMWAyt.esm.js +0 -2
  323. package/dist/chunks/index-BaWMWAyt.esm.js.map +0 -1
  324. package/dist/chunks/index-BeX4QeUu.esm.js +0 -2
  325. package/dist/chunks/index-BeX4QeUu.esm.js.map +0 -1
  326. package/dist/chunks/index-C3hpHWh1.esm.js +0 -2
  327. package/dist/chunks/index-C3hpHWh1.esm.js.map +0 -1
  328. package/dist/chunks/index-C3v-y56g.esm.js +0 -2
  329. package/dist/chunks/index-C3v-y56g.esm.js.map +0 -1
  330. package/dist/chunks/index-CqqF1sQo.esm.js +0 -2
  331. package/dist/chunks/index-CqqF1sQo.esm.js.map +0 -1
  332. package/dist/chunks/index-Cs4Kp9X4.esm.js +0 -2
  333. package/dist/chunks/index-Cs4Kp9X4.esm.js.map +0 -1
  334. package/dist/chunks/index-D20ifskY.esm.d.ts +0 -21
  335. package/dist/chunks/index-D3hxLDQF.esm.js +0 -2
  336. package/dist/chunks/index-D3hxLDQF.esm.js.map +0 -1
  337. package/dist/chunks/index-D5TZB-zM.esm.js +0 -2
  338. package/dist/chunks/index-D5TZB-zM.esm.js.map +0 -1
  339. package/dist/chunks/index-D6qJfs7_.esm.js +0 -2
  340. package/dist/chunks/index-D6qJfs7_.esm.js.map +0 -1
  341. package/dist/chunks/index-DSJACB_p.esm.js +0 -2
  342. package/dist/chunks/index-DSJACB_p.esm.js.map +0 -1
  343. package/dist/chunks/index-DmjZnpod.esm.js +0 -2
  344. package/dist/chunks/index-DmjZnpod.esm.js.map +0 -1
  345. package/dist/chunks/index-EJRmgmQu.esm.d.ts +0 -74
  346. package/dist/chunks/index-UMeAzKTG.esm.js.map +0 -1
  347. package/dist/chunks/index-mppXVWCH.esm.js +0 -2
  348. package/dist/chunks/index-mppXVWCH.esm.js.map +0 -1
  349. package/dist/chunks/index-n62IxH5D.esm.js +0 -2
  350. package/dist/chunks/index-n62IxH5D.esm.js.map +0 -1
  351. package/dist/chunks/index-nAPzvUWE.esm.js +0 -2
  352. package/dist/chunks/index-nAPzvUWE.esm.js.map +0 -1
  353. package/dist/chunks/index-xcGPhpiO.esm.d.ts +0 -44
  354. package/dist/chunks/is-all-html-elements-fcB7UUA1.esm.js +0 -2
  355. package/dist/chunks/is-all-html-elements-fcB7UUA1.esm.js.map +0 -1
  356. package/dist/chunks/loading-template-BFvXaTlD.esm.js +0 -2
  357. package/dist/chunks/loading-template-BFvXaTlD.esm.js.map +0 -1
  358. package/dist/chunks/localize-Dg7NgKIP.esm.js +0 -31
  359. package/dist/chunks/localize-Dg7NgKIP.esm.js.map +0 -1
  360. package/dist/chunks/localize-DkAbsh05.esm.js +0 -31
  361. package/dist/chunks/localize-DkAbsh05.esm.js.map +0 -1
  362. package/dist/chunks/order-page-B0WbVrvh.esm.js +0 -2
  363. package/dist/chunks/order-page-B0WbVrvh.esm.js.map +0 -1
  364. package/dist/chunks/order-page-CT3hnhzf.esm.js +0 -2
  365. package/dist/chunks/order-page-CT3hnhzf.esm.js.map +0 -1
  366. package/dist/chunks/progress-bar-B82FOT8n.esm.js +0 -54
  367. package/dist/chunks/progress-bar-B82FOT8n.esm.js.map +0 -1
  368. package/dist/chunks/promo-pill-label-DcsiJS_N.esm.js +0 -16
  369. package/dist/chunks/promo-pill-label-DcsiJS_N.esm.js.map +0 -1
  370. package/dist/chunks/promo-types-CmZzhkpN.esm.d.ts +0 -15
  371. package/dist/chunks/promo-types-DKAOFHJr.esm.js +0 -2
  372. package/dist/chunks/promo-types-DKAOFHJr.esm.js.map +0 -1
  373. package/dist/chunks/routes-BIMwJ8u9.esm.js +0 -2
  374. package/dist/chunks/routes-BIMwJ8u9.esm.js.map +0 -1
  375. package/dist/chunks/routes-DSu5s3K7.esm.js +0 -2
  376. package/dist/chunks/routes-DSu5s3K7.esm.js.map +0 -1
  377. package/dist/chunks/share-button-CLMw49f5.esm.js +0 -2
  378. package/dist/chunks/share-button-CLMw49f5.esm.js.map +0 -1
  379. package/dist/chunks/share-button-DXS3zbJz.esm.js +0 -2
  380. package/dist/chunks/share-button-DXS3zbJz.esm.js.map +0 -1
  381. package/dist/chunks/share-button-DkTpGZk1.esm.js +0 -172
  382. package/dist/chunks/share-button-Dzc7loia.esm.js.map +0 -1
  383. package/dist/chunks/types-D_PLq1pj.esm.d.ts +0 -28
  384. package/dist/chunks/types-DfRc36jU.esm.d.ts +0 -15
  385. package/dist/chunks/update-cart-ByUvNLyZ.esm.js +0 -2
  386. package/dist/chunks/update-cart-ByUvNLyZ.esm.js.map +0 -1
  387. package/dist/chunks/update-cart-yj_9VGHp.esm.js +0 -2
  388. package/dist/chunks/update-cart-yj_9VGHp.esm.js.map +0 -1
  389. package/dist/integrations/index.d.ts +0 -31
  390. package/dist/integrations/index.esm.js +0 -2
  391. package/dist/integrations/index.esm.js.map +0 -1
  392. package/dist/integrations/index.js +0 -2
  393. package/dist/integrations/index.js.map +0 -1
  394. package/dist/utils/index.d.ts +0 -16
  395. package/dist/utils/index.esm.js +0 -2
  396. package/dist/utils/index.esm.js.map +0 -1
  397. package/dist/utils/index.js +0 -2
  398. package/dist/utils/index.js.map +0 -1
@@ -1,3 +1,48 @@
1
+ import debounce from 'lodash-es/debounce';
2
+ import isEqual from 'lodash-es/isEqual';
3
+
4
+ /**
5
+ * Full URL string (https://abc.com/path), without trailing slash
6
+ */
7
+ type TUrl$1 = string;
8
+ type LANGUAGES = "en" | "fr" | "de" | "es" | "it" | "pl" | "ja";
9
+ /**
10
+ * Basic info needed to call the Beam API.
11
+ * Endpoints may also require parameters such as chainId, storeId, and order/cart details.
12
+ */
13
+ type BeamBaseAPIConfig = {
14
+ apiKey: string;
15
+ baseUrl?: TUrl$1;
16
+ };
17
+
18
+ declare const WIDGET_NAMES: {
19
+ readonly select_nonprofit: "select-nonprofit";
20
+ readonly redeem_transaction: "redeem-transaction";
21
+ readonly impact_overview: "impact-overview";
22
+ readonly community_impact: "community-impact";
23
+ readonly cumulative_impact: "cumulative-impact";
24
+ readonly product_details_page: "product-details-page";
25
+ readonly subscription_management: "subscription-management";
26
+ readonly subscription_impact: "subscription-impact";
27
+ readonly select_subscription_nonprofit: "select-subscription-nonprofit";
28
+ readonly social_share: "social-share";
29
+ readonly subscriber_select_nonprofit: "subscriber-select-nonprofit";
30
+ };
31
+ declare const HELPER_NAMES: {
32
+ cart_update: string;
33
+ };
34
+
35
+ /** Number ID */
36
+ type TNumericId = number;
37
+ /** String ID */
38
+ type TId = string;
39
+ /** Beam API key format (prefix.uuid) */
40
+ type TApiKey = string;
41
+ /** Full URL without trailing slash */
42
+ type TUrl = string;
43
+ type WidgetName = (typeof WIDGET_NAMES)[keyof typeof WIDGET_NAMES];
44
+ type HelperName = (typeof HELPER_NAMES)[keyof typeof HELPER_NAMES];
45
+
1
46
  /**
2
47
  * This file was auto-generated by openapi-typescript.
3
48
  * Do not make direct changes to the file.
@@ -889,7 +934,7 @@ interface paths {
889
934
  */
890
935
  lang?: "en" | "fr" | "de" | "es" | "it" | "pl" | "ja";
891
936
  /** @enum {string} */
892
- widgetName: "select-nonprofit" | "redeem-transaction" | "post-purchase" | "subscription-management" | "select-subscription-nonprofit";
937
+ widgetName: "select-nonprofit" | "redeem-transaction" | "post-purchase" | "subscription-management" | "select-subscription-nonprofit" | "subscriber-select-nonprofit";
893
938
  /** @example 1.0 */
894
939
  version: string;
895
940
  cart?: {
@@ -2987,7 +3032,7 @@ interface paths {
2987
3032
  put: {
2988
3033
  parameters: {
2989
3034
  query: {
2990
- orderId: string;
3035
+ orderId: Partial<string> & Partial<number>;
2991
3036
  };
2992
3037
  };
2993
3038
  responses: {
@@ -3556,7 +3601,7 @@ interface paths {
3556
3601
  nonprofitId?: number;
3557
3602
  isCanceled?: boolean;
3558
3603
  /** @enum {string} */
3559
- widgetName?: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact";
3604
+ widgetName?: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact" | "subscriber-select-nonprofit";
3560
3605
  version?: string;
3561
3606
  options?: {
3562
3607
  response?: {
@@ -4118,7 +4163,7 @@ interface paths {
4118
4163
  remoteSubscriptionId: string;
4119
4164
  nonprofitId: number | null;
4120
4165
  /** @enum {string|null} */
4121
- selectionMethod?: ("dashboard" | "remote_order" | "checkout" | "subscription_management_widget") | null;
4166
+ selectionMethod?: ("dashboard" | "remote_order" | "checkout" | "subscription_management_widget" | "subscriber_select_nonprofit_widget") | null;
4122
4167
  };
4123
4168
  };
4124
4169
  };
@@ -4321,8 +4366,8 @@ interface paths {
4321
4366
  "application/json": {
4322
4367
  nonprofitId: number | null;
4323
4368
  /**
4324
- * Format: uuid
4325
- * @description UUID of an existing selection
4369
+ * @description UUID
4370
+ * @example bqkdk-0393b-jbkdd-02difj
4326
4371
  */
4327
4372
  selectionId?: string | null;
4328
4373
  /** @description Cart ID from partner site */
@@ -4401,7 +4446,7 @@ interface paths {
4401
4446
  parameters: {
4402
4447
  query: {
4403
4448
  chainId: number;
4404
- widgetName: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact";
4449
+ widgetName: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact" | "subscriber-select-nonprofit";
4405
4450
  version: string;
4406
4451
  };
4407
4452
  };
@@ -4453,7 +4498,7 @@ interface paths {
4453
4498
  /** @example 4058 */
4454
4499
  chainId: number;
4455
4500
  /** @enum {string} */
4456
- widgetName: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact";
4501
+ widgetName: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact" | "subscriber-select-nonprofit";
4457
4502
  /** @example 1.0 */
4458
4503
  version: string;
4459
4504
  config: {
@@ -7524,7 +7569,7 @@ interface paths {
7524
7569
  storeId: number;
7525
7570
  /** When set to true, draft themes are returned */
7526
7571
  draftConfig?: boolean;
7527
- widgetName?: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact";
7572
+ widgetName?: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact" | "subscriber-select-nonprofit";
7528
7573
  /** The identifier for the product */
7529
7574
  remoteProductIdentifier?: string;
7530
7575
  };
@@ -7678,7 +7723,7 @@ interface paths {
7678
7723
  storeId: number;
7679
7724
  /** When set to true, draft themes are returned */
7680
7725
  draftConfig?: boolean;
7681
- widgetName?: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact";
7726
+ widgetName?: "community-impact" | "impact-overview" | "select-nonprofit" | "redeem-transaction" | "cumulative-impact" | "mobile-full-screen-nonprofit-selection" | "mobile-impact-list" | "mobile-minimal-nonprofit-selection" | "mobile-personal-impact" | "mobile-selected-nonprofit" | "mobile-progress-bar" | "select-nonprofit-cta" | "mobile-share-button" | "subscription-management" | "product-details-page" | "select-subscription-nonprofit" | "subscription-impact" | "subscriber-select-nonprofit";
7682
7727
  /** The identifier for the product */
7683
7728
  remoteProductIdentifier?: string;
7684
7729
  };
@@ -8089,4 +8134,545 @@ interface paths {
8089
8134
  };
8090
8135
  }
8091
8136
 
8092
- export type { paths as p };
8137
+ type TCartApi = paths["/chain/findEligibleNonprofitsForCart"]["post"]["requestBody"]["content"]["application/json"]["cart"];
8138
+ type TCart = TCartApi & {
8139
+ content: {
8140
+ items: Record<string, any>[];
8141
+ discounts?: Record<string, any>[] | undefined | null;
8142
+ };
8143
+ };
8144
+ type TBeamCartLocalStorage = {
8145
+ cartId: string;
8146
+ beamCartId?: string;
8147
+ subtotal: number;
8148
+ itemCount: number;
8149
+ currencyCode: string;
8150
+ } & TCart;
8151
+
8152
+ declare class BeamError extends Error {
8153
+ supportUrl: string;
8154
+ constructor(msg?: string, { cause, name }?: {
8155
+ cause?: any;
8156
+ name?: string;
8157
+ });
8158
+ }
8159
+ declare class NetworkError extends BeamError {
8160
+ /** Fetch Response object with .ok, .status, etc.*/
8161
+ response: Response;
8162
+ /** If network response included JSON payload, it is parsed and available here */
8163
+ body?: Record<string, string>;
8164
+ constructor(response: Response, body?: Record<string, string>, msg?: string);
8165
+ }
8166
+ declare class MissingConfig extends BeamError {
8167
+ missingConfigKeyNames: string[];
8168
+ constructor(missingConfigKeyNames?: string[], msg?: string);
8169
+ }
8170
+ declare class LocalStorageError extends BeamError {
8171
+ constructor(msg?: string);
8172
+ }
8173
+ declare class SetupError extends BeamError {
8174
+ constructor(msg?: string);
8175
+ }
8176
+
8177
+ type beamErrors_BeamError = BeamError;
8178
+ declare const beamErrors_BeamError: typeof BeamError;
8179
+ type beamErrors_LocalStorageError = LocalStorageError;
8180
+ declare const beamErrors_LocalStorageError: typeof LocalStorageError;
8181
+ type beamErrors_MissingConfig = MissingConfig;
8182
+ declare const beamErrors_MissingConfig: typeof MissingConfig;
8183
+ type beamErrors_NetworkError = NetworkError;
8184
+ declare const beamErrors_NetworkError: typeof NetworkError;
8185
+ type beamErrors_SetupError = SetupError;
8186
+ declare const beamErrors_SetupError: typeof SetupError;
8187
+ declare namespace beamErrors {
8188
+ export {
8189
+ beamErrors_BeamError as BeamError,
8190
+ beamErrors_LocalStorageError as LocalStorageError,
8191
+ beamErrors_MissingConfig as MissingConfig,
8192
+ beamErrors_NetworkError as NetworkError,
8193
+ beamErrors_SetupError as SetupError,
8194
+ };
8195
+ }
8196
+
8197
+ type TPromoCodeRequest = paths["/productDetailsPage"]["post"]["requestBody"]["content"]["application/json"]["promos"];
8198
+ type TUnvalidatedPromoRequest = NonNullable<TPromoCodeRequest>["unvalidatedPromoCodes"];
8199
+ type TPromoCodeAttribute = {
8200
+ value: string;
8201
+ url?: never;
8202
+ } | {
8203
+ url: string;
8204
+ value?: never;
8205
+ };
8206
+ type TPromoCodeResponse = paths["/productDetailsPage"]["post"]["responses"]["200"]["content"]["application/json"]["promos"];
8207
+ type TValidatedPromoResponse = NonNullable<TPromoCodeResponse>["validatedPromoCodes"];
8208
+
8209
+ type NetworkEventDetail = {
8210
+ url: string;
8211
+ method: string;
8212
+ type: "fetch";
8213
+ response: Response;
8214
+ } | {
8215
+ url: string;
8216
+ method: string;
8217
+ type: "xhr";
8218
+ xhr: XMLHttpRequest;
8219
+ };
8220
+ /**
8221
+ * beamnetworkcall
8222
+ * Emitted by the Beam network listener whenever any API calls are made on the page
8223
+ */
8224
+ declare class BeamNetworkCallEvent extends CustomEvent<NetworkEventDetail> {
8225
+ static eventName: "beamnetworkcall";
8226
+ constructor(detail: NetworkEventDetail);
8227
+ }
8228
+ type NonprofitSelectDetail = {
8229
+ selectionId?: string;
8230
+ selectedNonprofitId?: number | null;
8231
+ nonprofitName?: string | null;
8232
+ source?: WidgetName | null;
8233
+ timestamp?: Date;
8234
+ };
8235
+ /**
8236
+ * beamnonprofitselect
8237
+ * Emitted when the end user selects a nonprofit in the Beam widget, and when the previous selection was restored
8238
+ * automatically
8239
+ */
8240
+ declare class BeamNonprofitSelectEvent extends CustomEvent<NonprofitSelectDetail> {
8241
+ static eventName: "beamnonprofitselect";
8242
+ constructor(detail: NonprofitSelectDetail);
8243
+ }
8244
+ type CartChangeDetail = TCartApi & {
8245
+ cartId?: string;
8246
+ subtotal?: number;
8247
+ itemCount?: number;
8248
+ currencyCode?: string;
8249
+ };
8250
+ /**
8251
+ * beamcartchange
8252
+ * Emitted when Beam detects that cart contents have changed, and when items are added to the cart for the first time
8253
+ */
8254
+ declare class BeamCartChangeEvent extends CustomEvent<CartChangeDetail> {
8255
+ static eventName: "beamcartchange";
8256
+ constructor(detail: CartChangeDetail);
8257
+ }
8258
+ type CartCreatedDetail = CartChangeDetail;
8259
+ /**
8260
+ * beamcartcreated
8261
+ * Emitted when a cart is created in Beam for the first time, but NOT when the cart is updated
8262
+ * Beam's cart expiration rules are used to determine when a returning visit counts as the same cart
8263
+ */
8264
+ declare class BeamCartCreatedEvent extends CustomEvent<CartCreatedDetail> {
8265
+ static eventName: "beamcartcreated";
8266
+ constructor(detail: CartCreatedDetail);
8267
+ }
8268
+ type OrderCreatedDetail = {
8269
+ orderId: TId;
8270
+ transactionId: TId;
8271
+ cartTotal: number;
8272
+ currencyCode: string;
8273
+ };
8274
+ /**
8275
+ * beamordercreated
8276
+ * Emitted when an order is registered with Beam for the first time, but NOT on repeat visits, page refreshes, etc.
8277
+ */
8278
+ declare class BeamOrderCreatedEvent extends CustomEvent<OrderCreatedDetail> {
8279
+ static eventName: "beamordercreated";
8280
+ constructor(detail: OrderCreatedDetail);
8281
+ }
8282
+ /**
8283
+ * beamstatuschange
8284
+ * Emitted when the Beam config object has finished initializing along with all plugins
8285
+ */
8286
+ type BeamStatusChangeEventDetail = {
8287
+ status: "pending";
8288
+ } | {
8289
+ status: "error";
8290
+ error: Error;
8291
+ } | {
8292
+ status: "ready";
8293
+ };
8294
+ declare class BeamStatusChangeEvent extends CustomEvent<BeamStatusChangeEventDetail> {
8295
+ static eventName: "beamstatuschange";
8296
+ constructor(detail: BeamStatusChangeEventDetail);
8297
+ }
8298
+ type NonprofitSelectionRemovedDetail = {
8299
+ previousNonprofitId?: number | null;
8300
+ newNonprofitId?: number | null;
8301
+ selectionId?: string;
8302
+ timestamp?: Date;
8303
+ };
8304
+ /**
8305
+ * beamnonprofitselectionremoved
8306
+ * Emitted when the nonprofit selection is removed from deselection or due to nonprofit cohort change
8307
+ */
8308
+ declare class BeamNonprofitSelectionRemovedEvent extends CustomEvent<NonprofitSelectionRemovedDetail> {
8309
+ static eventName: "beamnonprofitselectionremoved";
8310
+ constructor(detail: NonprofitSelectionRemovedDetail);
8311
+ }
8312
+ type PromoStoredDetail = {
8313
+ promoCodes: TPromoCodeRequest;
8314
+ };
8315
+ /**
8316
+ * Emitted when a URL with query parameters is sanitized and stored in localStorage
8317
+ *
8318
+ * @event beampromocodesstored
8319
+ */
8320
+ declare class BeamPromoCodesStoredEvent extends CustomEvent<PromoStoredDetail> {
8321
+ static eventName: string;
8322
+ constructor(detail: PromoStoredDetail);
8323
+ }
8324
+ type WidgetStoredPromosDetail = {
8325
+ source?: WidgetName | HelperName | null;
8326
+ };
8327
+ /**
8328
+ * Emitted when a widget stores the url or manual promoCodes in local storage
8329
+ *
8330
+ * @event beamwidgetstoredpromocodes
8331
+ */
8332
+ declare class BeamWidgetStoredPromoCodesEvent extends CustomEvent<WidgetStoredPromosDetail> {
8333
+ static eventName: "beamwidgetstoredpromocodes";
8334
+ constructor(detail: WidgetStoredPromosDetail);
8335
+ }
8336
+ type WidgetInitialNonprofitSyncDetail = {
8337
+ nonprofitId?: number | null;
8338
+ nonprofitIdChanged?: boolean;
8339
+ selectionId?: string;
8340
+ selectionIdChanged?: boolean;
8341
+ };
8342
+ /**
8343
+ * [Shopify Specific] - Emitted the first time a widget restores nonprofit selection from custom attributes
8344
+ *
8345
+ * @event beamwidgetinitialnonprofitsync
8346
+ */
8347
+ declare class BeamWidgetInitialNonprofitSyncEvent extends CustomEvent<WidgetInitialNonprofitSyncDetail> {
8348
+ static eventName: "beamwidgetinitialnonprofitsync";
8349
+ constructor(detail: WidgetInitialNonprofitSyncDetail);
8350
+ }
8351
+ type BeamWidgetInitialNonprofitSyncCancelDetail = {
8352
+ cancelled?: boolean;
8353
+ };
8354
+ /**
8355
+ * [Shopify Specific] - Allows WidgetInitialNonprofitSyncDetail to be cancelled asynchronously
8356
+ *
8357
+ * @event beamwidgetinitialnonprofitsynccancel
8358
+ */
8359
+ declare class BeamWidgetInitialNonprofitSyncCancelEvent extends CustomEvent<BeamWidgetInitialNonprofitSyncCancelDetail> {
8360
+ static eventName: "beamwidgetinitialnonprofitsynccancel";
8361
+ constructor(detail: BeamWidgetInitialNonprofitSyncCancelDetail);
8362
+ }
8363
+ type BeamStatsigInitializedDetail = {
8364
+ showBeam: boolean;
8365
+ stableId?: string;
8366
+ };
8367
+ /**
8368
+ * Fired when Statsig experiment assignments for Beam are initialized
8369
+ *
8370
+ * @event beamstatsiginitialized
8371
+ */
8372
+ declare class BeamStatsigInitializedEvent extends CustomEvent<BeamStatsigInitializedDetail> {
8373
+ static eventName: "beamstatsiginitialized";
8374
+ constructor(detail: BeamStatsigInitializedDetail);
8375
+ }
8376
+
8377
+ type events_BeamCartChangeEvent = BeamCartChangeEvent;
8378
+ declare const events_BeamCartChangeEvent: typeof BeamCartChangeEvent;
8379
+ type events_BeamCartCreatedEvent = BeamCartCreatedEvent;
8380
+ declare const events_BeamCartCreatedEvent: typeof BeamCartCreatedEvent;
8381
+ type events_BeamNetworkCallEvent = BeamNetworkCallEvent;
8382
+ declare const events_BeamNetworkCallEvent: typeof BeamNetworkCallEvent;
8383
+ type events_BeamNonprofitSelectEvent = BeamNonprofitSelectEvent;
8384
+ declare const events_BeamNonprofitSelectEvent: typeof BeamNonprofitSelectEvent;
8385
+ type events_BeamNonprofitSelectionRemovedEvent = BeamNonprofitSelectionRemovedEvent;
8386
+ declare const events_BeamNonprofitSelectionRemovedEvent: typeof BeamNonprofitSelectionRemovedEvent;
8387
+ type events_BeamOrderCreatedEvent = BeamOrderCreatedEvent;
8388
+ declare const events_BeamOrderCreatedEvent: typeof BeamOrderCreatedEvent;
8389
+ type events_BeamPromoCodesStoredEvent = BeamPromoCodesStoredEvent;
8390
+ declare const events_BeamPromoCodesStoredEvent: typeof BeamPromoCodesStoredEvent;
8391
+ type events_BeamStatsigInitializedEvent = BeamStatsigInitializedEvent;
8392
+ declare const events_BeamStatsigInitializedEvent: typeof BeamStatsigInitializedEvent;
8393
+ type events_BeamStatusChangeEvent = BeamStatusChangeEvent;
8394
+ declare const events_BeamStatusChangeEvent: typeof BeamStatusChangeEvent;
8395
+ type events_BeamWidgetInitialNonprofitSyncCancelEvent = BeamWidgetInitialNonprofitSyncCancelEvent;
8396
+ declare const events_BeamWidgetInitialNonprofitSyncCancelEvent: typeof BeamWidgetInitialNonprofitSyncCancelEvent;
8397
+ type events_BeamWidgetInitialNonprofitSyncEvent = BeamWidgetInitialNonprofitSyncEvent;
8398
+ declare const events_BeamWidgetInitialNonprofitSyncEvent: typeof BeamWidgetInitialNonprofitSyncEvent;
8399
+ type events_BeamWidgetStoredPromoCodesEvent = BeamWidgetStoredPromoCodesEvent;
8400
+ declare const events_BeamWidgetStoredPromoCodesEvent: typeof BeamWidgetStoredPromoCodesEvent;
8401
+ declare namespace events {
8402
+ export {
8403
+ events_BeamCartChangeEvent as BeamCartChangeEvent,
8404
+ events_BeamCartCreatedEvent as BeamCartCreatedEvent,
8405
+ events_BeamNetworkCallEvent as BeamNetworkCallEvent,
8406
+ events_BeamNonprofitSelectEvent as BeamNonprofitSelectEvent,
8407
+ events_BeamNonprofitSelectionRemovedEvent as BeamNonprofitSelectionRemovedEvent,
8408
+ events_BeamOrderCreatedEvent as BeamOrderCreatedEvent,
8409
+ events_BeamPromoCodesStoredEvent as BeamPromoCodesStoredEvent,
8410
+ events_BeamStatsigInitializedEvent as BeamStatsigInitializedEvent,
8411
+ events_BeamStatusChangeEvent as BeamStatusChangeEvent,
8412
+ events_BeamWidgetInitialNonprofitSyncCancelEvent as BeamWidgetInitialNonprofitSyncCancelEvent,
8413
+ events_BeamWidgetInitialNonprofitSyncEvent as BeamWidgetInitialNonprofitSyncEvent,
8414
+ events_BeamWidgetStoredPromoCodesEvent as BeamWidgetStoredPromoCodesEvent,
8415
+ };
8416
+ }
8417
+
8418
+ declare const logger: {
8419
+ error: (...args: any[]) => void;
8420
+ log: (...args: any[]) => void;
8421
+ warn: (...args: any[]) => void;
8422
+ debug: (...args: any[]) => void;
8423
+ };
8424
+
8425
+ declare const initNetworkListeners: () => void;
8426
+ /**
8427
+ * Disables Beam event dispatching from the fetch/XHR Proxies without
8428
+ * un-patching them (un-patching is unsafe if another script wrapped
8429
+ * fetch/XHR after us — restoring our saved reference would remove
8430
+ * their wrapper too).
8431
+ */
8432
+ declare const teardownNetworkListeners: () => void;
8433
+
8434
+ /**
8435
+ * Creates an object that has the same API as normal localStorage, but adds a beam_ prefix and apiKey postfix to keys
8436
+ * Also adds helper methods for JSON (de-)serialization
8437
+ */
8438
+ declare const createScopedLocalStorage: (config: {
8439
+ apiKey: string;
8440
+ }) => {
8441
+ readonly prefix: string;
8442
+ readonly postfix: string;
8443
+ getItem(key: string): string | null;
8444
+ setItem(key: string, value: unknown): void;
8445
+ removeItem(key: string): void;
8446
+ /** Safely parses value as JSON and return JS object */
8447
+ getItemJson<T = Record<string, unknown>>(key: string): T | null;
8448
+ /** Safely stringifies value as JSON */
8449
+ setItemJson(key: string, value: object): void;
8450
+ };
8451
+
8452
+ declare function waitForElement(selector: string, { timeout }?: {
8453
+ timeout?: number | undefined;
8454
+ }): Promise<Element>;
8455
+
8456
+ declare const getCookieMap: (cookieString?: string) => Map<string, string>;
8457
+ declare const getCookieValue: (name: string) => string | undefined;
8458
+ declare const setCookieValue: (options: CookieInit) => undefined;
8459
+ declare const deleteCookieValue: (options: {
8460
+ name: string;
8461
+ domain?: string;
8462
+ path?: string;
8463
+ }) => undefined;
8464
+ interface CookieInit {
8465
+ name: string;
8466
+ value: string;
8467
+ path?: string;
8468
+ domain?: string;
8469
+ expires?: number;
8470
+ sameSite?: "strict" | "lax" | "none";
8471
+ }
8472
+
8473
+ declare function saveRemoteSession({ remoteSessionId, apiKey }: {
8474
+ remoteSessionId: string;
8475
+ apiKey?: string;
8476
+ }): void;
8477
+ declare function getRemoteSession({ apiKey }: {
8478
+ apiKey?: string;
8479
+ }): string | null;
8480
+
8481
+ type Func<T extends any[], R> = (...args: T) => R;
8482
+ /**
8483
+ * Takes a function and returns a new memoized function.
8484
+ * If the same arguments are passed to the memoized function, it will return the previously computed result.
8485
+ * This is a "memoize once" function meaning it only compares the previous and current arguments, not historic values.
8486
+ * Results that throw errors or return rejected Promises are not cached.
8487
+ *
8488
+ * @param {Function} fn - The function to be memoized.
8489
+ * @param {(value: any) => boolean} [isEqual]- The equality function used to compare arguments.
8490
+ * @returns {Function} - The memoized function.
8491
+ * @param func
8492
+ */
8493
+ declare function memoizeLast<T extends any[], R>(func: Func<T, R>, { isEqual }?: {
8494
+ isEqual?: ((value: any, other: any) => boolean) | undefined;
8495
+ }): MemoizedLast<Func<T, R>>;
8496
+ type MemoizedLast<T extends (...args: any[]) => any> = T & {
8497
+ /** Clears the cached args/result so the next call always executes. */
8498
+ reset: () => void;
8499
+ };
8500
+
8501
+ /**
8502
+ * Retrieves all validated promo codes stored in the "beam_promo_codes" cookie and parses it
8503
+ *
8504
+ * @returns {TPromoCodeResponse | undefined} An array of `ValidatedPromoCode` objects if found and parsed successfully, otherwise `undefined`
8505
+ */
8506
+ declare const getAllPromoCodesFromCookie: () => TPromoCodeResponse | undefined;
8507
+ /**
8508
+ * Stores the validated promo codes in the "beam_promo_codes" cookie, replaces and does not merge
8509
+ *
8510
+ * @param {TValidatedPromoResponse} validatedPromoCodes
8511
+ * @param {string} domain
8512
+ */
8513
+ declare const setPromoCodeInCookie: ({ validatedPromoCodes, domain, }: {
8514
+ validatedPromoCodes: TValidatedPromoResponse;
8515
+ domain?: string;
8516
+ }) => void;
8517
+ /**
8518
+ * Retrieves promo codes from localStorage, scoped by API key
8519
+ * @param {string} apiKey API key used for storage scoping
8520
+ * @returns {TPromoCodeRequest | null} - Returns stored promo codes object containing both
8521
+ * validated and unvalidated codes
8522
+ * - If no codes exist, returns a fresh object with empty arrays
8523
+ *
8524
+ */
8525
+ declare const getPromoCodesLocalStorage: ({ apiKey }: {
8526
+ apiKey: string;
8527
+ }) => TPromoCodeRequest | null;
8528
+ /**
8529
+ * Sets promo codes in localStorage
8530
+ * @param {TPromoCodeRequest} promoCodes New promo codes to add
8531
+ * @param {string} apiKey API key for storage scoping
8532
+ */
8533
+ declare const setPromoCodesInLocalStorage: ({ apiKey, promoCodes, }: {
8534
+ apiKey?: string;
8535
+ promoCodes: Partial<TPromoCodeRequest>;
8536
+ }) => void;
8537
+ /**
8538
+ * Merges new promo codes with existing ones and returns the combined result
8539
+ * @param {Partial<TPromoCodeRequest>} newPromos New promo codes to add
8540
+ * @param {string} apiKey API key for storage scoping
8541
+ * @returns {TPromoCodeRequest} An object containing both validated and unvalidated promo codes
8542
+ * @example
8543
+ * const result = mergePromoCodes({
8544
+ * apiKey: 'beam_123',
8545
+ * newPromos: {
8546
+ * unvalidatedPromoCodes: [
8547
+ * { type: 'manual', attributes: { value: 'WINTER20' } },
8548
+ * { type: 'url', attributes: { url: 'www.example.com/?promo=HOLIDAY25' } }
8549
+ * ]
8550
+ * }
8551
+ * });
8552
+ */
8553
+ declare const mergeStoreAndReturnPromos: ({ newPromos, apiKey, }: {
8554
+ newPromos: Partial<TPromoCodeRequest>;
8555
+ apiKey: string;
8556
+ }) => TPromoCodeRequest;
8557
+ /**
8558
+ * Formats unvalidated promo codes by determining their source and attributes
8559
+ * The function will assign `QueryParam` as the source if a `url` exists,
8560
+ * otherwise, it will assign `Manual` as the source
8561
+ *
8562
+ * @param {TPromoCodeAttribute[]} promoAttributes An array of promo attributes to be formatted
8563
+ * @returns {TUnvalidatedPromoRequest} - An array of UnvalidatedPromoCode objects,
8564
+ * each with a source and attributes object
8565
+ */
8566
+ declare const mapToUnvalidatedPromoCodes: (promoAttributes: TPromoCodeAttribute[]) => TUnvalidatedPromoRequest;
8567
+ /**
8568
+ * @param {TPromoCodeAttribute[]} promoAttributes An array of promo attributes to be formatted
8569
+ * @param {string} apiKey API key for storage scoping
8570
+ * @returns {TPromoCodeRequest} An object containing both validated and unvalidated promo codes
8571
+ */
8572
+ declare const formatStoreAndReturnPromoCodes: (promoAttributes: TPromoCodeAttribute[], apiKey: string) => TPromoCodeRequest;
8573
+ /**
8574
+ * Extracts applicable promo codes from the cart object
8575
+ * This function retrieves discounts stored in the cart's `content.discounts` array,
8576
+ * filters out only the applicable promo codes, and returns them as an array of strings
8577
+ *
8578
+ * @param {TBeamCartLocalStorage} cart The cart object retrieved from local storage
8579
+ * @returns {string[]} An array of applicable promo codes
8580
+ */
8581
+ declare const getPromoCodesFromCart: (cart: TBeamCartLocalStorage) => string[];
8582
+ /**
8583
+ * Gets promo code exclusively from Shopify discount cookie
8584
+ * @returns {string | null} Single discount code or null if not found
8585
+ */
8586
+ declare const getPromoCodeFromShopifyCookie: () => string | null;
8587
+ /**
8588
+ * Safely parses a JSON string into an array of strings
8589
+ * If parsing fails or the input is not a valid JSON array, it returns an empty array
8590
+ *
8591
+ * @param {string | undefined | null} jsonString The JSON string to parse
8592
+ * @returns {string[]} The parsed array of strings or an empty array if parsing fails
8593
+ */
8594
+ declare const parseJsonStringArray: (jsonString: string | undefined | null) => string[];
8595
+ /**
8596
+ * Retrieves and sanitizes the current URL for storage, preserving only safe query parameters
8597
+ *
8598
+ * @returns {TPromoCodeAttribute} Returns an object with only the `url` property set
8599
+ */
8600
+ declare const getSanitizedUrlForStorage: () => TPromoCodeAttribute | undefined;
8601
+ declare const promoCodesAreEqual: (a: TPromoCodeRequest, b: TPromoCodeRequest) => boolean;
8602
+ declare const isEmptyPromoData: (promos: {
8603
+ unvalidatedPromoCodes?: unknown[];
8604
+ validatedPromoCodes?: unknown[];
8605
+ }) => boolean;
8606
+
8607
+ /**
8608
+ * Clears every piece of Beam-related browser state this SDK writes, by iterating the
8609
+ * LOCAL_STORAGE_KEYS/BEAM_COOKIE_NAMES registries (src/api-sdk/constants.ts) directly —
8610
+ * anything added to those objects is cleared automatically, with nothing to update here.
8611
+ *
8612
+ * Not tied to any one integration's lifecycle (e.g. registerCartIntegration/
8613
+ * unregisterCartIntegration) — safe to call on its own, from any integration or directly,
8614
+ * whenever a full reset of Beam's local footprint is needed.
8615
+ */
8616
+ declare function clearBeamStorage(config: {
8617
+ apiKey: string;
8618
+ domain?: string;
8619
+ }): void;
8620
+
8621
+ type index_MemoizedLast<T extends (...args: any[]) => any> = MemoizedLast<T>;
8622
+ declare const index_clearBeamStorage: typeof clearBeamStorage;
8623
+ declare const index_createScopedLocalStorage: typeof createScopedLocalStorage;
8624
+ declare const index_debounce: typeof debounce;
8625
+ declare const index_deleteCookieValue: typeof deleteCookieValue;
8626
+ declare const index_events: typeof events;
8627
+ declare const index_formatStoreAndReturnPromoCodes: typeof formatStoreAndReturnPromoCodes;
8628
+ declare const index_getAllPromoCodesFromCookie: typeof getAllPromoCodesFromCookie;
8629
+ declare const index_getCookieMap: typeof getCookieMap;
8630
+ declare const index_getCookieValue: typeof getCookieValue;
8631
+ declare const index_getPromoCodeFromShopifyCookie: typeof getPromoCodeFromShopifyCookie;
8632
+ declare const index_getPromoCodesFromCart: typeof getPromoCodesFromCart;
8633
+ declare const index_getPromoCodesLocalStorage: typeof getPromoCodesLocalStorage;
8634
+ declare const index_getRemoteSession: typeof getRemoteSession;
8635
+ declare const index_getSanitizedUrlForStorage: typeof getSanitizedUrlForStorage;
8636
+ declare const index_initNetworkListeners: typeof initNetworkListeners;
8637
+ declare const index_isEmptyPromoData: typeof isEmptyPromoData;
8638
+ declare const index_isEqual: typeof isEqual;
8639
+ declare const index_logger: typeof logger;
8640
+ declare const index_mapToUnvalidatedPromoCodes: typeof mapToUnvalidatedPromoCodes;
8641
+ declare const index_memoizeLast: typeof memoizeLast;
8642
+ declare const index_mergeStoreAndReturnPromos: typeof mergeStoreAndReturnPromos;
8643
+ declare const index_parseJsonStringArray: typeof parseJsonStringArray;
8644
+ declare const index_promoCodesAreEqual: typeof promoCodesAreEqual;
8645
+ declare const index_saveRemoteSession: typeof saveRemoteSession;
8646
+ declare const index_setCookieValue: typeof setCookieValue;
8647
+ declare const index_setPromoCodeInCookie: typeof setPromoCodeInCookie;
8648
+ declare const index_setPromoCodesInLocalStorage: typeof setPromoCodesInLocalStorage;
8649
+ declare const index_teardownNetworkListeners: typeof teardownNetworkListeners;
8650
+ declare const index_waitForElement: typeof waitForElement;
8651
+ declare namespace index {
8652
+ export { index_clearBeamStorage as clearBeamStorage, index_createScopedLocalStorage as createScopedLocalStorage, index_debounce as debounce, index_deleteCookieValue as deleteCookieValue, beamErrors as errors, index_events as events, index_formatStoreAndReturnPromoCodes as formatStoreAndReturnPromoCodes, index_getAllPromoCodesFromCookie as getAllPromoCodesFromCookie, index_getCookieMap as getCookieMap, index_getCookieValue as getCookieValue, index_getPromoCodeFromShopifyCookie as getPromoCodeFromShopifyCookie, index_getPromoCodesFromCart as getPromoCodesFromCart, index_getPromoCodesLocalStorage as getPromoCodesLocalStorage, index_getRemoteSession as getRemoteSession, index_getSanitizedUrlForStorage as getSanitizedUrlForStorage, index_initNetworkListeners as initNetworkListeners, index_isEmptyPromoData as isEmptyPromoData, index_isEqual as isEqual, index_logger as logger, index_mapToUnvalidatedPromoCodes as mapToUnvalidatedPromoCodes, index_memoizeLast as memoizeLast, index_mergeStoreAndReturnPromos as mergeStoreAndReturnPromos, index_parseJsonStringArray as parseJsonStringArray, index_promoCodesAreEqual as promoCodesAreEqual, index_saveRemoteSession as saveRemoteSession, index_setCookieValue as setCookieValue, index_setPromoCodeInCookie as setPromoCodeInCookie, index_setPromoCodesInLocalStorage as setPromoCodesInLocalStorage, index_teardownNetworkListeners as teardownNetworkListeners, index_waitForElement as waitForElement };
8653
+ export type { index_MemoizedLast as MemoizedLast };
8654
+ }
8655
+
8656
+ /**
8657
+ * Retrieves the Beam cart ID from cookies
8658
+ * @param CART_COOKIE_NAME - The name of the cookie that stores the Beam cart ID
8659
+ * @returns The Beam cart ID if present in cookies or local storage, otherwise null
8660
+ */
8661
+ declare const getBeamCartId: (CART_COOKIE_NAME: string, config: {
8662
+ apiKey: string;
8663
+ }) => string | null;
8664
+ /**
8665
+ * Retrieves the external cart ID
8666
+ * @param CART_COOKIE_NAME - The name of the cookie that stores the external cart ID
8667
+ * @returns The external cart ID if available or null if neither is available
8668
+ */
8669
+ declare const getExternalCartId: (CART_COOKIE_NAME: string, config: {
8670
+ apiKey: string;
8671
+ }) => string | null;
8672
+
8673
+ declare function makeApiKeyHeader(apiKey: string): {
8674
+ authorization: string;
8675
+ };
8676
+
8677
+ export { BeamStatusChangeEvent as $, memoizeLast as A, BeamNonprofitSelectEvent as B, mergeStoreAndReturnPromos as C, parseJsonStringArray as D, promoCodesAreEqual as E, saveRemoteSession as F, setCookieValue as G, setPromoCodeInCookie as H, setPromoCodesInLocalStorage as I, teardownNetworkListeners as J, BeamError as O, LocalStorageError as P, MissingConfig as Q, NetworkError as R, SetupError as S, BeamCartChangeEvent as U, BeamCartCreatedEvent as V, BeamNetworkCallEvent as W, BeamNonprofitSelectionRemovedEvent as X, BeamOrderCreatedEvent as Y, BeamPromoCodesStoredEvent as Z, BeamStatsigInitializedEvent as _, index as a, BeamWidgetInitialNonprofitSyncCancelEvent as a0, BeamWidgetInitialNonprofitSyncEvent as a1, BeamWidgetStoredPromoCodesEvent as a2, getBeamCartId as a3, getExternalCartId as a4, makeApiKeyHeader as a5, events as e, initNetworkListeners as i, clearBeamStorage as j, createScopedLocalStorage as k, deleteCookieValue as l, beamErrors as m, formatStoreAndReturnPromoCodes as n, getAllPromoCodesFromCookie as o, getCookieMap as p, getCookieValue as q, getPromoCodeFromShopifyCookie as r, getPromoCodesFromCart as s, getPromoCodesLocalStorage as t, getRemoteSession as u, getSanitizedUrlForStorage as v, waitForElement as w, isEmptyPromoData as x, logger as y, mapToUnvalidatedPromoCodes as z };
8678
+ export type { paths as K, LANGUAGES as L, MemoizedLast as M, TApiKey as N, TUrl$1 as T, TNumericId as b, TId as c, TCart as d, TUrl as f, BeamBaseAPIConfig as g, TCartApi as h };