PageSourceSearch

https://shmatik.ru/_nuxt/DvSs-UHG.js

js shmatik.ru collected 2026-10-04 22:58:43 UTC 8,939 bytes, 1 lines download raw bytes

1import{aK as v,bF as r,aL as n,aM as a,b2 as g,bu as f,bh as h,bc as I,b3 as l,b4 as F,b5 as w,b7 as x,b6 as z,be as N,bf as E,a$ as d,b1 as m,bl as P,co as k,cb as b,cf as M,ce as R,bA as D,ck as O,bH as B}from"./Bgs6eNSj.js";import{C as H}from"./Bp7mL6-h.js";import{M as W}from"./B02RDZv0.js";import{P as q}from"./CqiwYo18.js";import{A as U}from"./D3xTsx6v.js";import{T as G}from"./C8NiijRa.js";import{v as Y}from"./saIk-JY7.js";import{M as j}from"./cOz5RT2z.js";import{v as K}from"./BJBs_h8m.js";import{$ as J}from"./BcCU186_.js";import"./BS3a-M1C.js";import"./ZuS3-68E.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="307c47e4-835f-480c-a7d0-21249b3e4323",t._sentryDebugIdIdentifier="sentry-dbid-307c47e4-835f-480c-a7d0-21249b3e4323")}catch{}})();const Q={name:"PromoActionProductCard",components:{AppPicture:U},props:{name:{type:String},photo:{type:String},isBigPhoto:{type:Boolean}},computed:{TEST_IDS(){return G}}},X={class:"gift-card__body"},Z=["data-testid"];function $(t,i,o,y,s,e){const _=r("AppPicture");return n(),a("div",{class:I(["gift-card-container",{"gift-card-container_big":o.isBigPhoto}])},[g("div",{class:I(["gift-card__image-container",{"gift-card__image-container_big":o.isBigPhoto}])},[o.photo?(n(),f(_,{key:0,class:"gift-card__image",src:o.photo,alt:o.name,width:"80",height:"80",densities:"x1 x2",loading:"lazy",decoding:"async"},null,8,["src","alt"])):h("",!0)],2),g("div",X,[g("p",{class:"gift-card__gift-name","data-testid":e.TEST_IDS.PROMO_MODAL.GIFT_NAME},l(o.name),9,Z),F(t.$slots,"default",{},void 0,!0)])],2)}const L=v(Q,[["render",$],["__scopeId","data-v-b3868ef9"]]),tt={name:"PromoActionProductCardWithCounter",components:{PlusIcon:J,MinusIcon:K,GButton:w,GTag:Y,GiftIcon:j,PromoActionProductCard:L},emits:["onChange"],props:{promoAction:{type:Object,required:!0},isGift:{type:Boolean},isCatalogDiscount:{type:Boolean}},data(){return{ButtonView:z,Sizes:x,products:[],totalCount:0}},computed:{TEST_IDS(){return G},isOneGift(){return this.promoAction.gifts.products.length===1}},methods:{updateProductCount(t,i){this.totalCount+=i,this.products=this.products.map(o=>o.id===t.id?{...o,count:o.count+i,canAdd:this.totalCount<this.promoAction.gifts.max_quantity}:{...o,canAdd:this.totalCount<this.promoAction.gifts.max_quantity}),this.$emit("onChange",this.products)},onPlus(t){this.updateProductCount(t,1)},onMinus(t){this.updateProductCount(t,-1)}},mounted(){this.isGift&&(this.totalCount=this.promoAction.gifts.products.reduce((t,i)=>t+i.count,0),this.products=this.promoAction.gifts.products.map(t=>({...t,count:t.count||0,canAdd:this.totalCount<this.promoAction.gifts.max_quantity}))),this.isCatalogDiscount&&(this.products=this.promoAction.reward.products),this.$emit("onChange",this.products)}},et=["data-testid"],ot={key:0,class:"gift-card__counter-block counter-block"},it={class:"counter-block__count"};function st(t,i,o,y,s,e){const _=r("GiftIcon"),A=r("GTag"),S=r("PromoActionProductCard"),p=r("MinusIcon"),u=r("GButton"),C=r("PlusIcon");return n(),a("div",null,[(n(!0),a(N,null,E(s.products,(c,T)=>(n(),a("div",{key:c.id,class:"gift-card"},[d(S,{name:c.name,photo:c.photo,"is-big-photo":o.isCatalogDiscount||o.isGift&&e.isOneGift},{default:m(()=>[o.isGift&&e.isOneGift?(n(),a("div",{key:0,class:"gift-card__gift-tag","data-testid":e.TEST_IDS.PROMO_MODAL.GIFT_TYPE},[d(_),P(" "+l(t.$t("gift")),1)],8,et)):h("",!0),o.isCatalogDiscount&&o.promoAction.reward.description?(n(),f(A,{key:1,"is-select":"",class:"gift-card__tag"},{default:m(()=>[P(l(o.promoAction.reward.description),1)]),_:1})):h("",!0)]),_:1},8,["name","photo","is-big-photo"]),o.isGift&&!e.isOneGift?(n(),a("div",ot,[d(u,{size:s.Sizes.S,"data-testid":`decrementGift-${T}`,view:s.ButtonView.GHOST,"only-icon":"",disabled:!c.count&&!c.canAdd||!c.count,onClick:V=>e.onMinus(c)},{default:m(()=>[d(p,{size:s.Sizes.S,fill:"var(--exeption-900)"},null,8,["size"])]),_:1},8,["size","data-testid","view","disabled","onClick"]),g("div",it,l(c.count),1),d(u,{size:s.Sizes.S,"data-testid":`incrementGift-${T}`,view:s.ButtonView.GHOST,disabled:!c.canAdd,"only-icon":"",onClick:V=>e.onPlus(c)},{default:m(()=>[d(C,{size:s.Sizes.S,fill:"var(--exeption-900)"},null,8,["size"])]),_:1},8,["size","data-testid","view","disabled","onClick"])])):h("",!0)]))),128))])}const nt=v(tt,[["render",st],["__scopeId","data-v-08f99ced"]]),rt={name:"PromoModal",mixins:[q,W],components:{PromoActionProductCardWithCounter:nt,PromoActionProductCard:L,GButton:w,GRadio:H},data(){return{Sizes:x,ButtonView:z,removeLoading:!1,selectLoading:!1,giftProductId:"",products:[],isCheckBeforeNextStep:!1}},computed:{TEST_IDS(){return G},...B(D,["getOpenedModal"]),...B(M,["getPromoActionsWithUnselectedGifts"]),promoAction(){return this.getOpenedModal?.modalData.promoAction},isGift(){return this.promoAction.reward.visual_type===O.GIFT},isCatalogDiscount(){return this.promoAction.reward.visual_type===O.CATALOG_DISCOUNT},giftsProducts(){return this.isGift?this.promoAction.gifts.products:this.isCatalogDiscount?this.promoAction.reward.products:[]},isOneProductAvailableForSelection(){return this.isGift&&this.giftsProducts.length>1&&this.promoAction.gifts.max_quantity===1},isAvailableSelectionProducts(){return this.isOneProductAvailableForSelection||this.isGift&&this.giftsProducts.length>1},isDisabledButton(){if(!this.isAvailableSelectionProducts)return!1;const t=this.products.reduce((i,o)=>i+o.count,0);return this.isOneProductAvailableForSelection?!this.giftProductId:this.promoAction.gifts.max_quantity!==t},deletePromoTitle(){return this.promoAction.is_auto?this.$t("doNotUsePromo"):this.$t("deletePromo")},choseBtnText(){return this.isCheckBeforeNextStep?this.$t("continue"):this.isAvailableSelectionProducts?this.$t("choose"):this.$t("back")}},methods:{...b(D,["openModal","closeModal"]),...b(R,["nextStep"]),...b(M,["sendGifts","togglePromoevents"]),onChangeHandler(t){this.products=t},async clickHandler(){if(this.selectLoading=!0,this.isAvailableSelectionProducts&&await this.sendGifts({id:this.promoAction.id,products:this.createSendProductsData()}),this.selectLoading=!1,this.closeModal(),this.getPromoActionsWithUnselectedGifts.length){this.openPromoModal(this.getPromoActionsWithUnselectedGifts[0],this.isCheckBeforeNextStep);return}if(this.needAdditionalProducts&&this.isCheckBeforeNextStep){this.openModal({modal
1Name:"ForgottenProducts"});return}this.isCheckBeforeNextStep&&await this.nextStep()},createSendProductsData(){return this.isOneProductAvailableForSelection?{[this.giftProductId]:1}:this.products.reduce((t,i)=>({...t,[i.id]:i.count}),{})},async deletePromo(){this.removeLoading=!0,await this.togglePromoevents({id:this.promoAction.id,is_active:!1}),this.closeModal(),this.isCheckBeforeNextStep&&await this.nextStep()}},mounted(){if(this.isCheckBeforeNextStep=this.getOpenedModal?.modalData?.isCheckBeforeNextStep||!1,this.isOneProductAvailableForSelection){const t=this.giftsProducts.find(i=>i.count);this.giftProductId=t?.id.toString()||""}}},at=["data-testid"],ct=["data-testid"],dt={key:1,class:"promo-modal__body"},lt={key:0};function ut(t,i,o,y,s,e){const _=r("PromoActionProductCard"),A=r("GRadio"),S=r("PromoActionProductCardWithCounter"),p=r("GButton");return n(),a("div",null,[(n(),f(k,{defer:"",to:t.teleportToTitle},[g("span",{"data-testid":e.TEST_IDS.PROMO_MODAL.TITLE},l(e.promoAction.title),9,at)],8,["to"])),e.promoAction.description?(n(),a("p",{key:0,class:"promo-modal__description","data-testid":e.TEST_IDS.PROMO_MODAL.DESCRIPTION},l(e.promoAction.description),9,ct)):h("",!0),e.isGift||e.isCatalogDiscount?(n(),a("div",dt,[e.isOneProductAvailableForSelection?(n(),a("div",lt,[(n(!0),a(N,null,E(e.giftsProducts,u=>(n(),f(A,{key:u.id,modelValue:s.giftProductId,"onUpdate:modelValue":i[0]||(i[0]=C=>s.giftProductId=C),value:u.id.toString(),class:"promo-modal__gift-radio"},{default:m(()=>[d(_,{name:u.name,photo:u.photo},null,8,["name","photo"])]),_:2},1032,["modelValue","value"]))),128))])):(n(),f(S,{key:1,"promo-action":e.promoAction,"is-gift":e.isGift,"is-catalog-discount":e.isCatalogDiscount,onOnChange:e.onChangeHandler},null,8,["promo-action","is-gift","is-catalog-discount","onOnChange"]))])):h("",!0),(n(),f(k,{defer:"",to:t.teleportToFooter},[d(p,{"data-testid":"chosePromocode",size:s.Sizes.M,view:s.ButtonView.PRIMARY,loading:s.selectLoading,disabled:e.isDisabledButton,onClick:e.clickHandler},{default:m(()=>[P(l(e.choseBtnText),1)]),_:1},8,["size","view","loading","disabled","onClick"]),d(p,{"data-testid":"cancelPromocode",class:"promo-modal__remove-promo",size:s.Sizes.M,view:s.ButtonView.SECONDARY,loading:s.removeLoading,onClick:e.deletePromo},{default:m(()=>[P(l(e.deletePromoTitle),1)]),_:1},8,["size","view","loading","onClick"])],8,["to"]))])}const Gt=v(rt,[["render",ut],["__scopeId","data-v-4d25661f"]]);export{Gt as default};

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.