{"version":3,"file":"Currency.js","sources":["requirejs/Currency.js"],"sourcesContent":["define([\"require\", \"exports\", \"knockout\"], function (require, exports, ko) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.Currency = void 0;\n class Currency {\n constructor(data) {\n this.FormatMoney = (value) => {\n var _a;\n return ((_a = this.CurrencyFormatter) === null || _a === void 0 ? void 0 : _a.format(value)) || value.formatMoney(this.Symbol(), this.DecimalDigits(), this.DecimalSeparator(), this.GroupSeparator());\n };\n this.FormatMoneyWithoutSymbol = (value) => {\n var _a;\n return ((_a = this.DecimalFormatter) === null || _a === void 0 ? void 0 : _a.format(value)) || this.FormatMoney(value).replace(this.Symbol(), '');\n };\n this.FormatMoneyWithoutFractionOrSymbol = (value) => {\n var _a;\n return ((_a = this.WholeNumberFormater) === null || _a === void 0 ? void 0 : _a.format(value)) || value.formatMoney(this.Symbol(), 0, this.DecimalSeparator(), this.GroupSeparator()).replace(this.Symbol(), '');\n };\n ko.mapping.fromJS(data, {}, this);\n const decimalFormatterOptions = {\n maximumFractionDigits: this.DecimalDigits(),\n minimumFractionDigits: this.DecimalDigits()\n };\n const wholeNumberFormatterOptions = {\n maximumFractionDigits: 0,\n minimumFractionDigits: 0\n };\n if ('Intl' in window) {\n this.DecimalFormatter = new Intl.NumberFormat(this.Locale(), decimalFormatterOptions);\n this.CurrencyFormatter = new Intl.NumberFormat(this.Locale(), Object.assign(Object.assign({}, decimalFormatterOptions), { style: 'currency', currency: this.Currency() }));\n this.WholeNumberFormater = new Intl.NumberFormat(this.Locale(), wholeNumberFormatterOptions);\n }\n }\n }\n exports.Currency = Currency;\n});\n//# sourceMappingURL=Currency.js.map"],"names":["define","require","exports","ko","Object","defineProperty","value","Currency","constructor","data","this","FormatMoney","_a","CurrencyFormatter","format","formatMoney","Symbol","DecimalDigits","DecimalSeparator","GroupSeparator","FormatMoneyWithoutSymbol","DecimalFormatter","replace","FormatMoneyWithoutFractionOrSymbol","WholeNumberFormater","mapping","fromJS","decimalFormatterOptions","maximumFractionDigits","minimumFractionDigits","window","Intl","NumberFormat","Locale","assign","style","currency"],"mappings":"AAAAA,OAAO,CAAC,UAAW,UAAW,YAAa,SAAUC,EAASC,EAASC,gBAEnEC,OAAOC,eAAeH,EAAS,aAAc,CAAEI,OAAO,IACtDJ,EAAQK,cAAW,EA+BnBL,EAAQK,eA7BJC,YAAYC,GACRC,KAAKC,YAAc,IACf,IAAIC,EACJ,OAAQ,OAACA,EAAKF,KAAKG,wBAA+C,EAASD,EAAGE,OAAOR,KAAWA,EAAMS,YAAYL,KAAKM,SAAUN,KAAKO,gBAAiBP,KAAKQ,mBAAoBR,KAAKS,mBAEzLT,KAAKU,yBAA2B,IAC5B,IAAIR,EACJ,OAAQ,OAACA,EAAKF,KAAKW,uBAA8C,EAAST,EAAGE,OAAOR,KAAWI,KAAKC,YAAYL,GAAOgB,QAAQZ,KAAKM,SAAU,KAElJN,KAAKa,mCAAqC,IACtC,IAAIX,EACJ,OAAQ,OAACA,EAAKF,KAAKc,0BAAiD,EAASZ,EAAGE,OAAOR,KAAWA,EAAMS,YAAYL,KAAKM,SAAU,EAAGN,KAAKQ,mBAAoBR,KAAKS,kBAAkBG,QAAQZ,KAAKM,SAAU,KAEjNb,EAAGsB,QAAQC,OAAOjB,EAAM,GAAIC,MACtBiB,EAA0B,CAC5BC,sBAAuBlB,KAAKO,gBAC5BY,sBAAuBnB,KAAKO,iBAM5B,SAAUa,SACVpB,KAAKW,iBAAmB,IAAIU,KAAKC,aAAatB,KAAKuB,SAAUN,GAC7DjB,KAAKG,kBAAoB,IAAIkB,KAAKC,aAAatB,KAAKuB,SAAU7B,OAAO8B,OAAO9B,OAAO8B,OAAO,GAAIP,GAA0B,CAAEQ,MAAO,WAAYC,SAAU1B,KAAKH,cAC5JG,KAAKc,oBAAsB,IAAIO,KAAKC,aAAatB,KAAKuB,SAPtB,CAChCL,sBAAuB,EACvBC,sBAAuB"}