accessibility-plugin-react 2.13.0 → 2.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -24,7 +24,7 @@ function styleInject(css, { insertAt } = {}) {
24
24
  }
25
25
 
26
26
  // src/styles/tailwind.css
27
- styleInject('.arap-root {\n --arap-surface: #fff;\n --arap-text: #111827;\n --arap-muted: #475569;\n --arap-border: #cbd5e1;\n --arap-divider: #e2e8f0;\n --arap-accent: #1d4ed8;\n --arap-accent-hover: #1e40af;\n --arap-selected: #eff6ff;\n --arap-control: #f8fafc;\n color-scheme: light;\n font: 15px/1.5 system-ui, sans-serif;\n color: var(--arap-text);\n text-align: left;\n letter-spacing: normal;\n}\n.arap-root *,\n.arap-root *::before,\n.arap-root *::after {\n box-sizing: border-box;\n}\n.arap-root button {\n font: inherit;\n cursor: pointer;\n color: inherit;\n text-transform: none;\n letter-spacing: normal;\n transition: background-color 0.15s, border-color 0.15s;\n}\n.arap-root button:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n.arap-root button:focus-visible,\n.arap-panel:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 3px;\n}\n.arap-root .arap-btn {\n position: fixed;\n z-index: 2147483001;\n bottom: max(16px, env(safe-area-inset-bottom));\n right: max(16px, env(safe-area-inset-right));\n width: 56px;\n height: 56px;\n padding: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 2px solid var(--arap-surface);\n border-radius: 50%;\n background: var(--arap-accent);\n color: #fff;\n box-shadow: 0 4px 12px #0f172a26, 0 10px 24px #0f172a14;\n}\n.arap-root .arap-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-root .arap-btn[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-position=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-panel {\n position: fixed;\n z-index: 2147483000;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n right: max(16px, env(safe-area-inset-right));\n width: min(400px, calc(100vw - 32px));\n max-height: calc(100vh - 120px);\n max-height: calc(100dvh - 120px - env(safe-area-inset-bottom));\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 20px;\n border: 1px solid var(--arap-divider);\n border-radius: 16px;\n background: var(--arap-surface);\n box-shadow: 0 8px 16px #0f172a0d, 0 20px 48px #0f172a1a;\n}\n.arap-root .arap-panel[hidden] {\n display: none !important;\n}\n.arap-root .arap-panel[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-panel[data-position=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-heading {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 8px;\n padding-bottom: 18px;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-heading-copy {\n min-width: 0;\n}\n.arap-heading h2 {\n margin: 0;\n font: 700 22px/1.3 system-ui, sans-serif;\n letter-spacing: -0.025em;\n color: var(--arap-text);\n overflow-wrap: anywhere;\n}\n.arap-description {\n margin: 6px 0 0;\n color: var(--arap-muted);\n font: 14px/1.5 system-ui, sans-serif;\n overflow-wrap: anywhere;\n}\n.arap-heading button {\n flex: none;\n width: 44px;\n height: 44px;\n margin-top: -6px;\n border: 1px solid transparent;\n border-radius: 8px;\n background: transparent;\n color: var(--arap-muted);\n font-size: 28px;\n line-height: 1;\n}\n.arap-heading button:hover {\n background: var(--arap-control);\n border-color: var(--arap-border);\n}\n.arap-feature {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 10px 12px;\n padding: 18px 0;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-feature:last-child {\n border: 0;\n padding-bottom: 0;\n}\n.arap-label {\n display: flex;\n align-items: center;\n gap: 10px;\n font-weight: 500;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n.arap-icon {\n flex: none;\n width: 22px;\n height: 22px;\n display: inline-block;\n vertical-align: middle;\n}\n.arap-controls {\n display: flex;\n align-items: stretch;\n border: 1px solid var(--arap-border);\n border-radius: 9px;\n overflow: hidden;\n background: var(--arap-control);\n}\n.arap-root .arap-btn-sm {\n flex: none;\n width: 44px;\n height: 44px;\n border: 0;\n border-radius: 0;\n background: transparent;\n font-size: 22px;\n}\n.arap-root .arap-btn-sm:hover:not(:disabled) {\n background: var(--arap-selected);\n color: var(--arap-accent);\n}\n.arap-root .arap-controls button:focus-visible {\n outline-offset: -4px;\n}\n.arap-value {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 56px;\n padding: 0 6px;\n text-align: center;\n font-weight: 600;\n border-inline: 1px solid var(--arap-divider);\n background: var(--arap-surface);\n}\n.arap-segmented {\n grid-column: 1 / -1;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n}\n.arap-root .arap-segment {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-muted);\n overflow-wrap: anywhere;\n}\n.arap-root .arap-segment:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-root .arap-segment-active {\n background: var(--arap-accent);\n color: #fff;\n border-color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-segment-active:hover {\n background: var(--arap-accent-hover);\n color: #fff;\n}\n.arap-check {\n flex: none;\n font-size: 15px;\n line-height: 1;\n}\n.arap-root .arap-toggle {\n position: relative;\n width: 56px;\n height: 44px;\n padding: 0;\n border: 0;\n border-radius: 10px;\n background: transparent;\n}\n.arap-toggle::before {\n content: "";\n position: absolute;\n inset: 6px 0;\n border: 2px solid #64748b;\n border-radius: 20px;\n background: #e2e8f0;\n}\n.arap-toggle-knob {\n position: absolute;\n top: 10px;\n left: 4px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: #475569;\n pointer-events: none;\n transition: transform 0.15s;\n}\n.arap-toggle-active::before {\n background: var(--arap-accent);\n border-color: var(--arap-accent);\n}\n.arap-toggle-active .arap-toggle-knob {\n transform: translateX(24px);\n background: #fff;\n}\n.arap-toggle-active .arap-toggle-knob::after {\n content: "\\2713";\n display: block;\n color: var(--arap-accent);\n font-size: 16px;\n font-weight: 700;\n line-height: 24px;\n text-align: center;\n}\n.arap-root .arap-toggle:hover::before {\n border-color: var(--arap-accent);\n}\n.arap-feature-reset {\n display: block;\n}\n.arap-root .arap-reset-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n min-height: 48px;\n padding: 10px;\n border: 1px solid var(--arap-border);\n border-radius: 10px;\n background: var(--arap-control);\n color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-reset-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n@media (max-width: 380px) {\n .arap-root .arap-panel {\n padding: 16px;\n }\n .arap-heading h2 {\n font-size: 20px;\n }\n .arap-feature-stepper {\n grid-template-columns: minmax(0, 1fr);\n }\n .arap-controls {\n width: 100%;\n }\n .arap-value {\n flex: 1;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .arap-root *,\n .arap-root *::before,\n .arap-root *::after {\n transition: none !important;\n animation: none !important;\n }\n}\n@media (forced-colors: active) {\n .arap-root {\n --arap-surface: Canvas;\n --arap-text: CanvasText;\n --arap-muted: CanvasText;\n --arap-border: ButtonText;\n --arap-divider: ButtonText;\n --arap-accent: Highlight;\n --arap-control: Canvas;\n --arap-selected: Canvas;\n }\n .arap-root button[aria-pressed=true] {\n outline: 2px solid Highlight;\n outline-offset: -4px;\n }\n .arap-root .arap-segment-active {\n color: HighlightText;\n background: Highlight;\n }\n .arap-toggle::before {\n border-color: ButtonText;\n background: Canvas;\n }\n .arap-toggle-knob {\n background: ButtonText;\n }\n .arap-toggle-active .arap-toggle-knob {\n background: Highlight;\n }\n .arap-toggle-active .arap-toggle-knob::after {\n color: HighlightText;\n }\n}\n.arap-root .arap-panel {\n display: flex;\n flex-direction: column;\n overflow: visible;\n}\n.arap-heading {\n flex: none;\n}\n.arap-tools {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 0 3px;\n margin: 0 -3px;\n}\n.arap-tools:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: -3px;\n}\n.arap-quick-actions {\n position: relative;\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 14px;\n margin-top: 8px;\n border-top: 1px solid var(--arap-divider);\n}\n.arap-actions {\n flex: 1;\n min-width: 0;\n}\n.arap-actions:empty {\n display: none;\n}\n.arap-actions .arap-feature-reset {\n padding: 0;\n margin: 0;\n border: 0;\n}\n.arap-root .arap-position-button,\n.arap-root .arap-position-default,\n.arap-root .arap-position-arrows button {\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-accent);\n}\n.arap-root .arap-position-button:hover,\n.arap-root .arap-position-default:hover,\n.arap-root .arap-position-arrows button:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-position-popover {\n position: absolute;\n z-index: 1;\n bottom: calc(100% + 8px);\n left: 0;\n width: 100%;\n max-height: calc(100dvh - 160px);\n overflow: auto;\n padding: 14px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n box-shadow: 0 8px 24px #0f172a26;\n}\n.arap-position-popover[hidden] {\n display: none !important;\n}\n.arap-position-label {\n display: block;\n margin-bottom: 6px;\n font-weight: 600;\n}\n.arap-position-popover select {\n width: 100%;\n min-height: 44px;\n padding: 8px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n font: inherit;\n color: var(--arap-text);\n background: var(--arap-surface);\n}\n.arap-position-popover select:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-position-arrows {\n display: flex;\n justify-content: space-between;\n gap: 6px;\n margin-top: 10px;\n}\n.arap-position-default {\n width: 100%;\n margin-top: 8px;\n}\n.arap-root .arap-btn[data-draggable=true] {\n touch-action: none;\n user-select: none;\n cursor: grab;\n}\n.arap-root .arap-btn[data-dragging=true] {\n cursor: grabbing;\n}\n.arap-root .arap-btn[data-corner$=left],\n.arap-root .arap-panel[data-corner$=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-corner$=right],\n.arap-root .arap-panel[data-corner$=right] {\n left: auto;\n right: max(16px, env(safe-area-inset-right));\n}\n.arap-root .arap-btn[data-corner^=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-btn[data-corner^=bottom] {\n top: auto;\n bottom: max(16px, env(safe-area-inset-bottom));\n}\n.arap-root .arap-panel[data-corner^=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-root .arap-panel[data-corner^=bottom] {\n top: auto;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n}\n.arap-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n.arap-root .arap-skip-actions {\n position: absolute;\n top: 12px;\n left: 20px;\n width: 44px;\n height: 44px;\n clip-path: inset(50%);\n overflow: hidden;\n pointer-events: none;\n}\n.arap-root .arap-skip-actions:focus-visible {\n right: 20px;\n width: auto;\n height: auto;\n min-height: 44px;\n clip-path: none;\n pointer-events: auto;\n z-index: 2;\n padding: 8px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-accent);\n}\n.arap-skip-to-main {\n position: fixed;\n top: 12px;\n left: 16px;\n z-index: 2147483647;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n pointer-events: none;\n font-family: inherit;\n font-size: 0.9375rem;\n font-weight: 600;\n text-decoration: none;\n color: var(--arap-accent, #008060);\n background: var(--arap-surface, #ffffff);\n border-radius: 8px;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.arap-skip-to-main:focus,\n.arap-skip-to-main:focus-visible {\n width: auto;\n height: auto;\n min-height: 44px;\n margin: 0;\n padding: 10px 18px;\n clip-path: none;\n overflow: visible;\n white-space: normal;\n pointer-events: auto;\n border: 2px solid var(--arap-accent, #008060);\n outline: 3px solid var(--arap-accent, #008060);\n outline-offset: 3px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n@media (forced-colors: active) {\n .arap-skip-to-main {\n background: Canvas;\n color: CanvasText;\n border-color: Highlight;\n }\n .arap-skip-to-main:focus,\n .arap-skip-to-main:focus-visible {\n outline: 3px solid Highlight;\n }\n}\n@media (max-height: 480px) {\n .arap-root .arap-panel {\n top: max(16px, env(safe-area-inset-top)) !important;\n bottom: max(16px, env(safe-area-inset-bottom)) !important;\n max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;\n padding: 8px;\n }\n .arap-heading {\n padding-bottom: 8px;\n }\n .arap-heading h2 {\n font-size: 18px;\n }\n .arap-heading button {\n margin-top: 0;\n }\n .arap-description {\n display: none;\n }\n .arap-quick-actions {\n padding-top: 8px;\n margin-top: 0;\n }\n .arap-root .arap-reset-btn {\n min-height: 44px;\n }\n .arap-root .arap-btn[data-open=true] {\n visibility: hidden;\n }\n .arap-position-popover {\n max-height: calc(100dvh - 96px);\n }\n}\n.arap-statement {\n flex: none;\n padding-top: 10px;\n text-align: center;\n}\n.arap-statement-link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 44px;\n padding: 6px 12px;\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 4px;\n font-size: 14px;\n font-weight: 500;\n border-radius: 8px;\n}\n.arap-statement-link:hover {\n color: var(--arap-accent-hover);\n background: var(--arap-selected);\n}\n.arap-statement-link:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-credits {\n display: flex;\n flex: none;\n flex-direction: column;\n gap: 2px;\n padding-top: 8px;\n color: var(--arap-muted);\n text-align: center;\n font-size: 11px;\n line-height: 1.4;\n}\n.arap-credits a {\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.arap-credits a:hover {\n color: var(--arap-accent-hover);\n}\n.arap-credits a:focus-visible {\n outline: 2px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-root .arap-btn[data-large-controls=true] {\n width: 64px;\n height: 64px;\n min-width: 48px;\n min-height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] {\n width: min(440px, calc(100vw - 32px));\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-heading button {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 32px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-btn-sm {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 24px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-value {\n min-width: 64px;\n font-size: 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-segment {\n min-width: 48px;\n min-height: 48px;\n padding: 10px 14px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle {\n width: 64px;\n height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle::before {\n inset: 8px 0;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-knob {\n top: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-active .arap-toggle-knob {\n transform: translateX(28px);\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-reset-btn {\n min-height: 52px;\n font-size: 16px;\n padding: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-button,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-default,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-arrows button {\n min-width: 48px;\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-popover select {\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-statement-link {\n min-height: 48px;\n font-size: 15px;\n padding: 10px 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-skip-actions {\n min-width: 48px;\n min-height: 48px;\n}\n.arap-feature-card {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 12px;\n}\n.arap-card-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-card-title {\n font-weight: 600;\n font-size: 15px;\n color: var(--arap-text);\n}\n.arap-card-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-status-badge {\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 9999px;\n font-size: 11px;\n font-weight: 600;\n background: var(--arap-control);\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-card-alert {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 10px 12px;\n border-radius: 8px;\n font-size: 13px;\n line-height: 1.4;\n}\n.arap-alert-icon {\n flex: none;\n font-size: 16px;\n line-height: 1;\n}\n.arap-card-error {\n background: #fef2f2;\n border: 1px solid #fecaca;\n color: #991b1b;\n}\n.arap-card-unavailable {\n background: #f8fafc;\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n}\n.arap-card-permission {\n background: #fffbeb;\n border: 1px solid #fde68a;\n color: #92400e;\n}\n.arap-permission-content {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-permission-btn {\n align-self: flex-start;\n padding: 4px 10px;\n border: 1px solid #d97706;\n border-radius: 6px;\n background: #f59e0b;\n color: #fff;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n.arap-permission-btn:hover {\n background: #d97706;\n}\n.arap-card-content {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.arap-choice-group {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 100%;\n}\n.arap-choice-group-title {\n font-size: 12px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-choice-badge {\n font-size: 11px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--arap-divider);\n color: var(--arap-muted);\n}\n.arap-segment-active .arap-choice-badge {\n background: rgba(255, 255, 255, 0.25);\n color: #fff;\n}\n.arap-stepper-control-wrapper {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n}\n.arap-slider-container {\n display: flex;\n align-items: center;\n padding: 4px 0;\n}\n.arap-slider {\n width: 100%;\n accent-color: var(--arap-accent);\n cursor: pointer;\n}\n.arap-search-count {\n padding: 6px 0;\n font-size: 12px;\n font-weight: 500;\n color: var(--arap-muted);\n}\n.arap-empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 24px 16px;\n gap: 8px;\n}\n.arap-empty-icon {\n font-size: 32px;\n}\n.arap-empty-title {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-empty-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n}\n.arap-empty-btn,\n.arap-retry-btn {\n margin-top: 6px;\n padding: 8px 16px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n font-weight: 500;\n font-size: 13px;\n color: var(--arap-text);\n cursor: pointer;\n}\n.arap-empty-btn:hover,\n.arap-retry-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n color: var(--arap-accent);\n}\n.arap-profile-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n transition: border-color 0.15s, box-shadow 0.15s;\n}\n.arap-profile-card-active {\n border-color: var(--arap-accent);\n background: var(--arap-selected);\n box-shadow: 0 0 0 1px var(--arap-accent);\n}\n.arap-profile-header {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.arap-profile-title-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-profile-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-profile-active-badge {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-accent);\n background: #dbeafe;\n padding: 2px 8px;\n border-radius: 9999px;\n}\n.arap-profile-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-profile-affected {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-profile-affected-label {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-profile-chips {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n.arap-profile-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px;\n border-radius: 6px;\n background: var(--arap-control);\n border: 1px solid var(--arap-divider);\n font-size: 12px;\n color: var(--arap-text);\n}\n.arap-profile-actions {\n display: flex;\n gap: 8px;\n margin-top: 4px;\n}\n.arap-profile-apply-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-accent);\n color: #fff;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-apply-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-profile-revert-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-muted);\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-revert-btn:hover {\n background: var(--arap-control);\n color: var(--arap-text);\n border-color: var(--arap-text);\n}\n.arap-notice {\n grid-column: 1 / -1;\n margin-top: 6px;\n padding: 8px 12px;\n border-radius: 8px;\n font-size: 12px;\n line-height: 1.45;\n background: #fefce8;\n border: 1px solid #fef08a;\n color: #854d0e;\n}\n.arap-notice-warning {\n background: #fffbeb;\n border-color: #fde68a;\n color: #92400e;\n}\n.arap-reading-mask {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-reading-guide {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-feature-expandable {\n flex-direction: column !important;\n align-items: stretch !important;\n}\n.arap-accessible-tooltip {\n position: fixed !important;\n z-index: 2147483646 !important;\n max-width: 320px !important;\n min-width: 48px !important;\n box-sizing: border-box !important;\n padding: 6px 12px !important;\n background: #0f172a !important;\n color: #ffffff !important;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n sans-serif !important;\n font-size: 13px !important;\n line-height: 1.4 !important;\n font-weight: 500 !important;\n border-radius: 6px !important;\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;\n pointer-events: auto !important;\n word-break: break-word !important;\n white-space: normal !important;\n opacity: 0 !important;\n visibility: hidden !important;\n transition: opacity 120ms ease, transform 120ms ease !important;\n transform: translateY(2px) !important;\n}\n.arap-accessible-tooltip[data-visible=true] {\n opacity: 1 !important;\n visibility: visible !important;\n transform: translateY(0) !important;\n}\n.arap-accessible-tooltip[data-placement=top] {\n transform: translateY(-2px) !important;\n}\n.arap-accessible-tooltip[data-placement=top][data-visible=true] {\n transform: translateY(0) !important;\n}\n@media (forced-colors: active) {\n .arap-accessible-tooltip {\n background: Canvas !important;\n color: CanvasText !important;\n border: 2px solid Highlight !important;\n box-shadow: none !important;\n }\n}\n');
27
+ styleInject('.arap-root {\n --arap-surface: #fff;\n --arap-text: #111827;\n --arap-muted: #475569;\n --arap-border: #cbd5e1;\n --arap-divider: #e2e8f0;\n --arap-accent: #1d4ed8;\n --arap-accent-hover: #1e40af;\n --arap-selected: #eff6ff;\n --arap-control: #f8fafc;\n color-scheme: light;\n font:\n 15px/1.5 system-ui,\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Noto Sans Sinhala",\n "Iskoola Pota",\n "Noto Sans Tamil",\n "Latha",\n "Nirmala UI",\n sans-serif;\n color: var(--arap-text);\n text-align: start;\n letter-spacing: normal;\n}\n.arap-root *,\n.arap-root *::before,\n.arap-root *::after {\n box-sizing: border-box;\n}\n.arap-root button {\n font: inherit;\n cursor: pointer;\n color: inherit;\n text-transform: none;\n letter-spacing: normal;\n transition: background-color 0.15s, border-color 0.15s;\n}\n.arap-root button:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n.arap-root button:focus-visible,\n.arap-panel:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 3px;\n}\n.arap-root .arap-btn {\n position: fixed;\n z-index: 2147483001;\n bottom: max(16px, env(safe-area-inset-bottom));\n right: max(16px, env(safe-area-inset-right));\n width: 56px;\n height: 56px;\n padding: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 2px solid var(--arap-surface);\n border-radius: 50%;\n background: var(--arap-accent);\n color: #fff;\n box-shadow: 0 4px 12px #0f172a26, 0 10px 24px #0f172a14;\n}\n.arap-root .arap-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-root .arap-btn[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-position=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-panel {\n position: fixed;\n z-index: 2147483000;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n right: max(16px, env(safe-area-inset-right));\n width: min(400px, calc(100vw - 32px));\n max-height: calc(100vh - 120px);\n max-height: calc(100dvh - 120px - env(safe-area-inset-bottom));\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 20px;\n border: 1px solid var(--arap-divider);\n border-radius: 16px;\n background: var(--arap-surface);\n box-shadow: 0 8px 16px #0f172a0d, 0 20px 48px #0f172a1a;\n}\n.arap-root .arap-panel[hidden] {\n display: none !important;\n}\n.arap-root .arap-panel[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-panel[data-position=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-heading {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 8px;\n padding-bottom: 18px;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-heading-copy {\n min-width: 0;\n}\n.arap-heading h2 {\n margin: 0;\n font: 700 22px/1.3 system-ui, sans-serif;\n letter-spacing: -0.025em;\n color: var(--arap-text);\n overflow-wrap: anywhere;\n}\n.arap-description {\n margin: 6px 0 0;\n color: var(--arap-muted);\n font: 14px/1.5 system-ui, sans-serif;\n overflow-wrap: anywhere;\n}\n.arap-heading button {\n flex: none;\n width: 44px;\n height: 44px;\n margin-top: -6px;\n border: 1px solid transparent;\n border-radius: 8px;\n background: transparent;\n color: var(--arap-muted);\n font-size: 28px;\n line-height: 1;\n}\n.arap-heading button:hover {\n background: var(--arap-control);\n border-color: var(--arap-border);\n}\n.arap-feature {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 10px 12px;\n padding: 18px 0;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-feature:last-child {\n border: 0;\n padding-bottom: 0;\n}\n.arap-label {\n display: flex;\n align-items: center;\n gap: 10px;\n font-weight: 500;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n.arap-icon {\n flex: none;\n width: 22px;\n height: 22px;\n display: inline-block;\n vertical-align: middle;\n}\n.arap-controls {\n display: flex;\n align-items: stretch;\n border: 1px solid var(--arap-border);\n border-radius: 9px;\n overflow: hidden;\n background: var(--arap-control);\n}\n.arap-root .arap-btn-sm {\n flex: none;\n width: 44px;\n height: 44px;\n border: 0;\n border-radius: 0;\n background: transparent;\n font-size: 22px;\n}\n.arap-root .arap-btn-sm:hover:not(:disabled) {\n background: var(--arap-selected);\n color: var(--arap-accent);\n}\n.arap-root .arap-controls button:focus-visible {\n outline-offset: -4px;\n}\n.arap-value {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 56px;\n padding: 0 6px;\n text-align: center;\n font-weight: 600;\n border-inline: 1px solid var(--arap-divider);\n background: var(--arap-surface);\n}\n.arap-segmented {\n grid-column: 1 / -1;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n}\n.arap-root .arap-segment {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-muted);\n overflow-wrap: anywhere;\n}\n.arap-root .arap-segment:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-root .arap-segment-active {\n background: var(--arap-accent);\n color: #fff;\n border-color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-segment-active:hover {\n background: var(--arap-accent-hover);\n color: #fff;\n}\n.arap-check {\n flex: none;\n font-size: 15px;\n line-height: 1;\n}\n.arap-root .arap-toggle {\n position: relative;\n width: 56px;\n height: 44px;\n padding: 0;\n border: 0;\n border-radius: 10px;\n background: transparent;\n}\n.arap-toggle::before {\n content: "";\n position: absolute;\n inset: 6px 0;\n border: 2px solid #64748b;\n border-radius: 20px;\n background: #e2e8f0;\n}\n.arap-toggle-knob {\n position: absolute;\n top: 10px;\n left: 4px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: #475569;\n pointer-events: none;\n transition: transform 0.15s;\n}\n.arap-toggle-active::before {\n background: var(--arap-accent);\n border-color: var(--arap-accent);\n}\n.arap-toggle-active .arap-toggle-knob {\n transform: translateX(24px);\n background: #fff;\n}\n.arap-toggle-active .arap-toggle-knob::after {\n content: "\\2713";\n display: block;\n color: var(--arap-accent);\n font-size: 16px;\n font-weight: 700;\n line-height: 24px;\n text-align: center;\n}\n.arap-root .arap-toggle:hover::before {\n border-color: var(--arap-accent);\n}\n.arap-feature-reset {\n display: block;\n}\n.arap-root .arap-reset-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n min-height: 48px;\n padding: 10px;\n border: 1px solid var(--arap-border);\n border-radius: 10px;\n background: var(--arap-control);\n color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-reset-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n@media (max-width: 380px) {\n .arap-root .arap-panel {\n padding: 16px;\n }\n .arap-heading h2 {\n font-size: 20px;\n }\n .arap-feature-stepper {\n grid-template-columns: minmax(0, 1fr);\n }\n .arap-controls {\n width: 100%;\n }\n .arap-value {\n flex: 1;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .arap-root *,\n .arap-root *::before,\n .arap-root *::after {\n transition: none !important;\n animation: none !important;\n }\n}\n@media (forced-colors: active) {\n .arap-root {\n --arap-surface: Canvas;\n --arap-text: CanvasText;\n --arap-muted: CanvasText;\n --arap-border: ButtonText;\n --arap-divider: ButtonText;\n --arap-accent: Highlight;\n --arap-control: Canvas;\n --arap-selected: Canvas;\n }\n .arap-root button[aria-pressed=true] {\n outline: 2px solid Highlight;\n outline-offset: -4px;\n }\n .arap-root .arap-segment-active {\n color: HighlightText;\n background: Highlight;\n }\n .arap-toggle::before {\n border-color: ButtonText;\n background: Canvas;\n }\n .arap-toggle-knob {\n background: ButtonText;\n }\n .arap-toggle-active .arap-toggle-knob {\n background: Highlight;\n }\n .arap-toggle-active .arap-toggle-knob::after {\n color: HighlightText;\n }\n}\n.arap-root .arap-panel {\n display: flex;\n flex-direction: column;\n overflow: visible;\n}\n.arap-heading {\n flex: none;\n}\n.arap-tools {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 0 3px;\n margin: 0 -3px;\n}\n.arap-tools:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: -3px;\n}\n.arap-quick-actions {\n position: relative;\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 14px;\n margin-top: 8px;\n border-top: 1px solid var(--arap-divider);\n}\n.arap-actions {\n flex: 1;\n min-width: 0;\n}\n.arap-actions:empty {\n display: none;\n}\n.arap-actions .arap-feature-reset {\n padding: 0;\n margin: 0;\n border: 0;\n}\n.arap-root .arap-position-button,\n.arap-root .arap-position-default,\n.arap-root .arap-position-arrows button {\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-accent);\n}\n.arap-root .arap-position-button:hover,\n.arap-root .arap-position-default:hover,\n.arap-root .arap-position-arrows button:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-position-popover {\n position: absolute;\n z-index: 1;\n bottom: calc(100% + 8px);\n left: 0;\n width: 100%;\n max-height: calc(100dvh - 160px);\n overflow: auto;\n padding: 14px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n box-shadow: 0 8px 24px #0f172a26;\n}\n.arap-position-popover[hidden] {\n display: none !important;\n}\n.arap-position-label {\n display: block;\n margin-bottom: 6px;\n font-weight: 600;\n}\n.arap-position-popover select {\n width: 100%;\n min-height: 44px;\n padding: 8px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n font: inherit;\n color: var(--arap-text);\n background: var(--arap-surface);\n}\n.arap-position-popover select:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-position-arrows {\n display: flex;\n justify-content: space-between;\n gap: 6px;\n margin-top: 10px;\n}\n.arap-position-default {\n width: 100%;\n margin-top: 8px;\n}\n.arap-root .arap-btn[data-draggable=true] {\n touch-action: none;\n user-select: none;\n cursor: grab;\n}\n.arap-root .arap-btn[data-dragging=true] {\n cursor: grabbing;\n}\n.arap-root .arap-btn[data-corner$=left],\n.arap-root .arap-panel[data-corner$=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-corner$=right],\n.arap-root .arap-panel[data-corner$=right] {\n left: auto;\n right: max(16px, env(safe-area-inset-right));\n}\n.arap-root .arap-btn[data-corner^=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-btn[data-corner^=bottom] {\n top: auto;\n bottom: max(16px, env(safe-area-inset-bottom));\n}\n.arap-root .arap-panel[data-corner^=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-root .arap-panel[data-corner^=bottom] {\n top: auto;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n}\n.arap-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n.arap-root .arap-skip-actions {\n position: absolute;\n top: 12px;\n left: 20px;\n width: 44px;\n height: 44px;\n clip-path: inset(50%);\n overflow: hidden;\n pointer-events: none;\n}\n.arap-root .arap-skip-actions:focus-visible {\n right: 20px;\n width: auto;\n height: auto;\n min-height: 44px;\n clip-path: none;\n pointer-events: auto;\n z-index: 2;\n padding: 8px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-accent);\n}\n.arap-skip-to-main {\n position: fixed;\n top: 12px;\n left: 16px;\n z-index: 2147483647;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n pointer-events: none;\n font-family: inherit;\n font-size: 0.9375rem;\n font-weight: 600;\n text-decoration: none;\n color: var(--arap-accent, #008060);\n background: var(--arap-surface, #ffffff);\n border-radius: 8px;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.arap-skip-to-main:focus,\n.arap-skip-to-main:focus-visible {\n width: auto;\n height: auto;\n min-height: 44px;\n margin: 0;\n padding: 10px 18px;\n clip-path: none;\n overflow: visible;\n white-space: normal;\n pointer-events: auto;\n border: 2px solid var(--arap-accent, #008060);\n outline: 3px solid var(--arap-accent, #008060);\n outline-offset: 3px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n@media (forced-colors: active) {\n .arap-skip-to-main {\n background: Canvas;\n color: CanvasText;\n border-color: Highlight;\n }\n .arap-skip-to-main:focus,\n .arap-skip-to-main:focus-visible {\n outline: 3px solid Highlight;\n }\n}\n@media (max-height: 480px) {\n .arap-root .arap-panel {\n top: max(16px, env(safe-area-inset-top)) !important;\n bottom: max(16px, env(safe-area-inset-bottom)) !important;\n max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;\n padding: 8px;\n }\n .arap-heading {\n padding-bottom: 8px;\n }\n .arap-heading h2 {\n font-size: 18px;\n }\n .arap-heading button {\n margin-top: 0;\n }\n .arap-description {\n display: none;\n }\n .arap-quick-actions {\n padding-top: 8px;\n margin-top: 0;\n }\n .arap-root .arap-reset-btn {\n min-height: 44px;\n }\n .arap-root .arap-btn[data-open=true] {\n visibility: hidden;\n }\n .arap-position-popover {\n max-height: calc(100dvh - 96px);\n }\n}\n.arap-statement {\n flex: none;\n padding-top: 10px;\n text-align: center;\n}\n.arap-statement-link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 44px;\n padding: 6px 12px;\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 4px;\n font-size: 14px;\n font-weight: 500;\n border-radius: 8px;\n}\n.arap-statement-link:hover {\n color: var(--arap-accent-hover);\n background: var(--arap-selected);\n}\n.arap-statement-link:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-credits {\n display: flex;\n flex: none;\n flex-direction: column;\n gap: 2px;\n padding-top: 8px;\n color: var(--arap-muted);\n text-align: center;\n font-size: 11px;\n line-height: 1.4;\n}\n.arap-credits a {\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.arap-credits a:hover {\n color: var(--arap-accent-hover);\n}\n.arap-credits a:focus-visible {\n outline: 2px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-root .arap-btn[data-large-controls=true] {\n width: 64px;\n height: 64px;\n min-width: 48px;\n min-height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] {\n width: min(440px, calc(100vw - 32px));\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-heading button {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 32px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-btn-sm {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 24px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-value {\n min-width: 64px;\n font-size: 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-segment {\n min-width: 48px;\n min-height: 48px;\n padding: 10px 14px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle {\n width: 64px;\n height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle::before {\n inset: 8px 0;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-knob {\n top: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-active .arap-toggle-knob {\n transform: translateX(28px);\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-reset-btn {\n min-height: 52px;\n font-size: 16px;\n padding: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-button,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-default,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-arrows button {\n min-width: 48px;\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-popover select {\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-statement-link {\n min-height: 48px;\n font-size: 15px;\n padding: 10px 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-skip-actions {\n min-width: 48px;\n min-height: 48px;\n}\n.arap-feature-card {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 12px;\n}\n.arap-card-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-card-title {\n font-weight: 600;\n font-size: 15px;\n color: var(--arap-text);\n}\n.arap-card-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-status-badge {\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 9999px;\n font-size: 11px;\n font-weight: 600;\n background: var(--arap-control);\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-card-alert {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 10px 12px;\n border-radius: 8px;\n font-size: 13px;\n line-height: 1.4;\n}\n.arap-alert-icon {\n flex: none;\n font-size: 16px;\n line-height: 1;\n}\n.arap-card-error {\n background: #fef2f2;\n border: 1px solid #fecaca;\n color: #991b1b;\n}\n.arap-card-unavailable {\n background: #f8fafc;\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n}\n.arap-card-permission {\n background: #fffbeb;\n border: 1px solid #fde68a;\n color: #92400e;\n}\n.arap-permission-content {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-permission-btn {\n align-self: flex-start;\n padding: 4px 10px;\n border: 1px solid #d97706;\n border-radius: 6px;\n background: #f59e0b;\n color: #fff;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n.arap-permission-btn:hover {\n background: #d97706;\n}\n.arap-card-content {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.arap-choice-group {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 100%;\n}\n.arap-choice-group-title {\n font-size: 12px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-choice-badge {\n font-size: 11px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--arap-divider);\n color: var(--arap-muted);\n}\n.arap-segment-active .arap-choice-badge {\n background: rgba(255, 255, 255, 0.25);\n color: #fff;\n}\n.arap-stepper-control-wrapper {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n}\n.arap-slider-container {\n display: flex;\n align-items: center;\n padding: 4px 0;\n}\n.arap-slider {\n width: 100%;\n accent-color: var(--arap-accent);\n cursor: pointer;\n}\n.arap-search-count {\n padding: 6px 0;\n font-size: 12px;\n font-weight: 500;\n color: var(--arap-muted);\n}\n.arap-empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 24px 16px;\n gap: 8px;\n}\n.arap-empty-icon {\n font-size: 32px;\n}\n.arap-empty-title {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-empty-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n}\n.arap-empty-btn,\n.arap-retry-btn {\n margin-top: 6px;\n padding: 8px 16px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n font-weight: 500;\n font-size: 13px;\n color: var(--arap-text);\n cursor: pointer;\n}\n.arap-empty-btn:hover,\n.arap-retry-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n color: var(--arap-accent);\n}\n.arap-profile-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n transition: border-color 0.15s, box-shadow 0.15s;\n}\n.arap-profile-card-active {\n border-color: var(--arap-accent);\n background: var(--arap-selected);\n box-shadow: 0 0 0 1px var(--arap-accent);\n}\n.arap-profile-header {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.arap-profile-title-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-profile-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-profile-active-badge {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-accent);\n background: #dbeafe;\n padding: 2px 8px;\n border-radius: 9999px;\n}\n.arap-profile-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-profile-affected {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-profile-affected-label {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-profile-chips {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n.arap-profile-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px;\n border-radius: 6px;\n background: var(--arap-control);\n border: 1px solid var(--arap-divider);\n font-size: 12px;\n color: var(--arap-text);\n}\n.arap-profile-actions {\n display: flex;\n gap: 8px;\n margin-top: 4px;\n}\n.arap-profile-apply-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-accent);\n color: #fff;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-apply-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-profile-revert-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-muted);\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-revert-btn:hover {\n background: var(--arap-control);\n color: var(--arap-text);\n border-color: var(--arap-text);\n}\n.arap-notice {\n grid-column: 1 / -1;\n margin-top: 6px;\n padding: 8px 12px;\n border-radius: 8px;\n font-size: 12px;\n line-height: 1.45;\n background: #fefce8;\n border: 1px solid #fef08a;\n color: #854d0e;\n}\n.arap-notice-warning {\n background: #fffbeb;\n border-color: #fde68a;\n color: #92400e;\n}\n.arap-reading-mask {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-reading-guide {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-feature-expandable {\n flex-direction: column !important;\n align-items: stretch !important;\n}\n.arap-accessible-tooltip {\n position: fixed !important;\n z-index: 2147483646 !important;\n max-width: 320px !important;\n min-width: 48px !important;\n box-sizing: border-box !important;\n padding: 6px 12px !important;\n background: #0f172a !important;\n color: #ffffff !important;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n sans-serif !important;\n font-size: 13px !important;\n line-height: 1.4 !important;\n font-weight: 500 !important;\n border-radius: 6px !important;\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;\n pointer-events: auto !important;\n word-break: break-word !important;\n white-space: normal !important;\n opacity: 0 !important;\n visibility: hidden !important;\n transition: opacity 120ms ease, transform 120ms ease !important;\n transform: translateY(2px) !important;\n}\n.arap-accessible-tooltip[data-visible=true] {\n opacity: 1 !important;\n visibility: visible !important;\n transform: translateY(0) !important;\n}\n.arap-accessible-tooltip[data-placement=top] {\n transform: translateY(-2px) !important;\n}\n.arap-accessible-tooltip[data-placement=top][data-visible=true] {\n transform: translateY(0) !important;\n}\n@media (forced-colors: active) {\n .arap-accessible-tooltip {\n background: Canvas !important;\n color: CanvasText !important;\n border: 2px solid Highlight !important;\n box-shadow: none !important;\n }\n}\n.arap-navigator-dialog {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n margin-top: 10px;\n padding: 10px;\n background: var(--arap-control, #f1f5f9);\n border: 1px solid var(--arap-border, #e2e8f0);\n border-radius: 8px;\n box-sizing: border-box;\n}\n.arap-navigator-tabs {\n display: flex;\n gap: 4px;\n border-bottom: 1px solid var(--arap-border, #cbd5e1);\n padding-bottom: 6px;\n}\n.arap-navigator-tab {\n flex: 1;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 6px 10px;\n font-size: 12px;\n font-weight: 600;\n color: var(--arap-muted, #64748b);\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n transition: all 120ms ease;\n}\n.arap-navigator-tab:hover {\n color: var(--arap-text, #0f172a);\n background: rgba(0, 0, 0, 0.04);\n}\n.arap-navigator-tab-active {\n color: var(--arap-accent, #008060) !important;\n background: var(--arap-selected, #f0fdf4) !important;\n}\n.arap-navigator-search-box {\n width: 100%;\n}\n.arap-navigator-search {\n width: 100%;\n box-sizing: border-box;\n padding: 6px 10px;\n font-size: 12px;\n border: 1px solid var(--arap-border, #cbd5e1);\n border-radius: 6px;\n background: var(--arap-surface, #ffffff);\n color: var(--arap-text, #0f172a);\n}\n.arap-navigator-search:focus {\n outline: 2px solid var(--arap-accent, #008060);\n outline-offset: 1px;\n}\n.arap-navigator-content {\n max-height: 240px;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.arap-navigator-list {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.arap-navigator-item {\n margin: 0;\n padding: 0;\n}\n.arap-navigator-jump-btn {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n font-size: 12px;\n font-weight: 500;\n text-align: left;\n background: var(--arap-surface, #ffffff);\n border: 1px solid var(--arap-border, #e2e8f0);\n border-radius: 6px;\n color: var(--arap-text, #0f172a);\n cursor: pointer;\n transition: background 100ms ease, border-color 100ms ease;\n}\n.arap-navigator-jump-btn:hover,\n.arap-navigator-jump-btn:focus-visible {\n background: var(--arap-selected, #f0fdf4);\n border-color: var(--arap-accent, #008060);\n outline: 2px solid var(--arap-accent, #008060);\n outline-offset: -1px;\n}\n.arap-navigator-badge {\n display: inline-block;\n padding: 2px 6px;\n font-size: 10px;\n font-weight: 700;\n border-radius: 4px;\n flex-shrink: 0;\n}\n.arap-navigator-badge-h {\n background: #e0f2fe;\n color: #0369a1;\n}\n.arap-navigator-badge-l {\n background: #fef3c7;\n color: #b45309;\n}\n.arap-navigator-item-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.arap-navigator-empty {\n padding: 16px;\n font-size: 12px;\n text-align: center;\n color: var(--arap-muted, #64748b);\n font-style: italic;\n}\n.arap-profile-card {\n padding: 12px;\n border: 1px solid var(--arap-border, #e2e8f0);\n border-radius: 8px;\n background: var(--arap-card-bg, #ffffff);\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.arap-profile-card:hover {\n border-color: var(--arap-primary, #2563eb);\n}\n.arap-profile-card-active {\n border-color: var(--arap-primary, #2563eb);\n background: rgba(37, 99, 235, 0.03);\n box-shadow: 0 0 0 1px var(--arap-primary, #2563eb);\n}\n.arap-profile-header {\n margin-bottom: 8px;\n}\n.arap-profile-title-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 4px;\n}\n.arap-profile-title {\n margin: 0;\n font-size: 13px;\n font-weight: 600;\n color: var(--arap-text, #1e293b);\n}\n.arap-profile-active-badge {\n display: inline-block;\n padding: 2px 8px;\n font-size: 11px;\n font-weight: 600;\n border-radius: 9999px;\n background: #dbeafe;\n color: #1d4ed8;\n}\n.arap-profile-desc {\n margin: 0;\n font-size: 11px;\n color: var(--arap-muted, #64748b);\n line-height: 1.4;\n}\n.arap-profile-affected {\n margin-top: 8px;\n margin-bottom: 10px;\n}\n.arap-profile-affected-label {\n display: block;\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: var(--arap-muted, #94a3b8);\n margin-bottom: 4px;\n}\n.arap-profile-chips {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n}\n.arap-profile-chip {\n display: inline-block;\n padding: 2px 6px;\n font-size: 10px;\n background: var(--arap-chip-bg, #f1f5f9);\n color: var(--arap-text, #334155);\n border-radius: 4px;\n border: 1px solid var(--arap-chip-border, #e2e8f0);\n}\n.arap-profile-actions {\n display: flex;\n justify-content: flex-end;\n margin-top: 8px;\n}\n.arap-profile-apply-btn,\n.arap-profile-revert-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 36px;\n padding: 6px 14px;\n font-size: 12px;\n font-weight: 600;\n border-radius: 6px;\n cursor: pointer;\n transition: background 0.15s ease, border-color 0.15s ease;\n}\n.arap-profile-apply-btn {\n background: var(--arap-primary, #2563eb);\n color: #ffffff;\n border: 1px solid var(--arap-primary, #2563eb);\n}\n.arap-profile-apply-btn:hover {\n background: #1d4ed8;\n}\n.arap-profile-revert-btn {\n background: #ffffff;\n color: #dc2626;\n border: 1px solid #fca5a5;\n}\n.arap-profile-revert-btn:hover {\n background: #fef2f2;\n border-color: #f87171;\n}\n.arap-large-controls .arap-profile-apply-btn,\n.arap-large-controls .arap-profile-revert-btn {\n min-height: 48px;\n padding: 10px 18px;\n font-size: 14px;\n}\n@media (prefers-reduced-motion: reduce) {\n .arap-profile-card,\n .arap-profile-apply-btn,\n .arap-profile-revert-btn,\n .arap-preset-card {\n transition: none !important;\n }\n}\n.arap-preset-card {\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.arap-preset-card:hover {\n border-color: var(--arap-border-hover, #cbd5e1);\n}\n.arap-large-controls .arap-preset-card button {\n min-height: 48px;\n padding: 10px 16px;\n font-size: 14px;\n}\n.arap-root[dir=rtl],\n.arap-panel[dir=rtl] {\n direction: rtl;\n text-align: right;\n}\n.arap-panel[dir=rtl] .arap-heading {\n flex-direction: row-reverse;\n}\n.arap-panel[dir=rtl] .arap-position-arrows {\n direction: ltr;\n}\n.arap-search-input {\n width: 100%;\n box-sizing: border-box;\n padding: 6px 28px 6px 10px;\n font-size: 12px;\n border: 1px solid var(--arap-border, #cbd5e1);\n border-radius: 6px;\n background: var(--arap-surface, #ffffff);\n color: var(--arap-text, #0f172a);\n}\n.arap-panel[dir=rtl] .arap-search-input {\n padding: 6px 10px 6px 28px;\n}\n.arap-search-clear {\n position: absolute;\n inset-inline-end: 8px;\n top: 50%;\n transform: translateY(-50%);\n border: none;\n background: transparent;\n cursor: pointer;\n padding: 2px 6px;\n font-size: 14px;\n color: var(--arap-muted, #64748b);\n border-radius: 4px;\n}\n.arap-search-clear:hover {\n background: var(--arap-selected, #eff6ff);\n color: var(--arap-text, #0f172a);\n}\n');
28
28
 
