@beamimpact/web-sdk 1.57.1 → 1.57.2

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 (156) hide show
  1. package/dist/chunks/{_share-dialog-dependencies-BEUnzuWq.esm.js → _share-dialog-dependencies-DFXGKz-z.esm.js} +2 -2
  2. package/dist/chunks/{_share-dialog-dependencies-BEUnzuWq.esm.js.map → _share-dialog-dependencies-DFXGKz-z.esm.js.map} +1 -1
  3. package/dist/chunks/{cart-CKltrzQt.esm.d.ts → cart-hrlPQg3L.esm.d.ts} +2 -2
  4. package/dist/chunks/index-BW8B2iVX.esm.js +32 -0
  5. package/dist/chunks/index-BW8B2iVX.esm.js.map +1 -0
  6. package/dist/chunks/{index-OYSJ-2mk.esm.d.ts → index-BXEbjPDK.esm.d.ts} +1 -1
  7. package/dist/chunks/{index-BAROgNYE.esm.d.ts → index-BZZiSTrL.esm.d.ts} +1 -1
  8. package/dist/chunks/{index-C6a13iqC.esm.d.ts → index-BuLbvDL8.esm.d.ts} +1 -1
  9. package/dist/chunks/{index-D6aFJ4cU.esm.js → index-C20vHMzS.esm.js} +2 -2
  10. package/dist/chunks/{index-D6aFJ4cU.esm.js.map → index-C20vHMzS.esm.js.map} +1 -1
  11. package/dist/chunks/index-CxHPGblW.esm.js +32 -0
  12. package/dist/chunks/index-CxHPGblW.esm.js.map +1 -0
  13. package/dist/chunks/{index-BH3YaPLG.esm.d.ts → index-D3OYVBqK.esm.d.ts} +1 -1
  14. package/dist/chunks/{index-MAMeVd6l.esm.js → index-D9W31jYp.esm.js} +2 -2
  15. package/dist/chunks/{index-MAMeVd6l.esm.js.map → index-D9W31jYp.esm.js.map} +1 -1
  16. package/dist/chunks/{index-DqhM4Yoj.esm.js → index-DXFRJEgw.esm.js} +2 -2
  17. package/dist/chunks/{index-DqhM4Yoj.esm.js.map → index-DXFRJEgw.esm.js.map} +1 -1
  18. package/dist/chunks/{index-Dm-K2MLY.esm.js → index-Dc4HgxdT.esm.js} +2 -2
  19. package/dist/chunks/{index-Dm-K2MLY.esm.js.map → index-Dc4HgxdT.esm.js.map} +1 -1
  20. package/dist/chunks/{index-HqfLVFOU.esm.js → index-xsFjZMYP.esm.js} +2 -2
  21. package/dist/chunks/{index-HqfLVFOU.esm.js.map → index-xsFjZMYP.esm.js.map} +1 -1
  22. package/dist/chunks/{promo-pill-label-5HmbDVmU.esm.js → promo-pill-label-rrCE5zhs.esm.js} +2 -2
  23. package/dist/chunks/{promo-pill-label-5HmbDVmU.esm.js.map → promo-pill-label-rrCE5zhs.esm.js.map} +1 -1
  24. package/dist/chunks/{share-button-C4yPLL_t.esm.js → share-button-DctAhc8i.esm.js} +2 -2
  25. package/dist/chunks/{share-button-C4yPLL_t.esm.js.map → share-button-DctAhc8i.esm.js.map} +1 -1
  26. package/dist/chunks/{share-button-5gfPmeEh.esm.js → share-button-Dob19-Da.esm.js} +2 -2
  27. package/dist/chunks/{share-button-5gfPmeEh.esm.js.map → share-button-Dob19-Da.esm.js.map} +1 -1
  28. package/dist/chunks/{update-cart-DoJGAdoU.esm.d.ts → update-cart-BclA4Tsd.esm.d.ts} +1 -1
  29. package/dist/chunks/utils-C5hmbxa4.esm.js.map +1 -1
  30. package/dist/chunks/{utils-COGFpDER.esm.d.ts → utils-SWm8ZEfg.esm.d.ts} +9 -0
  31. package/dist/components/beam-partner-logos.d.ts +1 -1
  32. package/dist/components/community-impact.d.ts +1 -1
  33. package/dist/components/community-impact.esm.js +1 -1
  34. package/dist/components/community-impact.js +1 -1
  35. package/dist/components/cumulative-impact.d.ts +1 -1
  36. package/dist/components/cumulative-impact.esm.js +1 -1
  37. package/dist/components/cumulative-impact.js +1 -1
  38. package/dist/components/impact-overview.d.ts +1 -1
  39. package/dist/components/impact-overview.esm.js +1 -1
  40. package/dist/components/impact-overview.js +1 -1
  41. package/dist/components/index.d.ts +1 -1
  42. package/dist/components/index.esm.js +1 -1
  43. package/dist/components/index.js +1 -1
  44. package/dist/components/post-purchase.d.ts +1 -1
  45. package/dist/components/post-purchase.esm.js +1 -1
  46. package/dist/components/post-purchase.js +1 -1
  47. package/dist/components/product-details-page.d.ts +1 -1
  48. package/dist/components/product-details-page.esm.js +1 -1
  49. package/dist/components/product-details-page.js +1 -1
  50. package/dist/components/redeem-transaction.d.ts +1 -1
  51. package/dist/components/redeem-transaction.esm.js +1 -1
  52. package/dist/components/redeem-transaction.js +1 -1
  53. package/dist/components/select-nonprofit.d.ts +1 -1
  54. package/dist/components/select-nonprofit.esm.js +1 -1
  55. package/dist/components/select-nonprofit.js +1 -1
  56. package/dist/components/select-subscription-nonprofit.d.ts +1 -1
  57. package/dist/components/select-subscription-nonprofit.esm.js +1 -1
  58. package/dist/components/select-subscription-nonprofit.js +1 -1
  59. package/dist/components/shopify.d.ts +4 -4
  60. package/dist/components/shopify.esm.js +1 -1
  61. package/dist/components/shopify.js +1 -1
  62. package/dist/components/social-share.d.ts +1 -1
  63. package/dist/components/social-share.esm.js +1 -1
  64. package/dist/components/social-share.js +1 -1
  65. package/dist/components/subscriber-select-nonprofit.d.ts +1 -1
  66. package/dist/components/subscriber-select-nonprofit.esm.js +1 -1
  67. package/dist/components/subscriber-select-nonprofit.js +1 -1
  68. package/dist/components/subscription-impact.d.ts +1 -1
  69. package/dist/components/subscription-impact.esm.js +1 -1
  70. package/dist/components/subscription-impact.js +1 -1
  71. package/dist/components/subscription-management.d.ts +1 -1
  72. package/dist/components/subscription-management.esm.js +1 -1
  73. package/dist/components/subscription-management.js +1 -1
  74. package/dist/index.d.ts +7 -7
  75. package/dist/index.esm.js +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/integrations/beam.d.ts +1 -1
  78. package/dist/integrations/beam.esm.js +1 -1
  79. package/dist/integrations/beam.js +1 -1
  80. package/dist/integrations/cart.d.ts +2 -2
  81. package/dist/integrations/cart.esm.js +1 -1
  82. package/dist/integrations/cart.js +1 -1
  83. package/dist/integrations/logs.d.ts +2 -2
  84. package/dist/integrations/logs.esm.js +1 -1
  85. package/dist/integrations/logs.js +1 -1
  86. package/dist/integrations/promoManager.d.ts +1 -1
  87. package/dist/integrations/shopify-order.d.ts +1 -1
  88. package/dist/integrations/shopify-order.esm.js +1 -1
  89. package/dist/integrations/shopify-order.js +1 -1
  90. package/dist/integrations/shopify.d.ts +3 -3
  91. package/dist/integrations/shopify.esm.js +1 -1
  92. package/dist/integrations/shopify.js +1 -1
  93. package/dist/integrations/statsig.d.ts +1 -1
  94. package/dist/integrations/statsig.esm.js +3 -3
  95. package/dist/integrations/statsig.esm.js.map +1 -1
  96. package/dist/integrations/statsig.js +3 -3
  97. package/dist/integrations/statsig.js.map +1 -1
  98. package/dist/integrations/utils.d.ts +1 -1
  99. package/dist/react/beam-partner-logos.d.ts +1 -1
  100. package/dist/react/community-impact.d.ts +1 -1
  101. package/dist/react/community-impact.esm.js +1 -1
  102. package/dist/react/community-impact.js +1 -1
  103. package/dist/react/cumulative-impact.d.ts +1 -1
  104. package/dist/react/cumulative-impact.esm.js +1 -1
  105. package/dist/react/cumulative-impact.js +1 -1
  106. package/dist/react/impact-overview.d.ts +1 -1
  107. package/dist/react/impact-overview.esm.js +1 -1
  108. package/dist/react/impact-overview.js +1 -1
  109. package/dist/react/index.d.ts +1 -1
  110. package/dist/react/index.esm.js +1 -1
  111. package/dist/react/index.js +1 -1
  112. package/dist/react/post-purchase.d.ts +1 -1
  113. package/dist/react/post-purchase.esm.js +1 -1
  114. package/dist/react/post-purchase.js +1 -1
  115. package/dist/react/product-details-page.d.ts +1 -1
  116. package/dist/react/product-details-page.esm.js +1 -1
  117. package/dist/react/product-details-page.js +1 -1
  118. package/dist/react/redeem-transaction.d.ts +1 -1
  119. package/dist/react/redeem-transaction.esm.js +1 -1
  120. package/dist/react/redeem-transaction.js +1 -1
  121. package/dist/react/select-nonprofit.d.ts +1 -1
  122. package/dist/react/select-nonprofit.esm.js +1 -1
  123. package/dist/react/select-nonprofit.js +1 -1
  124. package/dist/react/select-subscription-nonprofit.d.ts +1 -1
  125. package/dist/react/select-subscription-nonprofit.esm.js +1 -1
  126. package/dist/react/select-subscription-nonprofit.js +1 -1
  127. package/dist/react/social-share.d.ts +1 -1
  128. package/dist/react/social-share.esm.js +1 -1
  129. package/dist/react/social-share.js +1 -1
  130. package/dist/react/subscriber-select-nonprofit.d.ts +1 -1
  131. package/dist/react/subscriber-select-nonprofit.esm.js +1 -1
  132. package/dist/react/subscriber-select-nonprofit.js +1 -1
  133. package/dist/react/subscription-impact.d.ts +1 -1
  134. package/dist/react/subscription-impact.esm.js +1 -1
  135. package/dist/react/subscription-impact.js +1 -1
  136. package/dist/react/subscription-management.d.ts +1 -1
  137. package/dist/react/subscription-management.esm.js +1 -1
  138. package/dist/react/subscription-management.js +1 -1
  139. package/dist/utils/beam-errors.d.ts +1 -1
  140. package/dist/utils/cart.d.ts +1 -1
  141. package/dist/utils/clear-beam-storage.d.ts +1 -1
  142. package/dist/utils/cookies.d.ts +1 -1
  143. package/dist/utils/events.d.ts +1 -1
  144. package/dist/utils/local-storage.d.ts +1 -1
  145. package/dist/utils/logger.d.ts +1 -1
  146. package/dist/utils/makeApiKeyHeader.d.ts +1 -1
  147. package/dist/utils/memoize-last.d.ts +1 -1
  148. package/dist/utils/network-listeners.d.ts +1 -1
  149. package/dist/utils/promoManager.d.ts +1 -1
  150. package/dist/utils/remote-session.d.ts +1 -1
  151. package/dist/utils/wait-for-element.d.ts +1 -1
  152. package/package.json +1 -1
  153. package/dist/chunks/index-BgalrCS_.esm.js +0 -32
  154. package/dist/chunks/index-BgalrCS_.esm.js.map +0 -1
  155. package/dist/chunks/index-C60Vejym.esm.js +0 -32
  156. package/dist/chunks/index-C60Vejym.esm.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/index-Dm-K2MLY.esm.js";import"../chunks/index-DqhM4Yoj.esm.js";import"./impact-overview.js";import{B as b}from"../chunks/index-BgalrCS_.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-5gfPmeEh.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-5HmbDVmU.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-C4yPLL_t.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";export{b as BeamPostPurchase};
