import { t } from '@/services/i18n'; import { getDismissed, setDismissed } from '@/utils/cross-domain-storage'; import { setTrustedHtml, trustedHtml } from '@/utils/dom-utils'; const DISMISS_KEY = 'wm-layer-warning-dismissed'; let activeDialog: HTMLElement | null = null; export function showLayerWarning(threshold: number): void { if (getDismissed(DISMISS_KEY)) return; if (activeDialog) return; if (window.self !== window.top) return; if (new URLSearchParams(window.location.search).get('alert') === 'false') return; const overlay = document.createElement('div'); overlay.className = 'layer-warn-overlay'; setTrustedHtml(overlay, trustedHtml(`
${t('components.deckgl.layerWarningBody', { threshold })}