import { $ as WidgetTypeName, A as FONT_FAMILY_KEYS, B as SEMANTIC_COLOR_NAMES, C as sectionLayoutConfig, D as RepAppManifest, E as RepAppData, F as RADIUS_KEYS, G as ThemePayload, H as ThemeColorInput, I as RadiusKey, J as WIDGET_TYPE_NAMES, K as AnyComponent, L as ResolvedColorSet, M as FontFamilyKey, N as FontSizeKey, O as RepAppProfile, P as OklchPlain, Q as WidgetType, R as ResolvedSemanticColor, S as SectionLayoutType, T as NavigationItem, U as ThemeColorPlain, V as SemanticColorName, W as ThemeDefinition, X as WidgetRegistry, Y as WidgetPath, Z as WidgetSchema, _ as ColorOptions, _t as extractPropertyValues, b as GapOptions, d as AlignOptions, dt as PropertyFieldSchema, et as assertDefined, f as BackgroundType, ft as PropertyFieldType, g as ButtonSizeOptions, gt as applyPropertyValues, h as BorderWidthOptions, ht as WidgetPropertySchema, j as FONT_SIZE_KEYS, k as ScreenDefinition$1, m as BorderRadiusOptions, mt as TabConfig, n as PortalFunction, nt as isWidgetType, o as PortalFunctionHandler, ot as RemoteDomWidgetDefinition, p as BackgroundValue, pt as QuoteListItem, q as TypedWidgetSchema, r as PortalFunctionDefinition, rt as isWidgetTypeName, s as PortalFunctionImplementation, st as RemoteDomWidgetPackageDescriptor, tt as assertNever, u as implementPortalFunction, ut as PROPERTY_FIELD_TYPES, v as FontSizeOptions, vt as groupPropertyFields, w as ShareableItem, x as PaddingOptions, y as FontWeightOptions, yt as isPropertyFieldType, z as ResolvedTheme } from "./portal-function-VhLYKC5u.cjs"; import { a as buildRemoteWidgetRegistry, c as RemoteDomCapabilityMode, t as RemoteDomWidgetRegistryOptions } from "./build-widget-registry-C7BPrtGS.cjs"; import { a as gapValues, i as WidgetManifest, n as buildRemoteWidgetPluginManifests, r as getRemoteWidgetPackageCategoryId, t as RemoteWidgetPluginHostOptions } from "./build-remote-widget-plugin-manifests-CU6MRWan.cjs"; import React$1, { AnchorHTMLAttributes, ComponentProps, ComponentType, ErrorInfo, ReactElement, ReactNode } from "react"; import { QueryClient, UseQueryResult } from "@tanstack/react-query"; import Color from "colorjs.io"; import { RemoteDomFullscreenRequest, RemoteDomSerializableValue } from "@fluid-app/widget-runtime/remote-dom"; import { RemoteComponentRendererMap } from "@remote-dom/react/host"; //#region src/types/config.d.ts /** * Configuration for the Fluid SDK. * Use Readonly when the config should not be modified after creation. */ interface FluidSDKConfig { /** * Base URL for the Fluid API domain (e.g., "https://api.fluid.app"). * Endpoints include their full path from root (e.g., "/api/reps/me"). */ readonly baseUrl: string; /** * Optional token getter for contexts where session cookies are unavailable * (e.g., the cross-origin builder preview iframe). Not used in normal * portal operation — auth is handled by session cookies via `credentials: 'include'`. */ readonly getAuthToken?: () => string | null | Promise; /** * Callback invoked when a 401 authentication error occurs * Use this to trigger re-authentication flows */ readonly onAuthError?: () => void; /** * Default headers to include in all requests * Example: { "x-fluid-client": "portal" } */ readonly defaultHeaders?: Readonly>; /** * Override WebSocket URL for real-time messaging. * Default: derived from baseUrl by replacing trailing /api with /cable */ readonly websocketUrl?: string; /** * ISO country code for the store/merchant (e.g., "US", "CA", "GB"). * Used to fetch country-specific payment methods. * @default "US" */ readonly countryIso?: string; /** * SmartyStreets embedded autocomplete key. When omitted, the address * autocomplete in the address modals falls back to a plain text input. * The key is referer-locked, so each environment's hostnames must be * added to the SmartyStreets allowlist. */ readonly smartyEmbeddedKey?: string; /** * Google Maps Static API key. When provided, order detail screens * display a static map image of the shipping address. */ readonly googleMapsApiKey?: string; } //#endregion //#region ../../platform/theme-engine/src/color-engine.d.ts /** * Attempt to convert any string into a Color using colorjs.io. * If the string is exactly 6 hex digits it is assumed to be a bare hex value * (e.g. "3b82f6") and a "#" prefix is added before parsing. Six-letter * named colours like "orange" or "maroon" are left untouched. * * @returns the parsed Color, or a neutral gray (`oklch(0.5 0 0)`) on failure */ declare function parseColor(value: string): Color; /** * Returns either the original foreground or a corrected lightness variant, * whichever provides better contrast against `color`. * Inversion triggers when the |APCA contrast| is below 50 — APCA is signed * (negative for dark-on-light, positive for light-on-dark), so comparing the * absolute value avoids flipping dark text that already contrasts well on a * medium background. */ declare function getForegroundColor(foreground: Color, color: Color): Color; /** * Derive a dark-mode ThemeColorInput from its light-mode counterpart. */ declare function deriveDarkVariant(name: SemanticColorName, light: ThemeColorInput): ThemeColorInput; /** * Merge auto-derived dark colors with any user-specified overrides. * For each semantic color, if the user has fully overridden both base and * foreground those are used; otherwise the missing channels are derived. */ declare function mergeDarkOverrides(def: ThemeDefinition): Record; /** * Resolve a ThemeDefinition into a complete ResolvedTheme. * Dark mode colors are derived from light where not overridden. */ declare function resolveTheme(def: ThemeDefinition): ResolvedTheme; //#endregion //#region ../../platform/theme-engine/src/css-generator.d.ts interface GenerateThemeCSSOptions { /** Whether or not to allow prefers-color-scheme to choose the theme mode */ disableAutoTheme?: boolean; /** Whether to emit Tailwind built-in color overrides (default true) */ mapTailwindColors?: boolean; } /** * Generate a complete CSS string for a resolved theme. * Outputs 2–3 blocks: light default, dark explicit via `[data-theme-mode="dark"]`, * and (unless `disableAutoTheme`) a `prefers-color-scheme: dark` media query block. */ declare function generateThemeCSS(theme: ResolvedTheme, options?: GenerateThemeCSSOptions): string; //#endregion //#region ../../platform/theme-engine/src/serialisation.d.ts /** * Serialise a ThemeDefinition (with Color objects) to a plain JSON payload * suitable for backend storage. */ declare function serialiseTheme(def: ThemeDefinition): ThemePayload; /** * Deserialise a backend payload into a ThemeDefinition with Color objects. * Accepts `Record` because API data is untyped at the boundary. * Falls back to default colors for any missing light-mode entries. */ declare function deserialiseTheme(payload: Record): ThemeDefinition; //#endregion //#region ../../platform/theme-engine/src/transforms.d.ts /** Shape of a raw theme from the FluidOS API */ interface RawApiTheme { id: number; config?: Record | null; active?: boolean | null; name?: string | null; } /** * Build a ThemeDefinition from a single API theme object. * Handles both new structured format and legacy flat format. */ declare function buildThemeDefinition(theme: RawApiTheme): ThemeDefinition; /** * Transform raw API themes to ThemeDefinition[]. * Catches and logs errors per theme (graceful degradation). */ declare function transformThemes(themes: RawApiTheme[]): ThemeDefinition[]; /** * Get the active theme ID from a list of raw API themes. * Falls back to the first theme if none is marked active. */ declare function getActiveThemeId(themes: RawApiTheme[]): string | undefined; //#endregion //#region ../../platform/theme-engine/src/theme-applicator.d.ts /** * Inject or update a `