1
+ import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/index-Dc4HgxdT.esm.js";import"../chunks/index-DXFRJEgw.esm.js";import"./impact-overview.js";import{B as b}from"../chunks/index-CxHPGblW.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-Dob19-Da.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-rrCE5zhs.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/share-button-DctAhc8i.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";export{b as BeamPostPurchase};
2
2
  //# sourceMappingURL=post-purchase.js.map
@@ -2,7 +2,7 @@ import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
4
  import { p as postProductDetailsPage } from '../chunks/routes-D6Gtw6kZ.esm.js';
5
- import { T as TUrl, L as LANGUAGES } from '../chunks/utils-COGFpDER.esm.js';
5
+ import { T as TUrl, L as LANGUAGES } from '../chunks/utils-SWm8ZEfg.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,4 +1,4 @@
1
- import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9MFp.esm.js";import{u as b,B as G,l as W,A as M,c as R,d as k,e as D,f as _}from"../chunks/index-Dm-K2MLY.esm.js";import{D as O,z as j,A as H,h as U,C as K,E as w,W as y,x as N,v as V,F as q,G as J,H as Y,I as Z,m as S}from"../chunks/utils-C5hmbxa4.esm.js";import{c as Q,d as X,e as ee}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as te}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{p as oe}from"../chunks/promo-pill-label-5HmbDVmU.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const ae=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},ie=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return E(` border-radius: var(${a}-borderRadius, ${e});
1
+ import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9MFp.esm.js";import{u as b,B as G,l as W,A as M,c as R,d as k,e as D,f as _}from"../chunks/index-Dc4HgxdT.esm.js";import{D as O,z as j,A as H,h as U,C as K,E as w,W as y,x as N,v as V,F as q,G as J,H as Y,I as Z,m as S}from"../chunks/utils-C5hmbxa4.esm.js";import{c as Q,d as X,e as ee}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as te}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{p as oe}from"../chunks/promo-pill-label-rrCE5zhs.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const ae=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},ie=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return E(` border-radius: var(${a}-borderRadius, ${e});
2
2
  border-style: var(${a}-borderStyle, ${t});
3
3
  border-color: var(${a}-borderColor, ${o});
4
4
  border-width: var(${a}-borderWidth, ${i});
@@ -1,4 +1,4 @@
1
- import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9MFp.esm.js";import{u as b,B as G,l as W,A as M,c as R,d as k,e as D,f as _}from"../chunks/index-Dm-K2MLY.esm.js";import{D as O,z as j,A as H,h as U,C as K,E as w,W as y,x as N,v as V,F as q,G as J,H as Y,I as Z,m as S}from"../chunks/utils-C5hmbxa4.esm.js";import{c as Q,d as X,e as ee}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as te}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{p as oe}from"../chunks/promo-pill-label-5HmbDVmU.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const ae=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},ie=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return E(` border-radius: var(${a}-borderRadius, ${e});
1
+ import{m as E,b as r,i as B,n as p,r as z,a as A,h as L}from"../chunks/lit-BEag9MFp.esm.js";import{u as b,B as G,l as W,A as M,c as R,d as k,e as D,f as _}from"../chunks/index-Dc4HgxdT.esm.js";import{D as O,z as j,A as H,h as U,C as K,E as w,W as y,x as N,v as V,F as q,G as J,H as Y,I as Z,m as S}from"../chunks/utils-C5hmbxa4.esm.js";import{c as Q,d as X,e as ee}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as te}from"../chunks/responsive-aN8P5PqD.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{p as oe}from"../chunks/promo-pill-label-rrCE5zhs.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const ae=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return{[`${a}-borderRadius`]:e,[`${a}-borderStyle`]:t,[`${a}-borderColor`]:o,[`${a}-borderWidth`]:i}},ie=(n="",{borderRadius:e="0px",borderStyle:t="unset",borderColor:o="#000000",borderWidth:i="1px"}={})=>{const a=n.startsWith("--beam-")?n:`--beam-${n}`;return E(` border-radius: var(${a}-borderRadius, ${e});
2
2
  border-style: var(${a}-borderStyle, ${t});
3
3
  border-color: var(${a}-borderColor, ${o});
4
4
  border-width: var(${a}-borderWidth, ${i});
@@ -2,7 +2,7 @@ import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement, PropertyValues } from 'lit';
4
4
  import * as lodash from 'lodash';
5
- import { c as TId, b as TNumericId, d as TCart, L as LANGUAGES } from '../chunks/utils-COGFpDER.esm.js';
5
+ import { c as TId, b as TNumericId, d as TCart, L as LANGUAGES } from '../chunks/utils-SWm8ZEfg.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,2 +1,2 @@
1
- import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Dm-K2MLY.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import{B as d}from"../chunks/index-HqfLVFOU.esm.js";import"../chunks/share-button-5gfPmeEh.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/promo-pill-label-5HmbDVmU.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";export{d as BeamRedeemTransaction};
1
+ import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Dc4HgxdT.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import{B as d}from"../chunks/index-xsFjZMYP.esm.js";import"../chunks/share-button-Dob19-Da.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/promo-pill-label-rrCE5zhs.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";export{d as BeamRedeemTransaction};
2
2
  //# sourceMappingURL=redeem-transaction.esm.js.map
@@ -1,2 +1,2 @@
1
- import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Dm-K2MLY.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import{B as d}from"../chunks/index-DqhM4Yoj.esm.js";import"../chunks/share-button-5gfPmeEh.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-5HmbDVmU.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";export{d as BeamRedeemTransaction};
1
+ import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Dc4HgxdT.esm.js";import"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import{B as d}from"../chunks/index-DXFRJEgw.esm.js";import"../chunks/share-button-Dob19-Da.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-rrCE5zhs.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";export{d as BeamRedeemTransaction};
2
2
  //# sourceMappingURL=redeem-transaction.js.map
@@ -2,7 +2,7 @@ import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement, PropertyValues } from 'lit';
4
4
  import * as lodash from 'lodash';
5
- import { b as TNumericId, d as TCart, L as LANGUAGES } from '../chunks/utils-COGFpDER.esm.js';
5
+ import { b as TNumericId, d as TCart, L as LANGUAGES } from '../chunks/utils-SWm8ZEfg.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,4 +1,4 @@
1
- import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../chunks/lit-BEag9MFp.esm.js";import{i as Q,d as X}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as S,B as z,h as Z,m as ee,A as B,e as u,f as te,_ as oe,c as T,d as m}from"../chunks/index-Dm-K2MLY.esm.js";import{D as ie,A as M,J as F,h as ne,C as ae,E as K,W as C,L as O,B as P,K as re,z as se,M as E,N as le,v as ce,F as pe,G as de,H as fe,I as me,O as W,m as _,l as ge}from"../chunks/utils-C5hmbxa4.esm.js";import{c as he,d as ue,e as k}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as be}from"../chunks/share-button-5gfPmeEh.esm.js";import{c as Se}from"../chunks/responsive-aN8P5PqD.esm.js";import{p as Ne}from"../chunks/promo-pill-label-5HmbDVmU.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";class ve extends D{static get styles(){return L`
1
+ import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../chunks/lit-BEag9MFp.esm.js";import{i as Q,d as X}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as S,B as z,h as Z,m as ee,A as B,e as u,f as te,_ as oe,c as T,d as m}from"../chunks/index-Dc4HgxdT.esm.js";import{D as ie,A as M,J as F,h as ne,C as ae,E as K,W as C,L as O,B as P,K as re,z as se,M as E,N as le,v as ce,F as pe,G as de,H as fe,I as me,O as W,m as _,l as ge}from"../chunks/utils-C5hmbxa4.esm.js";import{c as he,d as ue,e as k}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as be}from"../chunks/share-button-Dob19-Da.esm.js";import{c as Se}from"../chunks/responsive-aN8P5PqD.esm.js";import{p as Ne}from"../chunks/promo-pill-label-rrCE5zhs.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";class ve extends D{static get styles(){return L`
2
2
  :host {
3
3
  }
4
4
 
