"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const b=require("string-template"),f=/(\%)[\(]([A-z0-9,.]+)\)/gi,g=/(\#)[\(]([A-z0-9,.]+)\)/gi,S=/(\#C)[\(]([A-z0-9,.]+)\)/gi,h=/(\$)[\(]([A-z0-9,.]+)\)/gi,x=[{name:"USD Dollar",code:"USD",symbol:"$"},{name:"Naira",code:"NGN",symbol:"₦"},{name:"South Africa Rand",code:"ZAR",symbol:"R"},{name:"Ethiopian Birr",code:"ETB",symbol:"Br"},{name:"Zambian Kwacha",code:"ZMW",symbol:"ZK"},{name:"Kenyan Shilling",code:"KES",symbol:"KSh"}],m=(o,t,r,e,s)=>{let n,c=t;for(;(n=o.exec(t))!==null;){const l=n[2],u=(p,d=2)=>s.formatNumber(e?p/100:p,{maximumFractionDigits:d,...r}),i=l.split(","),y=i.length>0&&i[0]?u.apply(void 0,i):"No Data";c=c.replaceAll(n[0],y)}return c},A=(o,t)=>{let r,e=t;for(;(r=o.exec(t))!==null;)if(r.length>2){const s=r[0],n=r[2],c=x.find(l=>a(l.code)==a(n)||a(l.name)==a(n)||a(l.symbol)==a(n));c&&(e=e.replaceAll(s,c.symbol))}return e},a=o=>o&&o.trim().toLowerCase(),C=(o,t,r)=>{let e=b(o,t).replace(/(?:\r\n|\r|\n)/g,"<br>");return e=m(f,e,{style:"percent"},!0,r),e=m(g,e,{style:"decimal"},!1,r),e=m(S,e,{notation:"compact"},!1,r),e=A(h,e),e};exports.formatContent=C;
