@beamimpact/web-sdk 1.44.2 → 1.45.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/_share-dialog-dependencies-R9RsuSGx.esm.js +2 -0
- package/dist/chunks/_share-dialog-dependencies-R9RsuSGx.esm.js.map +1 -0
- package/dist/chunks/_share-dialog-dependencies-o5GBtNTA.esm.js +2 -0
- package/dist/chunks/_share-dialog-dependencies-o5GBtNTA.esm.js.map +1 -0
- package/dist/chunks/{css-card-grid-r6wxRbPV.esm.js → css-card-grid-nEc--M5M.esm.js} +2 -2
- package/dist/chunks/{css-card-grid-r6wxRbPV.esm.js.map → css-card-grid-nEc--M5M.esm.js.map} +1 -1
- package/dist/chunks/{enforce-config-HksNiOMu.esm.js → enforce-config-ZAI7WYAd.esm.js} +2 -2
- package/dist/chunks/{enforce-config-HksNiOMu.esm.js.map → enforce-config-ZAI7WYAd.esm.js.map} +1 -1
- package/dist/chunks/{enforce-config-er6B5Gkj.esm.js → enforce-config-ZyPq_4CF.esm.js} +2 -2
- package/dist/chunks/{enforce-config-er6B5Gkj.esm.js.map → enforce-config-ZyPq_4CF.esm.js.map} +1 -1
- package/dist/chunks/{index-tV7ZK858.esm.js → index--JacA4R2.esm.js} +2 -2
- package/dist/chunks/{index-tV7ZK858.esm.js.map → index--JacA4R2.esm.js.map} +1 -1
- package/dist/chunks/index-1WxwWfcp.esm.js +2 -0
- package/dist/chunks/index-1WxwWfcp.esm.js.map +1 -0
- package/dist/chunks/index-4fdLArZg.esm.js +2 -0
- package/dist/chunks/index-4fdLArZg.esm.js.map +1 -0
- package/dist/chunks/index-Hd_2hpsA.esm.js +2 -0
- package/dist/chunks/index-Hd_2hpsA.esm.js.map +1 -0
- package/dist/chunks/{index-1nI7l5vj.esm.js → index-JDZQClkA.esm.js} +2 -2
- package/dist/chunks/{index-1nI7l5vj.esm.js.map → index-JDZQClkA.esm.js.map} +1 -1
- package/dist/chunks/index-MJNFm2RK.esm.js +2 -0
- package/dist/chunks/index-MJNFm2RK.esm.js.map +1 -0
- package/dist/chunks/{index-mw70Caof.esm.js → index-eXilYHHK.esm.js} +2 -2
- package/dist/chunks/{index-mw70Caof.esm.js.map → index-eXilYHHK.esm.js.map} +1 -1
- package/dist/chunks/index-gBAASIWa.esm.js +2 -0
- package/dist/chunks/index-gBAASIWa.esm.js.map +1 -0
- package/dist/chunks/index-lyf1T2wZ.esm.js +2 -0
- package/dist/chunks/index-lyf1T2wZ.esm.js.map +1 -0
- package/dist/chunks/{index-Kz977KkP.esm.js → index-qs-xQCeM.esm.js} +2 -2
- package/dist/chunks/{index-Kz977KkP.esm.js.map → index-qs-xQCeM.esm.js.map} +1 -1
- package/dist/chunks/{lit-3QHn3fwl.esm.js → lit-iNN5L_Qk.esm.js} +2 -2
- package/dist/chunks/{lit-3QHn3fwl.esm.js.map → lit-iNN5L_Qk.esm.js.map} +1 -1
- package/dist/chunks/loading-template-t4fFsYtr.esm.js +2 -0
- package/dist/chunks/{loading-template-mLjOGXMj.esm.js.map → loading-template-t4fFsYtr.esm.js.map} +1 -1
- package/dist/chunks/localize-m-_ESmpk.esm.js +31 -0
- package/dist/chunks/localize-m-_ESmpk.esm.js.map +1 -0
- package/dist/chunks/localize-o-cYvHQf.esm.js +31 -0
- package/dist/chunks/localize-o-cYvHQf.esm.js.map +1 -0
- package/dist/chunks/{order-page-zYoubhg4.esm.js → order-page-KZ7xLkRW.esm.js} +2 -2
- package/dist/chunks/{order-page-zYoubhg4.esm.js.map → order-page-KZ7xLkRW.esm.js.map} +1 -1
- package/dist/chunks/{order-page-zPVHsu6v.esm.js → order-page-mlWRT5YL.esm.js} +2 -2
- package/dist/chunks/{order-page-zPVHsu6v.esm.js.map → order-page-mlWRT5YL.esm.js.map} +1 -1
- package/dist/chunks/{progress-bar-HVG_n8_6.esm.js → progress-bar-PMU_xI3L.esm.js} +2 -2
- package/dist/chunks/{progress-bar-HVG_n8_6.esm.js.map → progress-bar-PMU_xI3L.esm.js.map} +1 -1
- package/dist/chunks/promo-pill-label-58PJRvSl.esm.js +15 -0
- package/dist/chunks/{promo-pill-label-81dVN7VY.esm.js.map → promo-pill-label-58PJRvSl.esm.js.map} +1 -1
- package/dist/chunks/{responsive-KbDsZM6S.esm.js → responsive-2lC2Wrtg.esm.js} +2 -2
- package/dist/chunks/{responsive-KbDsZM6S.esm.js.map → responsive-2lC2Wrtg.esm.js.map} +1 -1
- package/dist/chunks/{routes-eIRRJ7c1.esm.js → routes-FBB1GA4-.esm.js} +2 -2
- package/dist/chunks/{routes-eIRRJ7c1.esm.js.map → routes-FBB1GA4-.esm.js.map} +1 -1
- package/dist/chunks/{routes-4Mnz2XZX.esm.js → routes-jmFlXAbv.esm.js} +2 -2
- package/dist/chunks/{routes-4Mnz2XZX.esm.js.map → routes-jmFlXAbv.esm.js.map} +1 -1
- package/dist/chunks/share-button-SNvuFDC9.esm.js +2 -0
- package/dist/chunks/share-button-SNvuFDC9.esm.js.map +1 -0
- package/dist/chunks/{share-button-9d9kTwmG.esm.js → share-button-bQ8brpBZ.esm.js} +4 -3
- package/dist/chunks/{share-button-9d9kTwmG.esm.js.map → share-button-bQ8brpBZ.esm.js.map} +1 -1
- package/dist/chunks/{share-button-PJlajTPi.esm.js → share-button-hLOsYlSA.esm.js} +4 -3
- package/dist/chunks/{share-button-PJlajTPi.esm.js.map → share-button-hLOsYlSA.esm.js.map} +1 -1
- package/dist/chunks/{shoelace-components-A9MnfNMD.esm.js → shoelace-components-leDI-Yop.esm.js} +2 -2
- package/dist/chunks/{shoelace-components-A9MnfNMD.esm.js.map → shoelace-components-leDI-Yop.esm.js.map} +1 -1
- package/dist/chunks/{shoelace-components-c53kUkO2.esm.js → shoelace-components-qjNlvvPx.esm.js} +2 -2
- package/dist/chunks/{shoelace-components-c53kUkO2.esm.js.map → shoelace-components-qjNlvvPx.esm.js.map} +1 -1
- package/dist/chunks/{update-cart-ZuRyrnAL.esm.js → update-cart-aKQ3Cjc8.esm.js} +2 -2
- package/dist/chunks/{update-cart-ZuRyrnAL.esm.js.map → update-cart-aKQ3Cjc8.esm.js.map} +1 -1
- package/dist/chunks/{update-cart-SPqvT31b.esm.js → update-cart-j9LPS5By.esm.js} +2 -2
- package/dist/chunks/{update-cart-SPqvT31b.esm.js.map → update-cart-j9LPS5By.esm.js.map} +1 -1
- package/dist/chunks/{vendor--f7lkyBk.esm.js → vendor-GKiOHg2N.esm.js} +2 -2
- package/dist/chunks/{vendor--f7lkyBk.esm.js.map → vendor-GKiOHg2N.esm.js.map} +1 -1
- package/dist/components/beam-partner-logos.esm.js +1 -1
- package/dist/components/beam-partner-logos.js +1 -1
- package/dist/components/community-impact.esm.js +1 -1
- package/dist/components/community-impact.js +1 -1
- package/dist/components/cumulative-impact.esm.js +1 -1
- package/dist/components/cumulative-impact.js +1 -1
- package/dist/components/impact-overview.d.ts +6 -1
- package/dist/components/impact-overview.esm.js +87 -73
- package/dist/components/impact-overview.esm.js.map +1 -1
- package/dist/components/impact-overview.js +87 -73
- package/dist/components/impact-overview.js.map +1 -1
- package/dist/components/index.esm.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/post-purchase.esm.js +1 -1
- package/dist/components/post-purchase.esm.js.map +1 -1
- package/dist/components/post-purchase.js +1 -1
- package/dist/components/post-purchase.js.map +1 -1
- package/dist/components/product-details-page.esm.js +1 -1
- package/dist/components/product-details-page.js +1 -1
- package/dist/components/redeem-transaction.d.ts +7 -1
- package/dist/components/redeem-transaction.esm.js +256 -185
- package/dist/components/redeem-transaction.esm.js.map +1 -1
- package/dist/components/redeem-transaction.js +256 -185
- package/dist/components/redeem-transaction.js.map +1 -1
- package/dist/components/select-nonprofit.esm.js +42 -28
- package/dist/components/select-nonprofit.esm.js.map +1 -1
- package/dist/components/select-nonprofit.js +42 -28
- package/dist/components/select-nonprofit.js.map +1 -1
- package/dist/components/select-subscription-nonprofit.esm.js +34 -19
- package/dist/components/select-subscription-nonprofit.esm.js.map +1 -1
- package/dist/components/select-subscription-nonprofit.js +34 -19
- package/dist/components/select-subscription-nonprofit.js.map +1 -1
- 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.esm.js +1 -1
- package/dist/components/social-share.js +1 -1
- package/dist/components/subscription-impact.esm.js +1 -1
- package/dist/components/subscription-impact.js +1 -1
- package/dist/components/subscription-management.esm.js +1 -1
- package/dist/components/subscription-management.esm.js.map +1 -1
- package/dist/components/subscription-management.js +1 -1
- package/dist/components/subscription-management.js.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/integrations/beam.esm.js +1 -1
- package/dist/integrations/beam.js +1 -1
- package/dist/integrations/cart.esm.js +1 -1
- package/dist/integrations/cart.js +1 -1
- package/dist/integrations/index.esm.js +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/logs.esm.js +1 -1
- package/dist/integrations/logs.js +1 -1
- package/dist/integrations/session.esm.js +1 -1
- package/dist/integrations/session.js +1 -1
- package/dist/integrations/shopify.esm.js +1 -1
- package/dist/integrations/shopify.js +1 -1
- package/dist/integrations/statsig.esm.js +1 -1
- package/dist/integrations/statsig.js +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.esm.js +1 -1
- package/dist/react/community-impact.js +1 -1
- package/dist/react/cumulative-impact.esm.js +1 -1
- package/dist/react/cumulative-impact.js +1 -1
- package/dist/react/impact-overview.esm.js +1 -1
- package/dist/react/impact-overview.js +1 -1
- package/dist/react/index.esm.js +1 -1
- package/dist/react/index.js +1 -1
- 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.esm.js +1 -1
- package/dist/react/product-details-page.js +1 -1
- package/dist/react/redeem-transaction.esm.js +1 -1
- package/dist/react/redeem-transaction.esm.js.map +1 -1
- package/dist/react/redeem-transaction.js +1 -1
- package/dist/react/redeem-transaction.js.map +1 -1
- package/dist/react/select-nonprofit.esm.js +1 -1
- package/dist/react/select-nonprofit.js +1 -1
- package/dist/react/select-subscription-nonprofit.esm.js +1 -1
- package/dist/react/select-subscription-nonprofit.esm.js.map +1 -1
- package/dist/react/select-subscription-nonprofit.js +1 -1
- package/dist/react/select-subscription-nonprofit.js.map +1 -1
- package/dist/react/social-share.esm.js +1 -1
- package/dist/react/social-share.js +1 -1
- package/dist/react/subscription-impact.esm.js +1 -1
- package/dist/react/subscription-impact.js +1 -1
- package/dist/react/subscription-management.esm.js +1 -1
- package/dist/react/subscription-management.esm.js.map +1 -1
- package/dist/react/subscription-management.js +1 -1
- package/dist/react/subscription-management.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/_share-dialog-dependencies-6qxEKq8s.esm.js +0 -2
- package/dist/chunks/_share-dialog-dependencies-6qxEKq8s.esm.js.map +0 -1
- package/dist/chunks/_share-dialog-dependencies-a05NZJ6I.esm.js +0 -2
- package/dist/chunks/_share-dialog-dependencies-a05NZJ6I.esm.js.map +0 -1
- package/dist/chunks/checkbox-P2JYPqxl.esm.js +0 -17
- package/dist/chunks/checkbox-P2JYPqxl.esm.js.map +0 -1
- package/dist/chunks/index-2fgoYcug.esm.js +0 -2
- package/dist/chunks/index-2fgoYcug.esm.js.map +0 -1
- package/dist/chunks/index-4mQhPzhb.esm.js +0 -2
- package/dist/chunks/index-4mQhPzhb.esm.js.map +0 -1
- package/dist/chunks/index-BL75MsEt.esm.js +0 -2
- package/dist/chunks/index-BL75MsEt.esm.js.map +0 -1
- package/dist/chunks/index-MewTlHYO.esm.js +0 -2
- package/dist/chunks/index-MewTlHYO.esm.js.map +0 -1
- package/dist/chunks/index-mbNUaby9.esm.js +0 -2
- package/dist/chunks/index-mbNUaby9.esm.js.map +0 -1
- package/dist/chunks/index-vNBrw3_d.esm.js +0 -2
- package/dist/chunks/index-vNBrw3_d.esm.js.map +0 -1
- package/dist/chunks/loading-template-mLjOGXMj.esm.js +0 -2
- package/dist/chunks/localize-IRs8JglT.esm.js +0 -29
- package/dist/chunks/localize-IRs8JglT.esm.js.map +0 -1
- package/dist/chunks/localize-SsJbTmMj.esm.js +0 -29
- package/dist/chunks/localize-SsJbTmMj.esm.js.map +0 -1
- package/dist/chunks/promo-pill-label-81dVN7VY.esm.js +0 -15
- package/dist/chunks/share-button-CqTd80g8.esm.js +0 -2
- package/dist/chunks/share-button-CqTd80g8.esm.js.map +0 -1
|
@@ -1,21 +1,73 @@
|
|
|
1
|
-
import{f as I,g as l,t as x,h as N,y as d,q as v,u as P,k as D,m as U}from"../chunks/lit-3QHn3fwl.esm.js";import{d as z}from"../chunks/lodash-P8OIs-at.esm.js";import{u as h,A as k,d as f,a as M,_ as C,i as m}from"../chunks/localize-IRs8JglT.esm.js";import{D as L,f as E,W as B,h as W,u as A,S as F}from"../chunks/routes-4Mnz2XZX.esm.js";import{p as K}from"../chunks/progress-bar-HVG_n8_6.esm.js";import{p as _}from"../chunks/promo-pill-label-81dVN7VY.esm.js";import{partnerLogosConfigDefaults as O}from"./beam-partner-logos.esm.js";import{c as j,d as V,a as q,e as y,b as w}from"../chunks/enforce-config-HksNiOMu.esm.js";import{_ as G}from"../chunks/loading-template-mLjOGXMj.esm.js";import{M as H,B as J}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{createScopedLocalStorage as Z}from"../utils/local-storage.esm.js";import{c as Q}from"../chunks/css-card-grid-r6wxRbPV.esm.js";import{_ as X}from"../chunks/checkbox-P2JYPqxl.esm.js";import{c as Y}from"../chunks/events-_4nImo3u.esm.js";import"../utils/logger.esm.js";import"../chunks/vendor--f7lkyBk.esm.js";const u={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose your impact",ctaPromoPrefixMessage:()=>"At no extra cost,",ctaPromoMessage:({donationPercentage:n="1"}={})=>`select a nonprofit and ${n}% of your purchase will be donated.`,ctaMessage:({donationPercentage:n="1%"}={})=>`Select a nonprofit and ${n} of your purchase will be donated, at no extra cost.`,submitButtonText:()=>"Confirm",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose"},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choisissez votre cause",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`Choisissez un organisme \xE0 but non lucratif et ${n}% lui sera vers\xE9 en votre nom, sans frais suppl\xE9mentaires.`,submitButtonText:()=>"Confirmer",submitButtonTextCompleted:()=>"Confirm\xE9!",chooseButtonText:()=>"Choisissez"},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"W\xE4hle deinen Impact",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`W\xE4hle eine der gemeinn\xFCtzigen Organisationen und spende ${n} deines Einkaufs ohne zus\xE4tzliche Kosten`,submitButtonText:()=>"Best\xE4tigen",submitButtonTextCompleted:()=>"Best\xE4tigt!",chooseButtonText:()=>"W\xE4hlen"},es:{ctaTitle:()=>"Elige tu contribuci\xF3n",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`Elige una organizaci\xF3n sin fines de lucro y donaremos ${n} de tu compra sin coste adicional.`,beamAttribution:()=>"Ofrecido por Beam",submitButtonText:()=>"Confirmar",submitButtonTextCompleted:()=>"\xA1Confirmado!",chooseButtonText:()=>"Elige"},it:{ctaTitle:()=>"Scegli dove fare la differenza",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`Seleziona un'organizzazione no-profit a cui devolvere l\u2019${n} del tuo acquisto, senza costi aggiuntivi`,beamAttribution:()=>"Gestito da Beam",submitButtonText:()=>"Confermare",submitButtonTextCompleted:()=>"Confermato!",chooseButtonText:()=>"Scegli"},pl:{beamAttribution:()=>"Wspierany przez Beam",ctaTitle:()=>"Wybierz inicjatyw\u0119, kt\xF3r\u0105 chcesz wesprze\u0107",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`Wybierz organizacj\u0119, kt\xF3rej przeka\u017Cesz ${n} warto\u015Bci Twoich zakup\xF3w \u2013 bez \u017Cadnych dodatkowych koszt\xF3w!`,submitButtonText:()=>"Zatwierd\u017A",submitButtonTextCompleted:()=>"Zatwierdzono!",chooseButtonText:()=>"Wybierz"}};var ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,s=(n,e,t,o)=>{for(var i=o>1?void 0:o?te(e,t):e,p=n.length-1,c;p>=0;p--)(c=n[p])&&(i=(o?c(e,t,i):c(i))||i);return o&&i&&ee(e,t,i),i};class r extends N{constructor(){super(...arguments),this.baseUrl=L,this.lang="en",this.debug=!1,this.draftConfig=!1,this.isMobile=window.innerWidth<768,this.didUserExpandNonprofits=!1,this.shouldUseNewPromoUI=!1,this.getChainNonprofits=async()=>{if(q(["transactionId","subscriptionId"],this),!this.hasCorrectTransactionConfig&&!this.hasCorrectSubscriptionConfig)throw new H;const e=await E({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{storeId:this.storeId,postalCode:this.postalCode,countryCode:this.countryCode,cart:this.cart??void 0,widgetName:B.redeem_transaction,options:{config:{draftConfig:this.draftConfig}},version:"1.0.0",lang:this.configLang}});return e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),this.localStorage.setItemJson("chainNonprofits",{createdAt:new Date,data:e}),e},this.updateNonprofitIdForRecord=async({selectedNonprofitId:e})=>this.transactionId?this.putTransaction({selectedNonprofitId:e}):this.subscriptionId?this.putSubscription({selectedNonprofitId:e}):null,this.putTransaction=async({selectedNonprofitId:e})=>(y(["apiKey","transactionId"],this),W({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},pathParams:{transactionId:Number(this.transactionId)},requestBody:{nonprofitId:e}})),this.putSubscription=async({selectedNonprofitId:e})=>(y(["apiKey","subscriptionId"],this),A({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{remoteSubscriptionId:this.subscriptionId,nonprofitId:e}})),this.nonprofitListDataController=new k(this,this.getChainNonprofits),this.selectionDataController=new k(this,this.updateNonprofitIdForRecord),this.localStorage=Z(this),this.makeHandleSelect=(e,t,o)=>async i=>{if(!this.allowChange)return;const p=this.selectedNonprofitId;if(i instanceof KeyboardEvent){let c=null;switch(i.key){case"ArrowUp":case"ArrowLeft":t===0?c=o[o.length-1]:c=o[t-1],i.preventDefault();break;case"ArrowRight":case"ArrowDown":t===o.length-1?c=o[0]:c=o[t+1],i.preventDefault();break;case"Enter":case" ":i.preventDefault();break;default:return}if(c){const b=this.renderRoot.querySelector(`[data-value="${c.nonprofit.id}"]`);b!==null&&(b.tabIndex=0,b.focus());return}}if(i.currentTarget instanceof HTMLElement){if(p===e)return;this.selectedNonprofitId=e}},this.handleSubmit=async()=>{const{selectedNonprofitId:e}=this;if(!this.allowSubmit||e==null)return;await this.selectionDataController.exec({selectedNonprofitId:e}),this.shouldUseStoredSelection&&(this.localStorage.setItem("nonprofit",e),this.localStorage.setItem("nonprofit_selected_at",new Date().toISOString()));const t=this.nonprofitListDataController?.data?.nonprofits.find(o=>o.nonprofit.id===e);this.dispatchEvent(new Y({selectedNonprofitId:e,nonprofitName:t?.nonprofit.name,source:B.redeem_transaction}))},this.evaluateBreakPoints=z(()=>{this.isMobile=window.innerWidth<768},50,{maxWait:50,leading:!0})}get configLang(){return F[this.lang]||"en"}get hasCorrectTransactionConfig(){return w(["apiKey","transactionId"],this)}get hasCorrectSubscriptionConfig(){return w(["apiKey","subscriptionId"],this)}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.evaluateBreakPoints)}async firstUpdated(e){await this.restoreStateFromCache()}async updated(e){const t=["baseUrl","storeId","apiKey","countryCode","postalCode","lang"];for(const o of t)if(e.has(o)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){super.disconnectedCallback()}restoreStateFromCache(){y(["apiKey"],this),this.shouldUseStoredSelection&&(this.selectedNonprofitId=parseInt(this.localStorage.getItem("nonprofit")||"")||void 0);try{const{createdAt:e=0,data:t}=this.localStorage.getItemJson("chainNonprofits")||{},o=2*60*60*1e3;new Date(e).valueOf()+o>new Date().valueOf()&&(this.nonprofitListDataController.data=t,this.nonprofitListDataController.loading=!1)}catch{}}get allowChange(){return this.selectionDataController.data==null&&!this.selectionDataController.loading}get allowSubmit(){return!!(this.selectedNonprofitId&&this.allowChange)}get shouldUseStoredSelection(){return!this.subscriptionId}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...O,...K,"--beam-RedeemTransaction-maxWidth":"1000px","--beam-RedeemTransaction-submitButton-color":"#fff","--beam-RedeemTransaction-submitButton-hover-color":"#fff","--beam-RedeemTransaction-submitButton-disabled-color":"#fff","--beam-RedeemTransaction-submitButton-backgroundColor":"#333","--beam-RedeemTransaction-submitButton-hover-backgroundColor":"#222","--beam-RedeemTransaction-submitButton-disabled-backgroundColor":"#767676","--beam-RedeemTransaction-submitButton-borderColor":"#333","--beam-RedeemTransaction-submitButton-hover-borderColor":"#222","--beam-RedeemTransaction-submitButton-disabled-borderColor":"#767676","--beam-RedeemTransaction-submitButton-fontSize":"14px","--beam-RedeemTransaction-submitButton-fontWeight":"inherit","--beam-RedeemTransaction-submitButton-fontFamily":"inherit","--beam-RedeemTransaction-submitButton-textTransform":"none","--beam-RedeemTransaction-submitButton-borderRadius":"0px","--beam-RedeemTransaction-submitButton-padding":"15px 30px","--beam-RedeemTransaction-submitButton-position":"right","--beam-RedeemTransaction-submitButton-positionRight-width":"auto","--beam-RedeemTransaction-submitButton-positionBottom-width":"100%","--beam-RedeemTransaction-submitButton-positionBottom-marginTop":"10px","--beam-RedeemTransaction-checkmark-color":"transparent","--beam-RedeemTransaction-checkmark-selected-color":"#fff","--beam-RedeemTransaction-checkmark-hover-color":"#fff","--beam-RedeemTransaction-checkmark-backgroundColor":"transparent","--beam-RedeemTransaction-checkmark-selected-backgroundColor":"#333","--beam-RedeemTransaction-checkmark-hover-backgroundColor":"#d9d9d9","--beam-RedeemTransaction-checkmark-borderColor":"transparent","--beam-RedeemTransaction-checkmark-selected-borderColor":"#333","--beam-RedeemTransaction-checkmark-hover-borderColor":"#d9d9d9","--beam-RedeemTransaction-options-minWidth":"250px","--beam-RedeemTransaction-options-columnCount":"2","--beam-RedeemTransaction-options-borderRadius":"0px","--beam-RedeemTransaction-options-borderWidth":"1px","--beam-RedeemTransaction-options-selected-borderWidth":"2px","--beam-RedeemTransaction-options-focus-borderWidth":"1px","--beam-RedeemTransaction-options-image-borderRadius":"0px","--beam-RedeemTransaction-options-borderColor":"#d9d9d9","--beam-RedeemTransaction-options-selected-borderColor":"currentColor","--beam-RedeemTransaction-options-hover-borderColor":"#ccc","--beam-RedeemTransaction-options-backgroundColor":"transparent","--beam-RedeemTransaction-options-selected-backgroundColor":"transparent","--beam-RedeemTransaction-options-hover-backgroundColor":"#f1f1f1","--beam-RedeemTransaction-options-marginTop":"15px",...f("--beam-RedeemTransaction-title",{fontSize:"1.25em",fontWeight:"bold"}),...f("--beam-RedeemTransaction-description",{marginTop:"0.5em"}),...f("--beam-RedeemTransaction-details-cause",{fontSize:"1em",fontWeight:"bold"}),...f("--beam-RedeemTransaction-details-impactDescription",{fontSize:"0.85em",marginTop:"10px"}),"--beam-RedeemTransaction-details-nonprofitName-fontWeight":"bold","--beam-RedeemTransaction-details-nonprofitName-fontStyle":"inherit","--beam-RedeemTransaction-details-fundingProgress-marginTop":"10px",...f("--beam-RedeemTransaction-details-fundingProgressLabel",{fontSize:"0.85em"}),"--beam-RedeemTransaction-cardStyle":"'image'","--beam-RedeemTransaction-options-icon-padding":"0px","--beam-RedeemTransaction-options-collapseNonprofits-mobile":"false","--beam-RedeemTransaction-options-collapseNonprofits-desktop":"false",..._},t=this.nonprofitListDataController?.data?.config?.web?.theme||{},o={...e,...t};return Object.assign(Object.create({toCSS(){return M(this)}}),o)}handleChooseClick(){this.didUserExpandNonprofits=!0}get shouldCollapse(){const e=this.cssVariables["--beam-RedeemTransaction-options-collapseNonprofits-mobile"]==="true",t=this.cssVariables["--beam-RedeemTransaction-options-collapseNonprofits-desktop"]==="true";return this.isMobile&&e||!this.isMobile&&t}renderSubmitButton(e){return d`
|
|
2
|
-
|
|
1
|
+
import{y as a,m as k,f as $,g as c,t as v,h as I,u as C,k as P,q as D}from"../chunks/lit-iNN5L_Qk.esm.js";import{d as N}from"../chunks/lodash-P8OIs-at.esm.js";import{u as h,A as y,d as f,a as L,i as m,_ as x}from"../chunks/localize-o-cYvHQf.esm.js";import{D as z,f as U,W as B,j as M,u as E,S as W}from"../chunks/routes-jmFlXAbv.esm.js";import{p as A}from"../chunks/progress-bar-PMU_xI3L.esm.js";import{p as F}from"../chunks/promo-pill-label-58PJRvSl.esm.js";import{partnerLogosConfigDefaults as j}from"./beam-partner-logos.esm.js";import{c as K,d as _,a as O,e as R,b as w}from"../chunks/enforce-config-ZAI7WYAd.esm.js";import{_ as V}from"../chunks/loading-template-t4fFsYtr.esm.js";import{M as H,B as q}from"../chunks/beam-errors-P-Lu07Ce.esm.js";import{createScopedLocalStorage as G}from"../utils/local-storage.esm.js";import{c as J}from"../chunks/css-card-grid-nEc--M5M.esm.js";import{c as Z}from"../chunks/events-_4nImo3u.esm.js";import"../utils/logger.esm.js";import"../chunks/vendor-GKiOHg2N.esm.js";const Q=({height:n="1em",width:e="1em"}={})=>a`
|
|
2
|
+
<svg
|
|
3
|
+
style="${k({height:n,width:e,position:"relative",bottom:"0"})}"
|
|
4
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
viewBox="0 0 24 24"
|
|
6
|
+
>
|
|
7
|
+
<!-- Filled Circle -->
|
|
8
|
+
<circle cx="12" cy="12" r="10" fill="currentColor" />
|
|
9
|
+
</svg>
|
|
10
|
+
`,p={en:{beamAttribution:()=>"Powered by Beam",ctaTitle:()=>"Choose your impact",ctaPromoPrefixMessage:()=>"At no extra cost,",ctaPromoMessage:({donationPercentage:n="1"}={})=>`At no extra cost, select a nonprofit and ${n}% will be donated there for you.`,ctaMessage:({donationPercentage:n="1%"}={})=>`At no extra cost, select a nonprofit and ${n}% will be donated there for you.`,submitButtonText:()=>"Confirm Free Donation",submitButtonTextCompleted:()=>"Confirmed!",chooseButtonText:()=>"Choose a nonprofit"},fr:{beamAttribution:()=>"Optimis\xE9 par Beam",ctaTitle:()=>"Choisissez votre cause",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`Choisissez un organisme \xE0 but non lucratif et ${n}% lui sera vers\xE9 en votre nom, sans frais suppl\xE9mentaires.`,submitButtonText:()=>"Confirmer",submitButtonTextCompleted:()=>"Confirm\xE9!",chooseButtonText:()=>"Choisissez"},de:{beamAttribution:()=>"Unterst\xFCtzt von Beam",ctaTitle:()=>"W\xE4hle deinen Impact",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`W\xE4hle eine der gemeinn\xFCtzigen Organisationen und spende ${n} deines Einkaufs ohne zus\xE4tzliche Kosten`,submitButtonText:()=>"Best\xE4tigen",submitButtonTextCompleted:()=>"Best\xE4tigt!",chooseButtonText:()=>"W\xE4hlen"},es:{ctaTitle:()=>"Elige tu contribuci\xF3n",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`Elige una organizaci\xF3n sin fines de lucro y donaremos ${n} de tu compra sin coste adicional.`,beamAttribution:()=>"Ofrecido por Beam",submitButtonText:()=>"Confirmar",submitButtonTextCompleted:()=>"\xA1Confirmado!",chooseButtonText:()=>"Elige"},it:{ctaTitle:()=>"Scegli dove fare la differenza",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`Seleziona un'organizzazione no-profit a cui devolvere l\u2019${n} del tuo acquisto, senza costi aggiuntivi`,beamAttribution:()=>"Gestito da Beam",submitButtonText:()=>"Confermare",submitButtonTextCompleted:()=>"Confermato!",chooseButtonText:()=>"Scegli"},pl:{beamAttribution:()=>"Wspierany przez Beam",ctaTitle:()=>"Wybierz inicjatyw\u0119, kt\xF3r\u0105 chcesz wesprze\u0107",ctaPromoPrefixMessage:()=>"",ctaPromoMessage:()=>"",ctaMessage:({donationPercentage:n="1%"}={})=>`Wybierz organizacj\u0119, kt\xF3rej przeka\u017Cesz ${n} warto\u015Bci Twoich zakup\xF3w \u2013 bez \u017Cadnych dodatkowych koszt\xF3w!`,submitButtonText:()=>"Zatwierd\u017A",submitButtonTextCompleted:()=>"Zatwierdzono!",chooseButtonText:()=>"Wybierz"}};var X=Object.defineProperty,Y=Object.getOwnPropertyDescriptor,d=(n,e,o,t)=>{for(var i=t>1?void 0:t?Y(e,o):e,b=n.length-1,l;b>=0;b--)(l=n[b])&&(i=(t?l(e,o,i):l(i))||i);return t&&i&&X(e,o,i),i};class r extends I{constructor(){super(...arguments),this.baseUrl=z,this.lang="en",this.debug=!1,this.draftConfig=!1,this.isMobile=window.innerWidth<768,this.didUserExpandNonprofits=!1,this.shouldUsePromoUI=!1,this.getChainNonprofits=async()=>{if(O(["transactionId","subscriptionId"],this),!this.hasCorrectTransactionConfig&&!this.hasCorrectSubscriptionConfig)throw new H;const e=await U({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{storeId:this.storeId,postalCode:this.postalCode,countryCode:this.countryCode,cart:this.cart??void 0,widgetName:B.redeem_transaction,options:{config:{draftConfig:this.draftConfig}},version:"2.0.0",lang:this.configLang}});return e.store?.id&&e.store.id!==this.storeId&&(this.storeId=e.store.id),this.localStorage.setItemJson("chainNonprofits",{createdAt:new Date,data:e}),e},this.updateNonprofitIdForRecord=async({selectedNonprofitId:e})=>this.transactionId?this.putTransaction({selectedNonprofitId:e}):this.subscriptionId?this.putSubscription({selectedNonprofitId:e}):null,this.putTransaction=async({selectedNonprofitId:e})=>(R(["apiKey","transactionId"],this),M({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},pathParams:{transactionId:Number(this.transactionId)},requestBody:{nonprofitId:e}})),this.putSubscription=async({selectedNonprofitId:e})=>(R(["apiKey","subscriptionId"],this),E({baseUrl:this.baseUrl,headers:{authorization:`Api-Key ${this.apiKey}`},requestBody:{remoteSubscriptionId:this.subscriptionId,nonprofitId:e}})),this.nonprofitListDataController=new y(this,this.getChainNonprofits),this.selectionDataController=new y(this,this.updateNonprofitIdForRecord),this.localStorage=G(this),this.makeHandleSelect=(e,o,t)=>async i=>{if(!this.allowChange)return;const b=this.selectedNonprofitId;if(i instanceof KeyboardEvent){let l=null;switch(i.key){case"ArrowUp":case"ArrowLeft":o===0?l=t[t.length-1]:l=t[o-1],i.preventDefault();break;case"ArrowRight":case"ArrowDown":o===t.length-1?l=t[0]:l=t[o+1],i.preventDefault();break;case"Enter":case" ":i.preventDefault();break;default:return}if(l){const u=this.renderRoot.querySelector(`[data-value="${l.nonprofit.id}"]`);u!==null&&(u.tabIndex=0,u.focus());return}}if(i.currentTarget instanceof HTMLElement){if(b===e)return;this.selectedNonprofitId=e}},this.handleSubmit=async()=>{const{selectedNonprofitId:e}=this;if(!this.allowSubmit||e==null)return;await this.selectionDataController.exec({selectedNonprofitId:e}),this.shouldUseStoredSelection&&(this.localStorage.setItem("nonprofit",e),this.localStorage.setItem("nonprofit_selected_at",new Date().toISOString()));const o=this.nonprofitListDataController?.data?.nonprofits.find(t=>t.nonprofit.id===e);this.dispatchEvent(new Z({selectedNonprofitId:e,nonprofitName:o?.nonprofit.name,source:B.redeem_transaction}))},this.evaluateBreakPoints=N(()=>{this.isMobile=window.innerWidth<768},50,{maxWait:50,leading:!0})}get configLang(){return W[this.lang]||"en"}get hasCorrectTransactionConfig(){return w(["apiKey","transactionId"],this)}get hasCorrectSubscriptionConfig(){return w(["apiKey","subscriptionId"],this)}connectedCallback(){super.connectedCallback(),window.addEventListener("resize",this.evaluateBreakPoints)}async firstUpdated(e){await this.restoreStateFromCache()}async updated(e){const o=["baseUrl","storeId","apiKey","countryCode","postalCode","lang"];for(const t of o)if(e.has(t)){await this.nonprofitListDataController.exec();break}}disconnectedCallback(){super.disconnectedCallback()}restoreStateFromCache(){R(["apiKey"],this),this.shouldUseStoredSelection&&(this.selectedNonprofitId=parseInt(this.localStorage.getItem("nonprofit")||"")||void 0);try{const{createdAt:e=0,data:o}=this.localStorage.getItemJson("chainNonprofits")||{},t=2*60*60*1e3;new Date(e).valueOf()+t>new Date().valueOf()&&(this.nonprofitListDataController.data=o,this.nonprofitListDataController.loading=!1)}catch{}}get allowChange(){return this.selectionDataController.data==null&&!this.selectionDataController.loading}get allowSubmit(){return!!(this.selectedNonprofitId&&this.allowChange)}get shouldUseStoredSelection(){return!this.subscriptionId}get cssVariables(){const e={"--beam-fontFamily":"inherit","--beam-fontStyle":"inherit","--beam-fontSize":"inherit","--beam-textColor":"inherit","--beam-backgroundColor":"inherit",...f("--beam-RedeemTransaction-title",{fontSize:"1.25em",fontWeight:"bold"}),...f("--beam-RedeemTransaction-description",{marginTop:"0.5em",lineHeight:"normal"}),...j,...A,"--beam-RedeemTransaction-maxWidth":"1000px","--beam-RedeemTransaction-submitButton-fontSize":"14px","--beam-RedeemTransaction-submitButton-fontWeight":"inherit","--beam-RedeemTransaction-submitButton-fontFamily":"inherit","--beam-RedeemTransaction-submitButton-textTransform":"uppercase","--beam-RedeemTransaction-submitButton-color":"#fff","--beam-RedeemTransaction-submitButton-backgroundColor":"#000000","--beam-RedeemTransaction-submitButton-borderRadius":"0px","--beam-RedeemTransaction-submitButton-borderColor":"#000000","--beam-RedeemTransaction-submitButton-padding":"16px 0px","--beam-RedeemTransaction-submitButton-width":"100%","--beam-RedeemTransaction-submitButton-marginTop":"10px","--beam-RedeemTransaction-submitButton-marginBottom":"10px","--beam-RedeemTransaction-submitButtonContainer-backgroundColor":"#fff","--beam-RedeemTransaction-submitButton-hover-backgroundColor":"#000000","--beam-RedeemTransaction-submitButton-hover-borderColor":"#000000","--beam-RedeemTransaction-submitButton-hover-color":"#fff","--beam-RedeemTransaction-submitButton-disabled-borderColor":"#767676","--beam-RedeemTransaction-submitButton-disabled-backgroundColor":"#767676","--beam-RedeemTransaction-submitButton-disabled-color":"#fff","--beam-RedeemTransaction-radioButton-color":"transparent","--beam-RedeemTransaction-radioButton-borderColor":"#707070","--beam-RedeemTransaction-radioButton-backgroundColor":"#fff","--beam-RedeemTransaction-radioButton-hover-color":"#fff","--beam-RedeemTransaction-radioButton-hover-backgroundColor":"#000","--beam-RedeemTransaction-radioButton-hover-borderColor":"#000","--beam-RedeemTransaction-radioButton-selected-borderColor":"#000","--beam-RedeemTransaction-radioButton-selected-backgroundColor":"#000","--beam-RedeemTransaction-radioButton-selected-color":"#fff","--beam-RedeemTransaction-options-minWidth":"0px","--beam-RedeemTransaction-options-columnCount":"1","--beam-RedeemTransaction-options-borderWidth":"1px","--beam-RedeemTransaction-options-image-borderRadius":"8px","--beam-RedeemTransaction-options-image-height":"70px","--beam-RedeemTransaction-options-image-height-mobile":"75px","--beam-RedeemTransaction-options-borderColor":"#d9d9d9","--beam-RedeemTransaction-options-backgroundColor":"transparent","--beam-RedeemTransaction-options-marginTop":"15px","--beam-RedeemTransaction-options-hover-backgroundColor":"#f1f1f1","--beam-RedeemTransaction-options-hover-borderWidth":".5px","--beam-RedeemTransaction-options-hover-borderColor":"#000000","--beam-RedeemTransaction-options-selected-borderColor":"#000000","--beam-RedeemTransaction-options-selected-borderWidth":".5px","--beam-RedeemTransaction-options-selected-backgroundColor":"#eee",...f("--beam-RedeemTransaction-options-details",{fontSize:"0.85em",marginTop:"0px",lineHeight:"normal",letterSpacing:"-0.45px"}),...f("--beam-RedeemTransaction-options-details-cause",{fontSize:"1em",fontWeight:"bold"}),"--beam-RedeemTransaction-options-details-nonprofitName-fontWeight":"normal","--beam-RedeemTransaction-options-details-nonprofitName-fontStyle":"inherit","--beam-RedeemTransaction-options-details-fundingProgress-marginTop":"3px",...f("--beam-RedeemTransaction-options-details-fundingProgressLabel",{fontSize:"0.85em",textTransform:"capitalize"}),"--beam-RedeemTransaction-cardStyle":"'image'","--beam-RedeemTransaction-options-icon-padding":"0px","--beam-RedeemTransaction-options-icon-backgroundColor":"#F3F3F3","--beam-RedeemTransaction-options-collapseNonprofits-mobile":"false","--beam-RedeemTransaction-options-collapseNonprofits-desktop":"false","--beam-RedeemTransaction-image-width":"13%","--beam-RedeemTransaction-image-height":"50%","--beam-RedeemTransaction-image-width-mobile":"16%",...F},o=this.nonprofitListDataController?.data?.config?.web?.theme||{},t={...e,...o};return Object.assign(Object.create({toCSS(){return L(this)}}),t)}handleChooseClick(){this.didUserExpandNonprofits=!0}get shouldCollapse(){const e=this.cssVariables["--beam-RedeemTransaction-options-collapseNonprofits-mobile"],o=this.cssVariables["--beam-RedeemTransaction-options-collapseNonprofits-desktop"],t=e?.toLowerCase()==="true",i=o?.toLowerCase()==="true";return this.isMobile&&t||!this.isMobile&&i}renderSubmitButton(e){return a`
|
|
11
|
+
${this.didUserExpandNonprofits||!this.shouldCollapse?a` <button
|
|
3
12
|
type="button"
|
|
4
13
|
?aria-disabled=${!this.allowSubmit}
|
|
5
14
|
@click="${this.handleSubmit}"
|
|
6
|
-
class="${
|
|
15
|
+
class="${C({isDisabled:!this.allowSubmit,submitButton:!0})}"
|
|
7
16
|
part="submitButton"
|
|
8
17
|
>
|
|
9
|
-
${this.selectionDataController.data!==null?
|
|
10
|
-
</button>`:
|
|
11
|
-
type="button"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
${this.selectionDataController.data!==null?m(this.configLang,e?.config?.web?.confirmedButton||p[this.configLang].submitButtonTextCompleted()):m(this.configLang,e?.config?.web?.confirmButton||p[this.configLang].submitButtonText())}
|
|
19
|
+
</button>`:a`
|
|
20
|
+
<button type="button" @click="${this.handleChooseClick}" class="submitButton" part="submitButton">
|
|
21
|
+
${m(this.configLang,e?.config?.web?.collapsedButton||p[this.configLang].chooseButtonText())}
|
|
22
|
+
</button>
|
|
23
|
+
`}
|
|
24
|
+
`}renderRadioButton(){return a`
|
|
25
|
+
<div class="radioButtonContainer">
|
|
26
|
+
<span part="radioButton" class="radioButton">
|
|
27
|
+
<span style="line-height: 0;"> ${Q({height:"7px",width:"7px"})} </span>
|
|
28
|
+
</span>
|
|
29
|
+
</div>
|
|
30
|
+
`}renderNonprofitImage(e,o){const t=this.cssVariables["--beam-RedeemTransaction-cardStyle"],i=o?t==="'icon'"?e.nonprofit.causeIconUrl:t==="'selected_icon'"?e.nonprofit.causeIconSelectedUrl:e.imageUrl:e.imageUrl;return a`
|
|
31
|
+
${o?a` <div class="icon-container">
|
|
32
|
+
<div class="icon-background">
|
|
33
|
+
<img src="${i}" alt="" role="presentation" class="icon" />
|
|
34
|
+
</div>
|
|
35
|
+
</div>`:a` <div
|
|
36
|
+
class="image-container"
|
|
37
|
+
style="${this.isMobile?"flex: 1 0 var(--beam-RedeemTransaction-image-width-mobile)":"flex: 1 0 var(--beam-RedeemTransaction-image-width)"}"
|
|
15
38
|
>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
39
|
+
<img
|
|
40
|
+
src="${i}"
|
|
41
|
+
alt=""
|
|
42
|
+
role="presentation"
|
|
43
|
+
class="image"
|
|
44
|
+
style="
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: ${this.isMobile?"var(--beam-RedeemTransaction-options-image-height-mobile)":"var(--beam-RedeemTransaction-options-image-height)"};
|
|
47
|
+
object-fit: cover;
|
|
48
|
+
border-radius: var(--beam-RedeemTransaction-options-image-borderRadius);}
|
|
49
|
+
"
|
|
50
|
+
/>
|
|
51
|
+
</div>`}
|
|
52
|
+
`}renderOptionDetail(e){return a`
|
|
53
|
+
<div class="detailsCause" style="${h("--beam-RedeemTransaction-options-details-cause")}">
|
|
54
|
+
${m(this.configLang,e.nonprofit.cause||"")}
|
|
55
|
+
</div>
|
|
56
|
+
<p class="detailsDescription">${P(m(this.configLang,e.impact.description||""))}</p>
|
|
57
|
+
`}renderProgressBar(e){return a`
|
|
58
|
+
<div class="progressBarContainer">
|
|
59
|
+
<beam-progress-bar value="${e.impact.goalProgressPercentage}" style="flex: 1;"></beam-progress-bar>
|
|
60
|
+
<span class="details-progressBarLabel">
|
|
61
|
+
${m(this.configLang,e.impact.goalProgressText)}
|
|
62
|
+
</span>
|
|
63
|
+
</div>
|
|
64
|
+
`}renderNonprofitDetails(e,o,t){return a`
|
|
65
|
+
<div class="details" part="details">
|
|
66
|
+
${this.renderOptionDetail(e)} ${this.renderPromoPill(e,o,t)}
|
|
67
|
+
</div>
|
|
68
|
+
`}renderPromoPill(e,o,t){return a`
|
|
69
|
+
${e.promo?.isActive&&this.shouldUsePromoUI&&o?a`<beam-promo-info-pill .promo=${t?.config?.web?.promo} shortVersion></beam-promo-info-pill>`:a``}
|
|
70
|
+
`}render(){const{selectedNonprofitId:e}=this,{data:o,loading:t}=this.nonprofitListDataController;if(t&&!o)return V();if(this.nonprofitListDataController.error)return this.debug?x({error:this.nonprofitListDataController.error}):"";if(this.selectionDataController.error&&this.debug)return x({error:this.selectionDataController.error});if(o==null)return this.debug?x({error:new q("No data")}):"";const i=o?.nonprofits||[],b=i.find(s=>s.nonprofit.id===e)||null,l=this.cssVariables["--beam-RedeemTransaction-cardStyle"]==="'icon'"||this.cssVariables["--beam-RedeemTransaction-cardStyle"]==="'selected_icon'";this.shouldUsePromoUI=!!o?.config?.web?.promo;const u=i.some(s=>!s.promo||!s.promo.isActive);return a`
|
|
19
71
|
<style>
|
|
20
72
|
:host {
|
|
21
73
|
${this.cssVariables.toCSS()}
|
|
@@ -26,121 +78,45 @@ import{f as I,g as l,t as x,h as N,y as d,q as v,u as P,k as D,m as U}from"../ch
|
|
|
26
78
|
<div
|
|
27
79
|
style="order: 3;"
|
|
28
80
|
tabindex="-1"
|
|
29
|
-
class="options cardGrid ${
|
|
81
|
+
class="options cardGrid ${C({isHidden:!this.didUserExpandNonprofits&&this.shouldCollapse})}"
|
|
30
82
|
part="options"
|
|
31
83
|
role="radiogroup"
|
|
32
84
|
aria-labelledby="beam-RedeemTransaction-title"
|
|
33
85
|
?aria-disabled=${!this.allowChange}
|
|
34
86
|
>
|
|
35
|
-
${
|
|
87
|
+
${D(i,s=>s.nonprofit.id,(s,g)=>{const T=e===s.nonprofit.id,S=T||b==null&&g===0;return a`
|
|
36
88
|
<div
|
|
37
|
-
class="option ${
|
|
89
|
+
class="option ${C({isSelected:T,isDisabled:!this.allowChange})}"
|
|
38
90
|
part="option"
|
|
39
91
|
role="radio"
|
|
40
|
-
tabindex="${
|
|
41
|
-
data-value=${
|
|
92
|
+
tabindex="${S?0:-1}"
|
|
93
|
+
data-value=${s.nonprofit.id}
|
|
42
94
|
?aria-checked=${T}
|
|
43
|
-
@click=${this.makeHandleSelect(
|
|
44
|
-
@keydown=${this.makeHandleSelect(
|
|
45
|
-
aria-label="${m(this.configLang,
|
|
46
|
-
style="
|
|
95
|
+
@click=${this.makeHandleSelect(s.nonprofit.id,g,i)}
|
|
96
|
+
@keydown=${this.makeHandleSelect(s.nonprofit.id,g,i)}
|
|
97
|
+
aria-label="${m(this.configLang,s.nonprofit.cause||"")}"
|
|
98
|
+
style="display: flex; flex-direction: column; padding: 11px; justify-content:center;"
|
|
47
99
|
>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
src="${a.nonprofit.causeIconUrl}"
|
|
51
|
-
alt=""
|
|
52
|
-
role="presentation"
|
|
53
|
-
style="
|
|
54
|
-
flex: 1;
|
|
55
|
-
height: auto;
|
|
56
|
-
width: 100%;
|
|
57
|
-
display: block;
|
|
58
|
-
padding: var(--beam-RedeemTransaction-options-icon-padding);
|
|
59
|
-
border-radius: var(--beam-RedeemTransaction-options-image-borderRadius, 0);
|
|
60
|
-
"
|
|
61
|
-
/>
|
|
62
|
-
</div>`:d` <div style="height: 100%; flex: 1 0 33%; display: flex; flex-direction: column;">
|
|
63
|
-
<img
|
|
64
|
-
src="${a.imageUrl}"
|
|
65
|
-
alt=""
|
|
66
|
-
role="presentation"
|
|
67
|
-
style="
|
|
68
|
-
flex: 1;
|
|
69
|
-
height: auto;
|
|
70
|
-
width: 100%;
|
|
71
|
-
object-fit: cover;
|
|
72
|
-
border-radius: var(--beam-RedeemTransaction-options-image-borderRadius, 0);
|
|
73
|
-
"
|
|
74
|
-
/>
|
|
75
|
-
</div>`}
|
|
76
|
-
<div
|
|
77
|
-
class="details"
|
|
78
|
-
part="details"
|
|
79
|
-
style="
|
|
80
|
-
flex: 1 1 67%;
|
|
81
|
-
height: 100%;
|
|
82
|
-
display: flex;
|
|
83
|
-
flex-direction: column;
|
|
84
|
-
flex-wrap: nowrap;
|
|
85
|
-
justify-content: space-between;
|
|
86
|
-
align-content: stretch;
|
|
87
|
-
align-items: stretch;
|
|
88
|
-
position: relative;
|
|
89
|
-
"
|
|
90
|
-
>
|
|
100
|
+
<div class="optionContainer" style="display: flex; align-items: flex-start; gap: 8px;">
|
|
101
|
+
${this.renderRadioButton()}
|
|
91
102
|
<div
|
|
92
|
-
class="
|
|
93
|
-
style="flex:
|
|
103
|
+
class="nonprofitInfoContainer"
|
|
104
|
+
style="flex: 1; display: flex; flex-direction: column; gap: 5px;"
|
|
94
105
|
>
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
float: right;
|
|
101
|
-
padding: 4px;
|
|
102
|
-
border-radius: 100%;
|
|
103
|
-
display: inline-flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
"
|
|
107
|
-
>
|
|
108
|
-
<span style="line-height: 0;"> ${X({height:"10px",width:"10px"})} </span>
|
|
109
|
-
</span>
|
|
110
|
-
${m(this.configLang,a.nonprofit.cause||"")}
|
|
111
|
-
</div>
|
|
112
|
-
<p class="details-impactDescription" style="flex: 1 1;">
|
|
113
|
-
${U(m(this.configLang,a.impact.description||""))}
|
|
114
|
-
</p>
|
|
115
|
-
<div class="details-promo-pill-container" style="margin-top: 5px">
|
|
116
|
-
${a.promo?.isActive&&this.shouldUseNewPromoUI&&S?d`<beam-promo-info-pill
|
|
117
|
-
.promo=${t?.config?.web?.promo}
|
|
118
|
-
shortVersion
|
|
119
|
-
></beam-promo-info-pill>`:d``}
|
|
120
|
-
</div>
|
|
121
|
-
<div
|
|
122
|
-
style="display: flex; margin-top: var(--beam-RedeemTransaction-details-fundingProgress-marginTop); align-items: center;"
|
|
123
|
-
>
|
|
124
|
-
<beam-progress-bar
|
|
125
|
-
value="${a.impact.goalProgressPercentage}"
|
|
126
|
-
style="flex: 1 0;"
|
|
127
|
-
></beam-progress-bar>
|
|
128
|
-
<span
|
|
129
|
-
class="details-fundingProgressLabel"
|
|
130
|
-
style="${h("--beam-RedeemTransaction-details-fundingProgressLabel")} white-space: nowrap; text-align: right; flex: 0 1; margin-left: 15px;"
|
|
131
|
-
>
|
|
132
|
-
${m(this.configLang,a.impact.goalProgressText)}
|
|
133
|
-
</span>
|
|
106
|
+
<div class="imageDetailContainer" style="display: flex; gap: 8px;">
|
|
107
|
+
${this.renderNonprofitImage(s,l)}
|
|
108
|
+
${this.renderNonprofitDetails(s,u,o)}
|
|
109
|
+
</div>
|
|
110
|
+
${this.renderProgressBar(s)}
|
|
134
111
|
</div>
|
|
135
112
|
</div>
|
|
136
113
|
</div>
|
|
137
114
|
`})}
|
|
138
115
|
</div>
|
|
139
116
|
|
|
140
|
-
<div
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
>
|
|
117
|
+
<div class="submitButtonContainer">${this.renderSubmitButton(o)}</div>
|
|
118
|
+
|
|
119
|
+
<div class="headerContainer">
|
|
144
120
|
<div>
|
|
145
121
|
<div
|
|
146
122
|
class="header-promo-pill-container"
|
|
@@ -152,39 +128,36 @@ import{f as I,g as l,t as x,h as N,y as d,q as v,u as P,k as D,m as U}from"../ch
|
|
|
152
128
|
id="beam-RedeemTransaction-title"
|
|
153
129
|
style="${h("--beam-RedeemTransaction-title")}; margin-right: 8px;"
|
|
154
130
|
>
|
|
155
|
-
${m(this.configLang,
|
|
131
|
+
${m(this.configLang,o?.config?.web?.title)||p[this.configLang].ctaTitle()}
|
|
156
132
|
</h3>
|
|
157
|
-
${this.
|
|
158
|
-
.promo=${
|
|
133
|
+
${this.shouldUsePromoUI?a`<beam-promo-info-pill
|
|
134
|
+
.promo=${o?.config?.web?.promo}
|
|
159
135
|
style="${this.isMobile&&"order: -1; margin-bottom:10px;"}"
|
|
160
|
-
></beam-promo-info-pill>`:
|
|
136
|
+
></beam-promo-info-pill>`:a``}
|
|
161
137
|
</div>
|
|
162
138
|
<p class="description" part="description" style="${h("--beam-RedeemTransaction-description")}">
|
|
163
|
-
${this.
|
|
164
|
-
${m(this.configLang,
|
|
139
|
+
${this.shouldUsePromoUI?a`<span style="font-weight:bold">
|
|
140
|
+
${m(this.configLang,o?.config?.web?.promoDescriptionPrefix||"")||p[this.configLang].ctaPromoPrefixMessage()}
|
|
165
141
|
</span>
|
|
166
142
|
<span>
|
|
167
|
-
${m(this.configLang,
|
|
168
|
-
</span>`:
|
|
169
|
-
>${m(this.configLang,
|
|
143
|
+
${m(this.configLang,o?.config?.web?.promoDescription||"")||p[this.configLang].ctaPromoMessage()}
|
|
144
|
+
</span>`:a`<span
|
|
145
|
+
>${m(this.configLang,o?.config?.web?.description||"")||p[this.configLang].ctaMessage()}
|
|
170
146
|
</span>`}
|
|
171
147
|
</p>
|
|
172
148
|
</div>
|
|
173
|
-
${!this.isMobile&&this.shouldUseNewPromoUI||!this.shouldUseNewPromoUI?this.renderSubmitButton(R):null}
|
|
174
149
|
</div>
|
|
175
150
|
|
|
176
|
-
${this.isMobile&&this.shouldUseNewPromoUI?d` <div style="order: 4;">${this.renderSubmitButton(R)}</div> `:null}
|
|
177
|
-
|
|
178
151
|
<beam-partner-logos
|
|
179
|
-
partnerName="${
|
|
180
|
-
partnerLogoUrl="${
|
|
152
|
+
partnerName="${o.chain.name}"
|
|
153
|
+
partnerLogoUrl="${o.chain.logoUrl}"
|
|
181
154
|
style="order: 1"
|
|
182
155
|
></beam-partner-logos>
|
|
183
156
|
</div>
|
|
184
|
-
`}}r.tagName="beam-redeem-transaction",r.styles=[
|
|
157
|
+
`}}r.tagName="beam-redeem-transaction",r.styles=[K,$`
|
|
185
158
|
:host {
|
|
186
159
|
display: block;
|
|
187
|
-
max-width: var(--beam-RedeemTransaction-maxWidth
|
|
160
|
+
max-width: var(--beam-RedeemTransaction-maxWidth);
|
|
188
161
|
font-family: var(--beam-fontFamily);
|
|
189
162
|
font-style: var(--beam-fontStyle);
|
|
190
163
|
font-size: var(--beam-fontSize);
|
|
@@ -197,48 +170,48 @@ import{f as I,g as l,t as x,h as N,y as d,q as v,u as P,k as D,m as U}from"../ch
|
|
|
197
170
|
align-items: flex-start;
|
|
198
171
|
justify-content: space-between;
|
|
199
172
|
display: flex;
|
|
173
|
+
order: 2;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.submitButtonContainer {
|
|
177
|
+
margin-top: var(--beam-RedeemTransaction-submitButton-marginTop);
|
|
178
|
+
margin-bottom: var(--beam-RedeemTransaction-submitButton-marginBottom);
|
|
179
|
+
background-color: var(--beam-RedeemTransaction-submitButtonContainer-backgroundColor);
|
|
200
180
|
}
|
|
201
181
|
|
|
202
182
|
.submitButton {
|
|
203
|
-
color: var(--beam-RedeemTransaction-submitButton-color
|
|
204
|
-
background-color: var(--beam-RedeemTransaction-submitButton-backgroundColor
|
|
205
|
-
border: 1px solid var(--beam-RedeemTransaction-submitButton-borderColor
|
|
206
|
-
font-size: var(--beam-RedeemTransaction-submitButton-fontSize
|
|
207
|
-
font-weight: var(--beam-RedeemTransaction-submitButton-fontWeight
|
|
208
|
-
font-family: var(--beam-RedeemTransaction-submitButton-fontFamily
|
|
209
|
-
text-transform: var(--beam-RedeemTransaction-submitButton-textTransform
|
|
210
|
-
border-radius: var(--beam-RedeemTransaction-submitButton-borderRadius
|
|
211
|
-
padding: var(--beam-RedeemTransaction-submitButton-padding
|
|
183
|
+
color: var(--beam-RedeemTransaction-submitButton-color);
|
|
184
|
+
background-color: var(--beam-RedeemTransaction-submitButton-backgroundColor);
|
|
185
|
+
border: 1px solid var(--beam-RedeemTransaction-submitButton-borderColor);
|
|
186
|
+
font-size: var(--beam-RedeemTransaction-submitButton-fontSize);
|
|
187
|
+
font-weight: var(--beam-RedeemTransaction-submitButton-fontWeight);
|
|
188
|
+
font-family: var(--beam-RedeemTransaction-submitButton-fontFamily);
|
|
189
|
+
text-transform: var(--beam-RedeemTransaction-submitButton-textTransform);
|
|
190
|
+
border-radius: var(--beam-RedeemTransaction-submitButton-borderRadius);
|
|
191
|
+
padding: var(--beam-RedeemTransaction-submitButton-padding);
|
|
192
|
+
width: var(--beam-RedeemTransaction-submitButton-width);
|
|
212
193
|
transition: background-color 0.2s, border-color 0.2s, color 0.2s;
|
|
213
194
|
cursor: pointer;
|
|
214
195
|
}
|
|
215
196
|
|
|
216
|
-
.submitButton.positionRight {
|
|
217
|
-
width: var(--beam-RedeemTransaction-submitButton-positionRight-width, auto);
|
|
218
|
-
margin-left: 30px;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
.submitButton.positionBottom {
|
|
222
|
-
width: var(--beam-RedeemTransaction-submitButton-positionBottom-width, 100%);
|
|
223
|
-
margin-top: var(--beam-RedeemTransaction-submitButton-positionBottom-marginTop, 10px);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
197
|
.submitButton:not(.isDisabled):focus-visible,
|
|
227
198
|
.submitButton:not(.isDisabled):hover {
|
|
228
|
-
background-color: var(--beam-RedeemTransaction-submitButton-hover-backgroundColor
|
|
229
|
-
border-color: var(--beam-RedeemTransaction-submitButton-hover-borderColor
|
|
230
|
-
color: var(--beam-RedeemTransaction-submitButton-hover-color
|
|
199
|
+
background-color: var(--beam-RedeemTransaction-submitButton-hover-backgroundColor);
|
|
200
|
+
border-color: var(--beam-RedeemTransaction-submitButton-hover-borderColor);
|
|
201
|
+
color: var(--beam-RedeemTransaction-submitButton-hover-color);
|
|
231
202
|
}
|
|
232
203
|
|
|
233
204
|
.submitButton.isDisabled {
|
|
234
|
-
color: var(--beam-RedeemTransaction-submitButton-disabled-color
|
|
235
|
-
background-color: var(--beam-RedeemTransaction-submitButton-disabled-backgroundColor
|
|
236
|
-
border-color: var(--beam-RedeemTransaction-submitButton-disabled-borderColor
|
|
205
|
+
color: var(--beam-RedeemTransaction-submitButton-disabled-color);
|
|
206
|
+
background-color: var(--beam-RedeemTransaction-submitButton-disabled-backgroundColor);
|
|
207
|
+
border-color: var(--beam-RedeemTransaction-submitButton-disabled-borderColor);
|
|
237
208
|
cursor: not-allowed;
|
|
238
209
|
}
|
|
239
210
|
|
|
240
211
|
.options {
|
|
241
|
-
margin-top: var(--beam-RedeemTransaction-options-marginTop
|
|
212
|
+
margin-top: var(--beam-RedeemTransaction-options-marginTop);
|
|
213
|
+
order: 3;
|
|
214
|
+
flex-grow: 1;
|
|
242
215
|
}
|
|
243
216
|
|
|
244
217
|
.options.isHidden {
|
|
@@ -246,22 +219,42 @@ import{f as I,g as l,t as x,h as N,y as d,q as v,u as P,k as D,m as U}from"../ch
|
|
|
246
219
|
}
|
|
247
220
|
|
|
248
221
|
.option {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
background-color: var(--beam-RedeemTransaction-options-backgroundColor, transparent);
|
|
222
|
+
border: var(--beam-RedeemTransaction-options-borderWidth) solid
|
|
223
|
+
var(--beam-RedeemTransaction-options-borderColor);
|
|
224
|
+
border-bottom: none;
|
|
225
|
+
background-color: var(--beam-RedeemTransaction-options-backgroundColor);
|
|
254
226
|
cursor: pointer;
|
|
255
227
|
transition: border-color 0.2s, background-color 0.2s, outline 0.2s;
|
|
256
228
|
}
|
|
257
229
|
|
|
230
|
+
.option:first-child {
|
|
231
|
+
border-radius: 8px 8px 0 0; /* Top corners rounded */
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.option:last-child {
|
|
235
|
+
border-bottom: var(--beam-RedeemTransaction-options-borderWidth) solid
|
|
236
|
+
var(--beam-RedeemTransaction-options-borderColor);
|
|
237
|
+
border-radius: 0 0 8px 8px; /* Bottom corners rounded */
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.option:not(.isDisabled):not(:last-child):focus-visible,
|
|
241
|
+
.option:not(.isDisabled):not(:last-child):hover,
|
|
242
|
+
.option:not(.isSelected):not(:last-child):focus-visible,
|
|
243
|
+
.option:not(.isSelected):not(:last-child):hover {
|
|
244
|
+
background-color: var(--beam-RedeemTransaction-options-hover-backgroundColor);
|
|
245
|
+
outline: var(--beam-RedeemTransaction-options-hover-borderWidth) solid
|
|
246
|
+
var(--beam-RedeemTransaction-options-hover-borderColor);
|
|
247
|
+
border-bottom: var(--beam-RedeemTransaction-options-hover-borderWidth) solid
|
|
248
|
+
var(--beam-RedeemTransaction-options-hover-borderColor);
|
|
249
|
+
}
|
|
250
|
+
|
|
258
251
|
.option:not(.isDisabled):focus-visible,
|
|
259
252
|
.option:not(.isDisabled):hover,
|
|
260
253
|
.option:not(.isSelected):focus-visible,
|
|
261
254
|
.option:not(.isSelected):hover {
|
|
262
|
-
background-color: var(--beam-RedeemTransaction-options-hover-backgroundColor
|
|
263
|
-
outline: var(--beam-RedeemTransaction-options-hover-borderWidth
|
|
264
|
-
var(--beam-RedeemTransaction-options-hover-borderColor
|
|
255
|
+
background-color: var(--beam-RedeemTransaction-options-hover-backgroundColor);
|
|
256
|
+
outline: var(--beam-RedeemTransaction-options-hover-borderWidth) solid
|
|
257
|
+
var(--beam-RedeemTransaction-options-hover-borderColor);
|
|
265
258
|
}
|
|
266
259
|
|
|
267
260
|
.option.isDisabled {
|
|
@@ -269,48 +262,126 @@ import{f as I,g as l,t as x,h as N,y as d,q as v,u as P,k as D,m as U}from"../ch
|
|
|
269
262
|
}
|
|
270
263
|
|
|
271
264
|
.option.isSelected {
|
|
272
|
-
outline: var(--beam-RedeemTransaction-options-selected-borderWidth
|
|
273
|
-
var(--beam-RedeemTransaction-options-selected-borderColor
|
|
274
|
-
background-color: var(--beam-RedeemTransaction-options-selected-backgroundColor
|
|
265
|
+
outline: var(--beam-RedeemTransaction-options-selected-borderWidth) solid
|
|
266
|
+
var(--beam-RedeemTransaction-options-selected-borderColor);
|
|
267
|
+
background-color: var(--beam-RedeemTransaction-options-selected-backgroundColor);
|
|
268
|
+
border-bottom: var(--beam-RedeemTransaction-options-selected-borderWidth) solid
|
|
269
|
+
var(--beam-RedeemTransaction-options-selected-borderColor);
|
|
275
270
|
}
|
|
276
271
|
|
|
277
272
|
.option.isSelected:focus-visible,
|
|
278
273
|
.option.isSelected:hover {
|
|
279
|
-
outline: var(--beam-RedeemTransaction-options-selected-borderWidth
|
|
280
|
-
var(--beam-RedeemTransaction-options-selected-borderColor
|
|
274
|
+
outline: var(--beam-RedeemTransaction-options-selected-borderWidth) solid
|
|
275
|
+
var(--beam-RedeemTransaction-options-selected-borderColor);
|
|
276
|
+
border-bottom: var(--beam-RedeemTransaction-options-selected-borderWidth) solid
|
|
277
|
+
var(--beam-RedeemTransaction-options-selected-borderColor);
|
|
281
278
|
}
|
|
282
279
|
|
|
283
|
-
.option .
|
|
280
|
+
.option .radioButton {
|
|
284
281
|
border-width: 1px;
|
|
285
282
|
border-style: solid;
|
|
286
283
|
transition: background-color 0.2s, color 0.2s, border-color 0.2s;
|
|
287
|
-
color: var(--beam-RedeemTransaction-
|
|
288
|
-
background-color: var(--beam-RedeemTransaction-
|
|
289
|
-
border-color: var(--beam-RedeemTransaction-
|
|
284
|
+
color: var(--beam-RedeemTransaction-radioButton-color);
|
|
285
|
+
background-color: var(--beam-RedeemTransaction-radioButton-backgroundColor);
|
|
286
|
+
border-color: var(--beam-RedeemTransaction-radioButton-borderColor);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.option.isSelected .radioButton,
|
|
290
|
+
.option.isSelected:focus-visible .radioButton,
|
|
291
|
+
.option.isSelected:hover .radioButton {
|
|
292
|
+
color: var(--beam-RedeemTransaction-radioButton-selected-color);
|
|
293
|
+
background-color: var(--beam-RedeemTransaction-radioButton-selected-backgroundColor);
|
|
294
|
+
border-color: var(--beam-RedeemTransaction-radioButton-selected-borderColor);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.option:not(.isSelected):focus-visible .radioButton,
|
|
298
|
+
.option:not(.isSelected):hover .radioButton {
|
|
299
|
+
color: var(--beam-RedeemTransaction-radioButton-hover-color);
|
|
300
|
+
background-color: var(--beam-RedeemTransaction-radioButton-hover-backgroundColor);
|
|
301
|
+
border-color: var(--beam-RedeemTransaction-radioButton-hover-borderColor);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.detailsDescription {
|
|
305
|
+
${h("--beam-RedeemTransaction-options-details")}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.detailsDescription .nonprofitName {
|
|
309
|
+
font-weight: var(--beam-RedeemTransaction-options-details-nonprofitName-fontWeight);
|
|
310
|
+
font-style: var(--beam-RedeemTransaction-options-details-nonprofitName-fontStyle);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.radioButtonContainer {
|
|
314
|
+
height: 100%;
|
|
315
|
+
display: flex;
|
|
316
|
+
align-items: center;
|
|
317
|
+
justify-content: center;
|
|
318
|
+
flex: 0 0 auto;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.radioButton {
|
|
322
|
+
padding: 5px;
|
|
323
|
+
border-radius: 100%;
|
|
324
|
+
display: inline-flex;
|
|
325
|
+
align-items: center;
|
|
326
|
+
justify-content: center;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.imageContainer {
|
|
330
|
+
flex: 1 0 var(--beam-RedeemTransaction-image-width);
|
|
331
|
+
display: flex;
|
|
332
|
+
flex-direction: column;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.progressBarContainer {
|
|
336
|
+
display: flex;
|
|
337
|
+
align-items: center;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.details-progressBarLabel {
|
|
341
|
+
${h("--beam-RedeemTransaction-options-details-fundingProgressLabel")}
|
|
342
|
+
white-space: nowrap;
|
|
343
|
+
text-align: right;
|
|
344
|
+
margin-left: 15px;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.details {
|
|
348
|
+
flex: 1 1 100%;
|
|
349
|
+
display: flex;
|
|
350
|
+
flex-direction: column;
|
|
351
|
+
gap: 5px;
|
|
290
352
|
}
|
|
291
353
|
|
|
292
|
-
.
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
color: var(--beam-RedeemTransaction-checkmark-selected-color, #fff);
|
|
296
|
-
background-color: var(--beam-RedeemTransaction-checkmark-selected-backgroundColor, #333);
|
|
297
|
-
border-color: var(--beam-RedeemTransaction-checkmark-selected-borderColor, #333);
|
|
354
|
+
.root {
|
|
355
|
+
display: flex;
|
|
356
|
+
flex-direction: column;
|
|
298
357
|
}
|
|
299
358
|
|
|
300
|
-
.
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
359
|
+
.submitButtonContainer {
|
|
360
|
+
order: 4;
|
|
361
|
+
position: sticky;
|
|
362
|
+
bottom: 0;
|
|
363
|
+
z-index: 999;
|
|
305
364
|
}
|
|
306
365
|
|
|
307
|
-
.
|
|
308
|
-
|
|
366
|
+
.icon-background {
|
|
367
|
+
width: 50px;
|
|
368
|
+
height: 50px;
|
|
369
|
+
border-radius: 50%;
|
|
370
|
+
overflow: hidden;
|
|
371
|
+
background: var(--beam-RedeemTransaction-options-icon-backgroundColor);
|
|
372
|
+
display: flex;
|
|
373
|
+
justify-content: center;
|
|
374
|
+
align-items: center;
|
|
309
375
|
}
|
|
310
376
|
|
|
311
|
-
.
|
|
312
|
-
|
|
313
|
-
|
|
377
|
+
.icon {
|
|
378
|
+
height: var(--beam-RedeemTransaction-image-height);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.icon-container {
|
|
382
|
+
display: flex;
|
|
383
|
+
justify-content: center;
|
|
384
|
+
align-items: center;
|
|
314
385
|
}
|
|
315
|
-
`,
|
|
386
|
+
`,J({gap:"0px",itemMinWidth:"var(--beam-RedeemTransaction-options-minWidth, 0px)",columnCount:"var(--beam-RedeemTransaction-options-columnCount, 1)"})],d([c({type:String})],r.prototype,"baseUrl",2),d([c({type:String})],r.prototype,"apiKey",2),d([c({type:Number})],r.prototype,"transactionId",2),d([c({type:String})],r.prototype,"subscriptionId",2),d([c({type:Number})],r.prototype,"storeId",2),d([c({type:String})],r.prototype,"countryCode",2),d([c({type:String})],r.prototype,"postalCode",2),d([c({type:Object})],r.prototype,"cart",2),d([c({type:Number,reflect:!0})],r.prototype,"selectedNonprofitId",2),d([c({type:String})],r.prototype,"lang",2),d([c({type:Boolean})],r.prototype,"debug",2),d([c({type:Boolean})],r.prototype,"draftConfig",2),d([v()],r.prototype,"isMobile",2),d([v()],r.prototype,"didUserExpandNonprofits",2),d([v()],r.prototype,"shouldUsePromoUI",2),_(r);export{r as BeamRedeemTransaction};
|
|
316
387
|
//# sourceMappingURL=redeem-transaction.esm.js.map
|