import{_ as r,o as a,b as c,p as o,v as l,n as u,q as v}from"./main-DHoZdmBw.js";const P={name:"PriceSavingsInPercentFi",props:{bestPrice:{type:Object,default:()=>({})},small:{type:Boolean,default:!1},theme:{type:String,default:null}},computed:{quantity(){let e=0;return this.bestPrice&&(e=this.bestPrice.requestedQuantity>0?this.bestPrice.requestedQuantity:this.bestPrice.initialQuantity),e},savingsInPercent(){if(this.bestPrice&&this.bestPrice.price&&this.bestPrice.price.savingsInformation&&this.bestPrice.price.savingsInformation.savingsInPercent)return this.$dict.get("online-Shop.Product.Savings",[this.bestPrice.price.savingsInformation.savingsInPercent]);if(this.resultPriceRowsSavings){const e=this.resultPriceRowsSavings.find(i=>i.active),t=e&&e.savingsInformation&&e.savingsInformation.savingsInPercent;if(t)return this.$dict.get("online-Shop.Product.Price-Rows-Saving-Label",[t])}return null},resultPriceRowsSavings(){if(this.bestPrice){let e=0;const t=[{...this.bestPrice.price,minQty:this.bestPrice.initialQuantity,savingsInformation:null},...this.bestPrice.priceRowsIncludingSavings||[]];return t.forEach((i,s)=>{i.active=!1,i.minQty<=this.quantity&&(e=s)}),t[e].active=!0,t}return null}}},g={class:"badge-fi"};function f(e,t,i,s,h,n){return n.savingsInPercent?(a(),c("div",{key:0,class:u(["price-savings-in-percent-fi",i.theme?`price-savings-in-percent-fi--theme-${i.theme}`:""])},[o("span",g,l(n.savingsInPercent),1)],2)):v("",!0)}const d=r(P,[["render",f],["__scopeId","data-v-66bcf53e"]]);export{d as P};