PageSourceSearch

https://shop.bonfiglioli.com/chunk-KEC5ZZTA.js

js bonfiglioli.com collected 2026-09-25 18:40:22 UTC 25,085 bytes, 1 lines download raw bytes

1import{a as we,b as Qe,c as U,d as Re}from"./chunk-26IJFY67.js";import{c as Ne}from"./chunk-THO5MGCT.js";import{a as ke,c as Be,d as Y,e as x,f as v,g as _e,h as T,i as h,j as I,k as be}from"./chunk-MA54ZH2D.js";import{b as j,d as Oe}from"./chunk-PT7T6VUB.js";import{d as Se}from"./chunk-Y6BPF2AF.js";import"./chunk-W3OE3L5D.js";import"./chunk-ALNMNLGQ.js";import{a as Ce,b as Ae,d as De,g as Te,j as Ie,l as Me,n as Ee}from"./chunk-CJFAJ6X7.js";import"./chunk-ZGQ2OYA5.js";import{C as me,H as Pe,J as ve}from"./chunk-VDWXESJF.js";import{Ea as H}from"./chunk-JCOTUPE5.js";import{B as D,Ec as ge,I as ce,Ib as de,Ja as G,Nb as ue,P as pe,_b as he,bb as W,ec as ye,gc as fe,jb as le,m as F,s as L}from"./chunk-TXT3R3MF.js";import{E as k,Ea as m,Ec as g,Fa as y,Fc as ee,Gc as te,Hc as b,Ja as r,Lc as w,Mc as Q,Md as R,Nb as B,Nd as N,Rc as ie,S as C,Sa as J,Ta as X,W as u,Wc as ne,Yc as O,ad as ae,bd as re,c as $,cd as oe,e as z,fa as Z,fc as _,gc as f,ge as se,kc as A,o as K,p as l,q as M,t as q,ua as o,x as S,xa as E}from"./chunk-PWAHSUDZ.js";import{a as p,b as d}from"./chunk-2BAXZMGZ.js";function qe(i,P){if(i&1){let e=ie();w(0),ee(1,"div",1),ne("click",function(){J(e);let n=O();return X(n.initTransaction())}),te(),Q()}}var We=["googlePayButtonContainer"];function He(i,P){i&1&&b(0,"div",3,0)}function je(i,P){if(i&1&&(w(0),A(1,He,2,0,"div",2),Q()),i&2){let e=P.ngIf;B(),g("ngIf",e)}}function Ye(i,P){if(i&1&&b(0,"cx-opf-apple-pay",2),i&2){let e=O().ngIf;g("activeConfiguration",e)}}function Ve(i,P){if(i&1&&b(0,"cx-opf-google-pay",2),i&2){let e=O().ngIf;g("activeConfiguration",e)}}function $e(i,P){if(i&1&&(w(0),A(1,Ye,1,1,"cx-opf-apple-pay",1)(2,Ve,1,1,"cx-opf-google-pay",1),Q()),i&2){let e=P.ngIf,t=O();B(),g("ngIf",t.isPaymentMethodEnabled(t.PAYMENT_METHODS.APPLE_PAY,e)),B(),g("ngIf",t.isPaymentMethodEnabled(t.PAYMENT_METHODS.GOOGLE_PAY,e))}}var Le=(()=>{class i{initialize(){this.applePaySession=this.getApplePaySession(),this.applePaySession&&(this.isDeviceSupported=this.applePaySession.canMakePayments())}constructor(){this.winRef=r(W),this.isDeviceSupported=!1,this.applePayApiVersion=3,this.initialize()}getApplePaySession(){let e=this.winRef.nativeWindow;if(e.ApplePaySession)return e.ApplePaySession}get statusSuccess(){return this.isDeviceSupported?this.applePaySession.STATUS_SUCCESS:1}get statusFailure(){return this.isDeviceSupported?this.applePaySession.STATUS_FAILURE:1}isApplePaySupported(e){return this.isDeviceSupported&&this.supportsVersion(this.applePayApiVersion)?this.canMakePaymentsWithActiveCard(e):l(!1)}supportsVersion(e){try{return this.isDeviceSupported&&this.applePaySession.supportsVersion(e)}catch(t){return!1}}canMakePayments(){try{return this.isDeviceSupported&&this.applePaySession.canMakePayments()}catch(e){return!1}}canMakePaymentsWithActiveCard(e){return this.isDeviceSupported?K(this.applePaySession.canMakePaymentsWithActiveCard(e)):l(!1)}createSession(e){return this.isDeviceSupported?new this.applePaySession(this.applePayApiVersion,e):void 0}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=m({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),ze=(()=>{class i{constructor(){this.applePaySessionWrapperService=r(Le)}start(e){return new $(t=>{let n;try{n=this.applePaySessionWrapperService.createSession(e.request)}catch(s){t.error(s);return}let a=s=>{n.abort(),t.error(s)};n.addEventListener(v.VALIDATE_MERCHANT,s=>{e.onValidateMerchant(s).pipe(u(1)).subscribe({next:c=>{n.completeMerchantValidation(c)},error:a})}),n.addEventListener(v.CANCEL,()=>{t.error({type:Oe.PAYMENT_CANCELLED})}),e.onPaymentMethodSelected&&n.addEventListener(v.PAYMENT_METHOD_SELECTED,s=>{e.onPaymentMethodSelected(s).pipe(u(1)).subscribe({next:c=>{n.completePaymentMethodSelection(c)},error:a})}),e.onShippingContactSelected&&!this.isShippingTypePickup(e)&&n.addEventListener(v.SHIPPING_CONTACT_SELECTED,s=>{e.onShippingContactSelected(s).pipe(u(1)).subscribe({next:c=>{n.completeShippingContactSelection(c)},error:a})}),e.onShippingMethodSelected&&!this.isShippingTypePickup(e)&&n.addEventListener(v.SHIPPING_METHOD_SELECTED,s=>{e.onShippingMethodSelected(s).pipe(u(1)).subscribe({next:c=>{n.completeShippingMethodSelection(c)},error:a})}),n.addEventListener(v.PAYMENT_AUTHORIZED,s=>{e.onPaymentAuthorized(s).pipe(u(1)).subscribe({next:c=>{n.completePayment(c),c?.errors?.length?a({message:c?.errors[0]?.message}):(t.next(c),t.complete())},error:a})}),n.begin()})}isShippingTypePickup(e){return e.request.shippingType===_e.STORE_PICKUP}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=m({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Ke=(()=>{class i{constructor(){this.opfPaymentFacade=r(j),this.applePaySessionWrapperService=r(Le),this.applePaySessionOrchestrator=r(ze),this.winRef=r(W),this.opfQuickBuyTransactionService=r(U),this.opfQuickBuyFacade=r(Be),this.paymentInProgress=!1,this.defaultApplePayCardParameters={shippingMethods:[],merchantCapabilities:["supports3DS"],supportedNetworks:["visa","masterCard","amex","discover"],requiredShippingContactFields:["email","name","postalAddress"],requiredBillingContactFields:["email","name","postalAddress"]}
1,this.initialTransactionDetails={context:T.PRODUCT,product:void 0,cart:void 0,quantity:0,addressIds:[],total:{label:Y,amount:"",currency:""},deliveryInfo:{type:h.SHIPPING,pickupDetails:void 0}},this.transactionDetails=this.initialTransactionDetails}initTransactionDetails(e){if(this.transactionDetails=d(p({},this.initialTransactionDetails),{addressIds:[]}),e?.cart&&(this.transactionDetails=d(p({},this.transactionDetails),{context:T.CART,cart:e.cart,total:{amount:`${e.cart.totalPrice?.value}`,label:`${e.cart.code}`,currency:e.cart?.totalPrice?.currencyIso}})),e?.product&&e?.quantity){let n=e.product.price?.value*e.quantity;this.transactionDetails=d(p({},this.transactionDetails),{context:T.PRODUCT,product:e.product,quantity:e.quantity,total:{amount:n.toString(),label:`${e.product?.name}${e.quantity>1?` x ${e.quantity}`:""}`,currency:e.product?.price?.currencyIso}})}return this.transactionDetails}start(e){return this.paymentInProgress?M(()=>new Error("Apple Pay is already in progress")):(this.paymentInProgress=!0,this.setApplePayRequestConfig(e).pipe(o(t=>this.applePaySessionOrchestrator.start({request:t,onValidateMerchant:n=>this.handleValidation(n),onShippingContactSelected:n=>this.handleShippingContactSelected(n),onPaymentMethodSelected:n=>this.handlePaymentMethodSelected(n),onShippingMethodSelected:n=>this.handleShippingMethodSelected(n),onPaymentAuthorized:n=>this.handlePaymentAuthorized(n)})),u(1),C(t=>M(()=>t)),Z(()=>{this.deleteUserAddresses(),this.paymentInProgress=!1})))}isApplePaySupported(e){return this.applePaySessionWrapperService.isApplePaySupported(e)}deleteUserAddresses(){this.transactionDetails.addressIds.length&&(this.opfQuickBuyTransactionService.deleteUserAddresses([...this.transactionDetails.addressIds]),this.transactionDetails.addressIds=[])}handleValidation(e){return this.validateOpfAppleSession(e)}setApplePayRequestConfig(e){this.transactionDetails=this.initTransactionDetails(e);let t=e?.countryCode||"",n=d(p({},this.defaultApplePayCardParameters),{currencyCode:this.transactionDetails.total.currency,total:{amount:this.transactionDetails.total.amount,label:this.transactionDetails.total.label},countryCode:t});return k({deliveryInfo:this.opfQuickBuyTransactionService.getTransactionDeliveryInfo(),merchantName:this.opfQuickBuyTransactionService.getMerchantName()}).pipe(o(({deliveryInfo:a,merchantName:s})=>(this.transactionDetails.total.label=s,n.total.label=s,this.transactionDetails.deliveryInfo=a,l(void 0))),S(a=>(a&&(this.transactionDetails.deliveryInfo=a),n)))}validateOpfAppleSession(e){return this.opfQuickBuyTransactionService.handleCartGuestUser().pipe(o(()=>this.opfQuickBuyTransactionService.getCurrentCartId()),o(t=>{let n={validationUrl:e.validationURL,initiative:"web",initiativeContext:(this.winRef?.nativeWindow).location?.hostname,cartId:t};return this.verifyApplePaySession(n)}))}convertAppleToOpfAddress(e,t=!1){let n="[FIELD_NOT_SET]";return{firstName:t?n:e?.givenName,lastName:t?n:e?.familyName,line1:t?n:e?.addressLines?.[0],line2:e?.addressLines?.[1],email:e?.emailAddress,town:e?.locality,district:e?.administrativeArea,postalCode:e?.postalCode,phone:e?.phoneNumber,country:{isocode:e?.countryCode,name:e?.country},defaultAddress:!1}}handleShippingContactSelected(e){let t=this.convertAppleToOpfAddress(e.shippingContact,!0),n=this.updateApplePayForm(p({},this.transactionDetails.total));return this.opfQuickBuyTransactionService.setDeliveryAddress(t).pipe(E(a=>{this.recordDeliveryAddress(a)}),o(()=>this.opfQuickBuyTransactionService.getSupportedDeliveryModes()),u(1),S(a=>{if(!a.length)return l(d(p({},n),{errors:[this.getApplePayFormWithError("No shipment methods available for this delivery address")]}));let s=a.map(c=>({identifier:c.code,label:c.name,amount:(c.deliveryCost?.value).toFixed(2),detail:c.description??c.name}));return n.newShippingMethods=s,n}),o(()=>this.opfQuickBuyTransactionService.getCurrentCartTotalPrice()),o(a=>a?(this.transactionDetails.total.amount=a.toString(),n.newTotal.amount=a.toString(),l(n)):M(()=>new Error("Total Price not available"))))}handlePaymentMethodSelected(e){let t=this.updateApplePayForm(p({}
1,this.transactionDetails.total));return l(t)}handleShippingMethodSelected(e){let t=this.updateApplePayForm(p({},this.transactionDetails.total));return this.opfQuickBuyTransactionService.setDeliveryMode(e.shippingMethod.identifier).pipe(o(()=>this.opfQuickBuyTransactionService.getCurrentCart()),u(1),o(n=>n?.totalPrice?.value?(t.newTotal.amount=n.totalPrice.value.toString(),this.transactionDetails.total.amount=n.totalPrice.value.toString(),l(t)):M(()=>new Error("Total Price not available"))))}handlePaymentAuthorized(e){let t={status:this.applePaySessionWrapperService.statusSuccess},n;return this.placeOrderAfterPayment(e.payment).pipe(S(a=>(n=a,n?t:d(p({},t),{status:this.applePaySessionWrapperService.statusFailure}))),C(a=>l(d(p({},t),{status:this.applePaySessionWrapperService.statusFailure,errors:[this.getApplePayFormWithError(a?.message??"Payment error")]}))))}verifyApplePaySession(e){return this.opfQuickBuyFacade.getApplePayWebSession(e)}recordDeliveryAddress(e){this.transactionDetails.addressIds?.includes(e)||this.transactionDetails.addressIds?.push(e)}placeOrderAfterPayment(e){if(!e)return l(!1);let{shippingContact:t,billingContact:n}=e;if(!n)throw new Error("Error: empty billingContact");if(this.transactionDetails.deliveryInfo?.type===h.SHIPPING&&!t)throw new Error("Error: empty shippingContact");return(this.transactionDetails.deliveryInfo?.type===h.PICKUP?this.opfQuickBuyTransactionService.setDeliveryMode(h.PICKUP.toLocaleLowerCase()).pipe(o(()=>this.opfQuickBuyTransactionService.setBillingAddress(this.convertAppleToOpfAddress(n)))):this.opfQuickBuyTransactionService.setDeliveryAddress(this.convertAppleToOpfAddress(t)).pipe(E(s=>{this.recordDeliveryAddress(s)}),o(()=>this.opfQuickBuyTransactionService.setBillingAddress(this.convertAppleToOpfAddress(n))))).pipe(o(()=>t?.emailAddress?this.opfQuickBuyTransactionService.updateCartGuestUserEmail(t.emailAddress):l(!0)),o(()=>{let s=btoa(JSON.stringify(e.token.paymentData));return this.opfPaymentFacade.submitPayment({additionalData:[],paymentSessionId:"",callbacks:{onSuccess:()=>{},onPending:()=>{},onFailure:()=>{}},paymentMethod:I.APPLE_PAY,encryptedToken:s})}))}updateApplePayForm(e){return{newTotal:{amount:e.amount,label:e.label}}}getApplePayFormWithError(e,t="unknown"){return{code:t,message:e}}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=m({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Ze=(()=>{class i{constructor(){this.applePayService=r(Ke),this.currentProductService=r(H),this.opfQuickBuyTransactionService=r(U)}ngOnInit(){this.applePayDigitalWallet=this.activeConfiguration?.digitalWalletQuickBuy?.find(e=>e.provider===I.APPLE_PAY),!(!this.applePayDigitalWallet?.merchantId||!this.applePayDigitalWallet?.countryCode)&&(this.isApplePaySupported$=this.applePayService.isApplePaySupported(this.applePayDigitalWallet.merchantId))}initActiveCartTransaction(){return this.opfQuickBuyTransactionService.getCurrentCart().pipe(u(1),o(e=>this.applePayService.start({cart:e,countryCode:this.applePayDigitalWallet?.countryCode})))}initTransaction(){this.opfQuickBuyTransactionService.getTransactionLocationContext().pipe(u(1),o(()=>this.initActiveCartTransaction())).subscribe()}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=_({type:i,selectors:[["cx-opf-apple-pay"]],inputs:{activeConfiguration:"activeConfiguration"},decls:2,vars:3,consts:[[4,"ngIf"],[1,"apple-pay-button",3,"click"]],template:function(t,n){t&1&&(A(0,qe,2,0,"ng-container",0),R(1,"async")),t&2&&g("ngIf",N(1,1,n.isApplePaySupported$))},dependencies:[F,L],encapsulation:2,changeDetection:0})}}return i})(),Je=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=f({type:i})}static{this.\u0275inj=y({imports:[D]})}}return i})(),V=(()=>{class i{constructor(){this.opfBaseFacade=r(Ee),this.checkoutConfig=r(Se),this.authService=r(ge),this.userIdService=r(fe),this.cartGuestUserFacade=r(ve),this.activeCartFacade=r(Pe),this.multiCartFacade=r(me)}getPaymentGatewayConfiguration(){return this.opfBaseFacade.getActiveConfigurationsState().pipe(S(e=>(e?.data?.value||[]).filter(t=>t?.providerType===Ie.PAYMENT_GATEWAY)[0]))}getQuickBuyProviderConfig(e,t){let n;return t&&t.digitalWalletQuickBuy&&(n=t?.digitalWalletQuickBuy.find(a=>a.provider===e)),n}isQuickBuyProviderEnabled(e,t){let n=!1;return t&&t.digitalWalletQuickBuy&&(n=!!t?.digitalWalletQuickBuy.find(a=>a.provider===e)?.enabled),n}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=m({token:i,factory:i.\u0275fac})}}return i})(),Ge=(()=>{class i{constructor(){this.opfResourceLoaderService=r(Me),this.currentProductService=r(H),this.opfPaymentFacade=r(j),this.opfQuickBuyTransactionService=r(U),this.opfQuickBuyButtonsService=r(V),this.opfQuickBuyConfig=r(ke),this.googlePaymentClientOptions={environment:"TEST"},this.initialGooglePaymentRequest={apiVersion:2,apiVersionMinor:0,callbackIntents:["PAYMENT_AUTHORIZATION","SHIPPING_ADDRESS","SHIPPING_OPTION"],merchantInfo:{merchantName:Y},shippingOptionRequired:!0,shippingAddressRequired:!0,shippingAddressParameters:{phoneNumberRequired:!1},emailRequired:!0},this.defaultGooglePayCardParameters={allowedAuthMethods:["PAN_ONLY","CRYPTOGRAM_3DS"],allowedCardNetworks:["AMEX","DISCOVER","INTERAC","JCB","MASTERCARD","VISA"],billingAddressRequired:!0,billingAddressParameters:{format:"FULL"}},this.initialTransactionInfo={totalPrice:"0.00",totalPriceStatus:"ESTIMATED",currencyCode:"USD"}
1,this.initialTransactionDetails={context:T.PRODUCT,product:void 0,cart:void 0,quantity:0,deliveryInfo:{type:h.SHIPPING,pickupDetails:void 0},addressIds:[],total:{label:"",amount:"",currency:""}},this.googlePaymentRequest=this.initialGooglePaymentRequest,this.transactionDetails=this.initialTransactionDetails}updateGooglePaymentClient(){this.googlePaymentClient=new google.payments.api.PaymentsClient(this.googlePaymentClientOptions)}setGooglePaymentRequestConfig(e,t){e===h.PICKUP?(this.googlePaymentClientOptions=d(p({},this.googlePaymentClientOptions),{paymentDataCallbacks:{onPaymentAuthorized:this.handlePaymentCallbacks().onPaymentAuthorized}}),this.googlePaymentRequest=d(p({},this.initialGooglePaymentRequest),{shippingAddressRequired:!1,shippingOptionRequired:!1,callbackIntents:["PAYMENT_AUTHORIZATION"]})):(this.googlePaymentClientOptions=d(p({},this.googlePaymentClientOptions),{paymentDataCallbacks:this.handlePaymentCallbacks()}),this.googlePaymentRequest=this.initialGooglePaymentRequest),this.googlePaymentRequest.merchantInfo.merchantName=t,this.updateGooglePaymentClient()}loadResources(){let e=this.opfQuickBuyConfig?.providers?.[be];return e?.resourceUrl?.length?this.opfResourceLoaderService.loadResources([{url:e.resourceUrl}]):Promise.reject("Config not found")}initClient(e){this.setAllowedPaymentMethodsConfig(e),this.updateGooglePaymentClient()}getClient(){return this.googlePaymentClient}isReadyToPay(){return this.googlePaymentClient.isReadyToPay(this.googlePaymentRequest)}updateTransactionInfo(e){this.googlePaymentRequest.transactionInfo=e}getShippingOptionParameters(){return this.opfQuickBuyTransactionService.getSupportedDeliveryModes().pipe(u(1),S(e=>({defaultSelectedOptionId:e[0]?.code,shippingOptions:e?.map(t=>({id:t?.code,label:t?.name,description:t?.description}))})))}getNewTransactionInfo(e){let t,n=e?.totalPriceWithTax;return n&&n.value&&n.currencyIso&&(t={totalPrice:n.value.toString(),currencyCode:n.currencyIso.toString(),totalPriceStatus:"FINAL"}),t}setDeliveryAddress(e){let t=this.convertAddress(e);return this.transactionDetails?.deliveryInfo?.type===h.SHIPPING?this.opfQuickBuyTransactionService.setDeliveryAddress(t).pipe(E(n=>{this.associateAddressId(n)})):l(h.PICKUP)}setBillingAddress(e){return this.opfQuickBuyTransactionService.setBillingAddress(this.convertAddress(e))}setDeliveryMode(e,t){return t===h.PICKUP&&(e=h.PICKUP.toLocaleLowerCase()),!e&&t===h.SHIPPING?l(void 0):e&&this.verifyShippingOption(e)?this.opfQuickBuyTransactionService.setDeliveryMode(e):l(void 0)}convertAddress(e){let t={firstName:x,lastName:x,country:{isocode:e?.countryCode},town:e?.locality,district:e?.administrativeArea,postalCode:e?.postalCode,line1:e?.address1||x,line2:`${e?.address2} ${e?.address3}`};return e?.name&&(t=p(p({},t),this.getFirstAndLastName(e?.name))),t}handleActiveCartTransaction(){return this.transactionDetails.context=T.CART,this.opfQuickBuyTransactionService.handleCartGuestUser().pipe(o(()=>k({deliveryInfo:this.opfQuickBuyTransactionService.getTransactionDeliveryInfo(),merchantName:this.opfQuickBuyTransactionService.getMerchantName()}).pipe(o(({deliveryInfo:e,merchantName:t})=>(this.transactionDetails.deliveryInfo=e,this.setGooglePaymentRequestConfig(e.type,t),this.setDeliveryMode(void 0,e.type).pipe(o(()=>this.opfQuickBuyTransactionService.getCurrentCart().pipe(u(1),E(n=>{this.transactionDetails.cart=n,this.updateTransactionInfo({totalPrice:`${n.totalPrice?.value}`,currencyCode:n.totalPrice?.currencyIso||this.initialTransactionInfo.currencyCode,totalPriceStatus:this.initialTransactionInfo.totalPriceStatus})})))))))))}initTransaction(){this.transactionDetails=d(p({},this.initialTransactionDetails),{addressIds:[]}),this.opfQuickBuyTransactionService.getTransactionLocationContext().pipe(o(e=>(this.transactionDetails.context=e,this.handleActiveCartTransaction()))).subscribe(()=>{this.googlePaymentClient.loadPaymentData(this.googlePaymentRequest).catch(e=>{e.statusCode==="CANCELED"&&this.deleteAssociatedAddresses()})})}renderPaymentButton(e){e.nativeElement.appendChild(this.getClient().createButton({onClick:()=>this.initTransaction(),buttonSizeMode:"fill"}))}handlePaymentCallbacks(){return{onPaymentAuthorized:e=>q(this.setDeliveryAddress(e.shippingAddress).pipe(o(()=>this.setBillingAddress(e.paymentMethodData.info?.billingAddress)),o(()=>e?.email?this.opfQuickBuyTransactionService.updateCartGuestUserEmail(e.email):l(!0)),o(()=>{let t=btoa(e.paymentMethodData.tokenizationData.token);return this.opfPaymentFacade.submitPayment({additionalData:[],paymentSessionId:"",callbacks:{onSuccess:()=>{},onPending:()=>{},onFailure:()=>{}},paymentMethod:I.GOOGLE_PAY,encryptedToken:t})}),C(()=>l(!1)))).then(t=>(this.deleteAssociatedAddresses(),{transactionState:t?"SUCCESS":"ERROR"})),onPaymentDataChanged:e=>q(this.setDeliveryAddress(e.shippingAddress).pipe(o(()=>this.getShippingOptionParameters()),o(t=>{let n=this.verifyShippingOption(e.shippingOptionData?.id)??t?.defaultSelectedOptionId;return this.setDeliveryMode(n).pipe(o(()=>k([this.opfQuickBuyTransactionService.getCurrentCart(),this.opfQuickBuyTransactionService.getSelectedDeliveryMode()])),o(([a,s])=>{let c={newShippingOptionParameters:t,newTransactionInfo:this.getNewTransactionInfo(a)};return c.newShippingOptionParameters?.defaultSelectedOptionId&&(c.newShippingOptionParameters.defaultSelectedOptionId=s?.code),l(c)}))})))}}verifyShippingOption(e){return e==="shipping_option_unselected"?void 0:e}associateAddressId(e){this.isAddressIdAssociated(e)||this.transactionDetail
1s.addressIds.push(e)}isAddressIdAssociated(e){return this.transactionDetails.addressIds.includes(e)}resetAssociatedAddresses(){this.transactionDetails.addressIds=[]}deleteAssociatedAddresses(){this.transactionDetails.addressIds?.length&&(this.opfQuickBuyTransactionService.deleteUserAddresses(this.transactionDetails.addressIds),this.resetAssociatedAddresses())}getFirstAndLastName(e){let t=e?.split(" ")[0],n=e?.substring(t?.length)||t;return{firstName:t,lastName:n}}setAllowedPaymentMethodsConfig(e){let t=this.opfQuickBuyButtonsService.getQuickBuyProviderConfig(I.GOOGLE_PAY,e);this.googlePaymentRequest.allowedPaymentMethods=[{parameters:p({},this.defaultGooglePayCardParameters),tokenizationSpecification:{parameters:{gateway:String(t?.googlePayGateway),gatewayMerchantId:String(e.merchantId)},type:e.providerType},type:"CARD"}]}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=m({token:i,factory:i.\u0275fac,providedIn:"root"})}}return i})(),Xe=(()=>{class i{constructor(){this.opfGooglePayService=r(Ge),this.changeDetectionRef=r(se),this.isReadyToPayState$=new z(!1)}ngOnInit(){this.opfGooglePayService.loadResources().then(()=>{this.opfGooglePayService.initClient(this.activeConfiguration),this.opfGooglePayService.isReadyToPay().then(e=>{this.isReadyToPayState$.next(!!e?.result),this.changeDetectionRef.detectChanges(),e.result&&this.googlePayButtonContainer&&this.opfGooglePayService.renderPaymentButton(this.googlePayButtonContainer)})})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=_({type:i,selectors:[["cx-opf-google-pay"]],viewQuery:function(t,n){if(t&1&&ae(We,5),t&2){let a;re(a=oe())&&(n.googlePayButtonContainer=a.first)}},inputs:{activeConfiguration:"activeConfiguration"},decls:2,vars:3,consts:[["googlePayButtonContainer",""],[4,"ngIf"],["class","cx-opf-google-pay-button",4,"ngIf"],[1,"cx-opf-google-pay-button"]],template:function(t,n){t&1&&(A(0,je,2,1,"ng-container",1),R(1,"async")),t&2&&g("ngIf",N(1,1,n.isReadyToPayState$))},dependencies:[F,L],encapsulation:2,changeDetection:0})}}return i})(),et=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=f({type:i})}static{this.\u0275inj=y({providers:[Ge],imports:[D]})}}return i})(),tt=(()=>{class i{constructor(){this.opfQuickBuyButtonsService=r(V),this.PAYMENT_METHODS=I}ngOnInit(){this.paymentGatewayConfig$=this.opfQuickBuyButtonsService.getPaymentGatewayConfiguration()}isPaymentMethodEnabled(e,t){return this.opfQuickBuyButtonsService.isQuickBuyProviderEnabled(e,t)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=_({type:i,selectors:[["cx-opf-quick-buy-buttons"]],decls:2,vars:3,consts:[[4,"ngIf"],[3,"activeConfiguration",4,"ngIf"],[3,"activeConfiguration"]],template:function(t,n){t&1&&(A(0,$e,3,2,"ng-container",0),R(1,"async")),t&2&&g("ngIf",N(1,1,n.paymentGatewayConfig$))},dependencies:[F,Ze,Xe,L],encapsulation:2,changeDetection:0})}}return i})(),it=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=f({type:i})}static{this.\u0275inj=y({providers:[V,G({cmsComponents:{OpfQuickBuyButtonsComponent:{component:tt}}})],imports:[D,Je,et]})}}return i})(),xe=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=f({type:i})}static{this.\u0275inj=y({imports:[it]})}}return i})();var nt=(()=>{class i{constructor(){this.http=r(pe),this.converter=r(de),this.opfEndpointsService=r(Ne),this.config=r(De),this.opfMetadataStatePersistanceService=r(Te),this.logger=r(le),this.headerWithNoLanguage={accept:"application/json","Content-Type":"application/json"},this.headerWithContentLanguage=d(p({},this.headerWithNoLanguage),{"Content-Language":this.opfMetadataStatePersistanceService.getActiveLanguage()})}getApplePayWebSession(e,t){let n=new ce(this.headerWithContentLanguage).set(Ce,this.config.opf?.commerceCloudPublicKey||"").set(Ae,t||""),a=this.getApplePayWebSessionEndpoint();return this.http.post(a,e,{headers:n}).pipe(C(s=>{throw ye(s,this.logger)}),he({shouldRetry:ue,maxTries:2}),this.converter.pipeable(Re))}getApplePayWebSessionEndpoint(){return this.opfEndpointsService.buildUrl("getApplePayWebSession")}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=m({token:i,factory:i.\u0275fac})}}return i})(),at={backend:{opfApi:{endpoints:{getApplePayWebSession:"payments/apple-pay-web-sessions"}}}},Ue=(()=>
1{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=f({type:i})}static{this.\u0275inj=y({providers:[G(at),{provide:we,useClass:nt}],imports:[D]})}}return i})();var xt=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=f({type:i})}static{this.\u0275inj=y({imports:[xe,Qe,Ue]})}}return i})();export{xt as OpfQuickBuyModule};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.