()
| 1490 | } |
| 1491 | |
| 1492 | export async function initAiChat() { |
| 1493 | if (initialized) return; |
| 1494 | if (window.__FR_IS_PRO !== true) return; |
| 1495 | initialized = true; |
| 1496 | |
| 1497 | try { |
| 1498 | const cfg = await apiGet('/api/pro/ai/config/public.php'); |
| 1499 | const settings = (cfg && cfg.settings && typeof cfg.settings === 'object') ? cfg.settings : {}; |
| 1500 | if (!settings.chatEnabled) { |
| 1501 | return; |
| 1502 | } |
| 1503 | |
| 1504 | createChatUi(cfg); |
| 1505 | } catch (e) { |
| 1506 | // Non-Pro or disabled instances are expected to fail this request. |
| 1507 | } |
| 1508 | } |
nothing calls this directly
no test coverage detected