"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/AccessibilityWidget/AccessibilityWidget.tsx
var AccessibilityWidget_exports = {};
__export(AccessibilityWidget_exports, {
  default: () => AccessibilityWidget
});
module.exports = __toCommonJS(AccessibilityWidget_exports);

// src/components/Button/Button.tsx
var import_react = require("react");

// src/utils/utils.ts
var import_clsx = require("clsx");
var import_tailwind_merge = require("tailwind-merge");
function cn(...inputs) {
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
}

// src/components/Button/Button.tsx
var import_jsx_runtime = require("react/jsx-runtime");
var VARIANT_ACTION_CLASSES = {
  solid: {
    primary: "bg-primary-950 text-text border border-primary-950 hover:bg-primary-800 hover:border-primary-800 focus-visible:outline-none focus-visible:bg-primary-950 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-primary-700 active:border-primary-700 disabled:bg-primary-500 disabled:border-primary-500 disabled:opacity-40 disabled:cursor-not-allowed",
    secondary: "bg-text-950 text-text border border-text-800 hover:bg-text-800 hover:border-text-950 focus-visible:outline-none focus-visible:bg-text-900 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-text-700 active:border-text-700 disabled:bg-text-500 disabled:border-text-500 disabled:opacity-40 disabled:cursor-not-allowed",
    positive: "bg-success-500 text-text border border-success-500 hover:bg-success-600 hover:border-success-600 focus-visible:outline-none focus-visible:bg-success-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-success-700 active:border-success-700 disabled:bg-success-500 disabled:border-success-500 disabled:opacity-40 disabled:cursor-not-allowed",
    negative: "bg-error-500 text-text border border-error-500 hover:bg-error-600 hover:border-error-600 focus-visible:outline-none focus-visible:bg-error-500 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:bg-error-700 active:border-error-700 disabled:bg-error-500 disabled:border-error-500 disabled:opacity-40 disabled:cursor-not-allowed"
  },
  outline: {
    primary: "bg-transparent text-primary-950 border border-primary-950 hover:bg-background-50 hover:text-primary-400 hover:border-primary-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 active:border-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
    secondary: "bg-transparent text-text-950 border border-text-800 hover:bg-background-50 hover:text-text-700 hover:border-text-700 focus-visible:border-0 focus-visible:outline-none focus-visible:text-text-900 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-text-700 active:border-text-700 disabled:opacity-40 disabled:cursor-not-allowed",
    positive: "bg-transparent text-success-500 border border-success-300 hover:bg-background-50 hover:text-success-400 hover:border-success-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 active:border-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
    negative: "bg-transparent text-error-500 border border-error-300 hover:bg-background-50 hover:text-error-400 hover:border-error-400 focus-visible:border-0 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 active:border-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
  },
  link: {
    primary: "bg-transparent text-primary-950 hover:text-primary-400 focus-visible:outline-none focus-visible:text-primary-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-primary-700 disabled:opacity-40 disabled:cursor-not-allowed",
    secondary: "bg-transparent text-text-950 hover:text-text-800 focus-visible:outline-none focus-visible:text-text-900 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-text-700 disabled:opacity-40 disabled:cursor-not-allowed",
    positive: "bg-transparent text-success-500 hover:text-success-400 focus-visible:outline-none focus-visible:text-success-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-success-700 disabled:opacity-40 disabled:cursor-not-allowed",
    negative: "bg-transparent text-error-500 hover:text-error-400 focus-visible:outline-none focus-visible:text-error-600 focus-visible:ring-2 focus-visible:ring-offset-0 focus-visible:ring-indicator-info active:text-error-700 disabled:opacity-40 disabled:cursor-not-allowed"
  }
};
var SIZE_CLASSES = {
  "extra-small": "text-xs px-3.5 py-2",
  small: "text-sm px-4 py-2.5",
  medium: "text-md px-5 py-2.5",
  large: "text-lg px-6 py-3",
  "extra-large": "text-lg px-7 py-3.5"
};
var Button = (0, import_react.forwardRef)(
  ({
    children,
    iconLeft,
    iconRight,
    size = "medium",
    variant = "solid",
    action = "primary",
    className = "",
    disabled,
    type = "button",
    ...props
  }, ref) => {
    if (variant === "raw") {
      return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
        "button",
        {
          ref,
          className,
          disabled,
          type,
          ...props,
          children: [
            iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
            children,
            iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
          ]
        }
      );
    }
    const sizeClasses = SIZE_CLASSES[size];
    const variantClasses = VARIANT_ACTION_CLASSES[variant][action];
    const baseClasses = "inline-flex items-center justify-center rounded-full cursor-pointer font-medium";
    return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
      "button",
      {
        ref,
        className: cn(baseClasses, variantClasses, sizeClasses, className),
        disabled,
        type,
        ...props,
        children: [
          iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "mr-2 flex items-center", children: iconLeft }),
          children,
          iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "ml-2 flex items-center", children: iconRight })
        ]
      }
    );
  }
);
Button.displayName = "Button";
var Button_default = Button;

// src/components/Tooltip/Tooltip.tsx
var import_react2 = require("react");
var import_react_dom = require("react-dom");

// src/components/Text/Text.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var Text = ({
  children,
  size = "md",
  weight = "normal",
  color = "text-text-950",
  as,
  className = "",
  ...props
}) => {
  let sizeClasses;
  let weightClasses;
  const sizeClassMap = {
    "2xs": "text-2xs",
    xs: "text-xs",
    sm: "text-sm",
    md: "text-md",
    lg: "text-lg",
    xl: "text-xl",
    "2xl": "text-2xl",
    "3xl": "text-3xl",
    "4xl": "text-4xl",
    "5xl": "text-5xl",
    "6xl": "text-6xl"
  };
  sizeClasses = sizeClassMap[size] ?? sizeClassMap.md;
  const weightClassMap = {
    hairline: "font-hairline",
    light: "font-light",
    normal: "font-normal",
    medium: "font-medium",
    semibold: "font-semibold",
    bold: "font-bold",
    extrabold: "font-extrabold",
    black: "font-black"
  };
  weightClasses = weightClassMap[weight] ?? weightClassMap.normal;
  const baseClasses = "font-primary";
  const Component = as ?? "p";
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
    Component,
    {
      className: cn(baseClasses, sizeClasses, weightClasses, color, className),
      ...props,
      children
    }
  );
};
var Text_default = Text;

// src/components/Tooltip/Tooltip.tsx
var import_jsx_runtime3 = require("react/jsx-runtime");
var POSITION_CLASSES = {
  top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
  bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
  left: "right-full top-1/2 -translate-y-1/2 mr-2",
  right: "left-full top-1/2 -translate-y-1/2 ml-2"
};
var TOOLTIP_GAP_PX = 8;
var computePortalCoords = (triggerRect, position, tooltipRect) => {
  switch (position) {
    case "bottom":
      return {
        top: triggerRect.bottom + TOOLTIP_GAP_PX,
        left: triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2
      };
    case "left":
      return {
        top: triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2,
        left: triggerRect.left - tooltipRect.width - TOOLTIP_GAP_PX
      };
    case "right":
      return {
        top: triggerRect.top + triggerRect.height / 2 - tooltipRect.height / 2,
        left: triggerRect.right + TOOLTIP_GAP_PX
      };
    case "top":
    default:
      return {
        top: triggerRect.top - tooltipRect.height - TOOLTIP_GAP_PX,
        left: triggerRect.left + triggerRect.width / 2 - tooltipRect.width / 2
      };
  }
};
var TOOLTIP_CONTENT_CLASSES = cn(
  "whitespace-nowrap",
  "px-4 py-2 rounded-lg",
  "bg-background-dark text-white",
  "text-sm font-medium",
  "shadow-[0px_3px_10px_0px_rgba(38,38,38,0.2)]",
  "transition-opacity duration-150"
);
function Tooltip({
  content,
  children,
  position = "top",
  className,
  contentClassName,
  disabled = false,
  usePortal = false
}) {
  const triggerRef = (0, import_react2.useRef)(null);
  const tooltipRef = (0, import_react2.useRef)(null);
  const [open, setOpen] = (0, import_react2.useState)(false);
  const [coords, setCoords] = (0, import_react2.useState)({
    top: 0,
    left: 0
  });
  const updatePosition = (0, import_react2.useCallback)(() => {
    if (!triggerRef.current || !tooltipRef.current) return;
    const triggerRect = triggerRef.current.getBoundingClientRect();
    const tooltipRect = {
      width: tooltipRef.current.offsetWidth,
      height: tooltipRef.current.offsetHeight
    };
    setCoords(computePortalCoords(triggerRect, position, tooltipRect));
  }, [position]);
  (0, import_react2.useLayoutEffect)(() => {
    if (!usePortal || !open) return;
    updatePosition();
    const onViewportChange = () => updatePosition();
    window.addEventListener("resize", onViewportChange);
    window.addEventListener("scroll", onViewportChange, true);
    return () => {
      window.removeEventListener("resize", onViewportChange);
      window.removeEventListener("scroll", onViewportChange, true);
    };
  }, [usePortal, open, updatePosition, content]);
  (0, import_react2.useEffect)(() => {
    if (!usePortal) return;
    const node = triggerRef.current;
    if (!node) return;
    const handleOpen = () => setOpen(true);
    const handleClose = () => setOpen(false);
    node.addEventListener("mouseenter", handleOpen);
    node.addEventListener("mouseleave", handleClose);
    node.addEventListener("focusin", handleOpen);
    node.addEventListener("focusout", handleClose);
    return () => {
      node.removeEventListener("mouseenter", handleOpen);
      node.removeEventListener("mouseleave", handleClose);
      node.removeEventListener("focusin", handleOpen);
      node.removeEventListener("focusout", handleClose);
    };
  }, [usePortal]);
  if (disabled) {
    return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children });
  }
  if (usePortal) {
    return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
      Text_default,
      {
        as: "span",
        ref: triggerRef,
        className: cn("relative inline-flex", className),
        "aria-describedby": open ? "tooltip-portal" : void 0,
        children: [
          children,
          open && typeof document !== "undefined" && (0, import_react_dom.createPortal)(
            /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
              "div",
              {
                ref: tooltipRef,
                id: "tooltip-portal",
                role: "tooltip",
                style: {
                  position: "fixed",
                  top: coords.top,
                  left: coords.left,
                  zIndex: 9999
                },
                className: cn(TOOLTIP_CONTENT_CLASSES, contentClassName),
                children: content
              }
            ),
            document.body
          )
        ]
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cn("relative inline-flex group", className), children: [
    children,
    /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
      "div",
      {
        role: "tooltip",
        className: cn(
          "absolute z-50",
          TOOLTIP_CONTENT_CLASSES,
          "opacity-0 invisible",
          "group-hover:opacity-100 group-hover:visible",
          "group-focus-within:opacity-100 group-focus-within:visible",
          POSITION_CLASSES[position],
          contentClassName
        ),
        children: content
      }
    )
  ] });
}

