@beamimpact/web-sdk 1.55.8 → 1.57.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (409) hide show
  1. package/README.md +5 -0
  2. package/dist/chunks/_share-dialog-dependencies-U9953n3E.esm.js +2 -0
  3. package/dist/chunks/{_share-dialog-dependencies-BG0p8uUr.esm.js.map → _share-dialog-dependencies-U9953n3E.esm.js.map} +1 -1
  4. package/dist/chunks/{order-page-Qn1yyNbN.esm.d.ts → cart-ChovPXmM.esm.d.ts} +19 -41
  5. package/dist/chunks/css-card-grid-BUidQqf0.esm.js +21 -0
  6. package/dist/chunks/css-card-grid-BUidQqf0.esm.js.map +1 -0
  7. package/dist/chunks/handlebars-B_i-to-h.esm.js +23 -0
  8. package/dist/chunks/handlebars-B_i-to-h.esm.js.map +1 -0
  9. package/dist/chunks/index--PfL-_nX.esm.js +2 -0
  10. package/dist/chunks/index--PfL-_nX.esm.js.map +1 -0
  11. package/dist/chunks/index-B4xKTDaF.esm.js +2 -0
  12. package/dist/chunks/index-B4xKTDaF.esm.js.map +1 -0
  13. package/dist/chunks/index-BG4XJXUa.esm.d.ts +28 -0
  14. package/dist/chunks/index-BHglsF5j.esm.js +2 -0
  15. package/dist/chunks/index-BHglsF5j.esm.js.map +1 -0
  16. package/dist/chunks/{index-C-hPf29c.esm.d.ts → index-BY5lSRmw.esm.d.ts} +4 -1
  17. package/dist/chunks/{index-BjGPkgs-.esm.d.ts → index-BoIHE1tC.esm.d.ts} +16 -1
  18. package/dist/chunks/index-CTsxQr7R.esm.js +32 -0
  19. package/dist/chunks/index-CTsxQr7R.esm.js.map +1 -0
  20. package/dist/chunks/{index-2OQzw7UI.esm.js → index-CVmIOuEY.esm.js} +28 -18
  21. package/dist/chunks/index-CVmIOuEY.esm.js.map +1 -0
  22. package/dist/chunks/{index-CBS5Fqry.esm.d.ts → index-CdinWvYu.esm.d.ts} +4 -2
  23. package/dist/chunks/index-DBKUxzAl.esm.js +32 -0
  24. package/dist/chunks/index-DBKUxzAl.esm.js.map +1 -0
  25. package/dist/chunks/{index-C5gnsl34.esm.js → index-DTw-q6W4.esm.js} +28 -18
  26. package/dist/chunks/index-DTw-q6W4.esm.js.map +1 -0
  27. package/dist/chunks/index-DhHhFTBE.esm.js +31 -0
  28. package/dist/chunks/index-DhHhFTBE.esm.js.map +1 -0
  29. package/dist/chunks/index-IQOpw0qx.esm.d.ts +65 -0
  30. package/dist/chunks/{index-rxgS4BLp.esm.d.ts → index-_0XeyyF9.esm.d.ts} +6 -2
  31. package/dist/chunks/index-cb5vYQx0.esm.js +2 -0
  32. package/dist/chunks/index-cb5vYQx0.esm.js.map +1 -0
  33. package/dist/chunks/lit-BEag9MFp.esm.js +25 -0
  34. package/dist/chunks/lit-BEag9MFp.esm.js.map +1 -0
  35. package/dist/chunks/lodash-CrMU6wKg.esm.js +2 -0
  36. package/dist/chunks/lodash-CrMU6wKg.esm.js.map +1 -0
  37. package/dist/chunks/{promo-pill-label-ByFGhdxh.esm.js → promo-pill-label-BdTmmg_U.esm.js} +3 -3
  38. package/dist/chunks/{promo-pill-label-ByFGhdxh.esm.js.map → promo-pill-label-BdTmmg_U.esm.js.map} +1 -1
  39. package/dist/chunks/{responsive-BR8qUfBa.esm.js → responsive-aN8P5PqD.esm.js} +2 -2
  40. package/dist/chunks/{responsive-BR8qUfBa.esm.js.map → responsive-aN8P5PqD.esm.js.map} +1 -1
  41. package/dist/chunks/routes-D6Gtw6kZ.esm.d.ts +638 -0
  42. package/dist/chunks/share-button-7sI6zg-x.esm.js +54 -0
  43. package/dist/chunks/share-button-7sI6zg-x.esm.js.map +1 -0
  44. package/dist/chunks/{share-button-DmjRJmXh.esm.js → share-button-BaIbuJOl.esm.js} +9 -4
  45. package/dist/chunks/share-button-BaIbuJOl.esm.js.map +1 -0
  46. package/dist/chunks/{update-cart-CauFT0AF.esm.d.ts → update-cart-CcgzHTEm.esm.d.ts} +3 -3
  47. package/dist/chunks/utils-BjhsDvuU.esm.js +2 -0
  48. package/dist/chunks/utils-BjhsDvuU.esm.js.map +1 -0
  49. package/dist/chunks/{openapi-spec-Bk7E2QQP.esm.d.ts → utils-D8HO_RIu.esm.d.ts} +615 -11
  50. package/dist/chunks/vendor-DUOg5fL-.esm.js +1286 -0
  51. package/dist/chunks/vendor-DUOg5fL-.esm.js.map +1 -0
  52. package/dist/components/beam-partner-logos.d.ts +3 -1
  53. package/dist/components/beam-partner-logos.esm.js +5 -5
  54. package/dist/components/beam-partner-logos.esm.js.map +1 -1
  55. package/dist/components/beam-partner-logos.js +5 -5
  56. package/dist/components/beam-partner-logos.js.map +1 -1
  57. package/dist/components/community-impact.d.ts +3 -4
  58. package/dist/components/community-impact.esm.js +13 -8
  59. package/dist/components/community-impact.esm.js.map +1 -1
  60. package/dist/components/community-impact.js +13 -8
  61. package/dist/components/community-impact.js.map +1 -1
  62. package/dist/components/cumulative-impact.d.ts +3 -2
  63. package/dist/components/cumulative-impact.esm.js +3 -3
  64. package/dist/components/cumulative-impact.esm.js.map +1 -1
  65. package/dist/components/cumulative-impact.js +3 -3
  66. package/dist/components/cumulative-impact.js.map +1 -1
  67. package/dist/components/impact-overview.d.ts +38 -40
  68. package/dist/components/impact-overview.esm.js +10 -5
  69. package/dist/components/impact-overview.esm.js.map +1 -1
  70. package/dist/components/impact-overview.js +10 -5
  71. package/dist/components/impact-overview.js.map +1 -1
  72. package/dist/components/index.d.ts +6 -9
  73. package/dist/components/index.esm.js +1 -1
  74. package/dist/components/index.js +1 -1
  75. package/dist/components/post-purchase.d.ts +9 -12
  76. package/dist/components/post-purchase.esm.js +1 -31
  77. package/dist/components/post-purchase.esm.js.map +1 -1
  78. package/dist/components/post-purchase.js +1 -31
  79. package/dist/components/post-purchase.js.map +1 -1
  80. package/dist/components/product-details-page.d.ts +29 -28
  81. package/dist/components/product-details-page.esm.js +19 -19
  82. package/dist/components/product-details-page.esm.js.map +1 -1
  83. package/dist/components/product-details-page.js +19 -19
  84. package/dist/components/product-details-page.js.map +1 -1
  85. package/dist/components/redeem-transaction.d.ts +3 -7
  86. package/dist/components/redeem-transaction.esm.js +1 -1
  87. package/dist/components/redeem-transaction.js +1 -1
  88. package/dist/components/select-nonprofit.d.ts +3 -16
  89. package/dist/components/select-nonprofit.esm.js +8 -7
  90. package/dist/components/select-nonprofit.esm.js.map +1 -1
  91. package/dist/components/select-nonprofit.js +8 -7
  92. package/dist/components/select-nonprofit.js.map +1 -1
  93. package/dist/components/select-subscription-nonprofit.d.ts +3 -3
  94. package/dist/components/select-subscription-nonprofit.esm.js +44 -23
  95. package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
  96. package/dist/components/select-subscription-nonprofit.js +44 -23
  97. package/dist/components/select-subscription-nonprofit.js.map +1 -1
  98. package/dist/components/shopify.d.ts +9 -16
  99. package/dist/components/shopify.esm.js +1 -1
  100. package/dist/components/shopify.esm.js.map +1 -1
  101. package/dist/components/shopify.js +1 -1
  102. package/dist/components/shopify.js.map +1 -1
  103. package/dist/components/social-share.d.ts +15 -3
  104. package/dist/components/social-share.esm.js +12 -5
  105. package/dist/components/social-share.esm.js.map +1 -1
  106. package/dist/components/social-share.js +12 -5
  107. package/dist/components/social-share.js.map +1 -1
  108. package/dist/components/subscriber-select-nonprofit.d.ts +59 -0
  109. package/dist/components/subscriber-select-nonprofit.esm.js +137 -0
  110. package/dist/components/subscriber-select-nonprofit.esm.js.map +1 -0
  111. package/dist/components/subscriber-select-nonprofit.js +137 -0
  112. package/dist/components/subscriber-select-nonprofit.js.map +1 -0
  113. package/dist/components/subscription-impact.d.ts +38 -50
  114. package/dist/components/subscription-impact.esm.js +20 -8
  115. package/dist/components/subscription-impact.esm.js.map +1 -1
  116. package/dist/components/subscription-impact.js +20 -8
  117. package/dist/components/subscription-impact.js.map +1 -1
  118. package/dist/components/subscription-management.d.ts +91 -93
  119. package/dist/components/subscription-management.esm.js +7 -6
  120. package/dist/components/subscription-management.esm.js.map +1 -1
  121. package/dist/components/subscription-management.js +7 -6
  122. package/dist/components/subscription-management.js.map +1 -1
  123. package/dist/index.d.ts +40 -42
  124. package/dist/index.esm.js +1 -1
  125. package/dist/index.js +1 -1
  126. package/dist/integrations/beam.d.ts +5 -2
  127. package/dist/integrations/beam.esm.js +1 -1
  128. package/dist/integrations/beam.esm.js.map +1 -1
  129. package/dist/integrations/beam.js +1 -1
  130. package/dist/integrations/beam.js.map +1 -1
  131. package/dist/integrations/cart.d.ts +4 -4
  132. package/dist/integrations/cart.esm.js +1 -1
  133. package/dist/integrations/cart.js +1 -1
  134. package/dist/integrations/logs.d.ts +4 -2
  135. package/dist/integrations/logs.esm.js +1 -1
  136. package/dist/integrations/logs.js +1 -1
  137. package/dist/integrations/promoManager.d.ts +3 -1
  138. package/dist/integrations/promoManager.esm.js +1 -1
  139. package/dist/integrations/promoManager.esm.js.map +1 -1
  140. package/dist/integrations/promoManager.js +1 -1
  141. package/dist/integrations/promoManager.js.map +1 -1
  142. package/dist/integrations/session.d.ts +1 -1
  143. package/dist/integrations/session.esm.js +1 -1
  144. package/dist/integrations/session.js +1 -1
  145. package/dist/integrations/shopify-order.d.ts +38 -0
  146. package/dist/integrations/shopify-order.esm.js +2 -0
  147. package/dist/integrations/shopify-order.esm.js.map +1 -0
  148. package/dist/integrations/shopify-order.js +2 -0
  149. package/dist/integrations/shopify-order.js.map +1 -0
  150. package/dist/integrations/shopify.d.ts +5 -16
  151. package/dist/integrations/shopify.esm.js +1 -1
  152. package/dist/integrations/shopify.js +1 -1
  153. package/dist/integrations/statsig.d.ts +11 -5
  154. package/dist/integrations/statsig.esm.js +14 -14
  155. package/dist/integrations/statsig.esm.js.map +1 -1
  156. package/dist/integrations/statsig.js +14 -14
  157. package/dist/integrations/statsig.js.map +1 -1
  158. package/dist/integrations/utils.d.ts +1 -14
  159. package/dist/integrations/utils.esm.js +1 -1
  160. package/dist/integrations/utils.js +1 -1
  161. package/dist/react/beam-partner-logos.d.ts +3 -1
  162. package/dist/react/beam-partner-logos.esm.js +1 -1
  163. package/dist/react/beam-partner-logos.js +1 -1
  164. package/dist/react/community-impact.d.ts +3 -4
  165. package/dist/react/community-impact.esm.js +1 -1
  166. package/dist/react/community-impact.esm.js.map +1 -1
  167. package/dist/react/community-impact.js +1 -1
  168. package/dist/react/community-impact.js.map +1 -1
  169. package/dist/react/cumulative-impact.d.ts +3 -2
  170. package/dist/react/cumulative-impact.esm.js +1 -1
  171. package/dist/react/cumulative-impact.esm.js.map +1 -1
  172. package/dist/react/cumulative-impact.js +1 -1
  173. package/dist/react/cumulative-impact.js.map +1 -1
  174. package/dist/react/impact-overview.d.ts +3 -5
  175. package/dist/react/impact-overview.esm.js +1 -1
  176. package/dist/react/impact-overview.esm.js.map +1 -1
  177. package/dist/react/impact-overview.js +1 -1
  178. package/dist/react/impact-overview.js.map +1 -1
  179. package/dist/react/index.d.ts +7 -11
  180. package/dist/react/index.esm.js +1 -1
  181. package/dist/react/index.js +1 -1
  182. package/dist/react/post-purchase.d.ts +3 -8
  183. package/dist/react/post-purchase.esm.js +1 -1
  184. package/dist/react/post-purchase.esm.js.map +1 -1
  185. package/dist/react/post-purchase.js +1 -1
  186. package/dist/react/post-purchase.js.map +1 -1
  187. package/dist/react/product-details-page.d.ts +4 -3
  188. package/dist/react/product-details-page.esm.js +1 -1
  189. package/dist/react/product-details-page.esm.js.map +1 -1
  190. package/dist/react/product-details-page.js +1 -1
  191. package/dist/react/product-details-page.js.map +1 -1
  192. package/dist/react/redeem-transaction.d.ts +3 -9
  193. package/dist/react/redeem-transaction.esm.js +1 -1
  194. package/dist/react/redeem-transaction.esm.js.map +1 -1
  195. package/dist/react/redeem-transaction.js +1 -1
  196. package/dist/react/redeem-transaction.js.map +1 -1
  197. package/dist/react/select-nonprofit.d.ts +3 -8
  198. package/dist/react/select-nonprofit.esm.js +1 -1
  199. package/dist/react/select-nonprofit.esm.js.map +1 -1
  200. package/dist/react/select-nonprofit.js +1 -1
  201. package/dist/react/select-nonprofit.js.map +1 -1
  202. package/dist/react/select-subscription-nonprofit.d.ts +3 -7
  203. package/dist/react/select-subscription-nonprofit.esm.js +1 -1
  204. package/dist/react/select-subscription-nonprofit.esm.js.map +1 -1
  205. package/dist/react/select-subscription-nonprofit.js +1 -1
  206. package/dist/react/select-subscription-nonprofit.js.map +1 -1
  207. package/dist/react/shopify.d.ts +2 -2
  208. package/dist/react/shopify.esm.js +1 -1
  209. package/dist/react/shopify.esm.js.map +1 -1
  210. package/dist/react/shopify.js +1 -1
  211. package/dist/react/shopify.js.map +1 -1
  212. package/dist/react/social-share.d.ts +3 -3
  213. package/dist/react/social-share.esm.js +1 -1
  214. package/dist/react/social-share.esm.js.map +1 -1
  215. package/dist/react/social-share.js +1 -1
  216. package/dist/react/social-share.js.map +1 -1
  217. package/dist/react/subscriber-select-nonprofit.d.ts +14 -0
  218. package/dist/react/subscriber-select-nonprofit.esm.js +2 -0
  219. package/dist/react/subscriber-select-nonprofit.esm.js.map +1 -0
  220. package/dist/react/subscriber-select-nonprofit.js +2 -0
  221. package/dist/react/subscriber-select-nonprofit.js.map +1 -0
  222. package/dist/react/subscription-impact.d.ts +3 -4
  223. package/dist/react/subscription-impact.esm.js +1 -1
  224. package/dist/react/subscription-impact.esm.js.map +1 -1
  225. package/dist/react/subscription-impact.js +1 -1
  226. package/dist/react/subscription-impact.js.map +1 -1
  227. package/dist/react/subscription-management.d.ts +4 -7
  228. package/dist/react/subscription-management.esm.js +1 -1
  229. package/dist/react/subscription-management.esm.js.map +1 -1
  230. package/dist/react/subscription-management.js +1 -1
  231. package/dist/react/subscription-management.js.map +1 -1
  232. package/dist/utils/beam-errors.d.ts +3 -1
  233. package/dist/utils/beam-errors.esm.js +1 -1
  234. package/dist/utils/beam-errors.js +1 -1
  235. package/dist/utils/cart.d.ts +3 -18
  236. package/dist/utils/cart.esm.js +1 -1
  237. package/dist/utils/cart.esm.js.map +1 -1
  238. package/dist/utils/cart.js +1 -1
  239. package/dist/utils/cart.js.map +1 -1
  240. package/dist/utils/cookies.d.ts +3 -58
  241. package/dist/utils/cookies.esm.js +1 -1
  242. package/dist/utils/cookies.esm.js.map +1 -1
  243. package/dist/utils/cookies.js +1 -1
  244. package/dist/utils/cookies.js.map +1 -1
  245. package/dist/utils/debounce.esm.js +1 -1
  246. package/dist/utils/debounce.js +1 -1
  247. package/dist/utils/events.d.ts +3 -5
  248. package/dist/utils/events.esm.js +1 -1
  249. package/dist/utils/events.js +1 -1
  250. package/dist/utils/is-equal.esm.js +1 -1
  251. package/dist/utils/is-equal.js +1 -1
  252. package/dist/utils/local-storage.d.ts +3 -19
  253. package/dist/utils/local-storage.esm.js +1 -1
  254. package/dist/utils/local-storage.esm.js.map +1 -1
  255. package/dist/utils/local-storage.js +1 -1
  256. package/dist/utils/local-storage.js.map +1 -1
  257. package/dist/utils/logger.d.ts +3 -8
  258. package/dist/utils/logger.esm.js +1 -1
  259. package/dist/utils/logger.esm.js.map +1 -1
  260. package/dist/utils/logger.js +1 -1
  261. package/dist/utils/logger.js.map +1 -1
  262. package/dist/utils/makeApiKeyHeader.d.ts +3 -5
  263. package/dist/utils/makeApiKeyHeader.esm.js +1 -1
  264. package/dist/utils/makeApiKeyHeader.esm.js.map +1 -1
  265. package/dist/utils/makeApiKeyHeader.js +1 -1
  266. package/dist/utils/makeApiKeyHeader.js.map +1 -1
  267. package/dist/utils/memoize-last.d.ts +3 -17
  268. package/dist/utils/memoize-last.esm.js +1 -1
  269. package/dist/utils/memoize-last.esm.js.map +1 -1
  270. package/dist/utils/memoize-last.js +1 -1
  271. package/dist/utils/memoize-last.js.map +1 -1
  272. package/dist/utils/network-listeners.d.ts +3 -3
  273. package/dist/utils/network-listeners.esm.js +1 -1
  274. package/dist/utils/network-listeners.esm.js.map +1 -1
  275. package/dist/utils/network-listeners.js +1 -1
  276. package/dist/utils/network-listeners.js.map +1 -1
  277. package/dist/utils/promoManager.d.ts +3 -123
  278. package/dist/utils/promoManager.esm.js +1 -1
  279. package/dist/utils/promoManager.esm.js.map +1 -1
  280. package/dist/utils/promoManager.js +1 -1
  281. package/dist/utils/promoManager.js.map +1 -1
  282. package/dist/utils/remote-session.d.ts +3 -9
  283. package/dist/utils/remote-session.esm.js +1 -1
  284. package/dist/utils/remote-session.esm.js.map +1 -1
  285. package/dist/utils/remote-session.js +1 -1
  286. package/dist/utils/remote-session.js.map +1 -1
  287. package/dist/utils/wait-for-element.d.ts +3 -5
  288. package/dist/utils/wait-for-element.esm.js +1 -1
  289. package/dist/utils/wait-for-element.esm.js.map +1 -1
  290. package/dist/utils/wait-for-element.js +1 -1
  291. package/dist/utils/wait-for-element.js.map +1 -1
  292. package/package.json +45 -39
  293. package/dist/chunks/_share-dialog-dependencies-BG0p8uUr.esm.js +0 -2
  294. package/dist/chunks/_share-dialog-dependencies-dHlBUqo0.esm.js +0 -2
  295. package/dist/chunks/_share-dialog-dependencies-dHlBUqo0.esm.js.map +0 -1
  296. package/dist/chunks/beam-errors-CCe004HS.esm.d.ts +0 -40
  297. package/dist/chunks/beam-errors-Ci0d3926.esm.js +0 -2
  298. package/dist/chunks/beam-errors-Ci0d3926.esm.js.map +0 -1
  299. package/dist/chunks/cart-contents-CLT7p7Gd.esm.d.ts +0 -18
  300. package/dist/chunks/cart-contents-DkoytiZh.esm.js +0 -2
  301. package/dist/chunks/cart-contents-DkoytiZh.esm.js.map +0 -1
  302. package/dist/chunks/css-card-grid-CvoGpsJH.esm.js +0 -20
  303. package/dist/chunks/css-card-grid-CvoGpsJH.esm.js.map +0 -1
  304. package/dist/chunks/enforce-config-Ba1JkOHs.esm.js +0 -3
  305. package/dist/chunks/enforce-config-Ba1JkOHs.esm.js.map +0 -1
  306. package/dist/chunks/enforce-config-CZ3ToOgr.esm.js +0 -3
  307. package/dist/chunks/enforce-config-CZ3ToOgr.esm.js.map +0 -1
  308. package/dist/chunks/events-CSyogxoH.esm.d.ts +0 -186
  309. package/dist/chunks/events-Dki0ka4F.esm.js +0 -2
  310. package/dist/chunks/events-Dki0ka4F.esm.js.map +0 -1
  311. package/dist/chunks/index-2OQzw7UI.esm.js.map +0 -1
  312. package/dist/chunks/index-B1Y88trP.esm.js +0 -2
  313. package/dist/chunks/index-B1Y88trP.esm.js.map +0 -1
  314. package/dist/chunks/index-B1lGZARl.esm.d.ts +0 -46
  315. package/dist/chunks/index-B7hOLixE.esm.d.ts +0 -15
  316. package/dist/chunks/index-BNjsFEGn.esm.js +0 -2
  317. package/dist/chunks/index-BNjsFEGn.esm.js.map +0 -1
  318. package/dist/chunks/index-BTDB5Gk-.esm.js +0 -2
  319. package/dist/chunks/index-BTDB5Gk-.esm.js.map +0 -1
  320. package/dist/chunks/index-BX6GnRsb.esm.js +0 -2
  321. package/dist/chunks/index-BX6GnRsb.esm.js.map +0 -1
  322. package/dist/chunks/index-C3hpHWh1.esm.js +0 -2
  323. package/dist/chunks/index-C3hpHWh1.esm.js.map +0 -1
  324. package/dist/chunks/index-C5gnsl34.esm.js.map +0 -1
  325. package/dist/chunks/index-CGKJagBi.esm.js +0 -2
  326. package/dist/chunks/index-CGKJagBi.esm.js.map +0 -1
  327. package/dist/chunks/index-CJ1y1kTs.esm.d.ts +0 -46
  328. package/dist/chunks/index-CWKcDbs6.esm.js +0 -2
  329. package/dist/chunks/index-CWKcDbs6.esm.js.map +0 -1
  330. package/dist/chunks/index-Cg65EbvX.esm.js +0 -2
  331. package/dist/chunks/index-Cg65EbvX.esm.js.map +0 -1
  332. package/dist/chunks/index-Ct1m4IjM.esm.js +0 -2
  333. package/dist/chunks/index-Ct1m4IjM.esm.js.map +0 -1
  334. package/dist/chunks/index-D6qJfs7_.esm.js +0 -2
  335. package/dist/chunks/index-D6qJfs7_.esm.js.map +0 -1
  336. package/dist/chunks/index-DBb5HSkR.esm.js +0 -2
  337. package/dist/chunks/index-DBb5HSkR.esm.js.map +0 -1
  338. package/dist/chunks/index-DEaZqGi7.esm.js +0 -2
  339. package/dist/chunks/index-DEaZqGi7.esm.js.map +0 -1
  340. package/dist/chunks/index-DXj15KHe.esm.d.ts +0 -32
  341. package/dist/chunks/index-DnTE6QlY.esm.js +0 -2
  342. package/dist/chunks/index-DnTE6QlY.esm.js.map +0 -1
  343. package/dist/chunks/index-DrxhkT6Y.esm.js +0 -2
  344. package/dist/chunks/index-DrxhkT6Y.esm.js.map +0 -1
  345. package/dist/chunks/index-IKiJwo5v.esm.js +0 -2
  346. package/dist/chunks/index-IKiJwo5v.esm.js.map +0 -1
  347. package/dist/chunks/index-RhV6PBPH.esm.js +0 -2
  348. package/dist/chunks/index-RhV6PBPH.esm.js.map +0 -1
  349. package/dist/chunks/index-eCVyk0rc.esm.js +0 -2
  350. package/dist/chunks/index-eCVyk0rc.esm.js.map +0 -1
  351. package/dist/chunks/index-iqYDqEil.esm.d.ts +0 -19
  352. package/dist/chunks/index-tbwbkOdj.esm.js +0 -2
  353. package/dist/chunks/index-tbwbkOdj.esm.js.map +0 -1
  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/lit-WqMxC_PA.esm.js +0 -34
  357. package/dist/chunks/lit-WqMxC_PA.esm.js.map +0 -1
  358. package/dist/chunks/loading-template-DG4lkIIc.esm.js +0 -2
  359. package/dist/chunks/loading-template-DG4lkIIc.esm.js.map +0 -1
  360. package/dist/chunks/localize-Btu9xYcE.esm.js +0 -31
  361. package/dist/chunks/localize-Btu9xYcE.esm.js.map +0 -1
  362. package/dist/chunks/localize-C25pEGnx.esm.js +0 -31
  363. package/dist/chunks/localize-C25pEGnx.esm.js.map +0 -1
  364. package/dist/chunks/lodash-D3TLHRR_.esm.js +0 -2
  365. package/dist/chunks/lodash-D3TLHRR_.esm.js.map +0 -1
  366. package/dist/chunks/order-page-BRG7MXZ2.esm.js +0 -2
  367. package/dist/chunks/order-page-BRG7MXZ2.esm.js.map +0 -1
  368. package/dist/chunks/order-page-BbHDQfmy.esm.js +0 -2
  369. package/dist/chunks/order-page-BbHDQfmy.esm.js.map +0 -1
  370. package/dist/chunks/progress-bar-CveZ8E6Q.esm.d.ts +0 -15
  371. package/dist/chunks/progress-bar-DF7UuuHb.esm.js +0 -54
  372. package/dist/chunks/progress-bar-DF7UuuHb.esm.js.map +0 -1
  373. package/dist/chunks/promo-pill-label-BXRqZHET.esm.d.ts +0 -19
  374. package/dist/chunks/promo-pill-label-WGLW3bql.esm.js +0 -16
  375. package/dist/chunks/promo-pill-label-WGLW3bql.esm.js.map +0 -1
  376. package/dist/chunks/promo-types-7r9-UuiP.esm.d.ts +0 -14
  377. package/dist/chunks/promo-types-DKAOFHJr.esm.js +0 -2
  378. package/dist/chunks/promo-types-DKAOFHJr.esm.js.map +0 -1
  379. package/dist/chunks/routes-BvX92EDq.esm.js +0 -2
  380. package/dist/chunks/routes-BvX92EDq.esm.js.map +0 -1
  381. package/dist/chunks/routes-DahRzf8t.esm.d.ts +0 -638
  382. package/dist/chunks/routes-DguZveS3.esm.js +0 -2
  383. package/dist/chunks/routes-DguZveS3.esm.js.map +0 -1
  384. package/dist/chunks/share-button-BRjKJc5L.esm.js +0 -167
  385. package/dist/chunks/share-button-BRjKJc5L.esm.js.map +0 -1
  386. package/dist/chunks/share-button-CDVVaxEc.esm.d.ts +0 -27
  387. package/dist/chunks/share-button-DPNNnXeM.esm.js +0 -2
  388. package/dist/chunks/share-button-DPNNnXeM.esm.js.map +0 -1
  389. package/dist/chunks/share-button-DmjRJmXh.esm.js.map +0 -1
  390. package/dist/chunks/share-button-M8cMa6ol.esm.js +0 -2
  391. package/dist/chunks/share-button-M8cMa6ol.esm.js.map +0 -1
  392. package/dist/chunks/types-CPxMwnoR.esm.d.ts +0 -28
  393. package/dist/chunks/types-DfRc36jU.esm.d.ts +0 -15
  394. package/dist/chunks/update-cart-CJywJNax.esm.js +0 -2
  395. package/dist/chunks/update-cart-CJywJNax.esm.js.map +0 -1
  396. package/dist/chunks/update-cart-gwNcGXkd.esm.js +0 -2
  397. package/dist/chunks/update-cart-gwNcGXkd.esm.js.map +0 -1
  398. package/dist/chunks/vendor-KKSARHWL.esm.js +0 -1284
  399. package/dist/chunks/vendor-KKSARHWL.esm.js.map +0 -1
  400. package/dist/integrations/index.d.ts +0 -35
  401. package/dist/integrations/index.esm.js +0 -2
  402. package/dist/integrations/index.esm.js.map +0 -1
  403. package/dist/integrations/index.js +0 -2
  404. package/dist/integrations/index.js.map +0 -1
  405. package/dist/utils/index.d.ts +0 -16
  406. package/dist/utils/index.esm.js +0 -2
  407. package/dist/utils/index.esm.js.map +0 -1
  408. package/dist/utils/index.js +0 -2
  409. 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: {
@@ -6991,6 +7036,24 @@ interface paths {
6991
7036
  experiments: {
6992
7037
  /** @description experiment assignment that delegates if Beam integration should injected */
6993
7038
  showBeam: boolean;
7039
+ /** @description Log of user events associated with the session */
7040
+ events?: {
7041
+ /**
7042
+ * @description Name of the event recorded for the session
7043
+ * @enum {string}
7044
+ */
7045
+ eventName: "session_return";
7046
+ /**
7047
+ * @description The source through which the user returned to their session
7048
+ * @enum {string}
7049
+ */
7050
+ eventValue: "cart_abandon" | "checkout_abandon";
7051
+ /**
7052
+ * Format: date-time
7053
+ * @description Time the event occurred
7054
+ */
7055
+ timestamp: string;
7056
+ }[];
6994
7057
  };
6995
7058
  /** @description Beam Store Id */
6996
7059
  storeId?: number;
@@ -7506,7 +7569,7 @@ interface paths {
7506
7569
  storeId: number;
7507
7570
  /** When set to true, draft themes are returned */
7508
7571
  draftConfig?: boolean;
7509
- 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";
7510
7573
  /** The identifier for the product */
7511
7574
  remoteProductIdentifier?: string;
7512
7575
  };
@@ -7660,7 +7723,7 @@ interface paths {
7660
7723
  storeId: number;
7661
7724
  /** When set to true, draft themes are returned */
7662
7725
  draftConfig?: boolean;
7663
- 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";
7664
7727
  /** The identifier for the product */
7665
7728
  remoteProductIdentifier?: string;
7666
7729
  };
@@ -8071,4 +8134,545 @@ interface paths {
8071
8134
  };
8072
8135
  }
8073
8136
 
8074
- 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
+ type TPromoCodeRequest = paths["/productDetailsPage"]["post"]["requestBody"]["content"]["application/json"]["promos"];
8153
+ type TUnvalidatedPromoRequest = NonNullable<TPromoCodeRequest>["unvalidatedPromoCodes"];
8154
+ type TPromoCodeAttribute = {
8155
+ value: string;
8156
+ url?: never;
8157
+ } | {
8158
+ url: string;
8159
+ value?: never;
8160
+ };
8161
+ type TPromoCodeResponse = paths["/productDetailsPage"]["post"]["responses"]["200"]["content"]["application/json"]["promos"];
8162
+ type TValidatedPromoResponse = NonNullable<TPromoCodeResponse>["validatedPromoCodes"];
8163
+
8164
+ type NetworkEventDetail = {
8165
+ url: string;
8166
+ method: string;
8167
+ type: "fetch";
8168
+ response: Response;
8169
+ } | {
8170
+ url: string;
8171
+ method: string;
8172
+ type: "xhr";
8173
+ xhr: XMLHttpRequest;
8174
+ };
8175
+ /**
8176
+ * beamnetworkcall
8177
+ * Emitted by the Beam network listener whenever any API calls are made on the page
8178
+ */
8179
+ declare class BeamNetworkCallEvent extends CustomEvent<NetworkEventDetail> {
8180
+ static eventName: "beamnetworkcall";
8181
+ constructor(detail: NetworkEventDetail);
8182
+ }
8183
+ type NonprofitSelectDetail = {
8184
+ selectionId?: string;
8185
+ selectedNonprofitId?: number | null;
8186
+ nonprofitName?: string | null;
8187
+ source?: WidgetName | null;
8188
+ timestamp?: Date;
8189
+ };
8190
+ /**
8191
+ * beamnonprofitselect
8192
+ * Emitted when the end user selects a nonprofit in the Beam widget, and when the previous selection was restored
8193
+ * automatically
8194
+ */
8195
+ declare class BeamNonprofitSelectEvent extends CustomEvent<NonprofitSelectDetail> {
8196
+ static eventName: "beamnonprofitselect";
8197
+ constructor(detail: NonprofitSelectDetail);
8198
+ }
8199
+ type CartChangeDetail = TCartApi & {
8200
+ cartId?: string;
8201
+ subtotal?: number;
8202
+ itemCount?: number;
8203
+ currencyCode?: string;
8204
+ };
8205
+ /**
8206
+ * beamcartchange
8207
+ * Emitted when Beam detects that cart contents have changed, and when items are added to the cart for the first time
8208
+ */
8209
+ declare class BeamCartChangeEvent extends CustomEvent<CartChangeDetail> {
8210
+ static eventName: "beamcartchange";
8211
+ constructor(detail: CartChangeDetail);
8212
+ }
8213
+ type CartCreatedDetail = CartChangeDetail;
8214
+ /**
8215
+ * beamcartcreated
8216
+ * Emitted when a cart is created in Beam for the first time, but NOT when the cart is updated
8217
+ * Beam's cart expiration rules are used to determine when a returning visit counts as the same cart
8218
+ */
8219
+ declare class BeamCartCreatedEvent extends CustomEvent<CartCreatedDetail> {
8220
+ static eventName: "beamcartcreated";
8221
+ constructor(detail: CartCreatedDetail);
8222
+ }
8223
+ type OrderCreatedDetail = {
8224
+ orderId: TId;
8225
+ transactionId: TId;
8226
+ cartTotal: number;
8227
+ currencyCode: string;
8228
+ };
8229
+ /**
8230
+ * beamordercreated
8231
+ * Emitted when an order is registered with Beam for the first time, but NOT on repeat visits, page refreshes, etc.
8232
+ */
8233
+ declare class BeamOrderCreatedEvent extends CustomEvent<OrderCreatedDetail> {
8234
+ static eventName: "beamordercreated";
8235
+ constructor(detail: OrderCreatedDetail);
8236
+ }
8237
+ /**
8238
+ * beamstatuschange
8239
+ * Emitted when the Beam config object has finished initializing along with all plugins
8240
+ */
8241
+ type BeamStatusChangeEventDetail = {
8242
+ status: "pending";
8243
+ } | {
8244
+ status: "error";
8245
+ error: Error;
8246
+ } | {
8247
+ status: "ready";
8248
+ };
8249
+ declare class BeamStatusChangeEvent extends CustomEvent<BeamStatusChangeEventDetail> {
8250
+ static eventName: "beamstatuschange";
8251
+ constructor(detail: BeamStatusChangeEventDetail);
8252
+ }
8253
+ type NonprofitSelectionRemovedDetail = {
8254
+ previousNonprofitId?: number | null;
8255
+ newNonprofitId?: number | null;
8256
+ selectionId?: string;
8257
+ timestamp?: Date;
8258
+ };
8259
+ /**
8260
+ * beamnonprofitselectionremoved
8261
+ * Emitted when the nonprofit selection is removed from deselection or due to nonprofit cohort change
8262
+ */
8263
+ declare class BeamNonprofitSelectionRemovedEvent extends CustomEvent<NonprofitSelectionRemovedDetail> {
8264
+ static eventName: "beamnonprofitselectionremoved";
8265
+ constructor(detail: NonprofitSelectionRemovedDetail);
8266
+ }
8267
+ type PromoStoredDetail = {
8268
+ promoCodes: TPromoCodeRequest;
8269
+ };
8270
+ /**
8271
+ * Emitted when a URL with query parameters is sanitized and stored in localStorage
8272
+ *
8273
+ * @event beampromocodesstored
8274
+ */
8275
+ declare class BeamPromoCodesStoredEvent extends CustomEvent<PromoStoredDetail> {
8276
+ static eventName: string;
8277
+ constructor(detail: PromoStoredDetail);
8278
+ }
8279
+ type WidgetStoredPromosDetail = {
8280
+ source?: WidgetName | HelperName | null;
8281
+ };
8282
+ /**
8283
+ * Emitted when a widget stores the url or manual promoCodes in local storage
8284
+ *
8285
+ * @event beamwidgetstoredpromocodes
8286
+ */
8287
+ declare class BeamWidgetStoredPromoCodesEvent extends CustomEvent<WidgetStoredPromosDetail> {
8288
+ static eventName: "beamwidgetstoredpromocodes";
8289
+ constructor(detail: WidgetStoredPromosDetail);
8290
+ }
8291
+ type WidgetInitialNonprofitSyncDetail = {
8292
+ nonprofitId?: number | null;
8293
+ nonprofitIdChanged?: boolean;
8294
+ selectionId?: string;
8295
+ selectionIdChanged?: boolean;
8296
+ };
8297
+ /**
8298
+ * [Shopify Specific] - Emitted the first time a widget restores nonprofit selection from custom attributes
8299
+ *
8300
+ * @event beamwidgetinitialnonprofitsync
8301
+ */
8302
+ declare class BeamWidgetInitialNonprofitSyncEvent extends CustomEvent<WidgetInitialNonprofitSyncDetail> {
8303
+ static eventName: "beamwidgetinitialnonprofitsync";
8304
+ constructor(detail: WidgetInitialNonprofitSyncDetail);
8305
+ }
8306
+ type BeamWidgetInitialNonprofitSyncCancelDetail = {
8307
+ cancelled?: boolean;
8308
+ };
8309
+ /**
8310
+ * [Shopify Specific] - Allows WidgetInitialNonprofitSyncDetail to be cancelled asynchronously
8311
+ *
8312
+ * @event beamwidgetinitialnonprofitsynccancel
8313
+ */
8314
+ declare class BeamWidgetInitialNonprofitSyncCancelEvent extends CustomEvent<BeamWidgetInitialNonprofitSyncCancelDetail> {
8315
+ static eventName: "beamwidgetinitialnonprofitsynccancel";
8316
+ constructor(detail: BeamWidgetInitialNonprofitSyncCancelDetail);
8317
+ }
8318
+ type BeamStatsigInitializedDetail = {
8319
+ showBeam: boolean;
8320
+ stableId?: string;
8321
+ };
8322
+ /**
8323
+ * Fired when Statsig experiment assignments for Beam are initialized
8324
+ *
8325
+ * @event beamstatsiginitialized
8326
+ */
8327
+ declare class BeamStatsigInitializedEvent extends CustomEvent<BeamStatsigInitializedDetail> {
8328
+ static eventName: "beamstatsiginitialized";
8329
+ constructor(detail: BeamStatsigInitializedDetail);
8330
+ }
8331
+
8332
+ type events_BeamCartChangeEvent = BeamCartChangeEvent;
8333
+ declare const events_BeamCartChangeEvent: typeof BeamCartChangeEvent;
8334
+ type events_BeamCartCreatedEvent = BeamCartCreatedEvent;
8335
+ declare const events_BeamCartCreatedEvent: typeof BeamCartCreatedEvent;
8336
+ type events_BeamNetworkCallEvent = BeamNetworkCallEvent;
8337
+ declare const events_BeamNetworkCallEvent: typeof BeamNetworkCallEvent;
8338
+ type events_BeamNonprofitSelectEvent = BeamNonprofitSelectEvent;
8339
+ declare const events_BeamNonprofitSelectEvent: typeof BeamNonprofitSelectEvent;
8340
+ type events_BeamNonprofitSelectionRemovedEvent = BeamNonprofitSelectionRemovedEvent;
8341
+ declare const events_BeamNonprofitSelectionRemovedEvent: typeof BeamNonprofitSelectionRemovedEvent;
8342
+ type events_BeamOrderCreatedEvent = BeamOrderCreatedEvent;
8343
+ declare const events_BeamOrderCreatedEvent: typeof BeamOrderCreatedEvent;
8344
+ type events_BeamPromoCodesStoredEvent = BeamPromoCodesStoredEvent;
8345
+ declare const events_BeamPromoCodesStoredEvent: typeof BeamPromoCodesStoredEvent;
8346
+ type events_BeamStatsigInitializedEvent = BeamStatsigInitializedEvent;
8347
+ declare const events_BeamStatsigInitializedEvent: typeof BeamStatsigInitializedEvent;
8348
+ type events_BeamStatusChangeEvent = BeamStatusChangeEvent;
8349
+ declare const events_BeamStatusChangeEvent: typeof BeamStatusChangeEvent;
8350
+ type events_BeamWidgetInitialNonprofitSyncCancelEvent = BeamWidgetInitialNonprofitSyncCancelEvent;
8351
+ declare const events_BeamWidgetInitialNonprofitSyncCancelEvent: typeof BeamWidgetInitialNonprofitSyncCancelEvent;
8352
+ type events_BeamWidgetInitialNonprofitSyncEvent = BeamWidgetInitialNonprofitSyncEvent;
8353
+ declare const events_BeamWidgetInitialNonprofitSyncEvent: typeof BeamWidgetInitialNonprofitSyncEvent;
8354
+ type events_BeamWidgetStoredPromoCodesEvent = BeamWidgetStoredPromoCodesEvent;
8355
+ declare const events_BeamWidgetStoredPromoCodesEvent: typeof BeamWidgetStoredPromoCodesEvent;
8356
+ declare namespace events {
8357
+ export {
8358
+ events_BeamCartChangeEvent as BeamCartChangeEvent,
8359
+ events_BeamCartCreatedEvent as BeamCartCreatedEvent,
8360
+ events_BeamNetworkCallEvent as BeamNetworkCallEvent,
8361
+ events_BeamNonprofitSelectEvent as BeamNonprofitSelectEvent,
8362
+ events_BeamNonprofitSelectionRemovedEvent as BeamNonprofitSelectionRemovedEvent,
8363
+ events_BeamOrderCreatedEvent as BeamOrderCreatedEvent,
8364
+ events_BeamPromoCodesStoredEvent as BeamPromoCodesStoredEvent,
8365
+ events_BeamStatsigInitializedEvent as BeamStatsigInitializedEvent,
8366
+ events_BeamStatusChangeEvent as BeamStatusChangeEvent,
8367
+ events_BeamWidgetInitialNonprofitSyncCancelEvent as BeamWidgetInitialNonprofitSyncCancelEvent,
8368
+ events_BeamWidgetInitialNonprofitSyncEvent as BeamWidgetInitialNonprofitSyncEvent,
8369
+ events_BeamWidgetStoredPromoCodesEvent as BeamWidgetStoredPromoCodesEvent,
8370
+ };
8371
+ }
8372
+
8373
+ declare function waitForElement(selector: string, { timeout }?: {
8374
+ timeout?: number | undefined;
8375
+ }): Promise<Element>;
8376
+
8377
+ declare const initNetworkListeners: () => void;
8378
+
8379
+ declare class BeamError extends Error {
8380
+ supportUrl: string;
8381
+ constructor(msg?: string, { cause, name }?: {
8382
+ cause?: any;
8383
+ name?: string;
8384
+ });
8385
+ }
8386
+ declare class NetworkError extends BeamError {
8387
+ /** Fetch Response object with .ok, .status, etc.*/
8388
+ response: Response;
8389
+ /** If network response included JSON payload, it is parsed and available here */
8390
+ body?: Record<string, string>;
8391
+ constructor(response: Response, body?: Record<string, string>, msg?: string);
8392
+ }
8393
+ declare class MissingConfig extends BeamError {
8394
+ missingConfigKeyNames: string[];
8395
+ constructor(missingConfigKeyNames?: string[], msg?: string);
8396
+ }
8397
+ declare class LocalStorageError extends BeamError {
8398
+ constructor(msg?: string);
8399
+ }
8400
+ declare class SetupError extends BeamError {
8401
+ constructor(msg?: string);
8402
+ }
8403
+
8404
+ type beamErrors_BeamError = BeamError;
8405
+ declare const beamErrors_BeamError: typeof BeamError;
8406
+ type beamErrors_LocalStorageError = LocalStorageError;
8407
+ declare const beamErrors_LocalStorageError: typeof LocalStorageError;
8408
+ type beamErrors_MissingConfig = MissingConfig;
8409
+ declare const beamErrors_MissingConfig: typeof MissingConfig;
8410
+ type beamErrors_NetworkError = NetworkError;
8411
+ declare const beamErrors_NetworkError: typeof NetworkError;
8412
+ type beamErrors_SetupError = SetupError;
8413
+ declare const beamErrors_SetupError: typeof SetupError;
8414
+ declare namespace beamErrors {
8415
+ export {
8416
+ beamErrors_BeamError as BeamError,
8417
+ beamErrors_LocalStorageError as LocalStorageError,
8418
+ beamErrors_MissingConfig as MissingConfig,
8419
+ beamErrors_NetworkError as NetworkError,
8420
+ beamErrors_SetupError as SetupError,
8421
+ };
8422
+ }
8423
+
8424
+ declare const logger: {
8425
+ error: (...args: any[]) => void;
8426
+ log: (...args: any[]) => void;
8427
+ warn: (...args: any[]) => void;
8428
+ debug: (...args: any[]) => void;
8429
+ };
8430
+
8431
+ /**
8432
+ * Creates an object that has the same API as normal localStorage, but adds a beam_ prefix and apiKey postfix to keys
8433
+ * Also adds helper methods for JSON (de-)serialization
8434
+ */
8435
+ declare const createScopedLocalStorage: (config: {
8436
+ apiKey: string;
8437
+ }) => {
8438
+ readonly prefix: string;
8439
+ readonly postfix: string;
8440
+ getItem(key: string): string | null;
8441
+ setItem(key: string, value: unknown): void;
8442
+ removeItem(key: string): void;
8443
+ /** Safely parses value as JSON and return JS object */
8444
+ getItemJson<T = Record<string, unknown>>(key: string): T | null;
8445
+ /** Safely stringifies value as JSON */
8446
+ setItemJson(key: string, value: object): void;
8447
+ };
8448
+
8449
+ declare const getCookieMap: (cookieString?: string) => Map<string, string>;
8450
+ declare const getCookieValue: (name: string) => string | undefined;
8451
+ declare const setCookieValue: (options: CookieInit) => undefined;
8452
+ declare const deleteCookieValue: (options: {
8453
+ name: string;
8454
+ domain?: string;
8455
+ path?: string;
8456
+ }) => undefined;
8457
+ interface CookieInit {
8458
+ name: string;
8459
+ value: string;
8460
+ path?: string;
8461
+ domain?: string;
8462
+ expires?: number;
8463
+ sameSite?: "strict" | "lax" | "none";
8464
+ }
8465
+
8466
+ declare function saveRemoteSession({ remoteSessionId, apiKey }: {
8467
+ remoteSessionId: string;
8468
+ apiKey?: string;
8469
+ }): void;
8470
+ declare function getRemoteSession({ apiKey }: {
8471
+ apiKey?: string;
8472
+ }): string | null;
8473
+
8474
+ type Func<T extends any[], R> = (...args: T) => R;
8475
+ /**
8476
+ * Takes a function and returns a new memoized function.
8477
+ * If the same arguments are passed to the memoized function, it will return the previously computed result.
8478
+ * This is a "memoize once" function meaning it only compares the previous and current arguments, not historic values.
8479
+ * Results that throw errors or return rejected Promises are not cached.
8480
+ *
8481
+ * @param {Function} fn - The function to be memoized.
8482
+ * @param {(value: any) => boolean} [isEqual]- The equality function used to compare arguments.
8483
+ * @returns {Function} - The memoized function.
8484
+ * @param func
8485
+ */
8486
+ declare function memoizeLast<T extends any[], R>(func: Func<T, R>, { isEqual }?: {
8487
+ isEqual?: ((value: any, other: any) => boolean) | undefined;
8488
+ }): Func<T, R>;
8489
+
8490
+ /**
8491
+ * Retrieves all validated promo codes stored in the "beam_promo_codes" cookie and parses it
8492
+ *
8493
+ * @returns {TPromoCodeResponse | undefined} An array of `ValidatedPromoCode` objects if found and parsed successfully, otherwise `undefined`
8494
+ */
8495
+ declare const getAllPromoCodesFromCookie: () => TPromoCodeResponse | undefined;
8496
+ /**
8497
+ * Stores the validated promo codes in the "beam_promo_codes" cookie, replaces and does not merge
8498
+ *
8499
+ * @param {TValidatedPromoResponse} validatedPromoCodes
8500
+ * @param {string} domain
8501
+ */
8502
+ declare const setPromoCodeInCookie: ({ validatedPromoCodes, domain, }: {
8503
+ validatedPromoCodes: TValidatedPromoResponse;
8504
+ domain?: string;
8505
+ }) => void;
8506
+ /**
8507
+ * Retrieves promo codes from localStorage, scoped by API key
8508
+ * @param {string} apiKey API key used for storage scoping
8509
+ * @returns {TPromoCodeRequest | null} - Returns stored promo codes object containing both
8510
+ * validated and unvalidated codes
8511
+ * - If no codes exist, returns a fresh object with empty arrays
8512
+ *
8513
+ */
8514
+ declare const getPromoCodesLocalStorage: ({ apiKey }: {
8515
+ apiKey: string;
8516
+ }) => TPromoCodeRequest | null;
8517
+ /**
8518
+ * Sets promo codes in localStorage
8519
+ * @param {TPromoCodeRequest} promoCodes New promo codes to add
8520
+ * @param {string} apiKey API key for storage scoping
8521
+ */
8522
+ declare const setPromoCodesInLocalStorage: ({ apiKey, promoCodes, }: {
8523
+ apiKey?: string;
8524
+ promoCodes: Partial<TPromoCodeRequest>;
8525
+ }) => void;
8526
+ /**
8527
+ * Merges new promo codes with existing ones and returns the combined result
8528
+ * @param {Partial<TPromoCodeRequest>} newPromos New promo codes to add
8529
+ * @param {string} apiKey API key for storage scoping
8530
+ * @returns {TPromoCodeRequest} An object containing both validated and unvalidated promo codes
8531
+ * @example
8532
+ * const result = mergePromoCodes({
8533
+ * apiKey: 'beam_123',
8534
+ * newPromos: {
8535
+ * unvalidatedPromoCodes: [
8536
+ * { type: 'manual', attributes: { value: 'WINTER20' } },
8537
+ * { type: 'url', attributes: { url: 'www.example.com/?promo=HOLIDAY25' } }
8538
+ * ]
8539
+ * }
8540
+ * });
8541
+ */
8542
+ declare const mergeStoreAndReturnPromos: ({ newPromos, apiKey, }: {
8543
+ newPromos: Partial<TPromoCodeRequest>;
8544
+ apiKey: string;
8545
+ }) => TPromoCodeRequest;
8546
+ /**
8547
+ * Formats unvalidated promo codes by determining their source and attributes
8548
+ * The function will assign `QueryParam` as the source if a `url` exists,
8549
+ * otherwise, it will assign `Manual` as the source
8550
+ *
8551
+ * @param {TPromoCodeAttribute[]} promoAttributes An array of promo attributes to be formatted
8552
+ * @returns {TUnvalidatedPromoRequest} - An array of UnvalidatedPromoCode objects,
8553
+ * each with a source and attributes object
8554
+ */
8555
+ declare const mapToUnvalidatedPromoCodes: (promoAttributes: TPromoCodeAttribute[]) => TUnvalidatedPromoRequest;
8556
+ /**
8557
+ * @param {TPromoCodeAttribute[]} promoAttributes An array of promo attributes to be formatted
8558
+ * @param {string} apiKey API key for storage scoping
8559
+ * @returns {TPromoCodeRequest} An object containing both validated and unvalidated promo codes
8560
+ */
8561
+ declare const formatStoreAndReturnPromoCodes: (promoAttributes: TPromoCodeAttribute[], apiKey: string) => TPromoCodeRequest;
8562
+ /**
8563
+ * Extracts applicable promo codes from the cart object
8564
+ * This function retrieves discounts stored in the cart's `content.discounts` array,
8565
+ * filters out only the applicable promo codes, and returns them as an array of strings
8566
+ *
8567
+ * @param {TBeamCartLocalStorage} cart The cart object retrieved from local storage
8568
+ * @returns {string[]} An array of applicable promo codes
8569
+ */
8570
+ declare const getPromoCodesFromCart: (cart: TBeamCartLocalStorage) => string[];
8571
+ /**
8572
+ * Gets promo code exclusively from Shopify discount cookie
8573
+ * @returns {string | null} Single discount code or null if not found
8574
+ */
8575
+ declare const getPromoCodeFromShopifyCookie: () => string | null;
8576
+ /**
8577
+ * Safely parses a JSON string into an array of strings
8578
+ * If parsing fails or the input is not a valid JSON array, it returns an empty array
8579
+ *
8580
+ * @param {string | undefined | null} jsonString The JSON string to parse
8581
+ * @returns {string[]} The parsed array of strings or an empty array if parsing fails
8582
+ */
8583
+ declare const parseJsonStringArray: (jsonString: string | undefined | null) => string[];
8584
+ /**
8585
+ * Retrieves and sanitizes the current URL for storage, preserving only safe query parameters
8586
+ *
8587
+ * @returns {TPromoCodeAttribute} Returns an object with only the `url` property set
8588
+ */
8589
+ declare const getSanitizedUrlForStorage: () => TPromoCodeAttribute | undefined;
8590
+ declare const promoCodesAreEqual: (a: TPromoCodeRequest, b: TPromoCodeRequest) => boolean;
8591
+ declare const isEmptyPromoData: (promos: {
8592
+ unvalidatedPromoCodes?: unknown[];
8593
+ validatedPromoCodes?: unknown[];
8594
+ }) => boolean;
8595
+
8596
+ declare const index_createScopedLocalStorage: typeof createScopedLocalStorage;
8597
+ declare const index_debounce: typeof debounce;
8598
+ declare const index_deleteCookieValue: typeof deleteCookieValue;
8599
+ declare const index_events: typeof events;
8600
+ declare const index_formatStoreAndReturnPromoCodes: typeof formatStoreAndReturnPromoCodes;
8601
+ declare const index_getAllPromoCodesFromCookie: typeof getAllPromoCodesFromCookie;
8602
+ declare const index_getCookieMap: typeof getCookieMap;
8603
+ declare const index_getCookieValue: typeof getCookieValue;
8604
+ declare const index_getPromoCodeFromShopifyCookie: typeof getPromoCodeFromShopifyCookie;
8605
+ declare const index_getPromoCodesFromCart: typeof getPromoCodesFromCart;
8606
+ declare const index_getPromoCodesLocalStorage: typeof getPromoCodesLocalStorage;
8607
+ declare const index_getRemoteSession: typeof getRemoteSession;
8608
+ declare const index_getSanitizedUrlForStorage: typeof getSanitizedUrlForStorage;
8609
+ declare const index_initNetworkListeners: typeof initNetworkListeners;
8610
+ declare const index_isEmptyPromoData: typeof isEmptyPromoData;
8611
+ declare const index_isEqual: typeof isEqual;
8612
+ declare const index_logger: typeof logger;
8613
+ declare const index_mapToUnvalidatedPromoCodes: typeof mapToUnvalidatedPromoCodes;
8614
+ declare const index_memoizeLast: typeof memoizeLast;
8615
+ declare const index_mergeStoreAndReturnPromos: typeof mergeStoreAndReturnPromos;
8616
+ declare const index_parseJsonStringArray: typeof parseJsonStringArray;
8617
+ declare const index_promoCodesAreEqual: typeof promoCodesAreEqual;
8618
+ declare const index_saveRemoteSession: typeof saveRemoteSession;
8619
+ declare const index_setCookieValue: typeof setCookieValue;
8620
+ declare const index_setPromoCodeInCookie: typeof setPromoCodeInCookie;
8621
+ declare const index_setPromoCodesInLocalStorage: typeof setPromoCodesInLocalStorage;
8622
+ declare const index_waitForElement: typeof waitForElement;
8623
+ declare namespace index {
8624
+ export {
8625
+ index_createScopedLocalStorage as createScopedLocalStorage,
8626
+ index_debounce as debounce,
8627
+ index_deleteCookieValue as deleteCookieValue,
8628
+ beamErrors as errors,
8629
+ index_events as events,
8630
+ index_formatStoreAndReturnPromoCodes as formatStoreAndReturnPromoCodes,
8631
+ index_getAllPromoCodesFromCookie as getAllPromoCodesFromCookie,
8632
+ index_getCookieMap as getCookieMap,
8633
+ index_getCookieValue as getCookieValue,
8634
+ index_getPromoCodeFromShopifyCookie as getPromoCodeFromShopifyCookie,
8635
+ index_getPromoCodesFromCart as getPromoCodesFromCart,
8636
+ index_getPromoCodesLocalStorage as getPromoCodesLocalStorage,
8637
+ index_getRemoteSession as getRemoteSession,
8638
+ index_getSanitizedUrlForStorage as getSanitizedUrlForStorage,
8639
+ index_initNetworkListeners as initNetworkListeners,
8640
+ index_isEmptyPromoData as isEmptyPromoData,
8641
+ index_isEqual as isEqual,
8642
+ index_logger as logger,
8643
+ index_mapToUnvalidatedPromoCodes as mapToUnvalidatedPromoCodes,
8644
+ index_memoizeLast as memoizeLast,
8645
+ index_mergeStoreAndReturnPromos as mergeStoreAndReturnPromos,
8646
+ index_parseJsonStringArray as parseJsonStringArray,
8647
+ index_promoCodesAreEqual as promoCodesAreEqual,
8648
+ index_saveRemoteSession as saveRemoteSession,
8649
+ index_setCookieValue as setCookieValue,
8650
+ index_setPromoCodeInCookie as setPromoCodeInCookie,
8651
+ index_setPromoCodesInLocalStorage as setPromoCodesInLocalStorage,
8652
+ index_waitForElement as waitForElement,
8653
+ };
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 { SetupError as $, mergeStoreAndReturnPromos as A, BeamNonprofitSelectEvent as B, parseJsonStringArray as C, promoCodesAreEqual as D, saveRemoteSession as E, setCookieValue as F, setPromoCodeInCookie as G, setPromoCodesInLocalStorage as H, BeamCartChangeEvent as K, BeamCartCreatedEvent as M, BeamNetworkCallEvent as N, BeamNonprofitSelectionRemovedEvent as O, BeamOrderCreatedEvent as P, BeamPromoCodesStoredEvent as Q, BeamStatsigInitializedEvent as R, BeamStatusChangeEvent as S, BeamWidgetInitialNonprofitSyncCancelEvent as U, BeamWidgetInitialNonprofitSyncEvent as V, BeamWidgetStoredPromoCodesEvent as W, BeamError as X, LocalStorageError as Y, MissingConfig as Z, NetworkError as _, index as a, getBeamCartId as a0, getExternalCartId as a1, makeApiKeyHeader as a2, events as e, initNetworkListeners as i, createScopedLocalStorage as j, deleteCookieValue as k, beamErrors as l, formatStoreAndReturnPromoCodes as m, getAllPromoCodesFromCookie as n, getCookieMap as o, getCookieValue as p, getPromoCodeFromShopifyCookie as q, getPromoCodesFromCart as r, getPromoCodesLocalStorage as s, getRemoteSession as t, getSanitizedUrlForStorage as u, isEmptyPromoData as v, waitForElement as w, logger as x, mapToUnvalidatedPromoCodes as y, memoizeLast as z };
8678
+ export type { paths as I, TApiKey as J, LANGUAGES as L, TUrl$1 as T, TNumericId as b, TId as c, TCart as d, TUrl as f, BeamBaseAPIConfig as g, TCartApi as h };