import { toJsLiteral } from '../pwa/source-literals' import { AccessRulesSettings } from './settings' import { AGE_COOKIE } from './constants' /** The editor's marks and events (`features/plugins/flows/access-rules/access-rules-markers.ts` there). */ const ROOT_ATTR = 'data-tq-age-gate' const EVENTS = { confirm: 'tq-age-gate-confirm', birthdate: 'tq-age-gate-birthdate', close: 'tq-age-gate-close', open: 'tq-age-gate-open', tooYoung: 'tq-age-gate-too-young', } /** * The age gate's head snippet, for a project whose gate is the editor's Age * Gate component: drawn open on every published page, so a visitor who must * confirm sees it from the first paint. Before the page paints, this marks * `` from the cookie and the page's * path (the style hides the gate at once for a visitor who confirmed, or on * a page the gate does not cover); after hydration it tells the component to * close or open through its workflows (`tq-age-gate-close` / `-open`), and * keeps telling it for a while, since the listener attaches only once the * page hydrated. The gate's controls run workflows that send * `tq-age-gate-confirm` (remember, close) and `tq-age-gate-birthdate` with * the date (remember and close, or `tq-age-gate-too-young`). A gated page * can be marked noindex. Dependency-free ES5, so it runs before any bundle. * * ⛔ Shipped inside a `` }