// src/assets/img/accessibility.png
var accessibility_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAABa9JREFUeAG1WU9MXEUY/xaJNSVhiUbBCHRtAlGhaW1YMaRJtyVGOJgIF46uJuClgTVBYyL/uTSCKR40Ahq2niAxeDABTNDSAxxE0xrA6GkpRCE1hS5toySacX6zb57DMPvevBV/ycfbN/Nm5jffv/neI0Q5gjEW45czXM471yJHgLtc1h35kctCKBRaoP8bnFQRl14uuyw4UlwmuEToqOEQu8KODhO2REMW5Dr4pY/+NZ/A0tKSK5ubm0JUVFdXU1lZGTU0NFBdXZ34rWGdSz83fZJyJQit8UtCbZuamhICYlgYRKqqqgQBSDqdpr29PSFyA6urq+LZlpYWIRpGOMm3KAgck15TbbK4uMjq6+tZRUUFGxoaYpwIs8XGxgZrb29nxcXFrKmpSdxruIE1gxC8oY4GIUze3d0diJgX0dHRUb37mi25A8GACaE1aDAbQBqbiMfjQiYnJ01acjE2NuZaQsMVP3Jx9WlorKamxnOxlZUVsVjlxVfY82+8zaKXBtiJU2fFOPT5jTOQTGQjF2GZXCWAgX7k0Idnajip5ut3DgjaKisrPV1CktTMjRxbZCI4oQ6En3iZFYCGT9aeP0ROCrRq0NABwB2wEU0RrqnzpPb4JS4bE4kEtbW1idTgBaSP4tirWfsfi14UacYLSDtIUz09PWpzQmox32noxR/kLmB+ft797QWbZ2yQTCbd+QoLC2UzfLEvz7mJ8cgi7k/E1U0dHR1WE0PDd5a/zdp/f/0X0wlyCCDFo1+sXVJSQsPDw2jOkOCqjMH+8Ln6j2fZy1cXRRQa8pTRyTHuXP+nh/zvXP9nos8ryFQ/LOdrYu0X3xlRx8Vg4hj85NjjT1G46gVBuuDEs7S2tua7cxxzg4OD1N39HqV/+l743F8P9sTv2wtf0sDAgJUGsX74uSgVRJ4RsvnFR8K/+dgzMPHpxsZGOrZ/j1JXL9PWzOd8ge/EQL0AMKG1tZWWl5fpQvHDdH/yffrzq0/o7CN/0PT0tAg0P8DvcH7vLH8j1k4lL9PxhzKb54i5xxrMhXMSeU0maKgaJ4lXws0V8vRBHsRa+I2zHhyU9VIguOvlGxgAonISv9zoRwrjMackhjU8sBvCX2nOaDQqzKX7DfpmZ2dpbm5O+AuiDiaQ5RbuTb4m60T4M3wKAsClkP/0PIu5m5ubaXt7222zIqj7jFrn4V4ubALmQiKWG/JK/iaCromhftu0YALXsBgPgdlyKctgfhx7qokRxXgDE2aCeGnDCzywqLOzU0Suk2gDA2uXlpaqTesgeFPewQw2+U+HJASCEIAHFAUF1i4vL1ebbsHECalPRCkiLKhZdNeQbUEj3hDVfeKo0ye29R9ZD5pKKplLbefi5jXFQEzokSm5EBr0q+EkkMRBwgQQQ19XVxezAebSrJdyDc1v+mSrLCD9do7n/KLe1tSyWJmZmVGbJ1SCRWqP386ldmw0bWNqg/aAyIEI4g0jssdv53JRW+CMzbZhlHUGS0wcCnGW0aLri9CO4V3ByrQ6sr3jyHat9kwxRXshjSTKbPeFBZW1PJ7Gx8dFWYTjCOeozHe2QK7EJxPMFQ6HRZkmv+toc73u+b2GKaaWgDnxhnaq5c2c8puqebw7n6yNZXOREZ1Pvt7A2SNxnyYUi5Q5wLd27lLtB19nBhwvdDURBJjnCf4G+PRr7/Kq+x79cOklcbQ5hSlwE2vr4/KyzNdEzhGIagQT7t/+VZTzD279LEwUFBiz//tv4vfffB7MpcyzwOWCaZzf5zeovAP+A8kvKKQnHw2Lch4+KTUAbao1oVoHQnP4Rgi/RSm1tZMW5JRz+0OT5qwIOiTj/NLLyURQ+8kCVS1iTR8wZR0I8ihQJXml4EUVhQ+YI/RfwTLfbZLs6IBAtP8emAPRFAsO5Ni+oMR8TexBNkaZSEfERxxR/w0BQaBdp0yELlAO+Ach5cXReJZfPAAAAABJRU5ErkJggg==";

// src/components/AccessibilityWidget/fabPositioning.ts
var FAB_POSITION_CLASSES = {
  right: "right-0 rounded-l-lg",
  left: "left-0 rounded-r-lg"
};
var FAB_VERTICAL_ALIGN_CLASSES = {
  center: "top-1/2 -translate-y-1/2",
  // Pares empilhados (acessibilidade + Libras) com gap mínimo entre si,
  // como no widget do HandTalk. Cada FAB tem 40px (h-10).
  "above-center": "top-[calc(50%-1px)] -translate-y-full",
  "below-center": "top-[calc(50%+1px)]"
};
var FAB_TOOLTIP_POSITION = {
  right: "left",
  left: "right"
};

// src/components/AccessibilityWidget/AccessibilityFab.tsx
var import_jsx_runtime4 = require("react/jsx-runtime");
function AccessibilityFab({
  onClick,
  isOpen = false,
  position = "right",
  verticalAlign = "center",
  className
}) {
  const label = isOpen ? "Fechar op\xE7\xF5es de acessibilidade" : "Op\xE7\xF5es de acessibilidade";
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
    Tooltip,
    {
      content: label,
      position: FAB_TOOLTIP_POSITION[position],
      className: cn(
        "fixed z-40",
        FAB_VERTICAL_ALIGN_CLASSES[verticalAlign],
        FAB_POSITION_CLASSES[position]
      ),
      children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
        Button_default,
        {
          variant: "raw",
          onClick,
          "aria-label": label,
          "aria-expanded": isOpen,
          "data-testid": "accessibility-fab",
          className: cn(
            "a11y-widget-shield",
            FAB_POSITION_CLASSES[position],
            "flex h-10 w-10 cursor-pointer items-center justify-center",
            // `text-text-50` flipa junto com `bg-info-900` (claro no light,
            // escuro no dark). `text-white` deixaria o ícone branco sumindo
            // no tema escuro, onde `bg-info-900` resolve pra azul-claro.
            "bg-info-900 text-text-50 shadow-lg",
            "transition-all duration-200 hover:scale-110 hover:bg-info-800",
            "focus:outline-none focus:ring-4 focus:ring-info-300",
            className
          ),
          children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
            "img",
            {
              src: accessibility_default,
              alt: "",
              "aria-hidden": "true",
              className: "h-7 w-7"
            }
          )
        }
      )
    }
  );
}

// src/components/AccessibilityWidget/AccessibilityPanel.tsx
var import_react8 = require("react");
var import_react9 = require("@phosphor-icons/react");

// src/components/IconButton/IconButton.tsx
var import_react3 = require("react");
var import_jsx_runtime5 = require("react/jsx-runtime");
var IconButton = (0, import_react3.forwardRef)(
  ({ icon, size = "md", active = false, className = "", disabled, ...props }, ref) => {
    const baseClasses = [
      "inline-flex",
      "items-center",
      "justify-center",
      "rounded-lg",
      "font-medium",
      "bg-transparent",
      "text-text-950",
      "cursor-pointer",
      "hover:bg-primary-600",
      "hover:text-text",
      "focus-visible:outline-none",
      "focus-visible:ring-2",
      "focus-visible:ring-offset-0",
      "focus-visible:ring-indicator-info",
      "disabled:opacity-50",
      "disabled:cursor-not-allowed",
      "disabled:pointer-events-none"
    ];
    const sizeClasses = {
      sm: ["w-6", "h-6", "text-sm"],
      md: ["w-10", "h-10", "text-base"]
    };
    const activeClasses = active ? ["!bg-primary-50", "!text-primary-950", "hover:!bg-primary-100"] : [];
    const allClasses = [
      ...baseClasses,
      ...sizeClasses[size],
      ...activeClasses
    ].join(" ");
    const ariaLabel = props["aria-label"] ?? "Bot\xE3o de a\xE7\xE3o";
    return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
      "button",
      {
        ref,
        type: "button",
        className: cn(allClasses, className),
        disabled,
        "aria-pressed": active,
        "aria-label": ariaLabel,
        ...props,
        children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "flex items-center justify-center", children: icon })
      }
    );
  }
);
IconButton.displayName = "IconButton";
var IconButton_default = IconButton;

// src/components/ToggleSwitch/ToggleSwitch.tsx
var import_jsx_runtime6 = require("react/jsx-runtime");
var SIZE_CLASSES2 = {
  small: {
    track: "h-5 w-9",
    thumb: "h-4 w-4",
    translate: "translate-x-4"
  },
  medium: {
    track: "h-6 w-11",
    thumb: "h-5 w-5",
    translate: "translate-x-5"
  },
  large: {
    track: "h-7 w-14",
    thumb: "h-6 w-6",
    translate: "translate-x-7"
  }
};
var ToggleSwitch = ({
  checked = false,
  onChange,
  size = "small",
  disabled = false,
  className = "",
  thumbClassName = "",
  checkedColor = "bg-success-500",
  uncheckedColor = "bg-border-300",
  ...props
}) => {
  const sizeClasses = SIZE_CLASSES2[size];
  const trackClasses = cn(
    "relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent",
    "transition-colors duration-200 ease-in-out",
    "focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2",
    sizeClasses.track,
    checked ? checkedColor : uncheckedColor,
    disabled && "cursor-not-allowed opacity-40",
    className
  );
  const thumbClasses = cn(
    "pointer-events-none inline-block transform rounded-full bg-white shadow ring-0",
    "transition duration-200 ease-in-out",
    sizeClasses.thumb,
    checked ? sizeClasses.translate : "translate-x-0",
    thumbClassName
  );
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
    Button_default,
    {
      variant: "raw",
      type: "button",
      role: "switch",
      "aria-checked": checked,
      disabled,
      className: trackClasses,
      ...props,
      onClick: (e) => {
        props.onClick?.(e);
        if (!e.defaultPrevented) {
          onChange?.();
        }
      },
      children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: thumbClasses })
    }
  );
};
ToggleSwitch.displayName = "ToggleSwitch";
var ToggleSwitch_default = ToggleSwitch;

