@beamimpact/web-sdk 1.52.6 → 1.53.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 (194) hide show
  1. package/dist/chunks/{_share-dialog-dependencies-Cry6mcdg.esm.js → _share-dialog-dependencies-Cirjl8zP.esm.js} +2 -2
  2. package/dist/chunks/{_share-dialog-dependencies-Cry6mcdg.esm.js.map → _share-dialog-dependencies-Cirjl8zP.esm.js.map} +1 -1
  3. package/dist/chunks/{_share-dialog-dependencies-DSYemenF.esm.js → _share-dialog-dependencies-DElW9Yip.esm.js} +2 -2
  4. package/dist/chunks/{_share-dialog-dependencies-DSYemenF.esm.js.map → _share-dialog-dependencies-DElW9Yip.esm.js.map} +1 -1
  5. package/dist/chunks/cart-contents-DkoytiZh.esm.js.map +1 -1
  6. package/dist/chunks/{cart-contents-CUgc4y1N.esm.d.ts → cart-contents-oArgpFbi.esm.d.ts} +1 -1
  7. package/dist/chunks/{events-BKkf9u9l.esm.d.ts → events-BMTcECV9.esm.d.ts} +2 -2
  8. package/dist/chunks/{index-TAxKoTC1.esm.d.ts → index-1Mhh255_.esm.d.ts} +1 -1
  9. package/dist/chunks/index-2vxtp84k.esm.js +2 -0
  10. package/dist/chunks/index-2vxtp84k.esm.js.map +1 -0
  11. package/dist/chunks/index-Bs4Q42bL.esm.js +2 -0
  12. package/dist/chunks/index-Bs4Q42bL.esm.js.map +1 -0
  13. package/dist/chunks/{index-ki8pLX6n.esm.d.ts → index-C4P0R2un.esm.d.ts} +4 -4
  14. package/dist/chunks/{index-CbKkAM6h.esm.d.ts → index-CPVMm4wx.esm.d.ts} +1 -1
  15. package/dist/chunks/{index-Dnm34FcO.esm.d.ts → index-Ca8xkEwS.esm.d.ts} +1 -1
  16. package/dist/chunks/index-CaBSaNNT.esm.js +2 -0
  17. package/dist/chunks/index-CaBSaNNT.esm.js.map +1 -0
  18. package/dist/chunks/index-CjT2ycv5.esm.js +389 -0
  19. package/dist/chunks/index-CjT2ycv5.esm.js.map +1 -0
  20. package/dist/chunks/{index-BqBEii8E.esm.d.ts → index-CkuCObi0.esm.d.ts} +1 -1
  21. package/dist/chunks/index-DGyP7M3g.esm.js +2 -0
  22. package/dist/chunks/index-DGyP7M3g.esm.js.map +1 -0
  23. package/dist/chunks/index-DUeE7FLq.esm.js +2 -0
  24. package/dist/chunks/index-DUeE7FLq.esm.js.map +1 -0
  25. package/dist/chunks/index-DZyO6--E.esm.js +2 -0
  26. package/dist/chunks/index-DZyO6--E.esm.js.map +1 -0
  27. package/dist/chunks/index-D_L-n4we.esm.js +2 -0
  28. package/dist/chunks/index-D_L-n4we.esm.js.map +1 -0
  29. package/dist/chunks/{index-DvbUE31b.esm.d.ts → index-DqffUXvi.esm.d.ts} +1 -1
  30. package/dist/chunks/index-IZJ4xhyj.esm.js +2 -0
  31. package/dist/chunks/index-IZJ4xhyj.esm.js.map +1 -0
  32. package/dist/chunks/index-Z9-EAuWk.esm.js +2 -0
  33. package/dist/chunks/index-Z9-EAuWk.esm.js.map +1 -0
  34. package/dist/chunks/index-sUGvOawY.esm.js +2 -0
  35. package/dist/chunks/index-sUGvOawY.esm.js.map +1 -0
  36. package/dist/chunks/index-vH6HFI2B.esm.js +389 -0
  37. package/dist/chunks/index-vH6HFI2B.esm.js.map +1 -0
  38. package/dist/chunks/{openapi-spec-VAt3phhg.esm.d.ts → openapi-spec-x9NbL7bU.esm.d.ts} +860 -199
  39. package/dist/chunks/{order-page-Cerye00Q.esm.d.ts → order-page-D_p01zgd.esm.d.ts} +3 -3
  40. package/dist/chunks/order-page-O5u1cAz8.esm.js +2 -0
  41. package/dist/chunks/order-page-O5u1cAz8.esm.js.map +1 -0
  42. package/dist/chunks/order-page-Vk9anZAb.esm.js +2 -0
  43. package/dist/chunks/order-page-Vk9anZAb.esm.js.map +1 -0
  44. package/dist/chunks/{promo-types-C1unMpo2.esm.d.ts → promo-types-Cz_Zkjy1.esm.d.ts} +1 -1
  45. package/dist/chunks/promoManager-B9cTR1R3.esm.js.map +1 -1
  46. package/dist/chunks/promoManager-fl54hq13.esm.js.map +1 -1
  47. package/dist/chunks/routes-BnPd0lrO.esm.js +2 -0
  48. package/dist/chunks/routes-BnPd0lrO.esm.js.map +1 -0
  49. package/dist/chunks/{routes-DDRd747e.esm.d.ts → routes-BwRUVGsk.esm.d.ts} +21 -4
  50. package/dist/chunks/routes-D7s2_Xn5.esm.js +2 -0
  51. package/dist/chunks/routes-D7s2_Xn5.esm.js.map +1 -0
  52. package/dist/chunks/{share-button-Bj6RA_H6.esm.js → share-button-8zVx6bYw.esm.js} +2 -2
  53. package/dist/chunks/{share-button-Bj6RA_H6.esm.js.map → share-button-8zVx6bYw.esm.js.map} +1 -1
  54. package/dist/chunks/{share-button-DNgyupow.esm.js → share-button-CM4kwufS.esm.js} +2 -2
  55. package/dist/chunks/{share-button-XJxSyBaT.esm.js.map → share-button-CM4kwufS.esm.js.map} +1 -1
  56. package/dist/chunks/{share-button-DUn-zC5t.esm.js → share-button-CWFcBlaF.esm.js} +2 -2
  57. package/dist/chunks/{share-button-DUn-zC5t.esm.js.map → share-button-CWFcBlaF.esm.js.map} +1 -1
  58. package/dist/chunks/{share-button-XJxSyBaT.esm.js → share-button-DNyMCeHQ.esm.js} +2 -2
  59. package/dist/chunks/{share-button-DNgyupow.esm.js.map → share-button-DNyMCeHQ.esm.js.map} +1 -1
  60. package/dist/chunks/{update-cart-y9guItUM.esm.js → update-cart-BQHJ9lRb.esm.js} +2 -2
  61. package/dist/chunks/{update-cart-y9guItUM.esm.js.map → update-cart-BQHJ9lRb.esm.js.map} +1 -1
  62. package/dist/chunks/{update-cart-Kt4NGuYW.esm.js → update-cart-DCxR1dVX.esm.js} +2 -2
  63. package/dist/chunks/{update-cart-Kt4NGuYW.esm.js.map → update-cart-DCxR1dVX.esm.js.map} +1 -1
  64. package/dist/chunks/{update-cart-NiToHHJH.esm.d.ts → update-cart-Dp0v0m4d.esm.d.ts} +1 -1
  65. package/dist/components/community-impact.esm.js +1 -1
  66. package/dist/components/community-impact.js +1 -1
  67. package/dist/components/cumulative-impact.esm.js +1 -1
  68. package/dist/components/cumulative-impact.js +1 -1
  69. package/dist/components/impact-overview.d.ts +3 -0
  70. package/dist/components/impact-overview.esm.js +1 -1
  71. package/dist/components/impact-overview.js +1 -1
  72. package/dist/components/index.d.ts +3 -3
  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 +10 -88
  76. package/dist/components/post-purchase.esm.js +4 -3
  77. package/dist/components/post-purchase.esm.js.map +1 -1
  78. package/dist/components/post-purchase.js +4 -3
  79. package/dist/components/post-purchase.js.map +1 -1
  80. package/dist/components/product-details-page.d.ts +1 -1
  81. package/dist/components/product-details-page.esm.js +1 -1
  82. package/dist/components/product-details-page.js +1 -1
  83. package/dist/components/redeem-transaction.d.ts +2 -2
  84. package/dist/components/redeem-transaction.esm.js +1 -388
  85. package/dist/components/redeem-transaction.esm.js.map +1 -1
  86. package/dist/components/redeem-transaction.js +1 -388
  87. package/dist/components/redeem-transaction.js.map +1 -1
  88. package/dist/components/select-nonprofit.d.ts +2 -2
  89. package/dist/components/select-nonprofit.esm.js +1 -1
  90. package/dist/components/select-nonprofit.js +1 -1
  91. package/dist/components/select-subscription-nonprofit.esm.js +1 -1
  92. package/dist/components/select-subscription-nonprofit.js +1 -1
  93. package/dist/components/shopify.d.ts +7 -7
  94. package/dist/components/shopify.esm.js +1 -1
  95. package/dist/components/shopify.esm.js.map +1 -1
  96. package/dist/components/shopify.js +1 -1
  97. package/dist/components/shopify.js.map +1 -1
  98. package/dist/components/social-share.esm.js +1 -1
  99. package/dist/components/social-share.js +1 -1
  100. package/dist/components/subscription-impact.d.ts +3 -0
  101. package/dist/components/subscription-impact.esm.js +1 -1
  102. package/dist/components/subscription-impact.js +1 -1
  103. package/dist/components/subscription-management.d.ts +16 -3
  104. package/dist/components/subscription-management.esm.js +18 -18
  105. package/dist/components/subscription-management.esm.js.map +1 -1
  106. package/dist/components/subscription-management.js +18 -18
  107. package/dist/components/subscription-management.js.map +1 -1
  108. package/dist/index.d.ts +13 -13
  109. package/dist/index.esm.js +1 -1
  110. package/dist/index.js +1 -1
  111. package/dist/integrations/beam.esm.js +1 -1
  112. package/dist/integrations/beam.js +1 -1
  113. package/dist/integrations/cart.d.ts +3 -3
  114. package/dist/integrations/cart.esm.js +1 -1
  115. package/dist/integrations/cart.js +1 -1
  116. package/dist/integrations/index.d.ts +11 -11
  117. package/dist/integrations/index.esm.js +1 -1
  118. package/dist/integrations/index.js +1 -1
  119. package/dist/integrations/logs.d.ts +2 -2
  120. package/dist/integrations/logs.esm.js +1 -1
  121. package/dist/integrations/logs.js +1 -1
  122. package/dist/integrations/shopify.d.ts +5 -5
  123. package/dist/integrations/shopify.esm.js +1 -1
  124. package/dist/integrations/shopify.js +1 -1
  125. package/dist/integrations/statsig.esm.js +1 -1
  126. package/dist/integrations/statsig.js +1 -1
  127. package/dist/integrations/utils.d.ts +4 -4
  128. package/dist/react/community-impact.esm.js +1 -1
  129. package/dist/react/community-impact.js +1 -1
  130. package/dist/react/cumulative-impact.esm.js +1 -1
  131. package/dist/react/cumulative-impact.js +1 -1
  132. package/dist/react/impact-overview.esm.js +1 -1
  133. package/dist/react/impact-overview.js +1 -1
  134. package/dist/react/index.d.ts +5 -5
  135. package/dist/react/index.esm.js +1 -1
  136. package/dist/react/index.js +1 -1
  137. package/dist/react/post-purchase.d.ts +2 -2
  138. package/dist/react/post-purchase.esm.js +1 -1
  139. package/dist/react/post-purchase.esm.js.map +1 -1
  140. package/dist/react/post-purchase.js +1 -1
  141. package/dist/react/post-purchase.js.map +1 -1
  142. package/dist/react/product-details-page.d.ts +1 -1
  143. package/dist/react/product-details-page.esm.js +1 -1
  144. package/dist/react/product-details-page.js +1 -1
  145. package/dist/react/redeem-transaction.d.ts +4 -4
  146. package/dist/react/redeem-transaction.esm.js +1 -1
  147. package/dist/react/redeem-transaction.esm.js.map +1 -1
  148. package/dist/react/redeem-transaction.js +1 -1
  149. package/dist/react/redeem-transaction.js.map +1 -1
  150. package/dist/react/select-nonprofit.d.ts +4 -4
  151. package/dist/react/select-nonprofit.esm.js +1 -1
  152. package/dist/react/select-nonprofit.js +1 -1
  153. package/dist/react/select-subscription-nonprofit.d.ts +4 -4
  154. package/dist/react/select-subscription-nonprofit.esm.js +1 -1
  155. package/dist/react/select-subscription-nonprofit.js +1 -1
  156. package/dist/react/social-share.esm.js +1 -1
  157. package/dist/react/social-share.js +1 -1
  158. package/dist/react/subscription-impact.esm.js +1 -1
  159. package/dist/react/subscription-impact.js +1 -1
  160. package/dist/react/subscription-management.d.ts +3 -3
  161. package/dist/react/subscription-management.esm.js +1 -1
  162. package/dist/react/subscription-management.js +1 -1
  163. package/dist/utils/events.d.ts +4 -4
  164. package/dist/utils/index.d.ts +4 -4
  165. package/dist/utils/promoManager.d.ts +3 -3
  166. package/package.json +2 -2
  167. package/dist/chunks/index--lGfTDwX.esm.js +0 -2
  168. package/dist/chunks/index--lGfTDwX.esm.js.map +0 -1
  169. package/dist/chunks/index-1hlAGQPk.esm.js +0 -2
  170. package/dist/chunks/index-1hlAGQPk.esm.js.map +0 -1
  171. package/dist/chunks/index-B-uw46_j.esm.js +0 -2
  172. package/dist/chunks/index-B-uw46_j.esm.js.map +0 -1
  173. package/dist/chunks/index-BTYU0dxk.esm.js +0 -2
  174. package/dist/chunks/index-BTYU0dxk.esm.js.map +0 -1
  175. package/dist/chunks/index-CFtmDAHb.esm.js +0 -2
  176. package/dist/chunks/index-CFtmDAHb.esm.js.map +0 -1
  177. package/dist/chunks/index-D2Ox_xyE.esm.js +0 -2
  178. package/dist/chunks/index-D2Ox_xyE.esm.js.map +0 -1
  179. package/dist/chunks/index-D8jCSss3.esm.js +0 -2
  180. package/dist/chunks/index-D8jCSss3.esm.js.map +0 -1
  181. package/dist/chunks/index-DE2QManY.esm.js +0 -2
  182. package/dist/chunks/index-DE2QManY.esm.js.map +0 -1
  183. package/dist/chunks/index-GmNTlVv2.esm.js +0 -2
  184. package/dist/chunks/index-GmNTlVv2.esm.js.map +0 -1
  185. package/dist/chunks/index-oGObXjk6.esm.js +0 -2
  186. package/dist/chunks/index-oGObXjk6.esm.js.map +0 -1
  187. package/dist/chunks/order-page-BRpixGl8.esm.js +0 -2
  188. package/dist/chunks/order-page-BRpixGl8.esm.js.map +0 -1
  189. package/dist/chunks/order-page-CW5aw6Kh.esm.js +0 -2
  190. package/dist/chunks/order-page-CW5aw6Kh.esm.js.map +0 -1
  191. package/dist/chunks/routes-D-AQPRne.esm.js +0 -2
  192. package/dist/chunks/routes-D-AQPRne.esm.js.map +0 -1
  193. package/dist/chunks/routes-Lvj2SXN4.esm.js +0 -2
  194. package/dist/chunks/routes-Lvj2SXN4.esm.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { waitForElement } from '../utils/wait-for-element.js';
