import{a as e}from"./BvYk3gM92.js";import{l as t}from"./Bcb1m8Xc2.js";function n(e){return e.replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}function r(r,i,a={}){if(i==null||i===``)return null;if(a.format===`wikilink`){let r=e(i);return r.length===0?null:r.map(e=>t.resolveUserRefName(e)??a.nameResolver?.(e)??n(e)).join(`, `)}let o=Array.isArray(i)?i.join(`, `):String(i);if(!o)return null;if(r===`deal_value`){let e=Number(i);if(!isNaN(e))return e.toLocaleString(`en-US`,{style:`currency`,currency:`USD`,maximumFractionDigits:0})}let s=o.replace(/^\[\[(.+?)\]\]$/,`$1`);if(r.endsWith(`_date`)||r===`date`||r===`presented_at`){try{let e=/^\d{4}-\d{2}-\d{2}$/.test(s)?new Date(s+`T00:00:00`):new Date(s);if(!isNaN(e.getTime()))return e.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}catch{}return s}return s.replace(/[-_]/g,` `).replace(/\b\w/g,e=>e.toUpperCase())}export{r as t};