// src/components/AccessibilityWidget/AccessibilityToggleRow.tsx
var import_jsx_runtime7 = require("react/jsx-runtime");
function AccessibilityToggleRow({
  label,
  ariaLabel,
  description,
  checked,
  onChange,
  rowTestId,
  switchTestId
}) {
  const computedAriaLabel = ariaLabel ?? (typeof label === "string" ? label : void 0);
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
    "div",
    {
      role: "switch",
      tabIndex: 0,
      "aria-checked": checked,
      "aria-label": computedAriaLabel,
      "data-testid": rowTestId,
      className: cn(
        "flex items-center justify-between gap-3 rounded-md py-1.5",
        "cursor-pointer transition-colors duration-150 hover:bg-background-100",
        "focus:outline-none focus-visible:ring-2 focus-visible:ring-info-500"
      ),
      onClick: onChange,
      onKeyDown: (e) => {
        if (e.key === "Enter" || e.key === " ") {
          e.preventDefault();
          onChange();
        }
      },
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex flex-col", children: [
          /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text_default, { size: "sm", className: "text-text-900", children: label }),
          description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Text_default, { size: "2xs", className: "text-text-600", children: description })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
          ToggleSwitch_default,
          {
            checked,
            onChange: () => void 0,
            checkedColor: "bg-info-600",
            "data-testid": switchTestId,
            tabIndex: -1,
            "aria-hidden": true
          }
        )
      ]
    }
  );
}

// src/components/AccessibilityWidget/TTSSection.tsx
var import_react6 = require("react");
var import_react7 = require("@phosphor-icons/react");

// src/components/Select/Select.tsx
var import_zustand = require("zustand");
var import_react4 = require("react");
var import_react_dom2 = require("react-dom");
var import_phosphor_react = require("phosphor-react");
var import_jsx_runtime8 = require("react/jsx-runtime");
var VARIANT_CLASSES = {
  outlined: "border-2 rounded-lg focus:border-primary-950",
  underlined: "border-b-2 focus:border-primary-950",
  rounded: "border-2 rounded-full focus:border-primary-950"
};
var SIZE_CLASSES3 = {
  small: "text-sm",
  medium: "text-md",
  large: "text-lg",
  "extra-large": "text-lg"
};
var HEIGHT_CLASSES = {
  small: "h-8",
  medium: "h-9",
  large: "h-10",
  "extra-large": "h-12"
};
var PADDING_CLASSES = {
  small: "px-2 py-1",
  medium: "px-3 py-2",
  large: "px-4 py-3",
  "extra-large": "px-5 py-4"
};
function createSelectStore(onValueChange) {
  return (0, import_zustand.create)((set) => ({
    open: false,
    setOpen: (open) => set({ open }),
    value: "",
    setValue: (value) => set({ value }),
    selectedLabel: "",
    setSelectedLabel: (label) => set({ selectedLabel: label }),
    onValueChange,
    triggerRect: null,
    setTriggerRect: (rect) => set({ triggerRect: rect })
  }));
}
var useSelectStore = (externalStore) => {
  if (!externalStore) {
    throw new Error(
      "Component must be used within a Select (store is missing)"
    );
  }
  return externalStore;
};
function getLabelAsNode(children) {
  if (typeof children === "string" || typeof children === "number") {
    return children;
  }
  const flattened = import_react4.Children.toArray(children);
  if (flattened.length === 1) return flattened[0];
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: flattened });
}
var injectStore = (children, store, size, selectId) => {
  return import_react4.Children.map(children, (child) => {
    if ((0, import_react4.isValidElement)(child)) {
      const typedChild = child;
      const newProps = {
        store
      };
      if (typedChild.type === SelectTrigger) {
        newProps.size = size;
        newProps.selectId = selectId;
      }
      if (typedChild.type === SelectContent) {
        newProps.selectId = selectId;
      }
      if (typedChild.props.children) {
        newProps.children = injectStore(
          typedChild.props.children,
          store,
          size,
          selectId
        );
      }
      return (0, import_react4.cloneElement)(typedChild, newProps);
    }
    return child;
  });
};
var Select = ({
  children,
  defaultValue = "",
  className,
  value: propValue,
  onValueChange,
  size = "small",
  label,
  helperText,
  errorMessage,
  id
}) => {
  const storeRef = (0, import_react4.useRef)(null);
  storeRef.current ??= createSelectStore(onValueChange);
  const store = storeRef.current;
  const selectRef = (0, import_react4.useRef)(null);
  const { open, setOpen, setValue, selectedLabel } = (0, import_zustand.useStore)(store, (s) => s);
  const generatedId = (0, import_react4.useId)();
  const selectId = id ?? `select-${generatedId}`;
  const findLabelForValue = (children2, targetValue) => {
    let found = null;
    const search = (nodes) => {
      import_react4.Children.forEach(nodes, (child) => {
        if (!(0, import_react4.isValidElement)(child)) return;
        const typedChild = child;
        if (typedChild.type === SelectItem && typedChild.props.value === targetValue) {
          if (typeof typedChild.props.children === "string")
            found = typedChild.props.children;
        }
        if (typedChild.props.children && !found)
          search(typedChild.props.children);
      });
    };
    search(children2);
    return found;
  };
  (0, import_react4.useEffect)(() => {
    if (!selectedLabel && defaultValue) {
      const label2 = findLabelForValue(children, defaultValue);
      if (label2) store.setState({ selectedLabel: label2 });
    }
  }, [children, defaultValue, selectedLabel]);
  (0, import_react4.useEffect)(() => {
    const handleClickOutside = (event) => {
      const target = event.target;
      const isInsideTrigger = selectRef.current?.contains(target);
      const portaledMenu = document.body.querySelector(
        `[role="menu"][data-select-id="${selectId}"]`
      );
      const isInsidePortaledMenu = portaledMenu?.contains(target);
      if (!isInsideTrigger && !isInsidePortaledMenu) {
        setOpen(false);
      }
    };
    const handleArrowKeys = (event) => {
      const selectContent = document.body.querySelector(
        `[role="menu"][data-select-id="${selectId}"]`
      );
      if (selectContent) {
        event.preventDefault();
        const items = Array.from(
          selectContent.querySelectorAll(
            '[role="menuitem"]:not([aria-disabled="true"])'
          )
        ).filter((el) => el instanceof HTMLElement);
        const focused = document.activeElement;
        const currentIndex = items.findIndex((item) => item === focused);
        let nextIndex;
        if (event.key === "ArrowDown") {
          nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % items.length;
        } else {
          nextIndex = currentIndex === -1 ? items.length - 1 : (currentIndex - 1 + items.length) % items.length;
        }
        items[nextIndex]?.focus();
      }
    };
    if (open) {
      document.addEventListener("mousedown", handleClickOutside);
      document.addEventListener("keydown", handleArrowKeys);
    }
    return () => {
      document.removeEventListener("mousedown", handleClickOutside);
      document.removeEventListener("keydown", handleArrowKeys);
    };
  }, [open, selectId, setOpen]);
  (0, import_react4.useEffect)(() => {
    if (propValue === void 0) return;
    setValue(propValue);
    const label2 = findLabelForValue(children, propValue);
    store.setState({ selectedLabel: label2 ?? "" });
  }, [propValue, children]);
  const sizeClasses = SIZE_CLASSES3[size];
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: cn("w-full", className), children: [
    label && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
      "label",
      {
        htmlFor: selectId,
        className: cn("block font-bold text-text-900 mb-1.5", sizeClasses),
        children: label
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: cn("relative w-full"), ref: selectRef, children: injectStore(children, store, size, selectId) }),
    (helperText || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mt-1.5 gap-1.5", children: [
      helperText && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm text-text-500", children: helperText }),
      errorMessage && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { className: "flex gap-1 items-center text-sm text-indicator-error", children: [
        /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_phosphor_react.WarningCircle, { size: 16 }),
        " ",
        errorMessage
      ] })
    ] })
  ] });
};
var SelectValue = ({
  placeholder,
  store: externalStore
}) => {
  const store = useSelectStore(externalStore);
  const selectedLabel = (0, import_zustand.useStore)(store, (s) => s.selectedLabel);
  const value = (0, import_zustand.useStore)(store, (s) => s.value);
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "text-inherit flex gap-2 items-center", children: selectedLabel || placeholder || value });
};
var SelectTrigger = (0, import_react4.forwardRef)(
  ({
    className,
    invalid = false,
    variant = "outlined",
    store: externalStore,
    disabled,
    size = "medium",
    selectId,
    type = "button",
    ...props
  }, ref) => {
    const store = useSelectStore(externalStore);
    const open = (0, import_zustand.useStore)(store, (s) => s.open);
    const internalRef = (0, import_react4.useRef)(null);
    const setRefs = (0, import_react4.useCallback)(
      (element) => {
        internalRef.current = element;
        if (typeof ref === "function") {
          ref(element);
        } else if (ref) {
          ref.current = element;
        }
      },
      [ref]
    );
    const updateTriggerRect = (0, import_react4.useCallback)(() => {
      if (internalRef.current) {
        const rect = internalRef.current.getBoundingClientRect();
        store.setState({
          triggerRect: {
            top: rect.top,
            left: rect.left,
            width: rect.width,
            height: rect.height
          }
        });
      }
    }, [store]);
    (0, import_react4.useEffect)(() => {
      if (!open) return;
      const handleUpdate = () => {
        updateTriggerRect();
      };
      window.addEventListener("scroll", handleUpdate, true);
      window.addEventListener("resize", handleUpdate);
      return () => {
        window.removeEventListener("scroll", handleUpdate, true);
        window.removeEventListener("resize", handleUpdate);
      };
    }, [open, updateTriggerRect]);
    const toggleOpen = () => {
      const newOpen = !open;
      if (newOpen) {
        updateTriggerRect();
      }
      store.setState({ open: newOpen });
    };
    const variantClasses = VARIANT_CLASSES[variant];
    const heightClasses = HEIGHT_CLASSES[size];
    const paddingClasses = PADDING_CLASSES[size];
    return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
      "button",
      {
        ref: setRefs,
        id: selectId,
        type,
        className: cn(
          "flex w-full items-center justify-between border-border-300",
          heightClasses,
          paddingClasses,
          invalid && `${variant == "underlined" ? "border-b-2" : "border-2"} border-indicator-error text-text-600`,
          disabled ? "cursor-not-allowed text-text-400 pointer-events-none opacity-50" : "cursor-pointer hover:bg-background-50 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground",
          !invalid && !disabled ? "text-text-700" : "",
          variantClasses,
          className
        ),
        onClick: toggleOpen,
        "aria-expanded": open,
        "aria-haspopup": "listbox",
        "aria-controls": open ? "select-content" : void 0,
        ...props,
        children: [
          props.children,
          /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
            import_phosphor_react.CaretDown,
            {
              className: cn(
                "h-[1em] w-[1em] opacity-50 transition-transform",
                open ? "rotate-180" : ""
              )
            }
          )
        ]
      }
    );
  }
);
SelectTrigger.displayName = "SelectTrigger";
function applyVerticalPosition(styles, triggerRect, side, align, gap) {
  styles.top = side === "top" ? triggerRect.top - gap : triggerRect.top + triggerRect.height + gap;
  styles.transform = side === "top" ? "translateY(-100%)" : void 0;
  if (align === "start") {
    styles.left = triggerRect.left;
  } else if (align === "center") {
    styles.left = triggerRect.left + triggerRect.width / 2;
    styles.transform = side === "top" ? "translate(-50%, -100%)" : "translateX(-50%)";
  } else {
    styles.left = triggerRect.left + triggerRect.width;
    styles.transform = side === "top" ? "translate(-100%, -100%)" : "translateX(-100%)";
  }
}
function applyHorizontalPosition(styles, triggerRect, side, align, gap) {
  styles.left = side === "left" ? triggerRect.left - gap : triggerRect.left + triggerRect.width + gap;
  styles.transform = side === "left" ? "translateX(-100%)" : void 0;
  if (align === "start") {
    styles.top = triggerRect.top;
  } else if (align === "center") {
    styles.top = triggerRect.top + triggerRect.height / 2;
    styles.transform = side === "left" ? "translate(-100%, -50%)" : "translateY(-50%)";
  } else {
    styles.top = triggerRect.top + triggerRect.height;
    styles.transform = side === "left" ? "translate(-100%, -100%)" : "translateY(-100%)";
  }
}
var SelectContent = (0, import_react4.forwardRef)(
  ({
    children,
    className,
    align = "start",
    side = "bottom",
    store: externalStore,
    selectId,
    ...props
  }, ref) => {
    const store = useSelectStore(externalStore);
    const open = (0, import_zustand.useStore)(store, (s) => s.open);
    const triggerRect = (0, import_zustand.useStore)(store, (s) => s.triggerRect);
    const [mounted, setMounted] = (0, import_react4.useState)(false);
    (0, import_react4.useEffect)(() => {
      setMounted(true);
    }, []);
    if (!open || !mounted) return null;
    const getPositionStyles = () => {
      if (!triggerRect) {
        return {};
      }
      const gap = 4;
      const styles = {
        position: "fixed",
        zIndex: 9999
      };
      const isVertical = side === "top" || side === "bottom";
      if (isVertical) {
        applyVerticalPosition(styles, triggerRect, side, align, gap);
      } else {
        applyHorizontalPosition(styles, triggerRect, side, align, gap);
      }
      return styles;
    };
    const content = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
      "div",
      {
        role: "menu",
        ref,
        "data-select-id": selectId,
        style: getPositionStyles(),
        className: cn(
          "bg-secondary min-w-[210px] max-h-[300px] overflow-y-auto overflow-x-hidden rounded-md border p-1 shadow-md border-border-100",
          className
        ),
        ...props,
        children
      }
    );
    return (0, import_react_dom2.createPortal)(content, document.body);
  }
);
SelectContent.displayName = "SelectContent";
var SelectItem = (0, import_react4.forwardRef)(
  ({
    className,
    children,
    value,
    disabled = false,
    store: externalStore,
    truncate = false,
    ...props
  }, ref) => {
    const store = useSelectStore(externalStore);
    const {
      value: selectedValue,
      setValue,
      setOpen,
      setSelectedLabel,
      onValueChange
    } = (0, import_zustand.useStore)(store, (s) => s);
    const handleClick = (e) => {
      const labelNode = getLabelAsNode(children);
      if (!disabled) {
        setValue(value);
        setSelectedLabel(labelNode);
        setOpen(false);
        onValueChange?.(value);
      }
      props.onClick?.(e);
    };
    return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
      "div",
      {
        role: "menuitem",
        "aria-disabled": disabled,
        ref,
        className: `
          bg-secondary focus-visible:bg-background-50
          relative flex select-none items-center gap-2 rounded-sm p-3 outline-none transition-colors [&>svg]:size-4 [&>svg]:shrink-0
          ${className}
          ${disabled ? "cursor-not-allowed text-text-400 pointer-events-none opacity-50" : "cursor-pointer hover:bg-background-50 text-text-700 focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground"}
          ${selectedValue === value && "bg-background-50"}
        `,
        onClick: handleClick,
        onKeyDown: (e) => {
          if (e.key === "Enter" || e.key === " ") handleClick(e);
        },
        tabIndex: disabled ? -1 : 0,
        ...props,
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: selectedValue === value && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_phosphor_react.Check, { className: "" }) }),
          truncate ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "truncate block max-w-[200px]", children }) : children
        ]
      }
    );
  }
);
SelectItem.displayName = "SelectItem";
var Select_default = Select;