@@ -1,4 +1,4 @@
1
- import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../chunks/lit-BEag9MFp.esm.js";import{i as Q,d as X}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as S,B as z,h as Z,m as ee,A as B,e as u,f as te,_ as oe,c as T,d as m}from"../chunks/index-Dm-K2MLY.esm.js";import{D as ie,A as M,J as F,h as ne,C as ae,E as K,W as C,L as O,B as P,K as re,z as se,M as E,N as le,v as ce,F as pe,G as de,H as fe,I as me,O as W,m as _,l as ge}from"../chunks/utils-C5hmbxa4.esm.js";import{c as he,d as ue,e as k}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as be}from"../chunks/share-button-5gfPmeEh.esm.js";import{c as Se}from"../chunks/responsive-aN8P5PqD.esm.js";import{p as Ne}from"../chunks/promo-pill-label-5HmbDVmU.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";class ve extends D{static get styles(){return L`
1
+ import{a as D,i as L,b as d,n as f,r as I,e as v,k as J,j as A,h as Y}from"../chunks/lit-BEag9MFp.esm.js";import{i as Q,d as X}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as S,B as z,h as Z,m as ee,A as B,e as u,f as te,_ as oe,c as T,d as m}from"../chunks/index-Dc4HgxdT.esm.js";import{D as ie,A as M,J as F,h as ne,C as ae,E as K,W as C,L as O,B as P,K as re,z as se,M as E,N as le,v as ce,F as pe,G as de,H as fe,I as me,O as W,m as _,l as ge}from"../chunks/utils-C5hmbxa4.esm.js";import{c as he,d as ue,e as k}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as be}from"../chunks/share-button-Dob19-Da.esm.js";import{c as Se}from"../chunks/responsive-aN8P5PqD.esm.js";import{p as Ne}from"../chunks/promo-pill-label-rrCE5zhs.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";class ve extends D{static get styles(){return L`
2
2
  :host {
3
3
  }
4
4
 
@@ -2,7 +2,7 @@ import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement, PropertyValues } from 'lit';
4
4
  import * as lodash from 'lodash';
5
- import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-COGFpDER.esm.js';
5
+ import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-SWm8ZEfg.esm.js';
6
6
  import './beam-partner-logos.js';
7
7
  import 'lodash-es/debounce';
8
8
  import 'lodash-es/isEqual';
@@ -1,4 +1,4 @@
1
- import{j as E,b as m,i as I,n as p,r as F,a as z,k as L,e as v,h as A}from"../chunks/lit-BEag9MFp.esm.js";import{d as M}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as d,h as W,k as P,A as k,e as u,f as U,_,c as N,d as l}from"../chunks/index-Dm-K2MLY.esm.js";import{a as R}from"../chunks/share-button-5gfPmeEh.esm.js";import{D as j,x as C,L as y,y as O,z as H,B as K,W as G,v as q,n as V}from"../chunks/utils-C5hmbxa4.esm.js";import{c as J,a as Y,d as Z,e as x}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import"./beam-partner-logos.esm.js";const Q=({height:e="1em",width:t="1em"}={})=>m`
1
+ import{j as E,b as m,i as I,n as p,r as F,a as z,k as L,e as v,h as A}from"../chunks/lit-BEag9MFp.esm.js";import{d as M}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as d,h as W,k as P,A as k,e as u,f as U,_,c as N,d as l}from"../chunks/index-Dc4HgxdT.esm.js";import{a as R}from"../chunks/share-button-Dob19-Da.esm.js";import{D as j,x as C,L as y,y as O,z as H,B as K,W as G,v as q,n as V}from"../chunks/utils-C5hmbxa4.esm.js";import{c as J,a as Y,d as Z,e as x}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import"./beam-partner-logos.esm.js";const Q=({height:e="1em",width:t="1em"}={})=>m`
2
2
  <svg
3
3
  style="${E({height:e,width:t,position:"relative",bottom:"0"})}"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -1,4 +1,4 @@
1
- import{j as E,b as m,i as I,n as p,r as F,a as z,k as L,e as v,h as A}from"../chunks/lit-BEag9MFp.esm.js";import{d as M}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as d,h as W,k as P,A as k,e as u,f as U,_,c as N,d as l}from"../chunks/index-Dm-K2MLY.esm.js";import{a as R}from"../chunks/share-button-5gfPmeEh.esm.js";import{D as j,x as C,L as y,y as O,z as H,B as K,W as G,v as q,n as V}from"../chunks/utils-C5hmbxa4.esm.js";import{c as J,a as Y,d as Z,e as x}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import"./beam-partner-logos.js";const Q=({height:e="1em",width:t="1em"}={})=>m`
1
+ import{j as E,b as m,i as I,n as p,r as F,a as z,k as L,e as v,h as A}from"../chunks/lit-BEag9MFp.esm.js";import{d as M}from"../chunks/lodash-CrMU6wKg.esm.js";import{u as d,h as W,k as P,A as k,e as u,f as U,_,c as N,d as l}from"../chunks/index-Dc4HgxdT.esm.js";import{a as R}from"../chunks/share-button-Dob19-Da.esm.js";import{D as j,x as C,L as y,y as O,z as H,B as K,W as G,v as q,n as V}from"../chunks/utils-C5hmbxa4.esm.js";import{c as J,a as Y,d as Z,e as x}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import"./beam-partner-logos.js";const Q=({height:e="1em",width:t="1em"}={})=>m`
2
2
  <svg
3
3
  style="${E({height:e,width:t,position:"relative",bottom:"0"})}"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -1,11 +1,11 @@
1
- import { w as waitForElement } from '../chunks/utils-COGFpDER.esm.js';
2
- export { e as events, i as initNetworkListeners } from '../chunks/utils-COGFpDER.esm.js';
3
- export { B as BeamShopifyCartIntegrationConfig, a as addBeamAttributesToCart, b as appendBeamAttributesToCart, c as appendStatsigToShopifyCartAttributes, d as appendToShopifyCartBeamAttribute, g as getBeamAttributesForCart, e as getCurrentCart, f as getShopifyCart, r as registerCartIntegration, t as trackCart, u as unregisterCartIntegration } from '../chunks/cart-CKltrzQt.esm.js';
1
+ import { w as waitForElement } from '../chunks/utils-SWm8ZEfg.esm.js';
2
+ export { e as events, i as initNetworkListeners } from '../chunks/utils-SWm8ZEfg.esm.js';
3
+ export { B as BeamShopifyCartIntegrationConfig, a as addBeamAttributesToCart, b as appendBeamAttributesToCart, c as appendStatsigToShopifyCartAttributes, d as appendToShopifyCartBeamAttribute, g as getBeamAttributesForCart, e as getCurrentCart, f as getShopifyCart, r as registerCartIntegration, t as trackCart, u as unregisterCartIntegration } from '../chunks/cart-hrlPQg3L.esm.js';
4
4
  export { TBeamOrderPageParams, showBeamOrderPageWidgets } from '../integrations/shopify-order.js';
5
5
  import 'lodash-es/debounce';
6
6
  import 'lodash-es/isEqual';
7
7
  import 'lodash';
8
- import '../chunks/update-cart-DoJGAdoU.esm.js';
8
+ import '../chunks/update-cart-BclA4Tsd.esm.js';
9
9
  import './post-purchase.js';
10
10
  import 'lit';
11
11
  import 'lit-html';
@@ -1,2 +1,2 @@
1
- import{g as t,a as r,w as e}from"../chunks/utils-C5hmbxa4.esm.js";import{e as B,b as T}from"../chunks/utils-C5hmbxa4.esm.js";import{J as y,g as S,n as F,x as c,y as E,L as I,T as L,e as M,r as V,a as v}from"../chunks/index-D6aFJ4cU.esm.js";import{s as N}from"../chunks/index-C60Vejym.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Dm-K2MLY.esm.js";import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/index-MAMeVd6l.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/index-HqfLVFOU.esm.js";import"../chunks/share-button-5gfPmeEh.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/promo-pill-label-5HmbDVmU.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"./impact-overview.esm.js";import"../chunks/share-button-C4yPLL_t.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";const a={waitForElement:e,getCookieMap:r,getCookieValue:t};export{y as addBeamAttributesToCart,S as appendBeamAttributesToCart,F as appendStatsigToShopifyCartAttributes,c as appendToShopifyCartBeamAttribute,B as events,E as getBeamAttributesForCart,I as getCurrentCart,L as getShopifyCart,T as initNetworkListeners,M as registerCartIntegration,N as showBeamOrderPageWidgets,V as trackCart,v as unregisterCartIntegration,a as utils};
1
+ import{g as t,a as r,w as e}from"../chunks/utils-C5hmbxa4.esm.js";import{e as B,b as T}from"../chunks/utils-C5hmbxa4.esm.js";import{J as y,g as S,n as F,x as c,y as E,L as I,T as L,e as M,r as V,a as v}from"../chunks/index-C20vHMzS.esm.js";import{s as N}from"../chunks/index-BW8B2iVX.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Dc4HgxdT.esm.js";import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/index-D9W31jYp.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/index-xsFjZMYP.esm.js";import"../chunks/share-button-Dob19-Da.esm.js";import"./beam-partner-logos.esm.js";import"../chunks/promo-pill-label-rrCE5zhs.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"./impact-overview.esm.js";import"../chunks/share-button-DctAhc8i.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";const a={waitForElement:e,getCookieMap:r,getCookieValue:t};export{y as addBeamAttributesToCart,S as appendBeamAttributesToCart,F as appendStatsigToShopifyCartAttributes,c as appendToShopifyCartBeamAttribute,B as events,E as getBeamAttributesForCart,I as getCurrentCart,L as getShopifyCart,T as initNetworkListeners,M as registerCartIntegration,N as showBeamOrderPageWidgets,V as trackCart,v as unregisterCartIntegration,a as utils};
2
2
  //# sourceMappingURL=shopify.esm.js.map
@@ -1,2 +1,2 @@
1
- import{g as t,a as r,w as e}from"../chunks/utils-C5hmbxa4.esm.js";import{e as B,b as T}from"../chunks/utils-C5hmbxa4.esm.js";import{J as y,g as S,n as F,x as c,y as E,L as I,T as L,e as M,r as V,a as v}from"../chunks/index-D6aFJ4cU.esm.js";import{s as N}from"../chunks/index-BgalrCS_.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Dm-K2MLY.esm.js";import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/index-MAMeVd6l.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/index-DqhM4Yoj.esm.js";import"../chunks/share-button-5gfPmeEh.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-5HmbDVmU.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"./impact-overview.js";import"../chunks/share-button-C4yPLL_t.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";const a={waitForElement:e,getCookieMap:r,getCookieValue:t};export{y as addBeamAttributesToCart,S as appendBeamAttributesToCart,F as appendStatsigToShopifyCartAttributes,c as appendToShopifyCartBeamAttribute,B as events,E as getBeamAttributesForCart,I as getCurrentCart,L as getShopifyCart,T as initNetworkListeners,M as registerCartIntegration,N as showBeamOrderPageWidgets,V as trackCart,v as unregisterCartIntegration,a as utils};
1
+ import{g as t,a as r,w as e}from"../chunks/utils-C5hmbxa4.esm.js";import{e as B,b as T}from"../chunks/utils-C5hmbxa4.esm.js";import{J as y,g as S,n as F,x as c,y as E,L as I,T as L,e as M,r as V,a as v}from"../chunks/index-C20vHMzS.esm.js";import{s as N}from"../chunks/index-CxHPGblW.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/index-Dc4HgxdT.esm.js";import"../chunks/lit-BEag9MFp.esm.js";import"../chunks/index-D9W31jYp.esm.js";import"../chunks/css-card-grid-CiqEjkwR.esm.js";import"../chunks/index-DXFRJEgw.esm.js";import"../chunks/share-button-Dob19-Da.esm.js";import"./beam-partner-logos.js";import"../chunks/promo-pill-label-rrCE5zhs.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"./impact-overview.js";import"../chunks/share-button-DctAhc8i.esm.js";import"../chunks/responsive-aN8P5PqD.esm.js";const a={waitForElement:e,getCookieMap:r,getCookieValue:t};export{y as addBeamAttributesToCart,S as appendBeamAttributesToCart,F as appendStatsigToShopifyCartAttributes,c as appendToShopifyCartBeamAttribute,B as events,E as getBeamAttributesForCart,I as getCurrentCart,L as getShopifyCart,T as initNetworkListeners,M as registerCartIntegration,N as showBeamOrderPageWidgets,V as trackCart,v as unregisterCartIntegration,a as utils};
2
2
  //# sourceMappingURL=shopify.js.map
@@ -2,7 +2,7 @@ import * as lit from 'lit';
2
2
  import { LitElement } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
4
  import './beam-partner-logos.js';
5
- import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-COGFpDER.esm.js';
5
+ import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-SWm8ZEfg.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,4 +1,4 @@
1
- import{i as m,n as s,r as n,a as g,b}from"../chunks/lit-BEag9MFp.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import{u as d,s as r,p}from"../chunks/share-button-5gfPmeEh.esm.js";import"./beam-partner-logos.esm.js";import{c as f,d as y,e as u}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{g as w,_ as x}from"../chunks/index-Dm-K2MLY.esm.js";import{D as I,v as U,W as S}from"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";var k=Object.defineProperty,a=(l,t,i,v)=>{for(var o=void 0,c=l.length-1,h;c>=0;c--)(h=l[c])&&(o=h(t,i,o)||o);return o&&k(t,i,o),o};class e extends g{constructor(){super(...arguments),this.baseUrl=I,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 U[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 w({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{storeId:this.storeId,personalImpactLimit:0,nonprofitId:this.nonprofitId,widgetName:S.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?x():b`
1
+ import{i as m,n as s,r as n,a as g,b}from"../chunks/lit-BEag9MFp.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import{u as d,s as r,p}from"../chunks/share-button-Dob19-Da.esm.js";import"./beam-partner-logos.esm.js";import{c as f,d as y,e as u}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{g as w,_ as x}from"../chunks/index-Dc4HgxdT.esm.js";import{D as I,v as U,W as S}from"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";var k=Object.defineProperty,a=(l,t,i,v)=>{for(var o=void 0,c=l.length-1,h;c>=0;c--)(h=l[c])&&(o=h(t,i,o)||o);return o&&k(t,i,o),o};class e extends g{constructor(){super(...arguments),this.baseUrl=I,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 U[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 w({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{storeId:this.storeId,personalImpactLimit:0,nonprofitId:this.nonprofitId,widgetName:S.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?x():b`
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{i as m,n as s,r as n,a as g,b}from"../chunks/lit-BEag9MFp.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import{u as d,s as r,p}from"../chunks/share-button-5gfPmeEh.esm.js";import"./beam-partner-logos.js";import{c as f,d as y,e as u}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{g as w,_ as x}from"../chunks/index-Dm-K2MLY.esm.js";import{D as I,v as U,W as S}from"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";var k=Object.defineProperty,a=(l,t,i,v)=>{for(var o=void 0,c=l.length-1,h;c>=0;c--)(h=l[c])&&(o=h(t,i,o)||o);return o&&k(t,i,o),o};class e extends g{constructor(){super(...arguments),this.baseUrl=I,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 U[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 w({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{storeId:this.storeId,personalImpactLimit:0,nonprofitId:this.nonprofitId,widgetName:S.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?x():b`
1
+ import{i as m,n as s,r as n,a as g,b}from"../chunks/lit-BEag9MFp.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import{u as d,s as r,p}from"../chunks/share-button-Dob19-Da.esm.js";import"./beam-partner-logos.js";import{c as f,d as y,e as u}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{g as w,_ as x}from"../chunks/index-Dc4HgxdT.esm.js";import{D as I,v as U,W as S}from"../chunks/utils-C5hmbxa4.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";var k=Object.defineProperty,a=(l,t,i,v)=>{for(var o=void 0,c=l.length-1,h;c>=0;c--)(h=l[c])&&(o=h(t,i,o)||o);return o&&k(t,i,o),o};class e extends g{constructor(){super(...arguments),this.baseUrl=I,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 U[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 w({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},queryParams:{storeId:this.storeId,personalImpactLimit:0,nonprofitId:this.nonprofitId,widgetName:S.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?x():b`
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,7 +1,7 @@
1
1
  import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement, PropertyValues } from 'lit';