29
29
  // src/core/AccessibilityPlugin.tsx
30
30
  import {
@@ -361,6 +361,16 @@ builtins.readingMaskHeight = {
361
361
  defaultValue: DEFAULT_READING_MASK_HEIGHT,
362
362
  validate: (v) => typeof v === "number" && v >= MIN_READING_MASK_HEIGHT && v <= MAX_READING_MASK_HEIGHT
363
363
  };
364
+ builtins.activeProfile = {
365
+ defaultValue: null,
366
+ validate: (v) => v === null || typeof v === "object" && v !== null && "profileId" in v && typeof v.profileId === "string"
367
+ };
368
+ builtins.customPresets = {
369
+ defaultValue: [],
370
+ validate: (v) => Array.isArray(v) && v.every(
371
+ (item) => typeof item === "object" && item !== null && typeof item.id === "string" && typeof item.name === "string" && typeof item.createdAt === "string" && typeof item.settings === "object" && item.settings !== null
372
+ )
373
+ };
364
374
  function validValue(key, value, fallback, validate) {
365
375
  if (builtins[key]) return builtins[key].validate(value);
366
376
  if (validate) {
@@ -1863,15 +1873,39 @@ function AccessibilityPlugin({
1863
1873
  const definition = registrations.current.get(key);
1864
1874
  if (!validKey(key) || !definition || !validValue(key, value2, definition.defaultValue, definition.validate))
1865
1875
  throw new Error(`Invalid value or unregistered feature: ${key}`);
1866
- setFeatures((previous) => ({ ...previous, [key]: value2 }));
1876
+ setFeatures((previous) => {
1877
+ const copy = { ...previous, [key]: value2 };
1878
+ if (key !== "activeProfile" && key !== PLACEMENT_KEY && previous.activeProfile && typeof previous.activeProfile === "object") {
1879
+ const profileState = previous.activeProfile;
1880
+ const targetKey = key === "fontSize" || key === "textScale" ? "fontScale" : key === "focusHighlight" ? "highlightFocus" : key === "linkHighlight" ? "highlightLinks" : key === "bigCursor" ? "cursorSize" : key === "readingGuide" || key === "readingMask" ? "readerMode" : key;
1881
+ if (profileState.baseSnapshot && (targetKey in profileState.baseSnapshot || key in profileState.baseSnapshot)) {
1882
+ copy.activeProfile = {
1883
+ ...profileState,
1884
+ overrides: {
1885
+ ...profileState.overrides,
1886
+ [targetKey]: value2,
1887
+ [key]: value2
1888
+ }
1889
+ };
1890
+ }
1891
+ }
1892
+ return copy;
1893
+ });
1867
1894
  },
1868
1895
  [setFeatures]
1869
1896
  );
1870
1897
  const resetAll = useCallback2(() => {
1871
1898
  resetFns.current.forEach((fn) => fn());
1872
- setFeatures(
1873
- (previous) => validPlacement(previous[PLACEMENT_KEY]) ? { [PLACEMENT_KEY]: previous[PLACEMENT_KEY] } : {}
1874
- );
1899
+ setFeatures((previous) => {
1900
+ const preserved = {};
1901
+ if (validPlacement(previous[PLACEMENT_KEY])) {
1902
+ preserved[PLACEMENT_KEY] = previous[PLACEMENT_KEY];
1903
+ }
1904
+ if (Array.isArray(previous.customPresets)) {
1905
+ preserved.customPresets = previous.customPresets;
1906
+ }
1907
+ return preserved;
1908
+ });
1875
1909
  }, [setFeatures]);
1876
1910
  const registerReset = useCallback2((key, fn) => {
1877
1911
  resetFns.current.set(key, fn);
@@ -1906,6 +1940,7 @@ function AccessibilityPlugin({
1906
1940
  document.addEventListener("arap:disable-feature", handler);
1907
1941
  return () => document.removeEventListener("arap:disable-feature", handler);
1908
1942
  }, [handleDisable]);
1943
+ const effectiveLocale = locale || (typeof document !== "undefined" ? document.documentElement.lang : void 0) || void 0;
1909
1944
  useBuiltinEffects(active, handleDisable);
1910
1945
  const value = useMemo(
1911
1946
  () => ({
@@ -1923,7 +1958,7 @@ function AccessibilityPlugin({
1923
1958
  resetAll,
1924
1959
  registerReset,
1925
1960
  unregisterReset,
1926
- locale,
1961
+ locale: effectiveLocale,
1927
1962
  statementUrl,
1928
1963
  largeControls
1929
1964
  }),
@@ -1942,7 +1977,7 @@ function AccessibilityPlugin({
1942
1977
  resetAll,
1943
1978
  registerReset,
1944
1979
  unregisterReset,
1945
- locale,
1980
+ effectiveLocale,
1946
1981
  statementUrl,
1947
1982
  largeControls
1948
1983
  ]
@@ -1987,6 +2022,12 @@ function WidgetPortal({ children }) {
1987
2022
  import { useContext, useSyncExternalStore as useSyncExternalStore4 } from "react";
1988
2023
 
1989
2024
  // src/core/i18n/en.ts
2025
+ var enCornerNames = {
2026
+ "bottom-right": "bottom right",
2027
+ "bottom-left": "bottom left",
2028
+ "top-right": "top right",
2029
+ "top-left": "top left"
2030
+ };
1990
2031
  var enLocale = Object.freeze({
1991
2032
  title: "Accessibility settings",
1992
2033
  description: "Adjust your reading experience",
@@ -2016,13 +2057,199 @@ var enLocale = Object.freeze({
2016
2057
  moveDown: "Move accessibility button down",
2017
2058
  moveRight: "Move accessibility button right",
2018
2059
  largeControlsLabel: "Oversized widget controls",
2060
+ cornerNames: enCornerNames,
2019
2061
  formatPointPosition: (x, y) => `Button position: ${Math.round(x * 100)}% horizontally, ${Math.round(y * 100)}% vertically.`,
2020
- formatCornerPosition: (corner) => `Button position: ${corner.split("-").join(" ")}.`
2062
+ formatCornerPosition: (corner) => `Button position: ${corner.split("-").join(" ")}.`,
2063
+ searchPlaceholder: "Search tools or profiles...",
2064
+ searchClearLabel: "Clear search query",
2065
+ formatSearchCount: (matched, total, query) => query ? `Showing ${matched} of ${total} tools matching "${query}"` : `Showing all ${total} tools`,
2066
+ emptySearchTitle: "No matching tools found",
2067
+ emptySearchDescription: "Try adjusting your search query or reset filters.",
2068
+ clearSearchLabel: "Clear search",
2069
+ formatProfileApplied: (profileName) => `\u2713 Profile "${profileName}" applied.`,
2070
+ formatProfileReverted: () => "Reverted to custom settings.",
2071
+ formatPresetSaved: (presetName) => `Preset "${presetName}" saved successfully.`,
2072
+ formatPresetApplied: (presetName) => `Preset "${presetName}" applied.`,
2073
+ formatPresetDeleted: (presetName) => `Preset "${presetName}" deleted.`,
2074
+ decreaseTextSize: "Decrease text size",
2075
+ increaseTextSize: "Increase text size",
2076
+ features: {
2077
+ textScale: "Bigger Text",
2078
+ lineHeight: "Line Height",
2079
+ letterSpacing: "Letter Spacing",
2080
+ wordSpacing: "Word Spacing",
2081
+ paragraphSpacing: "Paragraph Spacing",
2082
+ textAlign: "Text Align",
2083
+ fontFamily: "Readable Font",
2084
+ contrast: "Contrast",
2085
+ highlightLinks: "Highlight Links",
2086
+ focusOutline: "Focus Outline",
2087
+ reduceMotion: "Reduce Motion",
2088
+ cursorGuide: "Reading Guide",
2089
+ headingsNavigator: "Page Navigator",
2090
+ profiles: "Accessibility Profiles",
2091
+ presets: "Saved Presets",
2092
+ readingMode: "Reading Mode"
2093
+ }
2094
+ });
2095
+
2096
+ // src/core/i18n/si.ts
2097
+ var siCornerNames = {
2098
+ "bottom-right": "\u0DB4\u0DC4\u0DC5 \u0DAF\u0D9A\u0DD4\u0DAB",
2099
+ "bottom-left": "\u0DB4\u0DC4\u0DC5 \u0DC0\u0DB8",
2100
+ "top-right": "\u0D89\u0DC4\u0DC5 \u0DAF\u0D9A\u0DD4\u0DAB",
2101
+ "top-left": "\u0D89\u0DC4\u0DC5 \u0DC0\u0DB8"
2102
+ };
2103
+ var siLocale = Object.freeze({
2104
+ title: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DC3\u0DD0\u0D9A\u0DC3\u0DD4\u0DB8\u0DCA",
2105
+ description: "\u0D94\u0DB6\u0DDA \u0D9A\u0DD2\u0DBA\u0DC0\u0DD3\u0DB8\u0DDA \u0D85\u0DAD\u0DCA\u0DAF\u0DD0\u0D9A\u0DD3\u0DB8 \u0DC3\u0D9A\u0DC3\u0DCF \u0D9C\u0DB1\u0DCA\u0DB1",
2106
+ closeLabel: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DC3\u0DD0\u0D9A\u0DC3\u0DD4\u0DB8\u0DCA \u0DC0\u0DC3\u0DB1\u0DCA\u0DB1",
2107
+ skipToActions: "\u0D9A\u0DCA\u0DC2\u0DAB\u0DD2\u0D9A \u0D9A\u0DCA\u200D\u0DBB\u0DD2\u0DBA\u0DCF \u0DC0\u0DD9\u0DAD \u0DB8\u0D9F \u0DC4\u0DBB\u0DD2\u0DB1\u0DCA\u0DB1",
2108
+ skipToMain: "\u0DB4\u0DCA\u200D\u0DBB\u0DB0\u0DCF\u0DB1 \u0D85\u0DB1\u0DCA\u0DAD\u0DBB\u0DCA\u0D9C\u0DAD\u0DBA \u0DC0\u0DD9\u0DAD \u0DB8\u0D9F \u0DC4\u0DBB\u0DD2\u0DB1\u0DCA\u0DB1",
2109
+ toolsLabel: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DB8\u0DD9\u0DC0\u0DBD\u0DB8\u0DCA",
2110
+ quickActionsLabel: "\u0D9A\u0DCA\u0DC2\u0DAB\u0DD2\u0D9A \u0D9A\u0DCA\u200D\u0DBB\u0DD2\u0DBA\u0DCF",
2111
+ resetLabel: "\u0DC3\u0DD2\u0DBA\u0DBD\u0DD4 \u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DC3\u0DD0\u0D9A\u0DC3\u0DD4\u0DB8\u0DCA \u0DBA\u0DC5\u0DD2 \u0DC3\u0D9A\u0DC3\u0DB1\u0DCA\u0DB1",
2112
+ resetAll: "\u0DC3\u0DD2\u0DBA\u0DBD\u0DCA\u0DBD \u0DBA\u0DC5\u0DD2 \u0DC3\u0D9A\u0DC3\u0DB1\u0DCA\u0DB1",
2113
+ statementLink: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DB4\u0DCA\u200D\u0DBB\u0D9A\u0DCF\u0DC1\u0DBA",
2114
+ openInNewTab: "\u0DB1\u0DC0 \u0DA7\u0DD0\u0DB6\u0DBA\u0D9A \u0DC0\u0DD2\u0DC0\u0DD8\u0DAD \u0DC0\u0DDA",
2115
+ creditsPrefix: "\u0DC3\u0DD0\u0DBD\u0DC3\u0DD4\u0DB8\u0DCA \u0D9A\u0DBB \u0DB1\u0DD2\u0DBB\u0DCA\u0DB8\u0DCF\u0DAB\u0DBA \u0D9A\u0DC5\u0DDA",
2116
+ creditsName: "\u0DB4\u0DCA\u200D\u0DBB\u0DB6\u0DDD\u0DAF\u0DCA",
2117
+ documentationLink: "\u0DB1\u0DD2\u0DBD \u0DBD\u0DDA\u0D9B\u0DB1\u0D9C\u0DAD \u0D9A\u0DD2\u0DBB\u0DD3\u0DB8",
2118
+ buttonTitle: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF\u0DC0",
2119
+ dragHelp: "\u0DC3\u0DCA\u0DAE\u0DCF\u0DB1\u0DBA \u0DB8\u0DCF\u0DBB\u0DD4 \u0D9A\u0DD2\u0DBB\u0DD3\u0DB8\u0DA7 \u0D85\u0DAF\u0DD2\u0DB1\u0DCA\u0DB1, \u0DB1\u0DD0\u0DAD\u0DC4\u0DDC\u0DAD\u0DCA Alt \u0DC3\u0DB8\u0D9F \u0D8A\u0DAD\u0DBD \u0DBA\u0DAD\u0DD4\u0DBB\u0DD4 \u0DB7\u0DCF\u0DC0\u0DD2\u0DAD\u0DCF \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1. \u0DA0\u0DBD\u0DB1 \u0DB8\u0DD9\u0DB1\u0DD4\u0DC0 \u0D9A\u0DCA\u0DBD\u0DD2\u0D9A\u0DCA \u0DC3\u0DC4 \u0DBA\u0DAD\u0DD4\u0DBB\u0DD4\u0DB4\u0DD4\u0DC0\u0DBB\u0DD4 \u0DB4\u0DCF\u0DBD\u0DB1 \u0DC3\u0DB4\u0DBA\u0DBA\u0DD2.",
2120
+ positionLabel: "\u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8\u0DDA \u0DB4\u0DD2\u0DC4\u0DD2\u0DA7\u0DD3\u0DB8",
2121
+ moveButton: "\u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8 \u0D9C\u0DD9\u0DB1\u0DBA\u0DB1\u0DCA\u0DB1",
2122
+ moveButtonLabel: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8 \u0D9C\u0DD9\u0DB1\u0DBA\u0DB1\u0DCA\u0DB1",
2123
+ buttonPositionSelectLabel: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8\u0DDA \u0DB4\u0DD2\u0DC4\u0DD2\u0DA7\u0DD3\u0DB8",
2124
+ customPosition: "\u0D85\u0DB7\u0DD2\u0DBB\u0DD4\u0DA0\u0DD2 \u0DB4\u0DD2\u0DC4\u0DD2\u0DA7\u0DD3\u0DB8",
2125
+ resetPosition: "\u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8\u0DDA \u0DB4\u0DD2\u0DC4\u0DD2\u0DA7\u0DD3\u0DB8 \u0DBA\u0DC5\u0DD2 \u0DC3\u0D9A\u0DC3\u0DB1\u0DCA\u0DB1",
2126
+ doneMoving: "\u0DA0\u0DBD\u0DB1\u0DBA \u0D85\u0DC0\u0DC3\u0DB1\u0DCA",
2127
+ moveLeft: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8 \u0DC0\u0DB8\u0DA7 \u0D9C\u0DD9\u0DB1\u0DBA\u0DB1\u0DCA\u0DB1",
2128
+ moveUp: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8 \u0D89\u0DC4\u0DC5\u0DA7 \u0D9C\u0DD9\u0DB1\u0DBA\u0DB1\u0DCA\u0DB1",
2129
+ moveDown: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8 \u0DB4\u0DC4\u0DC5\u0DA7 \u0D9C\u0DD9\u0DB1\u0DBA\u0DB1\u0DCA\u0DB1",
2130
+ moveRight: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8 \u0DAF\u0D9A\u0DD4\u0DAB\u0DA7 \u0D9C\u0DD9\u0DB1\u0DBA\u0DB1\u0DCA\u0DB1",
2131
+ largeControlsLabel: "\u0DC0\u0DD2\u0DC1\u0DCF\u0DBD \u0DB4\u0DCA\u200D\u0DBB\u0DB8\u0DCF\u0DAB\u0DBA\u0DDA \u0DB4\u0DCF\u0DBD\u0DB1",
2132
+ cornerNames: siCornerNames,
2133
+ formatPointPosition: (x, y) => `\u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8\u0DDA \u0DB4\u0DD2\u0DC4\u0DD2\u0DA7\u0DD3\u0DB8: \u0DAD\u0DD2\u0DBB\u0DC3\u0DCA \u0D85\u0DAD\u0DA7 ${Math.round(x * 100)}%, \u0DC3\u0DD2\u0DBB\u0DC3\u0DCA \u0D85\u0DAD\u0DA7 ${Math.round(y * 100)}%.`,
2134
+ formatCornerPosition: (corner) => {
2135
+ const translated = siCornerNames[corner] ?? corner.split("-").join(" ");
2136
+ return `\u0DB6\u0DDC\u0DAD\u0DCA\u0DAD\u0DB8\u0DDA \u0DB4\u0DD2\u0DC4\u0DD2\u0DA7\u0DD3\u0DB8: ${translated}.`;
2137
+ },
2138
+ searchPlaceholder: "\u0DB8\u0DD9\u0DC0\u0DBD\u0DB8\u0DCA \u0DC4\u0DDD \u0DB4\u0DD0\u0DAD\u0DD2\u0D9A\u0DA9 \u0DC3\u0DDC\u0DBA\u0DB1\u0DCA\u0DB1...",
2139
+ searchClearLabel: "\u0DC3\u0DD9\u0DC0\u0DD4\u0DB8 \u0DC4\u0DD2\u0DC3\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1",
2140
+ formatSearchCount: (matched, total, query) => query ? `\u0DB8\u0DD9\u0DC0\u0DBD\u0DB8\u0DCA ${total} \u0DB1\u0DCA "${query}" \u0DA7 \u0D9C\u0DD0\u0DBD\u0DB4\u0DD9\u0DB1 ${matched} \u0D9A\u0DCA \u0DB4\u0DD9\u0DB1\u0DCA\u0DC0\u0DBA\u0DD2` : `\u0DC3\u0DD2\u0DBA\u0DBD\u0DD4 \u0DB8\u0DD9\u0DC0\u0DBD\u0DB8\u0DCA ${total} \u0DB8 \u0DB4\u0DD9\u0DB1\u0DCA\u0DC0\u0DBA\u0DD2`,
2141
+ emptySearchTitle: "\u0D9C\u0DD0\u0DBD\u0DB4\u0DD9\u0DB1 \u0DB8\u0DD9\u0DC0\u0DBD\u0DB8\u0DCA \u0DC4\u0DB8\u0DD4 \u0DB1\u0DDC\u0DC0\u0DD3\u0DBA",
2142
+ emptySearchDescription: "\u0DC0\u0DD9\u0DB1\u0DAD\u0DCA \u0DC3\u0DD9\u0DC0\u0DD4\u0DB8\u0DCA \u0DB4\u0DAF\u0DBA\u0D9A\u0DCA \u0DB7\u0DCF\u0DC0\u0DD2\u0DAD\u0DCF \u0D9A\u0DBB \u0DB6\u0DBD\u0DB1\u0DCA\u0DB1 \u0DC4\u0DDD \u0DB4\u0DD9\u0DBB\u0DC4\u0DB1\u0DCA \u0DBA\u0DC5\u0DD2 \u0DC3\u0D9A\u0DC3\u0DB1\u0DCA\u0DB1.",
2143
+ clearSearchLabel: "\u0DC3\u0DD9\u0DC0\u0DD4\u0DB8 \u0DC4\u0DD2\u0DC3\u0DCA \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1",
2144
+ formatProfileApplied: (profileName) => `\u2713 "${profileName}" \u0DB4\u0DD0\u0DAD\u0DD2\u0D9A\u0DA9 \u0DC3\u0D9A\u0DCA\u200D\u0DBB\u0DD2\u0DBA \u0D9A\u0DBB\u0DB1 \u0DBD\u0DAF\u0DD3.`,
2145
+ formatProfileReverted: () => "\u0DB4\u0DD0\u0DAD\u0DD2\u0D9A\u0DA9 \u0D89\u0DC0\u0DAD\u0DCA \u0D9A\u0DBB \u0D85\u0DB7\u0DD2\u0DBB\u0DD4\u0DA0\u0DD2 \u0DC3\u0DD0\u0D9A\u0DC3\u0DD4\u0DB8\u0DCA \u0DC0\u0DD9\u0DAD \u0DB8\u0DCF\u0DBB\u0DD4 \u0DC0\u0DD2\u0DBA.",
2146
+ formatPresetSaved: (presetName) => `"${presetName}" \u0DB4\u0DD9\u0DBB\u0DC3\u0DD0\u0D9A\u0DC3\u0DD4\u0DB8 \u0DC3\u0DCF\u0DBB\u0DCA\u0DAE\u0D9A\u0DC0 \u0DC3\u0DD4\u0DBB\u0D9A\u0DD2\u0DB1 \u0DBD\u0DAF\u0DD3.`,
2147
+ formatPresetApplied: (presetName) => `"${presetName}" \u0DB4\u0DD9\u0DBB\u0DC3\u0DD0\u0D9A\u0DC3\u0DD4\u0DB8 \u0D9A\u0DCA\u200D\u0DBB\u0DD2\u0DBA\u0DCF\u0DAD\u0DCA\u0DB8\u0D9A \u0D9A\u0DBB\u0DB1 \u0DBD\u0DAF\u0DD3.`,
2148
+ formatPresetDeleted: (presetName) => `"${presetName}" \u0DB4\u0DD9\u0DBB\u0DC3\u0DD0\u0D9A\u0DC3\u0DD4\u0DB8 \u0D89\u0DC0\u0DAD\u0DCA \u0D9A\u0DBB\u0DB1 \u0DBD\u0DAF\u0DD3.`,
2149
+ decreaseTextSize: "\u0D85\u0D9A\u0DD4\u0DBB\u0DD4 \u0DB4\u0DCA\u200D\u0DBB\u0DB8\u0DCF\u0DAB\u0DBA \u0D85\u0DA9\u0DD4 \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1",
2150
+ increaseTextSize: "\u0D85\u0D9A\u0DD4\u0DBB\u0DD4 \u0DB4\u0DCA\u200D\u0DBB\u0DB8\u0DCF\u0DAB\u0DBA \u0DC0\u0DD0\u0DA9\u0DD2 \u0D9A\u0DBB\u0DB1\u0DCA\u0DB1",
2151
+ features: {
2152
+ textScale: "\u0DC0\u0DD2\u0DC1\u0DCF\u0DBD \u0D85\u0D9A\u0DD4\u0DBB\u0DD4",
2153
+ lineHeight: "\u0DB4\u0DDA\u0DC5\u0DD2 \u0DB4\u0DBB\u0DAD\u0DBB\u0DBA",
2154
+ letterSpacing: "\u0D85\u0D9A\u0DD4\u0DBB\u0DD4 \u0DB4\u0DBB\u0DAD\u0DBB\u0DBA",
2155
+ wordSpacing: "\u0DC0\u0DA0\u0DB1 \u0DB4\u0DBB\u0DAD\u0DBB\u0DBA",
2156
+ paragraphSpacing: "\u0DA1\u0DDA\u0DAF \u0DB4\u0DBB\u0DAD\u0DBB\u0DBA",
2157
+ textAlign: "\u0DB4\u0DD9\u0DC5 \u0DB4\u0DD9\u0DC5\u0D9C\u0DD0\u0DC3\u0DCA\u0DB8",
2158
+ fontFamily: "\u0DB4\u0DD0\u0DC4\u0DD0\u0DAF\u0DD2\u0DBD\u0DD2 \u0D85\u0D9A\u0DD4\u0DBB\u0DD4",
2159
+ contrast: "\u0DC0\u0DBB\u0DCA\u0DAB \u0DC0\u0DD9\u0DB1\u0DC3",
2160
+ highlightLinks: "\u0DC3\u0DB6\u0DD0\u0DB3\u0DD2 \u0D89\u0DC3\u0DCA\u0DB8\u0DAD\u0DD4 \u0D9A\u0DD2\u0DBB\u0DD3\u0DB8",
2161
+ focusOutline: "\u0DB1\u0DCF\u0DB7\u0DD2\u0D9C\u0DAD \u0DB8\u0DCF\u0DBA\u0DD2\u0DB8",
2162
+ reduceMotion: "\u0DA0\u0DBD\u0DB1\u0DBA \u0D85\u0DC0\u0DB8 \u0D9A\u0DD2\u0DBB\u0DD3\u0DB8",
2163
+ cursorGuide: "\u0D9A\u0DD2\u0DBA\u0DC0\u0DD3\u0DB8\u0DDA \u0DB8\u0D9F\u0DB4\u0DD9\u0DB1\u0DCA\u0DC0\u0DD4\u0DB8",
2164
+ headingsNavigator: "\u0DB4\u0DD2\u0DA7\u0DD4 \u0D9C\u0DC0\u0DDA\u0DC1\u0D9A\u0DBA",
2165
+ profiles: "\u0DB4\u0DCA\u200D\u0DBB\u0DC0\u0DDA\u0DC1\u0DCA\u200D\u0DBA\u0DAD\u0DCF \u0DB4\u0DD0\u0DAD\u0DD2\u0D9A\u0DA9",
2166
+ presets: "\u0DC3\u0DD4\u0DBB\u0D9A\u0DD2\u0DB1 \u0DBD\u0DAF \u0DB4\u0DD9\u0DBB\u0DC3\u0DD0\u0D9A\u0DC3\u0DD4\u0DB8\u0DCA",
2167
+ readingMode: "\u0D9A\u0DD2\u0DBA\u0DC0\u0DD3\u0DB8\u0DDA \u0DB8\u0DCF\u0DAF\u0DD2\u0DBD\u0DD2\u0DBA"
2168
+ }
2169
+ });
2170
+
2171
+ // src/core/i18n/ta.ts
2172
+ var taCornerNames = {
2173
+ "bottom-right": "\u0B95\u0BC0\u0BB4\u0BCD \u0BB5\u0BB2\u0BA4\u0BC1",
2174
+ "bottom-left": "\u0B95\u0BC0\u0BB4\u0BCD \u0B87\u0B9F\u0BA4\u0BC1",
2175
+ "top-right": "\u0BAE\u0BC7\u0BB2\u0BCD \u0BB5\u0BB2\u0BA4\u0BC1",
2176
+ "top-left": "\u0BAE\u0BC7\u0BB2\u0BCD \u0B87\u0B9F\u0BA4\u0BC1"
2177
+ };
2178
+ var taLocale = Object.freeze({
2179
+ title: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0B85\u0BAE\u0BC8\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",
2180
+ description: "\u0B89\u0B99\u0BCD\u0B95\u0BB3\u0BCD \u0BB5\u0BBE\u0B9A\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1 \u0B85\u0BA9\u0BC1\u0BAA\u0BB5\u0BA4\u0BCD\u0BA4\u0BC8 \u0BAE\u0BBE\u0BB1\u0BCD\u0BB1\u0BBF\u0BAF\u0BAE\u0BC8\u0B95\u0BCD\u0B95\u0BB5\u0BC1\u0BAE\u0BCD",
2181
+ closeLabel: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0B85\u0BAE\u0BC8\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BC8 \u0BAE\u0BC2\u0B9F\u0BC1\u0B95",
2182
+ skipToActions: "\u0BB5\u0BBF\u0BB0\u0BC8\u0BB5\u0BC1\u0B9A\u0BCD \u0B9A\u0BC6\u0BAF\u0BB2\u0BCD\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1\u0B9A\u0BCD \u0B9A\u0BC6\u0BB2\u0BCD\u0B95",
2183
+ skipToMain: "\u0BAE\u0BC1\u0B95\u0BCD\u0B95\u0BBF\u0BAF \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95\u0BA4\u0BCD\u0BA4\u0BBF\u0BB1\u0BCD\u0B95\u0BC1\u0B9A\u0BCD \u0B9A\u0BC6\u0BB2\u0BCD\u0B95",
2184
+ toolsLabel: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0B95\u0BB0\u0BC1\u0BB5\u0BBF\u0B95\u0BB3\u0BCD",
2185
+ quickActionsLabel: "\u0BB5\u0BBF\u0BB0\u0BC8\u0BB5\u0BC1\u0B9A\u0BCD \u0B9A\u0BC6\u0BAF\u0BB2\u0BCD\u0B95\u0BB3\u0BCD",
2186
+ resetLabel: "\u0B85\u0BA9\u0BC8\u0BA4\u0BCD\u0BA4\u0BC1 \u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0B85\u0BAE\u0BC8\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BC8\u0BAF\u0BC1\u0BAE\u0BCD \u0BAE\u0BC0\u0B9F\u0BCD\u0B9F\u0BAE\u0BC8",
2187
+ resetAll: "\u0B85\u0BA9\u0BC8\u0BA4\u0BCD\u0BA4\u0BC8\u0BAF\u0BC1\u0BAE\u0BCD \u0BAE\u0BC0\u0B9F\u0BCD\u0B9F\u0BAE\u0BC8",
2188
+ statementLink: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0B85\u0BB1\u0BBF\u0B95\u0BCD\u0B95\u0BC8",
2189
+ openInNewTab: "\u0BAA\u0BC1\u0BA4\u0BBF\u0BAF \u0BA4\u0BBE\u0BB5\u0BB2\u0BBF\u0BB2\u0BCD \u0BA4\u0BBF\u0BB1\u0B95\u0BCD\u0B95\u0BC1\u0BAE\u0BCD",
2190
+ creditsPrefix: "\u0BB5\u0B9F\u0BBF\u0BB5\u0BAE\u0BC8\u0BA4\u0BCD\u0BA4\u0BC1 \u0B89\u0BB0\u0BC1\u0BB5\u0BBE\u0B95\u0BCD\u0B95\u0BBF\u0BAF\u0BB5\u0BB0\u0BCD",
2191
+ creditsName: "\u0BAA\u0BBF\u0BB0\u0BAA\u0BCB\u0BA4\u0BCD",
2192
+ documentationLink: "\u0B85\u0BA4\u0BBF\u0B95\u0BBE\u0BB0\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD\u0BB5 \u0B86\u0BB5\u0BA3\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
2193
+ buttonTitle: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8",
2194
+ dragHelp: "\u0BA8\u0B95\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4 \u0B87\u0BB4\u0BC1\u0B95\u0BCD\u0B95\u0BB5\u0BC1\u0BAE\u0BCD, \u0B85\u0BB2\u0BCD\u0BB2\u0BA4\u0BC1 Alt \u0BAE\u0BB1\u0BCD\u0BB1\u0BC1\u0BAE\u0BCD \u0B85\u0BAE\u0BCD\u0BAA\u0BC1\u0B95\u0BCD\u0B95\u0BC1\u0BB1\u0BBF\u0B95\u0BB3\u0BC8\u0BAA\u0BCD \u0BAA\u0BAF\u0BA9\u0BCD\u0BAA\u0B9F\u0BC1\u0BA4\u0BCD\u0BA4\u0BB5\u0BC1\u0BAE\u0BCD. \u0BA8\u0B95\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC1 \u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BCD \u0BAE\u0BC6\u0BA9\u0BC1 \u0B95\u0BBF\u0BB3\u0BBF\u0B95\u0BCD \u0BAE\u0BB1\u0BCD\u0BB1\u0BC1\u0BAE\u0BCD \u0BB5\u0BBF\u0B9A\u0BC8\u0BAA\u0BCD\u0BAA\u0BB2\u0B95\u0BC8 \u0B95\u0B9F\u0BCD\u0B9F\u0BC1\u0BAA\u0BCD\u0BAA\u0BBE\u0B9F\u0BC1\u0B95\u0BB3\u0BC8 \u0BB5\u0BB4\u0B99\u0BCD\u0B95\u0BC1\u0B95\u0BBF\u0BB1\u0BA4\u0BC1.",
2195
+ positionLabel: "\u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BCD \u0B85\u0BAE\u0BC8\u0BB5\u0BBF\u0B9F\u0BAE\u0BCD",
2196
+ moveButton: "\u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BC8 \u0BA8\u0B95\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC1",
2197
+ moveButtonLabel: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BC8 \u0BA8\u0B95\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC1",
2198
+ buttonPositionSelectLabel: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BCD \u0B85\u0BAE\u0BC8\u0BB5\u0BBF\u0B9F\u0BAE\u0BCD",
2199
+ customPosition: "\u0BA4\u0BA9\u0BBF\u0BAA\u0BCD\u0BAA\u0BAF\u0BA9\u0BCD \u0B85\u0BAE\u0BC8\u0BB5\u0BBF\u0B9F\u0BAE\u0BCD",
2200
+ resetPosition: "\u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BCD \u0B85\u0BAE\u0BC8\u0BB5\u0BBF\u0B9F\u0BA4\u0BCD\u0BA4\u0BC8 \u0BAE\u0BC0\u0B9F\u0BCD\u0B9F\u0BAE\u0BC8",
2201
+ doneMoving: "\u0BA8\u0B95\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BA8\u0BCD\u0BA4\u0BA4\u0BC1",
2202
+ moveLeft: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BC8 \u0B87\u0B9F\u0BA4\u0BC1\u0BAA\u0BC1\u0BB1\u0BAE\u0BCD \u0BA8\u0B95\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC1",
2203
+ moveUp: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BC8 \u0BAE\u0BC7\u0BB2\u0BC7 \u0BA8\u0B95\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC1",
2204
+ moveDown: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BC8 \u0B95\u0BC0\u0BB4\u0BC7 \u0BA8\u0B95\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC1",
2205
+ moveRight: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BC8 \u0BB5\u0BB2\u0BA4\u0BC1\u0BAA\u0BC1\u0BB1\u0BAE\u0BCD \u0BA8\u0B95\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC1",
2206
+ largeControlsLabel: "\u0BAA\u0BC6\u0BB0\u0BBF\u0BAF \u0BB5\u0BBF\u0B9F\u0BCD\u0B9C\u0BC6\u0B9F\u0BCD \u0B95\u0B9F\u0BCD\u0B9F\u0BC1\u0BAA\u0BCD\u0BAA\u0BBE\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",
2207
+ cornerNames: taCornerNames,
2208
+ formatPointPosition: (x, y) => `\u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BCD \u0B85\u0BAE\u0BC8\u0BB5\u0BBF\u0B9F\u0BAE\u0BCD: \u0B95\u0BBF\u0B9F\u0BC8\u0BAE\u0B9F\u0BCD\u0B9F\u0BAE\u0BBE\u0B95 ${Math.round(x * 100)}%, \u0B9A\u0BC6\u0B99\u0BCD\u0B95\u0BC1\u0BA4\u0BCD\u0BA4\u0BBE\u0B95 ${Math.round(y * 100)}%.`,
2209
+ formatCornerPosition: (corner) => {
2210
+ const translated = taCornerNames[corner] ?? corner.split("-").join(" ");
2211
+ return `\u0BAA\u0BCA\u0BA4\u0BCD\u0BA4\u0BBE\u0BA9\u0BCD \u0B85\u0BAE\u0BC8\u0BB5\u0BBF\u0B9F\u0BAE\u0BCD: ${translated}.`;
2212
+ },
2213
+ searchPlaceholder: "\u0B95\u0BB0\u0BC1\u0BB5\u0BBF\u0B95\u0BB3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BA4\u0BC1 \u0B9A\u0BC1\u0BAF\u0BB5\u0BBF\u0BB5\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BC8\u0BA4\u0BCD \u0BA4\u0BC7\u0B9F\u0BC1\u0B95...",
2214
+ searchClearLabel: "\u0BA4\u0BC7\u0B9F\u0BB2\u0BC8 \u0B85\u0BB4\u0BBF",
2215
+ formatSearchCount: (matched, total, query) => query ? `\u0BAE\u0BCA\u0BA4\u0BCD\u0BA4\u0BAE\u0BC1\u0BB3\u0BCD\u0BB3 ${total} \u0B95\u0BB0\u0BC1\u0BB5\u0BBF\u0B95\u0BB3\u0BBF\u0BB2\u0BCD "${query}" \u0B89\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4\u0BC1\u0BAE\u0BCD ${matched} \u0B95\u0BBE\u0B9F\u0BCD\u0B9F\u0BAA\u0BCD\u0BAA\u0B9F\u0BC1\u0B95\u0BBF\u0BA9\u0BCD\u0BB1\u0BA9` : `\u0B85\u0BA9\u0BC8\u0BA4\u0BCD\u0BA4\u0BC1 ${total} \u0B95\u0BB0\u0BC1\u0BB5\u0BBF\u0B95\u0BB3\u0BC1\u0BAE\u0BCD \u0B95\u0BBE\u0B9F\u0BCD\u0B9F\u0BAA\u0BCD\u0BAA\u0B9F\u0BC1\u0B95\u0BBF\u0BA9\u0BCD\u0BB1\u0BA9`,
2216
+ emptySearchTitle: "\u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4\u0BC1\u0BAE\u0BCD \u0B95\u0BB0\u0BC1\u0BB5\u0BBF\u0B95\u0BB3\u0BCD \u0B8E\u0BA4\u0BC1\u0BB5\u0BC1\u0BAE\u0BCD \u0B95\u0BBF\u0B9F\u0BC8\u0B95\u0BCD\u0B95\u0BB5\u0BBF\u0BB2\u0BCD\u0BB2\u0BC8",
2217
+ emptySearchDescription: "\u0BB5\u0BC7\u0BB1\u0BC1 \u0BA4\u0BC7\u0B9F\u0BB2\u0BCD \u0BB5\u0BBE\u0BB0\u0BCD\u0BA4\u0BCD\u0BA4\u0BC8\u0BAF\u0BC8 \u0BAE\u0BC1\u0BAF\u0BB1\u0BCD\u0B9A\u0BBF\u0B95\u0BCD\u0B95\u0BB5\u0BC1\u0BAE\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BA4\u0BC1 \u0BB5\u0B9F\u0BBF\u0BAA\u0BCD\u0BAA\u0BBE\u0BA9\u0BCD\u0B95\u0BB3\u0BC8 \u0BAE\u0BC0\u0B9F\u0BCD\u0B9F\u0BAE\u0BC8\u0B95\u0BCD\u0B95\u0BB5\u0BC1\u0BAE\u0BCD.",
2218
+ clearSearchLabel: "\u0BA4\u0BC7\u0B9F\u0BB2\u0BC8 \u0B85\u0BB4\u0BBF",
2219
+ formatProfileApplied: (profileName) => `\u2713 "${profileName}" \u0B9A\u0BC1\u0BAF\u0BB5\u0BBF\u0BB5\u0BB0\u0BAE\u0BCD \u0B9A\u0BC6\u0BAF\u0BB2\u0BCD\u0BAA\u0B9F\u0BC1\u0BA4\u0BCD\u0BA4\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1.`,
2220
+ formatProfileReverted: () => "\u0B9A\u0BC1\u0BAF\u0BB5\u0BBF\u0BB5\u0BB0\u0BAE\u0BCD \u0B85\u0B95\u0BB1\u0BCD\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BC1 \u0BA4\u0BA9\u0BBF\u0BAA\u0BCD\u0BAA\u0BAF\u0BA9\u0BCD \u0B85\u0BAE\u0BC8\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0BAE\u0BBE\u0BB1\u0BCD\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1.",
2221
+ formatPresetSaved: (presetName) => `"${presetName}" \u0BAE\u0BC1\u0BA9\u0BCD\u0BA9\u0BAE\u0BC8\u0BB5\u0BC1 \u0BB5\u0BC6\u0BB1\u0BCD\u0BB1\u0BBF\u0B95\u0BB0\u0BAE\u0BBE\u0B95\u0B9A\u0BCD \u0B9A\u0BC7\u0BAE\u0BBF\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1.`,
2222
+ formatPresetApplied: (presetName) => `"${presetName}" \u0BAE\u0BC1\u0BA9\u0BCD\u0BA9\u0BAE\u0BC8\u0BB5\u0BC1 \u0B9A\u0BC6\u0BAF\u0BB2\u0BCD\u0BAA\u0B9F\u0BC1\u0BA4\u0BCD\u0BA4\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1.`,
2223
+ formatPresetDeleted: (presetName) => `"${presetName}" \u0BAE\u0BC1\u0BA9\u0BCD\u0BA9\u0BAE\u0BC8\u0BB5\u0BC1 \u0BA8\u0BC0\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1.`,
2224
+ decreaseTextSize: "\u0B89\u0BB0\u0BC8 \u0B85\u0BB3\u0BB5\u0BC8\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BC8\u0B95\u0BCD\u0B95\u0BB5\u0BC1\u0BAE\u0BCD",
2225
+ increaseTextSize: "\u0B89\u0BB0\u0BC8 \u0B85\u0BB3\u0BB5\u0BC8 \u0B85\u0BA4\u0BBF\u0B95\u0BB0\u0BBF\u0B95\u0BCD\u0B95\u0BB5\u0BC1\u0BAE\u0BCD",
2226
+ features: {
2227
+ textScale: "\u0BAA\u0BC6\u0BB0\u0BBF\u0BAF \u0B89\u0BB0\u0BC8",
2228
+ lineHeight: "\u0BB5\u0BB0\u0BBF \u0B87\u0B9F\u0BC8\u0BB5\u0BC6\u0BB3\u0BBF",
2229
+ letterSpacing: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1 \u0B87\u0B9F\u0BC8\u0BB5\u0BC6\u0BB3\u0BBF",
2230
+ wordSpacing: "\u0B9A\u0BCA\u0BB2\u0BCD \u0B87\u0B9F\u0BC8\u0BB5\u0BC6\u0BB3\u0BBF",
2231
+ paragraphSpacing: "\u0BAA\u0BA4\u0BCD\u0BA4\u0BBF \u0B87\u0B9F\u0BC8\u0BB5\u0BC6\u0BB3\u0BBF",
2232
+ textAlign: "\u0B89\u0BB0\u0BC8 \u0B9A\u0BC0\u0BB0\u0BAE\u0BC8\u0BAA\u0BCD\u0BAA\u0BC1",
2233
+ fontFamily: "\u0BA4\u0BC6\u0BB3\u0BBF\u0BB5\u0BBE\u0BA9 \u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0BB0\u0BC1",
2234
+ contrast: "\u0BAE\u0BBE\u0BB1\u0BC1\u0BAA\u0B9F\u0BCD\u0B9F \u0BB5\u0BA3\u0BCD\u0BA3\u0BAE\u0BCD",
2235
+ highlightLinks: "\u0B87\u0BA3\u0BC8\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BC8 \u0BAE\u0BC1\u0BA9\u0BCD\u0BA9\u0BBF\u0BB2\u0BC8\u0BAA\u0BCD\u0BAA\u0B9F\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1",
2236
+ focusOutline: "\u0B95\u0BB5\u0BA9 \u0B8E\u0BB2\u0BCD\u0BB2\u0BC8\u0B95\u0BCD\u0B95\u0BCB\u0B9F\u0BCD\u0B9F\u0BC1",
2237
+ reduceMotion: "\u0B87\u0BAF\u0B95\u0BCD\u0B95\u0BA4\u0BCD\u0BA4\u0BC8\u0B95\u0BCD \u0B95\u0BC1\u0BB1\u0BC8\u0BA4\u0BCD\u0BA4\u0BB2\u0BCD",
2238
+ cursorGuide: "\u0BB5\u0BBE\u0B9A\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1 \u0BB5\u0BB4\u0BBF\u0B95\u0BBE\u0B9F\u0BCD\u0B9F\u0BBF",
2239
+ headingsNavigator: "\u0BAA\u0B95\u0BCD\u0B95 \u0BB5\u0BB4\u0BBF\u0B95\u0BBE\u0B9F\u0BCD\u0B9F\u0BBF",
2240
+ profiles: "\u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BCD\u0BA4\u0BA9\u0BCD\u0BAE\u0BC8 \u0B9A\u0BC1\u0BAF\u0BB5\u0BBF\u0BB5\u0BB0\u0B99\u0BCD\u0B95\u0BB3\u0BCD",
2241
+ presets: "\u0B9A\u0BC7\u0BAE\u0BBF\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F \u0BAE\u0BC1\u0BA9\u0BCD\u0BA9\u0BAE\u0BC8\u0BB5\u0BC1\u0B95\u0BB3\u0BCD",
2242
+ readingMode: "\u0BB5\u0BBE\u0B9A\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1 \u0BAE\u0BC1\u0BB1\u0BC8"
2243
+ }
2021
2244
  });
2022
2245
 
2023
2246
  // src/core/i18n/index.ts
2024
2247
  var dictionaries = {
2025
- en: enLocale
2248
+ en: enLocale,
2249
+ si: siLocale,
2250
+ "si-lk": siLocale,
2251
+ ta: taLocale,
2252
+ "ta-lk": taLocale
2026
2253
  };
2027
2254
  var RTL_LOCALES = /* @__PURE__ */ new Set([
2028
2255
  "ar",
@@ -2357,7 +2584,7 @@ function PositionControls() {
2357
2584
  }),
2358
2585
  children: [
2359
2586
  /* @__PURE__ */ jsx5("option", { value: "custom", disabled: true, children: strings.customPosition }),
2360
- corners.map((corner) => /* @__PURE__ */ jsx5("option", { value: corner, children: corner.split("-").join(" ") }, corner))
2587
+ corners.map((corner) => /* @__PURE__ */ jsx5("option", { value: corner, children: strings.cornerNames?.[corner] ?? corner.split("-").join(" ") }, corner))
2361
2588
  ]
2362
2589
  }
2363
2590
  ),
@@ -2413,7 +2640,7 @@ function Panel({
2413
2640
  locale
2414
2641
  }) {
2415
2642
  const ctx = useContext4(AccessibilityContext);
2416
- const effectiveLocale = locale ?? ctx.locale;
2643
+ const effectiveLocale = locale || ctx.locale || (typeof document !== "undefined" ? document.documentElement.lang : void 0) || "en";
2417
2644
  const strings = resolveLocaleStrings(effectiveLocale);
2418
2645
  const panelTitle = title ?? strings.title;
2419
2646
  const panelDescription = description === void 0 ? strings.description : description;
@@ -2646,6 +2873,16 @@ var DEFAULT_PREFERENCES = Object.freeze({
2646
2873
  saturation: "original",
2647
2874
  tooltips: false
2648
2875
  });
2876
+ var ALL_PROFILE_IDS = [
2877
+ "motor",
2878
+ "blind",
2879
+ "color-blind",
2880
+ "dyslexia",
2881
+ "low-vision",
2882
+ "cognitive",
2883
+ "seizure",
2884
+ "adhd"
2885
+ ];
2649
2886
  var PROFILE_DEFINITIONS = {
2650
2887
  motor: {
2651
2888
  id: "motor",
@@ -2925,6 +3162,249 @@ function preferencesReducer(state, action) {
2925
3162
  }
2926
3163
  }
2927
3164
 
3165
+ // src/core/profiles.ts
3166
+ function getProfileDefinition(id) {
3167
+ return PROFILE_DEFINITIONS[id];
3168
+ }
3169
+ function mapProfileSettingsToFeatures(settings) {
3170
+ const features = {};
3171
+ if (settings.fontScale !== void 0) {
3172
+ features.fontScale = settings.fontScale;
3173
+ features.textScale = settings.fontScale;
3174
+ features.fontSize = Math.round(settings.fontScale * 100);
3175
+ }
3176
+ if (settings.lineHeight !== void 0) {
3177
+ features.lineHeight = settings.lineHeight !== null ? Math.round(settings.lineHeight * 100) : 100;
3178
+ }
3179
+ if (settings.letterSpacingEm !== void 0) {
3180
+ features.letterSpacingEm = settings.letterSpacingEm;
3181
+ }
3182
+ if (settings.wordSpacingEm !== void 0) {
3183
+ features.wordSpacingEm = settings.wordSpacingEm;
3184
+ }
3185
+ if (settings.paragraphSpacingEm !== void 0) {
3186
+ features.paragraphSpacingEm = settings.paragraphSpacingEm;
3187
+ }
3188
+ if (settings.textAlign !== void 0) {
3189
+ features.textAlign = settings.textAlign === "original" ? "default" : settings.textAlign;
3190
+ }
3191
+ if (settings.contrastMode !== void 0) {
3192
+ features.contrastMode = settings.contrastMode;
3193
+ features.contrast = settings.contrastMode;
3194
+ }
3195
+ if (settings.highlightLinks !== void 0) {
3196
+ features.linkHighlight = settings.highlightLinks;
3197
+ }
3198
+ if (settings.highlightFocus !== void 0) {
3199
+ features.highlightFocus = settings.highlightFocus;
3200
+ features.focusHighlight = settings.highlightFocus;
3201
+ }
3202
+ if (settings.reduceMotion !== void 0) {
3203
+ features.reduceMotion = settings.reduceMotion;
3204
+ }
3205
+ if (settings.hideDecorativeImages !== void 0) {
3206
+ features.hideImages = settings.hideDecorativeImages;
3207
+ }
3208
+ if (settings.fontFamily !== void 0) {
3209
+ features.fontFamily = settings.fontFamily === "original" ? "default" : settings.fontFamily;
3210
+ }
3211
+ if (settings.cursorSize !== void 0) {
3212
+ features.bigCursor = settings.cursorSize === "large";
3213
+ }
3214
+ if (settings.readerMode !== void 0) {
3215
+ if (settings.readerMode === "guide") {
3216
+ features.readingGuide = true;
3217
+ features.readingMask = false;
3218
+ } else if (settings.readerMode === "mask") {
3219
+ features.readingMask = true;
3220
+ features.readingGuide = false;
3221
+ } else {
3222
+ features.readingGuide = false;
3223
+ features.readingMask = false;
3224
+ }
3225
+ }
3226
+ if (settings.saturation !== void 0) {
3227
+ features.saturation = settings.saturation === "low" ? 1 : settings.saturation === "high" ? 2 : 0;
3228
+ }
3229
+ if (settings.tooltips !== void 0) {
3230
+ features.tooltips = settings.tooltips;
3231
+ features.accessibleTooltips = settings.tooltips;
3232
+ }
3233
+ return features;
3234
+ }
3235
+ function mapFeaturesToProfileSettings(features) {
3236
+ const result = {
3237
+ ...DEFAULT_PREFERENCES
3238
+ };
3239
+ if (typeof features.fontScale === "number") {
3240
+ result.fontScale = features.fontScale;
3241
+ } else if (typeof features.textScale === "number") {
3242
+ result.fontScale = features.textScale;
3243
+ } else if (typeof features.fontSize === "number") {
3244
+ result.fontScale = features.fontSize / 100;
3245
+ }
3246
+ if (features.lineHeight !== void 0) {
3247
+ result.lineHeight = typeof features.lineHeight === "number" ? features.lineHeight / 100 : null;
3248
+ }
3249
+ if (typeof features.contrastMode === "string") {
3250
+ result.contrastMode = features.contrastMode === "original" ? "off" : features.contrastMode;
3251
+ }
3252
+ if (features.linkHighlight !== void 0) {
3253
+ result.highlightLinks = Boolean(features.linkHighlight);
3254
+ }
3255
+ if (features.highlightFocus !== void 0 || features.focusHighlight !== void 0) {
3256
+ result.highlightFocus = Boolean(
3257
+ features.highlightFocus ?? features.focusHighlight
3258
+ );
3259
+ }
3260
+ if (features.reduceMotion !== void 0) {
3261
+ result.reduceMotion = Boolean(features.reduceMotion);
3262
+ }
3263
+ if (features.hideImages !== void 0) {
3264
+ result.hideDecorativeImages = Boolean(features.hideImages);
3265
+ }
3266
+ if (typeof features.fontFamily === "string") {
3267
+ result.fontFamily = features.fontFamily === "default" ? "original" : features.fontFamily;
3268
+ }
3269
+ if (features.bigCursor !== void 0) {
3270
+ result.cursorSize = features.bigCursor ? "large" : "original";
3271
+ }
3272
+ if (features.readingMask) {
3273
+ result.readerMode = "mask";
3274
+ } else if (features.readingGuide) {
3275
+ result.readerMode = "guide";
3276
+ } else if (features.readingMask === false || features.readingGuide === false) {
3277
+ result.readerMode = "off";
3278
+ }
3279
+ if (features.tooltips !== void 0 || features.accessibleTooltips !== void 0) {
3280
+ result.tooltips = Boolean(features.tooltips ?? features.accessibleTooltips);
3281
+ }
3282
+ return result;
3283
+ }
3284
+ function applyProfileToStore(profileId, currentFeatures, setFeatureState, existingActiveState) {
3285
+ const profile = PROFILE_DEFINITIONS[profileId];
3286
+ if (!profile) {
3287
+ throw new Error(`Unknown profile identifier: ${profileId}`);
3288
+ }
3289
+ const currentSettings = mapFeaturesToProfileSettings(currentFeatures);
3290
+ const targetSettings = profile.settings;
3291
+ const baseSnapshot = {
3292
+ ...existingActiveState?.baseSnapshot ?? {}
3293
+ };
3294
+ for (const k of Object.keys(targetSettings)) {
3295
+ if (!(k in baseSnapshot)) {
3296
+ baseSnapshot[k] = currentSettings[k];
3297
+ }
3298
+ }
3299
+ const activeProfileState = {
3300
+ profileId,
3301
+ baseSnapshot,
3302
+ overrides: {}
3303
+ };
3304
+ const targetFeatures = mapProfileSettingsToFeatures(targetSettings);
3305
+ for (const [key, val] of Object.entries(targetFeatures)) {
3306
+ try {
3307
+ setFeatureState(key, val);
3308
+ } catch {
3309
+ }
3310
+ }
3311
+ try {
3312
+ setFeatureState("activeProfile", activeProfileState);
3313
+ } catch {
3314
+ }
3315
+ return activeProfileState;
3316
+ }
3317
+ function revertProfileFromStore(activeProfileState, setFeatureState) {
3318
+ const { baseSnapshot, overrides } = activeProfileState;
3319
+ const restoredSettings = {};
3320
+ for (const [k, baseVal] of Object.entries(baseSnapshot)) {
3321
+ const key = k;
3322
+ if (key in overrides) {
3323
+ restoredSettings[key] = overrides[key];
3324
+ } else {
3325
+ restoredSettings[key] = baseVal;
3326
+ }
3327
+ }
3328
+ const restoredFeatures = mapProfileSettingsToFeatures(restoredSettings);
3329
+ for (const [key, val] of Object.entries(restoredFeatures)) {
3330
+ try {
3331
+ setFeatureState(key, val);
3332
+ } catch {
3333
+ }
3334
+ }
3335
+ try {
3336
+ setFeatureState("activeProfile", null);
3337
+ } catch {
3338
+ }
3339
+ }
3340
+ function recordProfileOverride(key, value, activeProfileState, setFeatureState) {
3341
+ if (!activeProfileState) return null;
3342
+ const nextOverrides = {
3343
+ ...activeProfileState.overrides,
3344
+ [key]: value
3345
+ };
3346
+ const nextState = {
3347
+ ...activeProfileState,
3348
+ overrides: nextOverrides
3349
+ };
3350
+ try {
3351
+ setFeatureState("activeProfile", nextState);
3352
+ } catch {
3353
+ }
3354
+ return nextState;
3355
+ }
3356
+
3357
+ // src/core/useProfiles.ts
3358
+ import { useCallback as useCallback4, useContext as useContext6 } from "react";
3359
+ function useProfiles() {
3360
+ const ctx = useContext6(AccessibilityContext);
3361
+ if (!ctx) {
3362
+ throw new Error(
3363
+ "useProfiles must be used within an <AccessibilityPlugin> provider."
3364
+ );
3365
+ }
3366
+ const { value: activeProfileState, setValue: setActiveProfileState } = useAccessibility("activeProfile", null);
3367
+ const applyProfile = useCallback4(
3368
+ (profileId) => {
3369
+ const nextState = applyProfileToStore(
3370
+ profileId,
3371
+ ctx.state.features,
3372
+ ctx.setFeatureState,
3373
+ activeProfileState
3374
+ );
3375
+ setActiveProfileState(nextState);
3376
+ },
3377
+ [
3378
+ ctx.state.features,
3379
+ ctx.setFeatureState,
3380
+ activeProfileState,
3381
+ setActiveProfileState
3382
+ ]
3383
+ );
3384
+ const revertProfile = useCallback4(() => {
3385
+ if (activeProfileState) {
3386
+ revertProfileFromStore(activeProfileState, ctx.setFeatureState);
3387
+ setActiveProfileState(null);
3388
+ }
3389
+ }, [activeProfileState, ctx.setFeatureState, setActiveProfileState]);
3390
+ const activeProfileId = activeProfileState?.profileId ?? null;
3391
+ const activeProfile = activeProfileId ? getProfileDefinition(activeProfileId) ?? null : null;
3392
+ const isProfileActive = useCallback4(
3393
+ (id) => activeProfileId === id,
3394
+ [activeProfileId]
3395
+ );
3396
+ const allProfiles = ALL_PROFILE_IDS.map((id) => PROFILE_DEFINITIONS[id]);
3397
+ return {
3398
+ profiles: allProfiles,
3399
+ activeProfileId,
3400
+ activeProfile,
3401
+ activeProfileState,
3402
+ applyProfile,
3403
+ revertProfile,
3404
+ isProfileActive
3405
+ };
3406
+ }
3407
+
2928
3408
  // src/core/FeatureIcon.tsx
2929
3409
  import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
2930
3410
  var drawings = {
@@ -2997,6 +3477,19 @@ var drawings = {
2997
3477
  /* @__PURE__ */ jsx7("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }),
2998
3478
  /* @__PURE__ */ jsx7("path", { d: "M8 9h8M8 13h5" })
2999
3479
  ] }),
3480
+ pageNavigator: /* @__PURE__ */ jsxs5(Fragment, { children: [
3481
+ /* @__PURE__ */ jsx7("circle", { cx: "12", cy: "12", r: "9" }),
3482
+ /* @__PURE__ */ jsx7("polygon", { points: "12 3 15.5 10.5 12 9 8.5 10.5 12 3", fill: "currentColor" }),
3483
+ /* @__PURE__ */ jsx7("polygon", { points: "12 21 8.5 13.5 12 15 15.5 13.5 12 21" })
3484
+ ] }),
3485
+ headings: /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M4 6v12M14 6v12M4 12h10M18 10h3M18 14h3M18 18h3" }) }),
3486
+ landmarks: /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1zM4 22v-7" }) }),
3487
+ profiles: /* @__PURE__ */ jsxs5(Fragment, { children: [
3488
+ /* @__PURE__ */ jsx7("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
3489
+ /* @__PURE__ */ jsx7("circle", { cx: "9", cy: "7", r: "4" }),
3490
+ /* @__PURE__ */ jsx7("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" })
3491
+ ] }),
3492
+ presets: /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) }),
3000
3493
  reset: /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M3 10a9 9 0 1 1 1 7M3 4v6h6" }) })
3001
3494
  };
3002
3495
  function FeatureIcon({ name }) {
@@ -3107,13 +3600,17 @@ function FontSizeController({
3107
3600
  }
3108
3601
 
3109
3602
  // src/features/TextScaleController.tsx
3603
+ import { useContext as useContext7 } from "react";
3110
3604
  import { jsx as jsx9, jsxs as jsxs7 } from "react/jsx-runtime";
3111
3605
  var FEATURE_KEY2 = "fontScale";
3112
3606
  var DEFAULT_VALUE2 = 1;
3113
3607
  function TextScaleController({
3114
3608
  steps = TEXT_SCALE_STEPS,
3115
- label = "Bigger Text"
3609
+ label
3116
3610
  } = {}) {
3611
+ const ctx = useContext7(AccessibilityContext);
3612
+ const strings = resolveLocaleStrings(ctx?.locale);
3613
+ const effectiveLabel = label ?? strings.features?.textScale ?? "Bigger Text";
3117
3614
  const { value, setValue } = useAccessibility(
3118
3615
  FEATURE_KEY2,
3119
3616
  DEFAULT_VALUE2
@@ -3143,11 +3640,11 @@ function TextScaleController({
3143
3640
  {
3144
3641
  className: "arap-feature arap-feature-stepper",
3145
3642
  role: "group",
3146
- "aria-label": label,
3643
+ "aria-label": effectiveLabel,
3147
3644
  children: [
3148
3645
  /* @__PURE__ */ jsxs7("span", { className: "arap-label", children: [
3149
3646
  /* @__PURE__ */ jsx9(FeatureIcon, { name: "fontSize" }),
3150
- /* @__PURE__ */ jsx9("span", { children: label })
3647
+ /* @__PURE__ */ jsx9("span", { children: effectiveLabel })
3151
3648
  ] }),
3152
3649
  /* @__PURE__ */ jsxs7("div", { className: "arap-controls", children: [
3153
3650
  /* @__PURE__ */ jsx9(
@@ -3156,7 +3653,7 @@ function TextScaleController({
3156
3653
  className: "arap-btn-sm",
3157
3654
  onClick: handleDecrease,
3158
3655
  disabled: isMin,
3159
- "aria-label": "Decrease text size",
3656
+ "aria-label": strings.decreaseTextSize ?? "Decrease text size",
3160
3657
  type: "button",
3161
3658
  children: "\u2212"
3162
3659
  }
@@ -3171,7 +3668,7 @@ function TextScaleController({
3171
3668
  className: "arap-btn-sm",
3172
3669
  onClick: handleIncrease,
3173
3670
  disabled: isMax,
3174
- "aria-label": "Increase text size",
3671
+ "aria-label": strings.increaseTextSize ?? "Increase text size",
3175
3672
  type: "button",
3176
3673
  children: "+"
3177
3674
  }
@@ -4383,128 +4880,1907 @@ function TooltipsController({
4383
4880
  }
4384
4881
  var AccessibleTooltipsController = TooltipsController;
4385
4882
 
4386
- // src/features/ResetController.tsx
4387
- import { createPortal as createPortal2 } from "react-dom";
4388
- import { useContext as useContext6 } from "react";
4389
- import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
4390
- function ResetController() {
4391
- const ctx = useContext6(AccessibilityContext);
4392
- if (!ctx) {
4393
- throw new Error(
4394
- "ResetController must be used within an <AccessibilityPlugin> provider."
4395
- );
4883
+ // src/features/PageNavigatorController.tsx
4884
+ import { useState as useState7, useEffect as useEffect7, useRef as useRef5, useCallback as useCallback5 } from "react";
4885
+
4886
+ // src/core/pageNavigator.ts
4887
+ var EXCLUDED_TAGS = /* @__PURE__ */ new Set([
4888
+ "SCRIPT",
4889
+ "STYLE",
4890
+ "LINK",
4891
+ "META",
4892
+ "NOSCRIPT",
4893
+ "TEMPLATE"
4894
+ ]);
4895
+ function isElementVisible(el) {
4896
+ if (el.getAttribute("aria-hidden") === "true") return false;
4897
+ if (el.getAttribute("hidden") !== null) return false;
4898
+ if (el.closest("[aria-hidden='true']")) return false;
4899
+ if (el.style.display === "none" || el.style.visibility === "hidden") {
4900
+ return false;
4396
4901
  }
4397
- const actionHost = useContext6(PanelActionsContext);
4398
- const { resetAll } = ctx;
4399
- const strings = resolveLocaleStrings(ctx.locale);
4400
- const button = /* @__PURE__ */ jsx30("div", { className: "arap-feature arap-feature-reset", children: /* @__PURE__ */ jsxs28("button", { className: "arap-reset-btn", onClick: resetAll, type: "button", children: [
4401
- /* @__PURE__ */ jsx30(FeatureIcon, { name: "reset" }),
4402
- strings.resetAll
4403
- ] }) });
4404
- return actionHost ? createPortal2(button, actionHost) : button;
4902
+ return true;
4405
4903
  }
4406
-
4407
- // src/core/controls/ToggleControl.tsx
4408
- import { jsx as jsx31 } from "react/jsx-runtime";
4409
- function ToggleControl({
4410
- id,
4411
- label,
4412
- checked,
4413
- onChange,
4414
- disabled = false,
4415
- unavailable = false,
4416
- unavailableReason,
4417
- name,
4418
- description,
4419
- largeControls = false,
4420
- className = "",
4421
- style
4422
- }) {
4423
- const isInteractive = !disabled && !unavailable;
4424
- const toggleLabel = typeof label === "string" ? label : void 0;
4425
- const handleClick = () => {
4426
- if (isInteractive) {
4427
- onChange(!checked);
4428
- }
4429
- };
4430
- return /* @__PURE__ */ jsx31(
4431
- "div",
4432
- {
4433
- className: `arap-toggle-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
4434
- style,
4435
- children: /* @__PURE__ */ jsx31(
4436
- "button",
4437
- {
4438
- id,
4439
- name,
4440
- type: "button",
4441
- className: `arap-toggle ${checked ? "arap-toggle-active" : ""}`,
4442
- role: "switch",
4443
- "aria-checked": checked,
4444
- "aria-label": toggleLabel,
4445
- "aria-disabled": !isInteractive,
4446
- disabled: !isInteractive,
4447
- onClick: handleClick,
4448
- title: unavailableReason || description || toggleLabel,
4449
- children: /* @__PURE__ */ jsx31(
4450
- "span",
4451
- {
4452
- className: "arap-toggle-knob",
4453
- style: {
4454
- transform: checked ? largeControls ? "translateX(28px)" : "translateX(24px)" : "translateX(0)"
4455
- }
4456
- }
4457
- )
4458
- }
4459
- )
4904
+ function scanHeadings(root) {
4905
+ const doc = root || (typeof document !== "undefined" ? document : null);
4906
+ if (!doc) return [];
4907
+ const candidates = doc.querySelectorAll(
4908
+ "h1, h2, h3, h4, h5, h6, [role='heading']"
4909
+ );
4910
+ const items = [];
4911
+ let index = 0;
4912
+ candidates.forEach((node) => {
4913
+ if (!(node instanceof HTMLElement)) return;
4914
+ if (EXCLUDED_TAGS.has(node.tagName)) return;
4915
+ if (node.closest("[data-arap-ui]")) return;
4916
+ if (!isElementVisible(node)) return;
4917
+ let level = 2;
4918
+ const match = node.tagName.match(/^H([1-6])$/i);
4919
+ if (match) {
4920
+ level = parseInt(match[1], 10);
4921
+ } else if (node.getAttribute("role") === "heading") {
4922
+ const ariaLevel = parseInt(node.getAttribute("aria-level") || "2", 10);
4923
+ level = Math.max(1, Math.min(6, isNaN(ariaLevel) ? 2 : ariaLevel));
4460
4924
  }
4925
+ const text = node.getAttribute("aria-label")?.trim() || node.textContent?.trim() || "";
4926
+ if (!text) return;
4927
+ items.push({
4928
+ id: node.id || `arap-heading-${++index}`,
4929
+ level,
4930
+ text,
4931
+ element: node
4932
+ });
4933
+ });
4934
+ return items;
4935
+ }
4936
+ var LANDMARK_TAGS = {
4937
+ HEADER: "banner",
4938
+ NAV: "navigation",
4939
+ MAIN: "main",
4940
+ ASIDE: "complementary",
4941
+ FOOTER: "contentinfo",
4942
+ FORM: "form",
4943
+ SECTION: "region"
4944
+ };
4945
+ var LANDMARK_TITLES = {
4946
+ banner: "Header (Banner)",
4947
+ navigation: "Navigation",
4948
+ main: "Main Content",
4949
+ complementary: "Sidebar (Complementary)",
4950
+ contentinfo: "Footer (Content Info)",
4951
+ search: "Search",
4952
+ region: "Region",
4953
+ form: "Form"
4954
+ };
4955
+ function isScopedHeaderOrFooter(el) {
4956
+ const parentSection = el.parentElement?.closest(
4957
+ "article, aside, main, nav, section"
4958
+ );
4959
+ return Boolean(parentSection && !parentSection.closest("[data-arap-ui]"));
4960
+ }
4961
+ function scanLandmarks(root) {
4962
+ const doc = root || (typeof document !== "undefined" ? document : null);
4963
+ if (!doc) return [];
4964
+ const candidates = doc.querySelectorAll(
4965
+ "header, nav, main, aside, footer, form[role='search'], [role='banner'], [role='navigation'], [role='main'], [role='complementary'], [role='contentinfo'], [role='search'], [role='region'][aria-label], [role='region'][aria-labelledby], section[aria-label], section[aria-labelledby], a[id]:not([href]), a[name]"
4461
4966
  );
4967
+ const items = [];
4968
+ let index = 0;
4969
+ candidates.forEach((node) => {
4970
+ if (!(node instanceof HTMLElement)) return;
4971
+ if (EXCLUDED_TAGS.has(node.tagName)) return;
4972
+ if (node.closest("[data-arap-ui]")) return;
4973
+ if (!isElementVisible(node)) return;
4974
+ let type = "";
4975
+ const explicitRole = node.getAttribute("role");
4976
+ if (explicitRole && [
4977
+ "banner",
4978
+ "navigation",
4979
+ "main",
4980
+ "complementary",
4981
+ "contentinfo",
4982
+ "search",
4983
+ "region",
4984
+ "form"
4985
+ ].includes(explicitRole)) {
4986
+ type = explicitRole;
4987
+ } else if (node.tagName in LANDMARK_TAGS) {
4988
+ if ((node.tagName === "HEADER" || node.tagName === "FOOTER") && isScopedHeaderOrFooter(node)) {
4989
+ return;
4990
+ }
4991
+ type = LANDMARK_TAGS[node.tagName];
4992
+ } else if (node.tagName === "A" && (node.id || node.getAttribute("name"))) {
4993
+ type = "anchor";
4994
+ }
4995
+ if (!type) return;
4996
+ let label = node.getAttribute("aria-label")?.trim() || "";
4997
+ if (!label && node.getAttribute("aria-labelledby")) {
4998
+ const labelId = node.getAttribute("aria-labelledby").trim();
4999
+ const labelEl = document.getElementById(labelId);
5000
+ if (labelEl) {
5001
+ label = labelEl.textContent?.trim() || "";
5002
+ }
5003
+ }
5004
+ if (!label) {
5005
+ if (type === "anchor") {
5006
+ label = node.textContent?.trim() || node.id || node.getAttribute("name") || "Named Anchor";
5007
+ } else {
5008
+ label = LANDMARK_TITLES[type] || type.charAt(0).toUpperCase() + type.slice(1);
5009
+ }
5010
+ }
5011
+ items.push({
5012
+ id: node.id || `arap-landmark-${++index}`,
5013
+ type,
5014
+ label,
5015
+ element: node
5016
+ });
5017
+ });
5018
+ return items;
5019
+ }
5020
+ function navigateToElement(element, options = {}) {
5021
+ if (!element || !element.isConnected) return;
5022
+ const isNaturallyFocusable = element instanceof HTMLAnchorElement || element instanceof HTMLButtonElement || element instanceof HTMLInputElement || element instanceof HTMLSelectElement || element instanceof HTMLTextAreaElement || element.hasAttribute("tabindex");
5023
+ const hadTabIndex = element.hasAttribute("tabindex");
5024
+ const previousTabIndex = element.getAttribute("tabindex");
5025
+ if (!isNaturallyFocusable) {
5026
+ element.setAttribute("tabindex", "-1");
5027
+ }
5028
+ const isReduced = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
5029
+ const behavior = options.behavior ?? (isReduced ? "auto" : "smooth");
5030
+ element.scrollIntoView({ behavior, block: "start" });
5031
+ element.focus();
5032
+ if (!isNaturallyFocusable) {
5033
+ const handleBlur = () => {
5034
+ if (hadTabIndex && previousTabIndex !== null) {
5035
+ element.setAttribute("tabindex", previousTabIndex);
5036
+ } else {
5037
+ element.removeAttribute("tabindex");
5038
+ }
5039
+ element.removeEventListener("blur", handleBlur);
5040
+ };
5041
+ element.addEventListener("blur", handleBlur, { once: true });
5042
+ }
5043
+ options.onComplete?.();
5044
+ }
5045
+ function subscribePageStructure(callback) {
5046
+ if (typeof MutationObserver === "undefined" || typeof document === "undefined" || !document.body) {
5047
+ return () => {
5048
+ };
5049
+ }
5050
+ let timer = null;
5051
+ const observer = new MutationObserver((mutations) => {
5052
+ const isExternal = mutations.some((m) => {
5053
+ const target = m.target;
5054
+ if (target instanceof Element && target.closest("[data-arap-ui]")) {
5055
+ return false;
5056
+ }
5057
+ return [...m.addedNodes, ...m.removedNodes].some((node) => {
5058
+ return !(node instanceof Element && node.closest("[data-arap-ui]"));
5059
+ });
5060
+ });
5061
+ if (!isExternal) return;
5062
+ if (timer) clearTimeout(timer);
5063
+ timer = setTimeout(() => {
5064
+ callback();
5065
+ }, 100);
5066
+ });
5067
+ observer.observe(document.body, { childList: true, subtree: true });
5068
+ return () => {
5069
+ if (timer) clearTimeout(timer);
5070
+ observer.disconnect();
5071
+ };
4462
5072
  }
4463
5073
 
4464
- // src/core/controls/ChoiceControl.tsx
4465
- import { useCallback as useCallback4, useMemo as useMemo2, useRef as useRef5 } from "react";
4466
- import { jsx as jsx32, jsxs as jsxs29 } from "react/jsx-runtime";
4467
- function ChoiceControl({
4468
- id,
4469
- label,
4470
- value,
4471
- options,
4472
- groups,
4473
- onChange,
4474
- disabled = false,
4475
- largeControls = false,
5074
+ // src/features/PageNavigatorController.tsx
5075
+ import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
5076
+ function PageNavigatorController({
4476
5077
  className = "",
4477
- style,
4478
- orientation = "horizontal"
5078
+ label = "Page Navigator",
5079
+ description = "Explore headings and landmarks",
5080
+ closeOnNavigate = false
4479
5081
  }) {
4480
- const containerRef = useRef5(null);
4481
- const allOptions = useMemo2(
4482
- () => groups ? groups.flatMap((g) => g.options) : options || [],
4483
- [groups, options]
5082
+ const [isOpen, setIsOpen] = useState7(false);
5083
+ const [activeTab, setActiveTab] = useState7(
5084
+ "headings"
4484
5085
  );
4485
- const handleKeyDown = useCallback4(
4486
- (e) => {
4487
- if (disabled || allOptions.length === 0) return;
4488
- const enabledOptions = allOptions.filter((opt) => !opt.disabled);
4489
- const currentIndex = enabledOptions.findIndex(
4490
- (opt) => opt.value === value
4491
- );
4492
- let nextIndex = -1;
4493
- if (e.key === "ArrowRight" || e.key === "ArrowDown") {
4494
- e.preventDefault();
4495
- nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % enabledOptions.length;
4496
- } else if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
4497
- e.preventDefault();
4498
- nextIndex = currentIndex === -1 ? enabledOptions.length - 1 : (currentIndex - 1 + enabledOptions.length) % enabledOptions.length;
4499
- } else if (e.key === "Home") {
4500
- e.preventDefault();
4501
- nextIndex = 0;
4502
- } else if (e.key === "End") {
4503
- e.preventDefault();
4504
- nextIndex = enabledOptions.length - 1;
5086
+ const [headings, setHeadings] = useState7([]);
5087
+ const [landmarks, setLandmarks] = useState7([]);
5088
+ const [search, setSearch] = useState7("");
5089
+ const triggerRef = useRef5(null);
5090
+ const dialogRef = useRef5(null);
5091
+ const refreshStructure = useCallback5(() => {
5092
+ setHeadings(scanHeadings());
5093
+ setLandmarks(scanLandmarks());
5094
+ }, []);
5095
+ const handleOpen = () => {
5096
+ refreshStructure();
5097
+ setIsOpen(true);
5098
+ };
5099
+ const handleClose = () => {
5100
+ setIsOpen(false);
5101
+ triggerRef.current?.focus();
5102
+ };
5103
+ useEffect7(() => {
5104
+ if (!isOpen) return;
5105
+ return subscribePageStructure(refreshStructure);
5106
+ }, [isOpen, refreshStructure]);
5107
+ useEffect7(() => {
5108
+ if (isOpen) {
5109
+ dialogRef.current?.focus();
5110
+ }
5111
+ }, [isOpen]);
5112
+ const handleNavigate = (element) => {
5113
+ navigateToElement(element, {
5114
+ onComplete: () => {
5115
+ if (closeOnNavigate) {
5116
+ setIsOpen(false);
5117
+ }
4505
5118
  }
4506
- if (nextIndex !== -1 && enabledOptions[nextIndex]) {
4507
- onChange(enabledOptions[nextIndex].value);
5119
+ });
5120
+ };
5121
+ const filteredHeadings = search.trim() ? headings.filter(
5122
+ (h) => h.text.toLowerCase().includes(search.toLowerCase())
5123
+ ) : headings;
5124
+ const filteredLandmarks = search.trim() ? landmarks.filter(
5125
+ (l) => l.label.toLowerCase().includes(search.toLowerCase())
5126
+ ) : landmarks;
5127
+ return /* @__PURE__ */ jsxs28(
5128
+ "div",
5129
+ {
5130
+ className: `arap-feature arap-feature-expandable ${className}`,
5131
+ role: "group",
5132
+ "aria-label": label,
5133
+ children: [
5134
+ /* @__PURE__ */ jsxs28(
5135
+ "div",
5136
+ {
5137
+ style: {
5138
+ display: "flex",
5139
+ alignItems: "center",
5140
+ justifyContent: "space-between",
5141
+ width: "100%"
5142
+ },
5143
+ children: [
5144
+ /* @__PURE__ */ jsxs28("span", { className: "arap-label", children: [
5145
+ /* @__PURE__ */ jsx30(FeatureIcon, { name: "pageNavigator" }),
5146
+ /* @__PURE__ */ jsxs28("span", { children: [
5147
+ /* @__PURE__ */ jsx30("span", { style: { display: "block" }, children: label }),
5148
+ description && /* @__PURE__ */ jsx30(
5149
+ "span",
5150
+ {
5151
+ style: {
5152
+ display: "block",
5153
+ fontSize: "11px",
5154
+ fontWeight: 400,
5155
+ color: "var(--arap-muted, #64748b)",
5156
+ marginTop: "1px"
5157
+ },
5158
+ children: description
5159
+ }
5160
+ )
5161
+ ] })
5162
+ ] }),
5163
+ /* @__PURE__ */ jsx30(
5164
+ "button",
5165
+ {
5166
+ ref: triggerRef,
5167
+ className: "arap-btn-sm",
5168
+ type: "button",
5169
+ "aria-expanded": isOpen,
5170
+ "aria-controls": "arap-page-navigator-dialog",
5171
+ onClick: () => {
5172
+ if (isOpen) {
5173
+ handleClose();
5174
+ } else {
5175
+ handleOpen();
5176
+ }
5177
+ },
5178
+ children: isOpen ? "Close" : "Explore"
5179
+ }
5180
+ )
5181
+ ]
5182
+ }
5183
+ ),
5184
+ isOpen && /* @__PURE__ */ jsxs28(
5185
+ "div",
5186
+ {
5187
+ ref: dialogRef,
5188
+ id: "arap-page-navigator-dialog",
5189
+ className: "arap-navigator-dialog",
5190
+ role: "region",
5191
+ "aria-label": "Page Structure Explorer",
5192
+ tabIndex: -1,
5193
+ onKeyDown: (event) => {
5194
+ if (event.key === "Escape") {
5195
+ event.stopPropagation();
5196
+ handleClose();
5197
+ }
5198
+ },
5199
+ children: [
5200
+ /* @__PURE__ */ jsxs28(
5201
+ "div",
5202
+ {
5203
+ className: "arap-navigator-tabs",
5204
+ role: "tablist",
5205
+ "aria-label": "Structure views",
5206
+ children: [
5207
+ /* @__PURE__ */ jsxs28(
5208
+ "button",
5209
+ {
5210
+ id: "arap-tab-headings",
5211
+ className: `arap-navigator-tab ${activeTab === "headings" ? "arap-navigator-tab-active" : ""}`,
5212
+ role: "tab",
5213
+ "aria-selected": activeTab === "headings",
5214
+ "aria-controls": "arap-panel-headings",
5215
+ type: "button",
5216
+ onClick: () => setActiveTab("headings"),
5217
+ onKeyDown: (e) => {
5218
+ if (e.key === "ArrowRight") {
5219
+ document.getElementById("arap-tab-landmarks")?.focus();
5220
+ setActiveTab("landmarks");
5221
+ }
5222
+ },
5223
+ children: [
5224
+ /* @__PURE__ */ jsx30(FeatureIcon, { name: "headings" }),
5225
+ /* @__PURE__ */ jsxs28("span", { children: [
5226
+ "Headings (",
5227
+ headings.length,
5228
+ ")"
5229
+ ] })
5230
+ ]
5231
+ }
5232
+ ),
5233
+ /* @__PURE__ */ jsxs28(
5234
+ "button",
5235
+ {
5236
+ id: "arap-tab-landmarks",
5237
+ className: `arap-navigator-tab ${activeTab === "landmarks" ? "arap-navigator-tab-active" : ""}`,
5238
+ role: "tab",
5239
+ "aria-selected": activeTab === "landmarks",
5240
+ "aria-controls": "arap-panel-landmarks",
5241
+ type: "button",
5242
+ onClick: () => setActiveTab("landmarks"),
5243
+ onKeyDown: (e) => {
5244
+ if (e.key === "ArrowLeft") {
5245
+ document.getElementById("arap-tab-headings")?.focus();
5246
+ setActiveTab("headings");
5247
+ }
5248
+ },
5249
+ children: [
5250
+ /* @__PURE__ */ jsx30(FeatureIcon, { name: "landmarks" }),
5251
+ /* @__PURE__ */ jsxs28("span", { children: [
5252
+ "Landmarks (",
5253
+ landmarks.length,
5254
+ ")"
5255
+ ] })
5256
+ ]
5257
+ }
5258
+ )
5259
+ ]
5260
+ }
5261
+ ),
5262
+ /* @__PURE__ */ jsx30("div", { className: "arap-navigator-search-box", children: /* @__PURE__ */ jsx30(
5263
+ "input",
5264
+ {
5265
+ type: "search",
5266
+ className: "arap-navigator-search",
5267
+ placeholder: `Filter ${activeTab}...`,
5268
+ value: search,
5269
+ onChange: (e) => setSearch(e.target.value),
5270
+ "aria-label": `Filter ${activeTab}`
5271
+ }
5272
+ ) }),
5273
+ /* @__PURE__ */ jsxs28("div", { className: "arap-navigator-content", children: [
5274
+ activeTab === "headings" && /* @__PURE__ */ jsx30(
5275
+ "div",
5276
+ {
5277
+ id: "arap-panel-headings",
5278
+ role: "tabpanel",
5279
+ "aria-labelledby": "arap-tab-headings",
5280
+ children: filteredHeadings.length === 0 ? /* @__PURE__ */ jsx30("div", { className: "arap-navigator-empty", role: "status", children: headings.length === 0 ? "No headings found on this page." : "No matching headings." }) : /* @__PURE__ */ jsx30("ul", { className: "arap-navigator-list", role: "list", children: filteredHeadings.map((h, i) => /* @__PURE__ */ jsx30("li", { className: "arap-navigator-item", children: /* @__PURE__ */ jsxs28(
5281
+ "button",
5282
+ {
5283
+ type: "button",
5284
+ className: "arap-navigator-jump-btn",
5285
+ style: {
5286
+ paddingLeft: `${Math.max(8, (h.level - 1) * 12 + 8)}px`
5287
+ },
5288
+ onClick: () => handleNavigate(h.element),
5289
+ children: [
5290
+ /* @__PURE__ */ jsxs28(
5291
+ "span",
5292
+ {
5293
+ className: "arap-navigator-badge arap-navigator-badge-h",
5294
+ "aria-hidden": "true",
5295
+ children: [
5296
+ "H",
5297
+ h.level
5298
+ ]
5299
+ }
5300
+ ),
5301
+ /* @__PURE__ */ jsx30("span", { className: "arap-navigator-item-text", children: h.text })
5302
+ ]
5303
+ }
5304
+ ) }, `${h.id}-${i}`)) })
5305
+ }
5306
+ ),
5307
+ activeTab === "landmarks" && /* @__PURE__ */ jsx30(
5308
+ "div",
5309
+ {
5310
+ id: "arap-panel-landmarks",
5311
+ role: "tabpanel",
5312
+ "aria-labelledby": "arap-tab-landmarks",
5313
+ children: filteredLandmarks.length === 0 ? /* @__PURE__ */ jsx30("div", { className: "arap-navigator-empty", role: "status", children: landmarks.length === 0 ? "No landmarks found on this page." : "No matching landmarks." }) : /* @__PURE__ */ jsx30("ul", { className: "arap-navigator-list", role: "list", children: filteredLandmarks.map((l, i) => /* @__PURE__ */ jsx30("li", { className: "arap-navigator-item", children: /* @__PURE__ */ jsxs28(
5314
+ "button",
5315
+ {
5316
+ type: "button",
5317
+ className: "arap-navigator-jump-btn",
5318
+ onClick: () => handleNavigate(l.element),
5319
+ children: [
5320
+ /* @__PURE__ */ jsx30(
5321
+ "span",
5322
+ {
5323
+ className: "arap-navigator-badge arap-navigator-badge-l",
5324
+ "aria-hidden": "true",
5325
+ children: l.type.toUpperCase()
5326
+ }
5327
+ ),
5328
+ /* @__PURE__ */ jsx30("span", { className: "arap-navigator-item-text", children: l.label })
5329
+ ]
5330
+ }
5331
+ ) }, `${l.id}-${i}`)) })
5332
+ }
5333
+ )
5334
+ ] })
5335
+ ]
5336
+ }
5337
+ )
5338
+ ]
5339
+ }
5340
+ );
5341
+ }
5342
+ var HeadingsNavigatorController = PageNavigatorController;
5343
+ var PageStructureController = PageNavigatorController;
5344
+
5345
+ // src/features/ProfilesController.tsx
5346
+ import { useContext as useContext9, useId as useId2, useMemo as useMemo2, useRef as useRef6, useState as useState8 } from "react";
5347
+
5348
+ // src/core/controls/ProfilePreviewCard.tsx
5349
+ import { jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
5350
+ function ProfilePreviewCard({
5351
+ profile,
5352
+ isActive,
5353
+ onApply,
5354
+ onRevert,
5355
+ largeControls = false,
5356
+ className = "",
5357
+ style
5358
+ }) {
5359
+ const affectedKeys = Object.keys(
5360
+ profile.settings
5361
+ );
5362
+ const formatKeyName = (key) => {
5363
+ switch (key) {
5364
+ case "fontScale":
5365
+ return "Font Size";
5366
+ case "lineHeight":
5367
+ return "Line Height";
5368
+ case "contrastMode":
5369
+ return "Contrast";
5370
+ case "reduceMotion":
5371
+ return "Reduce Motion";
5372
+ case "textAlign":
5373
+ return "Text Align";
5374
+ case "highlightLinks":
5375
+ return "Highlight Links";
5376
+ case "highlightFocus":
5377
+ return "Highlight Focus";
5378
+ case "cursorSize":
5379
+ return "Cursor Size";
5380
+ case "readerMode":
5381
+ return "Reading Mode";
5382
+ case "saturation":
5383
+ return "Saturation";
5384
+ case "hideDecorativeImages":
5385
+ return "Hide Images";
5386
+ default:
5387
+ return key.replace(/([A-Z])/g, " $1").trim();
5388
+ }
5389
+ };
5390
+ const formatSettingValue = (key, val) => {
5391
+ if (typeof val === "boolean") return val ? "On" : "Off";
5392
+ if (key === "fontScale" && typeof val === "number")
5393
+ return `${Math.round(val * 100)}%`;
5394
+ if (key === "lineHeight" && typeof val === "number")
5395
+ return `${Math.round(val * 100)}%`;
5396
+ if (val === null || val === void 0) return "Original";
5397
+ return String(val);
5398
+ };
5399
+ return /* @__PURE__ */ jsxs29(
5400
+ "div",
5401
+ {
5402
+ role: "group",
5403
+ "aria-label": `${profile.label} profile`,
5404
+ className: `arap-profile-card ${isActive ? "arap-profile-card-active" : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
5405
+ style,
5406
+ children: [
5407
+ /* @__PURE__ */ jsxs29("div", { className: "arap-profile-header", children: [
5408
+ /* @__PURE__ */ jsxs29("div", { className: "arap-profile-title-row", children: [
5409
+ /* @__PURE__ */ jsx31("h4", { className: "arap-profile-title", children: profile.label }),
5410
+ isActive && /* @__PURE__ */ jsx31(
5411
+ "span",
5412
+ {
5413
+ className: "arap-profile-active-badge",
5414
+ "aria-label": "Active profile",
5415
+ children: "\u2713 Active"
5416
+ }
5417
+ )
5418
+ ] }),
5419
+ /* @__PURE__ */ jsx31("p", { className: "arap-profile-desc", children: profile.description })
5420
+ ] }),
5421
+ /* @__PURE__ */ jsxs29("div", { className: "arap-profile-affected", children: [
5422
+ /* @__PURE__ */ jsx31("span", { className: "arap-profile-affected-label", children: "Affected settings:" }),
5423
+ /* @__PURE__ */ jsx31("div", { className: "arap-profile-chips", children: affectedKeys.map((key) => {
5424
+ const val = profile.settings[key];
5425
+ return /* @__PURE__ */ jsxs29("span", { className: "arap-profile-chip", children: [
5426
+ /* @__PURE__ */ jsxs29("strong", { children: [
5427
+ formatKeyName(key),
5428
+ ":"
5429
+ ] }),
5430
+ " ",
5431
+ formatSettingValue(key, val)
5432
+ ] }, key);
5433
+ }) })
5434
+ ] }),
5435
+ /* @__PURE__ */ jsx31("div", { className: "arap-profile-actions", children: isActive ? /* @__PURE__ */ jsx31(
5436
+ "button",
5437
+ {
5438
+ type: "button",
5439
+ className: "arap-profile-revert-btn",
5440
+ onClick: onRevert,
5441
+ "aria-label": `Revert ${profile.label} profile`,
5442
+ children: "Revert to custom settings"
5443
+ }
5444
+ ) : /* @__PURE__ */ jsx31(
5445
+ "button",
5446
+ {
5447
+ type: "button",
5448
+ className: "arap-profile-apply-btn",
5449
+ onClick: () => onApply(profile),
5450
+ "aria-label": `Apply ${profile.label} profile`,
5451
+ children: "Apply Profile"
5452
+ }
5453
+ ) })
5454
+ ]
5455
+ }
5456
+ );
5457
+ }
5458
+
5459
+ // src/core/controls/FeatureStatusState.tsx
5460
+ import { useContext as useContext8 } from "react";
5461
+ import { jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
5462
+ function SearchCount({
5463
+ totalCount,
5464
+ matchedCount,
5465
+ query,
5466
+ className = "",
5467
+ style,
5468
+ locale
5469
+ }) {
5470
+ const ctx = useContext8(AccessibilityContext);
5471
+ const strings = resolveLocaleStrings(locale ?? ctx?.locale);
5472
+ const text = strings.formatSearchCount ? strings.formatSearchCount(matchedCount, totalCount, query) : query ? `Showing ${matchedCount} of ${totalCount} tools matching "${query}"` : `Showing all ${totalCount} tools`;
5473
+ return /* @__PURE__ */ jsx32(
5474
+ "div",
5475
+ {
5476
+ role: "status",
5477
+ "aria-live": "polite",
5478
+ className: `arap-search-count ${className}`,
5479
+ style,
5480
+ children: text
5481
+ }
5482
+ );
5483
+ }
5484
+ function EmptyState({
5485
+ title,
5486
+ description,
5487
+ actionLabel,
5488
+ onAction,
5489
+ icon,
5490
+ className = "",
5491
+ style,
5492
+ locale
5493
+ }) {
5494
+ const ctx = useContext8(AccessibilityContext);
5495
+ const strings = resolveLocaleStrings(locale ?? ctx?.locale);
5496
+ const resolvedTitle = title ?? strings.emptySearchTitle ?? "No matching tools found";
5497
+ const resolvedDescription = description ?? strings.emptySearchDescription ?? "Try adjusting your search query or reset filters.";
5498
+ const resolvedActionLabel = actionLabel ?? strings.clearSearchLabel ?? "Clear search";
5499
+ return /* @__PURE__ */ jsxs30(
5500
+ "div",
5501
+ {
5502
+ role: "status",
5503
+ className: `arap-empty-state ${className}`,
5504
+ style,
5505
+ children: [
5506
+ /* @__PURE__ */ jsx32("div", { className: "arap-empty-icon", "aria-hidden": "true", children: icon ?? "\u{1F50D}" }),
5507
+ /* @__PURE__ */ jsx32("h3", { className: "arap-empty-title", children: resolvedTitle }),
5508
+ /* @__PURE__ */ jsx32("p", { className: "arap-empty-desc", children: resolvedDescription }),
5509
+ onAction && /* @__PURE__ */ jsx32("button", { type: "button", className: "arap-empty-btn", onClick: onAction, children: resolvedActionLabel })
5510
+ ]
5511
+ }
5512
+ );
5513
+ }
5514
+ function ErrorState({
5515
+ title = "Something went wrong",
5516
+ message,
5517
+ onRetry,
5518
+ retryLabel = "Try again",
5519
+ className = "",
5520
+ style
5521
+ }) {
5522
+ return /* @__PURE__ */ jsxs30(
5523
+ "div",
5524
+ {
5525
+ role: "alert",
5526
+ className: `arap-error-state arap-card-alert arap-card-error ${className}`,
5527
+ style,
5528
+ children: [
5529
+ /* @__PURE__ */ jsx32("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
5530
+ /* @__PURE__ */ jsxs30("div", { className: "arap-error-content", children: [
5531
+ title && /* @__PURE__ */ jsx32("h4", { className: "arap-error-title", children: title }),
5532
+ /* @__PURE__ */ jsx32("p", { className: "arap-error-message", children: message }),
5533
+ onRetry && /* @__PURE__ */ jsx32("button", { type: "button", className: "arap-retry-btn", onClick: onRetry, children: retryLabel })
5534
+ ] })
5535
+ ]
5536
+ }
5537
+ );
5538
+ }
5539
+
5540
+ // src/features/ProfilesController.tsx
5541
+ import { jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
5542
+ function ProfilesController({
5543
+ className = "",
5544
+ label,
5545
+ description = "Explore suggested preference combinations",
5546
+ largeControls = false,
5547
+ onProfileChange
5548
+ }) {
5549
+ const ctx = useContext9(AccessibilityContext);
5550
+ const strings = resolveLocaleStrings(ctx?.locale);
5551
+ const effectiveLabel = label ?? strings.features?.profiles ?? "Accessibility Profiles";
5552
+ const [isOpen, setIsOpen] = useState8(false);
5553
+ const [search, setSearch] = useState8("");
5554
+ const dialogId = "arap-profiles-dialog";
5555
+ const searchInputId = useId2();
5556
+ const triggerRef = useRef6(null);
5557
+ const {
5558
+ profiles,
5559
+ activeProfile,
5560
+ activeProfileState,
5561
+ applyProfile,
5562
+ revertProfile,
5563
+ isProfileActive
5564
+ } = useProfiles();
5565
+ const handleApply = (profileId) => {
5566
+ applyProfile(profileId);
5567
+ onProfileChange?.(profileId);
5568
+ };
5569
+ const handleRevert = () => {
5570
+ revertProfile();
5571
+ onProfileChange?.(null);
5572
+ };
5573
+ const filteredProfiles = useMemo2(() => {
5574
+ const q = search.trim().toLowerCase();
5575
+ if (!q) return profiles;
5576
+ return profiles.filter((p) => {
5577
+ const nameMatch = p.label.toLowerCase().includes(q);
5578
+ const descMatch = p.description.toLowerCase().includes(q);
5579
+ const settingMatch = Object.keys(p.settings).some(
5580
+ (k) => k.toLowerCase().includes(q)
5581
+ );
5582
+ return nameMatch || descMatch || settingMatch;
5583
+ });
5584
+ }, [profiles, search]);
5585
+ const hasOverrides = Boolean(activeProfileState?.overrides) && Object.keys(activeProfileState?.overrides ?? {}).length > 0;
5586
+ return /* @__PURE__ */ jsxs31(
5587
+ "div",
5588
+ {
5589
+ className: `arap-feature arap-feature-expandable ${largeControls ? "arap-large-controls" : ""} ${className}`,
5590
+ role: "group",
5591
+ "aria-label": effectiveLabel,
5592
+ children: [
5593
+ /* @__PURE__ */ jsxs31(
5594
+ "div",
5595
+ {
5596
+ style: {
5597
+ display: "flex",
5598
+ alignItems: "center",
5599
+ justifyContent: "space-between",
5600
+ width: "100%"
5601
+ },
5602
+ children: [
5603
+ /* @__PURE__ */ jsxs31("span", { className: "arap-label", children: [
5604
+ /* @__PURE__ */ jsx33(FeatureIcon, { name: "profiles" }),
5605
+ /* @__PURE__ */ jsxs31("span", { children: [
5606
+ /* @__PURE__ */ jsx33("span", { style: { display: "block" }, children: effectiveLabel }),
5607
+ description && /* @__PURE__ */ jsx33(
5608
+ "span",
5609
+ {
5610
+ style: {
5611
+ display: "block",
5612
+ fontSize: "11px",
5613
+ fontWeight: 400,
5614
+ color: "var(--arap-muted, #64748b)",
5615
+ marginTop: "1px"
5616
+ },
5617
+ children: activeProfile ? /* @__PURE__ */ jsxs31(
5618
+ "span",
5619
+ {
5620
+ style: {
5621
+ color: "var(--arap-primary, #2563eb)",
5622
+ fontWeight: 500
5623
+ },
5624
+ children: [
5625
+ "Active: ",
5626
+ activeProfile.label,
5627
+ hasOverrides && " (Customized)"
5628
+ ]
5629
+ }
5630
+ ) : description
5631
+ }
5632
+ )
5633
+ ] })
5634
+ ] }),
5635
+ /* @__PURE__ */ jsxs31("div", { style: { display: "flex", gap: "6px", alignItems: "center" }, children: [
5636
+ activeProfile && /* @__PURE__ */ jsx33(
5637
+ "button",
5638
+ {
5639
+ type: "button",
5640
+ className: "arap-btn-sm",
5641
+ onClick: handleRevert,
5642
+ "aria-label": "Revert active profile to custom settings",
5643
+ title: "Revert to custom settings",
5644
+ children: "Revert"
5645
+ }
5646
+ ),
5647
+ /* @__PURE__ */ jsx33(
5648
+ "button",
5649
+ {
5650
+ ref: triggerRef,
5651
+ className: "arap-btn-sm",
5652
+ type: "button",
5653
+ "aria-expanded": isOpen,
5654
+ "aria-controls": dialogId,
5655
+ onClick: () => setIsOpen(!isOpen),
5656
+ children: isOpen ? "Close" : "Browse"
5657
+ }
5658
+ )
5659
+ ] })
5660
+ ]
5661
+ }
5662
+ ),
5663
+ isOpen && /* @__PURE__ */ jsxs31(
5664
+ "div",
5665
+ {
5666
+ id: dialogId,
5667
+ className: "arap-profiles-panel",
5668
+ style: {
5669
+ marginTop: "12px",
5670
+ paddingTop: "12px",
5671
+ borderTop: "1px solid var(--arap-divider, #e2e8f0)"
5672
+ },
5673
+ children: [
5674
+ activeProfile && /* @__PURE__ */ jsxs31(
5675
+ "div",
5676
+ {
5677
+ className: "arap-profile-active-banner",
5678
+ style: {
5679
+ display: "flex",
5680
+ alignItems: "center",
5681
+ justifyContent: "space-between",
5682
+ padding: "8px 12px",
5683
+ marginBottom: "12px",
5684
+ background: "rgba(37, 99, 235, 0.08)",
5685
+ border: "1px solid rgba(37, 99, 235, 0.2)",
5686
+ borderRadius: "6px"
5687
+ },
5688
+ children: [
5689
+ /* @__PURE__ */ jsxs31("div", { children: [
5690
+ /* @__PURE__ */ jsxs31(
5691
+ "span",
5692
+ {
5693
+ style: {
5694
+ display: "block",
5695
+ fontWeight: 600,
5696
+ fontSize: "13px",
5697
+ color: "var(--arap-primary, #2563eb)"
5698
+ },
5699
+ children: [
5700
+ "\u2713 Current Profile: ",
5701
+ activeProfile.label
5702
+ ]
5703
+ }
5704
+ ),
5705
+ /* @__PURE__ */ jsx33(
5706
+ "span",
5707
+ {
5708
+ style: {
5709
+ display: "block",
5710
+ fontSize: "11px",
5711
+ color: "var(--arap-muted, #64748b)"
5712
+ },
5713
+ children: hasOverrides ? "Your custom adjustments survive alongside this profile." : "Neutral suggestion applied. Adjust any setting freely."
5714
+ }
5715
+ )
5716
+ ] }),
5717
+ /* @__PURE__ */ jsx33(
5718
+ "button",
5719
+ {
5720
+ type: "button",
5721
+ className: "arap-btn-sm",
5722
+ onClick: handleRevert,
5723
+ "aria-label": "Revert active profile",
5724
+ children: "Revert to Custom"
5725
+ }
5726
+ )
5727
+ ]
5728
+ }
5729
+ ),
5730
+ /* @__PURE__ */ jsxs31(
5731
+ "div",
5732
+ {
5733
+ className: "arap-navigator-search",
5734
+ style: { marginBottom: "10px" },
5735
+ children: [
5736
+ /* @__PURE__ */ jsx33("label", { htmlFor: searchInputId, className: "arap-sr-only", children: "Filter profiles" }),
5737
+ /* @__PURE__ */ jsx33(
5738
+ "input",
5739
+ {
5740
+ id: searchInputId,
5741
+ type: "search",
5742
+ className: "arap-search-input",
5743
+ value: search,
5744
+ onChange: (e) => setSearch(e.target.value),
5745
+ placeholder: strings.searchPlaceholder ?? "Search 8 accessibility profiles...",
5746
+ "aria-label": "Filter profiles"
5747
+ }
5748
+ ),
5749
+ search && /* @__PURE__ */ jsx33(
5750
+ "button",
5751
+ {
5752
+ type: "button",
5753
+ className: "arap-search-clear",
5754
+ onClick: () => setSearch(""),
5755
+ "aria-label": strings.searchClearLabel ?? "Clear profile filter",
5756
+ children: "\xD7"
5757
+ }
5758
+ )
5759
+ ]
5760
+ }
5761
+ ),
5762
+ /* @__PURE__ */ jsx33(
5763
+ SearchCount,
5764
+ {
5765
+ totalCount: profiles.length,
5766
+ matchedCount: filteredProfiles.length,
5767
+ query: search
5768
+ }
5769
+ ),
5770
+ /* @__PURE__ */ jsx33(
5771
+ "div",
5772
+ {
5773
+ className: "arap-profiles-list",
5774
+ style: {
5775
+ display: "flex",
5776
+ flexDirection: "column",
5777
+ gap: "10px",
5778
+ marginTop: "8px"
5779
+ },
5780
+ children: filteredProfiles.length === 0 ? /* @__PURE__ */ jsx33(
5781
+ EmptyState,
5782
+ {
5783
+ title: "No profiles found",
5784
+ description: `No accessibility profiles match "${search}".`,
5785
+ actionLabel: "Clear filter",
5786
+ onAction: () => setSearch("")
5787
+ }
5788
+ ) : filteredProfiles.map((p) => /* @__PURE__ */ jsx33(
5789
+ ProfilePreviewCard,
5790
+ {
5791
+ profile: p,
5792
+ isActive: isProfileActive(p.id),
5793
+ onApply: () => handleApply(p.id),
5794
+ onRevert: handleRevert,
5795
+ largeControls
5796
+ },
5797
+ p.id
5798
+ ))
5799
+ }
5800
+ )
5801
+ ]
5802
+ }
5803
+ )
5804
+ ]
5805
+ }
5806
+ );
5807
+ }
5808
+ var ProfileController = ProfilesController;
5809
+ var AccessibilityProfilesController = ProfilesController;
5810
+
5811
+ // src/features/ResetController.tsx
5812
+ import { createPortal as createPortal2 } from "react-dom";
5813
+ import { useContext as useContext10 } from "react";
5814
+ import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
5815
+ function ResetController() {
5816
+ const ctx = useContext10(AccessibilityContext);
5817
+ if (!ctx) {
5818
+ throw new Error(
5819
+ "ResetController must be used within an <AccessibilityPlugin> provider."
5820
+ );
5821
+ }
5822
+ const actionHost = useContext10(PanelActionsContext);
5823
+ const { resetAll } = ctx;
5824
+ const strings = resolveLocaleStrings(ctx.locale);
5825
+ const button = /* @__PURE__ */ jsx34("div", { className: "arap-feature arap-feature-reset", children: /* @__PURE__ */ jsxs32("button", { className: "arap-reset-btn", onClick: resetAll, type: "button", children: [
5826
+ /* @__PURE__ */ jsx34(FeatureIcon, { name: "reset" }),
5827
+ strings.resetAll
5828
+ ] }) });
5829
+ return actionHost ? createPortal2(button, actionHost) : button;
5830
+ }
5831
+
5832
+ // src/features/PresetsController.tsx
5833
+ import { useContext as useContext12, useId as useId3, useRef as useRef7, useState as useState9 } from "react";
5834
+
5835
+ // src/core/usePresets.ts
5836
+ import { useCallback as useCallback6, useContext as useContext11, useMemo as useMemo3 } from "react";
5837
+
5838
+ // src/core/presets.ts
5839
+ var ALLOWED_PREFERENCE_KEYS = Object.freeze([
5840
+ "fontScale",
5841
+ "lineHeight",
5842
+ "letterSpacingEm",
5843
+ "wordSpacingEm",
5844
+ "paragraphSpacingEm",
5845
+ "textAlign",
5846
+ "contrastMode",
5847
+ "highlightLinks",
5848
+ "highlightFocus",
5849
+ "reduceMotion",
5850
+ "hideDecorativeImages",
5851
+ "fontFamily",
5852
+ "cursorSize",
5853
+ "readerMode",
5854
+ "saturation",
5855
+ "tooltips"
5856
+ ]);
5857
+ var FORBIDDEN_KEYS = /* @__PURE__ */ new Set([
5858
+ "__proto__",
5859
+ "constructor",
5860
+ "prototype",
5861
+ "token",
5862
+ "auth",
5863
+ "password",
5864
+ "email",
5865
+ "user",
5866
+ "userId",
5867
+ "session",
5868
+ "cookie",
5869
+ "transcript",
5870
+ "recording",
5871
+ "pageContent",
5872
+ "notes",
5873
+ "input"
5874
+ ]);
5875
+ function sanitizePreferences(raw) {
5876
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
5877
+ return {};
5878
+ }
5879
+ const record = raw;
5880
+ const clean = {};
5881
+ for (const key of ALLOWED_PREFERENCE_KEYS) {
5882
+ if (key in record && record[key] !== void 0 && !FORBIDDEN_KEYS.has(key)) {
5883
+ clean[key] = normalizePreferenceValue(
5884
+ key,
5885
+ record[key]
5886
+ );
5887
+ }
5888
+ }
5889
+ return clean;
5890
+ }
5891
+ function generatePresetId() {
5892
+ const timestamp = Date.now();
5893
+ const randomPart = Math.random().toString(36).substring(2, 9);
5894
+ return `preset_${timestamp}_${randomPart}`;
5895
+ }
5896
+ function createCustomPreset(name, settings) {
5897
+ const trimmedName = (name || "").trim() || `Preset ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`;
5898
+ const sanitizedSettings = sanitizePreferences(settings);
5899
+ return {
5900
+ id: generatePresetId(),
5901
+ name: trimmedName.slice(0, 60),
5902
+ // clamp name length
5903
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5904
+ settings: sanitizedSettings
5905
+ };
5906
+ }
5907
+ function isValidCustomPreset(item) {
5908
+ if (!item || typeof item !== "object" || Array.isArray(item)) {
5909
+ return false;
5910
+ }
5911
+ const candidate = item;
5912
+ return typeof candidate.id === "string" && candidate.id.length > 0 && typeof candidate.name === "string" && candidate.name.length > 0 && typeof candidate.createdAt === "string" && typeof candidate.settings === "object" && candidate.settings !== null && !Array.isArray(candidate.settings);
5913
+ }
5914
+ function exportPresetsToJson(options) {
5915
+ const envelope = {
5916
+ $schema: "https://accessibility-plugin.org/schemas/presets-v1.json",
5917
+ version: 1,
5918
+ app: "accessibility-plugin-react",
5919
+ exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
5920
+ presets: options.presets.map((p) => ({
5921
+ id: p.id,
5922
+ name: p.name,
5923
+ createdAt: p.createdAt,
5924
+ updatedAt: p.updatedAt,
5925
+ settings: sanitizePreferences(p.settings)
5926
+ }))
5927
+ };
5928
+ if (options.currentSettings) {
5929
+ envelope.currentSettings = sanitizePreferences(options.currentSettings);
5930
+ }
5931
+ return JSON.stringify(envelope, null, 2);
5932
+ }
5933
+ function downloadJsonFile(filename, jsonContent) {
5934
+ if (typeof window === "undefined" || typeof document === "undefined") return;
5935
+ const blob = new Blob([jsonContent], {
5936
+ type: "application/json;charset=utf-8"
5937
+ });
5938
+ const url = URL.createObjectURL(blob);
5939
+ const anchor = document.createElement("a");
5940
+ anchor.href = url;
5941
+ anchor.download = filename.endsWith(".json") ? filename : `${filename}.json`;
5942
+ anchor.style.display = "none";
5943
+ document.body.appendChild(anchor);
5944
+ anchor.click();
5945
+ document.body.removeChild(anchor);
5946
+ URL.revokeObjectURL(url);
5947
+ }
5948
+ function validateAndParseImport(jsonString) {
5949
+ if (!jsonString || typeof jsonString !== "string" || !jsonString.trim()) {
5950
+ return {
5951
+ success: false,
5952
+ error: "Import file is empty."
5953
+ };
5954
+ }
5955
+ let raw;
5956
+ try {
5957
+ raw = JSON.parse(jsonString);
5958
+ } catch {
5959
+ return {
5960
+ success: false,
5961
+ error: "Invalid JSON format: syntax error in file."
5962
+ };
5963
+ }
5964
+ if (!raw || typeof raw !== "object") {
5965
+ return {
5966
+ success: false,
5967
+ error: "Malformed import: file root must be an object or array."
5968
+ };
5969
+ }
5970
+ if (Array.isArray(raw)) {
5971
+ const validPresets = [];
5972
+ for (const item of raw) {
5973
+ if (typeof item === "object" && item !== null && !Array.isArray(item)) {
5974
+ const p = item;
5975
+ const name = typeof p.name === "string" ? p.name : "Imported Preset";
5976
+ const id = typeof p.id === "string" && p.id ? p.id : generatePresetId();
5977
+ const createdAt = typeof p.createdAt === "string" ? p.createdAt : (/* @__PURE__ */ new Date()).toISOString();
5978
+ const settings = sanitizePreferences(p.settings || p);
5979
+ if (Object.keys(settings).length > 0) {
5980
+ validPresets.push({ id, name, createdAt, settings });
5981
+ }
5982
+ }
5983
+ }
5984
+ if (validPresets.length === 0) {
5985
+ return {
5986
+ success: false,
5987
+ error: "Array did not contain any valid accessibility presets."
5988
+ };
5989
+ }
5990
+ return {
5991
+ success: true,
5992
+ presets: validPresets,
5993
+ message: `Successfully imported ${validPresets.length} preset(s).`
5994
+ };
5995
+ }
5996
+ const obj = raw;
5997
+ if ("version" in obj && typeof obj.version === "number") {
5998
+ if (obj.version > 1) {
5999
+ return {
6000
+ success: false,
6001
+ error: `Unsupported schema version: version ${obj.version} is newer than supported version 1.`
6002
+ };
6003
+ }
6004
+ if (obj.version < 1) {
6005
+ return {
6006
+ success: false,
6007
+ error: `Unsupported schema version: version ${obj.version} is not recognized.`
6008
+ };
6009
+ }
6010
+ }
6011
+ const importedPresets = [];
6012
+ if (Array.isArray(obj.presets)) {
6013
+ for (const item of obj.presets) {
6014
+ if (isValidCustomPreset(item)) {
6015
+ importedPresets.push({
6016
+ id: item.id,
6017
+ name: item.name,
6018
+ createdAt: item.createdAt,
6019
+ updatedAt: item.updatedAt,
6020
+ settings: sanitizePreferences(item.settings)
6021
+ });
6022
+ } else if (typeof item === "object" && item !== null) {
6023
+ const record = item;
6024
+ const name = typeof record.name === "string" ? record.name : "Imported Preset";
6025
+ const id = typeof record.id === "string" && record.id ? record.id : generatePresetId();
6026
+ const createdAt = typeof record.createdAt === "string" ? record.createdAt : (/* @__PURE__ */ new Date()).toISOString();
6027
+ const settings = sanitizePreferences(record.settings || record);
6028
+ if (Object.keys(settings).length > 0) {
6029
+ importedPresets.push({ id, name, createdAt, settings });
6030
+ }
6031
+ }
6032
+ }
6033
+ }
6034
+ let currentSettings;
6035
+ if ("currentSettings" in obj && typeof obj.currentSettings === "object") {
6036
+ currentSettings = sanitizePreferences(obj.currentSettings);
6037
+ } else if (!("presets" in obj) && !("version" in obj)) {
6038
+ const flat = sanitizePreferences(obj);
6039
+ if (Object.keys(flat).length > 0) {
6040
+ currentSettings = flat;
6041
+ }
6042
+ }
6043
+ if (importedPresets.length === 0 && (!currentSettings || Object.keys(currentSettings).length === 0)) {
6044
+ return {
6045
+ success: false,
6046
+ error: "No valid presets or accessibility settings found in the file."
6047
+ };
6048
+ }
6049
+ const parts = [];
6050
+ if (importedPresets.length > 0)
6051
+ parts.push(`${importedPresets.length} preset(s)`);
6052
+ if (currentSettings && Object.keys(currentSettings).length > 0)
6053
+ parts.push("current settings");
6054
+ return {
6055
+ success: true,
6056
+ presets: importedPresets,
6057
+ currentSettings,
6058
+ message: `Successfully imported ${parts.join(" and ")}.`
6059
+ };
6060
+ }
6061
+ function applyCustomPresetToStore(preset, setFeatureState) {
6062
+ const mapped = mapProfileSettingsToFeatures(preset.settings);
6063
+ for (const [key, value] of Object.entries(mapped)) {
6064
+ try {
6065
+ setFeatureState(key, value);
6066
+ } catch {
6067
+ }
6068
+ }
6069
+ }
6070
+
6071
+ // src/core/usePresets.ts
6072
+ function usePresets() {
6073
+ const ctx = useContext11(AccessibilityContext);
6074
+ if (!ctx) {
6075
+ throw new Error(
6076
+ "usePresets must be used within an <AccessibilityPlugin> provider."
6077
+ );
6078
+ }
6079
+ const { value: rawPresets, setValue: setPresets } = useAccessibility("customPresets", []);
6080
+ const presets = useMemo3(
6081
+ () => Array.isArray(rawPresets) ? rawPresets : [],
6082
+ [rawPresets]
6083
+ );
6084
+ const currentSettings = useMemo3(
6085
+ () => mapFeaturesToProfileSettings(ctx.state.features),
6086
+ [ctx.state.features]
6087
+ );
6088
+ const saveCurrentAsPreset = useCallback6(
6089
+ (name) => {
6090
+ const newPreset = createCustomPreset(name, currentSettings);
6091
+ setPresets([...presets, newPreset]);
6092
+ return newPreset;
6093
+ },
6094
+ [currentSettings, presets, setPresets]
6095
+ );
6096
+ const applyPreset = useCallback6(
6097
+ (presetId) => {
6098
+ const found = presets.find((p) => p.id === presetId);
6099
+ if (!found) return false;
6100
+ applyCustomPresetToStore(found, ctx.setFeatureState);
6101
+ return true;
6102
+ },
6103
+ [ctx.setFeatureState, presets]
6104
+ );
6105
+ const deletePreset = useCallback6(
6106
+ (presetId) => {
6107
+ const next = presets.filter((p) => p.id !== presetId);
6108
+ if (next.length === presets.length) return false;
6109
+ setPresets(next);
6110
+ return true;
6111
+ },
6112
+ [presets, setPresets]
6113
+ );
6114
+ const exportPresets = useCallback6(() => {
6115
+ return exportPresetsToJson({ presets, currentSettings });
6116
+ }, [currentSettings, presets]);
6117
+ const downloadExport = useCallback6(
6118
+ (filename) => {
6119
+ const json = exportPresetsToJson({ presets, currentSettings });
6120
+ const dateStr = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
6121
+ const targetName = filename || `accessibility-preferences-${dateStr}.json`;
6122
+ downloadJsonFile(targetName, json);
6123
+ },
6124
+ [currentSettings, presets]
6125
+ );
6126
+ const importFromJson = useCallback6(
6127
+ (jsonStr) => {
6128
+ const result = validateAndParseImport(jsonStr);
6129
+ if (!result.success) {
6130
+ return result;
6131
+ }
6132
+ if (result.presets.length > 0) {
6133
+ const existingMap = new Map(presets.map((p) => [p.id, p]));
6134
+ for (const p of result.presets) {
6135
+ existingMap.set(p.id, p);
6136
+ }
6137
+ setPresets(Array.from(existingMap.values()));
6138
+ }
6139
+ if (result.currentSettings && Object.keys(result.currentSettings).length > 0) {
6140
+ applyCustomPresetToStore(
6141
+ {
6142
+ id: "temp_import",
6143
+ name: "Imported Settings",
6144
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
6145
+ settings: result.currentSettings
6146
+ },
6147
+ ctx.setFeatureState
6148
+ );
6149
+ }
6150
+ return result;
6151
+ },
6152
+ [ctx.setFeatureState, presets, setPresets]
6153
+ );
6154
+ const importFromFile = useCallback6(
6155
+ async (file) => {
6156
+ try {
6157
+ const text = await file.text();
6158
+ return importFromJson(text);
6159
+ } catch (err) {
6160
+ return {
6161
+ success: false,
6162
+ error: `Failed to read file: ${err instanceof Error ? err.message : String(err)}`
6163
+ };
6164
+ }
6165
+ },
6166
+ [importFromJson]
6167
+ );
6168
+ return {
6169
+ presets,
6170
+ currentSettings,
6171
+ saveCurrentAsPreset,
6172
+ applyPreset,
6173
+ deletePreset,
6174
+ exportPresets,
6175
+ downloadExport,
6176
+ importFromJson,
6177
+ importFromFile
6178
+ };
6179
+ }
6180
+
6181
+ // src/features/PresetsController.tsx
6182
+ import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
6183
+ function PresetsController({
6184
+ className = "",
6185
+ label,
6186
+ description = "Save, restore, and transfer your settings",
6187
+ largeControls = false
6188
+ } = {}) {
6189
+ const ctx = useContext12(AccessibilityContext);
6190
+ const strings = resolveLocaleStrings(ctx?.locale);
6191
+ const effectiveLabel = label ?? strings.features?.presets ?? "Custom Presets";
6192
+ const [isOpen, setIsOpen] = useState9(false);
6193
+ const [presetName, setPresetName] = useState9("");
6194
+ const [statusMessage, setStatusMessage] = useState9("");
6195
+ const [errorMessage, setErrorMessage] = useState9("");
6196
+ const dialogId = "arap-presets-dialog";
6197
+ const nameInputId = useId3();
6198
+ const fileInputRef = useRef7(null);
6199
+ const triggerRef = useRef7(null);
6200
+ const {
6201
+ presets,
6202
+ saveCurrentAsPreset,
6203
+ applyPreset,
6204
+ deletePreset,
6205
+ downloadExport,
6206
+ importFromFile
6207
+ } = usePresets();
6208
+ const handleSave = () => {
6209
+ const trimmed = presetName.trim();
6210
+ if (!trimmed) {
6211
+ setErrorMessage("Please enter a name for your preset.");
6212
+ setStatusMessage("");
6213
+ return;
6214
+ }
6215
+ const created = saveCurrentAsPreset(trimmed);
6216
+ setPresetName("");
6217
+ setErrorMessage("");
6218
+ setStatusMessage(
6219
+ strings.formatPresetSaved ? strings.formatPresetSaved(created.name) : `Preset "${created.name}" saved successfully.`
6220
+ );
6221
+ };
6222
+ const handleApply = (preset) => {
6223
+ const success = applyPreset(preset.id);
6224
+ if (success) {
6225
+ setErrorMessage("");
6226
+ setStatusMessage(
6227
+ strings.formatPresetApplied ? strings.formatPresetApplied(preset.name) : `Preset "${preset.name}" applied.`
6228
+ );
6229
+ }
6230
+ };
6231
+ const handleDelete = (preset) => {
6232
+ const success = deletePreset(preset.id);
6233
+ if (success) {
6234
+ setErrorMessage("");
6235
+ setStatusMessage(
6236
+ strings.formatPresetDeleted ? strings.formatPresetDeleted(preset.name) : `Preset "${preset.name}" deleted.`
6237
+ );
6238
+ }
6239
+ };
6240
+ const handleExport = () => {
6241
+ downloadExport();
6242
+ setErrorMessage("");
6243
+ setStatusMessage("Settings and presets exported to JSON file.");
6244
+ };
6245
+ const handleFileInputChange = async (e) => {
6246
+ const file = e.target.files?.[0];
6247
+ if (!file) return;
6248
+ const result = await importFromFile(file);
6249
+ if (result.success) {
6250
+ setErrorMessage("");
6251
+ setStatusMessage(result.message);
6252
+ } else {
6253
+ setStatusMessage("");
6254
+ setErrorMessage(result.error);
6255
+ }
6256
+ if (fileInputRef.current) {
6257
+ fileInputRef.current.value = "";
6258
+ }
6259
+ };
6260
+ const formatKeyName = (key) => {
6261
+ switch (key) {
6262
+ case "fontScale":
6263
+ return "Font Size";
6264
+ case "lineHeight":
6265
+ return "Line Height";
6266
+ case "contrastMode":
6267
+ return "Contrast";
6268
+ case "reduceMotion":
6269
+ return "Reduce Motion";
6270
+ case "textAlign":
6271
+ return "Text Align";
6272
+ case "highlightLinks":
6273
+ return "Highlight Links";
6274
+ case "highlightFocus":
6275
+ return "Highlight Focus";
6276
+ case "cursorSize":
6277
+ return "Cursor Size";
6278
+ case "readerMode":
6279
+ return "Reading Mode";
6280
+ case "saturation":
6281
+ return "Saturation";
6282
+ case "hideDecorativeImages":
6283
+ return "Hide Images";
6284
+ default:
6285
+ return key.replace(/([A-Z])/g, " $1").trim();
6286
+ }
6287
+ };
6288
+ const formatSettingValue = (key, val) => {
6289
+ if (typeof val === "boolean") return val ? "On" : "Off";
6290
+ if (key === "fontScale" && typeof val === "number")
6291
+ return `${Math.round(val * 100)}%`;
6292
+ if (key === "lineHeight" && typeof val === "number")
6293
+ return `${Math.round(val * 100)}%`;
6294
+ if (val === null || val === void 0) return "Original";
6295
+ return String(val);
6296
+ };
6297
+ return /* @__PURE__ */ jsxs33(
6298
+ "div",
6299
+ {
6300
+ className: `arap-feature arap-feature-expandable ${largeControls ? "arap-large-controls" : ""} ${className}`,
6301
+ role: "group",
6302
+ "aria-label": effectiveLabel,
6303
+ children: [
6304
+ /* @__PURE__ */ jsxs33(
6305
+ "div",
6306
+ {
6307
+ style: {
6308
+ display: "flex",
6309
+ alignItems: "center",
6310
+ justifyContent: "space-between",
6311
+ width: "100%"
6312
+ },
6313
+ children: [
6314
+ /* @__PURE__ */ jsxs33("span", { className: "arap-label", children: [
6315
+ /* @__PURE__ */ jsx35(FeatureIcon, { name: "presets" }),
6316
+ /* @__PURE__ */ jsxs33("span", { children: [
6317
+ /* @__PURE__ */ jsx35("span", { style: { display: "block" }, children: effectiveLabel }),
6318
+ description && /* @__PURE__ */ jsx35(
6319
+ "span",
6320
+ {
6321
+ style: {
6322
+ display: "block",
6323
+ fontSize: "11px",
6324
+ fontWeight: 400,
6325
+ color: "var(--arap-muted, #64748b)",
6326
+ marginTop: "1px"
6327
+ },
6328
+ children: presets.length > 0 ? `${presets.length} custom preset${presets.length === 1 ? "" : "s"} saved` : description
6329
+ }
6330
+ )
6331
+ ] })
6332
+ ] }),
6333
+ /* @__PURE__ */ jsx35(
6334
+ "button",
6335
+ {
6336
+ ref: triggerRef,
6337
+ className: "arap-btn-sm",
6338
+ type: "button",
6339
+ "aria-expanded": isOpen,
6340
+ "aria-controls": dialogId,
6341
+ onClick: () => setIsOpen(!isOpen),
6342
+ children: isOpen ? "Close" : "Presets"
6343
+ }
6344
+ )
6345
+ ]
6346
+ }
6347
+ ),
6348
+ isOpen && /* @__PURE__ */ jsxs33(
6349
+ "div",
6350
+ {
6351
+ id: dialogId,
6352
+ role: "region",
6353
+ "aria-label": "Custom Presets and Settings",
6354
+ tabIndex: -1,
6355
+ style: {
6356
+ marginTop: "12px",
6357
+ padding: "12px",
6358
+ borderRadius: "6px",
6359
+ backgroundColor: "var(--arap-card-bg, #f8fafc)",
6360
+ border: "1px solid var(--arap-border, #e2e8f0)"
6361
+ },
6362
+ onKeyDown: (e) => {
6363
+ if (e.key === "Escape") {
6364
+ e.stopPropagation();
6365
+ setIsOpen(false);
6366
+ triggerRef.current?.focus();
6367
+ }
6368
+ },
6369
+ children: [
6370
+ /* @__PURE__ */ jsxs33(
6371
+ "div",
6372
+ {
6373
+ role: "status",
6374
+ "aria-live": "polite",
6375
+ className: "arap-presets-status",
6376
+ style: {
6377
+ minHeight: statusMessage || errorMessage ? "24px" : "0",
6378
+ marginBottom: statusMessage || errorMessage ? "8px" : "0"
6379
+ },
6380
+ children: [
6381
+ statusMessage && /* @__PURE__ */ jsxs33(
6382
+ "div",
6383
+ {
6384
+ style: {
6385
+ fontSize: "12px",
6386
+ fontWeight: 500,
6387
+ color: "var(--arap-success, #16a34a)",
6388
+ padding: "4px 8px",
6389
+ backgroundColor: "rgba(22, 163, 74, 0.1)",
6390
+ borderRadius: "4px"
6391
+ },
6392
+ children: [
6393
+ "\u2713 ",
6394
+ statusMessage
6395
+ ]
6396
+ }
6397
+ ),
6398
+ errorMessage && /* @__PURE__ */ jsxs33(
6399
+ "div",
6400
+ {
6401
+ role: "alert",
6402
+ style: {
6403
+ fontSize: "12px",
6404
+ fontWeight: 500,
6405
+ color: "var(--arap-error, #dc2626)",
6406
+ padding: "4px 8px",
6407
+ backgroundColor: "rgba(220, 38, 38, 0.1)",
6408
+ borderRadius: "4px"
6409
+ },
6410
+ children: [
6411
+ "\u26A0 ",
6412
+ errorMessage
6413
+ ]
6414
+ }
6415
+ )
6416
+ ]
6417
+ }
6418
+ ),
6419
+ /* @__PURE__ */ jsxs33(
6420
+ "div",
6421
+ {
6422
+ className: "arap-presets-save-section",
6423
+ style: { marginBottom: "14px" },
6424
+ children: [
6425
+ /* @__PURE__ */ jsx35(
6426
+ "label",
6427
+ {
6428
+ htmlFor: nameInputId,
6429
+ style: {
6430
+ display: "block",
6431
+ fontSize: "12px",
6432
+ fontWeight: 600,
6433
+ marginBottom: "4px",
6434
+ color: "var(--arap-text, #1e293b)"
6435
+ },
6436
+ children: "Save current settings as preset:"
6437
+ }
6438
+ ),
6439
+ /* @__PURE__ */ jsxs33("div", { style: { display: "flex", gap: "6px" }, children: [
6440
+ /* @__PURE__ */ jsx35(
6441
+ "input",
6442
+ {
6443
+ id: nameInputId,
6444
+ type: "text",
6445
+ className: "arap-search-input",
6446
+ style: { flex: 1, padding: "6px 10px", fontSize: "13px" },
6447
+ value: presetName,
6448
+ onChange: (e) => {
6449
+ setPresetName(e.target.value);
6450
+ if (errorMessage) setErrorMessage("");
6451
+ },
6452
+ onKeyDown: (e) => {
6453
+ if (e.key === "Enter") {
6454
+ e.preventDefault();
6455
+ handleSave();
6456
+ }
6457
+ },
6458
+ placeholder: "Preset name (e.g. My Reading Setup)",
6459
+ "aria-label": "Preset name"
6460
+ }
6461
+ ),
6462
+ /* @__PURE__ */ jsx35(
6463
+ "button",
6464
+ {
6465
+ type: "button",
6466
+ className: "arap-btn-sm",
6467
+ onClick: handleSave,
6468
+ "aria-label": "Save current preset",
6469
+ children: "Save"
6470
+ }
6471
+ )
6472
+ ] })
6473
+ ]
6474
+ }
6475
+ ),
6476
+ /* @__PURE__ */ jsxs33(
6477
+ "div",
6478
+ {
6479
+ className: "arap-presets-transfer-section",
6480
+ style: {
6481
+ display: "flex",
6482
+ gap: "8px",
6483
+ marginBottom: "14px",
6484
+ paddingBottom: "12px",
6485
+ borderBottom: "1px solid var(--arap-border, #e2e8f0)"
6486
+ },
6487
+ children: [
6488
+ /* @__PURE__ */ jsx35(
6489
+ "button",
6490
+ {
6491
+ type: "button",
6492
+ className: "arap-btn-sm",
6493
+ style: { flex: 1 },
6494
+ onClick: handleExport,
6495
+ "aria-label": "Export settings and presets to JSON file",
6496
+ children: "Export JSON"
6497
+ }
6498
+ ),
6499
+ /* @__PURE__ */ jsx35(
6500
+ "button",
6501
+ {
6502
+ type: "button",
6503
+ className: "arap-btn-sm",
6504
+ style: { flex: 1 },
6505
+ onClick: () => fileInputRef.current?.click(),
6506
+ "aria-label": "Import settings and presets from JSON file",
6507
+ children: "Import JSON"
6508
+ }
6509
+ ),
6510
+ /* @__PURE__ */ jsx35(
6511
+ "input",
6512
+ {
6513
+ ref: fileInputRef,
6514
+ type: "file",
6515
+ accept: ".json,application/json",
6516
+ style: { display: "none" },
6517
+ "aria-label": "Upload JSON settings file",
6518
+ onChange: handleFileInputChange
6519
+ }
6520
+ )
6521
+ ]
6522
+ }
6523
+ ),
6524
+ /* @__PURE__ */ jsxs33("div", { className: "arap-presets-list-section", children: [
6525
+ /* @__PURE__ */ jsxs33(
6526
+ "h4",
6527
+ {
6528
+ style: {
6529
+ fontSize: "12px",
6530
+ fontWeight: 600,
6531
+ marginBottom: "6px",
6532
+ color: "var(--arap-text, #1e293b)"
6533
+ },
6534
+ children: [
6535
+ "Saved Presets (",
6536
+ presets.length,
6537
+ "):"
6538
+ ]
6539
+ }
6540
+ ),
6541
+ presets.length === 0 ? /* @__PURE__ */ jsx35(
6542
+ EmptyState,
6543
+ {
6544
+ title: "No saved presets yet",
6545
+ description: "Configure your preferences and save them above for quick 1-click access."
6546
+ }
6547
+ ) : /* @__PURE__ */ jsx35(
6548
+ "div",
6549
+ {
6550
+ style: {
6551
+ display: "flex",
6552
+ flexDirection: "column",
6553
+ gap: "8px"
6554
+ },
6555
+ children: presets.map((p) => {
6556
+ const affectedKeys = Object.keys(
6557
+ p.settings
6558
+ );
6559
+ return /* @__PURE__ */ jsxs33(
6560
+ "div",
6561
+ {
6562
+ className: "arap-preset-card",
6563
+ role: "group",
6564
+ "aria-label": `${p.name} preset`,
6565
+ style: {
6566
+ padding: "8px 10px",
6567
+ borderRadius: "6px",
6568
+ backgroundColor: "var(--arap-bg, #ffffff)",
6569
+ border: "1px solid var(--arap-border, #e2e8f0)"
6570
+ },
6571
+ children: [
6572
+ /* @__PURE__ */ jsxs33(
6573
+ "div",
6574
+ {
6575
+ style: {
6576
+ display: "flex",
6577
+ alignItems: "center",
6578
+ justifyContent: "space-between",
6579
+ marginBottom: "4px"
6580
+ },
6581
+ children: [
6582
+ /* @__PURE__ */ jsxs33("div", { children: [
6583
+ /* @__PURE__ */ jsx35(
6584
+ "strong",
6585
+ {
6586
+ style: {
6587
+ fontSize: "13px",
6588
+ color: "var(--arap-text, #1e293b)"
6589
+ },
6590
+ children: p.name
6591
+ }
6592
+ ),
6593
+ /* @__PURE__ */ jsxs33(
6594
+ "span",
6595
+ {
6596
+ style: {
6597
+ display: "block",
6598
+ fontSize: "10px",
6599
+ color: "var(--arap-muted, #64748b)"
6600
+ },
6601
+ children: [
6602
+ "Saved ",
6603
+ new Date(p.createdAt).toLocaleDateString()
6604
+ ]
6605
+ }
6606
+ )
6607
+ ] }),
6608
+ /* @__PURE__ */ jsxs33(
6609
+ "div",
6610
+ {
6611
+ style: {
6612
+ display: "flex",
6613
+ gap: "6px",
6614
+ alignItems: "center"
6615
+ },
6616
+ children: [
6617
+ /* @__PURE__ */ jsx35(
6618
+ "button",
6619
+ {
6620
+ type: "button",
6621
+ className: "arap-btn-sm",
6622
+ onClick: () => handleApply(p),
6623
+ "aria-label": `Apply preset ${p.name}`,
6624
+ children: "Apply"
6625
+ }
6626
+ ),
6627
+ /* @__PURE__ */ jsx35(
6628
+ "button",
6629
+ {
6630
+ type: "button",
6631
+ className: "arap-btn-sm",
6632
+ onClick: () => handleDelete(p),
6633
+ "aria-label": `Delete preset ${p.name}`,
6634
+ style: {
6635
+ color: "var(--arap-error, #dc2626)"
6636
+ },
6637
+ children: "Delete"
6638
+ }
6639
+ )
6640
+ ]
6641
+ }
6642
+ )
6643
+ ]
6644
+ }
6645
+ ),
6646
+ affectedKeys.length > 0 && /* @__PURE__ */ jsx35(
6647
+ "div",
6648
+ {
6649
+ className: "arap-profile-chips",
6650
+ style: { marginTop: "4px" },
6651
+ children: affectedKeys.map((key) => {
6652
+ const val = p.settings[key];
6653
+ return /* @__PURE__ */ jsxs33("span", { className: "arap-profile-chip", children: [
6654
+ /* @__PURE__ */ jsxs33("strong", { children: [
6655
+ formatKeyName(key),
6656
+ ":"
6657
+ ] }),
6658
+ " ",
6659
+ formatSettingValue(key, val)
6660
+ ] }, key);
6661
+ })
6662
+ }
6663
+ )
6664
+ ]
6665
+ },
6666
+ p.id
6667
+ );
6668
+ })
6669
+ }
6670
+ )
6671
+ ] })
6672
+ ]
6673
+ }
6674
+ )
6675
+ ]
6676
+ }
6677
+ );
6678
+ }
6679
+ var CustomPresetsController = PresetsController;
6680
+ var SettingsImportExportController = PresetsController;
6681
+ var PresetsBackupController = PresetsController;
6682
+
6683
+ // src/core/controls/ToggleControl.tsx
6684
+ import { jsx as jsx36 } from "react/jsx-runtime";
6685
+ function ToggleControl({
6686
+ id,
6687
+ label,
6688
+ checked,
6689
+ onChange,
6690
+ disabled = false,
6691
+ unavailable = false,
6692
+ unavailableReason,
6693
+ name,
6694
+ description,
6695
+ largeControls = false,
6696
+ className = "",
6697
+ style
6698
+ }) {
6699
+ const isInteractive = !disabled && !unavailable;
6700
+ const toggleLabel = typeof label === "string" ? label : void 0;
6701
+ const handleClick = () => {
6702
+ if (isInteractive) {
6703
+ onChange(!checked);
6704
+ }
6705
+ };
6706
+ return /* @__PURE__ */ jsx36(
6707
+ "div",
6708
+ {
6709
+ className: `arap-toggle-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
6710
+ style,
6711
+ children: /* @__PURE__ */ jsx36(
6712
+ "button",
6713
+ {
6714
+ id,
6715
+ name,
6716
+ type: "button",
6717
+ className: `arap-toggle ${checked ? "arap-toggle-active" : ""}`,
6718
+ role: "switch",
6719
+ "aria-checked": checked,
6720
+ "aria-label": toggleLabel,
6721
+ "aria-disabled": !isInteractive,
6722
+ disabled: !isInteractive,
6723
+ onClick: handleClick,
6724
+ title: unavailableReason || description || toggleLabel,
6725
+ children: /* @__PURE__ */ jsx36(
6726
+ "span",
6727
+ {
6728
+ className: "arap-toggle-knob",
6729
+ style: {
6730
+ transform: checked ? largeControls ? "translateX(28px)" : "translateX(24px)" : "translateX(0)"
6731
+ }
6732
+ }
6733
+ )
6734
+ }
6735
+ )
6736
+ }
6737
+ );
6738
+ }
6739
+
6740
+ // src/core/controls/ChoiceControl.tsx
6741
+ import { useCallback as useCallback7, useMemo as useMemo4, useRef as useRef8 } from "react";
6742
+ import { jsx as jsx37, jsxs as jsxs34 } from "react/jsx-runtime";
6743
+ function ChoiceControl({
6744
+ id,
6745
+ label,
6746
+ value,
6747
+ options,
6748
+ groups,
6749
+ onChange,
6750
+ disabled = false,
6751
+ largeControls = false,
6752
+ className = "",
6753
+ style,
6754
+ orientation = "horizontal"
6755
+ }) {
6756
+ const containerRef = useRef8(null);
6757
+ const allOptions = useMemo4(
6758
+ () => groups ? groups.flatMap((g) => g.options) : options || [],
6759
+ [groups, options]
6760
+ );
6761
+ const handleKeyDown = useCallback7(
6762
+ (e) => {
6763
+ if (disabled || allOptions.length === 0) return;
6764
+ const enabledOptions = allOptions.filter((opt) => !opt.disabled);
6765
+ const currentIndex = enabledOptions.findIndex(
6766
+ (opt) => opt.value === value
6767
+ );
6768
+ let nextIndex = -1;
6769
+ if (e.key === "ArrowRight" || e.key === "ArrowDown") {
6770
+ e.preventDefault();
6771
+ nextIndex = currentIndex === -1 ? 0 : (currentIndex + 1) % enabledOptions.length;
6772
+ } else if (e.key === "ArrowLeft" || e.key === "ArrowUp") {
6773
+ e.preventDefault();
6774
+ nextIndex = currentIndex === -1 ? enabledOptions.length - 1 : (currentIndex - 1 + enabledOptions.length) % enabledOptions.length;
6775
+ } else if (e.key === "Home") {
6776
+ e.preventDefault();
6777
+ nextIndex = 0;
6778
+ } else if (e.key === "End") {
6779
+ e.preventDefault();
6780
+ nextIndex = enabledOptions.length - 1;
6781
+ }
6782
+ if (nextIndex !== -1 && enabledOptions[nextIndex]) {
6783
+ onChange(enabledOptions[nextIndex].value);
4508
6784
  const buttons = containerRef.current?.querySelectorAll(
4509
6785
  "button[data-choice-value]"
4510
6786
  );
@@ -4519,7 +6795,7 @@ function ChoiceControl({
4519
6795
  const renderOptionButton = (opt) => {
4520
6796
  const isSelected = value === opt.value;
4521
6797
  const isOptionDisabled = disabled || Boolean(opt.disabled);
4522
- return /* @__PURE__ */ jsxs29(
6798
+ return /* @__PURE__ */ jsxs34(
4523
6799
  "button",
4524
6800
  {
4525
6801
  type: "button",
@@ -4533,15 +6809,15 @@ function ChoiceControl({
4533
6809
  onClick: () => !isOptionDisabled && onChange(opt.value),
4534
6810
  title: opt.description,
4535
6811
  children: [
4536
- isSelected && /* @__PURE__ */ jsx32("span", { className: "arap-check", "aria-hidden": "true", children: "\u2713" }),
4537
- /* @__PURE__ */ jsx32("span", { children: opt.label }),
4538
- opt.badge && /* @__PURE__ */ jsx32("span", { className: "arap-choice-badge", "aria-hidden": "true", children: opt.badge })
6812
+ isSelected && /* @__PURE__ */ jsx37("span", { className: "arap-check", "aria-hidden": "true", children: "\u2713" }),
6813
+ /* @__PURE__ */ jsx37("span", { children: opt.label }),
6814
+ opt.badge && /* @__PURE__ */ jsx37("span", { className: "arap-choice-badge", "aria-hidden": "true", children: opt.badge })
4539
6815
  ]
4540
6816
  },
4541
6817
  String(opt.value)
4542
6818
  );
4543
6819
  };
4544
- return /* @__PURE__ */ jsx32(
6820
+ return /* @__PURE__ */ jsx37(
4545
6821
  "div",
4546
6822
  {
4547
6823
  ref: containerRef,
@@ -4552,15 +6828,15 @@ function ChoiceControl({
4552
6828
  className: `arap-choice-control arap-segmented ${largeControls ? "arap-large-controls" : ""} ${className}`,
4553
6829
  style,
4554
6830
  onKeyDown: handleKeyDown,
4555
- children: groups ? groups.map((group) => /* @__PURE__ */ jsxs29(
6831
+ children: groups ? groups.map((group) => /* @__PURE__ */ jsxs34(
4556
6832
  "div",
4557
6833
  {
4558
6834
  className: "arap-choice-group",
4559
6835
  role: "group",
4560
6836
  "aria-label": group.label,
4561
6837
  children: [
4562
- /* @__PURE__ */ jsx32("span", { className: "arap-choice-group-title", children: group.label }),
4563
- /* @__PURE__ */ jsx32("div", { className: "arap-segmented", children: group.options.map(renderOptionButton) })
6838
+ /* @__PURE__ */ jsx37("span", { className: "arap-choice-group-title", children: group.label }),
6839
+ /* @__PURE__ */ jsx37("div", { className: "arap-segmented", children: group.options.map(renderOptionButton) })
4564
6840
  ]
4565
6841
  },
4566
6842
  group.label
@@ -4570,7 +6846,7 @@ function ChoiceControl({
4570
6846
  }
4571
6847
 
4572
6848
  // src/core/controls/StepperControl.tsx
4573
- import { jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
6849
+ import { jsx as jsx38, jsxs as jsxs35 } from "react/jsx-runtime";
4574
6850
  function StepperControl({
4575
6851
  id,
4576
6852
  label,
@@ -4600,15 +6876,15 @@ function StepperControl({
4600
6876
  onChange(Math.min(max, Number((value + step).toFixed(2))));
4601
6877
  }
4602
6878
  };
4603
- return /* @__PURE__ */ jsxs30(
6879
+ return /* @__PURE__ */ jsxs35(
4604
6880
  "div",
4605
6881
  {
4606
6882
  id,
4607
6883
  className: `arap-stepper-control-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
4608
6884
  style,
4609
6885
  children: [
4610
- /* @__PURE__ */ jsxs30("div", { className: "arap-controls", children: [
4611
- /* @__PURE__ */ jsx33(
6886
+ /* @__PURE__ */ jsxs35("div", { className: "arap-controls", children: [
6887
+ /* @__PURE__ */ jsx38(
4612
6888
  "button",
4613
6889
  {
4614
6890
  type: "button",
@@ -4619,8 +6895,8 @@ function StepperControl({
4619
6895
  children: "\u2212"
4620
6896
  }
4621
6897
  ),
4622
- /* @__PURE__ */ jsx33("output", { className: "arap-value", "aria-live": "polite", children: displayValue }),
4623
- /* @__PURE__ */ jsx33(
6898
+ /* @__PURE__ */ jsx38("output", { className: "arap-value", "aria-live": "polite", children: displayValue }),
6899
+ /* @__PURE__ */ jsx38(
4624
6900
  "button",
4625
6901
  {
4626
6902
  type: "button",
@@ -4632,7 +6908,7 @@ function StepperControl({
4632
6908
  }
4633
6909
  )
4634
6910
  ] }),
4635
- showSlider && /* @__PURE__ */ jsx33("div", { className: "arap-slider-container", children: /* @__PURE__ */ jsx33(
6911
+ showSlider && /* @__PURE__ */ jsx38("div", { className: "arap-slider-container", children: /* @__PURE__ */ jsx38(
4636
6912
  "input",
4637
6913
  {
4638
6914
  type: "range",
@@ -4656,7 +6932,7 @@ function StepperControl({
4656
6932
  }
4657
6933
 
4658
6934
  // src/core/controls/FeatureCard.tsx
4659
- import { jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
6935
+ import { jsx as jsx39, jsxs as jsxs36 } from "react/jsx-runtime";
4660
6936
  function FeatureCard({
4661
6937
  id,
4662
6938
  featureKey,
@@ -4675,7 +6951,7 @@ function FeatureCard({
4675
6951
  largeControls = false
4676
6952
  }) {
4677
6953
  const cardTitle = typeof title === "string" ? title : void 0;
4678
- return /* @__PURE__ */ jsxs31(
6954
+ return /* @__PURE__ */ jsxs36(
4679
6955
  "div",
4680
6956
  {
4681
6957
  id,
@@ -4684,27 +6960,27 @@ function FeatureCard({
4684
6960
  className: `arap-feature arap-feature-card ${status !== "idle" ? `arap-feature-${status}` : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
4685
6961
  style,
4686
6962
  children: [
4687
- /* @__PURE__ */ jsxs31("div", { className: "arap-card-header", children: [
4688
- /* @__PURE__ */ jsxs31("span", { className: "arap-label", children: [
4689
- icon ?? (featureKey ? /* @__PURE__ */ jsx34(FeatureIcon, { name: featureKey }) : null),
4690
- /* @__PURE__ */ jsx34("span", { className: "arap-card-title", children: title })
6963
+ /* @__PURE__ */ jsxs36("div", { className: "arap-card-header", children: [
6964
+ /* @__PURE__ */ jsxs36("span", { className: "arap-label", children: [
6965
+ icon ?? (featureKey ? /* @__PURE__ */ jsx39(FeatureIcon, { name: featureKey }) : null),
6966
+ /* @__PURE__ */ jsx39("span", { className: "arap-card-title", children: title })
4691
6967
  ] }),
4692
- statusBadge && /* @__PURE__ */ jsx34("span", { className: "arap-status-badge", "aria-hidden": "true", children: statusBadge })
6968
+ statusBadge && /* @__PURE__ */ jsx39("span", { className: "arap-status-badge", "aria-hidden": "true", children: statusBadge })
4693
6969
  ] }),
4694
- description && /* @__PURE__ */ jsx34("p", { className: "arap-card-desc", children: description }),
4695
- status === "error" && errorMessage && /* @__PURE__ */ jsxs31("div", { className: "arap-card-alert arap-card-error", role: "alert", children: [
4696
- /* @__PURE__ */ jsx34("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
4697
- /* @__PURE__ */ jsx34("span", { children: errorMessage })
6970
+ description && /* @__PURE__ */ jsx39("p", { className: "arap-card-desc", children: description }),
6971
+ status === "error" && errorMessage && /* @__PURE__ */ jsxs36("div", { className: "arap-card-alert arap-card-error", role: "alert", children: [
6972
+ /* @__PURE__ */ jsx39("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
6973
+ /* @__PURE__ */ jsx39("span", { children: errorMessage })
4698
6974
  ] }),
4699
- status === "unavailable" && unavailableMessage && /* @__PURE__ */ jsxs31("div", { className: "arap-card-alert arap-card-unavailable", role: "status", children: [
4700
- /* @__PURE__ */ jsx34("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u2139\uFE0F" }),
4701
- /* @__PURE__ */ jsx34("span", { children: unavailableMessage })
6975
+ status === "unavailable" && unavailableMessage && /* @__PURE__ */ jsxs36("div", { className: "arap-card-alert arap-card-unavailable", role: "status", children: [
6976
+ /* @__PURE__ */ jsx39("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u2139\uFE0F" }),
6977
+ /* @__PURE__ */ jsx39("span", { children: unavailableMessage })
4702
6978
  ] }),
4703
- status === "permission-required" && permissionMessage && /* @__PURE__ */ jsxs31("div", { className: "arap-card-alert arap-card-permission", role: "status", children: [
4704
- /* @__PURE__ */ jsx34("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u{1F512}" }),
4705
- /* @__PURE__ */ jsxs31("div", { className: "arap-permission-content", children: [
4706
- /* @__PURE__ */ jsx34("span", { children: permissionMessage }),
4707
- onRequestPermission && /* @__PURE__ */ jsx34(
6979
+ status === "permission-required" && permissionMessage && /* @__PURE__ */ jsxs36("div", { className: "arap-card-alert arap-card-permission", role: "status", children: [
6980
+ /* @__PURE__ */ jsx39("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u{1F512}" }),
6981
+ /* @__PURE__ */ jsxs36("div", { className: "arap-permission-content", children: [
6982
+ /* @__PURE__ */ jsx39("span", { children: permissionMessage }),
6983
+ onRequestPermission && /* @__PURE__ */ jsx39(
4708
6984
  "button",
4709
6985
  {
4710
6986
  type: "button",
@@ -4715,198 +6991,19 @@ function FeatureCard({
4715
6991
  )
4716
6992
  ] })
4717
6993
  ] }),
4718
- /* @__PURE__ */ jsx34("div", { className: "arap-card-content", children })
4719
- ]
4720
- }
4721
- );
4722
- }
4723
-
4724
- // src/core/controls/FeatureStatusState.tsx
4725
- import { jsx as jsx35, jsxs as jsxs32 } from "react/jsx-runtime";
4726
- function SearchCount({
4727
- totalCount,
4728
- matchedCount,
4729
- query,
4730
- className = "",
4731
- style
4732
- }) {
4733
- const text = query ? `Showing ${matchedCount} of ${totalCount} tools matching "${query}"` : `Showing all ${totalCount} tools`;
4734
- return /* @__PURE__ */ jsx35(
4735
- "div",
4736
- {
4737
- role: "status",
4738
- "aria-live": "polite",
4739
- className: `arap-search-count ${className}`,
4740
- style,
4741
- children: text
4742
- }
4743
- );
4744
- }
4745
- function EmptyState({
4746
- title = "No matching tools found",
4747
- description = "Try adjusting your search query or reset filters.",
4748
- actionLabel = "Clear search",
4749
- onAction,
4750
- icon,
4751
- className = "",
4752
- style
4753
- }) {
4754
- return /* @__PURE__ */ jsxs32(
4755
- "div",
4756
- {
4757
- role: "status",
4758
- className: `arap-empty-state ${className}`,
4759
- style,
4760
- children: [
4761
- /* @__PURE__ */ jsx35("div", { className: "arap-empty-icon", "aria-hidden": "true", children: icon ?? "\u{1F50D}" }),
4762
- /* @__PURE__ */ jsx35("h3", { className: "arap-empty-title", children: title }),
4763
- /* @__PURE__ */ jsx35("p", { className: "arap-empty-desc", children: description }),
4764
- onAction && /* @__PURE__ */ jsx35("button", { type: "button", className: "arap-empty-btn", onClick: onAction, children: actionLabel })
4765
- ]
4766
- }
4767
- );
4768
- }
4769
- function ErrorState({
4770
- title = "Something went wrong",
4771
- message,
4772
- onRetry,
4773
- retryLabel = "Try again",
4774
- className = "",
4775
- style
4776
- }) {
4777
- return /* @__PURE__ */ jsxs32(
4778
- "div",
4779
- {
4780
- role: "alert",
4781
- className: `arap-error-state arap-card-alert arap-card-error ${className}`,
4782
- style,
4783
- children: [
4784
- /* @__PURE__ */ jsx35("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
4785
- /* @__PURE__ */ jsxs32("div", { className: "arap-error-content", children: [
4786
- title && /* @__PURE__ */ jsx35("h4", { className: "arap-error-title", children: title }),
4787
- /* @__PURE__ */ jsx35("p", { className: "arap-error-message", children: message }),
4788
- onRetry && /* @__PURE__ */ jsx35("button", { type: "button", className: "arap-retry-btn", onClick: onRetry, children: retryLabel })
4789
- ] })
4790
- ]
4791
- }
4792
- );
4793
- }
4794
-
4795
- // src/core/controls/ProfilePreviewCard.tsx
4796
- import { jsx as jsx36, jsxs as jsxs33 } from "react/jsx-runtime";
4797
- function ProfilePreviewCard({
4798
- profile,
4799
- isActive,
4800
- onApply,
4801
- onRevert,
4802
- largeControls = false,
4803
- className = "",
4804
- style
4805
- }) {
4806
- const affectedKeys = Object.keys(
4807
- profile.settings
4808
- );
4809
- const formatKeyName = (key) => {
4810
- switch (key) {
4811
- case "fontScale":
4812
- return "Font Size";
4813
- case "lineHeight":
4814
- return "Line Height";
4815
- case "contrastMode":
4816
- return "Contrast";
4817
- case "reduceMotion":
4818
- return "Reduce Motion";
4819
- case "textAlign":
4820
- return "Text Align";
4821
- case "highlightLinks":
4822
- return "Highlight Links";
4823
- case "highlightFocus":
4824
- return "Highlight Focus";
4825
- case "cursorSize":
4826
- return "Cursor Size";
4827
- case "readerMode":
4828
- return "Reading Mode";
4829
- case "saturation":
4830
- return "Saturation";
4831
- case "hideDecorativeImages":
4832
- return "Hide Images";
4833
- default:
4834
- return key.replace(/([A-Z])/g, " $1").trim();
4835
- }
4836
- };
4837
- const formatSettingValue = (key, val) => {
4838
- if (typeof val === "boolean") return val ? "On" : "Off";
4839
- if (key === "fontScale" && typeof val === "number")
4840
- return `${Math.round(val * 100)}%`;
4841
- if (key === "lineHeight" && typeof val === "number")
4842
- return `${Math.round(val * 100)}%`;
4843
- if (val === null || val === void 0) return "Original";
4844
- return String(val);
4845
- };
4846
- return /* @__PURE__ */ jsxs33(
4847
- "div",
4848
- {
4849
- role: "group",
4850
- "aria-label": `${profile.label} profile`,
4851
- className: `arap-profile-card ${isActive ? "arap-profile-card-active" : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
4852
- style,
4853
- children: [
4854
- /* @__PURE__ */ jsxs33("div", { className: "arap-profile-header", children: [
4855
- /* @__PURE__ */ jsxs33("div", { className: "arap-profile-title-row", children: [
4856
- /* @__PURE__ */ jsx36("h4", { className: "arap-profile-title", children: profile.label }),
4857
- isActive && /* @__PURE__ */ jsx36(
4858
- "span",
4859
- {
4860
- className: "arap-profile-active-badge",
4861
- "aria-label": "Active profile",
4862
- children: "\u2713 Active"
4863
- }
4864
- )
4865
- ] }),
4866
- /* @__PURE__ */ jsx36("p", { className: "arap-profile-desc", children: profile.description })
4867
- ] }),
4868
- /* @__PURE__ */ jsxs33("div", { className: "arap-profile-affected", children: [
4869
- /* @__PURE__ */ jsx36("span", { className: "arap-profile-affected-label", children: "Affected settings:" }),
4870
- /* @__PURE__ */ jsx36("div", { className: "arap-profile-chips", children: affectedKeys.map((key) => {
4871
- const val = profile.settings[key];
4872
- return /* @__PURE__ */ jsxs33("span", { className: "arap-profile-chip", children: [
4873
- /* @__PURE__ */ jsxs33("strong", { children: [
4874
- formatKeyName(key),
4875
- ":"
4876
- ] }),
4877
- " ",
4878
- formatSettingValue(key, val)
4879
- ] }, key);
4880
- }) })
4881
- ] }),
4882
- /* @__PURE__ */ jsx36("div", { className: "arap-profile-actions", children: isActive ? /* @__PURE__ */ jsx36(
4883
- "button",
4884
- {
4885
- type: "button",
4886
- className: "arap-profile-revert-btn",
4887
- onClick: onRevert,
4888
- "aria-label": `Revert ${profile.label} profile`,
4889
- children: "Revert to custom settings"
4890
- }
4891
- ) : /* @__PURE__ */ jsx36(
4892
- "button",
4893
- {
4894
- type: "button",
4895
- className: "arap-profile-apply-btn",
4896
- onClick: () => onApply(profile),
4897
- "aria-label": `Apply ${profile.label} profile`,
4898
- children: "Apply Profile"
4899
- }
4900
- ) })
6994
+ /* @__PURE__ */ jsx39("div", { className: "arap-card-content", children })
4901
6995
  ]
4902
6996
  }
4903
6997
  );
4904
6998
  }
4905
6999
  export {
7000
+ ALLOWED_PREFERENCE_KEYS,
7001
+ ALL_PROFILE_IDS,
4906
7002
  AccessibilityButton,
4907
7003
  AccessibilityContext,
4908
7004
  AccessibilityList,
4909
7005
  AccessibilityPlugin,
7006
+ AccessibilityProfilesController,
4910
7007
  AccessibleTooltipsController,
4911
7008
  BigCursorController,
4912
7009
  CONTRAST_MODES,
@@ -4915,6 +7012,7 @@ export {
4915
7012
  ChoiceControl,
4916
7013
  ContrastController,
4917
7014
  ContrastModeController,
7015
+ CustomPresetsController,
4918
7016
  DEFAULT_PREFERENCES,
4919
7017
  DEFAULT_READING_MASK_HEIGHT,
4920
7018
  DYSLEXIA_FONT_STACK,
@@ -4927,6 +7025,7 @@ export {
4927
7025
  FontFamilyController,
4928
7026
  FontSizeController,
4929
7027
  GrayscaleController,
7028
+ HeadingsNavigatorController,
4930
7029
  HideDecorativeImagesController,
4931
7030
  HideImagesController,
4932
7031
  HideVideosController,
@@ -4941,8 +7040,14 @@ export {
4941
7040
  MAX_READING_MASK_HEIGHT,
4942
7041
  MIN_READING_MASK_HEIGHT,
4943
7042
  PROFILE_DEFINITIONS,
7043
+ PageNavigatorController,
7044
+ PageStructureController,
4944
7045
  ParagraphSpacingController,
7046
+ PresetsBackupController,
7047
+ PresetsController,
7048
+ ProfileController,
4945
7049
  ProfilePreviewCard,
7050
+ ProfilesController,
4946
7051
  READING_MASK_HEIGHT_PRESETS,
4947
7052
  ReadingGuideController,
4948
7053
  ReadingMaskController,
@@ -4950,6 +7055,7 @@ export {
4950
7055
  ResetController,
4951
7056
  SaturationController,
4952
7057
  SearchCount,
7058
+ SettingsImportExportController,
4953
7059
  SkipToMainLink,
4954
7060
  StepperControl,
4955
7061
  TEXT_ALIGN_BLOCK_SELECTOR,
@@ -4961,11 +7067,17 @@ export {
4961
7067
  ToggleControl,
4962
7068
  TooltipsController,
4963
7069
  WordSpacingController,
7070
+ applyCustomPresetToStore,
7071
+ applyProfileToStore,
7072
+ createCustomPreset,
4964
7073
  createInitialPreferencesState,
7074
+ downloadJsonFile,
4965
7075
  enLocale,
4966
7076
  enableAccessibleTooltips,
7077
+ exportPresetsToJson,
4967
7078
  findMainLandmark,
4968
7079
  getAuthoredDescription,
7080
+ getProfileDefinition,
4969
7081
  getScriptSpacingConstraints,
4970
7082
  hasFinePointer,
4971
7083
  isEligibleDecorativeImage,
@@ -4978,17 +7090,32 @@ export {
4978
7090
  isProtectedFromTextSpacing,
4979
7091
  isReducedMotionActive,
4980
7092
  isRtlLocale,
7093
+ isValidCustomPreset,
7094
+ mapFeaturesToProfileSettings,
7095
+ mapProfileSettingsToFeatures,
7096
+ navigateToElement,
4981
7097
  normalizePreferenceValue,
4982
7098
  normalizePreferences,
4983
7099
  nudgeReadingAid,
4984
7100
  positionTooltip,
4985
7101
  preferencesReducer,
7102
+ recordProfileOverride,
4986
7103
  registerLocale,
4987
7104
  resolveEffectivePreferences,
4988
7105
  resolveLocaleStrings,
7106
+ revertProfileFromStore,
7107
+ sanitizePreferences,
7108
+ scanHeadings,
7109
+ scanLandmarks,
7110
+ siLocale,
4989
7111
  subscribeFinePointer,
4990
7112
  subscribeForcedColors,
7113
+ subscribePageStructure,
4991
7114
  subscribeReducedMotion,
4992
- useAccessibility
7115
+ taLocale,
7116
+ useAccessibility,
7117
+ usePresets,
7118
+ useProfiles,
7119
+ validateAndParseImport
4993
7120
  };
4994
7121
  //# sourceMappingURL=index.mjs.map