2
2
  export { initNetworkListeners } from '../utils/network-listeners.js';
3
- export { e as events } from '../chunks/events-BKkf9u9l.esm.js';
4
- export { B as BeamShopifyCartIntegrationConfig, T as TBeamOrderPageParams, a as addBeamAttributesToCart, d as appendBeamAttributesToCart, b as appendStatsigToShopifyCartAttributes, c as appendToShopifyCartBeamAttribute, f as getBeamAttributesForCart, g as getCurrentCart, e as getShopifyCart, r as registerCartIntegration, s as showBeamOrderPageWidgets, t as trackCart } from '../chunks/order-page-Cerye00Q.esm.js';
5
- import '../chunks/cart-contents-CUgc4y1N.esm.js';
6
- import '../chunks/openapi-spec-VAt3phhg.esm.js';
7
- import '../chunks/promo-types-C1unMpo2.esm.js';
3
+ export { e as events } from '../chunks/events-BMTcECV9.esm.js';
4
+ export { B as BeamShopifyCartIntegrationConfig, T as TBeamOrderPageParams, a as addBeamAttributesToCart, d as appendBeamAttributesToCart, b as appendStatsigToShopifyCartAttributes, c as appendToShopifyCartBeamAttribute, f as getBeamAttributesForCart, g as getCurrentCart, e as getShopifyCart, r as registerCartIntegration, s as showBeamOrderPageWidgets, t as trackCart } from '../chunks/order-page-D_p01zgd.esm.js';
5
+ import '../chunks/cart-contents-oArgpFbi.esm.js';
6
+ import '../chunks/openapi-spec-x9NbL7bU.esm.js';
7
+ import '../chunks/promo-types-Cz_Zkjy1.esm.js';
8
8
  import '../chunks/types-CPxMwnoR.esm.js';
9
9
  import 'lodash';
10
- import '../chunks/update-cart-NiToHHJH.esm.js';
10
+ import '../chunks/update-cart-Dp0v0m4d.esm.js';
11
11
  import '../chunks/types-C7gqAyyH.esm.js';
12
12
  import './post-purchase.js';
13
13
  import 'lit';
@@ -18,7 +18,7 @@ import '../chunks/promo-pill-label-BXRqZHET.esm.js';
18
18
  import './beam-partner-logos.js';
19
19
  import './impact-overview.js';
20
20
  import '../chunks/share-button-B9hpxBVr.esm.js';
21
- import '../chunks/routes-DDRd747e.esm.js';
21
+ import '../chunks/routes-BwRUVGsk.esm.js';
22
22
 
23
23
  /**
24
24
  * @deprecated
@@ -1,2 +1,2 @@
1
- import{waitForElement as t}from"../utils/wait-for-element.esm.js";import{getCookieValue as r,getCookieMap as o}from"../utils/cookies.esm.js";import{initNetworkListeners as K}from"../utils/network-listeners.esm.js";import{e as O}from"../chunks/events-BohmT6Lp.esm.js";import{z as Y,f as _,W as j,L as q,p as D,_ as G,I as H,K as J,s as Q,Y as R}from"../chunks/order-page-BRpixGl8.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";import"../chunks/lodash-D3TLHRR_.esm.js";import"../utils/logger.esm.js";import"../utils/local-storage.esm.js";import"../utils/memoize-last.esm.js";import"../chunks/promoManager-fl54hq13.esm.js";import"../chunks/cart-contents-DkoytiZh.esm.js";import"../chunks/update-cart-Kt4NGuYW.esm.js";import"../chunks/routes-Lvj2SXN4.esm.js";import"../utils/remote-session.esm.js";import"../utils/cart.esm.js";import"./post-purchase.esm.js";import"../chunks/lit-WqMxC_PA.esm.js";import"../chunks/enforce-config-CZ3ToOgr.esm.js";import"../chunks/localize-Btu9xYcE.esm.js";import"./redeem-transaction.esm.js";import"../chunks/progress-bar-DF7UuuHb.esm.js";import"../chunks/promo-pill-label-CbW_Vcru.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/loading-template-DG4lkIIc.esm.js";import"../chunks/css-card-grid-CvoGpsJH.esm.js";import"./impact-overview.esm.js";import"../chunks/_share-dialog-dependencies-Cry6mcdg.esm.js";import"../chunks/share-button-XJxSyBaT.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-DUn-zC5t.esm.js";import"../chunks/responsive-BR8qUfBa.esm.js";const i={waitForElement:t,getCookieMap:o,getCookieValue:r};export{Y as addBeamAttributesToCart,_ as appendBeamAttributesToCart,j as appendStatsigToShopifyCartAttributes,q as appendToShopifyCartBeamAttribute,O as events,D as getBeamAttributesForCart,G as getCurrentCart,H as getShopifyCart,K as initNetworkListeners,J as registerCartIntegration,Q as showBeamOrderPageWidgets,R as trackCart,i as utils};
1
+ import{waitForElement as t}from"../utils/wait-for-element.esm.js";import{getCookieValue as r,getCookieMap as o}from"../utils/cookies.esm.js";import{initNetworkListeners as L}from"../utils/network-listeners.esm.js";import{e as O}from"../chunks/events-BohmT6Lp.esm.js";import{z as Y,g as _,W as j,T as q,f as D,_ as G,I as H,K as J,s as Q,Y as R}from"../chunks/order-page-Vk9anZAb.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";import"../chunks/lodash-D3TLHRR_.esm.js";import"../utils/logger.esm.js";import"../utils/local-storage.esm.js";import"../utils/memoize-last.esm.js";import"../chunks/promoManager-fl54hq13.esm.js";import"../chunks/cart-contents-DkoytiZh.esm.js";import"../chunks/update-cart-DCxR1dVX.esm.js";import"../chunks/routes-BnPd0lrO.esm.js";import"../utils/remote-session.esm.js";import"../utils/cart.esm.js";import"./post-purchase.esm.js";import"../chunks/lit-WqMxC_PA.esm.js";import"../chunks/enforce-config-CZ3ToOgr.esm.js";import"../chunks/localize-Btu9xYcE.esm.js";import"../chunks/index-vH6HFI2B.esm.js";import"../chunks/progress-bar-DF7UuuHb.esm.js";import"../chunks/promo-pill-label-CbW_Vcru.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/loading-template-DG4lkIIc.esm.js";import"../chunks/css-card-grid-CvoGpsJH.esm.js";import"./impact-overview.esm.js";import"../chunks/_share-dialog-dependencies-Cirjl8zP.esm.js";import"../chunks/share-button-DNyMCeHQ.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-CWFcBlaF.esm.js";import"../chunks/responsive-BR8qUfBa.esm.js";const i={waitForElement:t,getCookieMap:o,getCookieValue:r};export{Y as addBeamAttributesToCart,_ as appendBeamAttributesToCart,j as appendStatsigToShopifyCartAttributes,q as appendToShopifyCartBeamAttribute,O as events,D as getBeamAttributesForCart,G as getCurrentCart,H as getShopifyCart,L as initNetworkListeners,J as registerCartIntegration,Q as showBeamOrderPageWidgets,R as trackCart,i as utils};
2
2
  //# sourceMappingURL=shopify.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shopify.esm.js","sources":["../../src/components/shopify/index.ts"],"sourcesContent":["/**\n * @deprecated\n * This file is preserved for backwards compatability, but future users should import from:\n * - integrations/shopify\n * - integration/utils\n * */\n\nimport { waitForElement } from \"../../utils/wait-for-element\";\nimport { getCookieMap, getCookieValue } from \"../../utils/cookies\";\n\nconst utils = {\n waitForElement,\n getCookieMap,\n getCookieValue,\n};\n\nexport { utils };\nexport { initNetworkListeners } from \"../../utils/network-listeners\";\nexport * as events from \"../../utils/events\";\n\nexport * from \"../../integrations/shopify\";\n"],"names":["utils","waitForElement","getCookieMap","getCookieValue"],"mappings":"qjDAUA,MAAMA,EAAQ,CACZ,eAAAC,EACA,aAAAC,EACA,eAAAC,CACF"}
