import{f as n}from"./common-U_VzDrmL.js";import{M as _,g as f,o as r,c as o,a as t,t as s,B as d,F as m,h as v,i as c}from"./index-Bb2UEb_P.js";const g={class:"tw-my-5"},x={class:"tw-flex tw-items-center tw-justify-between tw-text-lg tw-pb-4 tw-mb-4 tw-border-b tw-border-gray-200"},y={class:"tw-text-right"},p={key:0,class:"tw-pb-4 tw-mb-4 tw-border-b tw-border-gray-200"},B={class:"tw-text-right"},k={class:"tw-text-right"},j={key:1,class:"tw-flex tw-items-center tw-justify-between tw-text-lg tw-mb-2"},S={class:"tw-text-right"},D={key:2,class:"tw-mb-4 tw-border-b tw-border-gray-200"},E={class:"tw-text-right"},N={class:"tw-text-right"},P={key:3,class:"tw-flex tw-items-center tw-justify-between tw-text-xl tw-font-medium tw-pb-2 tw-mb-2 tw-border-b tw-border-gray-200"},C={class:"tw-text-gray-400 tw-text-right tw-line-through"},F={class:"tw-text-red-500 tw-text-right"},V={class:"tw-flex tw-justify-between tw-items-center"},A={class:"tw-text-xl tw-font-medium"},I={class:"tw-text-xl tw-font-medium"},R=_({__name:"TotalAmount",props:{tariff:{},additionalServices:{}},setup(b){const l=b,u=f(()=>l.tariff.Bonuses?l.tariff.Bonuses.reduce((e,i)=>e+i.Economy,0):0),w=f(()=>l.additionalServices?l.additionalServices.reduce((e,i)=>e+i.Price,0):0);return(e,i)=>(r(),o("div",g,[t("div",x,[i[0]||(i[0]=t("div",{class:"tw-text-right"},"Цена тарифа",-1)),t("div",y,s(d(n)(e.tariff.price)),1)]),e.tariff.Bonuses?.length>0?(r(),o("div",p,[(r(!0),o(m,null,v(e.tariff.Bonuses,(a,h)=>(r(),o("div",{key:h,class:"tw-flex tw-items-center tw-justify-between tw-text-gray-500 tw-text-base"},[t("div",B," Скидка "+s(a?.Discount)+"% на "+s(a?.Days)+" дней ",1),t("div",k,"-"+s(d(n)(a?.Economy)),1)]))),128))])):c("",!0),w.value>0?(r(),o("div",j,[i[1]||(i[1]=t("div",{class:"tw-text-right"},"Дополнительные услуги",-1)),t("div",S,s(d(n)(w.value)),1)])):c("",!0),w.value>0?(r(),o("div",D,[(r(!0),o(m,null,v(e.additionalServices,a=>(r(),o("div",{key:a.ServiceID,class:"tw-flex tw-items-center tw-justify-between tw-text-gray-500 tw-text-base tw-pb-2"},[t("div",E,s(a.Name),1),t("div",N,s(d(n)(a.Price)),1)]))),128))])):c("",!0),e.tariff.Bonuses?.length>0?(r(),o("div",P,[i[2]||(i[2]=t("div",{class:"tw-text-red-500"},"Выгода",-1)),t("div",null,[t("div",C,s(d(n)(e.tariff.price+w.value)),1),t("div",F,"-"+s(d(n)(u.value)),1)])])):c("",!0),t("div",V,[t("div",A,"Итого за "+s(e.tariff.label),1),t("div",I,s(d(n)(e.tariff.price-u.value+w.value)),1)])]))}});export{R as _};
