import { WidgetDependencies } from './types'; export declare class SimpleWidget { private container; private dependencies; private messageListener; private updateDebounceTimer; private containerClickListener; private isAuthenticated; private profileData; private levelData; private forceLoading; private brandingData; private channelData; private hasReceivedIframeAuthState; private lastRenderedState; private hasInitialAuthStructure; private currentUrl; private currentRecommendation; private persistentRecommendations; private urlChangeListener; private urlDebounceTimer; private recommendationCache; private contentCache; private lastRecommendationFetch; private lastRecommendationFetchByUrl; private executionGuards; private lastDataChange; private lastAvatarState; private imageLoadingStates; private imageCache; constructor(dependencies: WidgetDependencies); /** * Optimize image URL with resize and compression parameters */ private optimizeImageUrl; /** * Preload image and track loading state */ private preloadImage; /** * Get cached optimized image URL or create new one */ private getCachedImageUrl; /** * Check if image is currently loading */ private isImageLoading; /** * Check if image has loaded successfully */ private isImageLoaded; /** * Check if image failed to load */ private hasImageFailed; /** * Save data to localStorage with timestamp */ private saveToCache; /** * Load all cached data immediately on mount */ private loadAllCachedData; /** * Cache auth state changes */ private cacheAuthState; /** * STRONG RECOMMENDATION SYSTEM - Guaranteed to show when received * This method ensures recommendations are ALWAYS displayed, regardless of other state changes */ private setRecommendationPersistently; /** * Get current recommendation for URL with persistence check */ private getCurrentRecommendation; /** * Prevent duplicate executions within 100ms for same operation + data */ private shouldExecute; /** * Setup URL tracking system for recommendations */ private setupUrlTracking; /** * Wrap history methods to detect programmatic navigation */ private wrapHistoryMethods; /** * Handle URL changes */ private handleUrlChange; /** * Extract keywords from current page content with intelligent caching */ private extractKeywords; /** * Simple hash function for content caching */ private simpleHash; /** * Normalize URL for consistent comparison and caching */ private normalizeUrl; /** * STRONG RECOMMENDATION SYSTEM - Single controlled request method * This prevents redundant calls and ensures recommendations are always shown when received */ private requestSingleRecommendation; /** * Fetch recommendation with strong persistence guarantee */ private fetchRecommendationForCurrentPage; /** * Cleanup URL tracking */ private cleanupUrlTracking; /** * Debounce utility function */ private debounce; /** * Public getter for container access */ getContainer(): HTMLDivElement | null; /** * Get the current pixel position with priority logic */ getCurrentPosition(): string; mount(): void; /** * Setup resize listener to handle mobile ↔ desktop transitions */ private setupResizeListener; /** * Try to request fresh data from iframe immediately if it has finished loading * This leverages the preloaded iframe to get data faster */ private requestIframeDataIfReady; /** * Request fresh data from the preloaded iframe */ private requestFreshDataFromIframe; private injectStyles; /** * Get pixel position with priority: channelData.metadata.pixel.pixel_position > config > default */ private getPixelPosition; /** * Validate if a position value is valid */ private isValidPosition; /** * Notify SDK that position might have changed */ private notifyPositionChange; private createWidget; /** * Update mobile class based on current window width */ private updateMobileClass; /** * Update widget position without destroying state */ private updateWidgetPosition; private setupPostMessageListener; private setupInitialAuthCheck; private debouncedUpdateContent; private forceImmediateUpdate; private updateContent; private generateStateHash; private updateAuthenticatedContent; private updateAuthenticatedContentSelectively; private updateUnauthenticatedContent; private handleSessionChanged; private handleDataChanged; private generateAuthenticatedContent; /** * Generate HTML content for listing recommendation */ private generateRecommendationContent; private generateUnauthenticatedContent; private cleanupEventHandlers; private attachEventHandlers; private handleToggleVisibility; /** * Check if iframe is currently visible */ private isIframeVisible; private handleConnectWallet; /** * Handle recommendation click - show iframe and navigate to listing */ private handleRecommendationClick; destroy(): void; }