1
+ {"version":3,"file":"shopify.esm.js","sources":["../../src/components/shopify/index.ts"],"sourcesContent":["/**\n * @deprecated\n * This file is preserved for backwards compatability, but future users should import from:\n * - integrations/shopify\n * - integration/utils\n * */\n\nimport { waitForElement } from \"../../utils/wait-for-element\";\nimport { getCookieMap, getCookieValue } from \"../../utils/cookies\";\n\nconst utils = {\n waitForElement,\n getCookieMap,\n getCookieValue,\n};\n\nexport { utils };\nexport { initNetworkListeners } from \"../../utils/network-listeners\";\nexport * as events from \"../../utils/events\";\n\nexport * from \"../../integrations/shopify\";\n"],"names":["utils","waitForElement","getCookieMap","getCookieValue"],"mappings":"yjDAUA,MAAMA,EAAQ,CACZ,eAAAC,EACA,aAAAC,EACA,eAAAC,CACF"}
@@ -1,2 +1,2 @@
1
- import{waitForElement as t}from"../utils/wait-for-element.js";import{getCookieValue as r,getCookieMap as o}from"../utils/cookies.js";import{initNetworkListeners as K}from"../utils/network-listeners.js";import{e as O}from"../chunks/events-BohmT6Lp.esm.js";import{z as Y,f as _,W as j,L as q,p as D,_ as G,I as H,K as J,s as Q,Y as R}from"../chunks/order-page-CW5aw6Kh.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";import"../chunks/lodash-D3TLHRR_.esm.js";import"../utils/logger.js";import"../utils/local-storage.js";import"../utils/memoize-last.js";import"../chunks/promoManager-B9cTR1R3.esm.js";import"../chunks/cart-contents-DkoytiZh.esm.js";import"../chunks/update-cart-y9guItUM.esm.js";import"../chunks/routes-D-AQPRne.esm.js";import"../utils/remote-session.js";import"../utils/cart.js";import"./post-purchase.js";import"../chunks/lit-WqMxC_PA.esm.js";import"../chunks/enforce-config-Ba1JkOHs.esm.js";import"../chunks/localize-C25pEGnx.esm.js";import"./redeem-transaction.js";import"../chunks/progress-bar-DF7UuuHb.esm.js";import"../chunks/promo-pill-label-CbW_Vcru.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"./beam-partner-logos.js";import"../chunks/loading-template-DG4lkIIc.esm.js";import"../chunks/css-card-grid-CvoGpsJH.esm.js";import"./impact-overview.js";import"../chunks/_share-dialog-dependencies-DSYemenF.esm.js";import"../chunks/share-button-DNgyupow.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-Bj6RA_H6.esm.js";import"../chunks/responsive-BR8qUfBa.esm.js";const i={waitForElement:t,getCookieMap:o,getCookieValue:r};export{Y as addBeamAttributesToCart,_ as appendBeamAttributesToCart,j as appendStatsigToShopifyCartAttributes,q as appendToShopifyCartBeamAttribute,O as events,D as getBeamAttributesForCart,G as getCurrentCart,H as getShopifyCart,K as initNetworkListeners,J as registerCartIntegration,Q as showBeamOrderPageWidgets,R as trackCart,i as utils};
1
+ import{waitForElement as t}from"../utils/wait-for-element.js";import{getCookieValue as r,getCookieMap as o}from"../utils/cookies.js";import{initNetworkListeners as L}from"../utils/network-listeners.js";import{e as O}from"../chunks/events-BohmT6Lp.esm.js";import{z as Y,g as _,W as j,T as q,f as D,_ as G,I as H,K as J,s as Q,Y as R}from"../chunks/order-page-O5u1cAz8.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";import"../chunks/lodash-D3TLHRR_.esm.js";import"../utils/logger.js";import"../utils/local-storage.js";import"../utils/memoize-last.js";import"../chunks/promoManager-B9cTR1R3.esm.js";import"../chunks/cart-contents-DkoytiZh.esm.js";import"../chunks/update-cart-BQHJ9lRb.esm.js";import"../chunks/routes-D7s2_Xn5.esm.js";import"../utils/remote-session.js";import"../utils/cart.js";import"./post-purchase.js";import"../chunks/lit-WqMxC_PA.esm.js";import"../chunks/enforce-config-Ba1JkOHs.esm.js";import"../chunks/localize-C25pEGnx.esm.js";import"../chunks/index-CjT2ycv5.esm.js";import"../chunks/progress-bar-DF7UuuHb.esm.js";import"../chunks/promo-pill-label-CbW_Vcru.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"./beam-partner-logos.js";import"../chunks/loading-template-DG4lkIIc.esm.js";import"../chunks/css-card-grid-CvoGpsJH.esm.js";import"./impact-overview.js";import"../chunks/_share-dialog-dependencies-DElW9Yip.esm.js";import"../chunks/share-button-CM4kwufS.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-8zVx6bYw.esm.js";import"../chunks/responsive-BR8qUfBa.esm.js";const i={waitForElement:t,getCookieMap:o,getCookieValue:r};export{Y as addBeamAttributesToCart,_ as appendBeamAttributesToCart,j as appendStatsigToShopifyCartAttributes,q as appendToShopifyCartBeamAttribute,O as events,D as getBeamAttributesForCart,G as getCurrentCart,H as getShopifyCart,L as initNetworkListeners,J as registerCartIntegration,Q as showBeamOrderPageWidgets,R as trackCart,i as utils};
2
2
  //# sourceMappingURL=shopify.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shopify.js","sources":["../../src/components/shopify/index.ts"],"sourcesContent":["/**\n * @deprecated\n * This file is preserved for backwards compatability, but future users should import from:\n * - integrations/shopify\n * - integration/utils\n * */\n\nimport { waitForElement } from \"../../utils/wait-for-element\";\nimport { getCookieMap, getCookieValue } from \"../../utils/cookies\";\n\nconst utils = {\n waitForElement,\n getCookieMap,\n getCookieValue,\n};\n\nexport { utils };\nexport { initNetworkListeners } from \"../../utils/network-listeners\";\nexport * as events from \"../../utils/events\";\n\nexport * from \"../../integrations/shopify\";\n"],"names":["utils","waitForElement","getCookieMap","getCookieValue"],"mappings":"qgDAUA,MAAMA,EAAQ,CACZ,eAAAC,EACA,aAAAC,EACA,eAAAC,CACF"}
