function t(t){return t?t.replace(/[^a-zA-Z\s]/g,"").replace(/\s+/g," ").trim():""}function i(i){var o={topic:"",modification:"",tooltip:""};if(!(null==i?void 0:i.trim()))return o;var a=i.replace(/\*/g,"").replace(/\s+/g," ").trim();console.log("Clean variant:",a);var r=/<(sup|tooltip|info)>[\s*]*([^<]*?)[\s*]*<\/\1>/i,e=a.match(r),l=e?e[2].replace(/\*/g,"").trim():"";console.log("Extracted tooltip:",l);var c=a.replace(r,"").trim();console.log("Main text after tooltip removal:",c);var n=c.match(/.*?replace\s+(.*?)(?:\s+with\s*|$)/i),s="",p="";if(n){s=n[1].trim();var m=c.match(/\s+with\s+(.*?)$/i);p=m?m[1].trim():""}else{var f=c.match(/^(.*?)(?:\s+with\s+(.*?))?$/i);f&&(s=f[1].trim(),p=f[2]?f[2].trim():"")}return s=t(s),p=t(p),l=t(l),console.log("Extracted parts after cleaning:",{mainText:c,topic:s,modification:p,tooltip:l}),s&&(p||l)?(console.log("Final results:",{topic:s,modification:p,tooltip:l}),{topic:s,modification:p,tooltip:l}):(console.log("Validation failed - returning default"),o)}export{i as parseVariant};
//# sourceMappingURL=variantParser.js.map
