import { recomaze_ai_personalization_env } from '../../env'; /** * The Google connection needs an OAuth app Google has not verified yet, so * the consent screen warns every merchant who tries it. Until the review is * through, SEO → Analytics shows only on the sites named here; everywhere * else the page and its menu row stay out of the way. */ const OPEN_ON: string[] = ['aishop.one']; /** * Whether this site may open SEO → Analytics. * * @param {string | null | undefined} domain - The site's domain, as the env carries it. * @returns {boolean} */ export function canSeeSeoAnalytics( domain: string | null | undefined = recomaze_ai_personalization_env?.domain ): boolean { const host = String(domain ?? '') .trim() .toLowerCase() .replace(/^https?:\/\//, '') .replace(/^www\./, '') .split('/')[0] .split(':')[0]; return OPEN_ON.some(open => host === open || host.endsWith(`.${open}`)); }