1import{P as g}from"./PopupWrapperLago-24c75c8c.js";import{P as w}from"./PopupDefault-62d0bf19.js";import{S as b}from"./SalmonButton-aad65f21.js";import{B as k}from"./BaseRadioGroup-fd36b67b.js";import{l as y}from"./index-ba7a78b3.js";import{_ as C}from"./plugin-vue_export-helper-c27b6911.js";import{B as i,C as s,a2 as d,a4 as l,a3 as m,a8 as f,a5 as h,a7 as _,aa as D,D as n}from"./vendor-841ae9e1.js";import"./SvgIcon-3a8dabd4.js";import"./consola-a319bdc8.js";import"./sentry-27444d60.js";import"./polyfills-c1ef29e8.js";import"./axios-f31720dc.js";import"./imask/esm-65004cd6.js";import"./lodash-59cf2d56.js";import"./crypto-bn-fe71aef5.js";import"./elliptic-0bc42179.js";const S={name:"PopupCardsSelect",components:{SalmonButton:b,BaseRadioGroup:k},props:{cards:{type:Array,default:()=>[]},profile:{type:Object,default:()=>{}}},data(){var t;return{activeCard:((t=this.getActiveCard())==null?void 0:t.id)||{}}},computed:{cardOnlyList(){return this.cards.filter(t=>(t==null?void 0:t.paymethod)!=="sbp")},cardsList(){return this.cardOnlyList.map(t=>{var e,r;return{label:`${((e=t==null?void 0:t.card_type)==null?void 0:e.title)||""} ${t==null?void 0:t.number}, ${((r=t==null?void 0:t.bank)==null?void 0:r.title)||""}`,value:t==null?void 0:t.id}})}},methods:{async confirm(){try{await this.$store.dispatch("profile/selectCard",{id:this.activeCard}),await this.$store.dispatch("profile/updateProfile",{autopay:"true"}),await this.$store.commit("profile/setProfileFields",{autopay:!0}),await this.$store.dispatch("profile/loadProfile"),await this.$store.dispatch("profile/loadCards")}catch(t){y("PopupCardsSelect","lagoon: setting card autopay",t.message||t)}this.$router.push({name:"Profile.subscription"})},showDeactivate(){this.$emit("showDeactivate")},getActiveCard(){let t=null;return this.cards.forEach(e=>{e.actived&&e.paymethod!=="sbp"&&(t=e)}),t},onCardSelect({value:t}){this.activeCard=t}}},B={class:"popup-cards-select"},L={class:"popup-cards-select__text-buttons"};function x(t,e,r,P,a,o){const p=i("router-link"),u=i("BaseRadioGroup"),c=i("SalmonButton");return s(),d("div",B,[e[4]||(e[4]=l("div",{class:"default-popup__title"},"ÐаÑÑÑойка авÑопÑодлениÑ",-1)),l("div",L,[m(p,{to:{name:"Profile.subscription.card.new"},class:"text-button"},{default:f(()=>[...e[1]||(e[1]=[h(" ÐобавиÑÑ Ð½Ð¾Ð²ÑÑ ÐºÐ°ÑÑÑ ",-1)])]),_:1}),r.profile.autopay?(s(),d("span",{key:0,class:"text-button --red",onClick:e[0]||(e[0]=(...v)=>o.showDeactivate&&o.showDeactivate(...v))}," ÐÑклÑÑиÑÑ Ð°Ð²ÑопÑодление ")):_("",!0)]),o.cardsList.length?(s(),d(D,{key:0},[e[3]||(e[3]=l("div",{class:"popup-cards-select__strong"}," ÐÑбÑаÑÑ ÐºÐ°ÑÑÑ, Ñ ÐºÐ¾ÑоÑой бÑÐ´ÐµÑ ÑпиÑÑваÑÑÑÑ Ð°Ð²ÑопÑодление: ",-1)),m(u,{class:"popup-cards-select__items",values:o.cardsList,label:"",value:a.activeCard,name:"autopay_card",onInput:o.onCardSelect},null,8,["values","value","onInput"]),m(c,{class:"popup-cards-select__button",onClick:o.confirm},{default:f(()=>[...e[2]||(e[2]=[h(" ÐодÑвеÑдиÑÑ ",-1)])]),_:1},8,["onClick"])],64)):_("",!0),e[5]||(e[5]=l("div",{class:"default-popup__additional"}," ÐÑием плаÑежей и Ñ
Ñанение инÑоÑмаÑии о банковÑкиÑ
каÑÑаÑ
обеÑпеÑÐ¸Ð²Ð°ÐµÑ ÐР«Ðанк Ð ÑÑÑкий СÑандаÑÑ». ÐведеннÑе вами даннÑе обÑабаÑÑваÑÑÑÑ ÑолÑко банком, и не доÑÑÑÐ¿Ð½Ñ ÑÑеÑÑим лиÑам ",-1))])}const A=C(S,[["render",x]]),$={name:"ViewProfileAutopay",components:{PopupWrapperLago:g,PopupDefault:w,PopupCardsSelect:A},data(){return{showDeactivate:!1,success:!1,deactivationLoading:!1}},computed:{cards(){return this.$store.state.profile.cards},profile(){return this.$store.state.profile.profile}},mounted(){},methods:{closePopup(){this.$router.push({name:"Profile.subscription"})},async deactivateAutopay(){this.deactivationLoading=!0;try{await this.$store.dispatch("profile/updateProfile",{autopay:"false"})}catch(t){y("ViewProfileAutopay","profile/updateProfile",t.message||t)}this.deactivationLoading=!1,this.success=!0,this.$store.commit("profile/setProfileFields",{autopay:!1})}}};function V(t,e,r,P,a,o){const p=i("PopupDefault"),u=i("PopupCardsSelect"),c=i("PopupWrapperLago");return s(),n(c,{onClose:o.closePopup},{default:f(()=>[a.success?(s(),n(p,{key:0,title:"ÐвÑопÑодление ÑÑпеÑно оÑклÑÑено",additional:"ÐÑием плаÑежей и Ñ
Ñанение инÑоÑмаÑии о банковÑкиÑ
каÑÑаÑ
обеÑпеÑÐ¸Ð²Ð°ÐµÑ ÐР«Ðанк Ð ÑÑÑкий СÑандаÑÑ». ÐведеннÑе вами даннÑе обÑабаÑÑваÑÑÑÑ ÑолÑко банком, и не доÑÑÑÐ¿Ð½Ñ ÑÑеÑÑим лиÑам, вклÑÑÐ°Ñ vedomosti.ru"})):a.showDeactivate?a.showDeactivate?(s(),n(p,{key:2,title:"Ðнимание!",body:"ÐÑ Ð¾ÑклÑÑаеÑе авÑомаÑиÑеÑкое пÑодление подпиÑки на vedomosti.ru.",button:"ÐÑклÑÑиÑÑ Ð°Ð²ÑопÑодление","is-loading":a.deactivationLoading,onConfirm:o.deactivateAutopay,onCancel:o.closePopup},null,8,["is-loading","onConfirm","onCancel"])):_("",!0):(s(),n(u,{key:1,cards:o.cards,profile:o.profile,onShowDeactivate:e[0]||(e[0]=v=>a.showDeactivate=!0)},null,8,["cards","profile"]))]),_:1},8,["onClose"])}const Q=C($,[["render",V]]);export{Q 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.