"use strict";
/**
 * Game Iframe SDK - Main Entry Point
 *
 * @packageDocumentation
 * @module game-iframe-sdk
 *
 * Architecture:
 * - types.ts:         Type definitions
 * - mappers.ts:       Data transformation/mapping
 * - EventEmitter.ts:  Simple typed event emitter
 * - MessageHandler.ts: Handle incoming messages from iframe
 * - MessageSender.ts:  Send messages to iframe
 * - GameIframeSDK.ts:  Main SDK (composes above layers)
 * - useGameIframeSDK.ts: React hook
 *
 * @example Browser/Vanilla JS
 * ```typescript
 * import { GameIframeSDK } from 'game-iframe-sdk';
 *
 * const sdk = new GameIframeSDK({
 *     iframeOrigin: 'http://senaai.vn:1357',
 *     debug: true
 * });
 *
 * sdk.setIframe(document.getElementById('gameIframe'));
 *
 * sdk.on('gameReady', () => {
 *     sdk.sendGameData({ game_id: 'xxx', user_id: 'yyy', questions: [...] });
 * });
 * ```
 *
 * @example React
 * ```tsx
 * import { useGameIframeSDK } from 'game-iframe-sdk';
 *
 * function GamePlayer() {
 *     const iframeRef = useRef<HTMLIFrameElement>(null);
 *
 *     const { isReady, sendGameData } = useGameIframeSDK({
 *         iframeRef,
 *         iframeOrigin: 'http://senaai.vn:1357',
 *         onAnswerReport: (data) => submitToServer(data),
 *     });
 *
 *     return <iframe ref={iframeRef} src={gameUrl} />;
 * }
 * ```
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.destroyGameBridge = exports.getGameBridge = exports.GameBridge = exports.GameBridgeModule = exports.SDK_MESSAGE_TYPES = exports.SdkIframeCore = exports.SdkIframe = exports.destroyGameClientSDK = exports.getGameClientSDK = exports.GameClientSDK = exports.Client = exports.Kit = exports.DEFAULT_CONFIG = exports.MESSAGE_TYPES = exports.useGameIframeSDK = exports.EventEmitter = exports.MessageSender = exports.MessageHandler = exports.destroyGameIframeSDK = exports.getGameIframeSDK = exports.createGameIframeSDK = exports.GameIframeSDK = void 0;
// =============================================================================
// CORE SDK
// =============================================================================
var GameIframeSDK_1 = require("./GameIframeSDK");
Object.defineProperty(exports, "GameIframeSDK", { enumerable: true, get: function () { return GameIframeSDK_1.GameIframeSDK; } });
Object.defineProperty(exports, "createGameIframeSDK", { enumerable: true, get: function () { return GameIframeSDK_1.createGameIframeSDK; } });
Object.defineProperty(exports, "getGameIframeSDK", { enumerable: true, get: function () { return GameIframeSDK_1.getGameIframeSDK; } });
Object.defineProperty(exports, "destroyGameIframeSDK", { enumerable: true, get: function () { return GameIframeSDK_1.destroyGameIframeSDK; } });
// =============================================================================
// LAYERS (for advanced usage)
// =============================================================================
var MessageHandler_1 = require("./MessageHandler");
Object.defineProperty(exports, "MessageHandler", { enumerable: true, get: function () { return MessageHandler_1.MessageHandler; } });
var MessageSender_1 = require("./MessageSender");
Object.defineProperty(exports, "MessageSender", { enumerable: true, get: function () { return MessageSender_1.MessageSender; } });
var EventEmitter_1 = require("./EventEmitter");
Object.defineProperty(exports, "EventEmitter", { enumerable: true, get: function () { return EventEmitter_1.EventEmitter; } });
// Mappers removed - mapped data should be handled by the application
// =============================================================================
// =============================================================================
// REACT HOOK
// =============================================================================
var useGameIframeSDK_1 = require("./useGameIframeSDK");
Object.defineProperty(exports, "useGameIframeSDK", { enumerable: true, get: function () { return useGameIframeSDK_1.useGameIframeSDK; } });
// =============================================================================
// TYPES
// =============================================================================
var types_1 = require("./types");
// Message Types
Object.defineProperty(exports, "MESSAGE_TYPES", { enumerable: true, get: function () { return types_1.MESSAGE_TYPES; } });
Object.defineProperty(exports, "DEFAULT_CONFIG", { enumerable: true, get: function () { return types_1.DEFAULT_CONFIG; } });
// =============================================================================
// KIT (Helper Mappers, API, Components)
// =============================================================================
const Kit = __importStar(require("./kit"));
exports.Kit = Kit;
// =============================================================================
// CLIENT SDK (for Game Iframe - used by game developers)
// =============================================================================
const Client = __importStar(require("./client"));
exports.Client = Client;
var client_1 = require("./client");
Object.defineProperty(exports, "GameClientSDK", { enumerable: true, get: function () { return client_1.GameClientSDK; } });
Object.defineProperty(exports, "getGameClientSDK", { enumerable: true, get: function () { return client_1.getGameClientSDK; } });
Object.defineProperty(exports, "destroyGameClientSDK", { enumerable: true, get: function () { return client_1.destroyGameClientSDK; } });
// =============================================================================
// SDK IFRAME (Hidden iframe - runs on separate domain for security)
// =============================================================================
const SdkIframe = __importStar(require("./sdk-iframe"));
exports.SdkIframe = SdkIframe;
var sdk_iframe_1 = require("./sdk-iframe");
Object.defineProperty(exports, "SdkIframeCore", { enumerable: true, get: function () { return sdk_iframe_1.SdkIframeCore; } });
Object.defineProperty(exports, "SDK_MESSAGE_TYPES", { enumerable: true, get: function () { return sdk_iframe_1.SDK_MESSAGE_TYPES; } });
// =============================================================================
// GAME BRIDGE (For game developers - communicates with SDK Iframe)
// =============================================================================
const GameBridgeModule = __importStar(require("./game-bridge"));
exports.GameBridgeModule = GameBridgeModule;
var game_bridge_1 = require("./game-bridge");
Object.defineProperty(exports, "GameBridge", { enumerable: true, get: function () { return game_bridge_1.GameBridge; } });
Object.defineProperty(exports, "getGameBridge", { enumerable: true, get: function () { return game_bridge_1.getGameBridge; } });
Object.defineProperty(exports, "destroyGameBridge", { enumerable: true, get: function () { return game_bridge_1.destroyGameBridge; } });
//# sourceMappingURL=index.js.map