(()=>{"use strict";var e={d:(t,i)=>{for(var r in i)e.o(i,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:i[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>i});const i={getCurrencies:()=>window.eac_currencies||[],getConfig(e){return e=e||window.eac_base_currency||"USD",this.getCurrencies()[e]||{}},getSymbol(e){return this.getConfig(e).symbol||"$"},getName(e){return this.getConfig(e).name||e},getRate(e){const t=this.getConfig(e);return parseFloat(t.rate)||1},getPrecision(e){return this.getConfig(e).precision||2},getPosition(e){return this.getConfig(e).position||"before"},getThousand(e){return this.getConfig(e).thousand||","},getDecimal(e){return this.getConfig(e).decimal||"."},format(e,t){t=t||window.eac_base_currency||"USD";const i=(e=this.unformat(e))<0,r=Math.abs(e),n=this.getPrecision(t),o=this.getThousand(t),s=this.getDecimal(t),a=this.getPosition(t),g=this.getSymbol(t),u=r.toFixed(n).split("."),c=u[0].replace(/\B(?=(\d{3})+(?!\d))/g,o),l=u.length>1?s+u[1]:"",h="before"===a?g+c+l:c+l+g;return i?"-"+h:h},unformat(e,t){if(t=t||window.eac_base_currency||"USD",null==e||""===e)return 0;if("number"==typeof e)return e;const i=this.getDecimal(t),r=new RegExp(`[^0-9${i}]`,"g"),n=String(e).trim(),o=/^-/.test(n)||/-$/.test(n),s=n.replace(r,"").replace(i,"."),a=parseFloat(s);return isNaN(a)?0:o?-a:a},convert(e,t,i){return e=this.unformat(e),t="string"==typeof t&&3===t.length?this.getRate(t):t,i="string"==typeof i&&3===i.length?this.getRate(i):i,isNaN(t)||t<=0||isNaN(i)||i<=0||t===i||(1!==t&&(e/=t),1!==i&&(e*=i)),e},absint(e){return Math.abs(Math.round(this.unformat(e)))},getCurrencyMaskOptions(e){const t=this.getSymbol(e).replace(/[.,]/g,""),i=this.getPosition(e);return{alias:"currency",placeholder:"0.00",rightAlign:!1,allowMinus:!0,digits:this.getPrecision(e),radixPoint:this.getDecimal(e),groupSeparator:this.getThousand(e),prefix:"before"===i?t:"",suffix:"after"===i?t:"",autoUnmask:!0}},getExchangeRateMaskOptions(e){return{alias:"decimal",rightAlign:!1,allowMinus:!1,digitsOptional:!1,groupSeparator:"",digits:4,suffix:this.getSymbol(e).replace(/[.,]/g,""),removeMaskOnSubmit:!0}}};(window.eac=window.eac||{}).money=t})();