@beamimpact/web-sdk 1.50.1 → 1.52.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/_share-dialog-dependencies-BwdvNwrJ.esm.js +2 -0
- package/dist/chunks/_share-dialog-dependencies-BwdvNwrJ.esm.js.map +1 -0
- package/dist/chunks/_share-dialog-dependencies-QaTONkKb.esm.js +2 -0
- package/dist/chunks/_share-dialog-dependencies-QaTONkKb.esm.js.map +1 -0
- package/dist/chunks/{beam-errors-AMvTvR1C.esm.js → beam-errors-Ci0d3926.esm.js} +1 -1
- package/dist/chunks/{beam-errors-AMvTvR1C.esm.js.map → beam-errors-Ci0d3926.esm.js.map} +1 -1
- package/dist/chunks/{cart-contents-6_ztOjrx.esm.d.ts → cart-contents-CUgc4y1N.esm.d.ts} +1 -1
- package/dist/chunks/cart-contents-DkoytiZh.esm.js +2 -0
- package/dist/chunks/{cart-contents-h60geKWa.esm.js.map → cart-contents-DkoytiZh.esm.js.map} +1 -1
- package/dist/chunks/{css-card-grid-nEc--M5M.esm.js → css-card-grid-CvoGpsJH.esm.js} +2 -2
- package/dist/chunks/{css-card-grid-nEc--M5M.esm.js.map → css-card-grid-CvoGpsJH.esm.js.map} +1 -1
- package/dist/chunks/enforce-config-Ba1JkOHs.esm.js +3 -0
- package/dist/chunks/{enforce-config-S8EGgEnO.esm.js.map → enforce-config-Ba1JkOHs.esm.js.map} +1 -1
- package/dist/chunks/enforce-config-CZ3ToOgr.esm.js +3 -0
- package/dist/chunks/{enforce-config-l-tNb_z7.esm.js.map → enforce-config-CZ3ToOgr.esm.js.map} +1 -1
- package/dist/chunks/{events-u_8n2LIU.esm.d.ts → events-BKkf9u9l.esm.d.ts} +3 -3
- package/dist/chunks/{events-T3hYV1LF.esm.js → events-BohmT6Lp.esm.js} +2 -2
- package/dist/chunks/{events-T3hYV1LF.esm.js.map → events-BohmT6Lp.esm.js.map} +1 -1
- package/dist/chunks/index-B5vRxWI3.esm.js +2 -0
- package/dist/chunks/index-B5vRxWI3.esm.js.map +1 -0
- package/dist/chunks/{index-JDZQClkA.esm.js → index-BNjsFEGn.esm.js} +2 -2
- package/dist/chunks/{index-JDZQClkA.esm.js.map → index-BNjsFEGn.esm.js.map} +1 -1
- package/dist/chunks/{index-bhqIqVQJ.esm.d.ts → index-BqBEii8E.esm.d.ts} +1 -1
- package/dist/chunks/index-BsuCVFh-.esm.js +2 -0
- package/dist/chunks/index-BsuCVFh-.esm.js.map +1 -0
- package/dist/chunks/{index-dLnZQZlT.esm.js → index-C-beNpP0.esm.js} +2 -2
- package/dist/chunks/index-C-beNpP0.esm.js.map +1 -0
- package/dist/chunks/{index-E8H5A7Qq.esm.js → index-C3hpHWh1.esm.js} +1 -1
- package/dist/chunks/index-C3hpHWh1.esm.js.map +1 -0
- package/dist/chunks/index-C9SnlT_2.esm.js +2 -0
- package/dist/chunks/index-C9SnlT_2.esm.js.map +1 -0
- package/dist/chunks/index-CFZqe2Wn.esm.js +2 -0
- package/dist/chunks/index-CFZqe2Wn.esm.js.map +1 -0
- package/dist/chunks/{index-FQExZDX9.esm.js → index-CFtmDAHb.esm.js} +1 -1
- package/dist/chunks/index-CFtmDAHb.esm.js.map +1 -0
- package/dist/chunks/index-CTt5RnKY.esm.js +2 -0
- package/dist/chunks/index-CTt5RnKY.esm.js.map +1 -0
- package/dist/chunks/{index-0X3JKFYs.esm.d.ts → index-CbKkAM6h.esm.d.ts} +1 -1
- package/dist/chunks/{index-f7fp9odj.esm.js → index-CbWdmBet.esm.js} +2 -2
- package/dist/chunks/index-CbWdmBet.esm.js.map +1 -0
- package/dist/chunks/{index-XCMf22lv.esm.js → index-D6qJfs7_.esm.js} +1 -1
- package/dist/chunks/index-D6qJfs7_.esm.js.map +1 -0
- package/dist/chunks/{index-XPlAZw7t.esm.js → index-DElVAjg2.esm.js} +2 -2
- package/dist/chunks/{index-XPlAZw7t.esm.js.map → index-DElVAjg2.esm.js.map} +1 -1
- package/dist/chunks/{index-HVGMpZIV.esm.js → index-DTGB86pM.esm.js} +2 -2
- package/dist/chunks/{index-HVGMpZIV.esm.js.map → index-DTGB86pM.esm.js.map} +1 -1
- package/dist/chunks/index-DZt3Lbb4.esm.js +2 -0
- package/dist/chunks/index-DZt3Lbb4.esm.js.map +1 -0
- package/dist/chunks/{index-kFulvjM4.esm.js → index-DhtZDPvk.esm.js} +2 -2
- package/dist/chunks/index-DhtZDPvk.esm.js.map +1 -0
- package/dist/chunks/{index-q2vZ79t1.esm.d.ts → index-Dnm34FcO.esm.d.ts} +2 -2
- package/dist/chunks/{index-puZGYsUA.esm.d.ts → index-DvbUE31b.esm.d.ts} +2 -2
- package/dist/chunks/{index-m1LRybiJ.esm.js → index-GcpuX_TZ.esm.js} +2 -2
- package/dist/chunks/index-GcpuX_TZ.esm.js.map +1 -0
- package/dist/chunks/{index-eXilYHHK.esm.js → index-IKiJwo5v.esm.js} +2 -2
- package/dist/chunks/{index-eXilYHHK.esm.js.map → index-IKiJwo5v.esm.js.map} +1 -1
- package/dist/chunks/{index-cznI-EZa.esm.d.ts → index-TAxKoTC1.esm.d.ts} +4 -2
- package/dist/chunks/index-ki8pLX6n.esm.d.ts +15 -0
- package/dist/chunks/{index-PiMq5a49.esm.js → index-oGObXjk6.esm.js} +1 -1
- package/dist/chunks/index-oGObXjk6.esm.js.map +1 -0
- package/dist/chunks/{is-all-html-elements-SdSkxirh.esm.js → is-all-html-elements-fcB7UUA1.esm.js} +1 -1
- package/dist/chunks/{is-all-html-elements-SdSkxirh.esm.js.map → is-all-html-elements-fcB7UUA1.esm.js.map} +1 -1
- package/dist/chunks/lit-WqMxC_PA.esm.js +34 -0
- package/dist/chunks/lit-WqMxC_PA.esm.js.map +1 -0
- package/dist/chunks/loading-template-DG4lkIIc.esm.js +2 -0
- package/dist/chunks/{loading-template-t4fFsYtr.esm.js.map → loading-template-DG4lkIIc.esm.js.map} +1 -1
- package/dist/chunks/{localize-7sMSg1W9.esm.js → localize-Btu9xYcE.esm.js} +6 -6
- package/dist/chunks/{localize-7sMSg1W9.esm.js.map → localize-Btu9xYcE.esm.js.map} +1 -1
- package/dist/chunks/{localize-OiRewTgu.esm.js → localize-C25pEGnx.esm.js} +6 -6
- package/dist/chunks/{localize-OiRewTgu.esm.js.map → localize-C25pEGnx.esm.js.map} +1 -1
- package/dist/chunks/lodash-7H4x2457.esm.js +2 -0
- package/dist/chunks/lodash-7H4x2457.esm.js.map +1 -0
- package/dist/chunks/order-page-BbrDKYmJ.esm.js +2 -0
- package/dist/chunks/order-page-BbrDKYmJ.esm.js.map +1 -0
- package/dist/chunks/{order-page-dlXIs0gJ.esm.d.ts → order-page-Cerye00Q.esm.d.ts} +19 -7
- package/dist/chunks/order-page-stMlaqKK.esm.js +2 -0
- package/dist/chunks/order-page-stMlaqKK.esm.js.map +1 -0
- package/dist/chunks/{progress-bar-PMU_xI3L.esm.js → progress-bar-DF7UuuHb.esm.js} +4 -4
- package/dist/chunks/{progress-bar-PMU_xI3L.esm.js.map → progress-bar-DF7UuuHb.esm.js.map} +1 -1
- package/dist/chunks/promo-pill-label-CbW_Vcru.esm.js +16 -0
- package/dist/chunks/{promo-pill-label-P1X4xeAx.esm.js.map → promo-pill-label-CbW_Vcru.esm.js.map} +1 -1
- package/dist/chunks/{promo-types-aQ_hre6t.esm.d.ts → promo-types-C1unMpo2.esm.d.ts} +1 -1
- package/dist/chunks/{promoManager--3WXq4at.esm.js → promoManager-B9cTR1R3.esm.js} +2 -2
- package/dist/chunks/{promoManager--3WXq4at.esm.js.map → promoManager-B9cTR1R3.esm.js.map} +1 -1
- package/dist/chunks/{promoManager-YUzbMtwY.esm.js → promoManager-fl54hq13.esm.js} +2 -2
- package/dist/chunks/{promoManager-YUzbMtwY.esm.js.map → promoManager-fl54hq13.esm.js.map} +1 -1
- package/dist/chunks/{responsive-2lC2Wrtg.esm.js → responsive-BR8qUfBa.esm.js} +2 -2
- package/dist/chunks/{responsive-2lC2Wrtg.esm.js.map → responsive-BR8qUfBa.esm.js.map} +1 -1
- package/dist/chunks/routes-CAhDCFDX.esm.js +2 -0
- package/dist/chunks/{routes-o-phF_L1.esm.js.map → routes-CAhDCFDX.esm.js.map} +1 -1
- package/dist/chunks/routes-pcL-CUiQ.esm.js +2 -0
- package/dist/chunks/{routes-YPOoVIR2.esm.js.map → routes-pcL-CUiQ.esm.js.map} +1 -1
- package/dist/chunks/{share-button-hDn8fnBI.esm.d.ts → share-button-B9hpxBVr.esm.d.ts} +6 -1
- package/dist/chunks/share-button-BYVId0-U.esm.js +2 -0
- package/dist/chunks/share-button-BYVId0-U.esm.js.map +1 -0
- package/dist/chunks/share-button-BvUcpOcx.esm.js +167 -0
- package/dist/chunks/share-button-BvUcpOcx.esm.js.map +1 -0
- package/dist/chunks/share-button-C-DXj68Z.esm.js +2 -0
- package/dist/chunks/share-button-C-DXj68Z.esm.js.map +1 -0
- package/dist/chunks/share-button-CtklpZOO.esm.js +167 -0
- package/dist/chunks/share-button-CtklpZOO.esm.js.map +1 -0
- package/dist/chunks/{update-cart-UuMHYehB.esm.js → update-cart-BLsw_Faz.esm.js} +2 -2
- package/dist/chunks/{update-cart-UuMHYehB.esm.js.map → update-cart-BLsw_Faz.esm.js.map} +1 -1
- package/dist/chunks/{update-cart-JO4fuiim.esm.d.ts → update-cart-NiToHHJH.esm.d.ts} +2 -2
- package/dist/chunks/{update-cart-mNsQ9K-k.esm.js → update-cart-ciJaz8li.esm.js} +2 -2
- package/dist/chunks/{update-cart-mNsQ9K-k.esm.js.map → update-cart-ciJaz8li.esm.js.map} +1 -1
- package/dist/chunks/{vendor-GKiOHg2N.esm.js → vendor-KKSARHWL.esm.js} +2 -2
- package/dist/chunks/{vendor-GKiOHg2N.esm.js.map → vendor-KKSARHWL.esm.js.map} +1 -1
- package/dist/components/beam-partner-logos.d.ts +1 -1
- package/dist/components/beam-partner-logos.esm.js +4 -4
- package/dist/components/beam-partner-logos.esm.js.map +1 -1
- package/dist/components/beam-partner-logos.js +4 -4
- package/dist/components/beam-partner-logos.js.map +1 -1
- package/dist/components/community-impact.d.ts +3 -3
- package/dist/components/community-impact.esm.js +15 -15
- package/dist/components/community-impact.esm.js.map +1 -1
- package/dist/components/community-impact.js +15 -15
- package/dist/components/community-impact.js.map +1 -1
- package/dist/components/cumulative-impact.d.ts +2 -2
- package/dist/components/cumulative-impact.esm.js +8 -8
- package/dist/components/cumulative-impact.esm.js.map +1 -1
- package/dist/components/cumulative-impact.js +8 -8
- package/dist/components/cumulative-impact.js.map +1 -1
- package/dist/components/impact-overview.d.ts +4 -4
- package/dist/components/impact-overview.esm.js +26 -21
- package/dist/components/impact-overview.esm.js.map +1 -1
- package/dist/components/impact-overview.js +26 -21
- package/dist/components/impact-overview.js.map +1 -1
- package/dist/components/index.d.ts +8 -8
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/post-purchase.d.ts +7 -7
- package/dist/components/post-purchase.esm.js +2 -2
- package/dist/components/post-purchase.esm.js.map +1 -1
- package/dist/components/post-purchase.js +2 -2
- package/dist/components/post-purchase.js.map +1 -1
- package/dist/components/product-details-page.d.ts +3 -4
- package/dist/components/product-details-page.esm.js +22 -11
- package/dist/components/product-details-page.esm.js.map +1 -1
- package/dist/components/product-details-page.js +22 -11
- package/dist/components/product-details-page.js.map +1 -1
- package/dist/components/redeem-transaction.d.ts +6 -6
- package/dist/components/redeem-transaction.esm.js +3 -3
- package/dist/components/redeem-transaction.esm.js.map +1 -1
- package/dist/components/redeem-transaction.js +3 -3
- package/dist/components/redeem-transaction.js.map +1 -1
- package/dist/components/select-nonprofit.d.ts +6 -6
- package/dist/components/select-nonprofit.esm.js +89 -89
- package/dist/components/select-nonprofit.esm.js.map +1 -1
- package/dist/components/select-nonprofit.js +89 -89
- package/dist/components/select-nonprofit.js.map +1 -1
- package/dist/components/select-subscription-nonprofit.d.ts +3 -3
- package/dist/components/select-subscription-nonprofit.esm.js +13 -13
- package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
- package/dist/components/select-subscription-nonprofit.js +13 -13
- package/dist/components/select-subscription-nonprofit.js.map +1 -1
- package/dist/components/shopify.d.ts +12 -12
- package/dist/components/shopify.esm.js +1 -1
- package/dist/components/shopify.esm.js.map +1 -1
- package/dist/components/shopify.js +1 -1
- package/dist/components/shopify.js.map +1 -1
- package/dist/components/social-share.d.ts +3 -3
- package/dist/components/social-share.esm.js +3 -3
- package/dist/components/social-share.esm.js.map +1 -1
- package/dist/components/social-share.js +3 -3
- package/dist/components/social-share.js.map +1 -1
- package/dist/components/subscription-impact.d.ts +4 -4
- package/dist/components/subscription-impact.esm.js +27 -25
- package/dist/components/subscription-impact.esm.js.map +1 -1
- package/dist/components/subscription-impact.js +27 -25
- package/dist/components/subscription-impact.js.map +1 -1
- package/dist/components/subscription-management.d.ts +7 -7
- package/dist/components/subscription-management.esm.js +9 -9
- package/dist/components/subscription-management.esm.js.map +1 -1
- package/dist/components/subscription-management.js +9 -9
- package/dist/components/subscription-management.js.map +1 -1
- package/dist/index.d.ts +22 -22
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/integrations/beam.d.ts +1 -1
- package/dist/integrations/beam.esm.js +1 -1
- package/dist/integrations/beam.esm.js.map +1 -1
- package/dist/integrations/beam.js +1 -1
- package/dist/integrations/beam.js.map +1 -1
- package/dist/integrations/cart.d.ts +4 -4
- package/dist/integrations/cart.esm.js +1 -1
- package/dist/integrations/cart.js +1 -1
- package/dist/integrations/index.d.ts +18 -18
- package/dist/integrations/index.esm.js +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/logs.d.ts +2 -2
- package/dist/integrations/logs.esm.js +1 -1
- package/dist/integrations/logs.js +1 -1
- package/dist/integrations/promoManager.d.ts +1 -1
- package/dist/integrations/promoManager.esm.js +1 -1
- package/dist/integrations/promoManager.js +1 -1
- package/dist/integrations/session.d.ts +1 -1
- package/dist/integrations/session.esm.js +1 -1
- package/dist/integrations/session.js +1 -1
- package/dist/integrations/shopify.d.ts +10 -10
- package/dist/integrations/shopify.esm.js +1 -1
- package/dist/integrations/shopify.js +1 -1
- package/dist/integrations/statsig.d.ts +1 -1
- package/dist/integrations/statsig.esm.js +2 -2
- package/dist/integrations/statsig.esm.js.map +1 -1
- package/dist/integrations/statsig.js +2 -2
- package/dist/integrations/statsig.js.map +1 -1
- package/dist/integrations/utils.d.ts +6 -6
- package/dist/integrations/utils.esm.js +1 -1
- package/dist/integrations/utils.js +1 -1
- package/dist/react/beam-partner-logos.d.ts +1 -1
- package/dist/react/beam-partner-logos.esm.js +1 -1
- package/dist/react/beam-partner-logos.js +1 -1
- package/dist/react/community-impact.d.ts +3 -3
- package/dist/react/community-impact.esm.js +1 -1
- package/dist/react/community-impact.js +1 -1
- package/dist/react/cumulative-impact.d.ts +2 -2
- package/dist/react/cumulative-impact.esm.js +1 -1
- package/dist/react/cumulative-impact.js +1 -1
- package/dist/react/impact-overview.d.ts +4 -4
- package/dist/react/impact-overview.esm.js +1 -1
- package/dist/react/impact-overview.esm.js.map +1 -1
- package/dist/react/impact-overview.js +1 -1
- package/dist/react/impact-overview.js.map +1 -1
- package/dist/react/index.d.ts +10 -10
- package/dist/react/index.esm.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/post-purchase.d.ts +7 -7
- package/dist/react/post-purchase.esm.js +1 -1
- package/dist/react/post-purchase.esm.js.map +1 -1
- package/dist/react/post-purchase.js +1 -1
- package/dist/react/post-purchase.js.map +1 -1
- package/dist/react/product-details-page.d.ts +3 -3
- package/dist/react/product-details-page.esm.js +1 -1
- package/dist/react/product-details-page.js +1 -1
- package/dist/react/redeem-transaction.d.ts +8 -8
- package/dist/react/redeem-transaction.esm.js +1 -1
- package/dist/react/redeem-transaction.js +1 -1
- package/dist/react/select-nonprofit.d.ts +8 -8
- package/dist/react/select-nonprofit.esm.js +1 -1
- package/dist/react/select-nonprofit.js +1 -1
- package/dist/react/select-subscription-nonprofit.d.ts +7 -7
- package/dist/react/select-subscription-nonprofit.esm.js +1 -1
- package/dist/react/select-subscription-nonprofit.js +1 -1
- package/dist/react/social-share.d.ts +3 -3
- package/dist/react/social-share.esm.js +1 -1
- package/dist/react/social-share.esm.js.map +1 -1
- package/dist/react/social-share.js +1 -1
- package/dist/react/social-share.js.map +1 -1
- package/dist/react/subscription-impact.d.ts +4 -4
- package/dist/react/subscription-impact.esm.js +1 -1
- package/dist/react/subscription-impact.js +1 -1
- package/dist/react/subscription-management.d.ts +7 -7
- package/dist/react/subscription-management.esm.js +1 -1
- package/dist/react/subscription-management.js +1 -1
- package/dist/utils/beam-errors.d.ts +1 -1
- package/dist/utils/beam-errors.esm.js +1 -1
- package/dist/utils/beam-errors.js +1 -1
- package/dist/utils/cart.esm.js +1 -1
- package/dist/utils/cart.js +1 -1
- package/dist/utils/cookies.esm.js +1 -1
- package/dist/utils/cookies.esm.js.map +1 -1
- package/dist/utils/cookies.js +1 -1
- package/dist/utils/cookies.js.map +1 -1
- package/dist/utils/debounce.esm.js +1 -1
- package/dist/utils/debounce.js +1 -1
- package/dist/utils/events.d.ts +5 -5
- package/dist/utils/events.esm.js +1 -1
- package/dist/utils/events.js +1 -1
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/index.esm.js +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/is-equal.esm.js +1 -1
- package/dist/utils/is-equal.js +1 -1
- package/dist/utils/local-storage.esm.js +1 -1
- package/dist/utils/local-storage.js +1 -1
- package/dist/utils/memoize-last.esm.js +1 -1
- package/dist/utils/memoize-last.esm.js.map +1 -1
- package/dist/utils/memoize-last.js +1 -1
- package/dist/utils/memoize-last.js.map +1 -1
- package/dist/utils/network-listeners.esm.js +1 -1
- package/dist/utils/network-listeners.esm.js.map +1 -1
- package/dist/utils/network-listeners.js +1 -1
- package/dist/utils/network-listeners.js.map +1 -1
- package/dist/utils/promoManager.d.ts +3 -3
- package/dist/utils/promoManager.esm.js +1 -1
- package/dist/utils/promoManager.js +1 -1
- package/dist/utils/remote-session.esm.js +1 -1
- package/dist/utils/remote-session.js +1 -1
- package/dist/utils/wait-for-element.esm.js +1 -1
- package/dist/utils/wait-for-element.js +1 -1
- package/package.json +4 -4
- package/dist/chunks/_share-dialog-dependencies-RmYWlyJ0.esm.js +0 -2
- package/dist/chunks/_share-dialog-dependencies-RmYWlyJ0.esm.js.map +0 -1
- package/dist/chunks/_share-dialog-dependencies-yCBFjXxQ.esm.js +0 -2
- package/dist/chunks/_share-dialog-dependencies-yCBFjXxQ.esm.js.map +0 -1
- package/dist/chunks/cart-contents-h60geKWa.esm.js +0 -2
- package/dist/chunks/enforce-config-S8EGgEnO.esm.js +0 -3
- package/dist/chunks/enforce-config-l-tNb_z7.esm.js +0 -3
- package/dist/chunks/index-2qmtuEV_.esm.d.ts +0 -15
- package/dist/chunks/index-44clOvXJ.esm.js +0 -2
- package/dist/chunks/index-44clOvXJ.esm.js.map +0 -1
- package/dist/chunks/index-B-9JPaCH.esm.js +0 -2
- package/dist/chunks/index-B-9JPaCH.esm.js.map +0 -1
- package/dist/chunks/index-CNVMNDM4.esm.js +0 -2
- package/dist/chunks/index-CNVMNDM4.esm.js.map +0 -1
- package/dist/chunks/index-E8H5A7Qq.esm.js.map +0 -1
- package/dist/chunks/index-FQExZDX9.esm.js.map +0 -1
- package/dist/chunks/index-PiMq5a49.esm.js.map +0 -1
- package/dist/chunks/index-UHchr4H_.esm.js +0 -2
- package/dist/chunks/index-UHchr4H_.esm.js.map +0 -1
- package/dist/chunks/index-XCMf22lv.esm.js.map +0 -1
- package/dist/chunks/index-dLnZQZlT.esm.js.map +0 -1
- package/dist/chunks/index-f7fp9odj.esm.js.map +0 -1
- package/dist/chunks/index-kFulvjM4.esm.js.map +0 -1
- package/dist/chunks/index-m1LRybiJ.esm.js.map +0 -1
- package/dist/chunks/index-smGc5rsi.esm.js +0 -2
- package/dist/chunks/index-smGc5rsi.esm.js.map +0 -1
- package/dist/chunks/index-wz6Yfo37.esm.js +0 -2
- package/dist/chunks/index-wz6Yfo37.esm.js.map +0 -1
- package/dist/chunks/lit-iNN5L_Qk.esm.js +0 -34
- package/dist/chunks/lit-iNN5L_Qk.esm.js.map +0 -1
- package/dist/chunks/loading-template-t4fFsYtr.esm.js +0 -2
- package/dist/chunks/lodash-P8OIs-at.esm.js +0 -2
- package/dist/chunks/lodash-P8OIs-at.esm.js.map +0 -1
- package/dist/chunks/order-page-WPxvCNLM.esm.js +0 -2
- package/dist/chunks/order-page-WPxvCNLM.esm.js.map +0 -1
- package/dist/chunks/order-page-ZpOf35sP.esm.js +0 -2
- package/dist/chunks/order-page-ZpOf35sP.esm.js.map +0 -1
- package/dist/chunks/promo-pill-label-P1X4xeAx.esm.js +0 -16
- package/dist/chunks/routes-YPOoVIR2.esm.js +0 -2
- package/dist/chunks/routes-o-phF_L1.esm.js +0 -2
- package/dist/chunks/share-button-EsUPw38-.esm.js +0 -163
- package/dist/chunks/share-button-EsUPw38-.esm.js.map +0 -1
- package/dist/chunks/share-button-SNvuFDC9.esm.js +0 -2
- package/dist/chunks/share-button-SNvuFDC9.esm.js.map +0 -1
- package/dist/chunks/share-button-r0y-bbwR.esm.js +0 -163
- package/dist/chunks/share-button-r0y-bbwR.esm.js.map +0 -1
- package/dist/chunks/shoelace-components-PB22pjfM.esm.js +0 -2
- package/dist/chunks/shoelace-components-PB22pjfM.esm.js.map +0 -1
- package/dist/chunks/shoelace-components-lr4iB8kL.esm.js +0 -2
- package/dist/chunks/shoelace-components-lr4iB8kL.esm.js.map +0 -1
- /package/dist/chunks/{beam-errors-bKCZlkvr.esm.d.ts → beam-errors-CCe004HS.esm.d.ts} +0 -0
- /package/dist/chunks/{index-EGiUuWe-.esm.d.ts → index-C-hPf29c.esm.d.ts} +0 -0
- /package/dist/chunks/{index-hn6JhG_w.esm.d.ts → index-DXj15KHe.esm.d.ts} +0 -0
- /package/dist/chunks/{index-mTXm0DPh.esm.d.ts → index-DbaDUPup.esm.d.ts} +0 -0
- /package/dist/chunks/{openapi-spec-bxGNhNMa.esm.d.ts → openapi-spec-VAt3phhg.esm.d.ts} +0 -0
- /package/dist/chunks/{progress-bar-0VS_AmEf.esm.d.ts → progress-bar-CveZ8E6Q.esm.d.ts} +0 -0
- /package/dist/chunks/{promo-pill-label-3bA1z-la.esm.d.ts → promo-pill-label-BXRqZHET.esm.d.ts} +0 -0
- /package/dist/chunks/{routes-lGXt7ttd.esm.d.ts → routes-DDRd747e.esm.d.ts} +0 -0
- /package/dist/chunks/{types-aju0qrRe.esm.d.ts → types-C7gqAyyH.esm.d.ts} +0 -0
- /package/dist/chunks/{types-IbMT3Nwn.esm.d.ts → types-CPxMwnoR.esm.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-subscription-nonprofit.esm.js","sources":["../../src/shared/fragments/checkbox.ts","../../src/components/select-subscription-nonprofit/strings.ts","../../src/components/select-subscription-nonprofit/index.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { styleMap } from \"lit/directives/style-map.js\";\n\nexport const _checkbox = ({ height = \"1em\", width = \"1em\" } = {}) =>\n html`\n <svg\n style=\"${styleMap({ height, width, position: \"relative\", bottom: \"0\" })}\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 78.369 78.369\"\n >\n <g>\n <path\n d=\"M78.049,19.015L29.458,67.606c-0.428,0.428-1.121,0.428-1.548,0L0.32,40.015c-0.427-0.426-0.427-1.119,0-1.547l6.704-6.704\n c0.428-0.427,1.121-0.427,1.548,0l20.113,20.112l41.113-41.113c0.429-0.427,1.12-0.427,1.548,0l6.703,6.704\n C78.477,17.894,78.477,18.586,78.049,19.015z\"\n style=\"fill: currentColor\"\n />\n </g>\n </svg>\n `;\n","export const strings = {\n en: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n fr: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n de: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n es: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n it: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n pl: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n};\n","import { css, html, LitElement, PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport debounce from \"lodash-es/debounce\";\nimport { postChainEligibleNonprofitsForCart, updateSubscription } from \"../../api-sdk/v3/routes\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { progressBarConfigDefaults } from \"../../shared/components/progress-bar\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { BeamError, MissingConfig } from \"../../utils/beam-errors\";\nimport { createScopedLocalStorage } from \"../../utils/local-storage\";\nimport { cssCardGrid } from \"../../shared/fragments/css-card-grid\";\nimport { _checkbox } from \"../../shared/fragments/checkbox\";\nimport { BeamNonprofitSelectEvent } from \"../../utils/events\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { TNumericId } from \"../../shared/types\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { strings } from \"./strings\";\nimport \"../../shared/components/progress-bar\";\nimport \"../beam-partner-logos\";\n\ninterface SubscriptionRequiredConfig {\n apiKey: string;\n subscriptionId: string;\n storeId: TNumericId;\n}\nconst cacheTtl = 2 * 60 * 60 * 1000;\nexport class BeamSelectSubscriptionNonprofit extends LitElement {\n static tagName = \"beam-select-subscription-nonprofit\";\n\n @property({ type: String }) public baseUrl: string = DEFAULT_BASE_URL;\n @property({ type: String }) public apiKey?: SubscriptionRequiredConfig[\"apiKey\"];\n @property({ type: String }) public subscriptionId?: SubscriptionRequiredConfig[\"subscriptionId\"];\n @property({ type: Number }) public storeId?: SubscriptionRequiredConfig[\"storeId\"];\n @property({ type: String }) public countryCode?: string;\n @property({ type: String }) public postalCode?: string;\n @property({ type: Number, reflect: true }) public selectedNonprofitId?: TNumericId;\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n @property({ type: Boolean }) public draftConfig = false;\n @property({ type: Boolean }) public debug = false;\n @state() private isMobile = window.innerWidth < 768;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n private getChainNonprofits = async () => {\n if (!enforceConfig<SubscriptionRequiredConfig>([\"apiKey\", \"subscriptionId\", \"storeId\"], this)) {\n throw new MissingConfig();\n }\n const res = await postChainEligibleNonprofitsForCart({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n requestBody: {\n storeId: this.storeId,\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n widgetName: \"select-subscription-nonprofit\",\n version: \"1.0.0\",\n lang: this.configLang,\n options: {\n config: {\n draftConfig: this.draftConfig,\n },\n },\n },\n });\n\n this.localStorage.setItemJson(\"chainNonprofits\", {\n createdAt: new Date(),\n data: res,\n });\n\n return res;\n };\n\n private updateNonprofitIdForSubscription = async ({ selectedNonprofitId }: { selectedNonprofitId: TNumericId }) => {\n if (!this.subscriptionId) {\n return null;\n }\n\n if (!enforceConfig<SubscriptionRequiredConfig>([\"apiKey\", \"subscriptionId\"], this)) {\n throw new MissingConfig();\n }\n\n return updateSubscription({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n requestBody: {\n remoteSubscriptionId: this.subscriptionId,\n nonprofitId: selectedNonprofitId,\n selectionMethod: \"subscription_management_widget\",\n },\n });\n };\n\n private nonprofitListDataController = new AsyncController<typeof this.getChainNonprofits>(\n this,\n this.getChainNonprofits\n );\n\n private subscriptionUpdateDataController = new AsyncController<typeof this.updateNonprofitIdForSubscription>(\n this,\n this.updateNonprofitIdForSubscription\n );\n\n private localStorage = createScopedLocalStorage(this as LitElement & SubscriptionRequiredConfig);\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\"resize\", this.evaluateBreakPoints);\n }\n\n async firstUpdated(_changedProperties: PropertyValues) {\n await this.restoreStateFromCache();\n }\n\n async updated(previousPropertyValues: PropertyValues) {\n // Reload nonprofit list on change of any of these props:\n // Also fires on first load as props go from undefined => value\n const requireNewDataProps = [\"baseUrl\", \"storeId\", \"apiKey\", \"countryCode\", \"postalCode\", \"lang\"];\n for (const prop of requireNewDataProps) {\n if (previousPropertyValues.has(prop)) {\n await this.nonprofitListDataController.exec();\n break;\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n\n private restoreStateFromCache() {\n if (!enforceConfig<SubscriptionRequiredConfig>([\"apiKey\"], this)) throw new MissingConfig();\n\n try {\n // try to restore nonprofit list if we have data and it's not too old\n // list will continue to refresh async and replace this data when ready\n const { createdAt = 0, data } =\n this.localStorage.getItemJson<{ createdAt: string; data: any }>(\"chainNonprofits\") || {};\n if (new Date(createdAt).valueOf() + cacheTtl > new Date().valueOf()) {\n this.nonprofitListDataController.data = data;\n this.nonprofitListDataController.loading = false;\n }\n } catch (err) {\n // ignore cache retrieval error and continue to fetch data\n }\n }\n\n /**\n * Factory for selection event handler\n *\n * Nonprofit selector implements radio-button semantics:\n * * If nothing is selected, tabbing into selector selects first card\n * * Arrow keys changes focus between cards, but doesn't select\n * * Enter/Space sets selection\n * * If a nonprofit is selected, arrow keys change focus AND selection\n * * Click sets selection\n * @param {number} id\n * @param {number} index\n * @param {{id: number}[]} nonprofits\n * @returns {(evt: Event) => void}\n */\n private makeHandleSelect =\n (id: number, index: number, nonprofits: { nonprofit: { id: number } }[]): ((event: Event) => void) =>\n async (event: Event) => {\n if (!this.allowChange) return;\n\n const currentId = this.selectedNonprofitId;\n if (event instanceof KeyboardEvent) {\n let nextFocus = null;\n switch (event.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n if (index === 0) {\n nextFocus = nonprofits[nonprofits.length - 1];\n } else {\n nextFocus = nonprofits[index - 1];\n }\n event.preventDefault();\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n if (index === nonprofits.length - 1) {\n nextFocus = nonprofits[0];\n } else {\n nextFocus = nonprofits[index + 1];\n }\n event.preventDefault();\n break;\n case \"Enter\":\n case \" \":\n event.preventDefault();\n break; // continue to toggle-selection block below\n default:\n return;\n }\n if (nextFocus) {\n const focusTarget = this.renderRoot.querySelector(`[data-value=\"${nextFocus.nonprofit.id}\"]`) as HTMLElement;\n if (focusTarget !== null) {\n focusTarget.tabIndex = 0;\n focusTarget.focus();\n }\n return;\n }\n }\n // Handle selection with click or Enter/Space key\n const targetEl = event.currentTarget;\n if (targetEl instanceof HTMLElement) {\n if (currentId === id) {\n // this[\"selected-nonprofit-id\"] = undefined; // unset (not supported)\n return; // no API call or localStorage change needed\n } else {\n this.selectedNonprofitId = id;\n }\n }\n };\n\n get allowChange() {\n // Disallow change if already submitted\n return this.subscriptionUpdateDataController.data == null && !this.subscriptionUpdateDataController.loading;\n }\n\n get allowSubmit() {\n // Disabled if no nonprofit has been selected yet or if submission was already received\n return Boolean(this.selectedNonprofitId && this.allowChange);\n }\n\n handleSubmit = async () => {\n const { selectedNonprofitId } = this;\n if (!this.allowSubmit || selectedNonprofitId == null) return;\n await this.subscriptionUpdateDataController.exec({ selectedNonprofitId });\n\n const selectedNonprofit = this.nonprofitListDataController?.data?.nonprofits.find(\n (np) => np.nonprofit.id === selectedNonprofitId\n );\n\n this.dispatchEvent(\n new BeamNonprofitSelectEvent({\n selectedNonprofitId,\n nonprofitName: selectedNonprofit?.nonprofit.name,\n source: WIDGET_NAMES.select_subscription_nonprofit,\n })\n );\n };\n\n evaluateBreakPoints = debounce(\n () => {\n this.isMobile = window.innerWidth < 768;\n },\n 50,\n { maxWait: 50, leading: true }\n );\n\n public get cssVariables() {\n const defaults = {\n ...progressBarConfigDefaults,\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontStyle\": \"inherit\",\n \"--beam-fontSize\": \"inherit\",\n \"--beam-textColor\": \"inherit\",\n \"--beam-backgroundColor\": \"inherit\",\n \"--beam-SelectSubscriptionNonprofit-maxWidth\": \"800px\",\n \"--beam-SelectSubscriptionNonprofit-mobile-header-alignItems\": \"center\",\n \"--beam-SelectSubscriptionNonprofit-desktop-header-alignItems\": \"center\",\n \"--beam-SelectSubscriptionNonprofit-headerContainer-padding\": \"2px\",\n \"--beam-SelectSubscriptionNonprofit-title-textAlign\": \"inherit\",\n \"--beam-SelectSubscriptionNonprofit-description-textAlign\": \"center\",\n \"--beam-SelectSubscriptionNonprofit-description-lineHeight\": \"138%\",\n \"--beam-SelectSubscriptionNonprofit-description-marginTop\": \"3px\",\n \"--beam-SelectSubscriptionNonprofit-desktop-description-width\": \"80%\",\n \"--beam-SelectSubscriptionNonprofit-mobile-description-width\": \"90%\",\n \"--beam-SelectSubscriptionNonprofit-options-marginTop\": \"10px\",\n \"--beam-SelectSubscriptionNonprofit-options-padding\": \"10px\",\n \"--beam-SelectSubscriptionNonprofit-options-borderWidth\": \"1px\",\n \"--beam-SelectSubscriptionNonprofit-options-borderColor\": \"transparent\",\n \"--beam-SelectSubscriptionNonprofit-options-borderRadius\": \"8px\",\n \"--beam-SelectSubscriptionNonprofit-options-backgroundColor\": \"#F9FBFB\",\n \"--beam-SelectSubscriptionNonprofit-option-padding\": \"15px\",\n \"--beam-SelectSubscriptionNonprofit-options-hover-backgroundColor\": \"#e1f1ee\",\n \"--beam-SelectSubscriptionNonprofit-options-hover-borderWidth\": \"1px\",\n \"--beam-SelectSubscriptionNonprofit-options-hover-borderColor\": \"#e1f1ee\",\n \"--beam-SelectSubscriptionNonprofit-options-selected-borderWidth\": \"1px\",\n \"--beam-SelectSubscriptionNonprofit-options-selected-borderColor\": \"#e1f1ee\",\n \"--beam-SelectSubscriptionNonprofit-options-selected-backgroundColor\": \"#e1f1ee\",\n \"--beam-SelectSubscriptionNonprofit-options-gap\": \"20px\",\n \"--beam-SelectSubscriptionNonprofit-options-minWidth\": \"250px\",\n \"--beam-SelectSubscriptionNonprofit-options-columnCount\": \"2\",\n \"--beam-SelectSubscriptionNonprofit-options-icon-borderRadius\": \"4px\",\n \"--beam-SelectSubscriptionNonprofit-options-icon-padding\": \"10px\",\n \"--beam-SelectSubscriptionNonprofit-options-image-borderRadius\": \"4px\",\n \"--beam-SelectSubscriptionNonprofit-cardIconContainer-height\": \"100%\",\n \"--beam-SelectSubscriptionNonprofit-iconBackground-width\": \"50px\",\n \"--beam-SelectSubscriptionNonprofit-iconBackground-height\": \"50px\",\n \"--beam-SelectSubscriptionNonprofit-iconBackground-borderRadius\": \"50%\",\n \"--beam-SelectSubscriptionNonprofit-iconBackground-background\": \"#0a323c\",\n \"--beam-SelectSubscriptionNonprofit-icon-height\": \"50px\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-backgroundColor\": \"transparent\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-color\": \"transparent\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-borderColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-selected-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-selected-backgroundColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-selected-borderColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-hover-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-hover-backgroundColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-hover-borderColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-cardStyle\": \"'selected_icon'\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-hover-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-disabled-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-backgroundColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-hover-backgroundColor\": \"#222\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-disabled-backgroundColor\": \"#767676\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-borderColor\": \"#333\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-hover-borderColor\": \"#222\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-disabled-borderColor\": \"#767676\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-fontSize\": \"14px\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-fontWeight\": \"inherit\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-fontFamily\": \"inherit\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-textTransform\": \"none\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-borderRadius\": \"30px\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-padding\": \"10px 30px\",\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-title\", {\n fontSize: \"20px\",\n fontWeight: \"bold\",\n lineHeight: \"120%\",\n textTransform: \"capitalize\",\n color: \"#0a323c\",\n }),\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-descriptionPrefix\", {\n marginTop: \"3px\",\n color: \"#2f302d\",\n fontSize: \"14px\",\n fontWeight: \"bold\",\n fontStyle: \"normal\",\n lineHeight: \"138%\",\n }),\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-description\", {\n color: \"#2f302d\",\n fontSize: \"14px\",\n fontStyle: \"normal\",\n }),\n \"--beam-SelectSubscriptionNonprofit-details-cause-letterSpacing\": \"0.36px\",\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-details-cause\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n color: \"#0a323c\",\n fontStyle: \"normal\",\n lineHeight: \"120%\",\n }),\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-details-description\", {\n fontSize: \"12px\",\n marginTop: \"5px\",\n fontStyle: \"normal\",\n lineHeight: \"140%\",\n fontWeight: \"400\",\n }),\n \"--beam-SelectSubscriptionNonprofit-details-fundingProgress-marginTop\": \"7px\",\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-details-funding-progress-label\", {\n fontSize: \"12px\",\n color: \"#666666\",\n fontWeight: \"400\",\n fontStyle: \"normal\",\n }),\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-boxShadow\": \"0px -20px 20px 0px rgba(0, 0, 0, 0.04)\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-padding\": \"15px 0px 45px\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-backgroundColor\": \"white\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-marginLeft\": \"-15px\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-marginRight\": \"-15px\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-width\": \"auto\",\n };\n\n const remoteConfig = this.nonprofitListDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n css`\n :host {\n display: block;\n max-width: var(--beam-SelectSubscriptionNonprofit-maxWidth);\n font-family: var(--beam-fontFamily);\n font-style: var(--beam-fontStyle);\n font-size: var(--beam-fontSize);\n background-color: var(--beam-backgroundColor);\n color: var(--beam-textColor);\n word-break: normal;\n }\n\n .widget-container-mobile {\n position: relative;\n }\n\n .header-container {\n align-items: flex-start;\n justify-content: space-between;\n padding: var(--beam-SelectSubscriptionNonprofit-headerContainer-padding);\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .header-container-mobile {\n align-items: var(--beam-SelectSubscriptionNonprofit-mobile-header-alignItems);\n }\n\n .header-container-desktop {\n align-items: var(--beam-SelectSubscriptionNonprofit-desktop-header-alignItems);\n }\n\n .title {\n text-align: var(--beam-SelectSubscriptionNonprofit-title-textAlign);\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-title\")};\n }\n\n .description-container {\n text-align: var(--beam-SelectSubscriptionNonprofit-description-textAlign);\n line-height: var(--beam-SelectSubscriptionNonprofit-description-lineHeight);\n margin-top: var(--beam-SelectSubscriptionNonprofit-description-marginTop);\n }\n\n .description-prefix {\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-descriptionPrefix\")};\n }\n\n .description {\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-description\")};\n }\n\n .description-desktop {\n width: var(--beam-SelectSubscriptionNonprofit-desktop-description-width);\n }\n\n .description-mobile {\n width: var(--beam-SelectSubscriptionNonprofit-mobile-description-width);\n }\n\n .root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n flex-shrink: 0;\n }\n\n .options {\n margin-top: var(--beam-SelectSubscriptionNonprofit-options-marginTop);\n padding: var(--beam-SelectSubscriptionNonprofit-options-padding);\n }\n\n .card-icon-container {\n height: var(--beam-SelectSubscriptionNonprofit-cardIconContainer-height);\n flex: 0;\n flex-direction: column;\n }\n\n .icon-background {\n width: var(--beam-SelectSubscriptionNonprofit-iconBackground-width);\n height: var(--beam-SelectSubscriptionNonprofit-iconBackground-height);\n border-radius: var(--beam-SelectSubscriptionNonprofit-iconBackground-borderRadius);\n overflow: hidden;\n background: var(--beam-SelectSubscriptionNonprofit-iconBackground-background);\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .card-icon {\n height: var(--beam-SelectSubscriptionNonprofit-icon-height);\n display: block;\n padding: var(--beam-SelectSubscriptionNonprofit-options-icon-padding);\n border-radius: var(--beam-SelectSubscriptionNonprofit-options-icon-borderRadius);\n }\n\n .card-image-container {\n height: 100%;\n flex: 4;\n display: flex;\n flex-direction: column;\n }\n\n .card-image {\n flex: 1;\n height: auto;\n width: 100%;\n object-fit: cover;\n border-radius: var(--beam-SelectSubscriptionNonprofit-options-image-borderRadius);\n }\n\n .option {\n /* outline is used to prevent layer shift if changing border width */\n outline: var(--beam-SelectSubscriptionNonprofit-options-borderWidth) solid\n var(--beam-SelectSubscriptionNonprofit-options-borderColor);\n border-radius: var(--beam-SelectSubscriptionNonprofit-options-borderRadius);\n background-color: var(--beam-SelectSubscriptionNonprofit-options-backgroundColor);\n cursor: pointer;\n transition: border-color 0.2s, background-color 0.2s, outline 0.2s;\n display: flex;\n gap: 15px;\n padding: var(--beam-SelectSubscriptionNonprofit-option-padding);\n }\n\n .options.cardGrid {\n order: 3;\n }\n\n .option:not(.isDisabled):focus-visible,\n .option:not(.isDisabled):hover,\n .option:not(.isSelected):focus-visible,\n .option:not(.isSelected):hover {\n background-color: var(--beam-SelectSubscriptionNonprofit-options-hover-backgroundColor);\n outline: var(--beam-SelectSubscriptionNonprofit-options-hover-borderWidth) solid\n var(--beam-SelectSubscriptionNonprofit-options-hover-borderColor);\n }\n\n .option.isDisabled {\n cursor: not-allowed;\n }\n\n .option.isSelected {\n outline: var(--beam-SelectSubscriptionNonprofit-options-selected-borderWidth) solid\n var(--beam-SelectSubscriptionNonprofit-options-selected-borderColor);\n background-color: var(--beam-SelectSubscriptionNonprofit-options-selected-backgroundColor);\n }\n\n .option.isSelected:focus-visible,\n .option.isSelected:hover {\n outline: var(--beam-SelectSubscriptionNonprofit-options-selected-borderWidth) solid\n var(--beam-SelectSubscriptionNonprofit-options-selected-borderColor);\n }\n\n .option .checkbox {\n margin-left: 5px;\n float: right;\n padding: 2px;\n border-radius: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-width: 1px;\n border-style: solid;\n transition: background-color 0.2s, color 0.2s, border-color 0.2s;\n color: var(--beam-SelectSubscriptionNonprofit-checkmark-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-checkmark-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-checkmark-borderColor);\n }\n\n .option.isSelected .checkbox,\n .option.isSelected:focus-visible .checkbox,\n .option.isSelected:hover .checkbox {\n color: var(--beam-SelectSubscriptionNonprofit-checkmark-selected-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-checkmark-selected-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-checkmark-selected-borderColor);\n }\n\n .option:not(.isSelected):focus-visible .checkbox,\n .option:not(.isSelected):hover .checkbox {\n color: var(--beam-SelectSubscriptionNonprofit-checkmark-hover-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-checkmark-hover-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-checkmark-hover-borderColor);\n }\n\n .card-details-container {\n flex: 1 1 67%;\n height: 100%;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-content: stretch;\n align-items: stretch;\n position: relative;\n }\n\n .details-cause {\n flex: 0 1;\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-details-cause\")};\n letter-spacing: var(--beam-SelectSubscriptionNonprofit-details-cause-letterSpacing);\n }\n\n .details-description {\n flex: 1 1;\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-details-description\")}\n }\n\n .details-description .nonprofitName {\n font-weight: var(--beam-SelectSubscriptionNonprofit-details-nonprofitName-fontWeight);\n font-style: var(--beam-SelectSubscriptionNonprofit-details-nonprofitName-fontStyle);\n }\n\n .card-progress-bar {\n display: flex;\n margin-top: var(--beam-SelectSubscriptionNonprofit-details-fundingProgress-marginTop);\n align-items: center;\n }\n\n .details-funding-progress-label {\n white-space: nowrap;\n text-align: right;\n flex: 0 1;\n margin-left: 15px;\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-details-funding-progress-label\")}\n }\n\n .footer {\n text-align: center;\n }\n\n .sticky-footer {\n position: sticky;\n background: var(--beam-SelectSubscriptionNonprofit-stickyFooter-backgroundColor);\n bottom: 0;\n box-shadow: var(--beam-SelectSubscriptionNonprofit-stickyFooter-boxShadow);\n padding: var(--beam-SelectSubscriptionNonprofit-stickyFooter-padding);\n left: 0;\n right: 0;\n margin-left: var(--beam-SelectSubscriptionNonprofit-stickyFooter-marginLeft);\n margin-right: var(--beam-SelectSubscriptionNonprofit-stickyFooter-marginRight);\n width: var(--beam-SelectSubscriptionNonprofit-stickyFooter-width);\n }\n\n .footer-desktop {\n margin-top: 20px;\n }\n\n .submitButton {\n color: var(--beam-SelectSubscriptionNonprofit-submitButton-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-submitButton-backgroundColor);\n border: 1px solid var(--beam-SelectSubscriptionNonprofit-submitButton-borderColor);\n font-size: var(--beam-SelectSubscriptionNonprofit-submitButton-fontSize);\n font-weight: var(--beam-SelectSubscriptionNonprofit-submitButton-fontWeight);\n font-family: var(--beam-SelectSubscriptionNonprofit-submitButton-fontFamily);\n text-transform: var(--beam-SelectSubscriptionNonprofit-submitButton-textTransform);\n border-radius: var(--beam-SelectSubscriptionNonprofit-submitButton-borderRadius);\n padding: var(--beam-SelectSubscriptionNonprofit-submitButton-padding);\n transition: background-color 0.2s, border-color 0.2s, color 0.2s;\n cursor: pointer;\n display: inline-flex;\n width: 234.173px;\n justify-content: center;\n align-items: center;\n gap: 10px;\n flex-shrink: 0;\n }\n\n .submitButton:not(.isDisabled):focus-visible,\n .submitButton:not(.isDisabled):hover {\n background-color: var(--beam-SelectSubscriptionNonprofit-submitButton-hover-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-submitButton-hover-borderColor);\n color: var(--beam-SelectSubscriptionNonprofit-submitButton-hover-color);\n }\n\n .submitButton.isDisabled {\n color: var(--beam-SelectSubscriptionNonprofit-submitButton-disabled-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-submitButton-disabled-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-submitButton-disabled-borderColor);\n cursor: not-allowed;\n }\n\n .hideStickyFooter {\n display: none;\n }\n `,\n cssCardGrid({\n gap: \"var(--beam-SelectSubscriptionNonprofit-options-gap)\",\n itemMinWidth: \"var(--beam-SelectSubscriptionNonprofit-options-minWidth)\",\n columnCount: \"var(--beam-SelectSubscriptionNonprofit-options-columnCount)\",\n }),\n ];\n\n protected render() {\n const { selectedNonprofitId } = this;\n const { data, loading } = this.nonprofitListDataController;\n\n if (loading && !data) {\n return _loading();\n }\n if (this.nonprofitListDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.nonprofitListDataController.error });\n }\n return \"\";\n }\n if (this.subscriptionUpdateDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.subscriptionUpdateDataController.error });\n }\n // do not show error screen for interactive errors by default\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new BeamError(\"No data\") });\n }\n return \"\";\n }\n const nonprofits = data?.nonprofits || [];\n const selectedNonprofit = nonprofits.find((np) => np.nonprofit.id === selectedNonprofitId) || null;\n // changes images in widget to icons\n const cardStyle = this.cssVariables[\"--beam-SelectSubscriptionNonprofit-cardStyle\"];\n const displayIcon = cardStyle === \"'icon'\" || cardStyle === \"'selected_icon'\";\n\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div class=\"widget-container ${this.isMobile ? \"widget-container-mobile\" : \"\"}\">\n <div class=\"header-container ${this.isMobile ? \"header-container-mobile\" : \"header-container-desktop\"}\">\n <h3 class=\"title\" part=\"title\" id=\"beam-SelectSubscriptionNonprofit-title\">\n ${localizeUserString(this.configLang, data?.config?.web?.title || \"\") ||\n strings[this.configLang].ctaTitle()}\n </h3>\n <div\n class=\"description-container ${this.isMobile\n ? \"header-container-mobile description-mobile\"\n : \"header-container-desktop description-desktop\"}\"\n >\n <span class=\"description\" part=\"description\">\n ${localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"ctaMessage\"] || \"\") ||\n strings[this.configLang].ctaMessage()}\n </span>\n <span class=\"description-prefix\" part=\"description\">\n ${localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"ctaMessagePrefix\"] || \"\") ||\n strings[this.configLang].ctaMessagePrefix()}\n </span>\n </div>\n </div>\n <div class=\"root\">\n <div\n tabindex=\"-1\"\n class=\"options cardGrid\"\n part=\"options\"\n role=\"radiogroup\"\n aria-labelledby=\"beam-SelectSubscriptionNonprofit-title\"\n ?aria-disabled=${!this.allowChange}\n >\n ${repeat(\n nonprofits,\n (i) => i.nonprofit.id,\n (np, index) => {\n const isSelected = selectedNonprofitId === np.nonprofit.id;\n const isFocusable = isSelected || (selectedNonprofit == null && index === 0);\n const unselectedIcon = np.nonprofit.causeIconUrl;\n const selectedIcon = np.nonprofit.causeIconSelectedUrl;\n const cardImage = np.imageUrl;\n const iconImage = cardStyle === \"'selected_icon'\" ? selectedIcon : unselectedIcon;\n return html`\n <div\n class=\"option ${classMap({\n isSelected: isSelected,\n isDisabled: !this.allowChange,\n })}\"\n part=\"option\"\n role=\"radio\"\n tabindex=\"${isFocusable ? 0 : -1}\"\n data-value=${np.nonprofit.id}\n ?aria-checked=${isSelected}\n @click=${this.makeHandleSelect(np.nonprofit.id, index, nonprofits)}\n @keydown=${this.makeHandleSelect(np.nonprofit.id, index, nonprofits)}\n aria-label=\"${localizeUserString(this.configLang, np.nonprofit.cause || \"\")}\"\n >\n ${displayIcon\n ? html` <div class=\"card-icon-container\">\n <div class=\"icon-background\">\n <img src=\"${iconImage}\" alt=\"\" role=\"presentation\" class=\"card-icon\" />\n </div>\n </div>`\n : html` <div class=\"card-image-container\">\n <img src=\"${cardImage}\" alt=\"\" role=\"presentation\" class=\"card-image\" />\n </div>`}\n <div class=\"card-details-container\" part=\"details\">\n <div class=\"details-cause\">\n <span part=\"checkbox\" class=\"checkbox\">\n <span style=\"line-height: 0;\"> ${_checkbox({ height: \"10px\", width: \"10px\" })} </span>\n </span>\n ${localizeUserString(this.configLang, np.nonprofit.cause || \"\")}\n </div>\n <p class=\"details-description\">\n ${unsafeHTML(localizeUserString(this.configLang, np.impact.description || \"\"))}\n </p>\n <div class=\"card-progress-bar\">\n <beam-progress-bar\n value=\"${np.impact.goalProgressPercentage}\"\n style=\"flex: 1 0;\"\n ></beam-progress-bar>\n <span class=\"details-funding-progress-label\">\n ${localizeUserString(this.configLang, np.impact.goalProgressText)}\n </span>\n </div>\n </div>\n </div>\n `;\n }\n )}\n </div>\n </div>\n <div\n id=\"footer\"\n class=\"footer ${this.isMobile ? \"sticky-footer\" : \"footer-desktop\"} ${this.isMobile &&\n !this.selectedNonprofitId\n ? \"hideStickyFooter\"\n : \"\"}\"\n >\n <button\n type=\"button\"\n ?aria-disabled=${!this.allowSubmit}\n @click=\"${this.handleSubmit}\"\n class=\"${classMap({\n isDisabled: !this.allowSubmit,\n submitButton: true,\n })}\"\n part=\"submitButton\"\n >\n ${this.subscriptionUpdateDataController.data !== null\n ? localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"submitButtonTextCompleted\"] || \"\"\n ) || strings[this.configLang].submitButtonTextCompleted()\n : localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"submitButtonText\"] || \"\") ||\n strings[this.configLang].submitButtonText()}\n </button>\n </div>\n </div>\n `;\n }\n}\n\ndefineCustomElement(BeamSelectSubscriptionNonprofit);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-select-subscription-nonprofit\": BeamSelectSubscriptionNonprofit;\n }\n}\n"],"names":["_checkbox","height","width","html","styleMap","strings","donationPercentage","cacheTtl","BeamSelectSubscriptionNonprofit","LitElement","DEFAULT_BASE_URL","enforceConfig","res","postChainEligibleNonprofitsForCart","makeApiKeyHeader","selectedNonprofitId","updateSubscription","AsyncController","createScopedLocalStorage","id","index","nonprofits","event","currentId","nextFocus","focusTarget","selectedNonprofit","np","BeamNonprofitSelectEvent","WIDGET_NAMES","debounce","SUPPORTED_LANGUAGES","_changedProperties","previousPropertyValues","requireNewDataProps","prop","createdAt","data","defaults","progressBarConfigDefaults","defineCustomText","remoteConfig","config","_cssVariableMap","loading","_loading","_errorMessage","BeamError","cardStyle","displayIcon","localizeUserString","repeat","i","isSelected","isFocusable","unselectedIcon","selectedIcon","cardImage","iconImage","classMap","unsafeHTML","cssReset","css","useCustomText","cssCardGrid","__decorateClass","property","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,CAAA,EARf1D,EAQwB,UAAA,aAAA,CAAA,EACeyD,EAAA,CAAjDC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAT9B1D,EASuC,UAAA,sBAAA,CAAA,EACfyD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAVf1D,EAUwB,UACCyD,OAAAA,CAAAA,EAAAA,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAXhB,EAAA1D,EAWyB,UACAyD,cAAAA,CAAAA,EAAAA,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAZhB,EAAA1D,EAYyB,UACnByD,QAAAA,CAAAA,EAAAA,EAAA,CAAhBE,EAbU,CAAA,EAAA3D,EAaM,UA8xBnB4D,WAAAA,CAAAA,EAAAA,EAAoB5D,CAA+B"}
|
|
1
|
+
{"version":3,"file":"select-subscription-nonprofit.esm.js","sources":["../../src/shared/fragments/checkbox.ts","../../src/components/select-subscription-nonprofit/strings.ts","../../src/components/select-subscription-nonprofit/index.ts"],"sourcesContent":["import { html } from \"lit\";\nimport { styleMap } from \"lit/directives/style-map.js\";\n\nexport const _checkbox = ({ height = \"1em\", width = \"1em\" } = {}) =>\n html`\n <svg\n style=\"${styleMap({ height, width, position: \"relative\", bottom: \"0\" })}\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 78.369 78.369\"\n >\n <g>\n <path\n d=\"M78.049,19.015L29.458,67.606c-0.428,0.428-1.121,0.428-1.548,0L0.32,40.015c-0.427-0.426-0.427-1.119,0-1.547l6.704-6.704\n c0.428-0.427,1.121-0.427,1.548,0l20.113,20.112l41.113-41.113c0.429-0.427,1.12-0.427,1.548,0l6.703,6.704\n C78.477,17.894,78.477,18.586,78.049,19.015z\"\n style=\"fill: currentColor\"\n />\n </g>\n </svg>\n `;\n","export const strings = {\n en: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n fr: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n de: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n es: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n it: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n pl: {\n ctaTitle: () => `Choose Your Impact`,\n ctaMessagePrefix: () => ` at no extra cost.`,\n ctaMessage: ({ donationPercentage = \"1%\" } = {}) =>\n `Choose a nonprofit and ${donationPercentage} will be donated there for you with every order of your subscription,`,\n submitButtonText: () => `Confirm`,\n submitButtonTextCompleted: () => `Confirmed!`,\n chooseButtonText: () => `Choose`,\n },\n};\n","import { css, html, LitElement, PropertyValues } from \"lit\";\nimport { property } from \"lit/decorators/property.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { state } from \"lit/decorators/state.js\";\nimport debounce from \"lodash-es/debounce\";\nimport { postChainEligibleNonprofitsForCart, updateSubscription } from \"../../api-sdk/v3/routes\";\nimport { defineCustomText, useCustomText } from \"../../shared/fragments/custom-text\";\nimport { progressBarConfigDefaults } from \"../../shared/components/progress-bar\";\nimport { AsyncController } from \"../../shared/controllers/async-controller\";\nimport { DEFAULT_BASE_URL, SUPPORTED_LANGUAGES, WIDGET_NAMES } from \"../../api-sdk/constants\";\nimport { defineCustomElement } from \"../../shared/defineCustomElement\";\nimport { _loading } from \"../../shared/fragments/loading-template\";\nimport { _errorMessage } from \"../../shared/fragments/error-message-template\";\nimport { cssReset } from \"../../shared/css-reset\";\nimport { makeApiKeyHeader } from \"../../utils/makeApiKeyHeader\";\nimport { _cssVariableMap } from \"../../shared/fragments/css-variable-map\";\nimport { BeamError, MissingConfig } from \"../../utils/beam-errors\";\nimport { createScopedLocalStorage } from \"../../utils/local-storage\";\nimport { cssCardGrid } from \"../../shared/fragments/css-card-grid\";\nimport { _checkbox } from \"../../shared/fragments/checkbox\";\nimport { BeamNonprofitSelectEvent } from \"../../utils/events\";\nimport { localizeUserString } from \"../../shared/localize\";\nimport { TNumericId } from \"../../shared/types\";\nimport { LANGUAGES } from \"../../api-sdk/types\";\nimport { enforceConfig } from \"../../shared/enforce-config\";\nimport { strings } from \"./strings\";\nimport \"../../shared/components/progress-bar\";\nimport \"../beam-partner-logos\";\n\ninterface SubscriptionRequiredConfig {\n apiKey: string;\n subscriptionId: string;\n storeId: TNumericId;\n}\nconst cacheTtl = 2 * 60 * 60 * 1000;\nexport class BeamSelectSubscriptionNonprofit extends LitElement {\n static tagName = \"beam-select-subscription-nonprofit\";\n\n @property({ type: String }) public baseUrl: string = DEFAULT_BASE_URL;\n @property({ type: String }) public apiKey?: SubscriptionRequiredConfig[\"apiKey\"];\n @property({ type: String }) public subscriptionId?: SubscriptionRequiredConfig[\"subscriptionId\"];\n @property({ type: Number }) public storeId?: SubscriptionRequiredConfig[\"storeId\"];\n @property({ type: String }) public countryCode?: string;\n @property({ type: String }) public postalCode?: string;\n @property({ type: Number, reflect: true }) public selectedNonprofitId?: TNumericId;\n @property({ type: String }) public lang: LANGUAGES = \"en\";\n @property({ type: Boolean }) public draftConfig = false;\n @property({ type: Boolean }) public debug = false;\n @state() private isMobile = window.innerWidth < 768;\n\n get configLang() {\n return SUPPORTED_LANGUAGES[this.lang] || \"en\";\n }\n\n private getChainNonprofits = async () => {\n if (!enforceConfig<SubscriptionRequiredConfig>([\"apiKey\", \"subscriptionId\", \"storeId\"], this)) {\n throw new MissingConfig();\n }\n const res = await postChainEligibleNonprofitsForCart({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n requestBody: {\n storeId: this.storeId,\n postalCode: this.postalCode,\n countryCode: this.countryCode,\n widgetName: \"select-subscription-nonprofit\",\n version: \"1.0.0\",\n lang: this.configLang,\n options: {\n config: {\n draftConfig: this.draftConfig,\n },\n },\n },\n });\n\n this.localStorage.setItemJson(\"chainNonprofits\", {\n createdAt: new Date(),\n data: res,\n });\n\n return res;\n };\n\n private updateNonprofitIdForSubscription = async ({ selectedNonprofitId }: { selectedNonprofitId: TNumericId }) => {\n if (!this.subscriptionId) {\n return null;\n }\n\n if (!enforceConfig<SubscriptionRequiredConfig>([\"apiKey\", \"subscriptionId\"], this)) {\n throw new MissingConfig();\n }\n\n return updateSubscription({\n baseUrl: this.baseUrl,\n headers: makeApiKeyHeader(this.apiKey),\n requestBody: {\n remoteSubscriptionId: this.subscriptionId,\n nonprofitId: selectedNonprofitId,\n selectionMethod: \"subscription_management_widget\",\n },\n });\n };\n\n private nonprofitListDataController = new AsyncController<typeof this.getChainNonprofits>(\n this,\n this.getChainNonprofits\n );\n\n private subscriptionUpdateDataController = new AsyncController<typeof this.updateNonprofitIdForSubscription>(\n this,\n this.updateNonprofitIdForSubscription\n );\n\n private localStorage = createScopedLocalStorage(this as LitElement & SubscriptionRequiredConfig);\n\n connectedCallback() {\n super.connectedCallback();\n window.addEventListener(\"resize\", this.evaluateBreakPoints);\n }\n\n async firstUpdated(_changedProperties: PropertyValues) {\n await this.restoreStateFromCache();\n }\n\n async updated(previousPropertyValues: PropertyValues) {\n // Reload nonprofit list on change of any of these props:\n // Also fires on first load as props go from undefined => value\n const requireNewDataProps = [\"baseUrl\", \"storeId\", \"apiKey\", \"countryCode\", \"postalCode\", \"lang\"];\n for (const prop of requireNewDataProps) {\n if (previousPropertyValues.has(prop)) {\n await this.nonprofitListDataController.exec();\n break;\n }\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n }\n\n private restoreStateFromCache() {\n if (!enforceConfig<SubscriptionRequiredConfig>([\"apiKey\"], this)) throw new MissingConfig();\n\n try {\n // try to restore nonprofit list if we have data and it's not too old\n // list will continue to refresh async and replace this data when ready\n const { createdAt = 0, data } =\n this.localStorage.getItemJson<{ createdAt: string; data: any }>(\"chainNonprofits\") || {};\n if (new Date(createdAt).valueOf() + cacheTtl > new Date().valueOf()) {\n this.nonprofitListDataController.data = data;\n this.nonprofitListDataController.loading = false;\n }\n } catch (err) {\n // ignore cache retrieval error and continue to fetch data\n }\n }\n\n /**\n * Factory for selection event handler\n *\n * Nonprofit selector implements radio-button semantics:\n * * If nothing is selected, tabbing into selector selects first card\n * * Arrow keys changes focus between cards, but doesn't select\n * * Enter/Space sets selection\n * * If a nonprofit is selected, arrow keys change focus AND selection\n * * Click sets selection\n * @param {number} id\n * @param {number} index\n * @param {{id: number}[]} nonprofits\n * @returns {(evt: Event) => void}\n */\n private makeHandleSelect =\n (id: number, index: number, nonprofits: { nonprofit: { id: number } }[]): ((event: Event) => void) =>\n async (event: Event) => {\n if (!this.allowChange) return;\n\n const currentId = this.selectedNonprofitId;\n if (event instanceof KeyboardEvent) {\n let nextFocus = null;\n switch (event.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n if (index === 0) {\n nextFocus = nonprofits[nonprofits.length - 1];\n } else {\n nextFocus = nonprofits[index - 1];\n }\n event.preventDefault();\n break;\n case \"ArrowRight\":\n case \"ArrowDown\":\n if (index === nonprofits.length - 1) {\n nextFocus = nonprofits[0];\n } else {\n nextFocus = nonprofits[index + 1];\n }\n event.preventDefault();\n break;\n case \"Enter\":\n case \" \":\n event.preventDefault();\n break; // continue to toggle-selection block below\n default:\n return;\n }\n if (nextFocus) {\n const focusTarget = this.renderRoot.querySelector(`[data-value=\"${nextFocus.nonprofit.id}\"]`) as HTMLElement;\n if (focusTarget !== null) {\n focusTarget.tabIndex = 0;\n focusTarget.focus();\n }\n return;\n }\n }\n // Handle selection with click or Enter/Space key\n const targetEl = event.currentTarget;\n if (targetEl instanceof HTMLElement) {\n if (currentId === id) {\n // this[\"selected-nonprofit-id\"] = undefined; // unset (not supported)\n return; // no API call or localStorage change needed\n } else {\n this.selectedNonprofitId = id;\n }\n }\n };\n\n get allowChange() {\n // Disallow change if already submitted\n return this.subscriptionUpdateDataController.data == null && !this.subscriptionUpdateDataController.loading;\n }\n\n get allowSubmit() {\n // Disabled if no nonprofit has been selected yet or if submission was already received\n return Boolean(this.selectedNonprofitId && this.allowChange);\n }\n\n handleSubmit = async () => {\n const { selectedNonprofitId } = this;\n if (!this.allowSubmit || selectedNonprofitId == null) return;\n await this.subscriptionUpdateDataController.exec({ selectedNonprofitId });\n\n const selectedNonprofit = this.nonprofitListDataController?.data?.nonprofits.find(\n (np) => np.nonprofit.id === selectedNonprofitId\n );\n\n this.dispatchEvent(\n new BeamNonprofitSelectEvent({\n selectedNonprofitId,\n nonprofitName: selectedNonprofit?.nonprofit.name,\n source: WIDGET_NAMES.select_subscription_nonprofit,\n })\n );\n };\n\n evaluateBreakPoints = debounce(\n () => {\n this.isMobile = window.innerWidth < 768;\n },\n 50,\n { maxWait: 50, leading: true }\n );\n\n public get cssVariables() {\n const defaults = {\n ...progressBarConfigDefaults,\n \"--beam-fontFamily\": \"inherit\",\n \"--beam-fontStyle\": \"inherit\",\n \"--beam-fontSize\": \"inherit\",\n \"--beam-textColor\": \"inherit\",\n \"--beam-backgroundColor\": \"inherit\",\n \"--beam-SelectSubscriptionNonprofit-maxWidth\": \"800px\",\n \"--beam-SelectSubscriptionNonprofit-mobile-header-alignItems\": \"center\",\n \"--beam-SelectSubscriptionNonprofit-desktop-header-alignItems\": \"center\",\n \"--beam-SelectSubscriptionNonprofit-headerContainer-padding\": \"2px\",\n \"--beam-SelectSubscriptionNonprofit-title-textAlign\": \"inherit\",\n \"--beam-SelectSubscriptionNonprofit-description-textAlign\": \"center\",\n \"--beam-SelectSubscriptionNonprofit-description-lineHeight\": \"138%\",\n \"--beam-SelectSubscriptionNonprofit-description-marginTop\": \"3px\",\n \"--beam-SelectSubscriptionNonprofit-desktop-description-width\": \"80%\",\n \"--beam-SelectSubscriptionNonprofit-mobile-description-width\": \"90%\",\n \"--beam-SelectSubscriptionNonprofit-options-marginTop\": \"10px\",\n \"--beam-SelectSubscriptionNonprofit-options-padding\": \"10px\",\n \"--beam-SelectSubscriptionNonprofit-options-borderWidth\": \"1px\",\n \"--beam-SelectSubscriptionNonprofit-options-borderColor\": \"transparent\",\n \"--beam-SelectSubscriptionNonprofit-options-borderRadius\": \"8px\",\n \"--beam-SelectSubscriptionNonprofit-options-backgroundColor\": \"#F9FBFB\",\n \"--beam-SelectSubscriptionNonprofit-option-padding\": \"15px\",\n \"--beam-SelectSubscriptionNonprofit-options-hover-backgroundColor\": \"#e1f1ee\",\n \"--beam-SelectSubscriptionNonprofit-options-hover-borderWidth\": \"1px\",\n \"--beam-SelectSubscriptionNonprofit-options-hover-borderColor\": \"#e1f1ee\",\n \"--beam-SelectSubscriptionNonprofit-options-selected-borderWidth\": \"1px\",\n \"--beam-SelectSubscriptionNonprofit-options-selected-borderColor\": \"#e1f1ee\",\n \"--beam-SelectSubscriptionNonprofit-options-selected-backgroundColor\": \"#e1f1ee\",\n \"--beam-SelectSubscriptionNonprofit-options-gap\": \"20px\",\n \"--beam-SelectSubscriptionNonprofit-options-minWidth\": \"250px\",\n \"--beam-SelectSubscriptionNonprofit-options-columnCount\": \"2\",\n \"--beam-SelectSubscriptionNonprofit-options-icon-borderRadius\": \"4px\",\n \"--beam-SelectSubscriptionNonprofit-options-icon-padding\": \"10px\",\n \"--beam-SelectSubscriptionNonprofit-options-image-borderRadius\": \"4px\",\n \"--beam-SelectSubscriptionNonprofit-cardIconContainer-height\": \"100%\",\n \"--beam-SelectSubscriptionNonprofit-iconBackground-width\": \"50px\",\n \"--beam-SelectSubscriptionNonprofit-iconBackground-height\": \"50px\",\n \"--beam-SelectSubscriptionNonprofit-iconBackground-borderRadius\": \"50%\",\n \"--beam-SelectSubscriptionNonprofit-iconBackground-background\": \"#0a323c\",\n \"--beam-SelectSubscriptionNonprofit-icon-height\": \"50px\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-backgroundColor\": \"transparent\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-color\": \"transparent\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-borderColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-selected-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-selected-backgroundColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-selected-borderColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-hover-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-hover-backgroundColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-checkmark-hover-borderColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-cardStyle\": \"'selected_icon'\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-hover-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-disabled-color\": \"#fff\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-backgroundColor\": \"#0A323C\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-hover-backgroundColor\": \"#222\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-disabled-backgroundColor\": \"#767676\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-borderColor\": \"#333\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-hover-borderColor\": \"#222\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-disabled-borderColor\": \"#767676\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-fontSize\": \"14px\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-fontWeight\": \"inherit\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-fontFamily\": \"inherit\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-textTransform\": \"none\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-borderRadius\": \"30px\",\n \"--beam-SelectSubscriptionNonprofit-submitButton-padding\": \"10px 30px\",\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-title\", {\n fontSize: \"20px\",\n fontWeight: \"bold\",\n lineHeight: \"120%\",\n textTransform: \"capitalize\",\n color: \"#0a323c\",\n }),\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-descriptionPrefix\", {\n marginTop: \"3px\",\n color: \"#2f302d\",\n fontSize: \"14px\",\n fontWeight: \"bold\",\n fontStyle: \"normal\",\n lineHeight: \"138%\",\n }),\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-description\", {\n color: \"#2f302d\",\n fontSize: \"14px\",\n fontStyle: \"normal\",\n }),\n \"--beam-SelectSubscriptionNonprofit-details-cause-letterSpacing\": \"0.36px\",\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-details-cause\", {\n fontSize: \"12px\",\n fontWeight: \"bold\",\n color: \"#0a323c\",\n fontStyle: \"normal\",\n lineHeight: \"120%\",\n }),\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-details-description\", {\n fontSize: \"12px\",\n marginTop: \"5px\",\n fontStyle: \"normal\",\n lineHeight: \"140%\",\n fontWeight: \"400\",\n }),\n \"--beam-SelectSubscriptionNonprofit-details-fundingProgress-marginTop\": \"7px\",\n ...defineCustomText(\"--beam-SelectSubscriptionNonprofit-details-funding-progress-label\", {\n fontSize: \"12px\",\n color: \"#666666\",\n fontWeight: \"400\",\n fontStyle: \"normal\",\n }),\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-boxShadow\": \"0px -20px 20px 0px rgba(0, 0, 0, 0.04)\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-padding\": \"15px 0px 45px\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-backgroundColor\": \"white\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-marginLeft\": \"-15px\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-marginRight\": \"-15px\",\n \"--beam-SelectSubscriptionNonprofit-stickyFooter-width\": \"auto\",\n };\n\n const remoteConfig = this.nonprofitListDataController?.data?.config?.web?.theme || {};\n\n const config = { ...defaults, ...remoteConfig };\n\n const serializable = Object.create({\n toCSS() {\n return _cssVariableMap(this as Record<string, string>);\n },\n });\n\n return Object.assign(serializable, config);\n }\n\n static styles = [\n cssReset,\n css`\n :host {\n display: block;\n max-width: var(--beam-SelectSubscriptionNonprofit-maxWidth);\n font-family: var(--beam-fontFamily);\n font-style: var(--beam-fontStyle);\n font-size: var(--beam-fontSize);\n background-color: var(--beam-backgroundColor);\n color: var(--beam-textColor);\n word-break: normal;\n }\n\n .widget-container-mobile {\n position: relative;\n }\n\n .header-container {\n align-items: flex-start;\n justify-content: space-between;\n padding: var(--beam-SelectSubscriptionNonprofit-headerContainer-padding);\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .header-container-mobile {\n align-items: var(--beam-SelectSubscriptionNonprofit-mobile-header-alignItems);\n }\n\n .header-container-desktop {\n align-items: var(--beam-SelectSubscriptionNonprofit-desktop-header-alignItems);\n }\n\n .title {\n text-align: var(--beam-SelectSubscriptionNonprofit-title-textAlign);\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-title\")};\n }\n\n .description-container {\n text-align: var(--beam-SelectSubscriptionNonprofit-description-textAlign);\n line-height: var(--beam-SelectSubscriptionNonprofit-description-lineHeight);\n margin-top: var(--beam-SelectSubscriptionNonprofit-description-marginTop);\n }\n\n .description-prefix {\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-descriptionPrefix\")};\n }\n\n .description {\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-description\")};\n }\n\n .description-desktop {\n width: var(--beam-SelectSubscriptionNonprofit-desktop-description-width);\n }\n\n .description-mobile {\n width: var(--beam-SelectSubscriptionNonprofit-mobile-description-width);\n }\n\n .root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n flex-shrink: 0;\n }\n\n .options {\n margin-top: var(--beam-SelectSubscriptionNonprofit-options-marginTop);\n padding: var(--beam-SelectSubscriptionNonprofit-options-padding);\n }\n\n .card-icon-container {\n height: var(--beam-SelectSubscriptionNonprofit-cardIconContainer-height);\n flex: 0;\n flex-direction: column;\n }\n\n .icon-background {\n width: var(--beam-SelectSubscriptionNonprofit-iconBackground-width);\n height: var(--beam-SelectSubscriptionNonprofit-iconBackground-height);\n border-radius: var(--beam-SelectSubscriptionNonprofit-iconBackground-borderRadius);\n overflow: hidden;\n background: var(--beam-SelectSubscriptionNonprofit-iconBackground-background);\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .card-icon {\n height: var(--beam-SelectSubscriptionNonprofit-icon-height);\n display: block;\n padding: var(--beam-SelectSubscriptionNonprofit-options-icon-padding);\n border-radius: var(--beam-SelectSubscriptionNonprofit-options-icon-borderRadius);\n }\n\n .card-image-container {\n height: 100%;\n flex: 4;\n display: flex;\n flex-direction: column;\n }\n\n .card-image {\n flex: 1;\n height: auto;\n width: 100%;\n object-fit: cover;\n border-radius: var(--beam-SelectSubscriptionNonprofit-options-image-borderRadius);\n }\n\n .option {\n /* outline is used to prevent layer shift if changing border width */\n outline: var(--beam-SelectSubscriptionNonprofit-options-borderWidth) solid\n var(--beam-SelectSubscriptionNonprofit-options-borderColor);\n border-radius: var(--beam-SelectSubscriptionNonprofit-options-borderRadius);\n background-color: var(--beam-SelectSubscriptionNonprofit-options-backgroundColor);\n cursor: pointer;\n transition: border-color 0.2s, background-color 0.2s, outline 0.2s;\n display: flex;\n gap: 15px;\n padding: var(--beam-SelectSubscriptionNonprofit-option-padding);\n }\n\n .options.cardGrid {\n order: 3;\n }\n\n .option:not(.isDisabled):focus-visible,\n .option:not(.isDisabled):hover,\n .option:not(.isSelected):focus-visible,\n .option:not(.isSelected):hover {\n background-color: var(--beam-SelectSubscriptionNonprofit-options-hover-backgroundColor);\n outline: var(--beam-SelectSubscriptionNonprofit-options-hover-borderWidth) solid\n var(--beam-SelectSubscriptionNonprofit-options-hover-borderColor);\n }\n\n .option.isDisabled {\n cursor: not-allowed;\n }\n\n .option.isSelected {\n outline: var(--beam-SelectSubscriptionNonprofit-options-selected-borderWidth) solid\n var(--beam-SelectSubscriptionNonprofit-options-selected-borderColor);\n background-color: var(--beam-SelectSubscriptionNonprofit-options-selected-backgroundColor);\n }\n\n .option.isSelected:focus-visible,\n .option.isSelected:hover {\n outline: var(--beam-SelectSubscriptionNonprofit-options-selected-borderWidth) solid\n var(--beam-SelectSubscriptionNonprofit-options-selected-borderColor);\n }\n\n .option .checkbox {\n margin-left: 5px;\n float: right;\n padding: 2px;\n border-radius: 100%;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n border-width: 1px;\n border-style: solid;\n transition: background-color 0.2s, color 0.2s, border-color 0.2s;\n color: var(--beam-SelectSubscriptionNonprofit-checkmark-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-checkmark-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-checkmark-borderColor);\n }\n\n .option.isSelected .checkbox,\n .option.isSelected:focus-visible .checkbox,\n .option.isSelected:hover .checkbox {\n color: var(--beam-SelectSubscriptionNonprofit-checkmark-selected-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-checkmark-selected-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-checkmark-selected-borderColor);\n }\n\n .option:not(.isSelected):focus-visible .checkbox,\n .option:not(.isSelected):hover .checkbox {\n color: var(--beam-SelectSubscriptionNonprofit-checkmark-hover-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-checkmark-hover-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-checkmark-hover-borderColor);\n }\n\n .card-details-container {\n flex: 1 1 67%;\n height: 100%;\n display: flex;\n flex-direction: column;\n flex-wrap: nowrap;\n justify-content: space-between;\n align-content: stretch;\n align-items: stretch;\n position: relative;\n }\n\n .details-cause {\n flex: 0 1;\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-details-cause\")};\n letter-spacing: var(--beam-SelectSubscriptionNonprofit-details-cause-letterSpacing);\n }\n\n .details-description {\n flex: 1 1;\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-details-description\")}\n }\n\n .details-description .nonprofitName {\n font-weight: var(--beam-SelectSubscriptionNonprofit-details-nonprofitName-fontWeight);\n font-style: var(--beam-SelectSubscriptionNonprofit-details-nonprofitName-fontStyle);\n }\n\n .card-progress-bar {\n display: flex;\n margin-top: var(--beam-SelectSubscriptionNonprofit-details-fundingProgress-marginTop);\n align-items: center;\n }\n\n .details-funding-progress-label {\n white-space: nowrap;\n text-align: right;\n flex: 0 1;\n margin-left: 15px;\n ${useCustomText(\"--beam-SelectSubscriptionNonprofit-details-funding-progress-label\")}\n }\n\n .footer {\n text-align: center;\n }\n\n .sticky-footer {\n position: sticky;\n background: var(--beam-SelectSubscriptionNonprofit-stickyFooter-backgroundColor);\n bottom: 0;\n box-shadow: var(--beam-SelectSubscriptionNonprofit-stickyFooter-boxShadow);\n padding: var(--beam-SelectSubscriptionNonprofit-stickyFooter-padding);\n left: 0;\n right: 0;\n margin-left: var(--beam-SelectSubscriptionNonprofit-stickyFooter-marginLeft);\n margin-right: var(--beam-SelectSubscriptionNonprofit-stickyFooter-marginRight);\n width: var(--beam-SelectSubscriptionNonprofit-stickyFooter-width);\n }\n\n .footer-desktop {\n margin-top: 20px;\n }\n\n .submitButton {\n color: var(--beam-SelectSubscriptionNonprofit-submitButton-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-submitButton-backgroundColor);\n border: 1px solid var(--beam-SelectSubscriptionNonprofit-submitButton-borderColor);\n font-size: var(--beam-SelectSubscriptionNonprofit-submitButton-fontSize);\n font-weight: var(--beam-SelectSubscriptionNonprofit-submitButton-fontWeight);\n font-family: var(--beam-SelectSubscriptionNonprofit-submitButton-fontFamily);\n text-transform: var(--beam-SelectSubscriptionNonprofit-submitButton-textTransform);\n border-radius: var(--beam-SelectSubscriptionNonprofit-submitButton-borderRadius);\n padding: var(--beam-SelectSubscriptionNonprofit-submitButton-padding);\n transition: background-color 0.2s, border-color 0.2s, color 0.2s;\n cursor: pointer;\n display: inline-flex;\n width: 234.173px;\n justify-content: center;\n align-items: center;\n gap: 10px;\n flex-shrink: 0;\n }\n\n .submitButton:not(.isDisabled):focus-visible,\n .submitButton:not(.isDisabled):hover {\n background-color: var(--beam-SelectSubscriptionNonprofit-submitButton-hover-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-submitButton-hover-borderColor);\n color: var(--beam-SelectSubscriptionNonprofit-submitButton-hover-color);\n }\n\n .submitButton.isDisabled {\n color: var(--beam-SelectSubscriptionNonprofit-submitButton-disabled-color);\n background-color: var(--beam-SelectSubscriptionNonprofit-submitButton-disabled-backgroundColor);\n border-color: var(--beam-SelectSubscriptionNonprofit-submitButton-disabled-borderColor);\n cursor: not-allowed;\n }\n\n .hideStickyFooter {\n display: none;\n }\n `,\n cssCardGrid({\n gap: \"var(--beam-SelectSubscriptionNonprofit-options-gap)\",\n itemMinWidth: \"var(--beam-SelectSubscriptionNonprofit-options-minWidth)\",\n columnCount: \"var(--beam-SelectSubscriptionNonprofit-options-columnCount)\",\n }),\n ];\n\n protected render() {\n const { selectedNonprofitId } = this;\n const { data, loading } = this.nonprofitListDataController;\n\n if (loading && !data) {\n return _loading();\n }\n if (this.nonprofitListDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.nonprofitListDataController.error });\n }\n return \"\";\n }\n if (this.subscriptionUpdateDataController.error) {\n if (this.debug) {\n return _errorMessage({ error: this.subscriptionUpdateDataController.error });\n }\n // do not show error screen for interactive errors by default\n }\n if (data == null) {\n if (this.debug) {\n return _errorMessage({ error: new BeamError(\"No data\") });\n }\n return \"\";\n }\n const nonprofits = data?.nonprofits || [];\n const selectedNonprofit = nonprofits.find((np) => np.nonprofit.id === selectedNonprofitId) || null;\n // changes images in widget to icons\n const cardStyle = this.cssVariables[\"--beam-SelectSubscriptionNonprofit-cardStyle\"];\n const displayIcon = cardStyle === \"'icon'\" || cardStyle === \"'selected_icon'\";\n\n return html`\n <style>\n :host {\n ${this.cssVariables.toCSS()}\n }\n </style>\n <div class=\"widget-container ${this.isMobile ? \"widget-container-mobile\" : \"\"}\">\n <div class=\"header-container ${this.isMobile ? \"header-container-mobile\" : \"header-container-desktop\"}\">\n <h3 class=\"title\" part=\"title\" id=\"beam-SelectSubscriptionNonprofit-title\">\n ${localizeUserString(this.configLang, data?.config?.web?.title || \"\") ||\n strings[this.configLang].ctaTitle()}\n </h3>\n <div\n class=\"description-container ${this.isMobile\n ? \"header-container-mobile description-mobile\"\n : \"header-container-desktop description-desktop\"}\"\n >\n <span class=\"description\" part=\"description\">\n ${localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"ctaMessage\"] || \"\") ||\n strings[this.configLang].ctaMessage()}\n </span>\n <span class=\"description-prefix\" part=\"description\">\n ${localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"ctaMessagePrefix\"] || \"\") ||\n strings[this.configLang].ctaMessagePrefix()}\n </span>\n </div>\n </div>\n <div class=\"root\">\n <div\n tabindex=\"-1\"\n class=\"options cardGrid\"\n part=\"options\"\n role=\"radiogroup\"\n aria-labelledby=\"beam-SelectSubscriptionNonprofit-title\"\n ?aria-disabled=${!this.allowChange}\n >\n ${repeat(\n nonprofits,\n (i) => i.nonprofit.id,\n (np, index) => {\n const isSelected = selectedNonprofitId === np.nonprofit.id;\n const isFocusable = isSelected || (selectedNonprofit == null && index === 0);\n const unselectedIcon = np.nonprofit.causeIconUrl;\n const selectedIcon = np.nonprofit.causeIconSelectedUrl;\n const cardImage = np.imageUrl;\n const iconImage = cardStyle === \"'selected_icon'\" ? selectedIcon : unselectedIcon;\n return html`\n <div\n class=\"option ${classMap({\n isSelected: isSelected,\n isDisabled: !this.allowChange,\n })}\"\n part=\"option\"\n role=\"radio\"\n tabindex=\"${isFocusable ? 0 : -1}\"\n data-value=${np.nonprofit.id}\n ?aria-checked=${isSelected}\n @click=${this.makeHandleSelect(np.nonprofit.id, index, nonprofits)}\n @keydown=${this.makeHandleSelect(np.nonprofit.id, index, nonprofits)}\n aria-label=\"${localizeUserString(this.configLang, np.nonprofit.cause || \"\")}\"\n >\n ${displayIcon\n ? html` <div class=\"card-icon-container\">\n <div class=\"icon-background\">\n <img src=\"${iconImage}\" alt=\"\" role=\"presentation\" class=\"card-icon\" />\n </div>\n </div>`\n : html` <div class=\"card-image-container\">\n <img src=\"${cardImage}\" alt=\"\" role=\"presentation\" class=\"card-image\" />\n </div>`}\n <div class=\"card-details-container\" part=\"details\">\n <div class=\"details-cause\">\n <span part=\"checkbox\" class=\"checkbox\">\n <span style=\"line-height: 0;\"> ${_checkbox({ height: \"10px\", width: \"10px\" })} </span>\n </span>\n ${localizeUserString(this.configLang, np.nonprofit.cause || \"\")}\n </div>\n <p class=\"details-description\">\n ${unsafeHTML(localizeUserString(this.configLang, np.impact.description || \"\"))}\n </p>\n <div class=\"card-progress-bar\">\n <beam-progress-bar\n value=\"${np.impact.goalProgressPercentage}\"\n style=\"flex: 1 0;\"\n ></beam-progress-bar>\n <span class=\"details-funding-progress-label\">\n ${localizeUserString(this.configLang, np.impact.goalProgressText)}\n </span>\n </div>\n </div>\n </div>\n `;\n }\n )}\n </div>\n </div>\n <div\n id=\"footer\"\n class=\"footer ${this.isMobile ? \"sticky-footer\" : \"footer-desktop\"} ${this.isMobile &&\n !this.selectedNonprofitId\n ? \"hideStickyFooter\"\n : \"\"}\"\n >\n <button\n type=\"button\"\n ?aria-disabled=${!this.allowSubmit}\n @click=\"${this.handleSubmit}\"\n class=\"${classMap({\n isDisabled: !this.allowSubmit,\n submitButton: true,\n })}\"\n part=\"submitButton\"\n >\n ${this.subscriptionUpdateDataController.data !== null\n ? localizeUserString(\n this.configLang,\n data?.config?.web?.additionalStrings?.[\"submitButtonTextCompleted\"] || \"\"\n ) || strings[this.configLang].submitButtonTextCompleted()\n : localizeUserString(this.configLang, data?.config?.web?.additionalStrings?.[\"submitButtonText\"] || \"\") ||\n strings[this.configLang].submitButtonText()}\n </button>\n </div>\n </div>\n `;\n }\n}\n\ndefineCustomElement(BeamSelectSubscriptionNonprofit);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"beam-select-subscription-nonprofit\": BeamSelectSubscriptionNonprofit;\n }\n}\n"],"names":["_checkbox","height","width","html","styleMap","strings","donationPercentage","cacheTtl","BeamSelectSubscriptionNonprofit","LitElement","DEFAULT_BASE_URL","enforceConfig","res","postChainEligibleNonprofitsForCart","makeApiKeyHeader","selectedNonprofitId","updateSubscription","AsyncController","createScopedLocalStorage","id","index","nonprofits","event","currentId","nextFocus","focusTarget","selectedNonprofit","np","BeamNonprofitSelectEvent","WIDGET_NAMES","debounce","SUPPORTED_LANGUAGES","_changedProperties","previousPropertyValues","requireNewDataProps","prop","createdAt","data","defaults","progressBarConfigDefaults","defineCustomText","remoteConfig","config","_cssVariableMap","loading","_loading","_errorMessage","BeamError","cardStyle","displayIcon","localizeUserString","repeat","i","isSelected","isFocusable","unselectedIcon","selectedIcon","cardImage","iconImage","classMap","unsafeHTML","cssReset","css","useCustomText","cssCardGrid","__decorateClass","property","state","defineCustomElement"],"mappings":"04BAGa,MAAAA,EAAY,CAAC,CAAE,OAAAC,EAAS,MAAO,MAAAC,EAAQ,KAAM,EAAI,CAAA,IAC5DC;AAAAA;AAAAA,eAEaC,EAAS,CAAE,OAAAH,EAAQ,MAAAC,EAAO,SAAU,WAAY,OAAQ,GAAI,CAAC,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,ICNhEG,EAAU,CACrB,GAAI,CACF,SAAU,IAAM,qBAChB,iBAAkB,IAAM,qBACxB,WAAY,CAAC,CAAE,mBAAAC,EAAqB,IAAK,EAAI,CAAA,IAC3C,2BAA2BA,CAAkB,wEAC/C,iBAAkB,IAAM,UACxB,0BAA2B,IAAM,aACjC,iBAAkB,IAAM,QAC1B,EACA,GAAI,CACF,SAAU,IAAM,qBAChB,iBAAkB,IAAM,qBACxB,WAAY,CAAC,CAAE,mBAAAA,EAAqB,IAAK,EAAI,CAAA,IAC3C,2BAA2BA,CAAkB,wEAC/C,iBAAkB,IAAM,UACxB,0BAA2B,IAAM,aACjC,iBAAkB,IAAM,QAC1B,EACA,GAAI,CACF,SAAU,IAAM,qBAChB,iBAAkB,IAAM,qBACxB,WAAY,CAAC,CAAE,mBAAAA,EAAqB,IAAK,EAAI,CAAA,IAC3C,2BAA2BA,CAAkB,wEAC/C,iBAAkB,IAAM,UACxB,0BAA2B,IAAM,aACjC,iBAAkB,IAAM,QAC1B,EACA,GAAI,CACF,SAAU,IAAM,qBAChB,iBAAkB,IAAM,qBACxB,WAAY,CAAC,CAAE,mBAAAA,EAAqB,IAAK,EAAI,CAC3C,IAAA,2BAA2BA,CAAkB,wEAC/C,iBAAkB,IAAM,UACxB,0BAA2B,IAAM,aACjC,iBAAkB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EAMwB,UACAyD,SAAAA,EAAAA,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAPf,EAAA1D,EAOwB,yBACAyD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EARf1D,EAQwB,UAAA,YAAA,EACeyD,EAAA,CAAjDC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,CAAA,EAT9B1D,EASuC,UAAA,qBAAA,EACfyD,EAAA,CAAlCC,EAAS,CAAE,KAAM,MAAO,CAAC,CAAA,EAVf1D,EAUwB,UACCyD,MAAAA,EAAAA,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAXhB,EAAA1D,EAWyB,UACAyD,aAAAA,EAAAA,EAAA,CAAnCC,EAAS,CAAE,KAAM,OAAQ,CAAC,CAZhB,EAAA1D,EAYyB,UACnByD,OAAAA,EAAAA,EAAA,CAAhBE,EAAAA,CAbU,EAAA3D,EAaM,UA8xBnB4D,UAAAA,EAAAA,EAAoB5D,CAA+B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{m as I,y as m,f as D,g as p,t as L,h as M,u as F,q as x,k as P}from"../chunks/lit-WqMxC_PA.esm.js";import{d as W}from"../chunks/lodash-7H4x2457.esm.js";import{D as A,e as U,u as R,W as _,S as z}from"../chunks/routes-CAhDCFDX.esm.js";import{u as d,A as C,d as u,a as E,_ as N,i as l}from"../chunks/localize-C25pEGnx.esm.js";import{p as H}from"../chunks/progress-bar-DF7UuuHb.esm.js";import{c as j,d as K,e as v}from"../chunks/enforce-config-Ba1JkOHs.esm.js";import{_ as G}from"../chunks/loading-template-DG4lkIIc.esm.js";import{makeApiKeyHeader as k}from"../utils/makeApiKeyHeader.js";import{B as O}from"../chunks/beam-errors-Ci0d3926.esm.js";import{createScopedLocalStorage as Y}from"../utils/local-storage.js";import{c as q}from"../chunks/css-card-grid-CvoGpsJH.esm.js";import{c as V}from"../chunks/events-BohmT6Lp.esm.js";import"./beam-partner-logos.js";import"../utils/logger.js";const J=({height:i="1em",width:o="1em"}={})=>m`
|
|
2
2
|
<svg
|
|
3
|
-
style="${I({height:
|
|
3
|
+
style="${I({height:i,width:o,position:"relative",bottom:"0"})}"
|
|
4
4
|
xmlns="http://www.w3.org/2000/svg"
|
|
5
5
|
viewBox="0 0 78.369 78.369"
|
|
6
6
|
>
|
|
@@ -13,7 +13,7 @@ import{y as m,m as I,f as D,g as p,t as L,h as M,q as F,u as x,k as P}from"../ch
|
|
|
13
13
|
/>
|
|
14
14
|
</g>
|
|
15
15
|
</svg>
|
|
16
|
-
`,S={en:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:r="1%"}={})=>`Choose a nonprofit and ${r} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},fr:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:r="1%"}={})=>`Choose a nonprofit and ${r} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},de:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:r="1%"}={})=>`Choose a nonprofit and ${r} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},es:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:r="1%"}={})=>`Choose a nonprofit and ${r} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},it:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:r="1%"}={})=>`Choose a nonprofit and ${r} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},pl:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:r="1%"}={})=>`Choose a nonprofit and ${r} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"}};var Z=Object.defineProperty,Q=Object.getOwnPropertyDescriptor,c=(r,o,t,e)=>{for(var i=e>1?void 0:e?Q(o,t):o,b=r.length-1,s;b>=0;b--)(s=r[b])&&(i=(e?s(o,t,i):s(i))||i);return e&&i&&Z(o,t,i),i};const X=2*60*60*1e3;class a extends M{constructor(){super(...arguments),this.baseUrl=A,this.lang="en",this.draftConfig=!1,this.debug=!1,this.isMobile=window.innerWidth<768,this.getChainNonprofits=async()=>{v(["apiKey","subscriptionId","storeId"],this);const o=await U({baseUrl:this.baseUrl,headers:k(this.apiKey),requestBody:{storeId:this.storeId,postalCode:this.postalCode,countryCode:this.countryCode,widgetName:"select-subscription-nonprofit",version:"1.0.0",lang:this.configLang,options:{config:{draftConfig:this.draftConfig}}}});return this.localStorage.setItemJson("chainNonprofits",{createdAt:new Date,data:o}),o},this.updateNonprofitIdForSubscription=async({selectedNonprofitId:o})=>this.subscriptionId?(v(["apiKey","subscriptionId"],this),R({baseUrl:this.baseUrl,headers:k(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,nonprofitId:o,selectionMethod:"subscription_management_widget"}})):null,this.nonprofitListDataController=new C(this,this.getChainNonprofits),this.subscriptionUpdateDataController=new C(this,this.updateNonprofitIdForSubscription),this.localStorage=Y(this),this.makeHandleSelect=(o,t,e)=>async i=>{if(!this.allowChange)return;const b=this.selectedNonprofitId;if(i instanceof KeyboardEvent){let s=null;switch(i.key){case"ArrowUp":case"ArrowLeft":t===0?s=e[e.length-1]:s=e[t-1],i.preventDefault();break;case"ArrowRight":case"ArrowDown":t===e.length-1?s=e[0]:s=e[t+1],i.preventDefault();break;case"Enter":case" ":i.preventDefault();break;default:return}if(s){const f=this.renderRoot.querySelector(`[data-value="${s.nonprofit.id}"]`);f!==null&&(f.tabIndex=0,f.focus());return}}if(i.currentTarget instanceof HTMLElement){if(b===o)return;this.selectedNonprofitId=o}},this.handleSubmit=async()=>{const{selectedNonprofitId:o}=this;if(!this.allowSubmit||o==null)return;await this.subscriptionUpdateDataController.exec({selectedNonprofitId:o});const t=this.nonprofitListDataController?.data?.nonprofits.find(e=>e.nonprofit.id===o);this.dispatchEvent(new V({selectedNonprofitId:o,nonprofitName:t?.nonprofit.name,source:_.select_subscription_nonprofit}))},this.evaluateBreakPoints=W(()=>{this.isMobile=window.innerWidth<768},50,{maxWait:50,leading:!0})}get configLang(){return z[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.evaluateBreakPoints)}async firstUpdated(o){await this.restoreStateFromCache()}async updated(o){const t=["baseUrl","storeId","apiKey","countryCode","postalCode","lang"];for(const e of t)if(o.has(e)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){super.disconnectedCallback()}restoreStateFromCache(){v(["apiKey"],this);try{const{createdAt:o=0,data:t}=this.localStorage.getItemJson("chainNonprofits")||{};new Date(o).valueOf()+X>new Date().valueOf()&&(this.nonprofitListDataController.data=t,this.nonprofitListDataController.loading=!1)}catch{}}get allowChange(){return this.subscriptionUpdateDataController.data==null&&!this.subscriptionUpdateDataController.loading}get allowSubmit(){return!!(this.selectedNonprofitId&&this.allowChange)}get cssVariables(){const o={...H,"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit","--beam-SelectSubscriptionNonprofit-maxWidth":"800px","--beam-SelectSubscriptionNonprofit-mobile-header-alignItems":"center","--beam-SelectSubscriptionNonprofit-desktop-header-alignItems":"center","--beam-SelectSubscriptionNonprofit-headerContainer-padding":"2px","--beam-SelectSubscriptionNonprofit-title-textAlign":"inherit","--beam-SelectSubscriptionNonprofit-description-textAlign":"center","--beam-SelectSubscriptionNonprofit-description-lineHeight":"138%","--beam-SelectSubscriptionNonprofit-description-marginTop":"3px","--beam-SelectSubscriptionNonprofit-desktop-description-width":"80%","--beam-SelectSubscriptionNonprofit-mobile-description-width":"90%","--beam-SelectSubscriptionNonprofit-options-marginTop":"10px","--beam-SelectSubscriptionNonprofit-options-padding":"10px","--beam-SelectSubscriptionNonprofit-options-borderWidth":"1px","--beam-SelectSubscriptionNonprofit-options-borderColor":"transparent","--beam-SelectSubscriptionNonprofit-options-borderRadius":"8px","--beam-SelectSubscriptionNonprofit-options-backgroundColor":"#F9FBFB","--beam-SelectSubscriptionNonprofit-option-padding":"15px","--beam-SelectSubscriptionNonprofit-options-hover-backgroundColor":"#e1f1ee","--beam-SelectSubscriptionNonprofit-options-hover-borderWidth":"1px","--beam-SelectSubscriptionNonprofit-options-hover-borderColor":"#e1f1ee","--beam-SelectSubscriptionNonprofit-options-selected-borderWidth":"1px","--beam-SelectSubscriptionNonprofit-options-selected-borderColor":"#e1f1ee","--beam-SelectSubscriptionNonprofit-options-selected-backgroundColor":"#e1f1ee","--beam-SelectSubscriptionNonprofit-options-gap":"20px","--beam-SelectSubscriptionNonprofit-options-minWidth":"250px","--beam-SelectSubscriptionNonprofit-options-columnCount":"2","--beam-SelectSubscriptionNonprofit-options-icon-borderRadius":"4px","--beam-SelectSubscriptionNonprofit-options-icon-padding":"10px","--beam-SelectSubscriptionNonprofit-options-image-borderRadius":"4px","--beam-SelectSubscriptionNonprofit-cardIconContainer-height":"100%","--beam-SelectSubscriptionNonprofit-iconBackground-width":"50px","--beam-SelectSubscriptionNonprofit-iconBackground-height":"50px","--beam-SelectSubscriptionNonprofit-iconBackground-borderRadius":"50%","--beam-SelectSubscriptionNonprofit-iconBackground-background":"#0a323c","--beam-SelectSubscriptionNonprofit-icon-height":"50px","--beam-SelectSubscriptionNonprofit-checkmark-backgroundColor":"transparent","--beam-SelectSubscriptionNonprofit-checkmark-color":"transparent","--beam-SelectSubscriptionNonprofit-checkmark-borderColor":"#0A323C","--beam-SelectSubscriptionNonprofit-checkmark-selected-color":"#fff","--beam-SelectSubscriptionNonprofit-checkmark-selected-backgroundColor":"#0A323C","--beam-SelectSubscriptionNonprofit-checkmark-selected-borderColor":"#0A323C","--beam-SelectSubscriptionNonprofit-checkmark-hover-color":"#fff","--beam-SelectSubscriptionNonprofit-checkmark-hover-backgroundColor":"#0A323C","--beam-SelectSubscriptionNonprofit-checkmark-hover-borderColor":"#0A323C","--beam-SelectSubscriptionNonprofit-cardStyle":"'selected_icon'","--beam-SelectSubscriptionNonprofit-submitButton-color":"#fff","--beam-SelectSubscriptionNonprofit-submitButton-hover-color":"#fff","--beam-SelectSubscriptionNonprofit-submitButton-disabled-color":"#fff","--beam-SelectSubscriptionNonprofit-submitButton-backgroundColor":"#0A323C","--beam-SelectSubscriptionNonprofit-submitButton-hover-backgroundColor":"#222","--beam-SelectSubscriptionNonprofit-submitButton-disabled-backgroundColor":"#767676","--beam-SelectSubscriptionNonprofit-submitButton-borderColor":"#333","--beam-SelectSubscriptionNonprofit-submitButton-hover-borderColor":"#222","--beam-SelectSubscriptionNonprofit-submitButton-disabled-borderColor":"#767676","--beam-SelectSubscriptionNonprofit-submitButton-fontSize":"14px","--beam-SelectSubscriptionNonprofit-submitButton-fontWeight":"inherit","--beam-SelectSubscriptionNonprofit-submitButton-fontFamily":"inherit","--beam-SelectSubscriptionNonprofit-submitButton-textTransform":"none","--beam-SelectSubscriptionNonprofit-submitButton-borderRadius":"30px","--beam-SelectSubscriptionNonprofit-submitButton-padding":"10px 30px",...u("--beam-SelectSubscriptionNonprofit-title",{fontSize:"20px",fontWeight:"bold",lineHeight:"120%",textTransform:"capitalize",color:"#0a323c"}),...u("--beam-SelectSubscriptionNonprofit-descriptionPrefix",{marginTop:"3px",color:"#2f302d",fontSize:"14px",fontWeight:"bold",fontStyle:"normal",lineHeight:"138%"}),...u("--beam-SelectSubscriptionNonprofit-description",{color:"#2f302d",fontSize:"14px",fontStyle:"normal"}),"--beam-SelectSubscriptionNonprofit-details-cause-letterSpacing":"0.36px",...u("--beam-SelectSubscriptionNonprofit-details-cause",{fontSize:"12px",fontWeight:"bold",color:"#0a323c",fontStyle:"normal",lineHeight:"120%"}),...u("--beam-SelectSubscriptionNonprofit-details-description",{fontSize:"12px",marginTop:"5px",fontStyle:"normal",lineHeight:"140%",fontWeight:"400"}),"--beam-SelectSubscriptionNonprofit-details-fundingProgress-marginTop":"7px",...u("--beam-SelectSubscriptionNonprofit-details-funding-progress-label",{fontSize:"12px",color:"#666666",fontWeight:"400",fontStyle:"normal"}),"--beam-SelectSubscriptionNonprofit-stickyFooter-boxShadow":"0px -20px 20px 0px rgba(0, 0, 0, 0.04)","--beam-SelectSubscriptionNonprofit-stickyFooter-padding":"15px 0px 45px","--beam-SelectSubscriptionNonprofit-stickyFooter-backgroundColor":"white","--beam-SelectSubscriptionNonprofit-stickyFooter-marginLeft":"-15px","--beam-SelectSubscriptionNonprofit-stickyFooter-marginRight":"-15px","--beam-SelectSubscriptionNonprofit-stickyFooter-width":"auto"},t=this.nonprofitListDataController?.data?.config?.web?.theme||{},e={...o,...t};return Object.assign(Object.create({toCSS(){return E(this)}}),e)}render(){const{selectedNonprofitId:o}=this,{data:t,loading:e}=this.nonprofitListDataController;if(e&&!t)return O();if(this.nonprofitListDataController.error)return this.debug?N({error:this.nonprofitListDataController.error}):"";if(this.subscriptionUpdateDataController.error&&this.debug)return N({error:this.subscriptionUpdateDataController.error});if(t==null)return this.debug?N({error:new G("No data")}):"";const i=t?.nonprofits||[],b=i.find(n=>n.nonprofit.id===o)||null,s=this.cssVariables["--beam-SelectSubscriptionNonprofit-cardStyle"],f=s==="'icon'"||s==="'selected_icon'";return m`
|
|
16
|
+
`,S={en:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:i="1%"}={})=>`Choose a nonprofit and ${i} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},fr:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:i="1%"}={})=>`Choose a nonprofit and ${i} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},de:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:i="1%"}={})=>`Choose a nonprofit and ${i} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},es:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:i="1%"}={})=>`Choose a nonprofit and ${i} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},it:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:i="1%"}={})=>`Choose a nonprofit and ${i} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},pl:{ctaTitle:()=>"Choose Your Impact",ctaMessagePrefix:()=>" at no extra cost.",ctaMessage:({donationPercentage:i="1%"}={})=>`Choose a nonprofit and ${i} will be donated there for you with every order of your subscription,`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"}};var Z=Object.defineProperty,c=(i,o,t,n)=>{for(var e=void 0,b=i.length-1,s;b>=0;b--)(s=i[b])&&(e=s(o,t,e)||e);return e&&Z(o,t,e),e};const Q=2*60*60*1e3;class a extends M{constructor(){super(...arguments),this.baseUrl=A,this.lang="en",this.draftConfig=!1,this.debug=!1,this.isMobile=window.innerWidth<768,this.getChainNonprofits=async()=>{v(["apiKey","subscriptionId","storeId"],this);const o=await U({baseUrl:this.baseUrl,headers:k(this.apiKey),requestBody:{storeId:this.storeId,postalCode:this.postalCode,countryCode:this.countryCode,widgetName:"select-subscription-nonprofit",version:"1.0.0",lang:this.configLang,options:{config:{draftConfig:this.draftConfig}}}});return this.localStorage.setItemJson("chainNonprofits",{createdAt:new Date,data:o}),o},this.updateNonprofitIdForSubscription=async({selectedNonprofitId:o})=>this.subscriptionId?(v(["apiKey","subscriptionId"],this),R({baseUrl:this.baseUrl,headers:k(this.apiKey),requestBody:{remoteSubscriptionId:this.subscriptionId,nonprofitId:o,selectionMethod:"subscription_management_widget"}})):null,this.nonprofitListDataController=new C(this,this.getChainNonprofits),this.subscriptionUpdateDataController=new C(this,this.updateNonprofitIdForSubscription),this.localStorage=Y(this),this.makeHandleSelect=(o,t,n)=>async e=>{if(!this.allowChange)return;const b=this.selectedNonprofitId;if(e instanceof KeyboardEvent){let s=null;switch(e.key){case"ArrowUp":case"ArrowLeft":t===0?s=n[n.length-1]:s=n[t-1],e.preventDefault();break;case"ArrowRight":case"ArrowDown":t===n.length-1?s=n[0]:s=n[t+1],e.preventDefault();break;case"Enter":case" ":e.preventDefault();break;default:return}if(s){const f=this.renderRoot.querySelector(`[data-value="${s.nonprofit.id}"]`);f!==null&&(f.tabIndex=0,f.focus());return}}if(e.currentTarget instanceof HTMLElement){if(b===o)return;this.selectedNonprofitId=o}},this.handleSubmit=async()=>{const{selectedNonprofitId:o}=this;if(!this.allowSubmit||o==null)return;await this.subscriptionUpdateDataController.exec({selectedNonprofitId:o});const t=this.nonprofitListDataController?.data?.nonprofits.find(n=>n.nonprofit.id===o);this.dispatchEvent(new V({selectedNonprofitId:o,nonprofitName:t?.nonprofit.name,source:_.select_subscription_nonprofit}))},this.evaluateBreakPoints=W(()=>{this.isMobile=window.innerWidth<768},50,{maxWait:50,leading:!0})}get configLang(){return z[this.lang]||"en"}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.evaluateBreakPoints)}async firstUpdated(o){await this.restoreStateFromCache()}async updated(o){const t=["baseUrl","storeId","apiKey","countryCode","postalCode","lang"];for(const n of t)if(o.has(n)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){super.disconnectedCallback()}restoreStateFromCache(){v(["apiKey"],this);try{const{createdAt:o=0,data:t}=this.localStorage.getItemJson("chainNonprofits")||{};new Date(o).valueOf()+Q>new Date().valueOf()&&(this.nonprofitListDataController.data=t,this.nonprofitListDataController.loading=!1)}catch{}}get allowChange(){return this.subscriptionUpdateDataController.data==null&&!this.subscriptionUpdateDataController.loading}get allowSubmit(){return!!(this.selectedNonprofitId&&this.allowChange)}get cssVariables(){const o={...H,"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit","--beam-SelectSubscriptionNonprofit-maxWidth":"800px","--beam-SelectSubscriptionNonprofit-mobile-header-alignItems":"center","--beam-SelectSubscriptionNonprofit-desktop-header-alignItems":"center","--beam-SelectSubscriptionNonprofit-headerContainer-padding":"2px","--beam-SelectSubscriptionNonprofit-title-textAlign":"inherit","--beam-SelectSubscriptionNonprofit-description-textAlign":"center","--beam-SelectSubscriptionNonprofit-description-lineHeight":"138%","--beam-SelectSubscriptionNonprofit-description-marginTop":"3px","--beam-SelectSubscriptionNonprofit-desktop-description-width":"80%","--beam-SelectSubscriptionNonprofit-mobile-description-width":"90%","--beam-SelectSubscriptionNonprofit-options-marginTop":"10px","--beam-SelectSubscriptionNonprofit-options-padding":"10px","--beam-SelectSubscriptionNonprofit-options-borderWidth":"1px","--beam-SelectSubscriptionNonprofit-options-borderColor":"transparent","--beam-SelectSubscriptionNonprofit-options-borderRadius":"8px","--beam-SelectSubscriptionNonprofit-options-backgroundColor":"#F9FBFB","--beam-SelectSubscriptionNonprofit-option-padding":"15px","--beam-SelectSubscriptionNonprofit-options-hover-backgroundColor":"#e1f1ee","--beam-SelectSubscriptionNonprofit-options-hover-borderWidth":"1px","--beam-SelectSubscriptionNonprofit-options-hover-borderColor":"#e1f1ee","--beam-SelectSubscriptionNonprofit-options-selected-borderWidth":"1px","--beam-SelectSubscriptionNonprofit-options-selected-borderColor":"#e1f1ee","--beam-SelectSubscriptionNonprofit-options-selected-backgroundColor":"#e1f1ee","--beam-SelectSubscriptionNonprofit-options-gap":"20px","--beam-SelectSubscriptionNonprofit-options-minWidth":"250px","--beam-SelectSubscriptionNonprofit-options-columnCount":"2","--beam-SelectSubscriptionNonprofit-options-icon-borderRadius":"4px","--beam-SelectSubscriptionNonprofit-options-icon-padding":"10px","--beam-SelectSubscriptionNonprofit-options-image-borderRadius":"4px","--beam-SelectSubscriptionNonprofit-cardIconContainer-height":"100%","--beam-SelectSubscriptionNonprofit-iconBackground-width":"50px","--beam-SelectSubscriptionNonprofit-iconBackground-height":"50px","--beam-SelectSubscriptionNonprofit-iconBackground-borderRadius":"50%","--beam-SelectSubscriptionNonprofit-iconBackground-background":"#0a323c","--beam-SelectSubscriptionNonprofit-icon-height":"50px","--beam-SelectSubscriptionNonprofit-checkmark-backgroundColor":"transparent","--beam-SelectSubscriptionNonprofit-checkmark-color":"transparent","--beam-SelectSubscriptionNonprofit-checkmark-borderColor":"#0A323C","--beam-SelectSubscriptionNonprofit-checkmark-selected-color":"#fff","--beam-SelectSubscriptionNonprofit-checkmark-selected-backgroundColor":"#0A323C","--beam-SelectSubscriptionNonprofit-checkmark-selected-borderColor":"#0A323C","--beam-SelectSubscriptionNonprofit-checkmark-hover-color":"#fff","--beam-SelectSubscriptionNonprofit-checkmark-hover-backgroundColor":"#0A323C","--beam-SelectSubscriptionNonprofit-checkmark-hover-borderColor":"#0A323C","--beam-SelectSubscriptionNonprofit-cardStyle":"'selected_icon'","--beam-SelectSubscriptionNonprofit-submitButton-color":"#fff","--beam-SelectSubscriptionNonprofit-submitButton-hover-color":"#fff","--beam-SelectSubscriptionNonprofit-submitButton-disabled-color":"#fff","--beam-SelectSubscriptionNonprofit-submitButton-backgroundColor":"#0A323C","--beam-SelectSubscriptionNonprofit-submitButton-hover-backgroundColor":"#222","--beam-SelectSubscriptionNonprofit-submitButton-disabled-backgroundColor":"#767676","--beam-SelectSubscriptionNonprofit-submitButton-borderColor":"#333","--beam-SelectSubscriptionNonprofit-submitButton-hover-borderColor":"#222","--beam-SelectSubscriptionNonprofit-submitButton-disabled-borderColor":"#767676","--beam-SelectSubscriptionNonprofit-submitButton-fontSize":"14px","--beam-SelectSubscriptionNonprofit-submitButton-fontWeight":"inherit","--beam-SelectSubscriptionNonprofit-submitButton-fontFamily":"inherit","--beam-SelectSubscriptionNonprofit-submitButton-textTransform":"none","--beam-SelectSubscriptionNonprofit-submitButton-borderRadius":"30px","--beam-SelectSubscriptionNonprofit-submitButton-padding":"10px 30px",...u("--beam-SelectSubscriptionNonprofit-title",{fontSize:"20px",fontWeight:"bold",lineHeight:"120%",textTransform:"capitalize",color:"#0a323c"}),...u("--beam-SelectSubscriptionNonprofit-descriptionPrefix",{marginTop:"3px",color:"#2f302d",fontSize:"14px",fontWeight:"bold",fontStyle:"normal",lineHeight:"138%"}),...u("--beam-SelectSubscriptionNonprofit-description",{color:"#2f302d",fontSize:"14px",fontStyle:"normal"}),"--beam-SelectSubscriptionNonprofit-details-cause-letterSpacing":"0.36px",...u("--beam-SelectSubscriptionNonprofit-details-cause",{fontSize:"12px",fontWeight:"bold",color:"#0a323c",fontStyle:"normal",lineHeight:"120%"}),...u("--beam-SelectSubscriptionNonprofit-details-description",{fontSize:"12px",marginTop:"5px",fontStyle:"normal",lineHeight:"140%",fontWeight:"400"}),"--beam-SelectSubscriptionNonprofit-details-fundingProgress-marginTop":"7px",...u("--beam-SelectSubscriptionNonprofit-details-funding-progress-label",{fontSize:"12px",color:"#666666",fontWeight:"400",fontStyle:"normal"}),"--beam-SelectSubscriptionNonprofit-stickyFooter-boxShadow":"0px -20px 20px 0px rgba(0, 0, 0, 0.04)","--beam-SelectSubscriptionNonprofit-stickyFooter-padding":"15px 0px 45px","--beam-SelectSubscriptionNonprofit-stickyFooter-backgroundColor":"white","--beam-SelectSubscriptionNonprofit-stickyFooter-marginLeft":"-15px","--beam-SelectSubscriptionNonprofit-stickyFooter-marginRight":"-15px","--beam-SelectSubscriptionNonprofit-stickyFooter-width":"auto"},t=this.nonprofitListDataController?.data?.config?.web?.theme||{},n={...o,...t};return Object.assign(Object.create({toCSS(){return E(this)}}),n)}render(){const{selectedNonprofitId:o}=this,{data:t,loading:n}=this.nonprofitListDataController;if(n&&!t)return G();if(this.nonprofitListDataController.error)return this.debug?N({error:this.nonprofitListDataController.error}):"";if(this.subscriptionUpdateDataController.error&&this.debug)return N({error:this.subscriptionUpdateDataController.error});if(t==null)return this.debug?N({error:new O("No data")}):"";const e=t?.nonprofits||[],b=e.find(r=>r.nonprofit.id===o)||null,s=this.cssVariables["--beam-SelectSubscriptionNonprofit-cardStyle"],f=s==="'icon'"||s==="'selected_icon'";return m`
|
|
17
17
|
<style>
|
|
18
18
|
:host {
|
|
19
19
|
${this.cssVariables.toCSS()}
|
|
@@ -44,17 +44,17 @@ import{y as m,m as I,f as D,g as p,t as L,h as M,q as F,u as x,k as P}from"../ch
|
|
|
44
44
|
aria-labelledby="beam-SelectSubscriptionNonprofit-title"
|
|
45
45
|
?aria-disabled=${!this.allowChange}
|
|
46
46
|
>
|
|
47
|
-
${F(
|
|
47
|
+
${F(e,r=>r.nonprofit.id,(r,h)=>{const g=o===r.nonprofit.id,y=g||b==null&&h===0,w=r.nonprofit.causeIconUrl,B=r.nonprofit.causeIconSelectedUrl,$=r.imageUrl,T=s==="'selected_icon'"?B:w;return m`
|
|
48
48
|
<div
|
|
49
49
|
class="option ${x({isSelected:g,isDisabled:!this.allowChange})}"
|
|
50
50
|
part="option"
|
|
51
51
|
role="radio"
|
|
52
52
|
tabindex="${y?0:-1}"
|
|
53
|
-
data-value=${
|
|
53
|
+
data-value=${r.nonprofit.id}
|
|
54
54
|
?aria-checked=${g}
|
|
55
|
-
@click=${this.makeHandleSelect(
|
|
56
|
-
@keydown=${this.makeHandleSelect(
|
|
57
|
-
aria-label="${l(this.configLang,
|
|
55
|
+
@click=${this.makeHandleSelect(r.nonprofit.id,h,e)}
|
|
56
|
+
@keydown=${this.makeHandleSelect(r.nonprofit.id,h,e)}
|
|
57
|
+
aria-label="${l(this.configLang,r.nonprofit.cause||"")}"
|
|
58
58
|
>
|
|
59
59
|
${f?m` <div class="card-icon-container">
|
|
60
60
|
<div class="icon-background">
|
|
@@ -68,18 +68,18 @@ import{y as m,m as I,f as D,g as p,t as L,h as M,q as F,u as x,k as P}from"../ch
|
|
|
68
68
|
<span part="checkbox" class="checkbox">
|
|
69
69
|
<span style="line-height: 0;"> ${J({height:"10px",width:"10px"})} </span>
|
|
70
70
|
</span>
|
|
71
|
-
${l(this.configLang,
|
|
71
|
+
${l(this.configLang,r.nonprofit.cause||"")}
|
|
72
72
|
</div>
|
|
73
73
|
<p class="details-description">
|
|
74
|
-
${P(l(this.configLang,
|
|
74
|
+
${P(l(this.configLang,r.impact.description||""))}
|
|
75
75
|
</p>
|
|
76
76
|
<div class="card-progress-bar">
|
|
77
77
|
<beam-progress-bar
|
|
78
|
-
value="${
|
|
78
|
+
value="${r.impact.goalProgressPercentage}"
|
|
79
79
|
style="flex: 1 0;"
|
|
80
80
|
></beam-progress-bar>
|
|
81
81
|
<span class="details-funding-progress-label">
|
|
82
|
-
${l(this.configLang,
|
|
82
|
+
${l(this.configLang,r.impact.goalProgressText)}
|
|
83
83
|
</span>
|
|
84
84
|
</div>
|
|
85
85
|
</div>
|
|
@@ -386,5 +386,5 @@ import{y as m,m as I,f as D,g as p,t as L,h as M,q as F,u as x,k as P}from"../ch
|
|
|
386
386
|
.hideStickyFooter {
|
|
387
387
|
display: none;
|
|
388
388
|
}
|
|
389
|
-
`,q({gap:"var(--beam-SelectSubscriptionNonprofit-options-gap)",itemMinWidth:"var(--beam-SelectSubscriptionNonprofit-options-minWidth)",columnCount:"var(--beam-SelectSubscriptionNonprofit-options-columnCount)"})],c([p({type:String})],a.prototype,"baseUrl"
|
|
389
|
+
`,q({gap:"var(--beam-SelectSubscriptionNonprofit-options-gap)",itemMinWidth:"var(--beam-SelectSubscriptionNonprofit-options-minWidth)",columnCount:"var(--beam-SelectSubscriptionNonprofit-options-columnCount)"})],c([p({type:String})],a.prototype,"baseUrl"),c([p({type:String})],a.prototype,"apiKey"),c([p({type:String})],a.prototype,"subscriptionId"),c([p({type:Number})],a.prototype,"storeId"),c([p({type:String})],a.prototype,"countryCode"),c([p({type:String})],a.prototype,"postalCode"),c([p({type:Number,reflect:!0})],a.prototype,"selectedNonprofitId"),c([p({type:String})],a.prototype,"lang"),c([p({type:Boolean})],a.prototype,"draftConfig"),c([p({type:Boolean})],a.prototype,"debug"),c([L()],a.prototype,"isMobile"),K(a);export{a as BeamSelectSubscriptionNonprofit};
|
|
390
390
|
//# sourceMappingURL=select-subscription-nonprofit.js.map
|