{"version":3,"file":"i18n-DuuduVQ9.js","sources":["../../../app/javascript/plugins/i18n.js"],"sourcesContent":["export default {\n install: (app, options) => {\n const translate = (path, interpolations) => {\n let copy = options[path];\n if (interpolations) {\n Object.keys(interpolations).forEach(key => {\n const re = new RegExp(`%{${key}}`, \"g\");\n // If you use String.prototype.replace and the thing you want to insert\n // begins with \"$[0-9]\", it will fail in Safari and FF. You should use\n // \"$$\" to escape one of the \"$\". This happens for us when passing in\n // formatted AU or US currency. https://github.com/zloirock/core-js/issues/471\n if (\n typeof interpolations[key] === \"string\" &&\n interpolations[key].charAt(0) === \"$\"\n ) {\n interpolations[key] = `$${interpolations[key]}`;\n }\n copy = copy.replace(re, interpolations[key]);\n });\n }\n return copy;\n };\n\n app.provide(\"t\", translate);\n app.config.globalProperties.t = translate;\n }\n};\n"],"names":["I18n","app","options","translate","path","interpolations","copy","key","re"],"mappings":"AAAA,MAAeA,EAAA,CACb,QAAS,CAACC,EAAKC,IAAY,CACzB,MAAMC,EAAY,CAACC,EAAMC,IAAmB,CAC1C,IAAIC,EAAOJ,EAAQE,CAAI,EACvB,OAAIC,GACF,OAAO,KAAKA,CAAc,EAAE,QAAQE,GAAO,CACzC,MAAMC,EAAK,IAAI,OAAO,KAAKD,CAAG,IAAK,GAAG,EAMpC,OAAOF,EAAeE,CAAG,GAAM,UAC/BF,EAAeE,CAAG,EAAE,OAAO,CAAC,IAAM,MAElCF,EAAeE,CAAG,EAAI,IAAIF,EAAeE,CAAG,CAAC,IAE/CD,EAAOA,EAAK,QAAQE,EAAIH,EAAeE,CAAG,CAAC,CACrD,CAAS,EAEID,CACR,EAEDL,EAAI,QAAQ,IAAKE,CAAS,EAC1BF,EAAI,OAAO,iBAAiB,EAAIE,CACpC,CACA"}