// ── @weeconnectpay/payment-fields · core ────────────────────────
//
// Public surface of the core layer (vanilla TS, framework-free).
// The React (`/react`) and web-component (`/web-component`) subpath exports
// sit on top of this and re-export the consumer-facing types.

// ── Main entry: the orchestrator ──
export { PaymentFieldsMachine } from './payment-fields-machine';

// ── Sub-machines (for advanced consumers / SDK internals) ──
export { ElementRegistry, type ElementRegistryOptions } from './element-registry';
export { ValidationMachine } from './validation-machine';
export { ThreeDsMachine, type ThreeDsMachineOptions } from './threeds-machine';

// ── Helpers ──
export { tokenize, createRateLimiter } from './tokenize';
export type { RateLimiter, TokenizeOptions, CreateRateLimiterOptions } from './tokenize';

export { loadClover, loadClover3DS } from './clover-loader';
export { getBrowserInfo } from './browser-info';
export { compileTheme } from './theme';
export {
  postFinalize,
  parseInterim,
} from './threeds-finalize-client';
export type {
  FinalizeRequest,
  FinalizeResponseEnvelope,
  FinalizeResponseData,
  ThreeDsInterimRaw,
} from './threeds-finalize-client';

// ── Types ──
export {
  CloverElementType,
  FIELD_KEY_TO_CLOVER_TYPE,
} from './types';
export type {
  // Element identity
  FieldKey,
  // Styles
  CloverElementStyles,
  CloverStyleSelector,
  CloverCssProperties,
  CloverFieldTheme,
  // Clover SDK shapes
  CloverGlobal,
  CloverInstance,
  CloverOptions,
  CloverElements,
  CloverElement,
  CloverElementEvent,
  CloverIframeTokenizationResponse,
  CloverPaymentRequestData,
  // 3DS
  Clover3DSGlobal,
  ThreeDSUtil,
  ThreeDsBrowserInfo,
  ThreeDsInterim,
  ThreeDsInterimFields,
  ThreeDsResult,
  // State machine
  PaymentFieldsState,
  FieldValidationState,
  ValidationSnapshot,
  PaymentFieldsSnapshot,
  PaymentFieldsError,
  PaymentFieldsErrorCode,
  TokenizationResult,
  // Config
  PaymentFieldsConfig,
  PaymentFieldsFeatures,
  PaymentFieldsEndpoints,
  HeadersProvider,
  SavedCredential,
  // Mount
  MountTargets,
  // Observer pattern
  PaymentFieldsListener,
  Unsubscribe,
} from './types';

export const __SDK_VERSION__ = '0.1.0';
