1import{br as d,bs as p,S as l}from"./storefrontApp.5Jl33SLO.min.js";import{e as m,n as u}from"./chunk-vendor-lit.NvY0u02.js";import{P}from"./chunk-product_stock_changed_handler.D1B5WJH.js";import{S as _}from"./chunk-storefront_base_lit_element.BngXaMu.js";import"./chunk-vendor-di.Bh23gdA.js";import"./chunk-storefront_settings_constants.DIF02Gz.js";import"./chunk-vendor-rxjs.Dp7kflo.js";import"./chunk-vendor-lodash.CWHFt7Z.js";import"./chunk-vendor-phoenix.cdKS79L.js";import"./chunk-product_events_constants.BHFu5GP.js";var y=Object.defineProperty,f=Object.getOwnPropertyDescriptor,c=(t,e,i,o)=>{for(var r=o>1?void 0:o?f(e,i):e,n=t.length-1,a;n>=0;n--)(a=t[n])&&(r=(o?a(e,i,r):a(r))||r);return o&&r&&y(e,i,r),r};let s=class extends _{constructor(){super(...arguments),this._handleProductStockChanged=({body:t})=>{if(!t)return;const e={loyalty:t.loyalty},{$pointsRequired:i,$pointsEarned:o}=this._getPointsElements();this._updatePoints(i,e.loyalty?.price),this._updatePoints(o,e.loyalty?.pointsGranted)}}firstUpdated(t){super.firstUpdated(t),new P(this._handleProductStockChanged)}_getPointsElements(){const t=this.querySelector(`.${d.pointsRequired}`),e=this.querySelector(`.${d.pointsEarned}`);return{$pointsRequired:t,$pointsEarned:e}}_updatePoints(t,e){t&&e&&(t.innerHTML="",t.append(e.pointsFormatted))}};s.moduleName=p.component;c([m({type:Number,attribute:"product-id"})],s.prototype,"productId",2);s=c([u(p.component)],s);class b extends l{static{this.featureName=p.feature}static{this._components={loyaltyProgramPoints:s}}}export{b as LoyaltyProgramPointsInitializer};
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.