<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">"use strict";
/**
 * Gamemonetizeå¹¿å‘Š
 */
var TAG = "GamemonetizeAdsInstance_AD_WEB";
var GamemonetizeAdsInstance = /** @class */ (function() {
    function GamemonetizeAdsInstance() {
        /**
         * æ˜¯å¦åˆå§‹åŒ–
         */
        this.isInited = false;
    }
    GamemonetizeAdsInstance.prototype.adsAsyncInit = function() {
        var _this = this;
        return new Promise(function(resolve, reject) {
            window["SDK_OPTIONS"] = {
                gameId: "h0p6mzxtof405wetsgm6aaag6sm3ptpg",
                onEvent: function(event) {
                    console.log("event.name ====", event);
                    switch (event.name) {
                        case "SDK_GAME_PAUSE":
                            break;
                        case "SDK_GAME_START":
                            if (_this.onSuccess) {
                                _this.onSuccess(false);
                                _this.onSuccess = null;
                            }
                            _this.onComplete();
                            break;
                        case "SDK_READY":
                            resolve(_this.isInited);
                            break;
                        default:
                            break;
                    }
                }
            };
            _this.init().then(function(isInited) {
                _this.isInited = isInited;
            });
        });
    };
    /**
     * åˆå§‹åŒ–googlesdk
     */
    GamemonetizeAdsInstance.prototype.init = function() {
        var _this = this;
        return new Promise(function(resolve, reject) {
            var t = _this;
            var ads = document.getElementById(TAG);
            if (ads &amp;&amp; !_this.isInited) {
                ads = null;
            }
            if (!ads) {
                function onLoaded() {
                    resolve(true);
                }

                function onError(e) {
                    console.log("onError", e);
                    reject(false);
                }
                var library = document.createElement("script");
                library.onload = onLoaded.bind(_this);
                library.onerror = onError.bind(_this);
                library.type = "text/javascript";
                library.async = false;
                library.src = "https://api.gamemonetize.com/sdk.js";
                library.id = TAG;
                document.head.appendChild(library);
            } else {
                resolve(true);
            }
        });
    };
    /**
     * å¹¿å‘Šå®Œæˆ
     */
    GamemonetizeAdsInstance.prototype.onComplete = function() {

    };
    /**
     * è¯·æ±‚å¹¿å‘Š
     */
    GamemonetizeAdsInstance.prototype.request = function(isRewared) {
        var _this = this;
        return new Promise(function(resolve, reject) {
            if (!_this.isInited) {
                resolve(false);
                return;
            }
            _this.onSuccess = resolve;
            window["sdk"].showBanner();
        });
    };
    GamemonetizeAdsInstance.prototype.showInterstitial = function() {
        return this.request(false);
    };
    GamemonetizeAdsInstance.prototype.showReward = function() {
        return this.request(true);
    };

    return GamemonetizeAdsInstance;
}());
window["GamemonetizeAdsInstance"] = new GamemonetizeAdsInstance();</pre></body></html>