// src/store/accessibilityStore.ts
var import_zustand2 = require("zustand");
var import_middleware = require("zustand/middleware");
var COLOR_BLIND_PREFIX = "a11y-cb-";
var getColorBlindClass = (mode) => mode === "none" /* None */ ? null : `${COLOR_BLIND_PREFIX}${mode}`;
var getColorBlindFilterId = (mode) => `${COLOR_BLIND_PREFIX}${mode}`;
var DEFAULT_ACCESSIBILITY_PREFERENCES = {
  contrastMode: "normal",
  saturationMode: "normal",
  fontSize: 0,
  letterSpacing: 0,
  lineSpacing: 0,
  highlightLinks: false,
  pauseAnimations: false,
  bigCursor: false,
  dyslexiaFont: false,
  readingAid: "none",
  keyboardShortcut: true,
  colorBlindMode: "none" /* None */,
  ttsMode: "off",
  ttsRate: 1,
  ttsVoiceId: null,
  librasEnabled: false
};
var useAccessibilityStore = (0, import_zustand2.create)()(
  (0, import_middleware.devtools)(
    (0, import_middleware.persist)(
      (set) => ({
        ...DEFAULT_ACCESSIBILITY_PREFERENCES,
        isPanelOpen: false,
        ttsStatus: "idle",
        setContrastMode: (contrastMode) => set({ contrastMode }),
        setSaturationMode: (saturationMode) => set({ saturationMode }),
        setFontSize: (fontSize) => set({ fontSize }),
        setLetterSpacing: (letterSpacing) => set({ letterSpacing }),
        setLineSpacing: (lineSpacing) => set({ lineSpacing }),
        setHighlightLinks: (highlightLinks) => set({ highlightLinks }),
        setPauseAnimations: (pauseAnimations) => set({ pauseAnimations }),
        setBigCursor: (bigCursor) => set({ bigCursor }),
        setDyslexiaFont: (dyslexiaFont) => set({ dyslexiaFont }),
        setReadingAid: (readingAid) => set({ readingAid }),
        setKeyboardShortcut: (keyboardShortcut) => set({ keyboardShortcut }),
        setColorBlindMode: (colorBlindMode) => set({ colorBlindMode }),
        setTTSMode: (ttsMode) => set({ ttsMode }),
        setTTSRate: (ttsRate) => set({ ttsRate }),
        setTTSVoiceId: (ttsVoiceId) => set({ ttsVoiceId }),
        setTTSStatus: (ttsStatus) => set({ ttsStatus }),
        setLibrasEnabled: (librasEnabled) => set({ librasEnabled }),
        resetPreferences: () => set({ ...DEFAULT_ACCESSIBILITY_PREFERENCES }),
        openPanel: () => set({ isPanelOpen: true }),
        closePanel: () => set({ isPanelOpen: false }),
        togglePanel: () => set((state) => ({ isPanelOpen: !state.isPanelOpen }))
      }),
      {
        name: "accessibility-store",
        // version 1: removeu `librasEnabled` da persistência (era custoso
        // recarregar VLibras a cada refresh). A migração limpa esse valor
        // de localStorages antigos para evitar auto-load surpresa.
        version: 1,
        // eslint-disable-next-line @typescript-eslint/no-explicit-any -- migrate works with arbitrary persisted shapes from older versions
        migrate: (persistedState) => {
          if (persistedState && typeof persistedState === "object" && "librasEnabled" in persistedState) {
            delete persistedState.librasEnabled;
          }
          return persistedState;
        },
        partialize: (state) => ({
          contrastMode: state.contrastMode,
          saturationMode: state.saturationMode,
          fontSize: state.fontSize,
          letterSpacing: state.letterSpacing,
          lineSpacing: state.lineSpacing,
          highlightLinks: state.highlightLinks,
          pauseAnimations: state.pauseAnimations,
          bigCursor: state.bigCursor,
          dyslexiaFont: state.dyslexiaFont,
          readingAid: state.readingAid,
          keyboardShortcut: state.keyboardShortcut,
          colorBlindMode: state.colorBlindMode,
          ttsRate: state.ttsRate,
          ttsVoiceId: state.ttsVoiceId
          // ttsMode e librasEnabled NÃO são persistidos:
          // - ttsMode: o leitor sempre começa desligado ao recarregar
          //   a página para evitar comportamento confuso
          // - librasEnabled: o VLibras é pesado (~MBs de assets); auto-
          //   carregar a cada refresh seria custoso e surpreendente. O
          //   usuário ativa explicitamente quando precisa.
        })
      }
    ),
    { name: "accessibility-store" }
  )
);

// src/hooks/useTTS.ts
var import_react5 = require("react");