4
- import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-COGFpDER.esm.js';
4
+ import { b as TNumericId, L as LANGUAGES } from '../chunks/utils-SWm8ZEfg.esm.js';
5
5
  import 'lodash-es/debounce';
6
6
  import 'lodash-es/isEqual';
7
7
 
@@ -1,4 +1,4 @@
1
- import{h as A,i as E,n as b,r as T,a as L,b as N,k as H,j as U}from"../chunks/lit-BEag9MFp.esm.js";import{d as P,u as h,h as B,j as z,k as _,A as C,e as g,f as W,_ as K,c as D}from"../chunks/index-Dm-K2MLY.esm.js";import{D as O,W as k,x as w,y as R,B as j,v as F}from"../chunks/utils-C5hmbxa4.esm.js";import{c as q,d as G,e as v}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as V}from"../chunks/share-button-5gfPmeEh.esm.js";import{c as J}from"../chunks/responsive-aN8P5PqD.esm.js";import{h as o,g as $}from"../chunks/handlebars-B_i-to-h.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const M={long:"dddd, MMMM D, YYYY",short:"MMM D, YYYY",numeric:"MM/DD/YYYY",iso:"YYYY-MM-DD",time:"h:mm A",time24:"HH:mm",datetime:"MMMM D, YYYY h:mm A",month:"MMMM YYYY",monthShort:"MMM YYYY",dayMonth:"MMMM D"},x=(t,e)=>{const r=M[e??"long"]??e??M.long;return $(t).format(r)};o.registerHelper("currentDate",t=>x(new Date,typeof t=="string"?t:void 0)),o.registerHelper("nextMonth",t=>{const e=$().add(1,"month").toDate();return x(e,typeof t=="string"?t:void 0)}),o.registerHelper("dateOffset",(t,e,r)=>{const s=typeof e=="string"?e:void 0,i=(typeof e=="string"?r:e)?.hash?.from,n=i?new Date(i):new Date,p=$(n).add(t,"day").toDate();return s==="relative"?t===-1?"yesterday":t===0?"today":t===1?"tomorrow":t<0?`${Math.abs(t)} days ago`:`${t} days from now`:x(p,s)}),o.registerHelper("formatDate",(t,e)=>{const r=t instanceof Date?t:new Date(t);return isNaN(r.getTime())?"":x(r,typeof e=="string"?e:void 0)}),o.registerHelper("color",(t,e)=>{const r=o.escapeExpression(e),s=o.escapeExpression(t);return new o.SafeString(`<span style="color:${s}">${r}</span>`)}),o.registerHelper("br",()=>new o.SafeString("<br>")),o.registerHelper("bold",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<strong>${e}</strong>`)}),o.registerHelper("italic",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<em>${e}</em>`)}),o.registerHelper("underline",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-decoration:underline">${e}</span>`)}),o.registerHelper("strikethrough",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<s>${e}</s>`)}),o.registerHelper("uppercase",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-transform:uppercase">${e}</span>`)}),o.registerHelper("lowercase",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-transform:lowercase">${e}</span>`)}),o.registerHelper("capitalize",t=>{const e=String(t??""),r=e.charAt(0).toUpperCase()+e.slice(1);return new o.SafeString(o.escapeExpression(r))}),o.registerHelper("style",(t,e)=>{const{bold:r,italic:s,underline:i,strikethrough:n,uppercase:p,lowercase:a,color:m,fontSize:f,fontFamily:y}=e.hash;let d=o.escapeExpression(t);r&&(d=`<strong>${d}</strong>`),s&&(d=`<em>${d}</em>`),n&&(d=`<s>${d}</s>`);const u=[];return i&&u.push("text-decoration:underline"),p&&u.push("text-transform:uppercase"),a&&u.push("text-transform:lowercase"),m&&u.push(`color:${o.escapeExpression(m)}`),f&&u.push(`font-size:${o.escapeExpression(f)}`),y&&u.push(`font-family:${o.escapeExpression(y)}`),u.length&&(d=`<span style="${u.join(";")}">${d}</span>`),new o.SafeString(d)});const Q="en",Y=(t,e={},r="")=>{const s=e.lang||Q,i=t||r,n=P(s,i)??i;return o.compile(n)(e)},S=(t,e={},r="")=>A(Y(t,e,r)),I={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},es:{beamAttribution:()=>"Desarrollado por Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},it:{beamAttribution:()=>"Offerto da Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},pl:{beamAttribution:()=>"Wspierane przez Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},ja:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`}};var X=Object.defineProperty,c=(t,e,r,s)=>{for(var i=void 0,n=t.length-1,p;n>=0;n--)(p=t[n])&&(i=p(e,r,i)||i);return i&&X(e,r,i),i};class l extends L{constructor(){super(...arguments),this.baseUrl=O,this.lang="en",this.debug=!1,this.draftConfig=!1,this.templateData={},this.chain={},this.subscriptionLookup=Promise.resolve(),this.getChainNonprofits=async()=>{v(["apiKey","subscriptionId"],this);const e=await B({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{storeId:this.storeId,widgetName:k.subscriber_select_nonprofit,postalCode:this.postalCode,countryCode:this.countryCode,version:"1.0.0",lang:this.configLang,options:{config:{draftConfig:this.draftConfig}}}});if(e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),await this.subscriptionLookup,this.selectedNonprofitId!=null&&!e.nonprofits.map(r=>r.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=void 0),this.selectedNonprofitId==null&&this.preselectNonprofitAtIndex!=null){const r=e.nonprofits[this.preselectNonprofitAtIndex-1];r&&(this.selectedNonprofitId=r.nonprofit.id,await this.selectionDataController.exec({selectedNonprofitId:r.nonprofit.id}))}return this.chain={...e?.chain},e},this.fetchSubscription=async()=>{v(["apiKey","subscriptionId"],this);const e=await z({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,email:this.email,partnerUserId:this.partnerUserId}});return e.nonprofit?.id&&this.selectedNonprofitId===void 0&&(this.selectedNonprofitId=e.nonprofit.id),e},this.updateNonprofitForSubscription=async({selectedNonprofitId:e})=>{v(["apiKey","subscriptionId"],this);const r=await _({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,nonprofitId:e,selectionMethod:R.subscriber_select_nonprofit_widget}});await this.updateComplete;const s=this.getNonprofitById(e);return this.dispatchEvent(new j({selectedNonprofitId:e,nonprofitName:s?.nonprofit?.name??null,source:k.subscriber_select_nonprofit,timestamp:new Date})),r},this.nonprofitListDataController=new C(this,this.getChainNonprofits),this.subscriptionDataController=new C(this,this.fetchSubscription),this.selectionDataController=new C(this,this.updateNonprofitForSubscription),this.makeHandleSelect=(e,r,s)=>async i=>{const n=this.selectedNonprofitId;if(i instanceof KeyboardEvent){let p=null;switch(i.key){case"ArrowUp":case"ArrowLeft":p=r===0?s[s.length-1]:s[r-1],i.preventDefault();break;case"ArrowRight":case"ArrowDown":p=r===s.length-1?s[0]:s[r+1],i.preventDefault();break;case"Enter":case" ":i.preventDefault();break;default:return}if(p){n!=null&&(this.selectedNonprofitId=p.nonprofit.id);const a=this.renderRoot.querySelector(`[data-value="${p.nonprofit.id}"]`);a!==null&&(a.tabIndex=0,a.focus());return}}!(i.currentTarget instanceof HTMLElement)||n===e||(this.selectedNonprofitId=e,await this.selectionDataController.exec({selectedNonprofitId:e}))}}get configLang(){return F[this.lang]||"en"}getNonprofitById(e){return e?this.nonprofitListDataController?.data?.nonprofits.find(r=>r.nonprofit.id===e):null}async connectedCallback(){super.connectedCallback(),this.nonprofitListDataController.loading=!0}async firstUpdated(){!this.apiKey||!this.email&&!this.partnerUserId||(this.subscriptionLookup=this.subscriptionDataController.exec(),await this.subscriptionLookup)}async updated(e){const r=["baseUrl","storeId","apiKey","countryCode","postalCode","lang"];for(const s of r)if(e.has(s)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){super.disconnectedCallback()}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...V,"--beam-SubscriberSelectNonprofit-title-textAlign":"inherit","--beam-SubscriberSelectNonprofit-description-textAlign":"inherit","--beam-SubscriberSelectNonprofit-maxWidth":"800px","--beam-SubscriberSelectNonprofit-options-marginTop":"0px","--beam-SubscriberSelectNonprofit-options-iconHeight":"20px","--beam-SubscriberSelectNonprofit-options-padding":"6px 4px","--beam-SubscriberSelectNonprofit-options-borderRadius":"4px","--beam-SubscriberSelectNonprofit-options-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-options-borderWidth":"1px","--beam-SubscriberSelectNonprofit-options--selected-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-options-backgroundColor":"transparent","--beam-SubscriberSelectNonprofit-options-gap":"8px","--beam-SubscriberSelectNonprofit-options-margin":"14px 0 0 0","--beam-SubscriberSelectNonprofit-width":"100%","--beam-SubscriberSelectNonprofit-options--selected-backgroundColor":"currentColor","--beam-SubscriberSelectNonprofit-details-marginTop":"6px","--beam-SubscriberSelectNonprofit-details-borderRadius":"4px","--beam-SubscriberSelectNonprofit-details-borderWidth":"1px","--beam-SubscriberSelectNonprofit-details-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-details-backgroundColor":"inherit","--beam-SubscriberSelectNonprofit-details-padding":"10px",...g("--beam-SubscriberSelectNonprofit-title",{fontSize:"1em",fontWeight:"bold"}),...g("--beam-SubscriberSelectNonprofit-description",{marginTop:"1em",fontSize:".85em"}),"--beam-SubscriberSelectNonprofit-title-block-margin-right":"8px",...g("--beam-SubscriberSelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold",textTransform:"uppercase"}),...g("--beam-SubscriberSelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...g("--beam-SubscriberSelectNonprofit-details-impactDescription",{fontSize:".85em",marginTop:"10px",lineHeight:"normal"}),"--beam-SubscriberSelectNonprofit-details-nonprofitName-fontWeight":"bold","--beam-SubscriberSelectNonprofit-details-nonprofitName-fontStyle":"inherit","--beam-SubscriberSelectNonprofit-details-fundingProgress-marginTop":"10px",...g("--beam-SubscriberSelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"})},r=this.nonprofitListDataController?.data?.config?.web?.theme||{},s={...e,...r};return Object.assign(Object.create({toCSS(){return W(this)}}),s)}render(){if(!this.apiKey||!this.email&&!this.partnerUserId)return N``;const{selectedNonprofitId:e}=this,{data:r,loading:s}=this.nonprofitListDataController;if(s&&!r)return K();if(this.nonprofitListDataController.error)return this.debug?D({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return D({error:this.selectionDataController.error});const i=r?.nonprofits||[],n=i.find(a=>a.nonprofit.id===e)||null,p={custom:{...this.templateData},chain:{...this.chain},selectedNonprofit:{...n?.nonprofit},lang:this.configLang};return N`
1
+ import{h as A,i as E,n as b,r as T,a as L,b as N,k as H,j as U}from"../chunks/lit-BEag9MFp.esm.js";import{d as P,u as h,h as B,j as z,k as _,A as C,e as g,f as W,_ as K,c as D}from"../chunks/index-Dc4HgxdT.esm.js";import{D as O,W as k,x as w,y as R,B as j,v as F}from"../chunks/utils-C5hmbxa4.esm.js";import{c as q,d as G,e as v}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as V}from"../chunks/share-button-Dob19-Da.esm.js";import{c as J}from"../chunks/responsive-aN8P5PqD.esm.js";import{h as o,g as $}from"../chunks/handlebars-B_i-to-h.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const M={long:"dddd, MMMM D, YYYY",short:"MMM D, YYYY",numeric:"MM/DD/YYYY",iso:"YYYY-MM-DD",time:"h:mm A",time24:"HH:mm",datetime:"MMMM D, YYYY h:mm A",month:"MMMM YYYY",monthShort:"MMM YYYY",dayMonth:"MMMM D"},x=(t,e)=>{const r=M[e??"long"]??e??M.long;return $(t).format(r)};o.registerHelper("currentDate",t=>x(new Date,typeof t=="string"?t:void 0)),o.registerHelper("nextMonth",t=>{const e=$().add(1,"month").toDate();return x(e,typeof t=="string"?t:void 0)}),o.registerHelper("dateOffset",(t,e,r)=>{const s=typeof e=="string"?e:void 0,i=(typeof e=="string"?r:e)?.hash?.from,n=i?new Date(i):new Date,p=$(n).add(t,"day").toDate();return s==="relative"?t===-1?"yesterday":t===0?"today":t===1?"tomorrow":t<0?`${Math.abs(t)} days ago`:`${t} days from now`:x(p,s)}),o.registerHelper("formatDate",(t,e)=>{const r=t instanceof Date?t:new Date(t);return isNaN(r.getTime())?"":x(r,typeof e=="string"?e:void 0)}),o.registerHelper("color",(t,e)=>{const r=o.escapeExpression(e),s=o.escapeExpression(t);return new o.SafeString(`<span style="color:${s}">${r}</span>`)}),o.registerHelper("br",()=>new o.SafeString("<br>")),o.registerHelper("bold",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<strong>${e}</strong>`)}),o.registerHelper("italic",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<em>${e}</em>`)}),o.registerHelper("underline",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-decoration:underline">${e}</span>`)}),o.registerHelper("strikethrough",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<s>${e}</s>`)}),o.registerHelper("uppercase",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-transform:uppercase">${e}</span>`)}),o.registerHelper("lowercase",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-transform:lowercase">${e}</span>`)}),o.registerHelper("capitalize",t=>{const e=String(t??""),r=e.charAt(0).toUpperCase()+e.slice(1);return new o.SafeString(o.escapeExpression(r))}),o.registerHelper("style",(t,e)=>{const{bold:r,italic:s,underline:i,strikethrough:n,uppercase:p,lowercase:a,color:m,fontSize:f,fontFamily:y}=e.hash;let d=o.escapeExpression(t);r&&(d=`<strong>${d}</strong>`),s&&(d=`<em>${d}</em>`),n&&(d=`<s>${d}</s>`);const u=[];return i&&u.push("text-decoration:underline"),p&&u.push("text-transform:uppercase"),a&&u.push("text-transform:lowercase"),m&&u.push(`color:${o.escapeExpression(m)}`),f&&u.push(`font-size:${o.escapeExpression(f)}`),y&&u.push(`font-family:${o.escapeExpression(y)}`),u.length&&(d=`<span style="${u.join(";")}">${d}</span>`),new o.SafeString(d)});const Q="en",Y=(t,e={},r="")=>{const s=e.lang||Q,i=t||r,n=P(s,i)??i;return o.compile(n)(e)},S=(t,e={},r="")=>A(Y(t,e,r)),I={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},es:{beamAttribution:()=>"Desarrollado por Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},it:{beamAttribution:()=>"Offerto da Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},pl:{beamAttribution:()=>"Wspierane przez Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},ja:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`}};var X=Object.defineProperty,c=(t,e,r,s)=>{for(var i=void 0,n=t.length-1,p;n>=0;n--)(p=t[n])&&(i=p(e,r,i)||i);return i&&X(e,r,i),i};class l extends L{constructor(){super(...arguments),this.baseUrl=O,this.lang="en",this.debug=!1,this.draftConfig=!1,this.templateData={},this.chain={},this.subscriptionLookup=Promise.resolve(),this.getChainNonprofits=async()=>{v(["apiKey","subscriptionId"],this);const e=await B({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{storeId:this.storeId,widgetName:k.subscriber_select_nonprofit,postalCode:this.postalCode,countryCode:this.countryCode,version:"1.0.0",lang:this.configLang,options:{config:{draftConfig:this.draftConfig}}}});if(e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),await this.subscriptionLookup,this.selectedNonprofitId!=null&&!e.nonprofits.map(r=>r.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=void 0),this.selectedNonprofitId==null&&this.preselectNonprofitAtIndex!=null){const r=e.nonprofits[this.preselectNonprofitAtIndex-1];r&&(this.selectedNonprofitId=r.nonprofit.id,await this.selectionDataController.exec({selectedNonprofitId:r.nonprofit.id}))}return this.chain={...e?.chain},e},this.fetchSubscription=async()=>{v(["apiKey","subscriptionId"],this);const e=await z({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,email:this.email,partnerUserId:this.partnerUserId}});return e.nonprofit?.id&&this.selectedNonprofitId===void 0&&(this.selectedNonprofitId=e.nonprofit.id),e},this.updateNonprofitForSubscription=async({selectedNonprofitId:e})=>{v(["apiKey","subscriptionId"],this);const r=await _({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,nonprofitId:e,selectionMethod:R.subscriber_select_nonprofit_widget}});await this.updateComplete;const s=this.getNonprofitById(e);return this.dispatchEvent(new j({selectedNonprofitId:e,nonprofitName:s?.nonprofit?.name??null,source:k.subscriber_select_nonprofit,timestamp:new Date})),r},this.nonprofitListDataController=new C(this,this.getChainNonprofits),this.subscriptionDataController=new C(this,this.fetchSubscription),this.selectionDataController=new C(this,this.updateNonprofitForSubscription),this.makeHandleSelect=(e,r,s)=>async i=>{const n=this.selectedNonprofitId;if(i instanceof KeyboardEvent){let p=null;switch(i.key){case"ArrowUp":case"ArrowLeft":p=r===0?s[s.length-1]:s[r-1],i.preventDefault();break;case"ArrowRight":case"ArrowDown":p=r===s.length-1?s[0]:s[r+1],i.preventDefault();break;case"Enter":case" ":i.preventDefault();break;default:return}if(p){n!=null&&(this.selectedNonprofitId=p.nonprofit.id);const a=this.renderRoot.querySelector(`[data-value="${p.nonprofit.id}"]`);a!==null&&(a.tabIndex=0,a.focus());return}}!(i.currentTarget instanceof HTMLElement)||n===e||(this.selectedNonprofitId=e,await this.selectionDataController.exec({selectedNonprofitId:e}))}}get configLang(){return F[this.lang]||"en"}getNonprofitById(e){return e?this.nonprofitListDataController?.data?.nonprofits.find(r=>r.nonprofit.id===e):null}async connectedCallback(){super.connectedCallback(),this.nonprofitListDataController.loading=!0}async firstUpdated(){!this.apiKey||!this.email&&!this.partnerUserId||(this.subscriptionLookup=this.subscriptionDataController.exec(),await this.subscriptionLookup)}async updated(e){const r=["baseUrl","storeId","apiKey","countryCode","postalCode","lang"];for(const s of r)if(e.has(s)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){super.disconnectedCallback()}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...V,"--beam-SubscriberSelectNonprofit-title-textAlign":"inherit","--beam-SubscriberSelectNonprofit-description-textAlign":"inherit","--beam-SubscriberSelectNonprofit-maxWidth":"800px","--beam-SubscriberSelectNonprofit-options-marginTop":"0px","--beam-SubscriberSelectNonprofit-options-iconHeight":"20px","--beam-SubscriberSelectNonprofit-options-padding":"6px 4px","--beam-SubscriberSelectNonprofit-options-borderRadius":"4px","--beam-SubscriberSelectNonprofit-options-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-options-borderWidth":"1px","--beam-SubscriberSelectNonprofit-options--selected-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-options-backgroundColor":"transparent","--beam-SubscriberSelectNonprofit-options-gap":"8px","--beam-SubscriberSelectNonprofit-options-margin":"14px 0 0 0","--beam-SubscriberSelectNonprofit-width":"100%","--beam-SubscriberSelectNonprofit-options--selected-backgroundColor":"currentColor","--beam-SubscriberSelectNonprofit-details-marginTop":"6px","--beam-SubscriberSelectNonprofit-details-borderRadius":"4px","--beam-SubscriberSelectNonprofit-details-borderWidth":"1px","--beam-SubscriberSelectNonprofit-details-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-details-backgroundColor":"inherit","--beam-SubscriberSelectNonprofit-details-padding":"10px",...g("--beam-SubscriberSelectNonprofit-title",{fontSize:"1em",fontWeight:"bold"}),...g("--beam-SubscriberSelectNonprofit-description",{marginTop:"1em",fontSize:".85em"}),"--beam-SubscriberSelectNonprofit-title-block-margin-right":"8px",...g("--beam-SubscriberSelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold",textTransform:"uppercase"}),...g("--beam-SubscriberSelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...g("--beam-SubscriberSelectNonprofit-details-impactDescription",{fontSize:".85em",marginTop:"10px",lineHeight:"normal"}),"--beam-SubscriberSelectNonprofit-details-nonprofitName-fontWeight":"bold","--beam-SubscriberSelectNonprofit-details-nonprofitName-fontStyle":"inherit","--beam-SubscriberSelectNonprofit-details-fundingProgress-marginTop":"10px",...g("--beam-SubscriberSelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"})},r=this.nonprofitListDataController?.data?.config?.web?.theme||{},s={...e,...r};return Object.assign(Object.create({toCSS(){return W(this)}}),s)}render(){if(!this.apiKey||!this.email&&!this.partnerUserId)return N``;const{selectedNonprofitId:e}=this,{data:r,loading:s}=this.nonprofitListDataController;if(s&&!r)return K();if(this.nonprofitListDataController.error)return this.debug?D({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return D({error:this.selectionDataController.error});const i=r?.nonprofits||[],n=i.find(a=>a.nonprofit.id===e)||null,p={custom:{...this.templateData},chain:{...this.chain},selectedNonprofit:{...n?.nonprofit},lang:this.configLang};return N`
2
2
  <style>
3
3
  :host {
4
4
  ${this.cssVariables.toCSS()}
@@ -1,4 +1,4 @@
1
- import{h as A,i as E,n as b,r as T,a as L,b as N,k as H,j as U}from"../chunks/lit-BEag9MFp.esm.js";import{d as P,u as h,h as B,j as z,k as _,A as C,e as g,f as W,_ as K,c as D}from"../chunks/index-Dm-K2MLY.esm.js";import{D as O,W as k,x as w,y as R,B as j,v as F}from"../chunks/utils-C5hmbxa4.esm.js";import{c as q,d as G,e as v}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as V}from"../chunks/share-button-5gfPmeEh.esm.js";import{c as J}from"../chunks/responsive-aN8P5PqD.esm.js";import{h as o,g as $}from"../chunks/handlebars-B_i-to-h.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const M={long:"dddd, MMMM D, YYYY",short:"MMM D, YYYY",numeric:"MM/DD/YYYY",iso:"YYYY-MM-DD",time:"h:mm A",time24:"HH:mm",datetime:"MMMM D, YYYY h:mm A",month:"MMMM YYYY",monthShort:"MMM YYYY",dayMonth:"MMMM D"},x=(t,e)=>{const r=M[e??"long"]??e??M.long;return $(t).format(r)};o.registerHelper("currentDate",t=>x(new Date,typeof t=="string"?t:void 0)),o.registerHelper("nextMonth",t=>{const e=$().add(1,"month").toDate();return x(e,typeof t=="string"?t:void 0)}),o.registerHelper("dateOffset",(t,e,r)=>{const s=typeof e=="string"?e:void 0,i=(typeof e=="string"?r:e)?.hash?.from,n=i?new Date(i):new Date,p=$(n).add(t,"day").toDate();return s==="relative"?t===-1?"yesterday":t===0?"today":t===1?"tomorrow":t<0?`${Math.abs(t)} days ago`:`${t} days from now`:x(p,s)}),o.registerHelper("formatDate",(t,e)=>{const r=t instanceof Date?t:new Date(t);return isNaN(r.getTime())?"":x(r,typeof e=="string"?e:void 0)}),o.registerHelper("color",(t,e)=>{const r=o.escapeExpression(e),s=o.escapeExpression(t);return new o.SafeString(`<span style="color:${s}">${r}</span>`)}),o.registerHelper("br",()=>new o.SafeString("<br>")),o.registerHelper("bold",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<strong>${e}</strong>`)}),o.registerHelper("italic",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<em>${e}</em>`)}),o.registerHelper("underline",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-decoration:underline">${e}</span>`)}),o.registerHelper("strikethrough",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<s>${e}</s>`)}),o.registerHelper("uppercase",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-transform:uppercase">${e}</span>`)}),o.registerHelper("lowercase",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-transform:lowercase">${e}</span>`)}),o.registerHelper("capitalize",t=>{const e=String(t??""),r=e.charAt(0).toUpperCase()+e.slice(1);return new o.SafeString(o.escapeExpression(r))}),o.registerHelper("style",(t,e)=>{const{bold:r,italic:s,underline:i,strikethrough:n,uppercase:p,lowercase:a,color:m,fontSize:f,fontFamily:y}=e.hash;let d=o.escapeExpression(t);r&&(d=`<strong>${d}</strong>`),s&&(d=`<em>${d}</em>`),n&&(d=`<s>${d}</s>`);const u=[];return i&&u.push("text-decoration:underline"),p&&u.push("text-transform:uppercase"),a&&u.push("text-transform:lowercase"),m&&u.push(`color:${o.escapeExpression(m)}`),f&&u.push(`font-size:${o.escapeExpression(f)}`),y&&u.push(`font-family:${o.escapeExpression(y)}`),u.length&&(d=`<span style="${u.join(";")}">${d}</span>`),new o.SafeString(d)});const Q="en",Y=(t,e={},r="")=>{const s=e.lang||Q,i=t||r,n=P(s,i)??i;return o.compile(n)(e)},S=(t,e={},r="")=>A(Y(t,e,r)),I={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},es:{beamAttribution:()=>"Desarrollado por Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},it:{beamAttribution:()=>"Offerto da Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},pl:{beamAttribution:()=>"Wspierane przez Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},ja:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`}};var X=Object.defineProperty,c=(t,e,r,s)=>{for(var i=void 0,n=t.length-1,p;n>=0;n--)(p=t[n])&&(i=p(e,r,i)||i);return i&&X(e,r,i),i};class l extends L{constructor(){super(...arguments),this.baseUrl=O,this.lang="en",this.debug=!1,this.draftConfig=!1,this.templateData={},this.chain={},this.subscriptionLookup=Promise.resolve(),this.getChainNonprofits=async()=>{v(["apiKey","subscriptionId"],this);const e=await B({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{storeId:this.storeId,widgetName:k.subscriber_select_nonprofit,postalCode:this.postalCode,countryCode:this.countryCode,version:"1.0.0",lang:this.configLang,options:{config:{draftConfig:this.draftConfig}}}});if(e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),await this.subscriptionLookup,this.selectedNonprofitId!=null&&!e.nonprofits.map(r=>r.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=void 0),this.selectedNonprofitId==null&&this.preselectNonprofitAtIndex!=null){const r=e.nonprofits[this.preselectNonprofitAtIndex-1];r&&(this.selectedNonprofitId=r.nonprofit.id,await this.selectionDataController.exec({selectedNonprofitId:r.nonprofit.id}))}return this.chain={...e?.chain},e},this.fetchSubscription=async()=>{v(["apiKey","subscriptionId"],this);const e=await z({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,email:this.email,partnerUserId:this.partnerUserId}});return e.nonprofit?.id&&this.selectedNonprofitId===void 0&&(this.selectedNonprofitId=e.nonprofit.id),e},this.updateNonprofitForSubscription=async({selectedNonprofitId:e})=>{v(["apiKey","subscriptionId"],this);const r=await _({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,nonprofitId:e,selectionMethod:R.subscriber_select_nonprofit_widget}});await this.updateComplete;const s=this.getNonprofitById(e);return this.dispatchEvent(new j({selectedNonprofitId:e,nonprofitName:s?.nonprofit?.name??null,source:k.subscriber_select_nonprofit,timestamp:new Date})),r},this.nonprofitListDataController=new C(this,this.getChainNonprofits),this.subscriptionDataController=new C(this,this.fetchSubscription),this.selectionDataController=new C(this,this.updateNonprofitForSubscription),this.makeHandleSelect=(e,r,s)=>async i=>{const n=this.selectedNonprofitId;if(i instanceof KeyboardEvent){let p=null;switch(i.key){case"ArrowUp":case"ArrowLeft":p=r===0?s[s.length-1]:s[r-1],i.preventDefault();break;case"ArrowRight":case"ArrowDown":p=r===s.length-1?s[0]:s[r+1],i.preventDefault();break;case"Enter":case" ":i.preventDefault();break;default:return}if(p){n!=null&&(this.selectedNonprofitId=p.nonprofit.id);const a=this.renderRoot.querySelector(`[data-value="${p.nonprofit.id}"]`);a!==null&&(a.tabIndex=0,a.focus());return}}!(i.currentTarget instanceof HTMLElement)||n===e||(this.selectedNonprofitId=e,await this.selectionDataController.exec({selectedNonprofitId:e}))}}get configLang(){return F[this.lang]||"en"}getNonprofitById(e){return e?this.nonprofitListDataController?.data?.nonprofits.find(r=>r.nonprofit.id===e):null}async connectedCallback(){super.connectedCallback(),this.nonprofitListDataController.loading=!0}async firstUpdated(){!this.apiKey||!this.email&&!this.partnerUserId||(this.subscriptionLookup=this.subscriptionDataController.exec(),await this.subscriptionLookup)}async updated(e){const r=["baseUrl","storeId","apiKey","countryCode","postalCode","lang"];for(const s of r)if(e.has(s)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){super.disconnectedCallback()}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...V,"--beam-SubscriberSelectNonprofit-title-textAlign":"inherit","--beam-SubscriberSelectNonprofit-description-textAlign":"inherit","--beam-SubscriberSelectNonprofit-maxWidth":"800px","--beam-SubscriberSelectNonprofit-options-marginTop":"0px","--beam-SubscriberSelectNonprofit-options-iconHeight":"20px","--beam-SubscriberSelectNonprofit-options-padding":"6px 4px","--beam-SubscriberSelectNonprofit-options-borderRadius":"4px","--beam-SubscriberSelectNonprofit-options-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-options-borderWidth":"1px","--beam-SubscriberSelectNonprofit-options--selected-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-options-backgroundColor":"transparent","--beam-SubscriberSelectNonprofit-options-gap":"8px","--beam-SubscriberSelectNonprofit-options-margin":"14px 0 0 0","--beam-SubscriberSelectNonprofit-width":"100%","--beam-SubscriberSelectNonprofit-options--selected-backgroundColor":"currentColor","--beam-SubscriberSelectNonprofit-details-marginTop":"6px","--beam-SubscriberSelectNonprofit-details-borderRadius":"4px","--beam-SubscriberSelectNonprofit-details-borderWidth":"1px","--beam-SubscriberSelectNonprofit-details-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-details-backgroundColor":"inherit","--beam-SubscriberSelectNonprofit-details-padding":"10px",...g("--beam-SubscriberSelectNonprofit-title",{fontSize:"1em",fontWeight:"bold"}),...g("--beam-SubscriberSelectNonprofit-description",{marginTop:"1em",fontSize:".85em"}),"--beam-SubscriberSelectNonprofit-title-block-margin-right":"8px",...g("--beam-SubscriberSelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold",textTransform:"uppercase"}),...g("--beam-SubscriberSelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...g("--beam-SubscriberSelectNonprofit-details-impactDescription",{fontSize:".85em",marginTop:"10px",lineHeight:"normal"}),"--beam-SubscriberSelectNonprofit-details-nonprofitName-fontWeight":"bold","--beam-SubscriberSelectNonprofit-details-nonprofitName-fontStyle":"inherit","--beam-SubscriberSelectNonprofit-details-fundingProgress-marginTop":"10px",...g("--beam-SubscriberSelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"})},r=this.nonprofitListDataController?.data?.config?.web?.theme||{},s={...e,...r};return Object.assign(Object.create({toCSS(){return W(this)}}),s)}render(){if(!this.apiKey||!this.email&&!this.partnerUserId)return N``;const{selectedNonprofitId:e}=this,{data:r,loading:s}=this.nonprofitListDataController;if(s&&!r)return K();if(this.nonprofitListDataController.error)return this.debug?D({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return D({error:this.selectionDataController.error});const i=r?.nonprofits||[],n=i.find(a=>a.nonprofit.id===e)||null,p={custom:{...this.templateData},chain:{...this.chain},selectedNonprofit:{...n?.nonprofit},lang:this.configLang};return N`
1
+ import{h as A,i as E,n as b,r as T,a as L,b as N,k as H,j as U}from"../chunks/lit-BEag9MFp.esm.js";import{d as P,u as h,h as B,j as z,k as _,A as C,e as g,f as W,_ as K,c as D}from"../chunks/index-Dc4HgxdT.esm.js";import{D as O,W as k,x as w,y as R,B as j,v as F}from"../chunks/utils-C5hmbxa4.esm.js";import{c as q,d as G,e as v}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{a as V}from"../chunks/share-button-Dob19-Da.esm.js";import{c as J}from"../chunks/responsive-aN8P5PqD.esm.js";import{h as o,g as $}from"../chunks/handlebars-B_i-to-h.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";const M={long:"dddd, MMMM D, YYYY",short:"MMM D, YYYY",numeric:"MM/DD/YYYY",iso:"YYYY-MM-DD",time:"h:mm A",time24:"HH:mm",datetime:"MMMM D, YYYY h:mm A",month:"MMMM YYYY",monthShort:"MMM YYYY",dayMonth:"MMMM D"},x=(t,e)=>{const r=M[e??"long"]??e??M.long;return $(t).format(r)};o.registerHelper("currentDate",t=>x(new Date,typeof t=="string"?t:void 0)),o.registerHelper("nextMonth",t=>{const e=$().add(1,"month").toDate();return x(e,typeof t=="string"?t:void 0)}),o.registerHelper("dateOffset",(t,e,r)=>{const s=typeof e=="string"?e:void 0,i=(typeof e=="string"?r:e)?.hash?.from,n=i?new Date(i):new Date,p=$(n).add(t,"day").toDate();return s==="relative"?t===-1?"yesterday":t===0?"today":t===1?"tomorrow":t<0?`${Math.abs(t)} days ago`:`${t} days from now`:x(p,s)}),o.registerHelper("formatDate",(t,e)=>{const r=t instanceof Date?t:new Date(t);return isNaN(r.getTime())?"":x(r,typeof e=="string"?e:void 0)}),o.registerHelper("color",(t,e)=>{const r=o.escapeExpression(e),s=o.escapeExpression(t);return new o.SafeString(`<span style="color:${s}">${r}</span>`)}),o.registerHelper("br",()=>new o.SafeString("<br>")),o.registerHelper("bold",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<strong>${e}</strong>`)}),o.registerHelper("italic",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<em>${e}</em>`)}),o.registerHelper("underline",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-decoration:underline">${e}</span>`)}),o.registerHelper("strikethrough",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<s>${e}</s>`)}),o.registerHelper("uppercase",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-transform:uppercase">${e}</span>`)}),o.registerHelper("lowercase",t=>{const e=o.escapeExpression(t);return new o.SafeString(`<span style="text-transform:lowercase">${e}</span>`)}),o.registerHelper("capitalize",t=>{const e=String(t??""),r=e.charAt(0).toUpperCase()+e.slice(1);return new o.SafeString(o.escapeExpression(r))}),o.registerHelper("style",(t,e)=>{const{bold:r,italic:s,underline:i,strikethrough:n,uppercase:p,lowercase:a,color:m,fontSize:f,fontFamily:y}=e.hash;let d=o.escapeExpression(t);r&&(d=`<strong>${d}</strong>`),s&&(d=`<em>${d}</em>`),n&&(d=`<s>${d}</s>`);const u=[];return i&&u.push("text-decoration:underline"),p&&u.push("text-transform:uppercase"),a&&u.push("text-transform:lowercase"),m&&u.push(`color:${o.escapeExpression(m)}`),f&&u.push(`font-size:${o.escapeExpression(f)}`),y&&u.push(`font-family:${o.escapeExpression(y)}`),u.length&&(d=`<span style="${u.join(";")}">${d}</span>`),new o.SafeString(d)});const Q="en",Y=(t,e={},r="")=>{const s=e.lang||Q,i=t||r,n=P(s,i)??i;return o.compile(n)(e)},S=(t,e={},r="")=>A(Y(t,e,r)),I={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},es:{beamAttribution:()=>"Desarrollado por Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},it:{beamAttribution:()=>"Offerto da Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},pl:{beamAttribution:()=>"Wspierane przez Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`},ja:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose Your Impact",ctaMessage:({donationPercentage:t="1%"}={})=>`Choose a nonprofit and ${t} will be donated there for you,at no extra cost, with every order of your subscription.`}};var X=Object.defineProperty,c=(t,e,r,s)=>{for(var i=void 0,n=t.length-1,p;n>=0;n--)(p=t[n])&&(i=p(e,r,i)||i);return i&&X(e,r,i),i};class l extends L{constructor(){super(...arguments),this.baseUrl=O,this.lang="en",this.debug=!1,this.draftConfig=!1,this.templateData={},this.chain={},this.subscriptionLookup=Promise.resolve(),this.getChainNonprofits=async()=>{v(["apiKey","subscriptionId"],this);const e=await B({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{storeId:this.storeId,widgetName:k.subscriber_select_nonprofit,postalCode:this.postalCode,countryCode:this.countryCode,version:"1.0.0",lang:this.configLang,options:{config:{draftConfig:this.draftConfig}}}});if(e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),await this.subscriptionLookup,this.selectedNonprofitId!=null&&!e.nonprofits.map(r=>r.nonprofit.id).includes(this.selectedNonprofitId)&&(this.selectedNonprofitId=void 0),this.selectedNonprofitId==null&&this.preselectNonprofitAtIndex!=null){const r=e.nonprofits[this.preselectNonprofitAtIndex-1];r&&(this.selectedNonprofitId=r.nonprofit.id,await this.selectionDataController.exec({selectedNonprofitId:r.nonprofit.id}))}return this.chain={...e?.chain},e},this.fetchSubscription=async()=>{v(["apiKey","subscriptionId"],this);const e=await z({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,email:this.email,partnerUserId:this.partnerUserId}});return e.nonprofit?.id&&this.selectedNonprofitId===void 0&&(this.selectedNonprofitId=e.nonprofit.id),e},this.updateNonprofitForSubscription=async({selectedNonprofitId:e})=>{v(["apiKey","subscriptionId"],this);const r=await _({baseUrl:this.baseUrl,headers:w(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,nonprofitId:e,selectionMethod:R.subscriber_select_nonprofit_widget}});await this.updateComplete;const s=this.getNonprofitById(e);return this.dispatchEvent(new j({selectedNonprofitId:e,nonprofitName:s?.nonprofit?.name??null,source:k.subscriber_select_nonprofit,timestamp:new Date})),r},this.nonprofitListDataController=new C(this,this.getChainNonprofits),this.subscriptionDataController=new C(this,this.fetchSubscription),this.selectionDataController=new C(this,this.updateNonprofitForSubscription),this.makeHandleSelect=(e,r,s)=>async i=>{const n=this.selectedNonprofitId;if(i instanceof KeyboardEvent){let p=null;switch(i.key){case"ArrowUp":case"ArrowLeft":p=r===0?s[s.length-1]:s[r-1],i.preventDefault();break;case"ArrowRight":case"ArrowDown":p=r===s.length-1?s[0]:s[r+1],i.preventDefault();break;case"Enter":case" ":i.preventDefault();break;default:return}if(p){n!=null&&(this.selectedNonprofitId=p.nonprofit.id);const a=this.renderRoot.querySelector(`[data-value="${p.nonprofit.id}"]`);a!==null&&(a.tabIndex=0,a.focus());return}}!(i.currentTarget instanceof HTMLElement)||n===e||(this.selectedNonprofitId=e,await this.selectionDataController.exec({selectedNonprofitId:e}))}}get configLang(){return F[this.lang]||"en"}getNonprofitById(e){return e?this.nonprofitListDataController?.data?.nonprofits.find(r=>r.nonprofit.id===e):null}async connectedCallback(){super.connectedCallback(),this.nonprofitListDataController.loading=!0}async firstUpdated(){!this.apiKey||!this.email&&!this.partnerUserId||(this.subscriptionLookup=this.subscriptionDataController.exec(),await this.subscriptionLookup)}async updated(e){const r=["baseUrl","storeId","apiKey","countryCode","postalCode","lang"];for(const s of r)if(e.has(s)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){super.disconnectedCallback()}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...V,"--beam-SubscriberSelectNonprofit-title-textAlign":"inherit","--beam-SubscriberSelectNonprofit-description-textAlign":"inherit","--beam-SubscriberSelectNonprofit-maxWidth":"800px","--beam-SubscriberSelectNonprofit-options-marginTop":"0px","--beam-SubscriberSelectNonprofit-options-iconHeight":"20px","--beam-SubscriberSelectNonprofit-options-padding":"6px 4px","--beam-SubscriberSelectNonprofit-options-borderRadius":"4px","--beam-SubscriberSelectNonprofit-options-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-options-borderWidth":"1px","--beam-SubscriberSelectNonprofit-options--selected-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-options-backgroundColor":"transparent","--beam-SubscriberSelectNonprofit-options-gap":"8px","--beam-SubscriberSelectNonprofit-options-margin":"14px 0 0 0","--beam-SubscriberSelectNonprofit-width":"100%","--beam-SubscriberSelectNonprofit-options--selected-backgroundColor":"currentColor","--beam-SubscriberSelectNonprofit-details-marginTop":"6px","--beam-SubscriberSelectNonprofit-details-borderRadius":"4px","--beam-SubscriberSelectNonprofit-details-borderWidth":"1px","--beam-SubscriberSelectNonprofit-details-borderColor":"currentColor","--beam-SubscriberSelectNonprofit-details-backgroundColor":"inherit","--beam-SubscriberSelectNonprofit-details-padding":"10px",...g("--beam-SubscriberSelectNonprofit-title",{fontSize:"1em",fontWeight:"bold"}),...g("--beam-SubscriberSelectNonprofit-description",{marginTop:"1em",fontSize:".85em"}),"--beam-SubscriberSelectNonprofit-title-block-margin-right":"8px",...g("--beam-SubscriberSelectNonprofit-details-cause",{fontSize:"0.85em",fontWeight:"bold",textTransform:"uppercase"}),...g("--beam-SubscriberSelectNonprofit-details-beamAttribution",{fontSize:"0.85em"}),...g("--beam-SubscriberSelectNonprofit-details-impactDescription",{fontSize:".85em",marginTop:"10px",lineHeight:"normal"}),"--beam-SubscriberSelectNonprofit-details-nonprofitName-fontWeight":"bold","--beam-SubscriberSelectNonprofit-details-nonprofitName-fontStyle":"inherit","--beam-SubscriberSelectNonprofit-details-fundingProgress-marginTop":"10px",...g("--beam-SubscriberSelectNonprofit-details-fundingProgressLabel",{fontSize:"0.85em"})},r=this.nonprofitListDataController?.data?.config?.web?.theme||{},s={...e,...r};return Object.assign(Object.create({toCSS(){return W(this)}}),s)}render(){if(!this.apiKey||!this.email&&!this.partnerUserId)return N``;const{selectedNonprofitId:e}=this,{data:r,loading:s}=this.nonprofitListDataController;if(s&&!r)return K();if(this.nonprofitListDataController.error)return this.debug?D({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return D({error:this.selectionDataController.error});const i=r?.nonprofits||[],n=i.find(a=>a.nonprofit.id===e)||null,p={custom:{...this.templateData},chain:{...this.chain},selectedNonprofit:{...n?.nonprofit},lang:this.configLang};return N`
2
2
  <style>
