"use strict";var core=require("@gem-sdk/core"),useDynamicProduct=require("./useDynamicProduct.js"),useRecurringSubtotal=require("./useRecurringSubtotal.js"),useProductPriceBreakdown=require("./useProductPriceBreakdown.js"),useSubscriptionSellingType=require("./useSubscriptionSellingType.js");const useGetMoneyLines=(e,u)=>{let{isDynamicProduct:t,dynamicPrice:i,dynamicDiscount:o,isEnableDynamicDiscount:s}=useDynamicProduct.useDynamicProduct(),{t:l}=core.useI18nStore(),r=useRecurringSubtotal.useRecurringSubtotal(),{isSubscription:n}=useSubscriptionSellingType.useSubscriptionSellingType(),{subTotalMoneyFormatted:a,offerDiscountTotal:c,discountMoneyFormatted:b,totalMoneyFormatted:p}=useProductPriceBreakdown.useProductPriceBreakdown(),d=()=>{let d=[];return!1!==e.isShowSubTotalLabel&&d.push({title:u.subTotalLabel,money:t?i:a,uniqueId:"subTotalLabel"}),!1!==e.isShowDiscountLabel&&d.push({title:u.discountLabel,money:t&&o&&s?`${o.value}%`:c>0?b:"No discount",uniqueId:"discountLabel"}),!1!==e.isShowShippingLabel&&d.push({title:u.shippingLabel,uniqueId:"shippingLabel",tooltip:{content:"Shipping fee will be calculated on real offer page",width:"23em"}}),!1!==e.isShowTaxesLabel&&d.push({title:u.taxesLabel,uniqueId:"taxesLabel",tooltip:{content:"Taxes will be calculated on real offer page",width:"20em"}}),!1!==e.isShowTotalLabel&&d.push({title:u.totalLabel,money:t?i:p,uniqueId:"totalLabel"}),u?.isShowRecurringTotalLabel!==!1&&r&&n&&d.push({title:l("Recurring subtotal"),money:r,uniqueId:"recurringTotalLabel",subTitle:l("Doesn't include shipping, tax or duties")}),d};return{getMoneyLines:d}};exports.useGetMoneyLines=useGetMoneyLines;