// src/components/AccessibilityWidget/tts/WebSpeechProvider.ts
var WebSpeechProvider = class {
  synth;
  currentUtterance = null;
  constructor(synth = getSynth()) {
    this.synth = synth;
  }
  isSupported() {
    return this.synth !== null;
  }
  async getVoices() {
    if (!this.synth) return [];
    const synth = this.synth;
    const collect = () => synth.getVoices().map((v) => ({
      id: v.voiceURI,
      name: v.name,
      lang: v.lang,
      isLocal: v.localService
    }));
    const initial = collect();
    if (initial.length > 0) return initial;
    return new Promise((resolve) => {
      const onChange = () => {
        synth.removeEventListener("voiceschanged", onChange);
        resolve(collect());
      };
      synth.addEventListener("voiceschanged", onChange);
      setTimeout(() => {
        synth.removeEventListener("voiceschanged", onChange);
        resolve(collect());
      }, 1500);
    });
  }
  speak(text, options = {}, events = {}) {
    if (!this.synth) {
      events.onError?.("S\xEDntese de voz n\xE3o dispon\xEDvel neste navegador.");
      return;
    }
    const trimmed = text.trim();
    if (!trimmed) return;
    this.synth.cancel();
    const utterance = new SpeechSynthesisUtterance(trimmed);
    utterance.rate = options.rate ?? 1;
    utterance.pitch = options.pitch ?? 1;
    const allVoices = this.synth.getVoices();
    let chosenVoice;
    if (options.voiceId) {
      chosenVoice = allVoices.find((v) => v.voiceURI === options.voiceId);
    } else if (options.lang) {
      chosenVoice = allVoices.find(
        (v) => v.lang.toLowerCase().startsWith(options.lang.toLowerCase())
      );
    }
    if (chosenVoice) {
      utterance.voice = chosenVoice;
      utterance.lang = chosenVoice.lang;
    }
    utterance.onstart = () => events.onStart?.();
    utterance.onend = () => {
      this.currentUtterance = null;
      events.onEnd?.();
    };
    utterance.onpause = () => events.onPause?.();
    utterance.onresume = () => events.onResume?.();
    utterance.onerror = (event) => {
      this.currentUtterance = null;
      events.onError?.(event.error || "Erro desconhecido na s\xEDntese.");
    };
    this.currentUtterance = utterance;
    this.synth.speak(utterance);
  }
  pause() {
    this.synth?.pause();
  }
  resume() {
    this.synth?.resume();
  }
  stop() {
    this.synth?.cancel();
    this.currentUtterance = null;
  }
};
var getSynth = () => {
  if (typeof globalThis === "undefined") return null;
  const synth = globalThis.speechSynthesis;
  return synth ?? null;
};

// src/hooks/useTTS.ts
var useTTS = (providerOverride) => {
  const setTTSStatus = useAccessibilityStore((s) => s.setTTSStatus);
  const ttsRate = useAccessibilityStore((s) => s.ttsRate);
  const ttsVoiceId = useAccessibilityStore((s) => s.ttsVoiceId);
  const provider = (0, import_react5.useMemo)(
    () => providerOverride ?? new WebSpeechProvider(),
    [providerOverride]
  );
  const [voices, setVoices] = (0, import_react5.useState)([]);
  const rateRef = (0, import_react5.useRef)(ttsRate);
  const voiceIdRef = (0, import_react5.useRef)(ttsVoiceId);
  rateRef.current = ttsRate;
  voiceIdRef.current = ttsVoiceId;
  const isActiveSpeakerRef = (0, import_react5.useRef)(false);
  (0, import_react5.useEffect)(() => {
    let mounted = true;
    if (provider.isSupported()) {
      provider.getVoices().then((list) => {
        if (mounted) setVoices(list);
      }).catch(() => void 0);
    }
    return () => {
      mounted = false;
      if (isActiveSpeakerRef.current) {
        provider.stop();
        setTTSStatus("idle");
        isActiveSpeakerRef.current = false;
      }
    };
  }, [provider, setTTSStatus]);
  const hasPortugueseVoice = voices.some(
    (v) => v.lang.toLowerCase().startsWith("pt")
  );
  const speak = (0, import_react5.useCallback)(
    (text) => {
      isActiveSpeakerRef.current = true;
      provider.speak(
        text,
        {
          rate: rateRef.current,
          voiceId: voiceIdRef.current ?? void 0
          // Não fixamos `lang: 'pt-BR'` aqui — em sistemas sem voz pt-BR
          // instalada, o browser fica tentando achar uma e nunca emite
          // áudio. O provider usa o `voice.lang` quando há voz escolhida.
        },
        {
          onStart: () => setTTSStatus("speaking"),
          onEnd: () => {
            isActiveSpeakerRef.current = false;
            setTTSStatus("idle");
          },
          onPause: () => setTTSStatus("paused"),
          onResume: () => setTTSStatus("speaking"),
          onError: () => {
            isActiveSpeakerRef.current = false;
            setTTSStatus("idle");
          }
        }
      );
    },
    [provider, setTTSStatus]
  );
  const pause = (0, import_react5.useCallback)(() => {
    provider.pause();
    setTTSStatus("paused");
  }, [provider, setTTSStatus]);
  const resume = (0, import_react5.useCallback)(() => {
    provider.resume();
    setTTSStatus("speaking");
  }, [provider, setTTSStatus]);
  const stop = (0, import_react5.useCallback)(() => {
    isActiveSpeakerRef.current = false;
    provider.stop();
    setTTSStatus("idle");
  }, [provider, setTTSStatus]);
  return {
    isSupported: provider.isSupported(),
    voices,
    hasPortugueseVoice,
    speak,
    pause,
    resume,
    stop
  };
};

// src/components/AccessibilityWidget/TTSSection.tsx
var import_jsx_runtime9 = require("react/jsx-runtime");
var RATE_OPTIONS = [
  { value: "0.75", label: "Lento", preview: "0.75" },
  { value: "1", label: "Normal", preview: "1.0" },
  { value: "1.25", label: "R\xE1pido", preview: "1.25" },
  { value: "2", label: "Muito r\xE1pido", preview: "2.0" }
];
function TTSSection({
  PreviewSegmented: PreviewSegmented2
}) {
  const ttsMode = useAccessibilityStore((s) => s.ttsMode);
  const ttsStatus = useAccessibilityStore((s) => s.ttsStatus);
  const ttsRate = useAccessibilityStore((s) => s.ttsRate);
  const ttsVoiceId = useAccessibilityStore((s) => s.ttsVoiceId);
  const setTTSMode = useAccessibilityStore((s) => s.setTTSMode);
  const setTTSRate = useAccessibilityStore((s) => s.setTTSRate);
  const setTTSVoiceId = useAccessibilityStore((s) => s.setTTSVoiceId);
  const { isSupported, voices, hasPortugueseVoice, pause, resume, stop } = useTTS();
  const sortedVoices = (0, import_react6.useMemo)(() => {
    return [...voices].sort((a, b) => {
      const aPt = a.lang.toLowerCase().startsWith("pt") ? 0 : 1;
      const bPt = b.lang.toLowerCase().startsWith("pt") ? 0 : 1;
      if (aPt !== bPt) return aPt - bPt;
      return a.name.localeCompare(b.name);
    });
  }, [voices]);
  if (!isSupported) {
    return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { size: "2xs", className: "text-text-600", children: "S\xEDntese de voz n\xE3o est\xE1 dispon\xEDvel neste navegador." });
  }
  const isClickToReadOn = ttsMode === "click-to-read";
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-6", children: [
    /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2", children: [
      /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
        Text_default,
        {
          size: "xs",
          weight: "medium",
          className: "uppercase leading-none text-text-600",
          children: "Texto para voz"
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
        AccessibilityToggleRow,
        {
          label: "Ative a leitura e clique no texto para ouvir",
          rowTestId: "a11y-tts-mode-toggle",
          checked: isClickToReadOn,
          onChange: () => setTTSMode(isClickToReadOn ? "off" : "click-to-read")
        }
      )
    ] }),
    !hasPortugueseVoice && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Text_default, { size: "2xs", className: "text-warning-700", children: "Nenhuma voz em portugu\xEAs foi encontrada no seu sistema. A leitura ser\xE1 feita com a voz padr\xE3o dispon\xEDvel." }),
    /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2", children: [
      /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
        Text_default,
        {
          size: "xs",
          weight: "medium",
          className: "uppercase leading-none text-text-600",
          children: "Voz"
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
        Select_default,
        {
          size: "small",
          value: ttsVoiceId ?? "",
          onValueChange: (value) => setTTSVoiceId(value || null),
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
              SelectTrigger,
              {
                variant: "rounded",
                "aria-label": "Voz da s\xEDntese de fala",
                "data-testid": "a11y-tts-voice-select",
                children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectValue, { placeholder: "Padr\xE3o do navegador" })
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(SelectContent, { children: [
              /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(SelectItem, { value: "", children: "Padr\xE3o do navegador" }),
              sortedVoices.map((v) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(SelectItem, { value: v.id, children: [
                v.name,
                " \u2014 ",
                v.lang
              ] }, v.id))
            ] })
          ]
        }
      )
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col gap-2", children: [
      /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
        Text_default,
        {
          size: "xs",
          weight: "medium",
          className: "uppercase leading-none text-text-600",
          children: "Velocidade"
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
        PreviewSegmented2,
        {
          ariaLabel: "Velocidade da fala",
          value: String(ttsRate),
          options: RATE_OPTIONS.map((opt) => ({
            value: opt.value,
            label: opt.label,
            preview: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-base font-bold leading-none", children: opt.preview })
          })),
          onChange: (v) => setTTSRate(Number(v))
        }
      )
    ] }),
    ttsStatus !== "idle" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2", children: [
      ttsStatus === "speaking" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
        Button_default,
        {
          variant: "outline",
          action: "secondary",
          size: "small",
          iconLeft: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react7.PauseIcon, { size: 14, weight: "bold", "aria-hidden": "true" }),
          onClick: pause,
          "data-testid": "a11y-tts-pause",
          children: "Pausar"
        }
      ),
      ttsStatus === "paused" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
        Button_default,
        {
          variant: "outline",
          action: "secondary",
          size: "small",
          iconLeft: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react7.PlayIcon, { size: 14, weight: "bold", "aria-hidden": "true" }),
          onClick: resume,
          "data-testid": "a11y-tts-resume",
          children: "Retomar"
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
        Button_default,
        {
          variant: "outline",
          action: "negative",
          size: "small",
          iconLeft: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react7.StopIcon, { size: 14, weight: "bold", "aria-hidden": "true" }),
          onClick: stop,
          "data-testid": "a11y-tts-stop",
          className: "ml-auto",
          children: "Parar"
        }
      )
    ] })
  ] });
}