1
+ {"version":3,"file":"shopify.js","sources":["../../src/components/shopify/index.ts"],"sourcesContent":["/**\n * @deprecated\n * This file is preserved for backwards compatability, but future users should import from:\n * - integrations/shopify\n * - integration/utils\n * */\n\nimport { waitForElement } from \"../../utils/wait-for-element\";\nimport { getCookieMap, getCookieValue } from \"../../utils/cookies\";\n\nconst utils = {\n waitForElement,\n getCookieMap,\n getCookieValue,\n};\n\nexport { utils };\nexport { initNetworkListeners } from \"../../utils/network-listeners\";\nexport * as events from \"../../utils/events\";\n\nexport * from \"../../integrations/shopify\";\n"],"names":["utils","waitForElement","getCookieMap","getCookieValue"],"mappings":"6gDAUA,MAAMA,EAAQ,CACZ,eAAAC,EACA,aAAAC,EACA,eAAAC,CACF"}
@@ -1,4 +1,4 @@
1
- import{f as m,g as o,t as n,h as g,y as f}from"../chunks/lit-WqMxC_PA.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"../chunks/_share-dialog-dependencies-Cry6mcdg.esm.js";import"../chunks/progress-bar-DF7UuuHb.esm.js";import"./beam-partner-logos.esm.js";import{c as b,d as y,e as u}from"../chunks/enforce-config-CZ3ToOgr.esm.js";import{D as w,S as x,g as I,W as U}from"../chunks/routes-Lvj2SXN4.esm.js";import{_ as S}from"../chunks/loading-template-DG4lkIIc.esm.js";import{u as d,s as r,p}from"../chunks/share-button-DUn-zC5t.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";import"../utils/logger.esm.js";var k=Object.defineProperty,a=(l,t,i,v)=>{for(var s=void 0,c=l.length-1,h;c>=0;c--)(h=l[c])&&(s=h(t,i,s)||s);return s&&k(t,i,s),s};class e extends g{constructor(){super(...arguments),this.baseUrl=w,this.lang="en",this.debug=!1,this.brandName=null,this.shareImageUrl=null,this.isMobile=!1,this.windowResized=!1,this.checkViewport=()=>{this.windowResized=window.innerWidth<=768}}get configLang(){return x[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.checkViewport),this.checkViewport()}disconnectedCallback(){window.removeEventListener("resize",this.checkViewport),super.disconnectedCallback()}async fetchImpactData(){u(["apiKey","storeId","nonprofitId"],this);try{return await I({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{storeId:this.storeId,personalImpactLimit:0,nonprofitId:this.nonprofitId,widgetName:U.community_impact,version:"1.0.0",lang:this.configLang,transactionId:this.transactionId??void 0}})}catch(t){throw this.debug&&console.error("Failed to fetch impact data",t),t}}async updateImpactData(){try{const t=await this.fetchImpactData();if(t&&(this.brandName=t.chain.name,this.shareImageUrl=t.promoAssetUrl||t.personalImpactAssetUrl||t.community[0].share.imageUrl,this.shareImageUrl)){const i=await d(this.shareImageUrl);this.file=i,this.dataUrl=URL.createObjectURL(i)}}catch(t){this.debug&&console.error("Error updating impact data:",t)}}async firstUpdated(){await this.updateImpactData(),this.isMobile=/Mobi|Android/i.test(navigator.userAgent)||"ontouchstart"in window||navigator.maxTouchPoints>0}async openSystemShareSheet(t){if(t)try{const i=await d(t);navigator.share&&this.brandName&&await navigator.share({files:[i],title:r[this.lang].impactShareTitle(),text:r[this.lang].impactShareText({brandName:this.brandName})})}catch(i){this.debug&&console.error("Failed to open share sheet",i)}}async handleClickCopy(){if(this.file)try{this.apiKey&&this.transactionId?p({baseUrl:this.baseUrl,apiKey:this.apiKey||"",requestBody:{eventName:"ExtensibilityCopyImageButtonClick",nonprofitId:this.nonprofitId,storeId:this.storeId,timestamp:Date.now(),transactionId:Number(this.transactionId)}}).catch(()=>null):console.error("Missing data for social share analytics. Skipping send"),await navigator.clipboard.write([new ClipboardItem({"image/png":this.file})])}catch(t){this.debug&&console.error("Failed to copy image to clipboard:",t)}}handleClickDownload(t){this.apiKey&&this.transactionId?p({baseUrl:this.baseUrl,apiKey:this.apiKey||"",requestBody:{eventName:"ExtensibilityDownloadImageButtonClick",nonprofitId:this.nonprofitId,storeId:this.storeId,timestamp:Date.now(),transactionId:Number(this.transactionId)}}).catch(()=>null):console.error("Missing data for social share analytics. Skipping send");const i=t.currentTarget;this.isMobile&&this.shareImageUrl?(t.preventDefault(),this.openSystemShareSheet(this.shareImageUrl)):this.dataUrl&&(i.href=this.dataUrl,i.download=r[this.lang].impactShareTitle())}render(){return!this.brandName||!this.shareImageUrl||!this.dataUrl?S():f`
1
+ import{f as m,g as o,t as n,h as g,y as f}from"../chunks/lit-WqMxC_PA.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"../chunks/_share-dialog-dependencies-Cirjl8zP.esm.js";import"../chunks/progress-bar-DF7UuuHb.esm.js";import"./beam-partner-logos.esm.js";import{c as b,d as y,e as u}from"../chunks/enforce-config-CZ3ToOgr.esm.js";import{D as w,S as x,g as I,W as U}from"../chunks/routes-BnPd0lrO.esm.js";import{_ as S}from"../chunks/loading-template-DG4lkIIc.esm.js";import{u as d,s as r,p}from"../chunks/share-button-CWFcBlaF.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";import"../utils/logger.esm.js";var k=Object.defineProperty,a=(l,t,i,v)=>{for(var s=void 0,c=l.length-1,h;c>=0;c--)(h=l[c])&&(s=h(t,i,s)||s);return s&&k(t,i,s),s};class e extends g{constructor(){super(...arguments),this.baseUrl=w,this.lang="en",this.debug=!1,this.brandName=null,this.shareImageUrl=null,this.isMobile=!1,this.windowResized=!1,this.checkViewport=()=>{this.windowResized=window.innerWidth<=768}}get configLang(){return x[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.checkViewport),this.checkViewport()}disconnectedCallback(){window.removeEventListener("resize",this.checkViewport),super.disconnectedCallback()}async fetchImpactData(){u(["apiKey","storeId","nonprofitId"],this);try{return await I({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{storeId:this.storeId,personalImpactLimit:0,nonprofitId:this.nonprofitId,widgetName:U.community_impact,version:"1.0.0",lang:this.configLang,transactionId:this.transactionId??void 0}})}catch(t){throw this.debug&&console.error("Failed to fetch impact data",t),t}}async updateImpactData(){try{const t=await this.fetchImpactData();if(t&&(this.brandName=t.chain.name,this.shareImageUrl=t.promoAssetUrl||t.personalImpactAssetUrl||t.community[0].share.imageUrl,this.shareImageUrl)){const i=await d(this.shareImageUrl);this.file=i,this.dataUrl=URL.createObjectURL(i)}}catch(t){this.debug&&console.error("Error updating impact data:",t)}}async firstUpdated(){await this.updateImpactData(),this.isMobile=/Mobi|Android/i.test(navigator.userAgent)||"ontouchstart"in window||navigator.maxTouchPoints>0}async openSystemShareSheet(t){if(t)try{const i=await d(t);navigator.share&&this.brandName&&await navigator.share({files:[i],title:r[this.lang].impactShareTitle(),text:r[this.lang].impactShareText({brandName:this.brandName})})}catch(i){this.debug&&console.error("Failed to open share sheet",i)}}async handleClickCopy(){if(this.file)try{this.apiKey&&this.transactionId?p({baseUrl:this.baseUrl,apiKey:this.apiKey||"",requestBody:{eventName:"ExtensibilityCopyImageButtonClick",nonprofitId:this.nonprofitId,storeId:this.storeId,timestamp:Date.now(),transactionId:Number(this.transactionId)}}).catch(()=>null):console.error("Missing data for social share analytics. Skipping send"),await navigator.clipboard.write([new ClipboardItem({"image/png":this.file})])}catch(t){this.debug&&console.error("Failed to copy image to clipboard:",t)}}handleClickDownload(t){this.apiKey&&this.transactionId?p({baseUrl:this.baseUrl,apiKey:this.apiKey||"",requestBody:{eventName:"ExtensibilityDownloadImageButtonClick",nonprofitId:this.nonprofitId,storeId:this.storeId,timestamp:Date.now(),transactionId:Number(this.transactionId)}}).catch(()=>null):console.error("Missing data for social share analytics. Skipping send");const i=t.currentTarget;this.isMobile&&this.shareImageUrl?(t.preventDefault(),this.openSystemShareSheet(this.shareImageUrl)):this.dataUrl&&(i.href=this.dataUrl,i.download=r[this.lang].impactShareTitle())}render(){return!this.brandName||!this.shareImageUrl||!this.dataUrl?S():f`
2
2
  <div class="share-container ${this.windowResized||this.isMobile?"mobile":"desktop"}">
3
3
  <h2 class="share-title">${r[this.lang].impactShareTitle()}</h2>
4
4
  <p class="share-text">${r[this.lang].impactShareText({brandName:this.brandName})}</p>
@@ -1,4 +1,4 @@
1
- import{f as m,g as o,t as n,h as g,y as f}from"../chunks/lit-WqMxC_PA.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"../chunks/_share-dialog-dependencies-DSYemenF.esm.js";import"../chunks/progress-bar-DF7UuuHb.esm.js";import"./beam-partner-logos.js";import{c as b,d as y,e as u}from"../chunks/enforce-config-Ba1JkOHs.esm.js";import{D as w,S as x,g as I,W as U}from"../chunks/routes-D-AQPRne.esm.js";import{_ as S}from"../chunks/loading-template-DG4lkIIc.esm.js";import{u as d,s as r,p}from"../chunks/share-button-Bj6RA_H6.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";import"../utils/logger.js";var k=Object.defineProperty,a=(l,t,i,v)=>{for(var s=void 0,c=l.length-1,h;c>=0;c--)(h=l[c])&&(s=h(t,i,s)||s);return s&&k(t,i,s),s};class e extends g{constructor(){super(...arguments),this.baseUrl=w,this.lang="en",this.debug=!1,this.brandName=null,this.shareImageUrl=null,this.isMobile=!1,this.windowResized=!1,this.checkViewport=()=>{this.windowResized=window.innerWidth<=768}}get configLang(){return x[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.checkViewport),this.checkViewport()}disconnectedCallback(){window.removeEventListener("resize",this.checkViewport),super.disconnectedCallback()}async fetchImpactData(){u(["apiKey","storeId","nonprofitId"],this);try{return await I({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{storeId:this.storeId,personalImpactLimit:0,nonprofitId:this.nonprofitId,widgetName:U.community_impact,version:"1.0.0",lang:this.configLang,transactionId:this.transactionId??void 0}})}catch(t){throw this.debug&&console.error("Failed to fetch impact data",t),t}}async updateImpactData(){try{const t=await this.fetchImpactData();if(t&&(this.brandName=t.chain.name,this.shareImageUrl=t.promoAssetUrl||t.personalImpactAssetUrl||t.community[0].share.imageUrl,this.shareImageUrl)){const i=await d(this.shareImageUrl);this.file=i,this.dataUrl=URL.createObjectURL(i)}}catch(t){this.debug&&console.error("Error updating impact data:",t)}}async firstUpdated(){await this.updateImpactData(),this.isMobile=/Mobi|Android/i.test(navigator.userAgent)||"ontouchstart"in window||navigator.maxTouchPoints>0}async openSystemShareSheet(t){if(t)try{const i=await d(t);navigator.share&&this.brandName&&await navigator.share({files:[i],title:r[this.lang].impactShareTitle(),text:r[this.lang].impactShareText({brandName:this.brandName})})}catch(i){this.debug&&console.error("Failed to open share sheet",i)}}async handleClickCopy(){if(this.file)try{this.apiKey&&this.transactionId?p({baseUrl:this.baseUrl,apiKey:this.apiKey||"",requestBody:{eventName:"ExtensibilityCopyImageButtonClick",nonprofitId:this.nonprofitId,storeId:this.storeId,timestamp:Date.now(),transactionId:Number(this.transactionId)}}).catch(()=>null):console.error("Missing data for social share analytics. Skipping send"),await navigator.clipboard.write([new ClipboardItem({"image/png":this.file})])}catch(t){this.debug&&console.error("Failed to copy image to clipboard:",t)}}handleClickDownload(t){this.apiKey&&this.transactionId?p({baseUrl:this.baseUrl,apiKey:this.apiKey||"",requestBody:{eventName:"ExtensibilityDownloadImageButtonClick",nonprofitId:this.nonprofitId,storeId:this.storeId,timestamp:Date.now(),transactionId:Number(this.transactionId)}}).catch(()=>null):console.error("Missing data for social share analytics. Skipping send");const i=t.currentTarget;this.isMobile&&this.shareImageUrl?(t.preventDefault(),this.openSystemShareSheet(this.shareImageUrl)):this.dataUrl&&(i.href=this.dataUrl,i.download=r[this.lang].impactShareTitle())}render(){return!this.brandName||!this.shareImageUrl||!this.dataUrl?S():f`
1
+ import{f as m,g as o,t as n,h as g,y as f}from"../chunks/lit-WqMxC_PA.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"../chunks/_share-dialog-dependencies-DElW9Yip.esm.js";import"../chunks/progress-bar-DF7UuuHb.esm.js";import"./beam-partner-logos.js";import{c as b,d as y,e as u}from"../chunks/enforce-config-Ba1JkOHs.esm.js";import{D as w,S as x,g as I,W as U}from"../chunks/routes-D7s2_Xn5.esm.js";import{_ as S}from"../chunks/loading-template-DG4lkIIc.esm.js";import{u as d,s as r,p}from"../chunks/share-button-8zVx6bYw.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";import"../utils/logger.js";var k=Object.defineProperty,a=(l,t,i,v)=>{for(var s=void 0,c=l.length-1,h;c>=0;c--)(h=l[c])&&(s=h(t,i,s)||s);return s&&k(t,i,s),s};class e extends g{constructor(){super(...arguments),this.baseUrl=w,this.lang="en",this.debug=!1,this.brandName=null,this.shareImageUrl=null,this.isMobile=!1,this.windowResized=!1,this.checkViewport=()=>{this.windowResized=window.innerWidth<=768}}get configLang(){return x[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.checkViewport),this.checkViewport()}disconnectedCallback(){window.removeEventListener("resize",this.checkViewport),super.disconnectedCallback()}async fetchImpactData(){u(["apiKey","storeId","nonprofitId"],this);try{return await I({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{storeId:this.storeId,personalImpactLimit:0,nonprofitId:this.nonprofitId,widgetName:U.community_impact,version:"1.0.0",lang:this.configLang,transactionId:this.transactionId??void 0}})}catch(t){throw this.debug&&console.error("Failed to fetch impact data",t),t}}async updateImpactData(){try{const t=await this.fetchImpactData();if(t&&(this.brandName=t.chain.name,this.shareImageUrl=t.promoAssetUrl||t.personalImpactAssetUrl||t.community[0].share.imageUrl,this.shareImageUrl)){const i=await d(this.shareImageUrl);this.file=i,this.dataUrl=URL.createObjectURL(i)}}catch(t){this.debug&&console.error("Error updating impact data:",t)}}async firstUpdated(){await this.updateImpactData(),this.isMobile=/Mobi|Android/i.test(navigator.userAgent)||"ontouchstart"in window||navigator.maxTouchPoints>0}async openSystemShareSheet(t){if(t)try{const i=await d(t);navigator.share&&this.brandName&&await navigator.share({files:[i],title:r[this.lang].impactShareTitle(),text:r[this.lang].impactShareText({brandName:this.brandName})})}catch(i){this.debug&&console.error("Failed to open share sheet",i)}}async handleClickCopy(){if(this.file)try{this.apiKey&&this.transactionId?p({baseUrl:this.baseUrl,apiKey:this.apiKey||"",requestBody:{eventName:"ExtensibilityCopyImageButtonClick",nonprofitId:this.nonprofitId,storeId:this.storeId,timestamp:Date.now(),transactionId:Number(this.transactionId)}}).catch(()=>null):console.error("Missing data for social share analytics. Skipping send"),await navigator.clipboard.write([new ClipboardItem({"image/png":this.file})])}catch(t){this.debug&&console.error("Failed to copy image to clipboard:",t)}}handleClickDownload(t){this.apiKey&&this.transactionId?p({baseUrl:this.baseUrl,apiKey:this.apiKey||"",requestBody:{eventName:"ExtensibilityDownloadImageButtonClick",nonprofitId:this.nonprofitId,storeId:this.storeId,timestamp:Date.now(),transactionId:Number(this.transactionId)}}).catch(()=>null):console.error("Missing data for social share analytics. Skipping send");const i=t.currentTarget;this.isMobile&&this.shareImageUrl?(t.preventDefault(),this.openSystemShareSheet(this.shareImageUrl)):this.dataUrl&&(i.href=this.dataUrl,i.download=r[this.lang].impactShareTitle())}render(){return!this.brandName||!this.shareImageUrl||!this.dataUrl?S():f`
2
2
  <div class="share-container ${this.windowResized||this.isMobile?"mobile":"desktop"}">
