PageSourceSearch

https://wasserstein-home.com/cdn/shop/t/69/assets/product-ajax-form.js?v=113985492364756232791709826641

js wasserstein-home.com collected 2026-10-01 13:57:58 UTC 2,274 bytes, 2 lines download raw bytes

1import"@archetype-themes/scripts/helpers/utils";theme.AjaxProduct=(function(){var status={loading:!1};function ProductForm(form,submit,args){this.form=form,this.args=args;var submitSelector=submit||".add-to-cart";this.form&&(this.addToCart=form.querySelector(submitSelector),this.form.addEventListener("submit",this.addItemFromForm.bind(this)))}return ProductForm.prototype=Object.assign({},ProductForm.prototype,{addItemFromForm:function(evt,callback){if(evt.preventDefault(),!status.loading){this.addToCart.classList.add("btn--loading"),status.loading=!0;var data=theme.utils.serialize(this.form);fetch(theme.routes.cartAdd,{method:"POST",body:data,credentials:"same-origin",headers:{"Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"}}).then(function(response){return response.json()}).then(function(data2){if(data2.status===422)this.error(data2);else{var product=data2;this.success(product)}status.loading=!1,this.addToCart.classList.remove("btn--loading"),document.body.classList.contains("template-cart")&&(window.scrollTo(0,0),location.reload())}.bind(this))}},success:function(product){var errors=this.form.querySelector(".errors");errors&&errors.remove(),this.form.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product:product,addToCartBtn:this.addToCart},bubbles:!0})),this.args&&this.args.scopedEventId&&document.dispatchEvent(new CustomEvent("ajaxProduct:added:"+this.args.scopedEventId,{detail:{product:product,addToCartBtn:this.addToCart}}))},error:function(error){if(!error.description){console.warn(error);return}var errors=this.form.querySelector(".errors");errors&&errors.remove();var errorDiv=document.createElement("div");errorDiv.classList.add("errors","text-center"),typeof error.description=="object"?errorDiv.textContent=error.message:errorDiv.textContent=error.description,this.form.append(errorDiv),this.form.dispatchEvent(new CustomEvent("ajaxProduct:error",{detail:{errorMessage:error.description},bubbles:!0})),this.args&&this.args.scopedEventId&&document.dispatchEvent(new CustomEvent("ajaxProduct:error:"+this.args.scopedEventId,{detail:{errorMessage:error.description}}))}}),ProductForm})();
2//# sourceMappingURL=/cdn/shop/t/69/assets/product-ajax-form.js.map?v=113985492364756232791709826641

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.