// src/components/AccessibilityWidget/AccessibilityPanel.tsx
var import_jsx_runtime10 = require("react/jsx-runtime");
var CONTRAST_OPTIONS = [
  { value: "normal", label: "Normal" },
  { value: "high", label: "Alto" },
  { value: "inverted", label: "Invertido" }
];
var SATURATION_OPTIONS = [
  { value: "normal", label: "Normal" },
  { value: "low", label: "Baixa" },
  { value: "grayscale", label: "Tons de cinza" }
];
var READING_AID_OPTIONS = [
  { value: "none", label: "Nenhum" },
  { value: "ruler", label: "R\xE9gua" },
  { value: "mask", label: "M\xE1scara" }
];
var LEVEL_LABELS = ["Padr\xE3o", "Pequeno", "M\xE9dio", "Grande"];
var FONT_SIZE_PREVIEW_CLASSES = [
  "text-base",
  // Padrão
  "text-lg",
  // Pequeno (= maior que Padrão, segue a escala incremental do widget)
  "text-2xl",
  // Médio
  "text-4xl"
  // Grande
];
var LETTER_SPACING_PREVIEW_CLASSES = [
  "tracking-tighter",
  // Padrão (junto)
  "tracking-normal",
  "tracking-wider",
  "tracking-widest"
];
var LINE_SPACING_PREVIEW_GAPS = [
  "gap-0.5",
  // Padrão (2px) — linhas próximas
  "gap-1.5",
  // Pequeno (6px)
  "gap-2.5",
  // Médio (10px)
  "gap-3.5"
  // Grande (14px)
];
var PANEL_EDGE_CLASSES = {
  right: "right-10 left-auto",
  left: "left-10 right-auto"
};
var AccordionSection = ({
  title,
  icon,
  defaultExpanded = false,
  testId,
  children
}) => {
  const [expanded, setExpanded] = (0, import_react8.useState)(defaultExpanded);
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "border-b border-background-200 last:border-b-0", children: [
    /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
      Button_default,
      {
        variant: "raw",
        "aria-expanded": expanded,
        onClick: () => setExpanded((v) => !v),
        "data-testid": testId,
        className: cn(
          "flex w-full cursor-pointer items-center justify-between gap-2 px-4 py-3",
          "text-left transition-colors hover:bg-background-50",
          "focus:outline-none focus-visible:ring-2 focus-visible:ring-info-500 focus-visible:ring-inset"
        ),
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "text-text-800", "aria-hidden": "true", children: icon }),
            /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
              Text_default,
              {
                size: "md",
                weight: "semibold",
                className: "leading-none text-text-800",
                children: title
              }
            )
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
            import_react9.CaretDownIcon,
            {
              size: 16,
              weight: "bold",
              "aria-hidden": "true",
              className: cn(
                "text-text-700 transition-transform duration-200",
                expanded ? "rotate-180" : "rotate-0"
              )
            }
          )
        ]
      }
    ),
    expanded && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex flex-col gap-6 px-4 pb-4 pt-2", children })
  ] });
};
var SubControl = ({ label, children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-2", children: [
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
    Text_default,
    {
      size: "xs",
      weight: "medium",
      className: "uppercase leading-none text-text-600",
      children: label
    }
  ),
  children
] });
var Segmented = ({
  value,
  options,
  onChange,
  ariaLabel
}) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
  "div",
  {
    role: "radiogroup",
    "aria-label": ariaLabel,
    className: "flex flex-wrap gap-2",
    children: options.map((opt) => {
      const isActive = opt.value === value;
      return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
        Button_default,
        {
          variant: "raw",
          role: "radio",
          "aria-checked": isActive,
          onClick: () => onChange(opt.value),
          className: cn(
            "flex-1 cursor-pointer rounded-xl border border-border-50 bg-background",
            // Texto segue spec do Figma: Roboto 14px/700/100%/0.2px, cor
            // #525252 (text-700). Quando ativo, troca pra primary-950
            // (azul escuro), mas mantém a mesma typography.
            "px-4 py-4 text-sm font-bold leading-none tracking-[0.2px] text-text-700",
            "shadow-soft-shadow-1 transition-all duration-150",
            "hover:bg-background-100",
            "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indicator-info",
            isActive && "ring-2 ring-primary-950 ring-offset-0 shadow-none text-primary-950"
          ),
          children: opt.label
        },
        String(opt.value)
      );
    })
  }
);
var PreviewSegmented = ({
  value,
  options,
  onChange,
  ariaLabel
}) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { role: "radiogroup", "aria-label": ariaLabel, className: "flex gap-2", children: options.map((opt) => {
  const isActive = opt.value === value;
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
    "div",
    {
      className: "flex flex-1 flex-col items-center gap-2",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          Button_default,
          {
            variant: "raw",
            role: "radio",
            "aria-checked": isActive,
            "aria-label": opt.label,
            onClick: () => onChange(opt.value),
            className: cn(
              "flex aspect-square w-full items-center justify-center",
              "cursor-pointer rounded-xl border border-border-50 bg-background",
              "text-text-700 shadow-soft-shadow-1 transition-all duration-150",
              "hover:bg-background-100",
              "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indicator-info",
              isActive && "ring-2 ring-primary-950 ring-offset-0 shadow-none text-primary-950"
            ),
            children: opt.preview
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          Text_default,
          {
            size: "xs",
            weight: "normal",
            className: "leading-none text-text-700",
            children: opt.label
          }
        )
      ]
    },
    String(opt.value)
  );
}) });
function AccessibilityPanel({
  isOpen,
  onClose,
  position = "right",
  className
}) {
  const closeButtonRef = (0, import_react8.useRef)(null);
  const previouslyFocusedRef = (0, import_react8.useRef)(null);
  const {
    contrastMode,
    saturationMode,
    fontSize,
    letterSpacing,
    lineSpacing,
    highlightLinks,
    pauseAnimations,
    bigCursor,
    dyslexiaFont,
    readingAid,
    keyboardShortcut,
    setContrastMode,
    setSaturationMode,
    setFontSize,
    setLetterSpacing,
    setLineSpacing,
    setHighlightLinks,
    setPauseAnimations,
    setBigCursor,
    setDyslexiaFont,
    setReadingAid,
    setKeyboardShortcut,
    resetPreferences
  } = useAccessibilityStore();
  (0, import_react8.useEffect)(() => {
    if (!isOpen) return;
    previouslyFocusedRef.current = document.activeElement;
    closeButtonRef.current?.focus();
    const handleKeyDown = (event) => {
      if (event.key === "Escape") {
        event.stopPropagation();
        onClose();
      }
    };
    globalThis.addEventListener("keydown", handleKeyDown);
    return () => {
      globalThis.removeEventListener("keydown", handleKeyDown);
      const previous = previouslyFocusedRef.current;
      if (previous && typeof previous.focus === "function") {
        previous.focus();
      }
    };
  }, [isOpen, onClose]);
  if (!isOpen) return null;
  const levelOptions = LEVEL_LABELS.map((label, index) => ({
    value: index,
    label
  }));
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
    "dialog",
    {
      open: true,
      "aria-label": "Op\xE7\xF5es de acessibilidade",
      "data-testid": "accessibility-panel",
      style: { height: "calc(100vh - 5rem)" },
      className: cn(
        "a11y-widget-shield",
        "fixed bottom-0 z-40 m-0",
        PANEL_EDGE_CLASSES[position],
        "flex w-[calc(100vw-3rem)] max-w-110 flex-col overflow-hidden rounded-2xl p-0",
        "border border-background-200 bg-background shadow-2xl",
        className
      ),
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "flex items-center justify-between gap-3 bg-primary-50 px-4 py-3", children: [
          /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex min-w-0 items-center gap-3", children: [
            /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
              "img",
              {
                src: accessibility_default,
                alt: "",
                "aria-hidden": "true",
                className: "h-10 w-10 shrink-0"
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex min-w-0 flex-col gap-1", children: [
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                Text_default,
                {
                  size: "md",
                  weight: "bold",
                  className: "leading-none tracking-[0.2px] text-text-950",
                  children: "Acessibilidade"
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                Text_default,
                {
                  size: "xs",
                  weight: "normal",
                  className: "leading-none text-text-800",
                  children: "Personalize a leitura e navega\xE7\xE3o"
                }
              )
            ] })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
            IconButton_default,
            {
              ref: closeButtonRef,
              size: "sm",
              "aria-label": "Fechar op\xE7\xF5es de acessibilidade",
              onClick: onClose,
              icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react9.XIcon, { size: 18 })
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex-1 overflow-y-auto", children: [
          /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
            AccordionSection,
            {
              title: "Vis\xE3o",
              icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react9.EyeIcon, { size: 18 }),
              testId: "a11y-section-vision",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SubControl, { label: "Contraste", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  Segmented,
                  {
                    ariaLabel: "Modo de contraste",
                    value: contrastMode,
                    options: CONTRAST_OPTIONS,
                    onChange: setContrastMode
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SubControl, { label: "Satura\xE7\xE3o", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  Segmented,
                  {
                    ariaLabel: "Modo de satura\xE7\xE3o",
                    value: saturationMode,
                    options: SATURATION_OPTIONS,
                    onChange: setSaturationMode
                  }
                ) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
            AccordionSection,
            {
              title: "Leitura",
              icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react9.TextTIcon, { size: 18 }),
              testId: "a11y-section-reading",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SubControl, { label: "Fonte para dislexia", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  AccessibilityToggleRow,
                  {
                    ariaLabel: "Trocar para Comic Sans MS",
                    rowTestId: "a11y-toggle-dyslexia-font-row",
                    switchTestId: "a11y-toggle-dyslexia-font",
                    checked: dyslexiaFont,
                    onChange: () => setDyslexiaFont(!dyslexiaFont),
                    label: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
                      "Trocar para",
                      " ",
                      /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { style: { fontFamily: '"Comic Sans MS", cursive' }, children: "Comic Sans MS" })
                    ] })
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SubControl, { label: "Tamanho da fonte", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  PreviewSegmented,
                  {
                    ariaLabel: "Tamanho da fonte",
                    value: fontSize,
                    options: levelOptions.map((opt) => ({
                      ...opt,
                      preview: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        "span",
                        {
                          className: cn(
                            "font-semibold leading-none",
                            FONT_SIZE_PREVIEW_CLASSES[opt.value]
                          ),
                          children: "Aa"
                        }
                      )
                    })),
                    onChange: setFontSize
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SubControl, { label: "Espa\xE7amento entre letras", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  PreviewSegmented,
                  {
                    ariaLabel: "Espa\xE7amento entre letras",
                    value: letterSpacing,
                    options: levelOptions.map((opt) => ({
                      ...opt,
                      preview: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                        "span",
                        {
                          className: cn(
                            // Mesmo tamanho do "Aa" no botão Padrão de "Tamanho
                            // da fonte" (text-base), pra que essa scale visualize
                            // só a variação de letter-spacing.
                            "text-base font-semibold leading-none",
                            LETTER_SPACING_PREVIEW_CLASSES[opt.value]
                          ),
                          children: "Aa"
                        }
                      )
                    })),
                    onChange: setLetterSpacing
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SubControl, { label: "Espa\xE7amento entre linhas", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  PreviewSegmented,
                  {
                    ariaLabel: "Espa\xE7amento entre linhas",
                    value: lineSpacing,
                    options: levelOptions.map((opt) => ({
                      ...opt,
                      preview: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
                        "span",
                        {
                          className: cn(
                            "flex flex-col items-stretch",
                            LINE_SPACING_PREVIEW_GAPS[opt.value]
                          ),
                          children: [
                            /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "h-0.5 w-7 rounded-full bg-current" }),
                            /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "h-0.5 w-7 rounded-full bg-current" }),
                            /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "h-0.5 w-7 rounded-full bg-current" })
                          ]
                        }
                      )
                    })),
                    onChange: setLineSpacing
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SubControl, { label: "Auxiliar de leitura", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  Segmented,
                  {
                    ariaLabel: "Auxiliar de leitura",
                    value: readingAid,
                    options: READING_AID_OPTIONS,
                    onChange: setReadingAid
                  }
                ) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
            AccordionSection,
            {
              title: "Leitor de texto",
              icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react9.SpeakerHighIcon, { size: 18 }),
              testId: "a11y-section-tts",
              children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TTSSection, { PreviewSegmented })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
            AccordionSection,
            {
              title: "Anima\xE7\xE3o",
              icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react9.FilmReelIcon, { size: 18 }),
              testId: "a11y-section-animation",
              children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                AccessibilityToggleRow,
                {
                  label: "Pausar anima\xE7\xF5es para conforto visual",
                  checked: pauseAnimations,
                  onChange: () => setPauseAnimations(!pauseAnimations),
                  switchTestId: "a11y-toggle-pause-animations"
                }
              )
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
            AccordionSection,
            {
              title: "Navega\xE7\xE3o",
              icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react9.NavigationArrowIcon, { size: 18 }),
              testId: "a11y-section-navigation",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SubControl, { label: "Destacar links e bot\xF5es", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  AccessibilityToggleRow,
                  {
                    label: "Adicionar contorno em elementos clic\xE1veis",
                    checked: highlightLinks,
                    onChange: () => setHighlightLinks(!highlightLinks),
                    switchTestId: "a11y-toggle-highlight-links"
                  }
                ) }),
                /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(SubControl, { label: "Cursor maior", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                  AccessibilityToggleRow,
                  {
                    label: "Aumentar e escurecer cursor",
                    checked: bigCursor,
                    onChange: () => setBigCursor(!bigCursor),
                    switchTestId: "a11y-toggle-big-cursor"
                  }
                ) })
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
            AccordionSection,
            {
              title: "Atalho de teclado",
              icon: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react9.KeyboardIcon, { size: 18 }),
              testId: "a11y-section-shortcut",
              children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
                AccessibilityToggleRow,
                {
                  label: "Alt+A para abrir o painel",
                  checked: keyboardShortcut,
                  onChange: () => setKeyboardShortcut(!keyboardShortcut),
                  switchTestId: "a11y-toggle-keyboard-shortcut"
                }
              )
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("footer", { className: "border-t border-background-200 px-4 py-3", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
          Button_default,
          {
            variant: "outline",
            action: "primary",
            size: "medium",
            iconLeft: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
              import_react9.ArrowCounterClockwiseIcon,
              {
                size: 16,
                weight: "bold",
                "aria-hidden": "true"
              }
            ),
            onClick: resetPreferences,
            "data-testid": "a11y-reset",
            className: "w-full justify-center",
            children: "Redefinir ajustes"
          }
        ) })
      ]
    }
  );
}

