// `data-tour` anchors on the two pages. The dashboard's guided tours target
// them (lib/tour/*Tour.ts); in WordPress they are inert attributes.

/**
 * Widget page. Since ACC-547 the page is three tabs, each with its own
 * address, and each anchor is on the tab its piece belongs to: `install` on
 * the first, `appearance` and `position` on the second, `advanced` on the
 * third. The save anchor is on the bar of the changes not yet saved, there on
 * any tab only while something is to save (and never for a reader). A step
 * whose anchor is not on the tab that is open is dropped by the tour's
 * visibility filter, so the tour walks that tab only.
 */
export const WIDGET_TOUR_ANCHORS = {
  install: "widget-install",
  appearance: "widget-appearance",
  position: "widget-position",
  advanced: "widget-advanced",
  save: "widget-save",
} as const;

/**
 * Statement page. Since the page was redrawn (ACC-540) they sit on:
 *  - `details`: the card of the form;
 *  - `language`: the language switch of the preview, the one language control
 *    that is always on the page (the tabs of the free text are inside a
 *    section that may be closed);
 *  - `preview`: the preview card, which is not shown on a phone;
 *  - `actions`: the save beside the title, which is not shown on a phone
 *    either (there it is in the bar at the bottom);
 *  - `phoneBar`: that bar, on a phone only.
 * A step whose anchor is not on screen is dropped by the tour.
 *
 * There is no download step: the static copy it pointed at went with ACC-245,
 * and the step with its copy went in C7 (ANSWERS 14/10, point 18).
 */
export const STATEMENT_TOUR_ANCHORS = {
  language: "statement-language",
  details: "statement-details",
  preview: "statement-preview",
  actions: "statement-actions",
  // Below 640px the save and the preview are in the bar at the bottom of the
  // window (`StatementPhoneBar`), and `preview` and `actions` are hidden: a
  // name of its own, since an anchor is in the DOM once.
  phoneBar: "statement-phone-bar",
} as const;

/**
 * What an anchor says about the state its area is in, when the step's text
 * depends on it (the report's view, an expired licence, a statement's form
 * read only): the attribute's value is handed to the step. Set next to the
 * `data-tour`.
 */
export const TOUR_VARIANT = "data-tour-variant";