3
3
  :host {
4
4
  ${this.cssVariables.toCSS()}
@@ -2,7 +2,7 @@ import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues } from 'lit';
3
3
  import * as lit_html from 'lit-html';
4
4
  import * as lodash from 'lodash';
5
- import { f as TUrl, b as TNumericId, c as TId, L as LANGUAGES } from '../chunks/utils-COGFpDER.esm.js';
5
+ import { f as TUrl, b as TNumericId, c as TId, L as LANGUAGES } from '../chunks/utils-SWm8ZEfg.esm.js';
6
6
  import 'lodash-es/debounce';
7
7
  import 'lodash-es/isEqual';
8
8
 
@@ -1,4 +1,4 @@
1
- import{a as w,i as $,b as p,n as l,r as _,g as C}from"../chunks/lit-BEag9MFp.esm.js";import{d as z,a as G}from"../chunks/lodash-CrMU6wKg.esm.js";import{a as Y}from"../chunks/share-button-5gfPmeEh.esm.js";import{s as S,a as K}from"../chunks/share-button-C4yPLL_t.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{D as q,x as J,v as Q,l as X}from"../chunks/utils-C5hmbxa4.esm.js";import{u as b,g as Z,A as ee,e as u,f as ie,_ as ae,c as te,d as n}from"../chunks/index-Dm-K2MLY.esm.js";import{c as ne,a as re,d as oe,e as se}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as ce}from"../chunks/responsive-aN8P5PqD.esm.js";var pe=Object.defineProperty,le=(i,e,r,m)=>{for(var t=void 0,a=i.length-1,d;a>=0;a--)(d=i[a])&&(t=d(e,r,t)||t);return t&&pe(e,r,t),t};class A extends w{constructor(){super(...arguments),this.infoText=""}static get styles(){return $`
1
+ import{a as w,i as $,b as p,n as l,r as _,g as C}from"../chunks/lit-BEag9MFp.esm.js";import{d as z,a as G}from"../chunks/lodash-CrMU6wKg.esm.js";import{a as Y}from"../chunks/share-button-Dob19-Da.esm.js";import{s as S,a as K}from"../chunks/share-button-DctAhc8i.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{D as q,x as J,v as Q,l as X}from"../chunks/utils-C5hmbxa4.esm.js";import{u as b,g as Z,A as ee,e as u,f as ie,_ as ae,c as te,d as n}from"../chunks/index-Dc4HgxdT.esm.js";import{c as ne,a as re,d as oe,e as se}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as ce}from"../chunks/responsive-aN8P5PqD.esm.js";var pe=Object.defineProperty,le=(i,e,r,m)=>{for(var t=void 0,a=i.length-1,d;a>=0;a--)(d=i[a])&&(t=d(e,r,t)||t);return t&&pe(e,r,t),t};class A extends w{constructor(){super(...arguments),this.infoText=""}static get styles(){return $`
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{a as w,i as $,b as p,n as l,r as _,g as C}from"../chunks/lit-BEag9MFp.esm.js";import{d as z,a as G}from"../chunks/lodash-CrMU6wKg.esm.js";import{a as Y}from"../chunks/share-button-5gfPmeEh.esm.js";import{s as S,a as K}from"../chunks/share-button-C4yPLL_t.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{D as q,x as J,v as Q,l as X}from"../chunks/utils-C5hmbxa4.esm.js";import{u as b,g as Z,A as ee,e as u,f as ie,_ as ae,c as te,d as n}from"../chunks/index-Dm-K2MLY.esm.js";import{c as ne,a as re,d as oe,e as se}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as ce}from"../chunks/responsive-aN8P5PqD.esm.js";var pe=Object.defineProperty,le=(i,e,r,m)=>{for(var t=void 0,a=i.length-1,d;a>=0;a--)(d=i[a])&&(t=d(e,r,t)||t);return t&&pe(e,r,t),t};class A extends w{constructor(){super(...arguments),this.infoText=""}static get styles(){return $`
1
+ import{a as w,i as $,b as p,n as l,r as _,g as C}from"../chunks/lit-BEag9MFp.esm.js";import{d as z,a as G}from"../chunks/lodash-CrMU6wKg.esm.js";import{a as Y}from"../chunks/share-button-Dob19-Da.esm.js";import{s as S,a as K}from"../chunks/share-button-DctAhc8i.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import{D as q,x as J,v as Q,l as X}from"../chunks/utils-C5hmbxa4.esm.js";import{u as b,g as Z,A as ee,e as u,f as ie,_ as ae,c as te,d as n}from"../chunks/index-Dc4HgxdT.esm.js";import{c as ne,a as re,d as oe,e as se}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{c as ce}from"../chunks/responsive-aN8P5PqD.esm.js";var pe=Object.defineProperty,le=(i,e,r,m)=>{for(var t=void 0,a=i.length-1,d;a>=0;a--)(d=i[a])&&(t=d(e,r,t)||t);return t&&pe(e,r,t),t};class A extends w{constructor(){super(...arguments),this.infoText=""}static get styles(){return $`
2
2
  sl-badge::part(base) {
3
3
  background-color: var(--beam-pillLabel-color-background, #000);
4
4
  color: var(--beam-pillLabel-color, #fff);
@@ -2,7 +2,7 @@ import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement } from 'lit';
4
4
  import { g as getChainNonprofits, a as getImpact } from '../chunks/routes-D6Gtw6kZ.esm.js';
5
- import { b as TNumericId, L as LANGUAGES, d as TCart } from '../chunks/utils-COGFpDER.esm.js';
5
+ import { b as TNumericId, L as LANGUAGES, d as TCart } from '../chunks/utils-SWm8ZEfg.esm.js';
6
6
  import './select-subscription-nonprofit.js';
7
7
  import './subscription-impact.js';
8
8
  import 'lodash-es/debounce';
@@ -1,4 +1,4 @@
1
- import{i as z,n as r,r as d,a as H,b as o,h as E}from"../chunks/lit-BEag9MFp.esm.js";import{D as R,v as j,P as K,W as B,x as y,B as N}from"../chunks/utils-C5hmbxa4.esm.js";import{a as _}from"../chunks/share-button-5gfPmeEh.esm.js";import{c as F,a as O,d as V,e as S}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{u as l,A as x,h as Y,j as G,g as q,e as c,f as J,d as p,_ as D,c as v}from"../chunks/index-Dm-K2MLY.esm.js";import"./select-subscription-nonprofit.esm.js";import"./subscription-impact.esm.js";import{partnerLogosConfigDefaults as Q}from"./beam-partner-logos.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-C4yPLL_t.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/responsive-aN8P5PqD.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"},ja:{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,u;b>=0;b--)(u=M[b])&&(a=u(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 x(this,this.fetchSubscription),this.eligibleNonprofitsDataController=new x(this,this.fetchEligibleNonprofits),this.personalImpactDataController=new x(this,this.fetchImpact)}get configLang(){return j[this.lang]||"en"}async firstUpdated(){if(!this.email&&!this.partnerUserId)throw new K(["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 Y({baseUrl:this.baseUrl,headers:y(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 G({baseUrl:this.baseUrl,headers:y(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 q({baseUrl:this.baseUrl,headers:y(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,timestamp:new Date});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={...Q,..._,"--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 J(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`
1
+ import{i as z,n as r,r as d,a as H,b as o,h as E}from"../chunks/lit-BEag9MFp.esm.js";import{D as R,v as j,P as K,W as B,x as y,B as N}from"../chunks/utils-C5hmbxa4.esm.js";import{a as _}from"../chunks/share-button-Dob19-Da.esm.js";import{c as F,a as O,d as V,e as S}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{u as l,A as x,h as Y,j as G,g as q,e as c,f as J,d as p,_ as D,c as v}from"../chunks/index-Dc4HgxdT.esm.js";import"./select-subscription-nonprofit.esm.js";import"./subscription-impact.esm.js";import{partnerLogosConfigDefaults as Q}from"./beam-partner-logos.esm.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-DctAhc8i.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/responsive-aN8P5PqD.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"},ja:{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,u;b>=0;b--)(u=M[b])&&(a=u(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 x(this,this.fetchSubscription),this.eligibleNonprofitsDataController=new x(this,this.fetchEligibleNonprofits),this.personalImpactDataController=new x(this,this.fetchImpact)}get configLang(){return j[this.lang]||"en"}async firstUpdated(){if(!this.email&&!this.partnerUserId)throw new K(["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 Y({baseUrl:this.baseUrl,headers:y(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 G({baseUrl:this.baseUrl,headers:y(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 q({baseUrl:this.baseUrl,headers:y(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,timestamp:new Date});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={...Q,..._,"--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 J(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
2
  ${a.map(u=>{const{impact:{goalCompletionText:m,description:h,goalProgressPercentage:f,goalProgressText:A},nonprofit:{cause:C,causeIconSelectedUrl:L,causeIconUrl:T,website:P,name:I,id:w}}=u,k=this.nonprofitId!==w&&this.isNonprofitEligible(w),U=k&&this.shouldDisplayProgressBar(f),W=m?`${this.emojis[b]} `:"";return b=(b+1)%this.emojis.length,o`
3
3
  <div class="tile">
4
4
  <div class="tile-header">
@@ -1,4 +1,4 @@
1
- import{i as z,n as r,r as d,a as H,b as o,h as E}from"../chunks/lit-BEag9MFp.esm.js";import{D as R,v as j,P as K,W as B,x as y,B as N}from"../chunks/utils-C5hmbxa4.esm.js";import{a as _}from"../chunks/share-button-5gfPmeEh.esm.js";import{c as F,a as O,d as V,e as S}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{u as l,A as x,h as Y,j as G,g as q,e as c,f as J,d as p,_ as D,c as v}from"../chunks/index-Dm-K2MLY.esm.js";import"./select-subscription-nonprofit.js";import"./subscription-impact.js";import{partnerLogosConfigDefaults as Q}from"./beam-partner-logos.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-C4yPLL_t.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/_share-dialog-dependencies-BEUnzuWq.esm.js";import"../chunks/responsive-aN8P5PqD.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"},ja:{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,u;b>=0;b--)(u=M[b])&&(a=u(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 x(this,this.fetchSubscription),this.eligibleNonprofitsDataController=new x(this,this.fetchEligibleNonprofits),this.personalImpactDataController=new x(this,this.fetchImpact)}get configLang(){return j[this.lang]||"en"}async firstUpdated(){if(!this.email&&!this.partnerUserId)throw new K(["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 Y({baseUrl:this.baseUrl,headers:y(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 G({baseUrl:this.baseUrl,headers:y(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 q({baseUrl:this.baseUrl,headers:y(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,timestamp:new Date});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={...Q,..._,"--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 J(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`
1
+ import{i as z,n as r,r as d,a as H,b as o,h as E}from"../chunks/lit-BEag9MFp.esm.js";import{D as R,v as j,P as K,W as B,x as y,B as N}from"../chunks/utils-C5hmbxa4.esm.js";import{a as _}from"../chunks/share-button-Dob19-Da.esm.js";import{c as F,a as O,d as V,e as S}from"../chunks/css-card-grid-CiqEjkwR.esm.js";import{u as l,A as x,h as Y,j as G,g as q,e as c,f as J,d as p,_ as D,c as v}from"../chunks/index-Dc4HgxdT.esm.js";import"./select-subscription-nonprofit.js";import"./subscription-impact.js";import{partnerLogosConfigDefaults as Q}from"./beam-partner-logos.js";import"../chunks/lodash-CrMU6wKg.esm.js";import"../chunks/share-button-DctAhc8i.esm.js";import"../chunks/vendor-DUOg5fL-.esm.js";import"../chunks/_share-dialog-dependencies-DFXGKz-z.esm.js";import"../chunks/responsive-aN8P5PqD.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"},ja:{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,u;b>=0;b--)(u=M[b])&&(a=u(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 x(this,this.fetchSubscription),this.eligibleNonprofitsDataController=new x(this,this.fetchEligibleNonprofits),this.personalImpactDataController=new x(this,this.fetchImpact)}get configLang(){return j[this.lang]||"en"}async firstUpdated(){if(!this.email&&!this.partnerUserId)throw new K(["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 Y({baseUrl:this.baseUrl,headers:y(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 G({baseUrl:this.baseUrl,headers:y(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 q({baseUrl:this.baseUrl,headers:y(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,timestamp:new Date});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={...Q,..._,"--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 J(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
2
  ${a.map(u=>{const{impact:{goalCompletionText:m,description:h,goalProgressPercentage:f,goalProgressText:A},nonprofit:{cause:C,causeIconSelectedUrl:L,causeIconUrl:T,website:P,name:I,id:w}}=u,k=this.nonprofitId!==w&&this.isNonprofitEligible(w),U=k&&this.shouldDisplayProgressBar(f),W=m?`${this.emojis[b]} `:"";return b=(b+1)%this.emojis.length,o`
3
3
  <div class="tile">
4
4
  <div class="tile-header">