// src/components/AccessibilityWidget/LibrasFab.tsx
var import_react10 = require("@phosphor-icons/react");
var import_jsx_runtime11 = require("react/jsx-runtime");
function LibrasFab({
  onClick,
  position = "right",
  verticalAlign = "below-center",
  className
}) {
  const label = "Tradu\xE7\xE3o em Libras";
  return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
    Tooltip,
    {
      content: label,
      position: FAB_TOOLTIP_POSITION[position],
      className: cn(
        "fixed z-40",
        FAB_VERTICAL_ALIGN_CLASSES[verticalAlign],
        FAB_POSITION_CLASSES[position]
      ),
      children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
        Button_default,
        {
          variant: "raw",
          onClick,
          "aria-label": label,
          "data-testid": "libras-fab",
          className: cn(
            "a11y-widget-shield",
            FAB_POSITION_CLASSES[position],
            "flex h-10 w-10 cursor-pointer items-center justify-center",
            // `text-text-50` flipa junto com `bg-info-900`: claro no light,
            // escuro no dark. Como o ícone usa `currentColor`, com `text-white`
            // a mãozinha sumiria no tema escuro (branco em fundo azul-claro).
            "bg-info-900 text-text-50 shadow-lg",
            "transition-all duration-200 hover:scale-110 hover:bg-info-800",
            "focus:outline-none focus:ring-4 focus:ring-info-300",
            className
          ),
          children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react10.HandWavingIcon, { size: 25, weight: "fill", "aria-hidden": "true" })
        }
      )
    }
  );
}

// src/components/AccessibilityWidget/ReadingAid.tsx
var import_react11 = require("react");
var import_jsx_runtime12 = require("react/jsx-runtime");
var RULER_HEIGHT_PX = 32;
var MASK_GAP_PX = 80;
function ReadingAid() {
  const readingAid = useAccessibilityStore((s) => s.readingAid);
  const [mouseY, setMouseY] = (0, import_react11.useState)(null);
  (0, import_react11.useEffect)(() => {
    if (readingAid === "none") {
      setMouseY(null);
      return;
    }
    let frame = 0;
    const handleMouseMove = (event) => {
      cancelAnimationFrame(frame);
      frame = requestAnimationFrame(() => setMouseY(event.clientY));
    };
    document.addEventListener("mousemove", handleMouseMove, { passive: true });
    return () => {
      cancelAnimationFrame(frame);
      document.removeEventListener("mousemove", handleMouseMove);
    };
  }, [readingAid]);
  if (readingAid === "none" || mouseY === null) return null;
  if (readingAid === "ruler") {
    return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
      "div",
      {
        "aria-hidden": "true",
        "data-testid": "a11y-reading-ruler",
        className: "a11y-widget-shield pointer-events-none fixed left-0 right-0 z-30",
        style: {
          top: mouseY - RULER_HEIGHT_PX / 2,
          height: RULER_HEIGHT_PX,
          background: "rgba(255, 235, 59, 0.25)",
          borderTop: "2px solid #facc15",
          borderBottom: "2px solid #facc15"
        }
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
      "div",
      {
        "aria-hidden": "true",
        "data-testid": "a11y-reading-mask-top",
        className: "a11y-widget-shield pointer-events-none fixed left-0 right-0 top-0 z-30 bg-black/90",
        style: { height: Math.max(0, mouseY - MASK_GAP_PX) }
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
      "div",
      {
        "aria-hidden": "true",
        "data-testid": "a11y-reading-mask-bottom",
        className: "a11y-widget-shield pointer-events-none fixed left-0 right-0 bottom-0 z-30 bg-black/90",
        style: { top: mouseY + MASK_GAP_PX }
      }
    )
  ] });
}

