import { p as LicenseContextValue, q as LicenseProviderProps, s as LicenseGateProps } from './trial-ByaOqPZz.js'; export { D as DEFAULT_API_BASE, a as LicenseActivation, b as LicenseCache, c as LicenseConfig, d as LicenseError, L as LicenseState, t as LicenseTier, u as LicenseWarningProps, P as PolarActivateResponse, g as PolarValidateResponse, T as TrialConfig, w as TrialContextValue, V as ValidateOptions, j as getCurrentDomain, k as getDaysLeft, l as isDevEnvironment, m as isEphemeralHost, r as resolveApiBase, o as validateLicenseKey } from './trial-ByaOqPZz.js'; import * as react_jsx_runtime from 'react/jsx-runtime'; import * as react from 'react'; import 'zod'; declare const LicenseContext: react.Context; declare const LicenseRenderContext: react.Context; declare function LicenseProvider({ licenseKey, organizationId, apiBase, trialDays, trialIssuedAt, children, onValidate, onError, }: LicenseProviderProps): react_jsx_runtime.JSX.Element; /** * Soft gate for Tour Kit Pro packages. * * Renders children unconditionally; on non-localhost hosts without a valid * license, layers a single small badge ({@link LicenseWatermark}) and a * dev-only console warning ({@link LicenseWarning}) on top. Tolerates a * missing `` so Pro packages stay rendered during evaluation. */ declare function LicenseGate({ require: _require, children, fallback, loading }: LicenseGateProps): react_jsx_runtime.JSX.Element; declare function LicenseWatermark(): react.ReactPortal | null; declare function LicenseWarning(): null; interface ProGateProps { /** The npm package name being gated (shown in placeholder + console) */ package: string; children: react.ReactNode; } /** * Hard gate for Tour Kit Pro packages. * Renders children when licensed, a branded placeholder when not. * Dev environments (localhost, 127.0.0.1, *.local) always render children. */ declare function ProGate({ package: packageName, children }: ProGateProps): react_jsx_runtime.JSX.Element; type TrialBadgeRenderProps = { daysLeft: number; isTrialing: boolean; isUrgent: boolean; }; type TrialBadgeProps = { /** Override daysLeft from context. When omitted, reads from `useLicense().trial.daysLeft`. */ daysLeft?: number; /** URL the Upgrade CTA links to. Defaults to the @tour-kit/license pricing page. */ pricingUrl?: string; /** Custom render — receives the resolved daysLeft + isTrialing/isUrgent flags. */ children?: (props: TrialBadgeRenderProps) => React.ReactNode; className?: string; }; /** * Trial countdown surface. Renders "{n} days left" when above the threshold; * renders an Upgrade `` when `daysLeft <= 3`. Renders `null` (and warns * once in dev) when no `daysLeft` prop is passed and no `trial` slice exists * on the surrounding ``. */ declare function TrialBadge({ daysLeft: daysLeftProp, pricingUrl, children, className, }: TrialBadgeProps): react_jsx_runtime.JSX.Element | null; type LicenseDebugPanelProps = { className?: string; /** * When false (default), renders null in production. Set true to force-render * at consumer's risk — strongly discouraged. Useful only for staging branches * where NODE_ENV is misconfigured. */ showInProduction?: boolean; }; /** * Drop into a dev or admin route to inspect the current license state. Renders * nothing in production by default. Specifically replaces the ambiguous * `status: valid, renderKey: dev_bypass` log line that the dashboard-next demo * surfaced as confusing — when dev bypass is active, the panel renders the * literal copy "🟢 Dev bypass active (NEXT_PUBLIC_TOUR_KIT_LICENSE_KEY set, * hostname=localhost)" so it is unambiguous what is happening. */ declare function LicenseDebugPanel({ className, showInProduction }: LicenseDebugPanelProps): react_jsx_runtime.JSX.Element | null; type LicenseTestModeProps = { tier: 'invalid'; children: React.ReactNode; } | { tier: 'pro'; children: React.ReactNode; } | { tier: 'free'; children: React.ReactNode; }; /** * QA-only: override `` context with a simulated state so the * watermark, adoption gate, and Pro fallbacks can be verified on a real * production-like domain without unsetting `NEXT_PUBLIC_TOUR_KIT_LICENSE_KEY` * or hitting the live Polar API. * * MUST NOT be imported from application src/. Use only in __tests__/ and * examples/. Enforced by `packages/license/scripts/check-license-test-mode.mjs`. * Production use also emits a loud `console.warn` so an accidental ship is * detectable in the browser console. */ declare function LicenseTestMode(props: LicenseTestModeProps): react_jsx_runtime.JSX.Element; declare function useLicense(): LicenseContextValue; declare function useIsPro(): boolean; interface LicenseGateResult { /** True if the component should be blocked (show placeholder) */ isGated: boolean; /** True while license validation is in progress */ isLoading: boolean; } /** * Determines whether a pro component should render or show a placeholder. * * Provider state wins over hostname. When `` is mounted, the * provider's derived `isGated`/`isLoading` flags drive the result so a missing * key on localhost still surfaces as gated. Only when no provider is in the * tree do we fall back to the hostname check — at that point we have no key to * inspect, so localhost stays quiet. * * Provider-derived signals (see LicenseProvider for the full table): * - status 'loading' → not gated, isLoading=true (avoid flash) * - status 'valid' + pro + renderKey → not gated * - status 'error' + fresh cache → not gated (grace period) * - status 'error' + no cache → gated * - status 'invalid' / 'expired' / 'revoked' → gated * * No-provider fallback: * - dev host → not gated (cannot inspect a key that does not exist) * - non-dev host → gated */ declare function useLicenseGate(): LicenseGateResult; export { LicenseContext, LicenseContextValue, LicenseDebugPanel, type LicenseDebugPanelProps, LicenseGate, LicenseGateProps, type LicenseGateResult, LicenseProvider, LicenseProviderProps, LicenseRenderContext, LicenseTestMode, type LicenseTestModeProps, LicenseWarning, LicenseWatermark, ProGate, type ProGateProps, TrialBadge, type TrialBadgeProps, type TrialBadgeRenderProps, useIsPro, useLicense, useLicenseGate };