import{a as t,e as r}from"./encodeQueryParams-1369773d.js";import{f as e}from"./fetchQuotes-3904b98d.js";import o from"./transformQuotesResponse.js";import"./extractQuote-96a6b874.js";import"./_commonjsHelpers-17042db9.js";import"./sortQuotesByDeliverySpeedEstimate-554f0c2a.js";import"date-fns";import"duration-fns";var n={RATE_HOST:"https://api.wise.com/v1/rates?source={SOURCE}&target={TARGET}",RATE_TOKEN:"OGNhN2FlMjUtOTNjNS00MmFlLThhYjQtMzlkZTFlOTQzZDEwOjliN2UzNmZkLWRjYjgtNDEwZS1hYzc3LTQ5NGRmYmEyZGJjZA=="};function u(r,e){return fetch(n.RATE_HOST.replace(/{SOURCE}/,r).replace(/{TARGET}/,e),{headers:{"Content-Type":"application/json",Authorization:"Basic ".concat(n.RATE_TOKEN)},method:"GET"}).then(t).then(function(t){return t.json()}).then(function(t){return{route:t[0]}})}var s="https://api.wise.com/v1";function c(t){return t.reduce(function(t,r){var e=r.amount||r;return e>t?e:t},0)}function i(t,r,e){return c(e.map(function(e){return c(e.routes[t][r].recordedAmounts)}))}function a(e,o){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).sourceCountry,u=r({source:e,target:o,sourceCountry:n});return fetch("".concat(s,"/comparisons/providers").concat(u)).then(t).then(function(t){return t.json()}).then(function(t){return{referenceQuotes:t.providers,maxAmountCollected:i(e,o,t.providers)}})}function m(t,r,n,u,s){var c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},i=c.sourceCountry,a=c.providerCountry,m=arguments.length>6&&void 0!==arguments[6]?arguments[6]:void 0;return e(t,r,n,u,s,{providerCountry:a,sourceCountry:i},m).then(function(t){return o(t,r)})}export{m as fetchQuotes,u as fetchRate,a as fetchReferenceQuotes,i as findMaxAmountCollected};
//# sourceMappingURL=clients.js.map
