import{q as L,r as y,E as ie,o as f,c as b,a as e,F as K,k as z,n as R,t as I,G as Q,H as U,I as X,z as S,s as ee,y as oe,i as te,J as ae,K as ce,p as q,l as F,v as ue,L as de,M as _e,B as ne,C as se,u as ve,N as me,f as N,w as pe,g as x,j as he,_ as ge}from"./index-Cdt4oMy6.js";import{a as fe}from"./AppFilters-CU-uIOCE.js";const be={class:"tabs"},ye={class:"tabs__nav"},Ie=["onClick"],Se={class:"tabs__content"},Ne={__name:"AppTabs",emits:["onChange"],setup(a,{emit:h}){const t=h,n=y([]),l=y("");U("tabs",n),U("activeTab",l);const u=i=>{l.value=i,t("onChange",i)};return ie(()=>{n.value.length>0&&!n.value.some(i=>i.name===l.value)&&(l.value=n.value[0].name)}),(i,v)=>(f(),b("div",be,[e("div",ye,[(f(!0),b(K,null,z(n.value,m=>(f(),b("div",{key:m.name,class:R(["tabs__nav-item",{active:m.name===l.value}]),onClick:V=>u(m.name)},I(m.label),11,Ie))),128))]),e("div",Se,[Q(i.$slots,"default",{},void 0,!0)])]))}},$e=L(Ne,[["__scopeId","data-v-65823653"]]),Pe={key:0},j={__name:"AppTab",props:{name:{type:String,required:!0},label:{type:String,required:!0}},setup(a){const h=a,t=X("tabs"),n=X("activeTab"),l=S(()=>n.value===h.name);return ee(()=>{t.value.push({name:h.name,label:h.label})}),oe(()=>{t.value=t.value.filter(u=>u.name!==h.name)}),(u,i)=>l.value?(f(),b("div",Pe,[Q(u.$slots,"default")])):te("",!0)}},xe={class:"calculator__item"},Ce={class:"calculator__item-top"},Ve={class:"calculator__item-top-left"},we={class:"h4 font-300 title"},Ae={class:"calculator__item-top-right"},Me={class:"h3"},Te=["value"],Le={class:"input_range_wrapper"},qe=["value","min","max"],ke={class:"calculator__item-bot"},Ee={__name:"InputRange",props:{defaultValue:{type:String,required:!0,default:0},min:{type:String,required:!0,default:0},max:{type:String,required:!0,default:0},title:{type:String,default:""},labels:{type:Array,default:[]},valueLabel:{type:String,default:""}},emits:["onChange"],setup(a,{emit:h}){const t=a,n=y(0),l=r=>r.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "),u=new Set(["0","1","2","3","4","5","6","7","8","9"]),i=h,v=y(0);function m(r){const g=Number(r.target.value.replace(/\s+/g,""));g>Number(t.max)?(i("onChange",Number(t.max)),r.target.value=l(t.max)):g<Number(t.min)?(i("onChange",Number(t.min)),r.target.value=l(t.min)):i("onChange",g)}function V(r){i("onChange",Number(parseInt(r.target.value)))}function C(r){let g="";const p=r.target.value;for(let s=0;s<p.length;s++)u.has(p[s])&&(g+=p[s]);r.target.value=l(g)}function A(r){v.value=r.target.value,i("onChange",Number(parseInt(v.value)))}return ae(v,()=>{const r=(Number(t.max)-Number(t.min))/100,g=v.value-Number(t.min);n.value=parseInt(Number(g/r))}),ce(()=>{v.value=t.defaultValue}),ee(()=>{v.value=t.defaultValue}),(r,g)=>(f(),b("div",xe,[e("div",Ce,[e("div",Ve,[e("span",we,I(a.title),1)]),e("div",Ae,[e("div",Me,[e("input",{value:l(a.defaultValue),type:"text",class:"hand_change",pattern:"[0-9]",onChange:m,onInput:C},null,40,Te),q(" "+I(a.valueLabel),1)])])]),e("div",Le,[e("input",{value:a.defaultValue,type:"range",min:a.min,max:a.max,class:"slider",onChange:V,onInput:A},null,40,qe),e("div",{class:"progress",style:F({background:`linear-gradient(90deg, #017338 ${n.value+.5}%, #3db489 ${n.value}%, #a5d991 100%)`})},null,4)]),e("div",ke,[(f(!0),b(K,null,z(a.labels,(p,s)=>(f(),b("span",{key:s},I(p),1))),128))])]))}},W=L(Ee,[["__scopeId","data-v-280e3c7c"]]),le=a=>(ne("data-v-213ee1eb"),a=a(),se(),a),Oe={class:"calculator__item"},Re={class:"calculator__item-top"},Fe={class:"calculator__item-top-left"},Ke={class:"h4 font-300 title"},ze={class:"calculator__item-top-right"},Be={class:"h3 input_wrapper"},De=["value"],Ge=le(()=>e("span",{class:"procent_label"},"%",-1)),Je=le(()=>e("span",{class:"separator"},"/",-1)),Ue=["value"],Xe={class:"input_range_wrapper"},je=["min","max"],We={class:"calculator__item-bot"},Ye={__name:"FirstPay",props:{firstPay:{type:Number,required:!0,default:0},min:{type:String,required:!0,default:"0"},max:{type:String,required:!0,default:"0"},title:{type:String,default:""},labels:{type:Array,default:[]},valueLabel:{type:String,default:""},procentValue:{type:String,default:""},price:{type:Number,default:0}},emits:["onChangeProcent"],setup(a,{emit:h}){const t=a;y("100px");const n=y(0);n.value=t.procentValue;const l=ue.useMq(),u=new Set(["0","1","2","3","4","5","6","7","8","9"]),i=s=>s.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "),v=h;function m(s){const o=l.xs?9:13,d=l.xs?75:100;return(s.length+1)*o>d?(s.length+1)*o:d}function V(s){let o="";const d=s.target.value;for(let _=0;_<d.length;_++)u.has(d[_])&&(o+=d[_]);s.target.value=i(o)}function C(s){let o="";const d=s.target.value;for(let _=0;_<d.length;_++)u.has(d[_])&&(o+=d[_]);s.target.value=o}function A(s){const o=Number(s.target.value.replace(/\s+/g,""));o>t.max?v("onChangeProcent",Number(t.max)):o<t.min?v("onChangeProcent",Number(t.min)):v("onChangeProcent",Number(o)),n.value=o}function r(s){const o=Number(s.target.value.replace(/\s+/g,"")),d=t.price/100,_=parseInt(o/d);_>t.max?v("onChangeProcent",Number(t.max)):_<t.min?v("onChangeProcent",Number(t.min)):v("onChangeProcent",Number(_)),n.value=_}function g(){v("onChangeProcent",Number(parseInt(n.value)))}const p=S(()=>{const s=(Number(t.max)-Number(t.min))/100;return parseInt((Number(n.value)-Number(t.min))/s)});return(s,o)=>(f(),b("div",Oe,[e("div",Re,[e("div",Fe,[e("span",Ke,I(a.title),1)]),e("div",ze,[e("div",Be,[e("input",{value:a.procentValue,onChange:A,onInput:C,type:"text",class:"input_procent"},null,40,De),Ge,Je,e("input",{value:i(a.firstPay),type:"text",class:"hand_change",style:F({width:m(i(a.firstPay).toString())+"px"}),onChange:r,onInput:V},null,44,Ue),q(" "+I(a.valueLabel),1)])])]),e("div",Xe,[de(e("input",{"onUpdate:modelValue":o[0]||(o[0]=d=>n.value=d),type:"range",min:a.min,max:a.max,class:"slider",onChange:g,onInput:g},null,40,je),[[_e,n.value]]),e("div",{class:"progress",style:F({background:`linear-gradient(90deg, #017338 ${p.value+.5}%, #3db489 ${p.value}%, #a5d991 100%)`})},null,4)]),e("div",We,[(f(!0),b(K,null,z(a.labels,(d,_)=>(f(),b("span",{key:_},I(i(d)),1))),128))])]))}},He=L(Ye,[["__scopeId","data-v-213ee1eb"]]),Ze={class:"item"},Qe={class:"title"},et={key:0,class:"info"},tt={class:"info_description"},at={class:"value"},nt={__name:"OfferItem",props:{title:{type:String,required:!0,default:""},description:{type:String,required:!0,default:""},value:{type:String,required:!0,default:""}},setup(a){return(h,t)=>(f(),b("div",Ze,[e("div",Qe,[q(I(a.title)+" ",1),a.description.length?(f(),b("div",et,[e("div",tt,I(a.description),1)])):te("",!0)]),e("div",at,I(a.value)+" ₽",1)]))}},O=L(nt,[["__scopeId","data-v-f7f65fc1"]]),T=5,k=50,Y=12,st=84,lt=15e6,rt=1e6,H=.01,Z=.02,it=.24,ot=.06,ct=.08,ut=.09,w=a=>(ne("data-v-b3e424c6"),a=a(),se(),a),dt={class:"calculator"},_t={class:"calculator__wrapper"},vt={class:"calculator__left"},mt={class:"filter_wrapper"},pt={class:"calculator__right"},ht=w(()=>e("h3",null,"Ðаше предложение",-1)),gt=w(()=>e("div",{class:"our_offer_description"},[q(" Ð”Ð»Ñ ÐºÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð¸Ñ€Ð¾Ð²ÐºÐ¸ ÑтоимоÑти договора лизинга возможно иÑпользование "),e("a",{href:"/bonus"},"БонуÑных программ.")],-1)),ft={class:"payment"},bt=w(()=>e("span",null,"ЕжемеÑÑчный платёж",-1)),yt={class:"payment__actions h3"},It={class:"payment total_payment"},St=w(()=>e("span",null,"ÐžÐ±Ñ‰Ð°Ñ Ñумма затрат",-1)),Nt={class:"payment__actions h3"},$t={class:"offers_row"},Pt={class:"offer_item"},xt=w(()=>e("p",null," ÐаÑтоÑщий раÑчёт ÑвлÑетÑÑ Ð¾Ñ€Ð¸ÐµÐ½Ñ‚Ð¸Ñ€Ð¾Ð²Ð¾Ñ‡Ð½Ñ‹Ð¼ и не ÑвлÑетÑÑ Ð¾Ñ„Ð¸Ñ†Ð¸Ð°Ð»ÑŒÐ½Ð¾Ð¹ офертой по заключению Ñделки. Ð”Ð»Ñ ÑƒÑ‚Ð¾Ñ‡Ð½ÐµÐ½Ð¸Ñ ÑƒÑловий Ñделки обращайтеÑÑŒ к нашим ÑпециалиÑтам. ",-1)),Ct={class:"flex"},Vt=w(()=>e("span",null,[q("ОÑтавить заÑвку "),e("img",{src:ge,alt:"arrow"})],-1)),wt=[Vt],At={__name:"index",setup(a){ve();const{openLeasingModal:h}=me(),t=y("ur"),n=y(5e6),l=y(Y),u=y(T),i=S(()=>parseInt(n.value/100*T)),v=S(()=>parseInt(n.value/100*k)),m=S(()=>n.value),V=m.value/100,C=y(parseInt(V*u.value)),A={ur:[{name:"passenger",label:"Легковой транÑпорт",disallow:!1},{name:"freight",label:"Грузовой транÑпорт",disallow:!1},{label:"Спецтехника",name:"specialMachinery",disallow:!1}],fiz:[{name:"passenger",label:"Легковой транÑпорт",disallow:!1},{name:"freight",label:"Грузовой транÑпорт",disallow:!0},{label:"Спецтехника",name:"specialMachinery",disallow:!0}]},r=y("passenger");function g(c){r.value=c}const p=[{title:"Сумма ДЛ",description:"За Ñчет ÑƒÐ¼ÐµÐ½ÑŒÑˆÐµÐ½Ð¸Ñ Ð½Ð°Ð»Ð¾Ð³Ð° на прибыль",value:""},{title:"Возмещение ÐДС Ñ Ð”Ð›",description:"За Ñчет ÑƒÐ¼ÐµÐ½ÑŒÑˆÐµÐ½Ð¸Ñ Ð½Ð°Ð»Ð¾Ð³Ð° на прибыль",value:"200 000 ₽"},{title:"ÐÐºÐ¾Ð½Ð¾Ð¼Ð¸Ñ Ð¿Ð¾ прибыли",description:"",value:""}];function s(c){t.value=c,console.log(t.value),r.value="passenger"}function o(c){n.value=Number(c)}function d(c){l.value=Number(c)}function _(c){c>Number(k)?u.value=k:c<Number(T)?u.value=T:u.value=c;const P=m.value/100;C.value=parseInt(P*u.value)}const M=c=>c.toString().replace(/\B(?=(\d{3})+(?!\d))/g," "),re=S(()=>({passenger:ot,freight:ct,specialMachinery:ut})[r.value]),B=S(()=>n.value*u.value/100),D=S(()=>n.value-B.value+(H+Z)*n.value),G=S(()=>D.value/l.value),J=S(()=>{let c=0;for(let P=1;P<=l.value;P++){const E=(D.value-G.value*(P-1))*(it+re.value)/12*1.2+G.value+(H+Z)*.2*n.value/l.value;c+=E}return c}),$=S(()=>J.value+B.value);return ae(m,()=>{const c=m.value/100;C.value=parseInt(c*u.value)}),(c,P)=>(f(),b("div",dt,[N($e,{class:"v2",onOnChange:s},{default:pe(()=>[N(j,{name:"ur",label:"ЮридичеÑкое лицо"}),N(j,{name:"fiz",label:"ФизичеÑкое лицо"})]),_:1}),e("div",_t,[e("div",vt,[e("div",mt,[N(fe,{tabs:A[t.value],activeKey:r.value,onOnChange:g},null,8,["tabs","activeKey"])]),N(W,{title:"Цена предмета лизинга",defaultValue:String(m.value),min:String(x(rt)),max:String(x(lt)),valueLabel:"₽",labels:["1 млн ₽","15 млн ₽"],onOnChange:o},null,8,["defaultValue","min","max"]),N(He,{title:"Первоначальный взноÑ",firstPay:Number(C.value),min:String(x(T)),max:String(x(k)),procentValue:String(u.value),valueLabel:"₽",labels:[`${i.value}`,`${v.value}`],price:m.value,onOnChangeProcent:_},null,8,["firstPay","min","max","procentValue","labels","price"]),N(W,{title:"Срок лизинга",defaultValue:String(l.value),min:String(x(Y)),max:String(x(st)),valueLabel:"меÑ",labels:["12 меÑ","84 меÑ"],onOnChange:d},null,8,["defaultValue","min","max"])]),e("div",pt,[ht,gt,e("div",ft,[bt,e("div",yt,I(M(parseInt(J.value/l.value)))+" ₽ ",1)]),e("div",It,[St,e("div",Nt,I(M(parseInt($.value-$.value*20/120-($.value-parseInt($.value*20/120))*.2)))+" ₽ ",1)]),e("div",$t,[e("div",Pt,[N(O,{value:M(parseInt($.value)),description:p[0].description,title:p[0].title},null,8,["value","description","title"])]),e("div",{class:R(["offer_item",t.value==="fiz"?"hidden":""])},[N(O,{value:M(parseInt($.value*20/120)),description:p[1].description,title:p[1].title},null,8,["value","description","title"])],2),e("div",{class:R(["offer_item",t.value==="fiz"?"hidden":""])},[N(O,{value:M(parseInt(parseInt($.value-$.value*20/120)*.2)),description:p[2].description,title:p[2].title},null,8,["value","description","title"])],2)]),xt,e("div",Ct,[e("a",{href:"#",onClick:P[0]||(P[0]=he((...E)=>x(h)&&x(h)(...E),["prevent"])),class:"btn-all ml-auto"},wt)])])])]))}},Lt=L(At,[["__scopeId","data-v-b3e424c6"]]);export{Lt as A,$e as T,j as _};