import{i as n,a as e,b as r}from"./quoteFilters-8fb88ba6.js";import"./provider-constants-fc252349.js";function t(e){return e.find(function(e){return n(e)})}function u(n){return!!t(n)}function i(r,u){var i=t(r),o=function(r,t){var u;return(u=t?r.filter(function(r){return!n(r)&&!e(r)}):r.filter(function(e){return!n(e)})).reduce(function(n,e){return n.receivedAmount>=e.receivedAmount?n:e},u[0])}(r,u);return i.receivedAmount-o.receivedAmount}function o(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return r.length>=2&&u(r)&&function(r,t){return t?!!r.some(function(r){return!n(r)&&!e(r)}):!!r.some(function(e){return!n(e)})}(r,t)}function c(t){return r(t)&&!n(t)&&!e(t)}function f(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return n.length>=2&&u(n)&&function(n){return!!n.some(c)}(n)}function v(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=t(n),r=function(n){var e=n.filter(c);return e.reduce(function(n,e){return n.receivedAmount<=e.receivedAmount?n:e},e[0])}(n);return e.receivedAmount-r.receivedAmount}function d(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return v(n)/t(n).rate}function m(r,u){if(o(r,u)){var i,c=function(n,r){return(r?n.filter(function(n){return!e(n)}):n).reduce(function(n,e){return n.receivedAmount>=e.receivedAmount?n:e},n[0])}(r,u);if(n(c)){var f=function(n,r){return(r?n.filter(function(n){return!e(n)}):n).reduce(function(n,e){return n.receivedAmount<=e.receivedAmount?n:e},n[0])}(r,u);i=c.receivedAmount-f.receivedAmount}else{i=t(r).receivedAmount-c.receivedAmount}return Math.round(100*i)/100}}export{i as calculateSavingAgainstCheapestNonWiseQuoteInTargetCurrency,d as calculateSavingAgainstMostExpensiveBankInSourceCurrency,v as calculateSavingAgainstMostExpensiveBankInTargetCurrency,m as calculateSavingsWithRespectToWiseQuote,f as supportsCalculatingSavingAgainstMostExpensiveBank,o as supportsCalculatingSavingsAgainstWiseQuote};
//# sourceMappingURL=savingsCalculator.js.map
