jQuery(function ($: JQueryStatic) { function decodeCouponNotice(context?: HTMLElement | Document): void { const $ctx = context ? $(context) : $(document); const selector = '#coupon-error-notice'; $ctx.find(selector).each((_i, el) => { const $el = $(el); const text = $el.text(); const rawHtml = $el.html(); let decoded = ''; // Case 1: HTML entities (old WooCommerce behavior) if (text.includes('<')) { decoded = $('