// src/components/AccessibilityWidget/ColorBlindFilters.tsx
var import_jsx_runtime13 = require("react/jsx-runtime");
function ColorBlindFilters() {
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
    "svg",
    {
      "aria-hidden": "true",
      "data-testid": "a11y-colorblind-filters",
      style: {
        position: "absolute",
        width: 0,
        height: 0,
        overflow: "hidden"
      },
      children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("defs", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("filter", { id: getColorBlindFilterId("protanopia" /* Protanopia */), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
          "feColorMatrix",
          {
            type: "matrix",
            values: "0.567 0.433 0     0 0\n                    0.558 0.442 0     0 0\n                    0     0.242 0.758 0 0\n                    0     0     0     1 0"
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("filter", { id: getColorBlindFilterId("deuteranopia" /* Deuteranopia */), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
          "feColorMatrix",
          {
            type: "matrix",
            values: "0.625 0.375 0   0 0\n                    0.700 0.300 0   0 0\n                    0     0.300 0.7 0 0\n                    0     0     0   1 0"
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("filter", { id: getColorBlindFilterId("tritanopia" /* Tritanopia */), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
          "feColorMatrix",
          {
            type: "matrix",
            values: "0.95 0.05  0     0 0\n                    0    0.433 0.567 0 0\n                    0    0.475 0.525 0 0\n                    0    0     0     1 0"
          }
        ) })
      ] })
    }
  );
}

// src/components/AccessibilityWidget/TTSController.tsx
var import_react12 = require("react");
var HIGHLIGHT_CLASS = "a11y-tts-target";
function TTSController() {
  const ttsMode = useAccessibilityStore((s) => s.ttsMode);
  const ttsStatus = useAccessibilityStore((s) => s.ttsStatus);
  const { speak, stop, isSupported } = useTTS();
  (0, import_react12.useEffect)(() => {
    if (!isSupported || ttsMode !== "click-to-read") return;
    const handler = (event) => {
      const initialTarget = event.target;
      if (!initialTarget) return;
      if (initialTarget.closest(".a11y-widget-shield")) return;
      const found = findReadableAncestor(initialTarget);
      if (!found) return;
      event.preventDefault();
      event.stopPropagation();
      document.querySelectorAll(`.${HIGHLIGHT_CLASS}`).forEach((el) => el.classList.remove(HIGHLIGHT_CLASS));
      found.node.classList.add(HIGHLIGHT_CLASS);
      speak(found.text);
    };
    document.addEventListener("click", handler, true);
    return () => {
      document.removeEventListener("click", handler, true);
      document.querySelectorAll(`.${HIGHLIGHT_CLASS}`).forEach((el) => el.classList.remove(HIGHLIGHT_CLASS));
      stop();
    };
  }, [isSupported, ttsMode, speak, stop]);
  (0, import_react12.useEffect)(() => {
    if (ttsStatus === "idle") {
      document.querySelectorAll(`.${HIGHLIGHT_CLASS}`).forEach((el) => el.classList.remove(HIGHLIGHT_CLASS));
    }
  }, [ttsStatus]);
  (0, import_react12.useEffect)(() => () => stop(), [stop]);
  return null;
}
var extractReadableText = (el) => {
  const aria = el.getAttribute("aria-label")?.trim();
  if (aria) return aria;
  const title = el.getAttribute("title")?.trim();
  if (title) return title;
  const text = el.innerText?.trim() ?? "";
  return text.length > 600 ? `${text.slice(0, 600)}...` : text;
};
var MAX_ANCESTOR_LOOKUP = 8;
var findReadableAncestor = (start) => {
  let node = start;
  let depth = 0;
  while (node && depth < MAX_ANCESTOR_LOOKUP && node !== document.body) {
    const text = extractReadableText(node);
    if (text) return { node, text };
    node = node.parentElement;
    depth++;
  }
  return null;
};

// src/components/AccessibilityWidget/VLibrasLoader.tsx
var import_react13 = require("react");
var SCRIPT_ID = "a11y-vlibras-script";
var SCRIPT_URL = "https://vlibras.gov.br/app/vlibras-plugin.js";
var APP_URL = "https://vlibras.gov.br/app";
var WRAPPER_ID = "a11y-vlibras-wrapper";
function VLibrasLoader() {
  const enabled = useAccessibilityStore((s) => s.librasEnabled);
  (0, import_react13.useEffect)(() => {
    if (typeof document === "undefined") return;
    if (!enabled) {
      removeWrapper();
      return;
    }
    injectWrapper();
    loadScript().then(() => {
      const VLibras = globalThis.VLibras;
      if (!VLibras?.Widget) return;
      const previousOnload = globalThis.onload;
      new VLibras.Widget(APP_URL);
      const installed = globalThis.onload;
      if (typeof installed === "function" && installed !== previousOnload) {
        installed.call(
          globalThis,
          new Event("load")
        );
      }
      requestAnimationFrame(() => {
        const accessButton = document.querySelector("[vw-access-button]");
        accessButton?.click();
      });
    }).catch(() => {
      useAccessibilityStore.getState().setLibrasEnabled(false);
    });
    return () => {
    };
  }, [enabled]);
  return null;
}
var injectWrapper = () => {
  if (document.getElementById(WRAPPER_ID)) return;
  const wrapper = document.createElement("div");
  wrapper.id = WRAPPER_ID;
  wrapper.setAttribute("vw", "");
  wrapper.className = "enabled";
  const accessButton = document.createElement("div");
  accessButton.setAttribute("vw-access-button", "");
  accessButton.className = "active";
  wrapper.appendChild(accessButton);
  const pluginWrapper = document.createElement("div");
  pluginWrapper.setAttribute("vw-plugin-wrapper", "");
  const top = document.createElement("div");
  top.className = "vw-plugin-top-wrapper";
  pluginWrapper.appendChild(top);
  wrapper.appendChild(pluginWrapper);
  document.body.appendChild(wrapper);
};
var removeWrapper = () => {
  document.getElementById(WRAPPER_ID)?.remove();
};
var loadScript = () => {
  return new Promise((resolve, reject) => {
    if (document.getElementById(SCRIPT_ID)) {
      resolve();
      return;
    }
    const script = document.createElement("script");
    script.id = SCRIPT_ID;
    script.src = SCRIPT_URL;
    script.async = true;
    script.onload = () => resolve();
    script.onerror = () => reject(new Error("Falha ao carregar o script do VLibras"));
    document.head.appendChild(script);
  });
};

// src/hooks/useA11yPreferences.ts
var import_react14 = require("react");
var CONTRAST_CLASS = {
  normal: null,
  high: "a11y-contrast-high",
  inverted: "a11y-contrast-inverted"
};
var SATURATION_CLASS = {
  normal: null,
  grayscale: "a11y-saturation-grayscale",
  low: "a11y-saturation-low"
};
var LEVEL_PREFIX = {
  fontSize: "a11y-font-",
  letterSpacing: "a11y-letter-spacing-",
  lineSpacing: "a11y-line-spacing-"
};
var ALL_A11Y_CLASSES = [
  "a11y-contrast-high",
  "a11y-contrast-inverted",
  "a11y-saturation-grayscale",
  "a11y-saturation-low",
  "a11y-font-1",
  "a11y-font-2",
  "a11y-font-3",
  "a11y-letter-spacing-1",
  "a11y-letter-spacing-2",
  "a11y-letter-spacing-3",
  "a11y-line-spacing-1",
  "a11y-line-spacing-2",
  "a11y-line-spacing-3",
  "a11y-highlight-links",
  "a11y-no-animations",
  "a11y-big-cursor",
  "a11y-dyslexia-font",
  "a11y-cb-protanopia",
  "a11y-cb-deuteranopia",
  "a11y-cb-tritanopia"
];
var buildLevelClass = (prefix, level) => {
  if (level === 0) return null;
  return `${prefix}${level}`;
};
var buildClassMap = (prefs) => ({
  contrastMode: CONTRAST_CLASS[prefs.contrastMode] ?? void 0,
  saturationMode: SATURATION_CLASS[prefs.saturationMode] ?? void 0,
  fontSize: buildLevelClass(LEVEL_PREFIX.fontSize, prefs.fontSize) ?? void 0,
  letterSpacing: buildLevelClass(LEVEL_PREFIX.letterSpacing, prefs.letterSpacing) ?? void 0,
  lineSpacing: buildLevelClass(LEVEL_PREFIX.lineSpacing, prefs.lineSpacing) ?? void 0,
  highlightLinks: prefs.highlightLinks ? "a11y-highlight-links" : void 0,
  pauseAnimations: prefs.pauseAnimations ? "a11y-no-animations" : void 0,
  bigCursor: prefs.bigCursor ? "a11y-big-cursor" : void 0,
  dyslexiaFont: prefs.dyslexiaFont ? "a11y-dyslexia-font" : void 0,
  colorBlindMode: getColorBlindClass(prefs.colorBlindMode) ?? void 0
});
var syncDom = (prefs) => {
  if (typeof document === "undefined") return;
  const root = document.documentElement;
  ALL_A11Y_CLASSES.forEach((cls) => root.classList.remove(cls));
  const classMap = buildClassMap(prefs);
  Object.values(classMap).forEach((cls) => {
    if (cls) root.classList.add(cls);
  });
};
var useA11yPreferences = () => {
  const contrastMode = useAccessibilityStore((s) => s.contrastMode);
  const saturationMode = useAccessibilityStore((s) => s.saturationMode);
  const fontSize = useAccessibilityStore((s) => s.fontSize);
  const letterSpacing = useAccessibilityStore((s) => s.letterSpacing);
  const lineSpacing = useAccessibilityStore((s) => s.lineSpacing);
  const highlightLinks = useAccessibilityStore((s) => s.highlightLinks);
  const pauseAnimations = useAccessibilityStore((s) => s.pauseAnimations);
  const bigCursor = useAccessibilityStore((s) => s.bigCursor);
  const dyslexiaFont = useAccessibilityStore((s) => s.dyslexiaFont);
  const readingAid = useAccessibilityStore((s) => s.readingAid);
  const keyboardShortcut = useAccessibilityStore((s) => s.keyboardShortcut);
  const colorBlindMode = useAccessibilityStore((s) => s.colorBlindMode);
  const ttsMode = useAccessibilityStore((s) => s.ttsMode);
  const ttsRate = useAccessibilityStore((s) => s.ttsRate);
  const ttsVoiceId = useAccessibilityStore((s) => s.ttsVoiceId);
  const librasEnabled = useAccessibilityStore((s) => s.librasEnabled);
  (0, import_react14.useEffect)(() => {
    syncDom({
      contrastMode,
      saturationMode,
      fontSize,
      letterSpacing,
      lineSpacing,
      highlightLinks,
      pauseAnimations,
      bigCursor,
      dyslexiaFont,
      readingAid,
      keyboardShortcut,
      colorBlindMode,
      ttsMode,
      ttsRate,
      ttsVoiceId,
      librasEnabled
    });
  }, [
    contrastMode,
    saturationMode,
    fontSize,
    letterSpacing,
    lineSpacing,
    highlightLinks,
    pauseAnimations,
    bigCursor,
    dyslexiaFont,
    colorBlindMode
  ]);
};

// src/hooks/useA11yKeyboardShortcut.ts
var import_react15 = require("react");
var useA11yKeyboardShortcut = () => {
  const enabled = useAccessibilityStore((s) => s.keyboardShortcut);
  const togglePanel = useAccessibilityStore((s) => s.togglePanel);
  (0, import_react15.useEffect)(() => {
    if (!enabled) return;
    const handler = (event) => {
      if (!event.altKey || event.key.toLowerCase() !== "a") return;
      if (event.repeat) return;
      const target = event.target;
      if (target) {
        const tag = target.tagName;
        if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || target.isContentEditable) {
          return;
        }
      }
      event.preventDefault();
      togglePanel();
    };
    globalThis.addEventListener("keydown", handler);
    return () => globalThis.removeEventListener("keydown", handler);
  }, [enabled, togglePanel]);
};

// src/components/AccessibilityWidget/AccessibilityWidget.tsx
var import_jsx_runtime14 = require("react/jsx-runtime");
function AccessibilityWidget({
  position = "right",
  fabClassName,
  panelClassName,
  showLibras = true
}) {
  useA11yPreferences();
  useA11yKeyboardShortcut();
  const isPanelOpen = useAccessibilityStore((s) => s.isPanelOpen);
  const togglePanel = useAccessibilityStore((s) => s.togglePanel);
  const closePanel = useAccessibilityStore((s) => s.closePanel);
  const librasEnabled = useAccessibilityStore((s) => s.librasEnabled);
  const setLibrasEnabled = useAccessibilityStore((s) => s.setLibrasEnabled);
  const accessibilityVerticalAlign = showLibras ? "above-center" : "center";
  const handleLibrasClick = () => {
    if (!librasEnabled) {
      setLibrasEnabled(true);
      return;
    }
    document.querySelector("[vw-access-button]")?.click();
  };
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
    !isPanelOpen && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
      AccessibilityFab,
      {
        onClick: togglePanel,
        isOpen: isPanelOpen,
        position,
        verticalAlign: accessibilityVerticalAlign,
        className: fabClassName
      }
    ),
    !isPanelOpen && showLibras && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LibrasFab, { onClick: handleLibrasClick, position }),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
      AccessibilityPanel,
      {
        isOpen: isPanelOpen,
        onClose: closePanel,
        position,
        className: panelClassName
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ReadingAid, {}),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ColorBlindFilters, {}),
    /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TTSController, {}),
    showLibras && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(VLibrasLoader, {})
  ] });
}
//# sourceMappingURL=index.js.map