3
3
  <h2 class="share-title">${r[this.lang].impactShareTitle()}</h2>
4
4
  <p class="share-text">${r[this.lang].impactShareText({brandName:this.brandName})}</p>
@@ -157,6 +157,9 @@ declare class BeamSubscriptionImpact extends LitElement {
157
157
  } | null;
158
158
  promoAssetUrl: string | null;
159
159
  personalImpactAssetUrl: string | null;
160
+ settings?: {
161
+ excludeDonationsForRecurringTransactions: boolean;
162
+ } | undefined;
160
163
  }>;
161
164
  private impactDataController;
162
165
  impactTitleRefs: HTMLElement[];
@@ -1,4 +1,4 @@
1
- import{h as $,f as w,y as p,g as l,t as _,p as C}from"../chunks/lit-WqMxC_PA.esm.js";import{d as S,b as H}from"../chunks/lodash-D3TLHRR_.esm.js";import{p as j}from"../chunks/progress-bar-DF7UuuHb.esm.js";import{s as A,a as K}from"../chunks/share-button-XJxSyBaT.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import{D as q,g as J,S as Q}from"../chunks/routes-Lvj2SXN4.esm.js";import{u as b,A as X,d as g,a as Z,_ as ee,i as r}from"../chunks/localize-Btu9xYcE.esm.js";import{c as ie,d as te,e as ae}from"../chunks/enforce-config-CZ3ToOgr.esm.js";import{_ as re}from"../chunks/loading-template-DG4lkIIc.esm.js";import{makeApiKeyHeader as ne}from"../utils/makeApiKeyHeader.esm.js";import{c as oe}from"../chunks/responsive-BR8qUfBa.esm.js";import{logger as se}from"../utils/logger.esm.js";import{c as ce}from"../chunks/css-card-grid-CvoGpsJH.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-DUn-zC5t.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";var pe=Object.defineProperty,le=(i,e,n,m)=>{for(var a=void 0,t=i.length-1,d;t>=0;t--)(d=i[t])&&(a=d(e,n,a)||a);return a&&pe(e,n,a),a};class P extends ${constructor(){super(...arguments),this.infoText=""}static get styles(){return w`
1
+ import{h as $,f as w,y as p,g as l,t as _,p as C}from"../chunks/lit-WqMxC_PA.esm.js";import{d as S,b as H}from"../chunks/lodash-D3TLHRR_.esm.js";import{p as j}from"../chunks/progress-bar-DF7UuuHb.esm.js";import{s as A,a as K}from"../chunks/share-button-DNyMCeHQ.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import{D as q,g as J,S as Q}from"../chunks/routes-BnPd0lrO.esm.js";import{u as b,A as X,d as g,a as Z,_ as ee,i as r}from"../chunks/localize-Btu9xYcE.esm.js";import{c as ie,d as te,e as ae}from"../chunks/enforce-config-CZ3ToOgr.esm.js";import{_ as re}from"../chunks/loading-template-DG4lkIIc.esm.js";import{makeApiKeyHeader as ne}from"../utils/makeApiKeyHeader.esm.js";import{c as oe}from"../chunks/responsive-BR8qUfBa.esm.js";import{logger as se}from"../utils/logger.esm.js";import{c as ce}from"../chunks/css-card-grid-CvoGpsJH.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-CWFcBlaF.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";var pe=Object.defineProperty,le=(i,e,n,m)=>{for(var a=void 0,t=i.length-1,d;t>=0;t--)(d=i[t])&&(a=d(e,n,a)||a);return a&&pe(e,n,a),a};class P extends ${constructor(){super(...arguments),this.infoText=""}static get styles(){return w`
2
2
  sl-badge::part(base) {
3
3
  background-color: var(--beam-pillLabel-color-background, #000);
4
4
  color: var(--beam-pillLabel-color, #fff);
@@ -1,4 +1,4 @@
1
- import{h as $,f as w,y as p,g as l,t as _,p as C}from"../chunks/lit-WqMxC_PA.esm.js";import{d as S,b as H}from"../chunks/lodash-D3TLHRR_.esm.js";import{p as j}from"../chunks/progress-bar-DF7UuuHb.esm.js";import{s as A,a as K}from"../chunks/share-button-DNgyupow.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import{D as q,g as J,S as Q}from"../chunks/routes-D-AQPRne.esm.js";import{u as b,A as X,d as g,a as Z,_ as ee,i as r}from"../chunks/localize-C25pEGnx.esm.js";import{c as ie,d as te,e as ae}from"../chunks/enforce-config-Ba1JkOHs.esm.js";import{_ as re}from"../chunks/loading-template-DG4lkIIc.esm.js";import{makeApiKeyHeader as ne}from"../utils/makeApiKeyHeader.js";import{c as oe}from"../chunks/responsive-BR8qUfBa.esm.js";import{logger as se}from"../utils/logger.js";import{c as ce}from"../chunks/css-card-grid-CvoGpsJH.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-Bj6RA_H6.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";var pe=Object.defineProperty,le=(i,e,n,m)=>{for(var a=void 0,t=i.length-1,d;t>=0;t--)(d=i[t])&&(a=d(e,n,a)||a);return a&&pe(e,n,a),a};class P extends ${constructor(){super(...arguments),this.infoText=""}static get styles(){return w`
1
+ import{h as $,f as w,y as p,g as l,t as _,p as C}from"../chunks/lit-WqMxC_PA.esm.js";import{d as S,b as H}from"../chunks/lodash-D3TLHRR_.esm.js";import{p as j}from"../chunks/progress-bar-DF7UuuHb.esm.js";import{s as A,a as K}from"../chunks/share-button-CM4kwufS.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import{D as q,g as J,S as Q}from"../chunks/routes-D7s2_Xn5.esm.js";import{u as b,A as X,d as g,a as Z,_ as ee,i as r}from"../chunks/localize-C25pEGnx.esm.js";import{c as ie,d as te,e as ae}from"../chunks/enforce-config-Ba1JkOHs.esm.js";import{_ as re}from"../chunks/loading-template-DG4lkIIc.esm.js";import{makeApiKeyHeader as ne}from"../utils/makeApiKeyHeader.js";import{c as oe}from"../chunks/responsive-BR8qUfBa.esm.js";import{logger as se}from"../utils/logger.js";import{c as ce}from"../chunks/css-card-grid-CvoGpsJH.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-8zVx6bYw.esm.js";import"../chunks/beam-errors-Ci0d3926.esm.js";var pe=Object.defineProperty,le=(i,e,n,m)=>{for(var a=void 0,t=i.length-1,d;t>=0;t--)(d=i[t])&&(a=d(e,n,a)||a);return a&&pe(e,n,a),a};class P extends ${constructor(){super(...arguments),this.infoText=""}static get styles(){return w`
2
2
  sl-badge::part(base) {
3
3
  background-color: var(--beam-pillLabel-color-background, #000);
4
4
  color: var(--beam-pillLabel-color, #fff);
@@ -1,15 +1,15 @@
1
1
  import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement } from 'lit';
4
- import { g as getImpact, a as getChainNonprofits } from '../chunks/routes-DDRd747e.esm.js';
5
- import { T as TCart } from '../chunks/cart-contents-CUgc4y1N.esm.js';
4
+ import { g as getImpact, a as getChainNonprofits } from '../chunks/routes-BwRUVGsk.esm.js';
5
+ import { T as TCart } from '../chunks/cart-contents-oArgpFbi.esm.js';
6
6
  import './select-subscription-nonprofit.js';
7
7
  import './subscription-impact.js';
8
8
  import './beam-partner-logos.js';
9
9
  import '../chunks/progress-bar-CveZ8E6Q.esm.js';
10
10
  import { L as LANGUAGES } from '../chunks/types-C7gqAyyH.esm.js';
11
11
  import { T as TNumericId } from '../chunks/types-CPxMwnoR.esm.js';
12
- import '../chunks/openapi-spec-VAt3phhg.esm.js';
12
+ import '../chunks/openapi-spec-x9NbL7bU.esm.js';
13
13
  import 'lodash';
14
14
  import '../chunks/share-button-B9hpxBVr.esm.js';
15
15
 
@@ -162,13 +162,23 @@ declare class BeamSubscriptionManagement extends LitElement {
162
162
  apply: boolean;
163
163
  }[];
164
164
  } | undefined;
165
+ extensibility?: {
166
+ excludeB2BOrders?: boolean | undefined;
167
+ } | undefined;
168
+ settings?: {
169
+ excludeDonationsForRecurringTransactions: boolean;
170
+ } | undefined;
165
171
  }>;
166
172
  fetchSubscription(): Promise<{
167
173
  beamUserId: string;
168
174
  remoteSubscriptionId: string;
169
175
  internalSubscriptionId: string;
176
+ settings?: {
177
+ excludeDonationsForRecurringTransactions: boolean;
178
+ } | undefined;
170
179
  nonprofit: {
171
180
  id: number;
181
+ name?: string | undefined;
172
182
  } | null;
173
183
  }>;
174
184
  fetchImpact(): Promise<{
@@ -293,6 +303,9 @@ declare class BeamSubscriptionManagement extends LitElement {
293
303
  } | null;
294
304
  promoAssetUrl: string | null;
295
305
  personalImpactAssetUrl: string | null;
306
+ settings?: {
307
+ excludeDonationsForRecurringTransactions: boolean;
308
+ } | undefined;
296
309
  }>;
297
310
  getDisplayablePreviousImpacts(): {
298
311
  imageUrl: string | null;
@@ -1,19 +1,19 @@
1
- import{f as z,g as r,t as d,h as H,y as n,k as E}from"../chunks/lit-WqMxC_PA.esm.js";import{D as R,S as _,e as j,W as B,f as K,g as F}from"../chunks/routes-Lvj2SXN4.esm.js";import{p as O}from"../chunks/progress-bar-DF7UuuHb.esm.js";import{c as V,d as Y,e as S}from"../chunks/enforce-config-CZ3ToOgr.esm.js";import{u as l,A as y,d as c,a as G,i as p,_ as v}from"../chunks/localize-Btu9xYcE.esm.js";import{c as N}from"../chunks/events-BohmT6Lp.esm.js";import{M as q}from"../chunks/beam-errors-Ci0d3926.esm.js";import"./select-subscription-nonprofit.esm.js";import"./subscription-impact.esm.js";import{partnerLogosConfigDefaults as J}from"./beam-partner-logos.esm.js";import{makeApiKeyHeader as x}from"../utils/makeApiKeyHeader.esm.js";import{_ as $}from"../chunks/loading-template-DG4lkIIc.esm.js";import{c as Q}from"../chunks/css-card-grid-CvoGpsJH.esm.js";import"../utils/logger.esm.js";import"../chunks/lodash-D3TLHRR_.esm.js";import"../utils/local-storage.esm.js";import"../chunks/share-button-XJxSyBaT.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-DUn-zC5t.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"../chunks/responsive-BR8qUfBa.esm.js";const g={en:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},fr:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},de:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},es:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},it:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},pl:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"}};var X=Object.defineProperty,i=(M,t,o,s)=>{for(var a=void 0,b=M.length-1,m;b>=0;b--)(m=M[b])&&(a=m(t,o,a)||a);return a&&X(t,o,a),a};const D=3,Z=0,tt=1,et=98;class e extends H{constructor(){super(...arguments),this.baseUrl=R,this.lang="en",this.debug=!1,this.draftConfig=!1,this.activeWidget=null,this.nonprofitId=null,this.beamUserId=null,this.eligibleNonprofits=[],this.showAllTiles=!1,this.isMobile=window.innerWidth<720,this.dropdownVisible=!1,this.emojis=["\u{1F44F}","\u{1F4AA}","\u{1F64C}","\u2728","\u{1F947}"],this.subscriptionDataController=new y(this,this.fetchSubscription),this.eligibleNonprofitsDataController=new y(this,this.fetchEligibleNonprofits),this.personalImpactDataController=new y(this,this.fetchImpact)}get configLang(){return _[this.lang]||"en"}async firstUpdated(){if(!this.email&&!this.partnerUserId)throw new q(["email","partnerUserId"],"One of the following properties needs to be specified: email, partnerUserId ");S(["apiKey","subscriptionId"],this),await this.loadWidget()}async loadWidget(){await Promise.all([this.fetchEligibleNonprofits(),this.fetchSubscription()]),await this.fetchImpact(),this.activeWidget=this.nonprofitId?"subscription-impact":"select-subscription-nonprofit"}async fetchEligibleNonprofits(){S(["apiKey","subscriptionId"],this);const t=await j({baseUrl:this.baseUrl,headers:x(this.apiKey),requestBody:{storeId:this.storeId||void 0,postalCode:this.postalCode||void 0,countryCode:this.countryCode||void 0,widgetName:B.subscription_management,version:"1.0.0"}});return this.storeId=t.store.id,this.eligibleNonprofits=t.nonprofits,this.eligibleNonprofitsDataController.data=t,t}async fetchSubscription(){S(["apiKey","subscriptionId"],this);const t=await K({baseUrl:this.baseUrl,headers:x(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,email:this.email,partnerUserId:this.partnerUserId}});return this.beamUserId=t.beamUserId,this.nonprofitId=t.nonprofit?.id||null,t}async fetchImpact(){S(["apiKey"],this);const t=await F({baseUrl:this.baseUrl,headers:x(this.apiKey),queryParams:{beamUserId:this.beamUserId?this.beamUserId:void 0,widgetName:"subscription-management",version:"1.0.0",lang:this.configLang}});return this.personalImpactDataController.data=t,t}getDisplayablePreviousImpacts(){const t=this.personalImpactDataController.data?.personal;return!t||t?.length<1?[]:t.filter(o=>!(!o.nonprofit.includeInPersonalImpact||o.nonprofit.id===this.nonprofitId&&(!o.impact.goalCompletionText||o.impact.goalCompletionText?.length<1)))}handleSwapNonprofitButtonClick(){this.activeWidget="select-subscription-nonprofit"}handleBackToSubscriptionImpactButtonClick(){this.activeWidget="subscription-impact"}handleSupportAgainButtonClick(t,o){this.activeWidget="select-subscription-nonprofit",this.selectedNonprofitId=t;const s=new N({selectedNonprofitId:t,nonprofitName:o,source:B.subscription_management});this.dispatchEvent(s)}handleNonprofitSelect(t){if(!(t instanceof N))return;const{selectedNonprofitId:o}=t.detail;this.nonprofitId=o??null,this.activeWidget="subscription-impact"}isNonprofitEligible(t){return this.eligibleNonprofits.some(o=>o.nonprofit.id===t)}shouldDisplayProgressBar(t){return t>tt&&t<et}get cssVariables(){const t={...J,...O,"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit","--beam-SubscriptionManagement-widgetContainer-borderColor":"#d5d5d5","--beam-SubscriptionManagement-widgetContainer-borderRadius":"4px","--beam-SubscriptionManagement-widgetContainer-padding":"8px 20px","--beam-SubscriptionManagement-widgetContainer-backgroundColor":"inherit","--beam-SubscriptionManagement-widgetContainer-maxWidth":"820px","--beam-SubscriptionManagement-logo-align-desktop":"left","--beam-SubscriptionManagement-logo-align-mobile":"center","--beam-SubscriptionManagement-previousImpact-cardStyle":"'selected_icon'","--beam-SubscriptionManagement-header-padding":"10px 20px 10px 0px","--beam-SubscriptionManagement-header-borderRadius":"0px","--beam-SubscriptionManagement-header-backgroundColor":"#fff","--beam-SubscriptionManagement-header-meatballsMenu-fontSize":"24px","--beam-SubscriptionManagement-header-meatballsMenu-color":"24px","--beam-SubscriptionManagement-lineBreak-color":"#ddd","--beam-SubscriptionManagement-lineBreak-width":"1px","--beam-SubscriptionManagement-lineBreak-margin":"10px 0 20px 0","--beam-SubscriptionManagement-tile-marginBottom":"20px","--beam-SubscriptionManagement-tile-border-width":"0px","--beam-SubscriptionManagement-tile-border-color":"#ddd","--beam-SubscriptionManagement-tile-padding":"12.5px","--beam-SubscriptionManagement-tile-borderRadius":"8px","--beam-SubscriptionManagement-tile-background":"#f8fbfb","--beam-SubscriptionManagement-tileContent-gap":" 15px","--beam-SubscriptionManagement-tileContent-padding":"5px 0px","--beam-SubscriptionManagement-tile-icon-borderRadius":"4px","--beam-SubscriptionManagement-tile-icon-height":"28px","--beam-SubscriptionManagement-tile-icon-background-borderRadius":"50%","--beam-SubscriptionManagement-tile-icon-background-width":"50px","--beam-SubscriptionManagement-tile-icon-background-height":"50px","--beam-SubscriptionManagement-tile-icon-background-backgroundColor":"#0a323c","--beam-SubscriptionManagement-tile-icon-background-padding":"10px","--beam-SubscriptionManagement-blockTileDescription-gap":"5px","--beam-SubscriptionManagement-blockTileDescription-padding":"0px","--beam-SubscriptionManagement-blockTileDescription-lineHeight":"130%","--beam-SubscriptionManagement-blockTileDescription-progressBar-width-desktop":"60%","--beam-SubscriptionManagement-blockTileDescription-progressBar-width-mobile":"100%","--beam-SubscriptionManagement-subWidgetContainer-padding":"0px 0px 10px","--beam-SubscriptionManagement-previousImpactContainer-padding-desktop":"10px 24px 10px 0px","--beam-SubscriptionManagement-previousImpactContainer-padding-mobile":"0px","--beam-SubscriptionManagement-dropDown-padding":"15px 8px","--beam-SubscriptionManagement-dropDown-borderRadius":"8px","--beam-SubscriptionManagement-dropDown-backgroundColor":"#f8fbfb","--beam-SubscriptionManagement-dropDown-boxShadow":"0px 4px 28px 0px rgba(0, 0, 0, 0.04)","--beam-SubscriptionManagement-dropDown-width":"128px","--beam-SubscriptionManagement-dropDown-hover-backgroundColor":"#E1F1EE","--beam-SubscriptionManagement-dropDownOptions-textDecoration":"underline",...c("--beam-SubscriptionManagement-dropDownOptions",{fontSize:"12px",fontWeight:"400",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-yourPreviousImpactTitle-marginBottom":"15px",...c("--beam-SubscriptionManagement-yourPreviousImpactTitle",{fontSize:"18px",fontWeight:"bold",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-yourPreviousImpact-showAllButton-textDecoration":"underline",...c("--beam-SubscriptionManagement-yourPreviousImpact-showAllButton",{fontSize:"12px",fontWeight:"bold",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-tile-title-letterSpacing":"0.36px",...c("--beam-SubscriptionManagement-tile-title",{fontSize:"12px",fontWeight:"bold",lineHeight:"120%",textTransform:"uppercase",fontStyle:"normal",color:"#0a323c"}),...c("--beam-SubscriptionManagement-tile-description",{fontSize:"14px",lineHeight:"120%",fontStyle:"normal",color:"#454a47"}),...c("--beam-SubscriptionManagement-tile-via",{fontSize:"14px",lineHeight:"120%",fontStyle:"normal",color:"#454a47"}),"--beam-SubscriptionManagement-tile-nonprofitLink-textDecoration":"underline",...c("--beam-SubscriptionManagement-tile-nonprofitLink",{fontSize:"14px",fontWeight:"400",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-tile-supportAgainButton-textDecoration":"underline",...c("--beam-SubscriptionManagement-tile-supportAgainButton",{fontSize:"14px",fontWeight:"400",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-tile-progressBarLabel-marginLeft":"8px",...c("--beam-SubscriptionManagement-tile-progressBarLabel",{fontSize:"10px",fontWeight:"bold",fontStyle:"normal",color:"#878a92"}),"--beam-SubscriptionManagement-tile-fundedAmount-lineHeight":"16px",...c("--beam-SubscriptionManagement-tile-fundedAmount",{fontSize:"14px",fontWeight:"400",lineHeight:"120%",fontStyle:"italic",color:"#0a323c"})},o=this.eligibleNonprofitsDataController?.data?.config?.web?.theme||{},s={...t,...o};return Object.assign(Object.create({toCSS(){return G(this)}}),s)}renderPreviousImpactTiles({personalImpact:t,cardStyle:o,eligibleNonprofitConfig:s}){if(!t)return n``;if(!s)return n``;const a=this.showAllTiles?t:t.slice(0,D);let b=0;return n`
2
- ${a.map(m=>{const{impact:{goalCompletionText:u,description:h,goalProgressPercentage:f,goalProgressText:A},nonprofit:{cause:C,causeIconSelectedUrl:L,causeIconUrl:T,website:P,name:I,id:w}}=m,k=this.nonprofitId!==w&&this.isNonprofitEligible(w),U=k&&this.shouldDisplayProgressBar(f),W=u?`${this.emojis[b]} `:"";return b=(b+1)%this.emojis.length,n`
1
+ import{f as z,g as r,t as d,h as H,y as o,k as E}from"../chunks/lit-WqMxC_PA.esm.js";import{D as R,S as _,d as j,W as B,e as K,g as F}from"../chunks/routes-BnPd0lrO.esm.js";import{p as O}from"../chunks/progress-bar-DF7UuuHb.esm.js";import{c as V,d as Y,e as S}from"../chunks/enforce-config-CZ3ToOgr.esm.js";import{u as l,A as y,d as c,a as G,i as p,_ as v}from"../chunks/localize-Btu9xYcE.esm.js";import{c as N}from"../chunks/events-BohmT6Lp.esm.js";import{M as q}from"../chunks/beam-errors-Ci0d3926.esm.js";import"./select-subscription-nonprofit.esm.js";import"./subscription-impact.esm.js";import{partnerLogosConfigDefaults as J}from"./beam-partner-logos.esm.js";import{makeApiKeyHeader as x}from"../utils/makeApiKeyHeader.esm.js";import{_ as D}from"../chunks/loading-template-DG4lkIIc.esm.js";import{c as Q}from"../chunks/css-card-grid-CvoGpsJH.esm.js";import"../utils/logger.esm.js";import"../chunks/lodash-D3TLHRR_.esm.js";import"../utils/local-storage.esm.js";import"../chunks/share-button-DNyMCeHQ.esm.js";import"../chunks/is-all-html-elements-fcB7UUA1.esm.js";import"../chunks/share-button-CWFcBlaF.esm.js";import"../chunks/vendor-KKSARHWL.esm.js";import"../chunks/responsive-BR8qUfBa.esm.js";const g={en:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},fr:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},de:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},es:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},it:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"},pl:{changeNonprofitButton:()=>"Change Nonprofit",previousImpactHeader:()=>"Your Previous Impact",previousNonprofitButton:()=>"Back to Previous Nonprofit",supportAgainButton:()=>"Support Again",via:()=>"via",showAllButton:()=>"Show All",showLessButton:()=>"Show Less"}};var X=Object.defineProperty,i=(M,t,n,s)=>{for(var a=void 0,b=M.length-1,m;b>=0;b--)(m=M[b])&&(a=m(t,n,a)||a);return a&&X(t,n,a),a};const $=3,Z=0,tt=1,et=98;class e extends H{constructor(){super(...arguments),this.baseUrl=R,this.lang="en",this.debug=!1,this.draftConfig=!1,this.activeWidget=null,this.nonprofitId=null,this.beamUserId=null,this.eligibleNonprofits=[],this.showAllTiles=!1,this.isMobile=window.innerWidth<720,this.dropdownVisible=!1,this.emojis=["\u{1F44F}","\u{1F4AA}","\u{1F64C}","\u2728","\u{1F947}"],this.subscriptionDataController=new y(this,this.fetchSubscription),this.eligibleNonprofitsDataController=new y(this,this.fetchEligibleNonprofits),this.personalImpactDataController=new y(this,this.fetchImpact)}get configLang(){return _[this.lang]||"en"}async firstUpdated(){if(!this.email&&!this.partnerUserId)throw new q(["email","partnerUserId"],"One of the following properties needs to be specified: email, partnerUserId ");S(["apiKey","subscriptionId"],this),await this.loadWidget()}async loadWidget(){await Promise.all([this.fetchEligibleNonprofits(),this.fetchSubscription()]),await this.fetchImpact(),this.activeWidget=this.nonprofitId?"subscription-impact":"select-subscription-nonprofit"}async fetchEligibleNonprofits(){S(["apiKey","subscriptionId"],this);const t=await j({baseUrl:this.baseUrl,headers:x(this.apiKey),requestBody:{storeId:this.storeId||void 0,postalCode:this.postalCode||void 0,countryCode:this.countryCode||void 0,widgetName:B.subscription_management,version:"1.0.0"}});return this.storeId=t.store.id,this.eligibleNonprofits=t.nonprofits,this.eligibleNonprofitsDataController.data=t,t}async fetchSubscription(){S(["apiKey","subscriptionId"],this);const t=await K({baseUrl:this.baseUrl,headers:x(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,email:this.email,partnerUserId:this.partnerUserId}});return this.beamUserId=t.beamUserId,this.nonprofitId=t.nonprofit?.id||null,t}async fetchImpact(){S(["apiKey"],this);const t=await F({baseUrl:this.baseUrl,headers:x(this.apiKey),queryParams:{beamUserId:this.beamUserId?this.beamUserId:void 0,widgetName:"subscription-management",version:"1.0.0",lang:this.configLang}});return this.personalImpactDataController.data=t,t}getDisplayablePreviousImpacts(){const t=this.personalImpactDataController.data?.personal;return!t||t?.length<1?[]:t.filter(n=>!(!n.nonprofit.includeInPersonalImpact||n.nonprofit.id===this.nonprofitId&&(!n.impact.goalCompletionText||n.impact.goalCompletionText?.length<1)))}handleSwapNonprofitButtonClick(){this.activeWidget="select-subscription-nonprofit"}handleBackToSubscriptionImpactButtonClick(){this.activeWidget="subscription-impact"}handleSupportAgainButtonClick(t,n){this.activeWidget="select-subscription-nonprofit",this.selectedNonprofitId=t;const s=new N({selectedNonprofitId:t,nonprofitName:n,source:B.subscription_management});this.dispatchEvent(s)}handleNonprofitSelect(t){if(!(t instanceof N))return;const{selectedNonprofitId:n}=t.detail;this.nonprofitId=n??null,this.activeWidget="subscription-impact"}isNonprofitEligible(t){return this.eligibleNonprofits.some(n=>n.nonprofit.id===t)}shouldDisplayProgressBar(t){return t>tt&&t<et}get cssVariables(){const t={...J,...O,"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit","--beam-SubscriptionManagement-widgetContainer-borderColor":"#d5d5d5","--beam-SubscriptionManagement-widgetContainer-borderRadius":"4px","--beam-SubscriptionManagement-widgetContainer-padding":"8px 20px","--beam-SubscriptionManagement-widgetContainer-backgroundColor":"inherit","--beam-SubscriptionManagement-widgetContainer-maxWidth":"820px","--beam-SubscriptionManagement-logo-align-desktop":"left","--beam-SubscriptionManagement-logo-align-mobile":"center","--beam-SubscriptionManagement-previousImpact-cardStyle":"'selected_icon'","--beam-SubscriptionManagement-header-padding":"10px 20px 10px 0px","--beam-SubscriptionManagement-header-borderRadius":"0px","--beam-SubscriptionManagement-header-backgroundColor":"#fff","--beam-SubscriptionManagement-header-meatballsMenu-fontSize":"24px","--beam-SubscriptionManagement-header-meatballsMenu-color":"24px","--beam-SubscriptionManagement-lineBreak-color":"#ddd","--beam-SubscriptionManagement-lineBreak-width":"1px","--beam-SubscriptionManagement-lineBreak-margin":"10px 0 20px 0","--beam-SubscriptionManagement-tile-marginBottom":"20px","--beam-SubscriptionManagement-tile-border-width":"0px","--beam-SubscriptionManagement-tile-border-color":"#ddd","--beam-SubscriptionManagement-tile-padding":"12.5px","--beam-SubscriptionManagement-tile-borderRadius":"8px","--beam-SubscriptionManagement-tile-background":"#f8fbfb","--beam-SubscriptionManagement-tileContent-gap":" 15px","--beam-SubscriptionManagement-tileContent-padding":"5px 0px","--beam-SubscriptionManagement-tile-icon-borderRadius":"4px","--beam-SubscriptionManagement-tile-icon-height":"28px","--beam-SubscriptionManagement-tile-icon-background-borderRadius":"50%","--beam-SubscriptionManagement-tile-icon-background-width":"50px","--beam-SubscriptionManagement-tile-icon-background-height":"50px","--beam-SubscriptionManagement-tile-icon-background-backgroundColor":"#0a323c","--beam-SubscriptionManagement-tile-icon-background-padding":"10px","--beam-SubscriptionManagement-blockTileDescription-gap":"5px","--beam-SubscriptionManagement-blockTileDescription-padding":"0px","--beam-SubscriptionManagement-blockTileDescription-lineHeight":"130%","--beam-SubscriptionManagement-blockTileDescription-progressBar-width-desktop":"60%","--beam-SubscriptionManagement-blockTileDescription-progressBar-width-mobile":"100%","--beam-SubscriptionManagement-subWidgetContainer-padding":"0px 0px 10px","--beam-SubscriptionManagement-previousImpactContainer-padding-desktop":"10px 24px 10px 0px","--beam-SubscriptionManagement-previousImpactContainer-padding-mobile":"0px","--beam-SubscriptionManagement-dropDown-padding":"15px 8px","--beam-SubscriptionManagement-dropDown-borderRadius":"8px","--beam-SubscriptionManagement-dropDown-backgroundColor":"#f8fbfb","--beam-SubscriptionManagement-dropDown-boxShadow":"0px 4px 28px 0px rgba(0, 0, 0, 0.04)","--beam-SubscriptionManagement-dropDown-width":"128px","--beam-SubscriptionManagement-dropDown-hover-backgroundColor":"#E1F1EE","--beam-SubscriptionManagement-dropDownOptions-textDecoration":"underline",...c("--beam-SubscriptionManagement-dropDownOptions",{fontSize:"12px",fontWeight:"400",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-yourPreviousImpactTitle-marginBottom":"15px",...c("--beam-SubscriptionManagement-yourPreviousImpactTitle",{fontSize:"18px",fontWeight:"bold",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-yourPreviousImpact-showAllButton-textDecoration":"underline",...c("--beam-SubscriptionManagement-yourPreviousImpact-showAllButton",{fontSize:"12px",fontWeight:"bold",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-tile-title-letterSpacing":"0.36px",...c("--beam-SubscriptionManagement-tile-title",{fontSize:"12px",fontWeight:"bold",lineHeight:"120%",textTransform:"uppercase",fontStyle:"normal",color:"#0a323c"}),...c("--beam-SubscriptionManagement-tile-description",{fontSize:"14px",lineHeight:"120%",fontStyle:"normal",color:"#454a47"}),...c("--beam-SubscriptionManagement-tile-via",{fontSize:"14px",lineHeight:"120%",fontStyle:"normal",color:"#454a47"}),"--beam-SubscriptionManagement-tile-nonprofitLink-textDecoration":"underline",...c("--beam-SubscriptionManagement-tile-nonprofitLink",{fontSize:"14px",fontWeight:"400",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-tile-supportAgainButton-textDecoration":"underline",...c("--beam-SubscriptionManagement-tile-supportAgainButton",{fontSize:"14px",fontWeight:"400",lineHeight:"120%",textTransform:"capitalize",fontStyle:"normal",color:"#0a323c"}),"--beam-SubscriptionManagement-tile-progressBarLabel-marginLeft":"8px",...c("--beam-SubscriptionManagement-tile-progressBarLabel",{fontSize:"10px",fontWeight:"bold",fontStyle:"normal",color:"#878a92"}),"--beam-SubscriptionManagement-tile-fundedAmount-lineHeight":"16px",...c("--beam-SubscriptionManagement-tile-fundedAmount",{fontSize:"14px",fontWeight:"400",lineHeight:"120%",fontStyle:"italic",color:"#0a323c"})},n=this.eligibleNonprofitsDataController?.data?.config?.web?.theme||{},s={...t,...n};return Object.assign(Object.create({toCSS(){return G(this)}}),s)}renderPreviousImpactTiles({personalImpact:t,cardStyle:n,eligibleNonprofitConfig:s}){if(!t)return o``;if(!s)return o``;const a=this.showAllTiles?t:t.slice(0,$);let b=0;return o`
2
+ ${a.map(m=>{const{impact:{goalCompletionText:u,description:h,goalProgressPercentage:f,goalProgressText:A},nonprofit:{cause:C,causeIconSelectedUrl:L,causeIconUrl:T,website:P,name:I,id:w}}=m,k=this.nonprofitId!==w&&this.isNonprofitEligible(w),U=k&&this.shouldDisplayProgressBar(f),W=u?`${this.emojis[b]} `:"";return b=(b+1)%this.emojis.length,o`
3
3
  <div class="tile">
4
4
  <div class="tile-header">
5
5
  <div class="tile-title">${p(this.configLang,C||"")}</div>
6
- ${k?n` <button
6
+ ${k?o` <button
7
7
  class="tile-support-again button"
8
8
  @click="${()=>this.handleSupportAgainButtonClick(w,I)}"
9
9
  >
10
10
  ${p(this.configLang,s?.web?.additionalStrings?.supportAgainButton||"")||g[this.configLang].supportAgainButton()}
11
- </button>`:n``}
11
+ </button>`:o``}
12
12
  </div>
13
13
  <div class="tile-content">
14
14
  <div class="icon-background">
15
15
  <img
16
- src="${o==="'selected_icon'"?L:T}"
16
+ src="${n==="'selected_icon'"?L:T}"
17
17
  alt="${C}"
18
18
  class="icon"
19
19
  />
@@ -28,12 +28,12 @@ import{f as z,g as r,t as d,h as H,y as n,k as E}from"../chunks/lit-WqMxC_PA.esm
28
28
  ${p(this.configLang,I||"")}
29
29
  </a>
30
30
  </div>
31
- ${U?n` <div
31
+ ${U?o` <div
32
32
  class="${this.isMobile?"tile-progress-bar-container-mobile":"tile-progress-bar-container-desktop"}"
33
33
  >
34
34
  <beam-progress-bar value="${f}" style="flex: 1 0;"></beam-progress-bar>
35
35
  <span class="details-funding-progress-label">${A}</span>
36
- </div>`:n``}
36
+ </div>`:o``}
37
37
  <div class="funded-times">
38
38
  ${W}${E(p(this.configLang,u))}
39
39
  </div>
@@ -41,7 +41,7 @@ import{f as z,g as r,t as d,h as H,y as n,k as E}from"../chunks/lit-WqMxC_PA.esm
41
41
  </div>
42
42
  </div>
43
43
  `})}
44
- `}render(){const{data:t,loading:o,error:s}=this.eligibleNonprofitsDataController;if(o)return $();if(s||t==null)return this.debug?v({error:s||new Error("No data")}):"";let a;const b=this.cssVariables["--beam-SubscriptionManagement-previousImpact-cardStyle"],m=this.cssVariables["--beam-SubscriptionManagement-logo-align-desktop"],u=this.cssVariables["--beam-SubscriptionManagement-logo-align-mobile"],h=this.getDisplayablePreviousImpacts().length??0;if((this.subscriptionDataController.loading||this.eligibleNonprofitsDataController.loading||this.personalImpactDataController.loading)&&$(),(this.subscriptionDataController.error||this.eligibleNonprofitsDataController.error||this.personalImpactDataController.error)&&this.debug){if(this.subscriptionDataController.error!==null)return v({error:this.subscriptionDataController.error});if(this.eligibleNonprofitsDataController.error!==null)return v({error:this.eligibleNonprofitsDataController.error});if(this.personalImpactDataController.error!==null)return v({error:this.personalImpactDataController.error})}else a="";return this.activeWidget==="select-subscription-nonprofit"?a=n` <beam-select-subscription-nonprofit
44
+ `}render(){const{data:t,loading:n,error:s}=this.eligibleNonprofitsDataController;if(n)return D();if(t?.settings?.excludeDonationsForRecurringTransactions)return o``;if(s||t==null)return this.debug?v({error:s||new Error("No data")}):"";let a;const b=this.cssVariables["--beam-SubscriptionManagement-previousImpact-cardStyle"],m=this.cssVariables["--beam-SubscriptionManagement-logo-align-desktop"],u=this.cssVariables["--beam-SubscriptionManagement-logo-align-mobile"],h=this.getDisplayablePreviousImpacts().length??0;if((this.subscriptionDataController.loading||this.eligibleNonprofitsDataController.loading||this.personalImpactDataController.loading)&&D(),(this.subscriptionDataController.error||this.eligibleNonprofitsDataController.error||this.personalImpactDataController.error)&&this.debug){if(this.subscriptionDataController.error!==null)return v({error:this.subscriptionDataController.error});if(this.eligibleNonprofitsDataController.error!==null)return v({error:this.eligibleNonprofitsDataController.error});if(this.personalImpactDataController.error!==null)return v({error:this.personalImpactDataController.error})}else a="";return this.activeWidget==="select-subscription-nonprofit"?a=o` <beam-select-subscription-nonprofit
45
45
  part="subscription-nonprofit"
46
46
  storeId="${this.storeId}"
47
47
  subscriptionId="${this.subscriptionId}"
@@ -55,7 +55,7 @@ import{f as z,g as r,t as d,h as H,y as n,k as E}from"../chunks/lit-WqMxC_PA.esm
55
55
  ?draftConfig="${this.draftConfig}"
56
56
  ?debug="${this.debug}"
57
57
  @beamnonprofitselect="${f=>this.handleNonprofitSelect(f)}"
58
- ></beam-select-subscription-nonprofit>`:this.activeWidget==="subscription-impact"&&(a=n`
58
+ ></beam-select-subscription-nonprofit>`:this.activeWidget==="subscription-impact"&&(a=o`
59
59
  <beam-subscription-impact
60
60
  part="subscription-impact"
61
61
  baseUrl="${this.baseUrl}"
@@ -67,7 +67,7 @@ import{f as z,g as r,t as d,h as H,y as n,k as E}from"../chunks/lit-WqMxC_PA.esm
67
67
  ?draftConfig="${this.draftConfig}"
68
68
  ?debug="${this.debug}"
69
69
  ></beam-subscription-impact>
70
- `),n`
70
+ `),o`
71
71
  <style>
72
72
  :host {
73
73
  ${this.cssVariables.toCSS()}
@@ -84,23 +84,23 @@ import{f as z,g as r,t as d,h as H,y as n,k as E}from"../chunks/lit-WqMxC_PA.esm
84
84
  partnerLogoUrl="${this.eligibleNonprofitsDataController.data?.chain.logoUrl}"
85
85
  ></beam-partner-logos>
86
86
  </div>
87
- ${this.nonprofitId?n` <div class="meatballsMenu" @click="${()=>this.dropdownVisible=!this.dropdownVisible}">
87
+ ${this.nonprofitId?o` <div class="meatballsMenu" @click="${()=>this.dropdownVisible=!this.dropdownVisible}">
88
88
  <span>&#8230;</span>
89
89
  <div class="dropdown-container ${this.dropdownVisible?"visible":""}">
90
- ${this.activeWidget==="select-subscription-nonprofit"?n`<button
90
+ ${this.activeWidget==="select-subscription-nonprofit"?o`<button
91
91
  @click="${this.handleBackToSubscriptionImpactButtonClick}"
92
92
  class="drop-down-options button"
93
93
  >
94
94
  ${p(this.configLang,t?.config?.web?.additionalStrings?.previousNonprofitButtonText||"")||g[this.configLang].previousNonprofitButton()}
95
- </button>`:this.activeWidget==="subscription-impact"?n`<button @click="${this.handleSwapNonprofitButtonClick}" class="drop-down-options button">
95
+ </button>`:this.activeWidget==="subscription-impact"?o`<button @click="${this.handleSwapNonprofitButtonClick}" class="drop-down-options button">
96
96
  ${p(this.configLang,t?.config?.web?.additionalStrings?.changeNonprofitButtonText||"")||g[this.configLang].changeNonprofitButton()}
97
97
  </button>`:""}
98
98
  </div>
99
- </div>`:n``}
99
+ </div>`:o``}
100
100
  </div>
101
101
  </div>
102
102
  <div class="sub-widget-container" part="previous-impact">${a}</div>
103
- ${h>Z?n` <div class="line-break"></div>
103
+ ${h>Z?o` <div class="line-break"></div>
104
104
 
105
105
  <div
106
106
  class="previous-impact-container ${this.isMobile?"--beam-SubscriptionManagement-previousImpactContainer-padding-mobile":"--beam-SubscriptionManagement-previousImpactContainer-padding-desktop"}"
@@ -111,7 +111,7 @@ import{f as z,g as r,t as d,h as H,y as n,k as E}from"../chunks/lit-WqMxC_PA.esm
111
111
  <div class="cardGrid">
112
112
  ${this.renderPreviousImpactTiles({personalImpact:this.getDisplayablePreviousImpacts(),cardStyle:b,eligibleNonprofitConfig:this.eligibleNonprofitsDataController.data?.config})}
113
113
  </div>
114
- ${h>D?n`
114
+ ${h>$?o`
115
115
  <div class="previous-impact-link-container">
116
116
  <button
117
117
  @click="${()=>this.showAllTiles=!this.showAllTiles}"
@@ -120,8 +120,8 @@ import{f as z,g as r,t as d,h as H,y as n,k as E}from"../chunks/lit-WqMxC_PA.esm
120
120
  ${this.showAllTiles?p(this.configLang,t?.config?.web?.additionalStrings?.showLessButton||"")||g[this.configLang].showLessButton():p(this.configLang,t?.config?.web?.additionalStrings?.showAllButton||"")||g[this.configLang].showAllButton()}
121
121
  </button>
122
122
  </div>
123
- `:n``}
124
- </div>`:n``}
123
+ `:o``}
124
+ </div>`:o``}
125
125
  </div>
126
126
  `}}e.tagName="beam-subscription-management",e.styles=[V,z`
127
127
  :host {