PageSourceSearch

https://garlyn.ru/build/assets/AddToCartButton-da0bef9d.js

js garlyn.ru collected 2026-09-24 10:46:57 UTC 1,678 bytes, 1 lines download raw bytes

1import{d as u,T as p,o as i,e as g,w as t,p as v,g as n,l as y,t as b,n as h,i as d,u as C,B,f}from"./vue.m-7107e1b8.js";import{c as k,s as w}from"./helpers-819aca0c.js";import{M as S,_ as m}from"./ErrorText-e9d01f32.js";import{_ as x}from"./_plugin-vue_export-helper-c27b6911.js";const N={key:0,class:"text"},M={class:"row"},T={class:"col-sm-6 mb-2 mb-md-0"},A={class:"col-sm-6"},V={__name:"AddToCartButton",props:{id:{type:Number,default:null},article:{type:String,default:null},name:{type:String,default:"Товар"},successMessage:{type:String,default:null},showResult:{type:Boolean,default:!0},quantity:{type:Number,default:1}},setup(s){const e=s,a=u(null),o=u(!1),l=p({id:e.id,article:e.article,quantity:e.quantity});async function _(){o.value=!0,l.post(route("cart.add"),{preserveScroll:!0,onSuccess(){e.showResult&&a.value.open(),k("add",e.id)},onFinish(){o.value=!1}}),w("click",{on:"add-to-cart",form:l.data()})}return(r,c)=>(i(),g(m,{onClick:_,disabled:o.value,class:"g-button-main add-to-cart-btn"},{default:t(()=>[v(r.$slots,"default",{},void 0,!0),n(S,{ref_key:"modalComponent",ref:a,centered:!0,width:700,showCloseButton:!1},{body:t(()=>[s.successMessage?(i(),y("div",N,b(s.successMessage),1)):h("",!0)]),footer:t(()=>[d("div",M,[d("div",T,[n(C(B),{class:"g-button g-button-main g-button-lg",href:r.route("cart.index")},{default:t(()=>[f(" Перейти в корзину ")]),_:1},8,["href"])]),d("div",A,[n(m,{class:"g-button-main-outline g-button-lg",onClick:c[0]||(c[0]=q=>a.value.close())},{default:t(()=>[f(" Продолжить покупки ")]),_:1})])])]),_:1},512)]),_:3},8,["disabled"]))}},F=x(V,[["__scopeId","data-v-f29877c1"]]);export{F as A};

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.