import { S as ShortcutRepresentation } from './keyboardUtilities-BCP3UcLb.mjs'; import { B as BreakpointsMap, d as ThBreakpoints, e as ThBreakpointsObject, f as ThDocumentTitleFormat, T as ThBackLinkPref, g as ThFormatPref, h as ThRunningHeadFormat, i as ThProgressionFormat, j as ThLayoutUI, k as ThPaginatedAffordancePref } from './ui-DnZZhozX.mjs'; import { e as ThColorScheme, f as ThContrast, g as ThSettingsKeys, h as ThTextSettingsKeys, b as ThSpacingSettingsKeys, d as ThSettingsRangePrefRequired, i as ThSettingsRadioPref, T as ThLineHeightOptions, j as ThSettingsGroupPref, a as ThSpacingPresetKeys } from './useContrast-Bl08zDTU.mjs'; import { I as I18nValue, e as ThSheetTypes, g as ThActionsKeys, d as ThCollapsibility, c as ThActionsTokens, f as ThDockingPref, T as ThDockingKeys } from './actions-C33UN3Ji.mjs'; import { IContentProtectionConfig, IAudioContentProtectionConfig, ExperimentKey } from '@readium/navigator'; type CSSValueUnitless = `${number}`; type CSSValueWithUnit = `${number}${Unit}`; type CSSAbsoluteLength = CSSValueWithUnit<"cm" | "in" | "mm" | "pc" | "pt" | "px" | "Q">; type CSSAngle = CSSValueWithUnit<"deg" | "grad" | "rad" | "turn">; type CSSDefaultViewport = CSSValueWithUnit<"vb" | "vh" | "vi" | "vmax" | "vmin" | "vw">; type CSSDynamicViewport = CSSValueWithUnit<"dvb" | "dvh" | "dvi" | "dvmax" | "dvmin" | "dvw">; type CSSFrequency = CSSValueWithUnit<"Hz" | "kHz">; type CSSFontRelativeLength = CSSValueWithUnit<"cap" | "ch" | "em" | "ex" | "ic" | "lh">; type CSSLargeViewport = CSSValueWithUnit<"lvb" | "lvh" | "lvi" | "lvmax" | "lvmin" | "lvw">; type CSSPhysicalLength = CSSValueWithUnit<"cm" | "in" | "mm" | "pc" | "pt" | "Q">; type CSSRelativeLength = CSSFontRelativeLength | CSSValueWithUnit<"%"> | CSSRootFontRelativeLength; type CSSResolution = CSSValueWithUnit<"dpcm" | "dpi" | "dppx" | "x">; type CSSRootFontRelativeLength = CSSValueWithUnit<"rcap" | "rch" | "rem" | "rex" | "ric" | "rlh">; type CSSSmallViewport = CSSValueWithUnit<"svb" | "svh" | "svi" | "svmax" | "svmin" | "svw">; type CSSTime = CSSValueWithUnit<"ms" | "s">; type CSSViewport = CSSDefaultViewport | CSSDynamicViewport | CSSLargeViewport | CSSSmallViewport; type CSSColor = string | `#${string}` | `rgb(${string})` | `rgba(${string})` | `hsl(${string})` | `hsla(${string})` | `hwb(${string})` | `lab(${string})` | `lch(${string})` | `oklab(${string})` | `oklch(${string})` | `color(${string})` | `color-mix(${string})` | `light-dark(${string})`; interface SystemFontSource { type: "system"; } interface BunnyFontSource { type: "custom"; provider: "bunny"; } interface GoogleFontSource { type: "custom"; provider: "google"; } interface LocalStaticFontFile { path: string; weight: number; style: "normal" | "italic"; } interface LocalVariableFontFile { path: string; style?: "normal" | "italic"; } interface LocalStaticFontSource { type: "custom"; provider: "local"; variant: "static"; files: LocalStaticFontFile[]; } interface LocalVariableFontSource { type: "custom"; provider: "local"; variant: "variable"; files: LocalVariableFontFile[]; } type LocalFontSource = LocalStaticFontSource | LocalVariableFontSource; type FontSource = SystemFontSource | BunnyFontSource | GoogleFontSource | LocalFontSource; type VariableFontRangeConfig = { min: number; max: number; step?: number; }; type WeightConfig = { type: "static"; values: number[]; } | { type: "variable"; } & VariableFontRangeConfig; interface FontSpec { family: string; fallbacks: string[]; weights: WeightConfig; styles?: ("normal" | "italic")[]; widths?: VariableFontRangeConfig; display?: "swap" | "block" | "fallback" | "optional"; } interface FontDefinition { id: string; name: string; label?: I18nValue; source: FontSource; spec: FontSpec; } type FontCollection = Record; type ValidatedLanguageCollection = { fonts: FontCollection; supportedLanguages: string[]; }; type ThFontFamilyPref = { default: FontCollection; } | { [K in Exclude]: ValidatedLanguageCollection; }; declare const readiumCSSFontCollection: FontCollection; declare const defaultFontCollection: FontCollection; declare const tamilCollection: { [x: string]: FontDefinition; }; declare const arabicFarsiCollection: FontCollection; declare const hebrewCollection: FontCollection; declare const chineseSimplifiedCollection: FontCollection; declare const chineseTraditionalCollection: FontCollection; declare const japaneseCollection: FontCollection; declare const japaneseVerticalCollection: FontCollection; declare const koreanCollection: FontCollection; interface CopyProtectionConfig { /** Maximum percentage of content that can be selected (0-1) */ maxSelectionPercent: number; /** Minimum number of characters that can be selected before protection kicks in */ minThreshold: number; /** Absolute maximum number of characters that can be copied in total */ absoluteMaxChars: number; /** Number of recent copy attempts to keep in history for pattern analysis */ historySize: number; } interface PrintProtectionConfig { /** Disable printing completely */ disable?: boolean; /** Optional watermark text to show when printing is disabled */ watermark?: I18nValue; } interface ContentProtectionConfig { /** * Higher-level API will make use of the following from Content Protection API: * - checkAutomation * - checkIFrameEmbedding * - monitorSelection * - monitorDevTools * - monitorScrollingExperimental */ /** * Configure copy protection * - boolean: true to enable with default settings, false to disable * - object: Fine-grained control over copy protection */ protectCopy?: boolean | CopyProtectionConfig; /** Disable right-click context menu */ disableContextMenu?: boolean; /** Disable drag and drop functionality */ disableDragAndDrop?: boolean; /** Print protection configuration */ protectPrinting?: PrintProtectionConfig; /** Disable Select All functionality (Ctrl+A/Cmd+A) */ disableSelectAll?: boolean; /** Disable Save functionality (Ctrl+S/Cmd+S) */ disableSave?: boolean; /** Monitor developer tools for suspicious activity. We need it for the shortcut protection */ monitorDevTools?: boolean; /** Prevent casting to remote devices via the Remote Playback API. */ disableRemotePlayback?: boolean; } /** * Resolves content protection configuration with localized strings * @param contentProtection The content protection config to resolve * @param t Translation function that supports defaultValue option * @returns Resolved content protection config compatible with navigator */ declare const resolveContentProtectionConfig: (contentProtection: ContentProtectionConfig | undefined, t: (key: string, options?: { defaultValue?: string; }) => string) => IContentProtectionConfig | undefined; /** * Audio-specific content protection configuration. * Differs from ContentProtectionConfig in that protectCopy is boolean only, * since audio does not support selection-based copy protection. */ type AudioContentProtectionConfig = Omit & { /** Block copy events (Ctrl+C / Cmd+C) */ protectCopy?: boolean; }; /** * Resolves audio content protection configuration with localized strings */ declare const resolveAudioContentProtectionConfig: (contentProtection: AudioContentProtectionConfig | undefined, t: (key: string, options?: { defaultValue?: string; }) => string) => IAudioContentProtectionConfig | undefined; /** * Default content protection configuration */ declare const defaultContentProtectionConfig: ContentProtectionConfig; /** * Default audio content protection configuration */ declare const defaultAudioContentProtectionConfig: AudioContentProtectionConfig; /** * Development content protection configuration - disables all protections */ declare const devContentProtectionConfig: { protectCopy: boolean; disableContextMenu: boolean; disableDragAndDrop: boolean; protectPrinting: { disable: boolean; }; disableSelectAll: boolean; disableSave: boolean; monitorDevTools: boolean; disableRemotePlayback: boolean; }; declare enum ThThemeKeys { light = "light", sepia = "sepia", dark = "dark", paper = "paper", contrast1 = "contrast1", contrast2 = "contrast2", contrast3 = "contrast3" } declare const lightTheme: { background: string; text: string; link: string; visited: string; subdue: string; disable: string; hover: string; onHover: string; select: string; onSelect: string; focus: string; elevate: string; immerse: string; }; declare const darkTheme: { background: string; text: string; link: string; visited: string; subdue: string; disable: string; hover: string; onHover: string; select: string; onSelect: string; focus: string; elevate: string; immerse: string; }; declare const paperTheme: { background: string; text: string; link: string; visited: string; subdue: string; disable: string; hover: string; onHover: string; select: string; onSelect: string; focus: string; elevate: string; immerse: string; }; declare const sepiaTheme: { background: string; text: string; link: string; visited: string; subdue: string; disable: string; hover: string; onHover: string; select: string; onSelect: string; focus: string; elevate: string; immerse: string; }; declare const contrast1Theme: { background: string; text: string; link: string; visited: string; subdue: string; disable: string; hover: string; onHover: string; select: string; onSelect: string; focus: string; elevate: string; immerse: string; }; declare const contrast2Theme: { background: string; text: string; link: string; visited: string; subdue: string; disable: string; hover: string; onHover: string; select: string; onSelect: string; focus: string; elevate: string; immerse: string; }; declare const contrast3Theme: { background: string; text: string; link: string; visited: string; subdue: string; disable: string; hover: string; onHover: string; select: string; onSelect: string; focus: string; elevate: string; immerse: string; }; interface ThemeTokens { background: CSSColor; text: CSSColor; link: CSSColor; visited: CSSColor; subdue: CSSColor; disable: CSSColor; hover: CSSColor; onHover: CSSColor; select: CSSColor; onSelect: CSSColor; focus: CSSColor; elevate: string; immerse: string; } interface useThemingProps { theme?: string; themeKeys: { [key in T]?: ThemeTokens; }; systemKeys?: { light: T; dark: T; }; breakpointsMap: BreakpointsMap; initProps?: Record; coverUrl?: string; autoThemeSource?: "cover" | "system"; onCoverThemeGenerated?: (themeTokens: ThemeTokens) => void; onBreakpointChange?: (breakpoint: ThBreakpoints | null) => void; onColorSchemeChange?: (colorScheme: ThColorScheme) => void; onContrastChange?: (contrast: ThContrast) => void; onForcedColorsChange?: (forcedColors: boolean) => void; onMonochromeChange?: (isMonochrome: boolean) => void; onReducedMotionChange?: (reducedMotion: boolean) => void; onReducedTransparencyChange?: (reducedTransparency: boolean) => void; onContainerBreakpointChange?: (breakpoint: ThBreakpoints | null) => void; } declare const useTheming: ({ theme, systemKeys, themeKeys, breakpointsMap, initProps, coverUrl, autoThemeSource, onBreakpointChange, onColorSchemeChange, onContrastChange, onForcedColorsChange, onMonochromeChange, onReducedMotionChange, onReducedTransparencyChange, onCoverThemeGenerated, onContainerBreakpointChange, }: useThemingProps) => { inferThemeAuto: () => T | undefined; theme: string | undefined; breakpoints: ThBreakpointsObject; colorScheme: ThColorScheme; contrast: ThContrast; forcedColors: boolean; monochrome: boolean; reducedMotion: boolean; reducedTransparency: boolean; coverThemeTokens: ThemeTokens | null; themeResolved: boolean; setContainerRef: (el: Element | null) => void; }; interface ThGlobalPreferences { locale?: string; } declare const createGlobalPreferences: (params: ThGlobalPreferences) => ThGlobalPreferences; interface ThGlobalPreferencesAdapter { getPreferences(): ThGlobalPreferences; setPreferences(prefs: ThGlobalPreferences): void; subscribe(callback: (prefs: ThGlobalPreferences) => void): void; unsubscribe(callback: (prefs: ThGlobalPreferences) => void): void; } type CustomizableKeys = { action?: string; theme?: string; settings?: string; text?: string; spacing?: string; }; type DefaultKeys = { action: ThActionsKeys; theme: ThThemeKeys; settings: ThSettingsKeys; text: ThTextSettingsKeys; spacing: ThSpacingSettingsKeys; }; type ActionKey = K extends { action: infer A; } ? A extends string ? ThActionsKeys | A : ThActionsKeys : ThActionsKeys; type ThemeKey = K extends { theme: infer T; } ? T extends string ? ThThemeKeys | T : ThThemeKeys : ThThemeKeys; type SettingsKey = K extends { settings: infer S; } ? S extends string ? ThSettingsKeys | S : ThSettingsKeys : ThSettingsKeys; type TextSettingsKey = K extends { text: infer T; } ? T extends string ? ThTextSettingsKeys | T : ThTextSettingsKeys : ThTextSettingsKeys; type SpacingSettingsKey = K extends { spacing: infer S; } ? S extends string ? ThSpacingSettingsKeys | S : ThSpacingSettingsKeys : ThSpacingSettingsKeys; interface ThSettingsSpacingPresets { reflowOrder: Array; webPubOrder: Array; keys: { [key in Exclude]?: ThSpacingPreset; }; } type ThSpacingPreset = { [ThSpacingSettingsKeys.letterSpacing]?: number; [ThSpacingSettingsKeys.lineHeight]?: ThLineHeightOptions; [ThSpacingSettingsKeys.paragraphIndent]?: number; [ThSpacingSettingsKeys.paragraphSpacing]?: number; [ThSpacingSettingsKeys.wordSpacing]?: number; } & (K extends { spacing: infer S; } ? S extends string ? { [key in S]?: number | ThLineHeightOptions; } : {} : {}); interface ThActionsPref { reflowOrder: Array>; fxlOrder: Array>; webPubOrder: Array>; collapse: ThCollapsibility; keys: Record, ThActionsTokens>; } type ThSettingsKeyTypes = { [ThSettingsKeys.fontFamily]: ThFontFamilyPref; [ThSettingsKeys.letterSpacing]: ThSettingsRangePrefRequired; [ThSettingsKeys.lineHeight]: ThSettingsRadioPref>; [ThSettingsKeys.paragraphIndent]: ThSettingsRangePrefRequired; [ThSettingsKeys.paragraphSpacing]: ThSettingsRangePrefRequired; [ThSettingsKeys.wordSpacing]: ThSettingsRangePrefRequired; [ThSettingsKeys.zoom]: ThSettingsRangePrefRequired; } & (K extends { settings: infer S; } ? S extends string ? { [key in S]: any; } : {} : {}); type ThConstraintKeys = Extract | "pagination" | "dropdown"; type ThShortcutsDisplayIn = "tooltip" | "menuItem"; interface ThShortcutsPref { representation: ShortcutRepresentation; joiner?: string; displayIn?: ThShortcutsDisplayIn[]; } interface ThIconPref { size: number; tooltipOffset: number; tooltipDelay?: number; } interface ThLayoutDefaultsPref { dockingWidth: number; scrim: string; } interface ThPreferences { experiments?: { reflow?: Array; webPub?: Array; }; metadata?: { documentTitle?: { format: I18nValue; }; }; typography: { minimalLineLength?: number | null; maximalLineLength?: number | null; optimalLineLength: number; pageGutter: number; }; theming: { header?: { backLink?: ThBackLinkPref | null; runningHead?: { format?: { reflow?: ThFormatPref; fxl?: ThFormatPref; webPub?: ThFormatPref; }; }; }; progression?: { format?: { reflow?: ThFormatPref>; fxl?: ThFormatPref>; webPub?: ThFormatPref>; }; }; arrow: { size: number; offset: number; tooltipDelay?: number; }; icon: ThIconPref; layout: { ui?: { reflow?: ThLayoutUI; fxl?: ThLayoutUI; webPub?: ThLayoutUI; }; radius: number; spacing: number; defaults: ThLayoutDefaultsPref; constraints?: { [key in ThConstraintKeys]?: number | null; }; }; breakpoints: BreakpointsMap; themes: { reflowOrder: Array | "auto">; fxlOrder: Array | "auto">; systemThemes?: { light: ThemeKey; dark: ThemeKey; }; keys: Record, "auto"> & string, ThemeTokens>; }; }; contentProtection?: ContentProtectionConfig; affordances: { scroll: { hintInImmersive: boolean; toggleOnMiddlePointer: Array<"tap" | "click">; hideOnForwardScroll: boolean; showOnBackwardScroll: boolean; }; paginated: { reflow: ThPaginatedAffordancePref; fxl: ThPaginatedAffordancePref; }; }; actions: ThActionsPref; shortcuts: ThShortcutsPref; docking: ThDockingPref; settings: { reflowOrder: Array>; fxlOrder: Array>; webPubOrder: Array>; keys: ThSettingsKeyTypes; text: ThSettingsGroupPref>; spacing: ThSettingsGroupPref> & { presets?: ThSettingsSpacingPresets; }; }; } /** * Creates a new preferences object with the provided parameters * @param params The preferences object to create * @returns A new preferences object */ declare const createPreferences: (params: ThPreferences) => ThPreferences; type ActionKeyType = K["action"] extends string ? K["action"] : ThActionsKeys; type ThemeKeyType = K["theme"] extends string ? K["theme"] : ThThemeKeys; type SettingsKeyType = K["settings"] extends string ? K["settings"] : ThSettingsKeys; type TextSettingsKeyType = K["text"] extends string ? K["text"] : ThTextSettingsKeys; type SpacingSettingsKeyType = K["spacing"] extends string ? K["spacing"] : ThSpacingSettingsKeys; interface ThPreferencesAdapter { getPreferences(): ThPreferences; setPreferences(prefs: ThPreferences): void; subscribe(callback: (prefs: ThPreferences) => void): void; unsubscribe(callback: (prefs: ThPreferences) => void): void; } export { type CSSColor as $, type ActionKey as A, type SpacingSettingsKeyType as B, type CustomizableKeys as C, type DefaultKeys as D, type useThemingProps as E, type FontCollection as F, type CSSValueUnitless as G, type CSSValueWithUnit as H, type CSSAbsoluteLength as I, type CSSAngle as J, type CSSDefaultViewport as K, type LocalStaticFontFile as L, type CSSDynamicViewport as M, type CSSFrequency as N, type CSSFontRelativeLength as O, type CSSLargeViewport as P, type CSSPhysicalLength as Q, type CSSRelativeLength as R, type SettingsKey as S, ThThemeKeys as T, type CSSResolution as U, type VariableFontRangeConfig as V, type WeightConfig as W, type CSSRootFontRelativeLength as X, type CSSSmallViewport as Y, type CSSTime as Z, type CSSViewport as _, type ThemeTokens as a, type SystemFontSource as a0, type BunnyFontSource as a1, type GoogleFontSource as a2, type LocalVariableFontFile as a3, type LocalStaticFontSource as a4, type LocalVariableFontSource as a5, type LocalFontSource as a6, type FontSource as a7, type FontSpec as a8, type ValidatedLanguageCollection as a9, type ThFontFamilyPref as aa, readiumCSSFontCollection as ab, defaultFontCollection as ac, tamilCollection as ad, arabicFarsiCollection as ae, hebrewCollection as af, chineseSimplifiedCollection as ag, chineseTraditionalCollection as ah, japaneseCollection as ai, japaneseVerticalCollection as aj, koreanCollection as ak, type CopyProtectionConfig as al, type PrintProtectionConfig as am, type ContentProtectionConfig as an, resolveContentProtectionConfig as ao, resolveAudioContentProtectionConfig as ap, defaultContentProtectionConfig as aq, defaultAudioContentProtectionConfig as ar, devContentProtectionConfig as as, lightTheme as at, darkTheme as au, paperTheme as av, sepiaTheme as aw, contrast1Theme as ax, contrast2Theme as ay, contrast3Theme as az, type AudioContentProtectionConfig as b, type ThShortcutsPref as c, type ThPreferencesAdapter as d, type ThPreferences as e, type ThGlobalPreferences as f, type ThGlobalPreferencesAdapter as g, type FontDefinition as h, type ThIconPref as i, type ThLayoutDefaultsPref as j, createGlobalPreferences as k, type ThemeKey as l, type TextSettingsKey as m, type SpacingSettingsKey as n, type ThSettingsSpacingPresets as o, type ThSpacingPreset as p, type ThActionsPref as q, type ThSettingsKeyTypes as r, type ThConstraintKeys as s, type ThShortcutsDisplayIn as t, useTheming as u, createPreferences as v, type ActionKeyType as w, type ThemeKeyType as x, type SettingsKeyType as y, type TextSettingsKeyType as z };