PageSourceSearch

https://www.praes.pl/application/assets/storefront/chunk-product_quantity_initializer.Bdb_WWm.js

js praes.pl collected 2026-10-08 17:41:54 UTC 2,485 bytes, 1 lines download raw bytes

1import{J as p,al as h,S as l,am as c,C as m}from"./storefrontApp.DHj_rTVq.min.js";import{S as v}from"./chunk-storefront_base_lit_element.BDgKmPq.js";import{P as I}from"./chunk-product_events_constants.BHFu5GP.js";import{e as u}from"./chunk-vendor-lit.NvY0u02.js";import{P as f}from"./chunk-product_quantity_changed_handler.r2t4i2F.js";import{I as y}from"./chunk-input_stepper_constants.CxAeeF7.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";var _=Object.defineProperty,o=(n,t,e,d)=>{for(var i=void 0,r=n.length-1,s;r>=0;r--)(s=n[r])&&(i=s(t,e,i)||i);return i&&_(t,e,i),i};class a extends v{constructor(){super(),this.productId=null,this.variantId=null,this.value=0,this._handleQuantityChange=t=>{if(!this._isCustomInputStepperEvent(t))return;const e=Number(t.detail.value);e!==this.value&&(this.value=e,this._handleDispatchQuantityChangedEvent(e))},this._handleDispatchQuantityChangedEvent=t=>{const e={productId:this.productId,variantId:this.variantId,quantity:t,senderId:this.id};this.eventBus.emit(new p(I.quantityChanged,e))},this._synchronizeQuantityComponents=({body:t})=>{if(!t)return;const{productId:e,variantId:d,quantity:i,senderId:r}=t;if(r===this.id)return;e===this.productId&&d===this.variantId&&i!==this.value&&(this.value=i,this._updateInputStepperValue(i))},this._updateInputStepperValue=t=>{const e=this.querySelector("h-input-stepper");if(!e)throw new Error("Input stepper not found inside product-quantity webcomponent");e.setValue(t)},new f(this._synchronizeQuantityComponents)}static{this.moduleName=h.productQuantity}connectedCallback(){if(super.connectedCallback(),!(this.productId&&this.variantId))throw new Error("Either product-id or variant-id has not been provided for product-quantity webcomponent.");this.addEventListener(y.valueChanged,this._handleQuantityChange)}_isCustomInputStepperEvent(t){return this._isCustomEvent(t)?typeof t.detail=="object"&&"value"in t.detail&&typeof t.detail.value=="number":!1}_isCustomEvent(t){return"detail"in t}}o([u({type:Number,attribute:"product-id"})],a.prototype,"productId");o([u({type:Number,attribute:"variant-id"})],a.prototype,"variantId");o([u({type:Number,attribute:"value"})],a.prototype,"value");class A extends l{static{this.featureName=c.feature}init(){return{cores:[{type:m,instance:[a]}]}}}export{A as ProductQuantityInitializer};

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.