/* Minification failed. Returning unminified contents.
(1905,9-10): run-time error JS1010: Expected identifier: .
(1905,9-10): run-time error JS1195: Expected expression: .
(8888,9-12): run-time error JS1009: Expected '}': ...
(8890,1-2): run-time error JS1002: Syntax error: }
(9882,35-38): run-time error JS1009: Expected '}': ...
(9882,35-38): run-time error JS1006: Expected ')': ...
(9882,34): run-time error JS1004: Expected ';'
(9882,84): run-time error JS1004: Expected ';'
(9882,84-85): run-time error JS1195: Expected expression: )
(10040,1-2): run-time error JS1002: Syntax error: }
(10072,21-24): run-time error JS1009: Expected '}': ...
(10072,20): run-time error JS1004: Expected ';'
(10085,1-2): run-time error JS1002: Syntax error: }
(10086,1-5): run-time error JS1034: Unmatched 'else'; no 'if' defined: else
(10480,31-34): run-time error JS1009: Expected '}': ...
(10480,30): run-time error JS1004: Expected ';'
(10527,1-2): run-time error JS1002: Syntax error: }
(10526,5-18): run-time error JS1018: 'return' statement outside of function: return public
(10078,13-57): run-time error JS1018: 'return' statement outside of function: return new LightstreamerAppExternal(request)
(10081,13-49): run-time error JS1018: 'return' statement outside of function: return new LightstreamerApp(request)
(10075,13-54): run-time error JS1018: 'return' statement outside of function: return new LightstreamerAppTourn(request)
(8515,154371-154378): run-time error JS1019: Can't have 'break' outside of loop: break e
(8432,224-231): run-time error JS1019: Can't have 'break' outside of loop: break a
(8265,184-191): run-time error JS1019: Can't have 'break' outside of loop: break a
 */
var localStorageHelper = function () {
    var public = {};

    public.set = function (key, username, value, minutes) {
        if (minutes) {
            var expires = "";
            var date = new Date();
            expires = new Date(date.setTime(date.getTime() + (minutes * 60 * 1000))).toString();
            localStorage.setItem(key, JSON.stringify({ value: value, username: username, expiredTime: expires }));
        }
    };

    function isExpiredTime(key, username) {
        var data = localStorage.getItem(key) ? JSON.parse(localStorage.getItem(key)) : null;
        if (data) {
            var now = new Date();
            var expiredTime = new Date(data.expiredTime);
            if (expiredTime.getTime() < now.getTime() || username != data.username) {
                return true;
            }
            return false;
        }
        return true;
    };

    function remove(key) {
        localStorage.removeItem(key);
    }

    public.get = function (key, username) {
        if (isExpiredTime(key, username) == true) {
            return null;
        }

        var data = JSON.parse(localStorage.getItem(key));
        return data ? data.value : null;
    };

    public.remove = remove;

    public.cleanUp = function (prefix, username) {
        for (var key in localStorage) {
            try {
                if (key.indexOf(prefix) > -1 && isExpiredTime(key, username) == true) {
                    remove(key);
                }
            }
            catch (ex) {
                console.error("Failed to remove key: " + key);
            }
        }
    };

    return public;
}();
;
var browser = {
    isIe: function () {
        return navigator.appVersion.indexOf("MSIE") != -1;
    },
    navigator: navigator.appVersion,
    getVersion: function () {
        var version = 999; // we assume a sane browser
        if (navigator.appVersion.indexOf("MSIE") != -1)
            // bah, IE again, lets downgrade version number
            version = parseFloat(navigator.appVersion.split("MSIE")[1]);
        return version;
    }
};

var playGameUI = {
    width: 0,
    height: 0,
    currentGameWindow: null,
    init: function (width, height) {
        var _self = this;

        $('body').addClass('playing-game');

        _self.width = width;
        _self.height = height;

        _self.scaleBoxFrame();

        $(window).on('resize.frame', function () {
            _self.scaleBoxFrame();
        });
    },
    destroy: function () {
        $('body').removeClass('playing-game');
        $(window).off('resize.frame');
    },
    openPopup: function (url, title, w, h) {
        var self = this;
        var $body = $('body');

        var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : window.screenX;
        var dualScreenTop = window.screenTop != undefined ? window.screenTop : window.screenY;

        var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
        var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;

        var systemZoom = width / window.screen.availWidth;
        var left = (width - w) / 2 / systemZoom + dualScreenLeft;
        var top = (height - h) / 2 / systemZoom + dualScreenTop;

        $body.addClass('playing-game');

        if (self.currentGameWindow) {
            self.currentGameWindow.close();
        }
        self.currentGameWindow = window.open(url, title, 'scrollbars=yes, width=' + w / systemZoom + ', height=' + h / systemZoom + ', top=' + top + ', left=' + left);

        if (window.focus) {
            self.currentGameWindow.focus();
        }

        var pollTimer = setInterval(function () {
            if (self.currentGameWindow.closed) {
                clearInterval(pollTimer);
                $body.removeClass('playing-game');
            }
        }, 500);

    },
    scaleBoxFrame: function () {
        var frameRatioToScreen = 0.72;
        if (this.height == 940 && this.width == 1024) {
            frameRatioToScreen = 1;
        }

        var $mainFrame = $('#wrapper-play-game .main-frame'),
            screenSizeWith = window.innerWidth,
            screenSizeHeight = window.innerHeight,
            gameWidth = this.width,
            gameHeight = this.height,
            frameRatio = gameHeight / gameWidth,
            frameWidth = screenSizeWith * frameRatioToScreen,
            frameHeight = frameWidth * frameRatio;

        if (1 / (frameRatioToScreen * frameRatio) > (screenSizeWith / screenSizeHeight)) {
            frameWidth = screenSizeWith * frameRatioToScreen;
            frameHeight = frameWidth * frameRatio;

            if (frameHeight > screenSizeHeight) {
                frameHeight = screenSizeHeight * frameRatioToScreen;
                frameWidth = frameHeight / frameRatio;
            }
        }
        else {
            frameHeight = screenSizeHeight * frameRatioToScreen;
            frameWidth = frameHeight / frameRatio;

            if (frameWidth > screenSizeWith) {
                frameWidth = screenSizeWith * frameRatioToScreen;
                frameHeight = frameWidth * frameRatio;
            }

        }
        $mainFrame.css({
            'height': Math.round(frameHeight),
            'width': Math.round(frameWidth)
        });
    }
};


function magnificPopup($target, data) {
    $target.magnificPopup({
        items: {
            src: $target.attr('src')
        },
        type: data.type,
        removalDelay: 500, //delay removal by X to allow out-animation
        callbacks: {
            beforeOpen: function () {
                // just a hack that adds mfp-anim class to markup 
                this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
                this.st.mainClass = this.st.el.attr('data-effect');
            }
        },
        closeOnContentClick: true,
        midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
    });
}

function validForm($container) {
    $container.find('*').tooltip('destroy');
    var valid = true;
    $.each($container.find('.required'), function (index, element) {
        var $element = $(element);
        if ($element.val() == '' || ($element.hasClass('number') && numeral($element.val()).value() == 0)) {
            $element.focus();
            $element.attr('title', $element.data('required-title'));
            $element.tooltip('show');
            valid = false;
            return false;
        }
    });

    return valid;
}

String.format = function () {
    // The string containing the format items (e.g. "{0}")
    // will and always has to be the first argument.
    var theString = arguments[0];

    // start with the second argument (i = 1)
    for (var i = 1; i < arguments.length; i++) {
        // "gm" = RegEx options for Global search (more than one instance)
        // and for Multiline search
        var regEx = new RegExp("\\{" + (i - 1) + "\\}", "gm");
        theString = theString.replace(regEx, arguments[i]);
    }

    return theString;
}

function createPopup($container, url, params, callBackFn) {
    var $modalContainer = $container;
    var $spinner = $("#main-spinner");

    $modalContainer.addClass("user-modal-show");

    if (url) {
        $spinner.show();

        $.ajax({
            url: url,
            data: params,
            dataType: "html",
            success: function (data) {
                $modalContainer.find(".modal-content").html(data);
            }
        })
            .fail(fns.callAjaxError)
            .always(function () {
                callBackFn($spinner);
            });
    }
}

function createTournamentPopup($container, url, params, callBackFn) {
    var $spinner = $("#main-spinner");

    $container.addClass("user-modal-show");

    var maginificPopupFn = function () {
        $.magnificPopup.open({
            items: {
                src: $container
            },
            type: 'inline',
            fixedBgPos: true,
            closeOnBgClick: false,
            mainClass: 'mfp-zoom-in'
        }, 0);
    }

    if (url) {
        $spinner.show();

        var arrayValues = [];
        $.post(url, params, function (data) {
            if (data['Tournament'] && data['Tournament'].length > 0) {
                var template = '<div class="item"><img src="{src}" /></div>';
                var html = template.replace('{src}', data['Tournament'][0]);
                $container.find(".tournament-content").html(html);

                $('.tac-owl-carousel').css('opacity', 1).addClass('owl-carousel owl-theme');
                $('.tac-owl-carousel').owlCarousel({
                    nav: true,
                    smartSpeed: 300,
                    dotsSpeed: 400,
                    items: true,
                    navText: [
                        '<img src="@Url.CdnContent("~/Themes/Joker/Images/arrow_left.png")" alt="title" />',
                        '<img src="@Url.CdnContent("~/Themes/Joker/Images/arrow_right.png")" alt="title" />'
                    ]
                });
                maginificPopupFn();
            }
        })
            .fail(fns.callAjaxError)
            .always(function () {
                $spinner.hide();
            });
    }
    else {
        if ($container.find('.tournament-content').length > 0 && $container.find('.tournament-content').html().trim() != '') {
            maginificPopupFn();
        }
    }
}

function popupLogin(redirectAction, gameCode) {
    createPopup($("#user-popup"), "SignInView", {
        redirectAction: redirectAction, gameCode: gameCode
    }, function ($spinner) {
        $spinner.hide();
    });
}

function detectBrowser() {
    // Opera 8.0+
    var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
    // Firefox 1.0+
    var isFirefox = typeof InstallTrigger !== 'undefined';
    // At least Safari 3+: "[object HTMLElementConstructor]"
    var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0;
    // Internet Explorer 6-11
    var isIE = /*@cc_on!@*/false || !!document.documentMode;
    // Edge 20+
    var isEdge = !isIE && !!window.StyleMedia;
    // Chrome 1+
    var isChrome = !!window.chrome && !!window.chrome.webstore;
    // Blink engine detection
    var isBlink = (isChrome || isOpera) && !!window.CSS;

    if (isIE) {
        return isEdge ? "Edge" : "IE";
    }
    else if (isFirefox) {
        return "Firefox";
    }
    else if (isSafari) {
        return "Safari";
    }
    else if (isChrome) {
        return "Chrome";
    }
    else if (isOpera) {
        return "Opera";
    }
    return "";
}

function checkingPopupBlocker(window) {
    if (!window || window.closed || typeof window.closed == 'undefined') {
        //POPUP BLOCKED
        showMessagePopup("error", localeMessages.PopupBlocked);
        return false;
    }
    return true;
}

function showMessagePopup(type, message, callbackFn) {
    var $popupContainer = $("#message-popup-container");
    if ($popupContainer.length) {
        var $modal = $popupContainer.find(".user-modal");
        $popupContainer.find(".message-content").html(message);
        var title = "";
        var $cancel = $popupContainer.find(".cancel-control");
        $cancel.addClass("hide");

        switch (type) {
            case "confirm": title = localeMessages.PleaseSelect; $cancel.removeClass("hide"); break;
            case "error": title = localeMessages.WeApologize; break;
            case "info": title = localeMessages.ForInfomation; break;
        }

        $popupContainer.find(".title-text").html(title);

        setTimeout(function () {
            $popupContainer.addClass("user-modal-show");
            $modal.addClass("zoomIn");

            $popupContainer.off("click", '.confirm-control');
            $popupContainer.on('click', '.confirm-control', function () {
                hidePopup($modal, false);
                if (typeof callbackFn == 'function' && type == 'confirm') {
                    callbackFn();
                }
            });

            $popupContainer.on('click', '.cancel-control', function () {
                hidePopup($modal, false);
            });
        }, 200);
    }
}

function hidePopup($modal, emptyContent) {
    var $container = $modal.closest(".user-modal-container");
    $modal.addClass("zoomOut");

    if (emptyContent == true) {
        $modal.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function () {
            $container.removeClass("user-modal-show");
        });
    }

    setTimeout(function () {
        $container.removeClass("user-modal-show");

        if (emptyContent == true) {
            $container.find(".modal-content").empty();
        }
        else {
            $modal.removeClass("zoomOut");
            $modal.removeClass("zoomIn");
        }
    }, 200);
}

function GetShortString(from, to, str) {
    if (str == "" || str == null || from >= str.length)
        return "";

    return str.substring(from, to > str.length ? str.length : to) + (to < str.length ? ".." : "");
}


function validateEmail(email) {
    var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    return re.test(email.toLowerCase());
};
; (function () {
    var $body = $('body');
    
    window.app = {
        vm: {
        },
        onBindingApplied: [],
        windows: {},
        beforeLogin: function () {
            for (var game in app.windows) {
                var win = app.windows[game];
                if (!win.closed)
                    win.close();
            }
            try {
                $(document).trigger('auth.beforeLogin');
            } catch (err) {
                console.log(err.message);
            }
        },
        logout: function () {
            for (var game in app.windows) {
                var win = app.windows[game];
                if (!win.closed)
                    win.close();
            }
            window.location.href = window.logoutURL;
        },
        close: function () {
            for (var game in app.windows) {
                var win = app.windows[game];
                if (!win.closed)
                    win.close();
            }
        }
    };

    window.fns = {
        baseUrl: $body.data('base-url'),
        callAjaxError: function (xhr, status, disabledPopup) {
            if (xhr.status == 401) {
                app.vm.logout();
            }
            else {
                disabledPopup = disabledPopup || false;
                if (disabledPopup == false) {
                    showMessagePopup("error", localeMessages.ErrorOccurred);
                }
            }
        }
    };

    $(function () {
        ko.applyBindings(app.vm);

        var ev = app.onBindingApplied;
        app.onBindingApplied = {
            push: function (fn) {
                fn();
            }
        };

        if (ev && ev.length > 0) {
            for (var i = 0; i < ev.length; i++) {
                ev[i]();
            }
        }

        var myEvent = window.attachEvent || window.addEventListener;
        var chkevent = window.attachEvent ? 'onbeforeunload' : 'beforeunload';
        try {
            myEvent(chkevent, function (e) {
                window.app.close();
            });
        }
        catch (ex) {

        }

    });


    $('.international-language').click(function () {
        $('#langtag').val($(this).data('value'));

        $(this).parents('form').submit();
    })

    var alertString = $('.validation-summary-errors').find('ul').find('li').first().html();
    if (alertString != undefined) {
        showMessagePopup("error", alertString);
    }

    window.UpdatePoints = function (data, win) {
       
    }

    window.checkSession = function () {
        var url = "/Ajax/PingGameSession";
        $.post(url, function (result) {
            if (result != null) {
                if (!result.Alive) {
                    app.vm.logout();
                }

                if (result.Balance != null) {
                    var $currentBalance = $('#current-balance');
                    $currentBalance.text(numeral(result.Balance).format('0,0.00'));

                    var $currentFreeBalance = $('#current-free-balance');
                    $currentFreeBalance.text(numeral(result.FreeBalance).format('0,0.00'));
                }
            }
        }).fail(function (xhr, status) {
            fns.callAjaxError(xhr, status, true);
        }).always(function () {
        });
    };


})();;
; (function () {
    if (!$(document.body).is('.game-select'))
        return;

    var lastClick;
    var windows = app.windows;

    var maxWindow = 1;

    $.extend(app.vm, {
        activeCategory: ko.observable(),
        searchKey: ko.observable(''),
        activeGame: ko.observable($('.game-box.active').data('game-code')),
        activeGameWidth: ko.observable($('.game-box.active').data('game-width')),
        activeGameHeight: ko.observable($('.game-box.active').data('game-height')),
        currentPoints: ko.observable($('.points .text').text()),
        selectGame: function (vm, ev) {
            var $target = $(ev.currentTarget || ev.srcElement);
            var activeGame = $target.data('game-code');
            var activeGameWidth = $target.data('game-width');
            var activeGameHeight = $target.data('game-height');

            app.vm.activeGame(activeGame);
            app.vm.activeGameWidth(activeGameWidth);
            app.vm.activeGameHeight(activeGameHeight);

            app.vm.playGame(vm, ev);
        },
        isActiveGames: function (gameName) {
            var key = app.vm.searchKey();
            if (key != '') {
                if (gameName.toLowerCase().indexOf(key.toLowerCase()) == -1) {
                    return false;
                }
            }
            return true;
        },
        logout: window.app.logout,
        playGame: function (vm, ev) {
            if (!app.vm.activeGame())
                return;
            var game = app.vm.activeGame();
            var curr = windows[game];
            if (curr) {
                if (!curr.closed) {
                    curr.focus();
                    return;
                }
            }
            if (window.authenticated === 'false') {
                // No playGame
            }
            else {
                var i = 0;
                for (var k in windows) {
                    if (!windows[k].closed) {
                        i++;
                    }
                }
                if (i >= maxWindow) {
                    showMessagePopup("error", String.format(localeMessages.CanNotPlayMoreThan, maxWindow));
                    return;
                }

                var heightBrowser = 0;
                var widthBrowser = 0;

                if (navigator.userAgent.toLowerCase().indexOf('chrome') > -1) {
                    heightBrowser = 67;
                    widthBrowser = 15;
                }

                var widthWindow = window.screen.availWidth - widthBrowser;
                var heightWindow = window.screen.availHeight - heightBrowser;

                var gameWidth = $(ev.currentTarget).data('game-width');
                var gameHeight = $(ev.currentTarget).data('game-height');

                var rateWidth = gameWidth / gameHeight;
                var rateHeight = gameHeight / gameWidth;


                if (gameWidth > widthWindow) {
                    gameWidth = widthWindow;
                    gameHeight = widthWindow * rateHeight;
                }
                if (gameHeight > heightWindow) {
                    gameWidth = heightWindow * rateWidth;
                    gameHeight = heightWindow;
                }

                windows[game] = window.open(window.fnGameURL(game), game, 'width=' + gameWidth + ',height=' + gameHeight);
                windows[game].moveTo(0, 0);
            }
        }
    });

    $(function () {
        $('.mouse-down').mousedown(function () {
            $('.mouse-down').removeClass('down')
            $(this).addClass('down');
        })
        $(document.body).mouseup(function () {
            $('.mouse-down').removeClass('down')
        })

        $('.game-preview-box').css('display', '');
    });
})();;
$(function () {
    var $body = $('body'),
        formatCurrency = '0,0.00',
        currency = $body.data('currency-code'),
        currencyDenom = parseFloat($body.data('currency-denom') || 1),
        publisher = $body.data('publisher'),
        pointRate = $body.data('point-rate'),
        turnOnInterval = true;

    var $jackpotTarget = $('.jackpot-num');
    var $gameContainer = $('#game-container');

    var jackpotRequest = null;
    var jackpotTimer = null;
    function getJackpot() {
        if ($jackpotTarget.length > 0) {
            if (jackpotRequest) {
                jackpotRequest.abort();
            }

            var arrayValues = [];
            jackpotRequest = $.post("/Service/GetCommonJackpot", { currencyCode: currency, publisher: publisher }, function (result) {
                var jackpot = result.Data;
                if (jackpot != null) {
                    var serverPoint = parseFloat(jackpot.Amount);
                    updateJackpotPoint($jackpotTarget, serverPoint);
                }
                else {
                    updateJackpotPoint($jackpotTarget, 0);
                }
            }).always(function () {
                setTimeout(function () {
                    getJackpot();
                }, 60 * 1000);
            });
        }
    }
    function startOrStopJackpotTimer(start) {
        if (!jackpotTimer) {
            getJackpot();
            return setInterval(function () {
                var point = $jackpotTarget.data('point');
                if (point != 0) {
                    point += (0.01 * currencyDenom);
                    updateJackpotPoint($jackpotTarget, point);
                }
            }, 200);
        }
        return jackpotTimer;
    }

    var gameJackpotRequest = null;
    var gameJackpotTimer = null;
    function getGameJackpot() {
        if ($gameContainer.length > 0) {
            var arrayValues = [];
            gameJackpotRequest = $.post("/Service/GetGameJackpot", { currencyCode: currency }, function (result) {
                var jackpots = result.Data;

                var $jackpotContainers = $gameContainer.find('.jackpot');
                $jackpotContainers.removeClass('has-value');

                $.each(jackpots, function (group, amount) {
                    var $jackpotContainer = $gameContainer.find('.jackpot[data-jackpot-group=' + group + ']');

                    if ($jackpotContainer.length > 0) {
                        var serverPoint = parseFloat(amount);
                        updateJackpotPoint($jackpotContainer.find('.jackpot-value'), serverPoint);
                        $jackpotContainer.show();
                        $jackpotContainer.addClass('showing-jackpot');
                        $jackpotContainer.addClass('has-value');
                    }
                });

                $.each($('#game-container').find('.jackpot:not(.showing-jackpot)'), function (index, element) {
                    $(element).remove();
                })
            }).always(function () {
                setTimeout(function () {
                    getGameJackpot();
                }, 60 * 1000);
            });
        }
    }    
    function startOrStopGameJackpotTimer(start) {
        if (!gameJackpotTimer) {
            getGameJackpot();
            return setInterval(function () {
                $.each($gameContainer.find('.jackpot.has-value'), function (index, item) {
                    var $jackpotValue = $(item).find('.jackpot-value');
                    var point = $jackpotValue.data('point');
                    if (point != 0) {
                        point = point + (0.01 * currencyDenom);
                        updateJackpotPoint($jackpotValue, point);
                    }
                });
            }, 200);
        }

        return gameJackpotTimer;
    }



    function updateJackpotPoint($target, point) {
        $target.data('point', point);
        $target.text(numeral(point).format(formatCurrency));
    }


    function startJackpot() {
        jackpotTimer = startOrStopJackpotTimer(true);
        gameJackpotTimer = startOrStopGameJackpotTimer(true);
    }
    function stopJackpot() {
    }
    

    window.startJackpot = startJackpot;
    window.stopJackpot = stopJackpot;


    startJackpot();
});
var windowsLiveGame = [];
var $body = $('body');
var countWindowOpened = 0;

function playLiveCasino(gameCode) {
    var gameWidth = 960;
    var gameHeight = 600;
    var sessionToken = $(document.body).data('id');
    var isExisted = windowsLiveGame.some(function (x) { return x.gameCode == gameCode; });
    var newWin = window.open("/PlayLiveCasino?gameCode=" + gameCode, gameCode, 'menubar=0,status=0,width=' + gameWidth + ',height=' + gameHeight);

    $body.addClass('playing-game');

    if (isExisted) {
        var liveGameActive = windowsLiveGame.find(function (x) { return x.gameCode == gameCode; });
        if (liveGameActive.windowOpen.parent != null) {
            liveGameActive.windowOpen.focus();
            return;
        }
    } else if (checkingPopupBlocker(newWin)) {
        windowsLiveGame.push({ gameCode: gameCode, windowOpen: newWin });
        countWindowOpened++;
    }
}

if (window.location.pathname.indexOf('LiveCasino') > -1) {
    setInterval(function () {
        var indexWindowClosed = windowsLiveGame.findIndex(function (x) { return x.windowOpen.closed == true; });

        if (indexWindowClosed > -1) {
            countWindowOpened--;
            windowsLiveGame.splice(indexWindowClosed, 1);
        }

        if (countWindowOpened == 0 && $body.hasClass('playing-game')) {
            $body.removeClass('playing-game');
        }
    }, 500);
};
$(function () {
    var now = new Date();
    var cacheExpired = new Date(now.setHours(now.getHours() + 24)).toString();
    var publisher = $(document.body).data('publisher');
    var currencyCode = $(document.body).data('currency-code');
    var token = $(document.body).data('id');
    var listPublisherNoneAnnouncement = ["JokerExternal","Ace", "AceM", "King", "Dragon", "New737", "JokerM", "Open23Plus", "NewAsia", "AgenNine", "KBSlot", "JokerT1", "Superwin", "Superwin777"];

    var prefixPrivateAnnouncementCacheKey = 'private_announcement_';
    var privateAnnouncementCacheKey = prefixPrivateAnnouncementCacheKey + publisher + "_" + currencyCode + "_" + token;
    var prefixPublicAnnouncementCacheKey = 'public_announcement_';
    var publicAnnouncementCacheKey = prefixPublicAnnouncementCacheKey + publisher; 

    var params = new window.URLSearchParams(window.location.search);
    var privateUrl = "/Service/GetPrivateAnnouncement";
    var publicUrl = "/Service/GetPublicAnnouncement?publisher=" + publisher;

    var getPopupAnnouncement = function () {
        if (publisher && !listPublisherNoneAnnouncement.indexOf(publisher) > -1) {

            if (window.location.pathname.indexOf('Agreement') > -1 || window.location.pathname.indexOf('SignIn') > -1 || (window.location.pathname.indexOf('GameIndex') > -1 && params.get('gameCode'))) {
                return false;
            }

            extLocalStorage.init();

            var publicRequest = !extLocalStorage.get(publicAnnouncementCacheKey) ? $.get(publicUrl) : undefined;
            var privateRequest = token && !extLocalStorage.get(privateAnnouncementCacheKey) ? $.get(privateUrl) : undefined;
            var request = $.when(publicRequest, privateRequest);

            popupAnnouncementRequest = request.done(function (publicAnnouncement, privateAnnouncement) {
                var result = $.merge(publicAnnouncement ? publicAnnouncement[0].map(function (obj) { return $.extend(obj, { AnnouncementType: 'public' }) }) : [],
                    privateAnnouncement ? privateAnnouncement[0].map(function (obj) { return $.extend(obj, { AnnouncementType: 'private' }) }) : []);

                if (result && result.length) {
                    renderElement(result);
                }
            }).fail(function (xhr, status) {

            });
        }
    }


    var renderElement = function (list) {
        var $body = $('body');
        $body.append('<div class="popup-announcement-wrapper"><div class="content-announcement"><div class="close-popup"></div><div class="list-items owl-carousel owl-theme"></div></div></div>');
        var $listAnnoucment = $('.popup-announcement-wrapper .list-items');
        $.each(list, function (e, i) {
            $listAnnoucment.append(`<div class="item-announcement" data-announcement-type="${i.AnnouncementType}"><img class="img-popup" src="${i.Content}" /></div>`);
        });
        initSlider();
        closeAnnoucment();
    };

    var initSlider = function () {
        var $listAnnoucment = $('.popup-announcement-wrapper .list-items');
        if ($listAnnoucment.length > 0) {
            $listAnnoucment.owlCarousel({
                nav: false,
                dotsSpeed: 500,
                items: 1
            });
        }
    };

    var closeAnnoucment = function () {
        $(document).on('click.closePopup', '.popup-announcement-wrapper .close-popup', function () {
            var $popupAnnouncementWrapper = $('.popup-announcement-wrapper');
            var $listItems = $popupAnnouncementWrapper.find('.list-items');
            var dataOwlSlider = $listItems.data();

            if ($listItems.find('[data-announcement-type="public"]').length) {
                extLocalStorage.set(publicAnnouncementCacheKey, true, cacheExpired);
            }

            extLocalStorage.set(privateAnnouncementCacheKey, true, cacheExpired);

            
            if (typeof dataOwlSlider['owlCarousel'] === "object") {
                $listItems.owlCarousel('destroy');
            }
            $popupAnnouncementWrapper.fadeOut(400, function () {
                $popupAnnouncementWrapper.remove();
            })
        });
    };

    getPopupAnnouncement();
    $(document).on('auth.beforeLogin', function () {
        for (var key in localStorage) {
            if (key.indexOf(prefixPrivateAnnouncementCacheKey) > -1) {
                localStorage.removeItem(key);
            }
        }
    });
});;
; (function () {
    $("#user-popup").on("submit", "#login-popup-form", function () {
        var $form = $(this);
        var $spinner = $form.parents(".user-modal-content").find(".spinner-overlay-container");

        if (validForm($form)) {
            var url = "/SignInPopup";
            $.ajax(url, {
                data: $form.serialize(),
                dataType: 'json',
                method: 'POST',
                beforeSend: function () {
                    $spinner.show();
                },
            }).done(function (result) {
                if (result.success) {
                    var redirectUrl = $form.find("#Action").val();
                    var gameCode = $form.find("#GameCode").val();
                    if (gameCode.length) {
                        redirectUrl = String.format("{0}?gameCode={1}", redirectUrl, gameCode)
                    }
                    window.location.replace(redirectUrl);
                } else {
                    var $errorContainer = $form.find(".modal-validation-summary ul");
                    $errorContainer.empty();
                    if (result.allErrors.length) {
                        $.each(result.allErrors, function (index, error) {
                            var errorHtml = String.format("<li>{0}</li>", error);
                            $errorContainer.append(errorHtml);
                        })
                    }
                }

            })
            .fail(fns.callAjaxError)
            .always(function () {
                $spinner.hide();
            });
        }

        return false;
    })
})();;
function ChangePasswordVM($container, username) {
    var self = this;
    var $form = $container.find("form");
    self.username = ko.observable(username);
    self.oldPassword = ko.observable();
    self.newPassword = ko.observable();
    self.confirmPassword = ko.observable();
    self.errors = ko.observableArray([]);
    self.isLoading = ko.observable(false);

    self.submitPassword = function () {
        if (validForm($form)) {
            if (self.newPassword() != self.confirmPassword()) {
                self.errors.removeAll();
                self.errors.push(localeMessages.ConfirmedPassNotMatch);
            }
            else {
                var url = "Service/ChangePassword";

                $.ajax(url, {
                    data: {
                        OldPassword: self.oldPassword(),
                        NewPassword: self.newPassword()
                    },
                    dataType: 'json',
                    method: 'POST',
                    beforeSend: function () {
                        self.errors.removeAll();
                        self.isLoading(true);
                    },
                }).done(function (result) {
                    if (result.Success == true) {
                        self.removeData();
                        showMessagePopup("info", String.format(localeMessages.PasswordHasBeenUpdated, username));
                        $("#user-popup").removeClass("user-modal-show");
                    }
                    else {
                        if ('Password cannot be empty or white space.' === result.Message) {
                            self.errors.push(localeMessages.PasswordCannotEmptyOrWhiteSpace);
                        }
                        else if ('Old Password cannot be empty or white space.' === result.Message) {
                            self.errors.push(localeMessages.OldPasswordCannotEmptyOrWhiteSpace);
                        }
                        else if ('Password must be at least 8 characters, case sensitive, contains characters and numbers, e.g. abcd1234' === result.Message) {
                            self.errors.push(localeMessages.PasswordMustBeLeastLength);
                        }
                        else {
                            self.errors.push(localeMessages.OldPasswordInValid);
                        }
                    }
                })
                    .fail(function (xhr, status) {
                        fns.callAjaxError(xhr, status);
                        $("#user-popup").removeClass("user-modal-show");
                    })
                    .always(function () {
                        self.isLoading(false);
                    });
            }
        }
    }

    self.removeData = function () {
        self.errors.removeAll();
        self.oldPassword("");
        self.newPassword("");
        self.confirmPassword("");
    }
}

function PasswordModalBinding(username) {
    var $container = $("#user-modal-password");
    if ($container.length > 0) {
        ko.applyBindings(ChangePasswordVM($container, username), $container[0]);
    }
}
;
; (function () {
    var topCount = 3;
    var timeInterval = 1000;
    var timeoutHandle = null;
    var warningTimeInSeconds = 5 * 60;
    var listLimit = 10;
    var rowHeight = 45;
    var list = [];

    var $container = $("#competition-ranks");
    var $tabsContainers = $container.find(".tabs-container");
    var $contentContainer;
    var ocode = $container.data("ocode");

    initialize();

    function initialize() {
        if ($container.length > 0) {
            var tabName = $tabsContainers.find("li.active a").data("type");

            $contentContainer = $($tabsContainers.find("li.active a").data("target"));
            $contentContainer.addClass("active");

            loadData(tabName);
        }

        registerEventsForPrize();
    }

    $(".rank-tabs").on("click", function () {
        var $self = $(this);
        var tabName = $self.data("type");
 
        loadData(tabName);
    })

    $(document).on("click", ".change-competition", function (e) {
        e.preventDefault();
        var $self = $(this);
        var $currentContainer = $self.closest(".general-info");
        var $targetContainer = $self.is(".left-arrow") ?
            $currentContainer.prev(".general-info") : $currentContainer.next(".general-info");

        if ($currentContainer.length && $targetContainer.length) {
            ocode = $targetContainer.data("ocode");
            var isGetActive = $targetContainer.data("active");
            var $container = $targetContainer.parents(".tab-pane");

            $container.find(".paginate").data("page-index", 0);
            $container.find(".paginate").find(".page-index").empty().hide();

            if ($container.data("type") == 'ranking') {
                getRankingDetails(ocode, $container, function () {
                    $currentContainer.addClass("hide");
                    $targetContainer.removeClass("hide");
                })
            }
            else {                
                getCompetitionDetails(isGetActive, ocode, $container, function () {
                    $currentContainer.addClass("hide");
                    $targetContainer.removeClass("hide");
                })
            }
        }
    });

    $(document).on("click", ".paginate .prev", function (e) {
        e.preventDefault();
        var $self = $(this);
        var $parentContainer = $self.parent(".paginate");
        var $container = $self.parents(".tab-pane");

        var pageIndex = $parentContainer.data("page-index");
        $parentContainer.data("page-index", pageIndex - 1); 

        if ($container.data("type") == 'ranking') {
            getRankingDetails(ocode, $container, function () {
                $container.find('.current-rank-table').addClass("hide");
            });
        }
        else {
            var isGetActive = $container.data("type") == 'active' ? true : false;
            getCompetitionDetails(isGetActive, ocode, $container, function () {
                $container.find('.current-rank-table').addClass("hide");
            });
        }
    });

    $(document).on("click", ".paginate .next", function (e) {
        e.preventDefault();
        var $self = $(this);
        var $parentContainer = $self.parent(".paginate");
        var $container = $self.parents(".tab-pane");

        var pageIndex = $parentContainer.data("page-index");
        $parentContainer.data("page-index", pageIndex + 1);    

        if ($container.data("type") == 'ranking') {
            getRankingDetails(ocode, $container, function () {
                $container.find('.current-rank-table').addClass("hide");
            });
        }
        else {
            var isGetActive = $container.data("type") == 'active' ? true : false;
            getCompetitionDetails(isGetActive, ocode, $container, function () {
                $container.find('.current-rank-table').addClass("hide");
            });
        }
    });

    function loadData(type) {
        ocode = "";

        switch (type) {
            case "active":
                getCompetitions(true); return;
            case "completed":
                getCompetitions(false); return;
            case "ranking":
                getRankings(); return;
        }
    }

    function getCompetitions(isGetActive) {
        var sessionToken = $(document.body).data('id');

        var url = "/Service/GetActiveCompetitions";
        var $container = $("#active-competitions");
        if (isGetActive == false) {
            var url = "/Service/GetCompletedCompetitions";
            $container = $("#completed-competitions")
        }
        $container.find(".paginate .page-index").empty().hide();

        $.ajax(url, {
            data: { token: sessionToken },
            dataType: 'json',
            method: 'POST',
            beforeSend: function () {
                $('#main-spinner').show();
                $container.find('.no-competition').remove();
                $container.find("#competitions").empty();
                $container.find(".top-rank-container ul").empty();
                $container.find("#current-rank tbody").empty();
            },
        }).done(function (result) {
            if (result.Success == true) {
                var competitions = result.Data;
                if (ocode) {
                    for (var i = 0; i < competitions.length; i++) {
                        if (competitions[i].OCode == ocode) {
                            list.push(competitions[i]);
                        }
                    }
                }
                else {
                    list = competitions;
                }

                $container.find(".paginate").data("page-index", 0);

                if (list.length > 0) {
                    drawCompetitions(isGetActive, list, $container);
                    ocode = list[0].OCode;
                    getCompetitionDetails(isGetActive, list[0].OCode, $container);
                }
                else {
                    var content = '<div class="no-competition">{text}</div>';
                    content = content.replace("{text}", localeMessages.NoCompetition);
                    $container.find("#competition-participants").hide();
                    $container.append(content);
                    $('#main-spinner').hide();
                    $container.show();
                }
            } else {
                showMessagePopup("error", result.Message);
                $('#main-spinner').hide();
            }
        }).fail(function (xhr, status) {
            fns.callAjaxError(xhr, status);
            $('#main-spinner').hide();
        }).always(function () {
        });
    }

    function getCompetitionDetails(isGetActive, ocode, $container, callbackFn) {
        var sessionToken = $(document.body).data('id');
        $container.find(".paginate").find(".prev, .next").hide();
        var pageIndex = $container.find(".paginate").data("page-index");
        var limit = 50;
        var url = "/Service/GetCompetitionPaticipants";
        if (isGetActive == false) {
            url = "/Service/GetCompetitionResult";
        }

        $.ajax(url, {
            data: { token: sessionToken, ocode: ocode, pageIndex: pageIndex, limit: limit },
            dataType: 'json',
            method: 'POST',
            beforeSend: function () {
                $('#main-spinner').show();
                $container.find(".top-rank-container ul").empty();
                $container.find("#current-rank tbody").empty();
            },
        }).done(function (result) {
            if (result.Success == true) {
                var items = result.Data;
                if (pageIndex > 0) {
                    $container.find(".paginate").find(".prev").show();
                }
                if (items.length >= limit) {
                    $container.find(".paginate").find(".next").show();
                }

                if (items.length > 0) {
                    drawCompetitionDetails(items, $container);
                    $container.find(".paginate .page-index").text(pageIndex + 1).show();
                }
                else {
                    var content = '<tr><td class="text-center" colspan="100">{text}</td></tr>';
                    content = content.replace("{text}", localeMessages.NoDataAvailable);
                    $container.find("#competition-participants tbody").html(content);
                    $('#main-spinner').hide();
                }

                for (var i = 0; i < list.length; i++) {
                    if (list[i].OCode == ocode) {
                        drawCompetitionTop(list[i], $container);
                    }
                }
            } else {
                showMessagePopup("error", result.Message);
            }
        }).fail(fns.callAjaxError)
            .always(function () {
                $('#main-spinner').hide();
                if (callbackFn) {
                    callbackFn();
                }
            });
    }



    function drawCompetitions(isGetActive, data, $container) {
        var $competitions = $container.find("#competitions");
        var html = "";
        $.each(data, function (index, competition) {
            var content = '<div class="general-info animated {hide}" data-ocode="{ocode}" data-active="{active}">';
            content += '<div class="competition-info line-right">';
            content += '<div class="competition-name">{name}</div>';
            content += '<div class="competition-date">{date}</div>';
            content += '</div>';
            if (isGetActive) {
                content += '<div class="remaining-container"><div class="remaining-label">{remainingLabel}</div>';
                content += '<div class="remaining-value" data-end-date="{endTime}"></div></div>';

                content = content.replace("{remainingLabel}", localeMessages.TimeLeft);
                content = content.replace("{endTime}", competition.EndTimeUTC)
            }

            content += '<div class="nav-arrow">{left} {right}</div>';
            content += '</div>';

            content = content.replace("{hide}", index != 0 ? "hide" : "").replace("{active}", isGetActive);
            content = content.replace("{name}", competition.Name).replace("{ocode}", competition.OCode);
            content = content.replace("{date}", String.format("{0} - {1}", competition.StartDate, competition.EndDate));

            content = content.replace("{left}", index != 0 ? '<div class="left-arrow change-competition"></div>' : '');
            content = content.replace("{right}", (data.length > 1 && index != data.length - 1) ? '<div class="right-arrow change-competition"></div>' : '');

            html += content;
        })
        $competitions.html(html);

        if (timeoutHandle != null) {
            window.clearTimeout(timeoutHandle);
        }
        if (isGetActive) {
            calculateTimeLeft();
        }
    }

    function drawCompetitionDetails(data, $container) {
        var $table = $container.find("#competition-participants");
        var currentEncVal = $("#competition-ranks").data("enc-val");
        var html = "";
        $.each(data, function (index, detail) {
            var tr = '<tr class="top-rank {order_class} {current-rank}">';
            tr += '<td class="text-center detail-ranking"><div class="ranking-icon">{order}</div></td>';
            tr += '<td class="text-left detail-name">{name}</td>';
            tr += '<td class="detail-amount">{amount}</td>';
            tr += '<td class="detail-award">{award}</td>';
            tr += '</tr>';
            if (detail.Order <= topCount) {
                tr = tr.replace("{order_class}", "ranking-" + detail.Order).replace("{order}", "")
            }
            else {
                tr = tr.replace("{order_class}", "").replace("{order}", detail.Order)
            }

            tr = tr.replace("{name}", detail.Name);
            tr = tr.replace("{amount}", detail.Chance);
            tr = tr.replace("{award}", detail.Award);

            if (currentEncVal != null && currentEncVal != '' && currentEncVal == detail.EncVal) {
                tr = tr.replace("{current-rank}", "current-rank");
                var $currentTable = $container.find("#current-rank");
                $currentTable.find("tbody").html(tr);
                if (detail.Order < listLimit) {
                    $currentTable.addClass("hide");
                }
            }
            else {
                tr = tr.replace("{current-rank}", "");
            }

            html += tr;
        })
        $table.find("tbody").html(html);


        setScrollbar($container.find(".scrollable-table"));
    }

    function drawCompetitionTop(data, $container) {
        var $topContainer = $container.find(".top-rank-container");
        var html = "";
        var dataPrize = [];

        dataPrize[0] = data.Prizes[1];
        dataPrize[1] = data.Prizes[0];
        dataPrize[2] = data.Prizes[2];

        $.each(dataPrize, function (index, detail) {
            var content = '<li class="top-{rank}">';
            content += '<div class="top-name">{name}</div>';
            content += '<div class="top-award"><div class="jackpot-coin-prize"></div><div class="amount">{amount}</div></div>';
            content += '</li>';

            if (detail.Position <= topCount) {
                content = content.replace("{rank}", detail.Position)
                    .replace("{name}", detail.PrizeName)
                    .replace("{amount}", detail.Award);
                html += content;
            }
        })

        $topContainer.find("ul").html(html);
    }


    function getRankings() {
        var sessionToken = $(document.body).data('id');

        var url = "/Service/GetRankings";
        var $container = $("#active-rankings");
        $container.find(".paginate .page-index").empty().hide();

        $.ajax(url, {
            data: { token: sessionToken },
            dataType: 'json',
            method: 'POST',
            beforeSend: function () {
                $('#main-spinner').show();
                $container.find('.no-competition').remove();
                $container.find("#competitions").empty();
                $container.find(".top-rank-container ul").empty();
                $container.find("#current-rank tbody").empty();
            },
        }).done(function (result) {
            if (result.Success == true) {
                var rankings = result.Data;
                if (ocode) {
                    for (var i = 0; i < rankings.length; i++) {
                        if (rankings[i].OCode == ocode) {
                            list.push(rankings[i]);
                        }
                    }
                }
                else {
                    list = rankings;
                }
           
                $container.find(".paginate").data("page-index", 0);

                if (list.length > 0) {
                    drawRankings(list, $container);
                    ocode = list[0].OCode;
                    getRankingDetails(list[0].OCode, $container);
                }
                else {
                    var content = '<div class="no-competition">{text}</div>';
                    content = content.replace("{text}", localeMessages.NoCompetition);
                    $container.find("#competition-participants").hide();
                    $container.append(content);
                    $('#main-spinner').hide();
                    $container.show();
                }
            } else {
                showMessagePopup("error", result.Message);
                $('#main-spinner').hide();
            }
        }).fail(function (xhr, status) {
            fns.callAjaxError(xhr, status);
            $('#main-spinner').hide();
        }).always(function () {
        });
    }

    function getRankingDetails(ocode, $container, callbackFn) {
        var sessionToken = $(document.body).data('id');
        $container.find(".paginate").find(".prev, .next").hide();
        var pageIndex = $container.find(".paginate").data("page-index");
        var limit = 50;
        var url = "/Service/GetRankingParticipants";
        $.ajax(url, {
            data: { token: sessionToken, ocode: ocode, pageIndex: pageIndex, limit: limit },
            dataType: 'json',
            method: 'POST',
            beforeSend: function () {
                $('#main-spinner').show();
                $container.find(".top-rank-container ul").empty();
                $container.find("#current-rank tbody").empty();
            },
        }).done(function (result) {
            if (result.Success == true) {
                var items = result.Data;

                if (pageIndex > 0) {
                    $container.find(".paginate").find(".prev").show();
                }
                if (items.length >= limit) {
                    $container.find(".paginate").find(".next").show();
                }

                if (items.length > 0) {
                    drawRankingDetails(items, $container);
                    $container.find(".paginate .page-index").text(pageIndex + 1).show();
                }
                else {
                    var content = '<tr><td class="text-center" colspan="100">{text}</td></tr>';
                    content = content.replace("{text}", localeMessages.NoDataAvailable);
                    $container.find("#competition-participants tbody").html(content);
                    $('#main-spinner').hide();
                }
                $container.find(".top-rank-container").hide();
            } else {
                showMessagePopup("error", result.Message);
            }
        }).fail(fns.callAjaxError)
            .always(function () {
                $('#main-spinner').hide();
                if (callbackFn) {
                    callbackFn();
                }
            });
    }

    function drawRankings(data, $container) {
        var $competitions = $container.find("#competitions");
        var html = "";
        $.each(data, function (index, competition) {
            var content = '<div class="general-info animated {hide}" data-ocode="{ocode}">';
            content += '<div class="competition-info">';
            content += '<div class="competition-name">{name}</div>';
            content += '<div class="competition-date">{date}</div>';
            content += '</div>';

            content += '<div class="nav-arrow">{left} {right}</div>';
            content += '</div>';

            content = content.replace("{hide}", index != 0 ? "hide" : "");
            content = content.replace("{name}", competition.Name).replace("{ocode}", competition.OCode);
            content = competition.HideDate == true ? content.replace("{date}", "") : content.replace("{date}", String.format("{0} - {1}", competition.StartDate, competition.EndDate));

            content = content.replace("{left}", index != 0 ? '<div class="left-arrow change-competition"></div>' : '');
            content = content.replace("{right}", (data.length > 1 && index != data.length - 1) ? '<div class="right-arrow change-competition"></div>' : '');

            html += content;
        })
        $competitions.html(html);

    }

    function drawRankingDetails(data, $container) {
        var $table = $container.find("#competition-participants");
        var currentEncVal = $("#competition-ranks").data("enc-val");
        var html = "";
        $.each(data, function (index, detail) {
            var tr = '<tr class="top-rank {order_class} {current-rank}">';
            tr += '<td class="text-center detail-ranking"><div class="ranking-icon">{order}</div></td>';
            tr += '<td class="text-left detail-name">{name}</td>';
            tr += '<td class="detail-amount">{amount}</td>';
            tr += '</tr>';
            if (detail.Order <= topCount) {
                tr = tr.replace("{order_class}", "ranking-" + detail.Order).replace("{order}", detail.Order);
            }
            else {
                tr = tr.replace("{order_class}", "").replace("{order}", detail.Order);
            }

            tr = tr.replace("{name}", detail.Name);
            tr = tr.replace("{amount}", detail.Chance);

            if (currentEncVal != null && currentEncVal != '' && currentEncVal == detail.EncVal) {
                tr = tr.replace("{current-rank}", "current-rank");
                var $currentTable = $container.find("#current-rank");
                $currentTable.find("tbody").html(tr);
                if (detail.Order < listLimit) {
                    $currentTable.addClass("hide");
                }
            }
            else {
                tr = tr.replace("{current-rank}", "");
            }

            html += tr;
        })
        $table.find("tbody").html(html);


        setScrollbar($container.find(".scrollable-table"));
    }


    function setScrollbar($container) {
        $container.mCustomScrollbar({
            axis: "y",
            theme: 'minimal',
            autoHideScrollbar: true,
            advanced: { updateOnContentResize: true },
            mouseWheel: { preventDefault: true },
            scrollbarPosition: 'inside',
            snapAmount: rowHeight,
            callbacks: {
                whileScrolling: function () { isScrolledIntoView(this, $container) }
            }
        });
    }

    function isScrolledIntoView(el, $container) {
        var viewPositionTop = el.mcs.top;
        var $element = $container.find("#competition-participants .current-rank");
        if ($element.length) {
            var $currentTable = $container.closest(".table-container").find(".current-rank-table");
            var elementTop = $container.find("#competition-participants .current-rank").position().top;
            var positionCurrentRank = elementTop - Math.abs(viewPositionTop);
            if (0 <= positionCurrentRank && positionCurrentRank <= rowHeight * listLimit) {
                $currentTable.addClass("hide");
            }
            else if (positionCurrentRank < 0) {
                $currentTable.removeClass("hide");
                $currentTable.css("top", String.format("{0}px", 0));
            }
            else {
                $currentTable.removeClass("hide");
                $currentTable.css("top", String.format("{0}px", rowHeight * listLimit));
            }
        }
    }

    function calculateTimeLeft() {
        var $remainingContainer = $("#active-competitions").find(".remaining-container");
        if ($remainingContainer.length) {
            $.each($remainingContainer, function (index, element) {
                var endTime = moment.utc($(element).find(".remaining-value").data("end-date"));
                var timeLeft = endTime.diff(moment.utc(), "seconds");
                var $textContainner = $(element).find(".remaining-value");

                var text = "";
                if (timeLeft <= 0) {
                    text = localeMessages.CompetitionClosed;
                    $textContainner.addClass("closed");
                }
                else {
                    if (timeLeft <= warningTimeInSeconds) {
                        $textContainner.addClass("closing");
                    }
                    var duration = moment.duration(timeLeft, "seconds");
                    text = "{0} day(s), {1}:{2}:{3}";
                    text = text.replace("{0}", Math.floor(duration.asDays()));
                    text = text.replace("{1}", format2digits(duration.hours()));
                    text = text.replace("{2}", format2digits(duration.minutes()));
                    text = text.replace("{3}", format2digits(duration.seconds()));
                }

                $textContainner.text(text);
            })

            timeoutHandle = window.setTimeout(function () {
                calculateTimeLeft();
            }, timeInterval);
        }
        return false;
    }

    function format2digits(number) {
        return ("0" + number).slice(-2);
    }

    function registerEventsForPrize() {
        var $prizeContainer = $("#prize-claim-popup-container");
        $prizeContainer.find(".btn-claim").click(function () {
            var prizeOCode = $prizeContainer.data("ocode");

            claimPrize(prizeOCode);
        })
    }

})();




;
function audioApp(audioFileInput, currentTime, autoLoop) {
    var _publicFn = {};
    var audioSite = null;
    var isPlaying = false;
    var targetBody = document.getElementsByTagName('body')[0];
    var hidden, visibilityChange;
    var listAudioOrignal = [];
    var listAudioPlay = [];
    var listClass = ['playing-tournament', 'playing-game', 'opening-minigame'];
    var listEventListener = ['click', 'touchend'];

    currentTime = (currentTime !== undefined) ? currentTime : 0;
    autoLoop = (autoLoop !== undefined) ? audioloop : true;

    if (typeof document.hidden !== 'undefined') {
        // Opera 12.10 and Firefox 18 and later support
        hidden = 'hidden';
        visibilityChange = 'visibilitychange';
    } else if (typeof document.mozHidden !== "undefined") {
        hidden = "mozHidden";
        visibilityChange = "mozvisibilitychange";
    } else if (typeof document.msHidden !== 'undefined') {
        hidden = 'msHidden';
        visibilityChange = 'msvisibilitychange';
    } else if (typeof document.webkitHidden !== 'undefined') {
        hidden = 'webkitHidden';
        visibilityChange = 'webkitvisibilitychange';
    }

    function handleVisibilityChange() {
        if (document[hidden]) {
            _publicFn.stop();
        } else {
            audioStopAndResumeByClassBody();
        }
    }

    if (typeof document.addEventListener === 'undefined' || hidden === undefined) {
        console.log('Brower not support Page Visibility API');
    } else {
        document.addEventListener(visibilityChange, handleVisibilityChange, false);
    }

    function audioStopAndResumeByClassBody() {
        var isHasClass = listClass.some(function(className) {
            return targetBody.className.includes(className);
        });

        if (isHasClass) {
            _publicFn.stop();
        } else {
            _publicFn.resume();
        }
    }

    function listenBodyClassChange() {
        var mutationObserver = new MutationObserver(function (mutationsList, observer) {
            if (mutationsList[0]) {
                audioStopAndResumeByClassBody();
            }
        });
        mutationObserver.observe(targetBody, { attributes: true });
    }

    var forcePlayAudioEvent = function (event) {
        var $audioPromise = audioSite.play();
        $audioPromise.then(function(e) {
            listEventListener.forEach(function (event) {
                window.removeEventListener(event, forcePlayAudioEvent);
            });
        }).catch(function(err) {
            console.log('Play audio error', err);
            playAudioRandom();
            listEventListener.forEach(function(event) {
                window.removeEventListener(event, forcePlayAudioEvent);
            });
        });
 
    };

    var playNextAudioAfterEnd = function (event) {
        audioSite.removeEventListener('ended', playNextAudioAfterEnd);
        playAudioRandom();
    };

    function playAudioRandom() {
        if (listAudioPlay.length === 0) {
            if (autoLoop) {
                listAudioPlay = [].concat(listAudioOrignal);
            } else {
                audioSite = null;
                return;
            }
        }
        var numberRandom = Math.floor(Math.random() * listAudioPlay.length);
        audioSite = new Audio(listAudioPlay[numberRandom]);
        listAudioPlay.splice(numberRandom, 1);
        audioSite.currentTime = currentTime;
        var $audioPromise = audioSite.play();
        audioSite.addEventListener('ended', playNextAudioAfterEnd);
        $audioPromise.then(function(event) {
            isPlaying = true;
            audioStopAndResumeByClassBody();
        }).catch(function(err) {
            console.log('Play audio prevent', err);
            isPlaying = false;
            setTimeout(function () {
                listEventListener.forEach(function(event) {
                    window.addEventListener(event, forcePlayAudioEvent);
                });
            }, 2000);
        });
    }

    _publicFn.init = function () {
        listenBodyClassChange();
        listAudioOrignal = [].concat(audioFileInput);
        listAudioPlay = [].concat(listAudioOrignal);

        if (isPlaying == false) {
            playAudioRandom();
        }
    }

    _publicFn.resume = function () {
        if (audioSite) {
            audioSite.play();
        }
    }

    _publicFn.stop = function () {
        if (audioSite) {
            audioSite.pause();
        }
    }

    return _publicFn;
};
; (function () {
    if (!$(document.body).is('.sign-in'))
        return;

    $.extend(app.vm, {
        remember: ko.observable(false),
        loading: ko.observable(true),
        toggleRemember: function () {
            if (app.vm.loading())
                return;
            app.vm.remember(!app.vm.remember());
        }
    });

    $(function () {
        app.vm.loading(false);

        $('form').submit(function () {
            var $this = $(this);
            if ($this.valid && $this.valid()) {
                app.vm.loading(true);
            }
        });
    });
})();;
/*
Copyright (c) 2011, Daniel Guerrero
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL DANIEL GUERRERO BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/**
 * Uses the new array typed in javascript to binary base64 encode/decode
 * at the moment just decodes a binary base64 encoded
 * into either an ArrayBuffer (decodeArrayBuffer)
 * or into an Uint8Array (decode)
 * 
 * References:
 * https://developer.mozilla.org/en/JavaScript_typed_arrays/ArrayBuffer
 * https://developer.mozilla.org/en/JavaScript_typed_arrays/Uint8Array
 */

var Base64Binary = {
	_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",

	/* will return a  Uint8Array type */
	decodeArrayBuffer: function (input) {
		var bytes = (input.length / 4) * 3;
		var ab = new ArrayBuffer(bytes);
		this.decode(input, ab);

		return ab;
	},

	removePaddingChars: function (input) {
		var lkey = this._keyStr.indexOf(input.charAt(input.length - 1));
		if (lkey == 64) {
			return input.substring(0, input.length - 1);
		}
		return input;
	},

	decode: function (input, arrayBuffer) {
		//get last chars to see if are valid
		input = this.removePaddingChars(input);
		input = this.removePaddingChars(input);

		var bytes = parseInt((input.length / 4) * 3, 10);

		var uarray;
		var chr1, chr2, chr3;
		var enc1, enc2, enc3, enc4;
		var i = 0;
		var j = 0;

		if (arrayBuffer)
			uarray = new Uint8Array(arrayBuffer);
		else
			uarray = new Uint8Array(bytes);

		input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");

		for (i = 0; i < bytes; i += 3) {
			//get the 3 octects in 4 ascii chars
			enc1 = this._keyStr.indexOf(input.charAt(j++));
			enc2 = this._keyStr.indexOf(input.charAt(j++));
			enc3 = this._keyStr.indexOf(input.charAt(j++));
			enc4 = this._keyStr.indexOf(input.charAt(j++));

			chr1 = (enc1 << 2) | (enc2 >> 4);
			chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
			chr3 = ((enc3 & 3) << 6) | enc4;

			uarray[i] = chr1;
			if (enc3 != 64) uarray[i + 1] = chr2;
			if (enc4 != 64) uarray[i + 2] = chr3;
		}

		return uarray;
	}
};;
; (function (root, factory) {
	if (typeof exports === "object") {
		// CommonJS
		module.exports = exports = factory();
	}
	else if (typeof define === "function" && define.amd) {
		// AMD
		define([], factory);
	}
	else {
		// Global (browser)
		root.CryptoJS = factory();
	}
}(this, function () {

	/**
	 * CryptoJS core components.
	 */
	var CryptoJS = CryptoJS || (function (Math, undefined) {
	    /*
	     * Local polyfil of Object.create
	     */
		var create = Object.create || (function () {
			function F() { };

			return function (obj) {
				var subtype;

				F.prototype = obj;

				subtype = new F();

				F.prototype = null;

				return subtype;
			};
		}());

	    /**
	     * CryptoJS namespace.
	     */
		var C = {};

	    /**
	     * Library namespace.
	     */
		var C_lib = C.lib = {};

	    /**
	     * Base object for prototypal inheritance.
	     */
		var Base = C_lib.Base = (function () {


			return {
	            /**
	             * Creates a new object that inherits from this object.
	             *
	             * @param {Object} overrides Properties to copy into the new object.
	             *
	             * @return {Object} The new object.
	             *
	             * @static
	             *
	             * @example
	             *
	             *     var MyType = CryptoJS.lib.Base.extend({
	             *         field: 'value',
	             *
	             *         method: function () {
	             *         }
	             *     });
	             */
				extend: function (overrides) {
					// Spawn
					var subtype = create(this);

					// Augment
					if (overrides) {
						subtype.mixIn(overrides);
					}

					// Create default initializer
					if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
						subtype.init = function () {
							subtype.$super.init.apply(this, arguments);
						};
					}

					// Initializer's prototype is the subtype object
					subtype.init.prototype = subtype;

					// Reference supertype
					subtype.$super = this;

					return subtype;
				},

	            /**
	             * Extends this object and runs the init method.
	             * Arguments to create() will be passed to init().
	             *
	             * @return {Object} The new object.
	             *
	             * @static
	             *
	             * @example
	             *
	             *     var instance = MyType.create();
	             */
				create: function () {
					var instance = this.extend();
					instance.init.apply(instance, arguments);

					return instance;
				},

	            /**
	             * Initializes a newly created object.
	             * Override this method to add some logic when your objects are created.
	             *
	             * @example
	             *
	             *     var MyType = CryptoJS.lib.Base.extend({
	             *         init: function () {
	             *             // ...
	             *         }
	             *     });
	             */
				init: function () {
				},

	            /**
	             * Copies properties into this object.
	             *
	             * @param {Object} properties The properties to mix in.
	             *
	             * @example
	             *
	             *     MyType.mixIn({
	             *         field: 'value'
	             *     });
	             */
				mixIn: function (properties) {
					for (var propertyName in properties) {
						if (properties.hasOwnProperty(propertyName)) {
							this[propertyName] = properties[propertyName];
						}
					}

					// IE won't copy toString using the loop above
					if (properties.hasOwnProperty('toString')) {
						this.toString = properties.toString;
					}
				},

	            /**
	             * Creates a copy of this object.
	             *
	             * @return {Object} The clone.
	             *
	             * @example
	             *
	             *     var clone = instance.clone();
	             */
				clone: function () {
					return this.init.prototype.extend(this);
				}
			};
		}());

	    /**
	     * An array of 32-bit words.
	     *
	     * @property {Array} words The array of 32-bit words.
	     * @property {number} sigBytes The number of significant bytes in this word array.
	     */
		var WordArray = C_lib.WordArray = Base.extend({
	        /**
	         * Initializes a newly created word array.
	         *
	         * @param {Array} words (Optional) An array of 32-bit words.
	         * @param {number} sigBytes (Optional) The number of significant bytes in the words.
	         *
	         * @example
	         *
	         *     var wordArray = CryptoJS.lib.WordArray.create();
	         *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
	         *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
	         */
			init: function (words, sigBytes) {
				words = this.words = words || [];

				if (sigBytes != undefined) {
					this.sigBytes = sigBytes;
				} else {
					this.sigBytes = words.length * 4;
				}
			},

	        /**
	         * Converts this word array to a string.
	         *
	         * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
	         *
	         * @return {string} The stringified word array.
	         *
	         * @example
	         *
	         *     var string = wordArray + '';
	         *     var string = wordArray.toString();
	         *     var string = wordArray.toString(CryptoJS.enc.Utf8);
	         */
			toString: function (encoder) {
				return (encoder || Hex).stringify(this);
			},

	        /**
	         * Concatenates a word array to this word array.
	         *
	         * @param {WordArray} wordArray The word array to append.
	         *
	         * @return {WordArray} This word array.
	         *
	         * @example
	         *
	         *     wordArray1.concat(wordArray2);
	         */
			concat: function (wordArray) {
				// Shortcuts
				var thisWords = this.words;
				var thatWords = wordArray.words;
				var thisSigBytes = this.sigBytes;
				var thatSigBytes = wordArray.sigBytes;

				// Clamp excess bits
				this.clamp();

				// Concat
				if (thisSigBytes % 4) {
					// Copy one byte at a time
					for (var i = 0; i < thatSigBytes; i++) {
						var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
						thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
					}
				} else {
					// Copy one word at a time
					for (var i = 0; i < thatSigBytes; i += 4) {
						thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
					}
				}
				this.sigBytes += thatSigBytes;

				// Chainable
				return this;
			},

	        /**
	         * Removes insignificant bits.
	         *
	         * @example
	         *
	         *     wordArray.clamp();
	         */
			clamp: function () {
				// Shortcuts
				var words = this.words;
				var sigBytes = this.sigBytes;

				// Clamp
				words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
				words.length = Math.ceil(sigBytes / 4);
			},

	        /**
	         * Creates a copy of this word array.
	         *
	         * @return {WordArray} The clone.
	         *
	         * @example
	         *
	         *     var clone = wordArray.clone();
	         */
			clone: function () {
				var clone = Base.clone.call(this);
				clone.words = this.words.slice(0);

				return clone;
			},

	        /**
	         * Creates a word array filled with random bytes.
	         *
	         * @param {number} nBytes The number of random bytes to generate.
	         *
	         * @return {WordArray} The random word array.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var wordArray = CryptoJS.lib.WordArray.random(16);
	         */
			random: function (nBytes) {
				var words = [];

				var r = (function (m_w) {
					var m_w = m_w;
					var m_z = 0x3ade68b1;
					var mask = 0xffffffff;

					return function () {
						m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask;
						m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask;
						var result = ((m_z << 0x10) + m_w) & mask;
						result /= 0x100000000;
						result += 0.5;
						return result * (Math.random() > .5 ? 1 : -1);
					}
				});

				for (var i = 0, rcache; i < nBytes; i += 4) {
					var _r = r((rcache || Math.random()) * 0x100000000);

					rcache = _r() * 0x3ade67b7;
					words.push((_r() * 0x100000000) | 0);
				}

				return new WordArray.init(words, nBytes);
			}
		});

	    /**
	     * Encoder namespace.
	     */
		var C_enc = C.enc = {};

	    /**
	     * Hex encoding strategy.
	     */
		var Hex = C_enc.Hex = {
	        /**
	         * Converts a word array to a hex string.
	         *
	         * @param {WordArray} wordArray The word array.
	         *
	         * @return {string} The hex string.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var hexString = CryptoJS.enc.Hex.stringify(wordArray);
	         */
			stringify: function (wordArray) {
				// Shortcuts
				var words = wordArray.words;
				var sigBytes = wordArray.sigBytes;

				// Convert
				var hexChars = [];
				for (var i = 0; i < sigBytes; i++) {
					var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
					hexChars.push((bite >>> 4).toString(16));
					hexChars.push((bite & 0x0f).toString(16));
				}

				return hexChars.join('');
			},

	        /**
	         * Converts a hex string to a word array.
	         *
	         * @param {string} hexStr The hex string.
	         *
	         * @return {WordArray} The word array.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var wordArray = CryptoJS.enc.Hex.parse(hexString);
	         */
			parse: function (hexStr) {
				// Shortcut
				var hexStrLength = hexStr.length;

				// Convert
				var words = [];
				for (var i = 0; i < hexStrLength; i += 2) {
					words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
				}

				return new WordArray.init(words, hexStrLength / 2);
			}
		};

	    /**
	     * Latin1 encoding strategy.
	     */
		var Latin1 = C_enc.Latin1 = {
	        /**
	         * Converts a word array to a Latin1 string.
	         *
	         * @param {WordArray} wordArray The word array.
	         *
	         * @return {string} The Latin1 string.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
	         */
			stringify: function (wordArray) {
				// Shortcuts
				var words = wordArray.words;
				var sigBytes = wordArray.sigBytes;

				// Convert
				var latin1Chars = [];
				for (var i = 0; i < sigBytes; i++) {
					var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
					latin1Chars.push(String.fromCharCode(bite));
				}

				return latin1Chars.join('');
			},

	        /**
	         * Converts a Latin1 string to a word array.
	         *
	         * @param {string} latin1Str The Latin1 string.
	         *
	         * @return {WordArray} The word array.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
	         */
			parse: function (latin1Str) {
				// Shortcut
				var latin1StrLength = latin1Str.length;

				// Convert
				var words = [];
				for (var i = 0; i < latin1StrLength; i++) {
					words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
				}

				return new WordArray.init(words, latin1StrLength);
			}
		};

	    /**
	     * UTF-8 encoding strategy.
	     */
		var Utf8 = C_enc.Utf8 = {
	        /**
	         * Converts a word array to a UTF-8 string.
	         *
	         * @param {WordArray} wordArray The word array.
	         *
	         * @return {string} The UTF-8 string.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
	         */
			stringify: function (wordArray) {
				try {
					return decodeURIComponent(escape(Latin1.stringify(wordArray)));
				} catch (e) {
					throw new Error('Malformed UTF-8 data');
				}
			},

	        /**
	         * Converts a UTF-8 string to a word array.
	         *
	         * @param {string} utf8Str The UTF-8 string.
	         *
	         * @return {WordArray} The word array.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
	         */
			parse: function (utf8Str) {
				return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
			}
		};

	    /**
	     * Abstract buffered block algorithm template.
	     *
	     * The property blockSize must be implemented in a concrete subtype.
	     *
	     * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
	     */
		var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
	        /**
	         * Resets this block algorithm's data buffer to its initial state.
	         *
	         * @example
	         *
	         *     bufferedBlockAlgorithm.reset();
	         */
			reset: function () {
				// Initial values
				this._data = new WordArray.init();
				this._nDataBytes = 0;
			},

	        /**
	         * Adds new data to this block algorithm's buffer.
	         *
	         * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
	         *
	         * @example
	         *
	         *     bufferedBlockAlgorithm._append('data');
	         *     bufferedBlockAlgorithm._append(wordArray);
	         */
			_append: function (data) {
				// Convert string to WordArray, else assume WordArray already
				if (typeof data == 'string') {
					data = Utf8.parse(data);
				}

				// Append
				this._data.concat(data);
				this._nDataBytes += data.sigBytes;
			},

	        /**
	         * Processes available data blocks.
	         *
	         * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
	         *
	         * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
	         *
	         * @return {WordArray} The processed data.
	         *
	         * @example
	         *
	         *     var processedData = bufferedBlockAlgorithm._process();
	         *     var processedData = bufferedBlockAlgorithm._process(!!'flush');
	         */
			_process: function (doFlush) {
				// Shortcuts
				var data = this._data;
				var dataWords = data.words;
				var dataSigBytes = data.sigBytes;
				var blockSize = this.blockSize;
				var blockSizeBytes = blockSize * 4;

				// Count blocks ready
				var nBlocksReady = dataSigBytes / blockSizeBytes;
				if (doFlush) {
					// Round up to include partial blocks
					nBlocksReady = Math.ceil(nBlocksReady);
				} else {
					// Round down to include only full blocks,
					// less the number of blocks that must remain in the buffer
					nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
				}

				// Count words ready
				var nWordsReady = nBlocksReady * blockSize;

				// Count bytes ready
				var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);

				// Process blocks
				if (nWordsReady) {
					for (var offset = 0; offset < nWordsReady; offset += blockSize) {
						// Perform concrete-algorithm logic
						this._doProcessBlock(dataWords, offset);
					}

					// Remove processed words
					var processedWords = dataWords.splice(0, nWordsReady);
					data.sigBytes -= nBytesReady;
				}

				// Return processed words
				return new WordArray.init(processedWords, nBytesReady);
			},

	        /**
	         * Creates a copy of this object.
	         *
	         * @return {Object} The clone.
	         *
	         * @example
	         *
	         *     var clone = bufferedBlockAlgorithm.clone();
	         */
			clone: function () {
				var clone = Base.clone.call(this);
				clone._data = this._data.clone();

				return clone;
			},

			_minBufferSize: 0
		});

	    /**
	     * Abstract hasher template.
	     *
	     * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
	     */
		var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
	        /**
	         * Configuration options.
	         */
			cfg: Base.extend(),

	        /**
	         * Initializes a newly created hasher.
	         *
	         * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
	         *
	         * @example
	         *
	         *     var hasher = CryptoJS.algo.SHA256.create();
	         */
			init: function (cfg) {
				// Apply config defaults
				this.cfg = this.cfg.extend(cfg);

				// Set initial values
				this.reset();
			},

	        /**
	         * Resets this hasher to its initial state.
	         *
	         * @example
	         *
	         *     hasher.reset();
	         */
			reset: function () {
				// Reset data buffer
				BufferedBlockAlgorithm.reset.call(this);

				// Perform concrete-hasher logic
				this._doReset();
			},

	        /**
	         * Updates this hasher with a message.
	         *
	         * @param {WordArray|string} messageUpdate The message to append.
	         *
	         * @return {Hasher} This hasher.
	         *
	         * @example
	         *
	         *     hasher.update('message');
	         *     hasher.update(wordArray);
	         */
			update: function (messageUpdate) {
				// Append
				this._append(messageUpdate);

				// Update the hash
				this._process();

				// Chainable
				return this;
			},

	        /**
	         * Finalizes the hash computation.
	         * Note that the finalize operation is effectively a destructive, read-once operation.
	         *
	         * @param {WordArray|string} messageUpdate (Optional) A final message update.
	         *
	         * @return {WordArray} The hash.
	         *
	         * @example
	         *
	         *     var hash = hasher.finalize();
	         *     var hash = hasher.finalize('message');
	         *     var hash = hasher.finalize(wordArray);
	         */
			finalize: function (messageUpdate) {
				// Final message update
				if (messageUpdate) {
					this._append(messageUpdate);
				}

				// Perform concrete-hasher logic
				var hash = this._doFinalize();

				return hash;
			},

			blockSize: 512 / 32,

	        /**
	         * Creates a shortcut function to a hasher's object interface.
	         *
	         * @param {Hasher} hasher The hasher to create a helper for.
	         *
	         * @return {Function} The shortcut function.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
	         */
			_createHelper: function (hasher) {
				return function (message, cfg) {
					return new hasher.init(cfg).finalize(message);
				};
			},

	        /**
	         * Creates a shortcut function to the HMAC's object interface.
	         *
	         * @param {Hasher} hasher The hasher to use in this HMAC helper.
	         *
	         * @return {Function} The shortcut function.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
	         */
			_createHmacHelper: function (hasher) {
				return function (message, key) {
					return new C_algo.HMAC.init(hasher, key).finalize(message);
				};
			}
		});

	    /**
	     * Algorithm namespace.
	     */
		var C_algo = C.algo = {};

		return C;
	}(Math));


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;
		var C_enc = C.enc;

	    /**
	     * Base64 encoding strategy.
	     */
		var Base64 = C_enc.Base64 = {
	        /**
	         * Converts a word array to a Base64 string.
	         *
	         * @param {WordArray} wordArray The word array.
	         *
	         * @return {string} The Base64 string.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var base64String = CryptoJS.enc.Base64.stringify(wordArray);
	         */
			stringify: function (wordArray) {
				// Shortcuts
				var words = wordArray.words;
				var sigBytes = wordArray.sigBytes;
				var map = this._map;

				// Clamp excess bits
				wordArray.clamp();

				// Convert
				var base64Chars = [];
				for (var i = 0; i < sigBytes; i += 3) {
					var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
					var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
					var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;

					var triplet = (byte1 << 16) | (byte2 << 8) | byte3;

					for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
						base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
					}
				}

				// Add padding
				var paddingChar = map.charAt(64);
				if (paddingChar) {
					while (base64Chars.length % 4) {
						base64Chars.push(paddingChar);
					}
				}

				return base64Chars.join('');
			},

	        /**
	         * Converts a Base64 string to a word array.
	         *
	         * @param {string} base64Str The Base64 string.
	         *
	         * @return {WordArray} The word array.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var wordArray = CryptoJS.enc.Base64.parse(base64String);
	         */
			parse: function (base64Str) {
				// Shortcuts
				var base64StrLength = base64Str.length;
				var map = this._map;
				var reverseMap = this._reverseMap;

				if (!reverseMap) {
					reverseMap = this._reverseMap = [];
					for (var j = 0; j < map.length; j++) {
						reverseMap[map.charCodeAt(j)] = j;
					}
				}

				// Ignore padding
				var paddingChar = map.charAt(64);
				if (paddingChar) {
					var paddingIndex = base64Str.indexOf(paddingChar);
					if (paddingIndex !== -1) {
						base64StrLength = paddingIndex;
					}
				}

				// Convert
				return parseLoop(base64Str, base64StrLength, reverseMap);

			},

			_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
		};

		function parseLoop(base64Str, base64StrLength, reverseMap) {
			var words = [];
			var nBytes = 0;
			for (var i = 0; i < base64StrLength; i++) {
				if (i % 4) {
					var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);
					var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);
					words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
					nBytes++;
				}
			}
			return WordArray.create(words, nBytes);
		}
	}());


	(function (Math) {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;
		var Hasher = C_lib.Hasher;
		var C_algo = C.algo;

		// Constants table
		var T = [];

		// Compute constants
		(function () {
			for (var i = 0; i < 64; i++) {
				T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
			}
		}());

	    /**
	     * MD5 hash algorithm.
	     */
		var MD5 = C_algo.MD5 = Hasher.extend({
			_doReset: function () {
				this._hash = new WordArray.init([
					0x67452301, 0xefcdab89,
					0x98badcfe, 0x10325476
				]);
			},

			_doProcessBlock: function (M, offset) {
				// Swap endian
				for (var i = 0; i < 16; i++) {
					// Shortcuts
					var offset_i = offset + i;
					var M_offset_i = M[offset_i];

					M[offset_i] = (
						(((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
						(((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
					);
				}

				// Shortcuts
				var H = this._hash.words;

				var M_offset_0 = M[offset + 0];
				var M_offset_1 = M[offset + 1];
				var M_offset_2 = M[offset + 2];
				var M_offset_3 = M[offset + 3];
				var M_offset_4 = M[offset + 4];
				var M_offset_5 = M[offset + 5];
				var M_offset_6 = M[offset + 6];
				var M_offset_7 = M[offset + 7];
				var M_offset_8 = M[offset + 8];
				var M_offset_9 = M[offset + 9];
				var M_offset_10 = M[offset + 10];
				var M_offset_11 = M[offset + 11];
				var M_offset_12 = M[offset + 12];
				var M_offset_13 = M[offset + 13];
				var M_offset_14 = M[offset + 14];
				var M_offset_15 = M[offset + 15];

				// Working varialbes
				var a = H[0];
				var b = H[1];
				var c = H[2];
				var d = H[3];

				// Computation
				a = FF(a, b, c, d, M_offset_0, 7, T[0]);
				d = FF(d, a, b, c, M_offset_1, 12, T[1]);
				c = FF(c, d, a, b, M_offset_2, 17, T[2]);
				b = FF(b, c, d, a, M_offset_3, 22, T[3]);
				a = FF(a, b, c, d, M_offset_4, 7, T[4]);
				d = FF(d, a, b, c, M_offset_5, 12, T[5]);
				c = FF(c, d, a, b, M_offset_6, 17, T[6]);
				b = FF(b, c, d, a, M_offset_7, 22, T[7]);
				a = FF(a, b, c, d, M_offset_8, 7, T[8]);
				d = FF(d, a, b, c, M_offset_9, 12, T[9]);
				c = FF(c, d, a, b, M_offset_10, 17, T[10]);
				b = FF(b, c, d, a, M_offset_11, 22, T[11]);
				a = FF(a, b, c, d, M_offset_12, 7, T[12]);
				d = FF(d, a, b, c, M_offset_13, 12, T[13]);
				c = FF(c, d, a, b, M_offset_14, 17, T[14]);
				b = FF(b, c, d, a, M_offset_15, 22, T[15]);

				a = GG(a, b, c, d, M_offset_1, 5, T[16]);
				d = GG(d, a, b, c, M_offset_6, 9, T[17]);
				c = GG(c, d, a, b, M_offset_11, 14, T[18]);
				b = GG(b, c, d, a, M_offset_0, 20, T[19]);
				a = GG(a, b, c, d, M_offset_5, 5, T[20]);
				d = GG(d, a, b, c, M_offset_10, 9, T[21]);
				c = GG(c, d, a, b, M_offset_15, 14, T[22]);
				b = GG(b, c, d, a, M_offset_4, 20, T[23]);
				a = GG(a, b, c, d, M_offset_9, 5, T[24]);
				d = GG(d, a, b, c, M_offset_14, 9, T[25]);
				c = GG(c, d, a, b, M_offset_3, 14, T[26]);
				b = GG(b, c, d, a, M_offset_8, 20, T[27]);
				a = GG(a, b, c, d, M_offset_13, 5, T[28]);
				d = GG(d, a, b, c, M_offset_2, 9, T[29]);
				c = GG(c, d, a, b, M_offset_7, 14, T[30]);
				b = GG(b, c, d, a, M_offset_12, 20, T[31]);

				a = HH(a, b, c, d, M_offset_5, 4, T[32]);
				d = HH(d, a, b, c, M_offset_8, 11, T[33]);
				c = HH(c, d, a, b, M_offset_11, 16, T[34]);
				b = HH(b, c, d, a, M_offset_14, 23, T[35]);
				a = HH(a, b, c, d, M_offset_1, 4, T[36]);
				d = HH(d, a, b, c, M_offset_4, 11, T[37]);
				c = HH(c, d, a, b, M_offset_7, 16, T[38]);
				b = HH(b, c, d, a, M_offset_10, 23, T[39]);
				a = HH(a, b, c, d, M_offset_13, 4, T[40]);
				d = HH(d, a, b, c, M_offset_0, 11, T[41]);
				c = HH(c, d, a, b, M_offset_3, 16, T[42]);
				b = HH(b, c, d, a, M_offset_6, 23, T[43]);
				a = HH(a, b, c, d, M_offset_9, 4, T[44]);
				d = HH(d, a, b, c, M_offset_12, 11, T[45]);
				c = HH(c, d, a, b, M_offset_15, 16, T[46]);
				b = HH(b, c, d, a, M_offset_2, 23, T[47]);

				a = II(a, b, c, d, M_offset_0, 6, T[48]);
				d = II(d, a, b, c, M_offset_7, 10, T[49]);
				c = II(c, d, a, b, M_offset_14, 15, T[50]);
				b = II(b, c, d, a, M_offset_5, 21, T[51]);
				a = II(a, b, c, d, M_offset_12, 6, T[52]);
				d = II(d, a, b, c, M_offset_3, 10, T[53]);
				c = II(c, d, a, b, M_offset_10, 15, T[54]);
				b = II(b, c, d, a, M_offset_1, 21, T[55]);
				a = II(a, b, c, d, M_offset_8, 6, T[56]);
				d = II(d, a, b, c, M_offset_15, 10, T[57]);
				c = II(c, d, a, b, M_offset_6, 15, T[58]);
				b = II(b, c, d, a, M_offset_13, 21, T[59]);
				a = II(a, b, c, d, M_offset_4, 6, T[60]);
				d = II(d, a, b, c, M_offset_11, 10, T[61]);
				c = II(c, d, a, b, M_offset_2, 15, T[62]);
				b = II(b, c, d, a, M_offset_9, 21, T[63]);

				// Intermediate hash value
				H[0] = (H[0] + a) | 0;
				H[1] = (H[1] + b) | 0;
				H[2] = (H[2] + c) | 0;
				H[3] = (H[3] + d) | 0;
			},

			_doFinalize: function () {
				// Shortcuts
				var data = this._data;
				var dataWords = data.words;

				var nBitsTotal = this._nDataBytes * 8;
				var nBitsLeft = data.sigBytes * 8;

				// Add padding
				dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);

				var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
				var nBitsTotalL = nBitsTotal;
				dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
					(((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
					(((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
				);
				dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
					(((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
					(((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
				);

				data.sigBytes = (dataWords.length + 1) * 4;

				// Hash final blocks
				this._process();

				// Shortcuts
				var hash = this._hash;
				var H = hash.words;

				// Swap endian
				for (var i = 0; i < 4; i++) {
					// Shortcut
					var H_i = H[i];

					H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
						(((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
				}

				// Return final computed hash
				return hash;
			},

			clone: function () {
				var clone = Hasher.clone.call(this);
				clone._hash = this._hash.clone();

				return clone;
			}
		});

		function FF(a, b, c, d, x, s, t) {
			var n = a + ((b & c) | (~b & d)) + x + t;
			return ((n << s) | (n >>> (32 - s))) + b;
		}

		function GG(a, b, c, d, x, s, t) {
			var n = a + ((b & d) | (c & ~d)) + x + t;
			return ((n << s) | (n >>> (32 - s))) + b;
		}

		function HH(a, b, c, d, x, s, t) {
			var n = a + (b ^ c ^ d) + x + t;
			return ((n << s) | (n >>> (32 - s))) + b;
		}

		function II(a, b, c, d, x, s, t) {
			var n = a + (c ^ (b | ~d)) + x + t;
			return ((n << s) | (n >>> (32 - s))) + b;
		}

	    /**
	     * Shortcut function to the hasher's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     *
	     * @return {WordArray} The hash.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hash = CryptoJS.MD5('message');
	     *     var hash = CryptoJS.MD5(wordArray);
	     */
		C.MD5 = Hasher._createHelper(MD5);

	    /**
	     * Shortcut function to the HMAC's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     * @param {WordArray|string} key The secret key.
	     *
	     * @return {WordArray} The HMAC.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hmac = CryptoJS.HmacMD5(message, key);
	     */
		C.HmacMD5 = Hasher._createHmacHelper(MD5);
	}(Math));


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;
		var Hasher = C_lib.Hasher;
		var C_algo = C.algo;

		// Reusable object
		var W = [];

	    /**
	     * SHA-1 hash algorithm.
	     */
		var SHA1 = C_algo.SHA1 = Hasher.extend({
			_doReset: function () {
				this._hash = new WordArray.init([
					0x67452301, 0xefcdab89,
					0x98badcfe, 0x10325476,
					0xc3d2e1f0
				]);
			},

			_doProcessBlock: function (M, offset) {
				// Shortcut
				var H = this._hash.words;

				// Working variables
				var a = H[0];
				var b = H[1];
				var c = H[2];
				var d = H[3];
				var e = H[4];

				// Computation
				for (var i = 0; i < 80; i++) {
					if (i < 16) {
						W[i] = M[offset + i] | 0;
					} else {
						var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
						W[i] = (n << 1) | (n >>> 31);
					}

					var t = ((a << 5) | (a >>> 27)) + e + W[i];
					if (i < 20) {
						t += ((b & c) | (~b & d)) + 0x5a827999;
					} else if (i < 40) {
						t += (b ^ c ^ d) + 0x6ed9eba1;
					} else if (i < 60) {
						t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
					} else /* if (i < 80) */ {
						t += (b ^ c ^ d) - 0x359d3e2a;
					}

					e = d;
					d = c;
					c = (b << 30) | (b >>> 2);
					b = a;
					a = t;
				}

				// Intermediate hash value
				H[0] = (H[0] + a) | 0;
				H[1] = (H[1] + b) | 0;
				H[2] = (H[2] + c) | 0;
				H[3] = (H[3] + d) | 0;
				H[4] = (H[4] + e) | 0;
			},

			_doFinalize: function () {
				// Shortcuts
				var data = this._data;
				var dataWords = data.words;

				var nBitsTotal = this._nDataBytes * 8;
				var nBitsLeft = data.sigBytes * 8;

				// Add padding
				dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
				dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
				dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
				data.sigBytes = dataWords.length * 4;

				// Hash final blocks
				this._process();

				// Return final computed hash
				return this._hash;
			},

			clone: function () {
				var clone = Hasher.clone.call(this);
				clone._hash = this._hash.clone();

				return clone;
			}
		});

	    /**
	     * Shortcut function to the hasher's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     *
	     * @return {WordArray} The hash.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hash = CryptoJS.SHA1('message');
	     *     var hash = CryptoJS.SHA1(wordArray);
	     */
		C.SHA1 = Hasher._createHelper(SHA1);

	    /**
	     * Shortcut function to the HMAC's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     * @param {WordArray|string} key The secret key.
	     *
	     * @return {WordArray} The HMAC.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hmac = CryptoJS.HmacSHA1(message, key);
	     */
		C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
	}());


	(function (Math) {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;
		var Hasher = C_lib.Hasher;
		var C_algo = C.algo;

		// Initialization and round constants tables
		var H = [];
		var K = [];

		// Compute constants
		(function () {
			function isPrime(n) {
				var sqrtN = Math.sqrt(n);
				for (var factor = 2; factor <= sqrtN; factor++) {
					if (!(n % factor)) {
						return false;
					}
				}

				return true;
			}

			function getFractionalBits(n) {
				return ((n - (n | 0)) * 0x100000000) | 0;
			}

			var n = 2;
			var nPrime = 0;
			while (nPrime < 64) {
				if (isPrime(n)) {
					if (nPrime < 8) {
						H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
					}
					K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));

					nPrime++;
				}

				n++;
			}
		}());

		// Reusable object
		var W = [];

	    /**
	     * SHA-256 hash algorithm.
	     */
		var SHA256 = C_algo.SHA256 = Hasher.extend({
			_doReset: function () {
				this._hash = new WordArray.init(H.slice(0));
			},

			_doProcessBlock: function (M, offset) {
				// Shortcut
				var H = this._hash.words;

				// Working variables
				var a = H[0];
				var b = H[1];
				var c = H[2];
				var d = H[3];
				var e = H[4];
				var f = H[5];
				var g = H[6];
				var h = H[7];

				// Computation
				for (var i = 0; i < 64; i++) {
					if (i < 16) {
						W[i] = M[offset + i] | 0;
					} else {
						var gamma0x = W[i - 15];
						var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
							((gamma0x << 14) | (gamma0x >>> 18)) ^
							(gamma0x >>> 3);

						var gamma1x = W[i - 2];
						var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
							((gamma1x << 13) | (gamma1x >>> 19)) ^
							(gamma1x >>> 10);

						W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
					}

					var ch = (e & f) ^ (~e & g);
					var maj = (a & b) ^ (a & c) ^ (b & c);

					var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
					var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));

					var t1 = h + sigma1 + ch + K[i] + W[i];
					var t2 = sigma0 + maj;

					h = g;
					g = f;
					f = e;
					e = (d + t1) | 0;
					d = c;
					c = b;
					b = a;
					a = (t1 + t2) | 0;
				}

				// Intermediate hash value
				H[0] = (H[0] + a) | 0;
				H[1] = (H[1] + b) | 0;
				H[2] = (H[2] + c) | 0;
				H[3] = (H[3] + d) | 0;
				H[4] = (H[4] + e) | 0;
				H[5] = (H[5] + f) | 0;
				H[6] = (H[6] + g) | 0;
				H[7] = (H[7] + h) | 0;
			},

			_doFinalize: function () {
				// Shortcuts
				var data = this._data;
				var dataWords = data.words;

				var nBitsTotal = this._nDataBytes * 8;
				var nBitsLeft = data.sigBytes * 8;

				// Add padding
				dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
				dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
				dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
				data.sigBytes = dataWords.length * 4;

				// Hash final blocks
				this._process();

				// Return final computed hash
				return this._hash;
			},

			clone: function () {
				var clone = Hasher.clone.call(this);
				clone._hash = this._hash.clone();

				return clone;
			}
		});

	    /**
	     * Shortcut function to the hasher's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     *
	     * @return {WordArray} The hash.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hash = CryptoJS.SHA256('message');
	     *     var hash = CryptoJS.SHA256(wordArray);
	     */
		C.SHA256 = Hasher._createHelper(SHA256);

	    /**
	     * Shortcut function to the HMAC's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     * @param {WordArray|string} key The secret key.
	     *
	     * @return {WordArray} The HMAC.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hmac = CryptoJS.HmacSHA256(message, key);
	     */
		C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
	}(Math));


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;
		var C_enc = C.enc;

	    /**
	     * UTF-16 BE encoding strategy.
	     */
		var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
	        /**
	         * Converts a word array to a UTF-16 BE string.
	         *
	         * @param {WordArray} wordArray The word array.
	         *
	         * @return {string} The UTF-16 BE string.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
	         */
			stringify: function (wordArray) {
				// Shortcuts
				var words = wordArray.words;
				var sigBytes = wordArray.sigBytes;

				// Convert
				var utf16Chars = [];
				for (var i = 0; i < sigBytes; i += 2) {
					var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
					utf16Chars.push(String.fromCharCode(codePoint));
				}

				return utf16Chars.join('');
			},

	        /**
	         * Converts a UTF-16 BE string to a word array.
	         *
	         * @param {string} utf16Str The UTF-16 BE string.
	         *
	         * @return {WordArray} The word array.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
	         */
			parse: function (utf16Str) {
				// Shortcut
				var utf16StrLength = utf16Str.length;

				// Convert
				var words = [];
				for (var i = 0; i < utf16StrLength; i++) {
					words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
				}

				return WordArray.create(words, utf16StrLength * 2);
			}
		};

	    /**
	     * UTF-16 LE encoding strategy.
	     */
		C_enc.Utf16LE = {
	        /**
	         * Converts a word array to a UTF-16 LE string.
	         *
	         * @param {WordArray} wordArray The word array.
	         *
	         * @return {string} The UTF-16 LE string.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
	         */
			stringify: function (wordArray) {
				// Shortcuts
				var words = wordArray.words;
				var sigBytes = wordArray.sigBytes;

				// Convert
				var utf16Chars = [];
				for (var i = 0; i < sigBytes; i += 2) {
					var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
					utf16Chars.push(String.fromCharCode(codePoint));
				}

				return utf16Chars.join('');
			},

	        /**
	         * Converts a UTF-16 LE string to a word array.
	         *
	         * @param {string} utf16Str The UTF-16 LE string.
	         *
	         * @return {WordArray} The word array.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
	         */
			parse: function (utf16Str) {
				// Shortcut
				var utf16StrLength = utf16Str.length;

				// Convert
				var words = [];
				for (var i = 0; i < utf16StrLength; i++) {
					words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
				}

				return WordArray.create(words, utf16StrLength * 2);
			}
		};

		function swapEndian(word) {
			return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
		}
	}());


	(function () {
		// Check if typed arrays are supported
		if (typeof ArrayBuffer != 'function') {
			return;
		}

		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;

		// Reference original init
		var superInit = WordArray.init;

		// Augment WordArray.init to handle typed arrays
		var subInit = WordArray.init = function (typedArray) {
			// Convert buffers to uint8
			if (typedArray instanceof ArrayBuffer) {
				typedArray = new Uint8Array(typedArray);
			}

			// Convert other array views to uint8
			if (
				typedArray instanceof Int8Array ||
				(typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) ||
				typedArray instanceof Int16Array ||
				typedArray instanceof Uint16Array ||
				typedArray instanceof Int32Array ||
				typedArray instanceof Uint32Array ||
				typedArray instanceof Float32Array ||
				typedArray instanceof Float64Array
			) {
				typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
			}

			// Handle Uint8Array
			if (typedArray instanceof Uint8Array) {
				// Shortcut
				var typedArrayByteLength = typedArray.byteLength;

				// Extract bytes
				var words = [];
				for (var i = 0; i < typedArrayByteLength; i++) {
					words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
				}

				// Initialize this word array
				superInit.call(this, words, typedArrayByteLength);
			} else {
				// Else call normal init
				superInit.apply(this, arguments);
			}
		};

		subInit.prototype = WordArray;
	}());


	/** @preserve
	(c) 2012 by Cédric Mesnil. All rights reserved.

	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

	    - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
	    - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

	THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	*/

	(function (Math) {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;
		var Hasher = C_lib.Hasher;
		var C_algo = C.algo;

		// Constants table
		var _zl = WordArray.create([
			0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
			7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
			3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
			1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
			4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);
		var _zr = WordArray.create([
			5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
			6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
			15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
			8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
			12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);
		var _sl = WordArray.create([
			11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
			7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
			11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
			11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
			9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]);
		var _sr = WordArray.create([
			8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
			9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
			9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
			15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
			8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]);

		var _hl = WordArray.create([0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
		var _hr = WordArray.create([0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);

	    /**
	     * RIPEMD160 hash algorithm.
	     */
		var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
			_doReset: function () {
				this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
			},

			_doProcessBlock: function (M, offset) {

				// Swap endian
				for (var i = 0; i < 16; i++) {
					// Shortcuts
					var offset_i = offset + i;
					var M_offset_i = M[offset_i];

					// Swap
					M[offset_i] = (
						(((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
						(((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
					);
				}
				// Shortcut
				var H = this._hash.words;
				var hl = _hl.words;
				var hr = _hr.words;
				var zl = _zl.words;
				var zr = _zr.words;
				var sl = _sl.words;
				var sr = _sr.words;

				// Working variables
				var al, bl, cl, dl, el;
				var ar, br, cr, dr, er;

				ar = al = H[0];
				br = bl = H[1];
				cr = cl = H[2];
				dr = dl = H[3];
				er = el = H[4];
				// Computation
				var t;
				for (var i = 0; i < 80; i += 1) {
					t = (al + M[offset + zl[i]]) | 0;
					if (i < 16) {
						t += f1(bl, cl, dl) + hl[0];
					} else if (i < 32) {
						t += f2(bl, cl, dl) + hl[1];
					} else if (i < 48) {
						t += f3(bl, cl, dl) + hl[2];
					} else if (i < 64) {
						t += f4(bl, cl, dl) + hl[3];
					} else {// if (i<80) {
						t += f5(bl, cl, dl) + hl[4];
					}
					t = t | 0;
					t = rotl(t, sl[i]);
					t = (t + el) | 0;
					al = el;
					el = dl;
					dl = rotl(cl, 10);
					cl = bl;
					bl = t;

					t = (ar + M[offset + zr[i]]) | 0;
					if (i < 16) {
						t += f5(br, cr, dr) + hr[0];
					} else if (i < 32) {
						t += f4(br, cr, dr) + hr[1];
					} else if (i < 48) {
						t += f3(br, cr, dr) + hr[2];
					} else if (i < 64) {
						t += f2(br, cr, dr) + hr[3];
					} else {// if (i<80) {
						t += f1(br, cr, dr) + hr[4];
					}
					t = t | 0;
					t = rotl(t, sr[i]);
					t = (t + er) | 0;
					ar = er;
					er = dr;
					dr = rotl(cr, 10);
					cr = br;
					br = t;
				}
				// Intermediate hash value
				t = (H[1] + cl + dr) | 0;
				H[1] = (H[2] + dl + er) | 0;
				H[2] = (H[3] + el + ar) | 0;
				H[3] = (H[4] + al + br) | 0;
				H[4] = (H[0] + bl + cr) | 0;
				H[0] = t;
			},

			_doFinalize: function () {
				// Shortcuts
				var data = this._data;
				var dataWords = data.words;

				var nBitsTotal = this._nDataBytes * 8;
				var nBitsLeft = data.sigBytes * 8;

				// Add padding
				dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
				dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
					(((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
					(((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
				);
				data.sigBytes = (dataWords.length + 1) * 4;

				// Hash final blocks
				this._process();

				// Shortcuts
				var hash = this._hash;
				var H = hash.words;

				// Swap endian
				for (var i = 0; i < 5; i++) {
					// Shortcut
					var H_i = H[i];

					// Swap
					H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
						(((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
				}

				// Return final computed hash
				return hash;
			},

			clone: function () {
				var clone = Hasher.clone.call(this);
				clone._hash = this._hash.clone();

				return clone;
			}
		});


		function f1(x, y, z) {
			return ((x) ^ (y) ^ (z));

		}

		function f2(x, y, z) {
			return (((x) & (y)) | ((~x) & (z)));
		}

		function f3(x, y, z) {
			return (((x) | (~(y))) ^ (z));
		}

		function f4(x, y, z) {
			return (((x) & (z)) | ((y) & (~(z))));
		}

		function f5(x, y, z) {
			return ((x) ^ ((y) | (~(z))));

		}

		function rotl(x, n) {
			return (x << n) | (x >>> (32 - n));
		}


	    /**
	     * Shortcut function to the hasher's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     *
	     * @return {WordArray} The hash.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hash = CryptoJS.RIPEMD160('message');
	     *     var hash = CryptoJS.RIPEMD160(wordArray);
	     */
		C.RIPEMD160 = Hasher._createHelper(RIPEMD160);

	    /**
	     * Shortcut function to the HMAC's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     * @param {WordArray|string} key The secret key.
	     *
	     * @return {WordArray} The HMAC.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hmac = CryptoJS.HmacRIPEMD160(message, key);
	     */
		C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
	}(Math));


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var Base = C_lib.Base;
		var C_enc = C.enc;
		var Utf8 = C_enc.Utf8;
		var C_algo = C.algo;

	    /**
	     * HMAC algorithm.
	     */
		var HMAC = C_algo.HMAC = Base.extend({
	        /**
	         * Initializes a newly created HMAC.
	         *
	         * @param {Hasher} hasher The hash algorithm to use.
	         * @param {WordArray|string} key The secret key.
	         *
	         * @example
	         *
	         *     var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
	         */
			init: function (hasher, key) {
				// Init hasher
				hasher = this._hasher = new hasher.init();

				// Convert string to WordArray, else assume WordArray already
				if (typeof key == 'string') {
					key = Utf8.parse(key);
				}

				// Shortcuts
				var hasherBlockSize = hasher.blockSize;
				var hasherBlockSizeBytes = hasherBlockSize * 4;

				// Allow arbitrary length keys
				if (key.sigBytes > hasherBlockSizeBytes) {
					key = hasher.finalize(key);
				}

				// Clamp excess bits
				key.clamp();

				// Clone key for inner and outer pads
				var oKey = this._oKey = key.clone();
				var iKey = this._iKey = key.clone();

				// Shortcuts
				var oKeyWords = oKey.words;
				var iKeyWords = iKey.words;

				// XOR keys with pad constants
				for (var i = 0; i < hasherBlockSize; i++) {
					oKeyWords[i] ^= 0x5c5c5c5c;
					iKeyWords[i] ^= 0x36363636;
				}
				oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;

				// Set initial values
				this.reset();
			},

	        /**
	         * Resets this HMAC to its initial state.
	         *
	         * @example
	         *
	         *     hmacHasher.reset();
	         */
			reset: function () {
				// Shortcut
				var hasher = this._hasher;

				// Reset
				hasher.reset();
				hasher.update(this._iKey);
			},

	        /**
	         * Updates this HMAC with a message.
	         *
	         * @param {WordArray|string} messageUpdate The message to append.
	         *
	         * @return {HMAC} This HMAC instance.
	         *
	         * @example
	         *
	         *     hmacHasher.update('message');
	         *     hmacHasher.update(wordArray);
	         */
			update: function (messageUpdate) {
				this._hasher.update(messageUpdate);

				// Chainable
				return this;
			},

	        /**
	         * Finalizes the HMAC computation.
	         * Note that the finalize operation is effectively a destructive, read-once operation.
	         *
	         * @param {WordArray|string} messageUpdate (Optional) A final message update.
	         *
	         * @return {WordArray} The HMAC.
	         *
	         * @example
	         *
	         *     var hmac = hmacHasher.finalize();
	         *     var hmac = hmacHasher.finalize('message');
	         *     var hmac = hmacHasher.finalize(wordArray);
	         */
			finalize: function (messageUpdate) {
				// Shortcut
				var hasher = this._hasher;

				// Compute HMAC
				var innerHash = hasher.finalize(messageUpdate);
				hasher.reset();
				var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));

				return hmac;
			}
		});
	}());


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var Base = C_lib.Base;
		var WordArray = C_lib.WordArray;
		var C_algo = C.algo;
		var SHA1 = C_algo.SHA1;
		var HMAC = C_algo.HMAC;

	    /**
	     * Password-Based Key Derivation Function 2 algorithm.
	     */
		var PBKDF2 = C_algo.PBKDF2 = Base.extend({
	        /**
	         * Configuration options.
	         *
	         * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
	         * @property {Hasher} hasher The hasher to use. Default: SHA1
	         * @property {number} iterations The number of iterations to perform. Default: 1
	         */
			cfg: Base.extend({
				keySize: 128 / 32,
				hasher: SHA1,
				iterations: 1
			}),

	        /**
	         * Initializes a newly created key derivation function.
	         *
	         * @param {Object} cfg (Optional) The configuration options to use for the derivation.
	         *
	         * @example
	         *
	         *     var kdf = CryptoJS.algo.PBKDF2.create();
	         *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
	         *     var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
	         */
			init: function (cfg) {
				this.cfg = this.cfg.extend(cfg);
			},

	        /**
	         * Computes the Password-Based Key Derivation Function 2.
	         *
	         * @param {WordArray|string} password The password.
	         * @param {WordArray|string} salt A salt.
	         *
	         * @return {WordArray} The derived key.
	         *
	         * @example
	         *
	         *     var key = kdf.compute(password, salt);
	         */
			compute: function (password, salt) {
				// Shortcut
				var cfg = this.cfg;

				// Init HMAC
				var hmac = HMAC.create(cfg.hasher, password);

				// Initial values
				var derivedKey = WordArray.create();
				var blockIndex = WordArray.create([0x00000001]);

				// Shortcuts
				var derivedKeyWords = derivedKey.words;
				var blockIndexWords = blockIndex.words;
				var keySize = cfg.keySize;
				var iterations = cfg.iterations;

				// Generate key
				while (derivedKeyWords.length < keySize) {
					var block = hmac.update(salt).finalize(blockIndex);
					hmac.reset();

					// Shortcuts
					var blockWords = block.words;
					var blockWordsLength = blockWords.length;

					// Iterations
					var intermediate = block;
					for (var i = 1; i < iterations; i++) {
						intermediate = hmac.finalize(intermediate);
						hmac.reset();

						// Shortcut
						var intermediateWords = intermediate.words;

						// XOR intermediate with block
						for (var j = 0; j < blockWordsLength; j++) {
							blockWords[j] ^= intermediateWords[j];
						}
					}

					derivedKey.concat(block);
					blockIndexWords[0]++;
				}
				derivedKey.sigBytes = keySize * 4;

				return derivedKey;
			}
		});

	    /**
	     * Computes the Password-Based Key Derivation Function 2.
	     *
	     * @param {WordArray|string} password The password.
	     * @param {WordArray|string} salt A salt.
	     * @param {Object} cfg (Optional) The configuration options to use for this computation.
	     *
	     * @return {WordArray} The derived key.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var key = CryptoJS.PBKDF2(password, salt);
	     *     var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
	     *     var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
	     */
		C.PBKDF2 = function (password, salt, cfg) {
			return PBKDF2.create(cfg).compute(password, salt);
		};
	}());


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var Base = C_lib.Base;
		var WordArray = C_lib.WordArray;
		var C_algo = C.algo;
		var MD5 = C_algo.MD5;

	    /**
	     * This key derivation function is meant to conform with EVP_BytesToKey.
	     * www.openssl.org/docs/crypto/EVP_BytesToKey.html
	     */
		var EvpKDF = C_algo.EvpKDF = Base.extend({
	        /**
	         * Configuration options.
	         *
	         * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
	         * @property {Hasher} hasher The hash algorithm to use. Default: MD5
	         * @property {number} iterations The number of iterations to perform. Default: 1
	         */
			cfg: Base.extend({
				keySize: 128 / 32,
				hasher: MD5,
				iterations: 1
			}),

	        /**
	         * Initializes a newly created key derivation function.
	         *
	         * @param {Object} cfg (Optional) The configuration options to use for the derivation.
	         *
	         * @example
	         *
	         *     var kdf = CryptoJS.algo.EvpKDF.create();
	         *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
	         *     var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
	         */
			init: function (cfg) {
				this.cfg = this.cfg.extend(cfg);
			},

	        /**
	         * Derives a key from a password.
	         *
	         * @param {WordArray|string} password The password.
	         * @param {WordArray|string} salt A salt.
	         *
	         * @return {WordArray} The derived key.
	         *
	         * @example
	         *
	         *     var key = kdf.compute(password, salt);
	         */
			compute: function (password, salt) {
				// Shortcut
				var cfg = this.cfg;

				// Init hasher
				var hasher = cfg.hasher.create();

				// Initial values
				var derivedKey = WordArray.create();

				// Shortcuts
				var derivedKeyWords = derivedKey.words;
				var keySize = cfg.keySize;
				var iterations = cfg.iterations;

				// Generate key
				while (derivedKeyWords.length < keySize) {
					if (block) {
						hasher.update(block);
					}
					var block = hasher.update(password).finalize(salt);
					hasher.reset();

					// Iterations
					for (var i = 1; i < iterations; i++) {
						block = hasher.finalize(block);
						hasher.reset();
					}

					derivedKey.concat(block);
				}
				derivedKey.sigBytes = keySize * 4;

				return derivedKey;
			}
		});

	    /**
	     * Derives a key from a password.
	     *
	     * @param {WordArray|string} password The password.
	     * @param {WordArray|string} salt A salt.
	     * @param {Object} cfg (Optional) The configuration options to use for this computation.
	     *
	     * @return {WordArray} The derived key.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var key = CryptoJS.EvpKDF(password, salt);
	     *     var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
	     *     var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
	     */
		C.EvpKDF = function (password, salt, cfg) {
			return EvpKDF.create(cfg).compute(password, salt);
		};
	}());


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;
		var C_algo = C.algo;
		var SHA256 = C_algo.SHA256;

	    /**
	     * SHA-224 hash algorithm.
	     */
		var SHA224 = C_algo.SHA224 = SHA256.extend({
			_doReset: function () {
				this._hash = new WordArray.init([
					0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
					0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
				]);
			},

			_doFinalize: function () {
				var hash = SHA256._doFinalize.call(this);

				hash.sigBytes -= 4;

				return hash;
			}
		});

	    /**
	     * Shortcut function to the hasher's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     *
	     * @return {WordArray} The hash.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hash = CryptoJS.SHA224('message');
	     *     var hash = CryptoJS.SHA224(wordArray);
	     */
		C.SHA224 = SHA256._createHelper(SHA224);

	    /**
	     * Shortcut function to the HMAC's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     * @param {WordArray|string} key The secret key.
	     *
	     * @return {WordArray} The HMAC.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hmac = CryptoJS.HmacSHA224(message, key);
	     */
		C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
	}());


	(function (undefined) {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var Base = C_lib.Base;
		var X32WordArray = C_lib.WordArray;

	    /**
	     * x64 namespace.
	     */
		var C_x64 = C.x64 = {};

	    /**
	     * A 64-bit word.
	     */
		var X64Word = C_x64.Word = Base.extend({
	        /**
	         * Initializes a newly created 64-bit word.
	         *
	         * @param {number} high The high 32 bits.
	         * @param {number} low The low 32 bits.
	         *
	         * @example
	         *
	         *     var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
	         */
			init: function (high, low) {
				this.high = high;
				this.low = low;
			}

	        /**
	         * Bitwise NOTs this word.
	         *
	         * @return {X64Word} A new x64-Word object after negating.
	         *
	         * @example
	         *
	         *     var negated = x64Word.not();
	         */
			// not: function () {
			// var high = ~this.high;
			// var low = ~this.low;

			// return X64Word.create(high, low);
			// },

	        /**
	         * Bitwise ANDs this word with the passed word.
	         *
	         * @param {X64Word} word The x64-Word to AND with this word.
	         *
	         * @return {X64Word} A new x64-Word object after ANDing.
	         *
	         * @example
	         *
	         *     var anded = x64Word.and(anotherX64Word);
	         */
			// and: function (word) {
			// var high = this.high & word.high;
			// var low = this.low & word.low;

			// return X64Word.create(high, low);
			// },

	        /**
	         * Bitwise ORs this word with the passed word.
	         *
	         * @param {X64Word} word The x64-Word to OR with this word.
	         *
	         * @return {X64Word} A new x64-Word object after ORing.
	         *
	         * @example
	         *
	         *     var ored = x64Word.or(anotherX64Word);
	         */
			// or: function (word) {
			// var high = this.high | word.high;
			// var low = this.low | word.low;

			// return X64Word.create(high, low);
			// },

	        /**
	         * Bitwise XORs this word with the passed word.
	         *
	         * @param {X64Word} word The x64-Word to XOR with this word.
	         *
	         * @return {X64Word} A new x64-Word object after XORing.
	         *
	         * @example
	         *
	         *     var xored = x64Word.xor(anotherX64Word);
	         */
			// xor: function (word) {
			// var high = this.high ^ word.high;
			// var low = this.low ^ word.low;

			// return X64Word.create(high, low);
			// },

	        /**
	         * Shifts this word n bits to the left.
	         *
	         * @param {number} n The number of bits to shift.
	         *
	         * @return {X64Word} A new x64-Word object after shifting.
	         *
	         * @example
	         *
	         *     var shifted = x64Word.shiftL(25);
	         */
			// shiftL: function (n) {
			// if (n < 32) {
			// var high = (this.high << n) | (this.low >>> (32 - n));
			// var low = this.low << n;
			// } else {
			// var high = this.low << (n - 32);
			// var low = 0;
			// }

			// return X64Word.create(high, low);
			// },

	        /**
	         * Shifts this word n bits to the right.
	         *
	         * @param {number} n The number of bits to shift.
	         *
	         * @return {X64Word} A new x64-Word object after shifting.
	         *
	         * @example
	         *
	         *     var shifted = x64Word.shiftR(7);
	         */
			// shiftR: function (n) {
			// if (n < 32) {
			// var low = (this.low >>> n) | (this.high << (32 - n));
			// var high = this.high >>> n;
			// } else {
			// var low = this.high >>> (n - 32);
			// var high = 0;
			// }

			// return X64Word.create(high, low);
			// },

	        /**
	         * Rotates this word n bits to the left.
	         *
	         * @param {number} n The number of bits to rotate.
	         *
	         * @return {X64Word} A new x64-Word object after rotating.
	         *
	         * @example
	         *
	         *     var rotated = x64Word.rotL(25);
	         */
			// rotL: function (n) {
			// return this.shiftL(n).or(this.shiftR(64 - n));
			// },

	        /**
	         * Rotates this word n bits to the right.
	         *
	         * @param {number} n The number of bits to rotate.
	         *
	         * @return {X64Word} A new x64-Word object after rotating.
	         *
	         * @example
	         *
	         *     var rotated = x64Word.rotR(7);
	         */
			// rotR: function (n) {
			// return this.shiftR(n).or(this.shiftL(64 - n));
			// },

	        /**
	         * Adds this word with the passed word.
	         *
	         * @param {X64Word} word The x64-Word to add with this word.
	         *
	         * @return {X64Word} A new x64-Word object after adding.
	         *
	         * @example
	         *
	         *     var added = x64Word.add(anotherX64Word);
	         */
			// add: function (word) {
			// var low = (this.low + word.low) | 0;
			// var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
			// var high = (this.high + word.high + carry) | 0;

			// return X64Word.create(high, low);
			// }
		});

	    /**
	     * An array of 64-bit words.
	     *
	     * @property {Array} words The array of CryptoJS.x64.Word objects.
	     * @property {number} sigBytes The number of significant bytes in this word array.
	     */
		var X64WordArray = C_x64.WordArray = Base.extend({
	        /**
	         * Initializes a newly created word array.
	         *
	         * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
	         * @param {number} sigBytes (Optional) The number of significant bytes in the words.
	         *
	         * @example
	         *
	         *     var wordArray = CryptoJS.x64.WordArray.create();
	         *
	         *     var wordArray = CryptoJS.x64.WordArray.create([
	         *         CryptoJS.x64.Word.create(0x00010203, 0x04050607),
	         *         CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
	         *     ]);
	         *
	         *     var wordArray = CryptoJS.x64.WordArray.create([
	         *         CryptoJS.x64.Word.create(0x00010203, 0x04050607),
	         *         CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
	         *     ], 10);
	         */
			init: function (words, sigBytes) {
				words = this.words = words || [];

				if (sigBytes != undefined) {
					this.sigBytes = sigBytes;
				} else {
					this.sigBytes = words.length * 8;
				}
			},

	        /**
	         * Converts this 64-bit word array to a 32-bit word array.
	         *
	         * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
	         *
	         * @example
	         *
	         *     var x32WordArray = x64WordArray.toX32();
	         */
			toX32: function () {
				// Shortcuts
				var x64Words = this.words;
				var x64WordsLength = x64Words.length;

				// Convert
				var x32Words = [];
				for (var i = 0; i < x64WordsLength; i++) {
					var x64Word = x64Words[i];
					x32Words.push(x64Word.high);
					x32Words.push(x64Word.low);
				}

				return X32WordArray.create(x32Words, this.sigBytes);
			},

	        /**
	         * Creates a copy of this word array.
	         *
	         * @return {X64WordArray} The clone.
	         *
	         * @example
	         *
	         *     var clone = x64WordArray.clone();
	         */
			clone: function () {
				var clone = Base.clone.call(this);

				// Clone "words" array
				var words = clone.words = this.words.slice(0);

				// Clone each X64Word object
				var wordsLength = words.length;
				for (var i = 0; i < wordsLength; i++) {
					words[i] = words[i].clone();
				}

				return clone;
			}
		});
	}());


	(function (Math) {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;
		var Hasher = C_lib.Hasher;
		var C_x64 = C.x64;
		var X64Word = C_x64.Word;
		var C_algo = C.algo;

		// Constants tables
		var RHO_OFFSETS = [];
		var PI_INDEXES = [];
		var ROUND_CONSTANTS = [];

		// Compute Constants
		(function () {
			// Compute rho offset constants
			var x = 1, y = 0;
			for (var t = 0; t < 24; t++) {
				RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;

				var newX = y % 5;
				var newY = (2 * x + 3 * y) % 5;
				x = newX;
				y = newY;
			}

			// Compute pi index constants
			for (var x = 0; x < 5; x++) {
				for (var y = 0; y < 5; y++) {
					PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;
				}
			}

			// Compute round constants
			var LFSR = 0x01;
			for (var i = 0; i < 24; i++) {
				var roundConstantMsw = 0;
				var roundConstantLsw = 0;

				for (var j = 0; j < 7; j++) {
					if (LFSR & 0x01) {
						var bitPosition = (1 << j) - 1;
						if (bitPosition < 32) {
							roundConstantLsw ^= 1 << bitPosition;
						} else /* if (bitPosition >= 32) */ {
							roundConstantMsw ^= 1 << (bitPosition - 32);
						}
					}

					// Compute next LFSR
					if (LFSR & 0x80) {
						// Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
						LFSR = (LFSR << 1) ^ 0x71;
					} else {
						LFSR <<= 1;
					}
				}

				ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
			}
		}());

		// Reusable objects for temporary values
		var T = [];
		(function () {
			for (var i = 0; i < 25; i++) {
				T[i] = X64Word.create();
			}
		}());

	    /**
	     * SHA-3 hash algorithm.
	     */
		var SHA3 = C_algo.SHA3 = Hasher.extend({
	        /**
	         * Configuration options.
	         *
	         * @property {number} outputLength
	         *   The desired number of bits in the output hash.
	         *   Only values permitted are: 224, 256, 384, 512.
	         *   Default: 512
	         */
			cfg: Hasher.cfg.extend({
				outputLength: 512
			}),

			_doReset: function () {
				var state = this._state = []
				for (var i = 0; i < 25; i++) {
					state[i] = new X64Word.init();
				}

				this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
			},

			_doProcessBlock: function (M, offset) {
				// Shortcuts
				var state = this._state;
				var nBlockSizeLanes = this.blockSize / 2;

				// Absorb
				for (var i = 0; i < nBlockSizeLanes; i++) {
					// Shortcuts
					var M2i = M[offset + 2 * i];
					var M2i1 = M[offset + 2 * i + 1];

					// Swap endian
					M2i = (
						(((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |
						(((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)
					);
					M2i1 = (
						(((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |
						(((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)
					);

					// Absorb message into state
					var lane = state[i];
					lane.high ^= M2i1;
					lane.low ^= M2i;
				}

				// Rounds
				for (var round = 0; round < 24; round++) {
					// Theta
					for (var x = 0; x < 5; x++) {
						// Mix column lanes
						var tMsw = 0, tLsw = 0;
						for (var y = 0; y < 5; y++) {
							var lane = state[x + 5 * y];
							tMsw ^= lane.high;
							tLsw ^= lane.low;
						}

						// Temporary values
						var Tx = T[x];
						Tx.high = tMsw;
						Tx.low = tLsw;
					}
					for (var x = 0; x < 5; x++) {
						// Shortcuts
						var Tx4 = T[(x + 4) % 5];
						var Tx1 = T[(x + 1) % 5];
						var Tx1Msw = Tx1.high;
						var Tx1Lsw = Tx1.low;

						// Mix surrounding columns
						var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
						var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
						for (var y = 0; y < 5; y++) {
							var lane = state[x + 5 * y];
							lane.high ^= tMsw;
							lane.low ^= tLsw;
						}
					}

					// Rho Pi
					for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
						// Shortcuts
						var lane = state[laneIndex];
						var laneMsw = lane.high;
						var laneLsw = lane.low;
						var rhoOffset = RHO_OFFSETS[laneIndex];

						// Rotate lanes
						if (rhoOffset < 32) {
							var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
							var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
						} else /* if (rhoOffset >= 32) */ {
							var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
							var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
						}

						// Transpose lanes
						var TPiLane = T[PI_INDEXES[laneIndex]];
						TPiLane.high = tMsw;
						TPiLane.low = tLsw;
					}

					// Rho pi at x = y = 0
					var T0 = T[0];
					var state0 = state[0];
					T0.high = state0.high;
					T0.low = state0.low;

					// Chi
					for (var x = 0; x < 5; x++) {
						for (var y = 0; y < 5; y++) {
							// Shortcuts
							var laneIndex = x + 5 * y;
							var lane = state[laneIndex];
							var TLane = T[laneIndex];
							var Tx1Lane = T[((x + 1) % 5) + 5 * y];
							var Tx2Lane = T[((x + 2) % 5) + 5 * y];

							// Mix rows
							lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
							lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);
						}
					}

					// Iota
					var lane = state[0];
					var roundConstant = ROUND_CONSTANTS[round];
					lane.high ^= roundConstant.high;
					lane.low ^= roundConstant.low;;
				}
			},

			_doFinalize: function () {
				// Shortcuts
				var data = this._data;
				var dataWords = data.words;
				var nBitsTotal = this._nDataBytes * 8;
				var nBitsLeft = data.sigBytes * 8;
				var blockSizeBits = this.blockSize * 32;

				// Add padding
				dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
				dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
				data.sigBytes = dataWords.length * 4;

				// Hash final blocks
				this._process();

				// Shortcuts
				var state = this._state;
				var outputLengthBytes = this.cfg.outputLength / 8;
				var outputLengthLanes = outputLengthBytes / 8;

				// Squeeze
				var hashWords = [];
				for (var i = 0; i < outputLengthLanes; i++) {
					// Shortcuts
					var lane = state[i];
					var laneMsw = lane.high;
					var laneLsw = lane.low;

					// Swap endian
					laneMsw = (
						(((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |
						(((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)
					);
					laneLsw = (
						(((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |
						(((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)
					);

					// Squeeze state to retrieve hash
					hashWords.push(laneLsw);
					hashWords.push(laneMsw);
				}

				// Return final computed hash
				return new WordArray.init(hashWords, outputLengthBytes);
			},

			clone: function () {
				var clone = Hasher.clone.call(this);

				var state = clone._state = this._state.slice(0);
				for (var i = 0; i < 25; i++) {
					state[i] = state[i].clone();
				}

				return clone;
			}
		});

	    /**
	     * Shortcut function to the hasher's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     *
	     * @return {WordArray} The hash.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hash = CryptoJS.SHA3('message');
	     *     var hash = CryptoJS.SHA3(wordArray);
	     */
		C.SHA3 = Hasher._createHelper(SHA3);

	    /**
	     * Shortcut function to the HMAC's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     * @param {WordArray|string} key The secret key.
	     *
	     * @return {WordArray} The HMAC.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hmac = CryptoJS.HmacSHA3(message, key);
	     */
		C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
	}(Math));


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var Hasher = C_lib.Hasher;
		var C_x64 = C.x64;
		var X64Word = C_x64.Word;
		var X64WordArray = C_x64.WordArray;
		var C_algo = C.algo;

		function X64Word_create() {
			return X64Word.create.apply(X64Word, arguments);
		}

		// Constants
		var K = [
			X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
			X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
			X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
			X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
			X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
			X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
			X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
			X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
			X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
			X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
			X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
			X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
			X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
			X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
			X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
			X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
			X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
			X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
			X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
			X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
			X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
			X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
			X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
			X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
			X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
			X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
			X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
			X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
			X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
			X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
			X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
			X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
			X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
			X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
			X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
			X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
			X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
			X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
			X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
			X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)
		];

		// Reusable objects
		var W = [];
		(function () {
			for (var i = 0; i < 80; i++) {
				W[i] = X64Word_create();
			}
		}());

	    /**
	     * SHA-512 hash algorithm.
	     */
		var SHA512 = C_algo.SHA512 = Hasher.extend({
			_doReset: function () {
				this._hash = new X64WordArray.init([
					new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),
					new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),
					new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),
					new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)
				]);
			},

			_doProcessBlock: function (M, offset) {
				// Shortcuts
				var H = this._hash.words;

				var H0 = H[0];
				var H1 = H[1];
				var H2 = H[2];
				var H3 = H[3];
				var H4 = H[4];
				var H5 = H[5];
				var H6 = H[6];
				var H7 = H[7];

				var H0h = H0.high;
				var H0l = H0.low;
				var H1h = H1.high;
				var H1l = H1.low;
				var H2h = H2.high;
				var H2l = H2.low;
				var H3h = H3.high;
				var H3l = H3.low;
				var H4h = H4.high;
				var H4l = H4.low;
				var H5h = H5.high;
				var H5l = H5.low;
				var H6h = H6.high;
				var H6l = H6.low;
				var H7h = H7.high;
				var H7l = H7.low;

				// Working variables
				var ah = H0h;
				var al = H0l;
				var bh = H1h;
				var bl = H1l;
				var ch = H2h;
				var cl = H2l;
				var dh = H3h;
				var dl = H3l;
				var eh = H4h;
				var el = H4l;
				var fh = H5h;
				var fl = H5l;
				var gh = H6h;
				var gl = H6l;
				var hh = H7h;
				var hl = H7l;

				// Rounds
				for (var i = 0; i < 80; i++) {
					// Shortcut
					var Wi = W[i];

					// Extend message
					if (i < 16) {
						var Wih = Wi.high = M[offset + i * 2] | 0;
						var Wil = Wi.low = M[offset + i * 2 + 1] | 0;
					} else {
						// Gamma0
						var gamma0x = W[i - 15];
						var gamma0xh = gamma0x.high;
						var gamma0xl = gamma0x.low;
						var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
						var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));

						// Gamma1
						var gamma1x = W[i - 2];
						var gamma1xh = gamma1x.high;
						var gamma1xl = gamma1x.low;
						var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
						var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));

						// W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
						var Wi7 = W[i - 7];
						var Wi7h = Wi7.high;
						var Wi7l = Wi7.low;

						var Wi16 = W[i - 16];
						var Wi16h = Wi16.high;
						var Wi16l = Wi16.low;

						var Wil = gamma0l + Wi7l;
						var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
						var Wil = Wil + gamma1l;
						var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
						var Wil = Wil + Wi16l;
						var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);

						Wi.high = Wih;
						Wi.low = Wil;
					}

					var chh = (eh & fh) ^ (~eh & gh);
					var chl = (el & fl) ^ (~el & gl);
					var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
					var majl = (al & bl) ^ (al & cl) ^ (bl & cl);

					var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
					var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
					var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
					var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));

					// t1 = h + sigma1 + ch + K[i] + W[i]
					var Ki = K[i];
					var Kih = Ki.high;
					var Kil = Ki.low;

					var t1l = hl + sigma1l;
					var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
					var t1l = t1l + chl;
					var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
					var t1l = t1l + Kil;
					var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
					var t1l = t1l + Wil;
					var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);

					// t2 = sigma0 + maj
					var t2l = sigma0l + majl;
					var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);

					// Update working variables
					hh = gh;
					hl = gl;
					gh = fh;
					gl = fl;
					fh = eh;
					fl = el;
					el = (dl + t1l) | 0;
					eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
					dh = ch;
					dl = cl;
					ch = bh;
					cl = bl;
					bh = ah;
					bl = al;
					al = (t1l + t2l) | 0;
					ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
				}

				// Intermediate hash value
				H0l = H0.low = (H0l + al);
				H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));
				H1l = H1.low = (H1l + bl);
				H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));
				H2l = H2.low = (H2l + cl);
				H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));
				H3l = H3.low = (H3l + dl);
				H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));
				H4l = H4.low = (H4l + el);
				H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));
				H5l = H5.low = (H5l + fl);
				H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));
				H6l = H6.low = (H6l + gl);
				H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));
				H7l = H7.low = (H7l + hl);
				H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));
			},

			_doFinalize: function () {
				// Shortcuts
				var data = this._data;
				var dataWords = data.words;

				var nBitsTotal = this._nDataBytes * 8;
				var nBitsLeft = data.sigBytes * 8;

				// Add padding
				dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
				dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
				dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
				data.sigBytes = dataWords.length * 4;

				// Hash final blocks
				this._process();

				// Convert hash to 32-bit word array before returning
				var hash = this._hash.toX32();

				// Return final computed hash
				return hash;
			},

			clone: function () {
				var clone = Hasher.clone.call(this);
				clone._hash = this._hash.clone();

				return clone;
			},

			blockSize: 1024 / 32
		});

	    /**
	     * Shortcut function to the hasher's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     *
	     * @return {WordArray} The hash.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hash = CryptoJS.SHA512('message');
	     *     var hash = CryptoJS.SHA512(wordArray);
	     */
		C.SHA512 = Hasher._createHelper(SHA512);

	    /**
	     * Shortcut function to the HMAC's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     * @param {WordArray|string} key The secret key.
	     *
	     * @return {WordArray} The HMAC.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hmac = CryptoJS.HmacSHA512(message, key);
	     */
		C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
	}());


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_x64 = C.x64;
		var X64Word = C_x64.Word;
		var X64WordArray = C_x64.WordArray;
		var C_algo = C.algo;
		var SHA512 = C_algo.SHA512;

	    /**
	     * SHA-384 hash algorithm.
	     */
		var SHA384 = C_algo.SHA384 = SHA512.extend({
			_doReset: function () {
				this._hash = new X64WordArray.init([
					new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
					new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
					new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
					new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
				]);
			},

			_doFinalize: function () {
				var hash = SHA512._doFinalize.call(this);

				hash.sigBytes -= 16;

				return hash;
			}
		});

	    /**
	     * Shortcut function to the hasher's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     *
	     * @return {WordArray} The hash.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hash = CryptoJS.SHA384('message');
	     *     var hash = CryptoJS.SHA384(wordArray);
	     */
		C.SHA384 = SHA512._createHelper(SHA384);

	    /**
	     * Shortcut function to the HMAC's object interface.
	     *
	     * @param {WordArray|string} message The message to hash.
	     * @param {WordArray|string} key The secret key.
	     *
	     * @return {WordArray} The HMAC.
	     *
	     * @static
	     *
	     * @example
	     *
	     *     var hmac = CryptoJS.HmacSHA384(message, key);
	     */
		C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
	}());


	/**
	 * Cipher core components.
	 */
	CryptoJS.lib.Cipher || (function (undefined) {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var Base = C_lib.Base;
		var WordArray = C_lib.WordArray;
		var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
		var C_enc = C.enc;
		var Utf8 = C_enc.Utf8;
		var Base64 = C_enc.Base64;
		var C_algo = C.algo;
		var EvpKDF = C_algo.EvpKDF;

	    /**
	     * Abstract base cipher template.
	     *
	     * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
	     * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
	     * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
	     * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
	     */
		var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
	        /**
	         * Configuration options.
	         *
	         * @property {WordArray} iv The IV to use for this operation.
	         */
			cfg: Base.extend(),

	        /**
	         * Creates this cipher in encryption mode.
	         *
	         * @param {WordArray} key The key.
	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
	         *
	         * @return {Cipher} A cipher instance.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
	         */
			createEncryptor: function (key, cfg) {
				return this.create(this._ENC_XFORM_MODE, key, cfg);
			},

	        /**
	         * Creates this cipher in decryption mode.
	         *
	         * @param {WordArray} key The key.
	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
	         *
	         * @return {Cipher} A cipher instance.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
	         */
			createDecryptor: function (key, cfg) {
				return this.create(this._DEC_XFORM_MODE, key, cfg);
			},

	        /**
	         * Initializes a newly created cipher.
	         *
	         * @param {number} xformMode Either the encryption or decryption transormation mode constant.
	         * @param {WordArray} key The key.
	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
	         *
	         * @example
	         *
	         *     var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
	         */
			init: function (xformMode, key, cfg) {
				// Apply config defaults
				this.cfg = this.cfg.extend(cfg);

				// Store transform mode and key
				this._xformMode = xformMode;
				this._key = key;

				// Set initial values
				this.reset();
			},

	        /**
	         * Resets this cipher to its initial state.
	         *
	         * @example
	         *
	         *     cipher.reset();
	         */
			reset: function () {
				// Reset data buffer
				BufferedBlockAlgorithm.reset.call(this);

				// Perform concrete-cipher logic
				this._doReset();
			},

	        /**
	         * Adds data to be encrypted or decrypted.
	         *
	         * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
	         *
	         * @return {WordArray} The data after processing.
	         *
	         * @example
	         *
	         *     var encrypted = cipher.process('data');
	         *     var encrypted = cipher.process(wordArray);
	         */
			process: function (dataUpdate) {
				// Append
				this._append(dataUpdate);

				// Process available blocks
				return this._process();
			},

	        /**
	         * Finalizes the encryption or decryption process.
	         * Note that the finalize operation is effectively a destructive, read-once operation.
	         *
	         * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
	         *
	         * @return {WordArray} The data after final processing.
	         *
	         * @example
	         *
	         *     var encrypted = cipher.finalize();
	         *     var encrypted = cipher.finalize('data');
	         *     var encrypted = cipher.finalize(wordArray);
	         */
			finalize: function (dataUpdate) {
				// Final data update
				if (dataUpdate) {
					this._append(dataUpdate);
				}

				// Perform concrete-cipher logic
				var finalProcessedData = this._doFinalize();

				return finalProcessedData;
			},

			keySize: 128 / 32,

			ivSize: 128 / 32,

			_ENC_XFORM_MODE: 1,

			_DEC_XFORM_MODE: 2,

	        /**
	         * Creates shortcut functions to a cipher's object interface.
	         *
	         * @param {Cipher} cipher The cipher to create a helper for.
	         *
	         * @return {Object} An object with encrypt and decrypt shortcut functions.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
	         */
			_createHelper: (function () {
				function selectCipherStrategy(key) {
					if (typeof key == 'string') {
						return PasswordBasedCipher;
					} else {
						return SerializableCipher;
					}
				}

				return function (cipher) {
					return {
						encrypt: function (message, key, cfg) {
							return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
						},

						decrypt: function (ciphertext, key, cfg) {
							return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
						}
					};
				};
			}())
		});

	    /**
	     * Abstract base stream cipher template.
	     *
	     * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
	     */
		var StreamCipher = C_lib.StreamCipher = Cipher.extend({
			_doFinalize: function () {
				// Process partial blocks
				var finalProcessedBlocks = this._process(!!'flush');

				return finalProcessedBlocks;
			},

			blockSize: 1
		});

	    /**
	     * Mode namespace.
	     */
		var C_mode = C.mode = {};

	    /**
	     * Abstract base block cipher mode template.
	     */
		var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
	        /**
	         * Creates this mode for encryption.
	         *
	         * @param {Cipher} cipher A block cipher instance.
	         * @param {Array} iv The IV words.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
	         */
			createEncryptor: function (cipher, iv) {
				return this.Encryptor.create(cipher, iv);
			},

	        /**
	         * Creates this mode for decryption.
	         *
	         * @param {Cipher} cipher A block cipher instance.
	         * @param {Array} iv The IV words.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
	         */
			createDecryptor: function (cipher, iv) {
				return this.Decryptor.create(cipher, iv);
			},

	        /**
	         * Initializes a newly created mode.
	         *
	         * @param {Cipher} cipher A block cipher instance.
	         * @param {Array} iv The IV words.
	         *
	         * @example
	         *
	         *     var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
	         */
			init: function (cipher, iv) {
				this._cipher = cipher;
				this._iv = iv;
			}
		});

	    /**
	     * Cipher Block Chaining mode.
	     */
		var CBC = C_mode.CBC = (function () {
	        /**
	         * Abstract base CBC mode.
	         */
			var CBC = BlockCipherMode.extend();

	        /**
	         * CBC encryptor.
	         */
			CBC.Encryptor = CBC.extend({
	            /**
	             * Processes the data block at offset.
	             *
	             * @param {Array} words The data words to operate on.
	             * @param {number} offset The offset where the block starts.
	             *
	             * @example
	             *
	             *     mode.processBlock(data.words, offset);
	             */
				processBlock: function (words, offset) {
					// Shortcuts
					var cipher = this._cipher;
					var blockSize = cipher.blockSize;

					// XOR and encrypt
					xorBlock.call(this, words, offset, blockSize);
					cipher.encryptBlock(words, offset);

					// Remember this block to use with next block
					this._prevBlock = words.slice(offset, offset + blockSize);
				}
			});

	        /**
	         * CBC decryptor.
	         */
			CBC.Decryptor = CBC.extend({
	            /**
	             * Processes the data block at offset.
	             *
	             * @param {Array} words The data words to operate on.
	             * @param {number} offset The offset where the block starts.
	             *
	             * @example
	             *
	             *     mode.processBlock(data.words, offset);
	             */
				processBlock: function (words, offset) {
					// Shortcuts
					var cipher = this._cipher;
					var blockSize = cipher.blockSize;

					// Remember this block to use with next block
					var thisBlock = words.slice(offset, offset + blockSize);

					// Decrypt and XOR
					cipher.decryptBlock(words, offset);
					xorBlock.call(this, words, offset, blockSize);

					// This block becomes the previous block
					this._prevBlock = thisBlock;
				}
			});

			function xorBlock(words, offset, blockSize) {
				// Shortcut
				var iv = this._iv;

				// Choose mixing block
				if (iv) {
					var block = iv;

					// Remove IV for subsequent blocks
					this._iv = undefined;
				} else {
					var block = this._prevBlock;
				}

				// XOR blocks
				for (var i = 0; i < blockSize; i++) {
					words[offset + i] ^= block[i];
				}
			}

			return CBC;
		}());

	    /**
	     * Padding namespace.
	     */
		var C_pad = C.pad = {};

	    /**
	     * PKCS #5/7 padding strategy.
	     */
		var Pkcs7 = C_pad.Pkcs7 = {
	        /**
	         * Pads data using the algorithm defined in PKCS #5/7.
	         *
	         * @param {WordArray} data The data to pad.
	         * @param {number} blockSize The multiple that the data should be padded to.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     CryptoJS.pad.Pkcs7.pad(wordArray, 4);
	         */
			pad: function (data, blockSize) {
				// Shortcut
				var blockSizeBytes = blockSize * 4;

				// Count padding bytes
				var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;

				// Create padding word
				var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;

				// Create padding
				var paddingWords = [];
				for (var i = 0; i < nPaddingBytes; i += 4) {
					paddingWords.push(paddingWord);
				}
				var padding = WordArray.create(paddingWords, nPaddingBytes);

				// Add padding
				data.concat(padding);
			},

	        /**
	         * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
	         *
	         * @param {WordArray} data The data to unpad.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     CryptoJS.pad.Pkcs7.unpad(wordArray);
	         */
			unpad: function (data) {
				// Get number of padding bytes from last byte
				var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;

				// Remove padding
				data.sigBytes -= nPaddingBytes;
			}
		};

	    /**
	     * Abstract base block cipher template.
	     *
	     * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
	     */
		var BlockCipher = C_lib.BlockCipher = Cipher.extend({
	        /**
	         * Configuration options.
	         *
	         * @property {Mode} mode The block mode to use. Default: CBC
	         * @property {Padding} padding The padding strategy to use. Default: Pkcs7
	         */
			cfg: Cipher.cfg.extend({
				mode: CBC,
				padding: Pkcs7
			}),

			reset: function () {
				// Reset cipher
				Cipher.reset.call(this);

				// Shortcuts
				var cfg = this.cfg;
				var iv = cfg.iv;
				var mode = cfg.mode;

				// Reset block mode
				if (this._xformMode == this._ENC_XFORM_MODE) {
					var modeCreator = mode.createEncryptor;
				} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
					var modeCreator = mode.createDecryptor;
					// Keep at least one block in the buffer for unpadding
					this._minBufferSize = 1;
				}

				if (this._mode && this._mode.__creator == modeCreator) {
					this._mode.init(this, iv && iv.words);
				} else {
					this._mode = modeCreator.call(mode, this, iv && iv.words);
					this._mode.__creator = modeCreator;
				}
			},

			_doProcessBlock: function (words, offset) {
				this._mode.processBlock(words, offset);
			},

			_doFinalize: function () {
				// Shortcut
				var padding = this.cfg.padding;

				// Finalize
				if (this._xformMode == this._ENC_XFORM_MODE) {
					// Pad data
					padding.pad(this._data, this.blockSize);

					// Process final blocks
					var finalProcessedBlocks = this._process(!!'flush');
				} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
					// Process final blocks
					var finalProcessedBlocks = this._process(!!'flush');

					// Unpad data
					padding.unpad(finalProcessedBlocks);
				}

				return finalProcessedBlocks;
			},

			blockSize: 128 / 32
		});

	    /**
	     * A collection of cipher parameters.
	     *
	     * @property {WordArray} ciphertext The raw ciphertext.
	     * @property {WordArray} key The key to this ciphertext.
	     * @property {WordArray} iv The IV used in the ciphering operation.
	     * @property {WordArray} salt The salt used with a key derivation function.
	     * @property {Cipher} algorithm The cipher algorithm.
	     * @property {Mode} mode The block mode used in the ciphering operation.
	     * @property {Padding} padding The padding scheme used in the ciphering operation.
	     * @property {number} blockSize The block size of the cipher.
	     * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
	     */
		var CipherParams = C_lib.CipherParams = Base.extend({
	        /**
	         * Initializes a newly created cipher params object.
	         *
	         * @param {Object} cipherParams An object with any of the possible cipher parameters.
	         *
	         * @example
	         *
	         *     var cipherParams = CryptoJS.lib.CipherParams.create({
	         *         ciphertext: ciphertextWordArray,
	         *         key: keyWordArray,
	         *         iv: ivWordArray,
	         *         salt: saltWordArray,
	         *         algorithm: CryptoJS.algo.AES,
	         *         mode: CryptoJS.mode.CBC,
	         *         padding: CryptoJS.pad.PKCS7,
	         *         blockSize: 4,
	         *         formatter: CryptoJS.format.OpenSSL
	         *     });
	         */
			init: function (cipherParams) {
				this.mixIn(cipherParams);
			},

	        /**
	         * Converts this cipher params object to a string.
	         *
	         * @param {Format} formatter (Optional) The formatting strategy to use.
	         *
	         * @return {string} The stringified cipher params.
	         *
	         * @throws Error If neither the formatter nor the default formatter is set.
	         *
	         * @example
	         *
	         *     var string = cipherParams + '';
	         *     var string = cipherParams.toString();
	         *     var string = cipherParams.toString(CryptoJS.format.OpenSSL);
	         */
			toString: function (formatter) {
				return (formatter || this.formatter).stringify(this);
			}
		});

	    /**
	     * Format namespace.
	     */
		var C_format = C.format = {};

	    /**
	     * OpenSSL formatting strategy.
	     */
		var OpenSSLFormatter = C_format.OpenSSL = {
	        /**
	         * Converts a cipher params object to an OpenSSL-compatible string.
	         *
	         * @param {CipherParams} cipherParams The cipher params object.
	         *
	         * @return {string} The OpenSSL-compatible string.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
	         */
			stringify: function (cipherParams) {
				// Shortcuts
				var ciphertext = cipherParams.ciphertext;
				var salt = cipherParams.salt;

				// Format
				if (salt) {
					var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
				} else {
					var wordArray = ciphertext;
				}

				return wordArray.toString(Base64);
			},

	        /**
	         * Converts an OpenSSL-compatible string to a cipher params object.
	         *
	         * @param {string} openSSLStr The OpenSSL-compatible string.
	         *
	         * @return {CipherParams} The cipher params object.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
	         */
			parse: function (openSSLStr) {
				// Parse base64
				var ciphertext = Base64.parse(openSSLStr);

				// Shortcut
				var ciphertextWords = ciphertext.words;

				// Test for salt
				if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
					// Extract salt
					var salt = WordArray.create(ciphertextWords.slice(2, 4));

					// Remove salt from ciphertext
					ciphertextWords.splice(0, 4);
					ciphertext.sigBytes -= 16;
				}

				return CipherParams.create({ ciphertext: ciphertext, salt: salt });
			}
		};

	    /**
	     * A cipher wrapper that returns ciphertext as a serializable cipher params object.
	     */
		var SerializableCipher = C_lib.SerializableCipher = Base.extend({
	        /**
	         * Configuration options.
	         *
	         * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
	         */
			cfg: Base.extend({
				format: OpenSSLFormatter
			}),

	        /**
	         * Encrypts a message.
	         *
	         * @param {Cipher} cipher The cipher algorithm to use.
	         * @param {WordArray|string} message The message to encrypt.
	         * @param {WordArray} key The key.
	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
	         *
	         * @return {CipherParams} A cipher params object.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
	         *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
	         *     var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
	         */
			encrypt: function (cipher, message, key, cfg) {
				// Apply config defaults
				cfg = this.cfg.extend(cfg);

				// Encrypt
				var encryptor = cipher.createEncryptor(key, cfg);
				var ciphertext = encryptor.finalize(message);

				// Shortcut
				var cipherCfg = encryptor.cfg;

				// Create and return serializable cipher params
				return CipherParams.create({
					ciphertext: ciphertext,
					key: key,
					iv: cipherCfg.iv,
					algorithm: cipher,
					mode: cipherCfg.mode,
					padding: cipherCfg.padding,
					blockSize: cipher.blockSize,
					formatter: cfg.format
				});
			},

	        /**
	         * Decrypts serialized ciphertext.
	         *
	         * @param {Cipher} cipher The cipher algorithm to use.
	         * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
	         * @param {WordArray} key The key.
	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
	         *
	         * @return {WordArray} The plaintext.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
	         *     var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
	         */
			decrypt: function (cipher, ciphertext, key, cfg) {
				// Apply config defaults
				cfg = this.cfg.extend(cfg);

				// Convert string to CipherParams
				ciphertext = this._parse(ciphertext, cfg.format);

				// Decrypt
				var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);

				return plaintext;
			},

	        /**
	         * Converts serialized ciphertext to CipherParams,
	         * else assumed CipherParams already and returns ciphertext unchanged.
	         *
	         * @param {CipherParams|string} ciphertext The ciphertext.
	         * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
	         *
	         * @return {CipherParams} The unserialized ciphertext.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
	         */
			_parse: function (ciphertext, format) {
				if (typeof ciphertext == 'string') {
					return format.parse(ciphertext, this);
				} else {
					return ciphertext;
				}
			}
		});

	    /**
	     * Key derivation function namespace.
	     */
		var C_kdf = C.kdf = {};

	    /**
	     * OpenSSL key derivation function.
	     */
		var OpenSSLKdf = C_kdf.OpenSSL = {
	        /**
	         * Derives a key and IV from a password.
	         *
	         * @param {string} password The password to derive from.
	         * @param {number} keySize The size in words of the key to generate.
	         * @param {number} ivSize The size in words of the IV to generate.
	         * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
	         *
	         * @return {CipherParams} A cipher params object with the key, IV, and salt.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
	         *     var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
	         */
			execute: function (password, keySize, ivSize, salt) {
				// Generate random salt
				if (!salt) {
					salt = WordArray.random(64 / 8);
				}

				// Derive key and IV
				var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);

				// Separate key and IV
				var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
				key.sigBytes = keySize * 4;

				// Return params
				return CipherParams.create({ key: key, iv: iv, salt: salt });
			}
		};

	    /**
	     * A serializable cipher wrapper that derives the key from a password,
	     * and returns ciphertext as a serializable cipher params object.
	     */
		var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
	        /**
	         * Configuration options.
	         *
	         * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
	         */
			cfg: SerializableCipher.cfg.extend({
				kdf: OpenSSLKdf
			}),

	        /**
	         * Encrypts a message using a password.
	         *
	         * @param {Cipher} cipher The cipher algorithm to use.
	         * @param {WordArray|string} message The message to encrypt.
	         * @param {string} password The password.
	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
	         *
	         * @return {CipherParams} A cipher params object.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
	         *     var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
	         */
			encrypt: function (cipher, message, password, cfg) {
				// Apply config defaults
				cfg = this.cfg.extend(cfg);

				// Derive key and other params
				var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);

				// Add IV to config
				cfg.iv = derivedParams.iv;

				// Encrypt
				var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);

				// Mix in derived params
				ciphertext.mixIn(derivedParams);

				return ciphertext;
			},

	        /**
	         * Decrypts serialized ciphertext using a password.
	         *
	         * @param {Cipher} cipher The cipher algorithm to use.
	         * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
	         * @param {string} password The password.
	         * @param {Object} cfg (Optional) The configuration options to use for this operation.
	         *
	         * @return {WordArray} The plaintext.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
	         *     var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
	         */
			decrypt: function (cipher, ciphertext, password, cfg) {
				// Apply config defaults
				cfg = this.cfg.extend(cfg);

				// Convert string to CipherParams
				ciphertext = this._parse(ciphertext, cfg.format);

				// Derive key and other params
				var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);

				// Add IV to config
				cfg.iv = derivedParams.iv;

				// Decrypt
				var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);

				return plaintext;
			}
		});
	}());


	/**
	 * Cipher Feedback block mode.
	 */
	CryptoJS.mode.CFB = (function () {
		var CFB = CryptoJS.lib.BlockCipherMode.extend();

		CFB.Encryptor = CFB.extend({
			processBlock: function (words, offset) {
				// Shortcuts
				var cipher = this._cipher;
				var blockSize = cipher.blockSize;

				generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);

				// Remember this block to use with next block
				this._prevBlock = words.slice(offset, offset + blockSize);
			}
		});

		CFB.Decryptor = CFB.extend({
			processBlock: function (words, offset) {
				// Shortcuts
				var cipher = this._cipher;
				var blockSize = cipher.blockSize;

				// Remember this block to use with next block
				var thisBlock = words.slice(offset, offset + blockSize);

				generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);

				// This block becomes the previous block
				this._prevBlock = thisBlock;
			}
		});

		function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
			// Shortcut
			var iv = this._iv;

			// Generate keystream
			if (iv) {
				var keystream = iv.slice(0);

				// Remove IV for subsequent blocks
				this._iv = undefined;
			} else {
				var keystream = this._prevBlock;
			}
			cipher.encryptBlock(keystream, 0);

			// Encrypt
			for (var i = 0; i < blockSize; i++) {
				words[offset + i] ^= keystream[i];
			}
		}

		return CFB;
	}());


	/**
	 * Electronic Codebook block mode.
	 */
	CryptoJS.mode.ECB = (function () {
		var ECB = CryptoJS.lib.BlockCipherMode.extend();

		ECB.Encryptor = ECB.extend({
			processBlock: function (words, offset) {
				this._cipher.encryptBlock(words, offset);
			}
		});

		ECB.Decryptor = ECB.extend({
			processBlock: function (words, offset) {
				this._cipher.decryptBlock(words, offset);
			}
		});

		return ECB;
	}());


	/**
	 * ANSI X.923 padding strategy.
	 */
	CryptoJS.pad.AnsiX923 = {
		pad: function (data, blockSize) {
			// Shortcuts
			var dataSigBytes = data.sigBytes;
			var blockSizeBytes = blockSize * 4;

			// Count padding bytes
			var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;

			// Compute last byte position
			var lastBytePos = dataSigBytes + nPaddingBytes - 1;

			// Pad
			data.clamp();
			data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
			data.sigBytes += nPaddingBytes;
		},

		unpad: function (data) {
			// Get number of padding bytes from last byte
			var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;

			// Remove padding
			data.sigBytes -= nPaddingBytes;
		}
	};


	/**
	 * ISO 10126 padding strategy.
	 */
	CryptoJS.pad.Iso10126 = {
		pad: function (data, blockSize) {
			// Shortcut
			var blockSizeBytes = blockSize * 4;

			// Count padding bytes
			var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;

			// Pad
			data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
				concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
		},

		unpad: function (data) {
			// Get number of padding bytes from last byte
			var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;

			// Remove padding
			data.sigBytes -= nPaddingBytes;
		}
	};


	/**
	 * ISO/IEC 9797-1 Padding Method 2.
	 */
	CryptoJS.pad.Iso97971 = {
		pad: function (data, blockSize) {
			// Add 0x80 byte
			data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));

			// Zero pad the rest
			CryptoJS.pad.ZeroPadding.pad(data, blockSize);
		},

		unpad: function (data) {
			// Remove zero padding
			CryptoJS.pad.ZeroPadding.unpad(data);

			// Remove one more byte -- the 0x80 byte
			data.sigBytes--;
		}
	};


	/**
	 * Output Feedback block mode.
	 */
	CryptoJS.mode.OFB = (function () {
		var OFB = CryptoJS.lib.BlockCipherMode.extend();

		var Encryptor = OFB.Encryptor = OFB.extend({
			processBlock: function (words, offset) {
				// Shortcuts
				var cipher = this._cipher
				var blockSize = cipher.blockSize;
				var iv = this._iv;
				var keystream = this._keystream;

				// Generate keystream
				if (iv) {
					keystream = this._keystream = iv.slice(0);

					// Remove IV for subsequent blocks
					this._iv = undefined;
				}
				cipher.encryptBlock(keystream, 0);

				// Encrypt
				for (var i = 0; i < blockSize; i++) {
					words[offset + i] ^= keystream[i];
				}
			}
		});

		OFB.Decryptor = Encryptor;

		return OFB;
	}());


	/**
	 * A noop padding strategy.
	 */
	CryptoJS.pad.NoPadding = {
		pad: function () {
		},

		unpad: function () {
		}
	};


	(function (undefined) {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var CipherParams = C_lib.CipherParams;
		var C_enc = C.enc;
		var Hex = C_enc.Hex;
		var C_format = C.format;

		var HexFormatter = C_format.Hex = {
	        /**
	         * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
	         *
	         * @param {CipherParams} cipherParams The cipher params object.
	         *
	         * @return {string} The hexadecimally encoded string.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var hexString = CryptoJS.format.Hex.stringify(cipherParams);
	         */
			stringify: function (cipherParams) {
				return cipherParams.ciphertext.toString(Hex);
			},

	        /**
	         * Converts a hexadecimally encoded ciphertext string to a cipher params object.
	         *
	         * @param {string} input The hexadecimally encoded string.
	         *
	         * @return {CipherParams} The cipher params object.
	         *
	         * @static
	         *
	         * @example
	         *
	         *     var cipherParams = CryptoJS.format.Hex.parse(hexString);
	         */
			parse: function (input) {
				var ciphertext = Hex.parse(input);
				return CipherParams.create({ ciphertext: ciphertext });
			}
		};
	}());


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var BlockCipher = C_lib.BlockCipher;
		var C_algo = C.algo;

		// Lookup tables
		var SBOX = [];
		var INV_SBOX = [];
		var SUB_MIX_0 = [];
		var SUB_MIX_1 = [];
		var SUB_MIX_2 = [];
		var SUB_MIX_3 = [];
		var INV_SUB_MIX_0 = [];
		var INV_SUB_MIX_1 = [];
		var INV_SUB_MIX_2 = [];
		var INV_SUB_MIX_3 = [];

		// Compute lookup tables
		(function () {
			// Compute double table
			var d = [];
			for (var i = 0; i < 256; i++) {
				if (i < 128) {
					d[i] = i << 1;
				} else {
					d[i] = (i << 1) ^ 0x11b;
				}
			}

			// Walk GF(2^8)
			var x = 0;
			var xi = 0;
			for (var i = 0; i < 256; i++) {
				// Compute sbox
				var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
				sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
				SBOX[x] = sx;
				INV_SBOX[sx] = x;

				// Compute multiplication
				var x2 = d[x];
				var x4 = d[x2];
				var x8 = d[x4];

				// Compute sub bytes, mix columns tables
				var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
				SUB_MIX_0[x] = (t << 24) | (t >>> 8);
				SUB_MIX_1[x] = (t << 16) | (t >>> 16);
				SUB_MIX_2[x] = (t << 8) | (t >>> 24);
				SUB_MIX_3[x] = t;

				// Compute inv sub bytes, inv mix columns tables
				var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
				INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
				INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
				INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
				INV_SUB_MIX_3[sx] = t;

				// Compute next counter
				if (!x) {
					x = xi = 1;
				} else {
					x = x2 ^ d[d[d[x8 ^ x2]]];
					xi ^= d[d[xi]];
				}
			}
		}());

		// Precomputed Rcon lookup
		var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];

	    /**
	     * AES block cipher algorithm.
	     */
		var AES = C_algo.AES = BlockCipher.extend({
			_doReset: function () {
				// Skip reset of nRounds has been set before and key did not change
				if (this._nRounds && this._keyPriorReset === this._key) {
					return;
				}

				// Shortcuts
				var key = this._keyPriorReset = this._key;
				var keyWords = key.words;
				var keySize = key.sigBytes / 4;

				// Compute number of rounds
				var nRounds = this._nRounds = keySize + 6;

				// Compute number of key schedule rows
				var ksRows = (nRounds + 1) * 4;

				// Compute key schedule
				var keySchedule = this._keySchedule = [];
				for (var ksRow = 0; ksRow < ksRows; ksRow++) {
					if (ksRow < keySize) {
						keySchedule[ksRow] = keyWords[ksRow];
					} else {
						var t = keySchedule[ksRow - 1];

						if (!(ksRow % keySize)) {
							// Rot word
							t = (t << 8) | (t >>> 24);

							// Sub word
							t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];

							// Mix Rcon
							t ^= RCON[(ksRow / keySize) | 0] << 24;
						} else if (keySize > 6 && ksRow % keySize == 4) {
							// Sub word
							t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
						}

						keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
					}
				}

				// Compute inv key schedule
				var invKeySchedule = this._invKeySchedule = [];
				for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
					var ksRow = ksRows - invKsRow;

					if (invKsRow % 4) {
						var t = keySchedule[ksRow];
					} else {
						var t = keySchedule[ksRow - 4];
					}

					if (invKsRow < 4 || ksRow <= 4) {
						invKeySchedule[invKsRow] = t;
					} else {
						invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
							INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
					}
				}
			},

			encryptBlock: function (M, offset) {
				this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
			},

			decryptBlock: function (M, offset) {
				// Swap 2nd and 4th rows
				var t = M[offset + 1];
				M[offset + 1] = M[offset + 3];
				M[offset + 3] = t;

				this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);

				// Inv swap 2nd and 4th rows
				var t = M[offset + 1];
				M[offset + 1] = M[offset + 3];
				M[offset + 3] = t;
			},

			_doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
				// Shortcut
				var nRounds = this._nRounds;

				// Get input, add round key
				var s0 = M[offset] ^ keySchedule[0];
				var s1 = M[offset + 1] ^ keySchedule[1];
				var s2 = M[offset + 2] ^ keySchedule[2];
				var s3 = M[offset + 3] ^ keySchedule[3];

				// Key schedule row counter
				var ksRow = 4;

				// Rounds
				for (var round = 1; round < nRounds; round++) {
					// Shift rows, sub bytes, mix columns, add round key
					var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
					var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
					var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
					var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];

					// Update state
					s0 = t0;
					s1 = t1;
					s2 = t2;
					s3 = t3;
				}

				// Shift rows, sub bytes, add round key
				var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
				var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
				var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
				var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];

				// Set output
				M[offset] = t0;
				M[offset + 1] = t1;
				M[offset + 2] = t2;
				M[offset + 3] = t3;
			},

			keySize: 256 / 32
		});

	    /**
	     * Shortcut functions to the cipher's object interface.
	     *
	     * @example
	     *
	     *     var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
	     *     var plaintext  = CryptoJS.AES.decrypt(ciphertext, key, cfg);
	     */
		C.AES = BlockCipher._createHelper(AES);
	}());


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var WordArray = C_lib.WordArray;
		var BlockCipher = C_lib.BlockCipher;
		var C_algo = C.algo;

		// Permuted Choice 1 constants
		var PC1 = [
			57, 49, 41, 33, 25, 17, 9, 1,
			58, 50, 42, 34, 26, 18, 10, 2,
			59, 51, 43, 35, 27, 19, 11, 3,
			60, 52, 44, 36, 63, 55, 47, 39,
			31, 23, 15, 7, 62, 54, 46, 38,
			30, 22, 14, 6, 61, 53, 45, 37,
			29, 21, 13, 5, 28, 20, 12, 4
		];

		// Permuted Choice 2 constants
		var PC2 = [
			14, 17, 11, 24, 1, 5,
			3, 28, 15, 6, 21, 10,
			23, 19, 12, 4, 26, 8,
			16, 7, 27, 20, 13, 2,
			41, 52, 31, 37, 47, 55,
			30, 40, 51, 45, 33, 48,
			44, 49, 39, 56, 34, 53,
			46, 42, 50, 36, 29, 32
		];

		// Cumulative bit shift constants
		var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];

		// SBOXes and round permutation constants
		var SBOX_P = [
			{
				0x0: 0x808200,
				0x10000000: 0x8000,
				0x20000000: 0x808002,
				0x30000000: 0x2,
				0x40000000: 0x200,
				0x50000000: 0x808202,
				0x60000000: 0x800202,
				0x70000000: 0x800000,
				0x80000000: 0x202,
				0x90000000: 0x800200,
				0xa0000000: 0x8200,
				0xb0000000: 0x808000,
				0xc0000000: 0x8002,
				0xd0000000: 0x800002,
				0xe0000000: 0x0,
				0xf0000000: 0x8202,
				0x8000000: 0x0,
				0x18000000: 0x808202,
				0x28000000: 0x8202,
				0x38000000: 0x8000,
				0x48000000: 0x808200,
				0x58000000: 0x200,
				0x68000000: 0x808002,
				0x78000000: 0x2,
				0x88000000: 0x800200,
				0x98000000: 0x8200,
				0xa8000000: 0x808000,
				0xb8000000: 0x800202,
				0xc8000000: 0x800002,
				0xd8000000: 0x8002,
				0xe8000000: 0x202,
				0xf8000000: 0x800000,
				0x1: 0x8000,
				0x10000001: 0x2,
				0x20000001: 0x808200,
				0x30000001: 0x800000,
				0x40000001: 0x808002,
				0x50000001: 0x8200,
				0x60000001: 0x200,
				0x70000001: 0x800202,
				0x80000001: 0x808202,
				0x90000001: 0x808000,
				0xa0000001: 0x800002,
				0xb0000001: 0x8202,
				0xc0000001: 0x202,
				0xd0000001: 0x800200,
				0xe0000001: 0x8002,
				0xf0000001: 0x0,
				0x8000001: 0x808202,
				0x18000001: 0x808000,
				0x28000001: 0x800000,
				0x38000001: 0x200,
				0x48000001: 0x8000,
				0x58000001: 0x800002,
				0x68000001: 0x2,
				0x78000001: 0x8202,
				0x88000001: 0x8002,
				0x98000001: 0x800202,
				0xa8000001: 0x202,
				0xb8000001: 0x808200,
				0xc8000001: 0x800200,
				0xd8000001: 0x0,
				0xe8000001: 0x8200,
				0xf8000001: 0x808002
			},
			{
				0x0: 0x40084010,
				0x1000000: 0x4000,
				0x2000000: 0x80000,
				0x3000000: 0x40080010,
				0x4000000: 0x40000010,
				0x5000000: 0x40084000,
				0x6000000: 0x40004000,
				0x7000000: 0x10,
				0x8000000: 0x84000,
				0x9000000: 0x40004010,
				0xa000000: 0x40000000,
				0xb000000: 0x84010,
				0xc000000: 0x80010,
				0xd000000: 0x0,
				0xe000000: 0x4010,
				0xf000000: 0x40080000,
				0x800000: 0x40004000,
				0x1800000: 0x84010,
				0x2800000: 0x10,
				0x3800000: 0x40004010,
				0x4800000: 0x40084010,
				0x5800000: 0x40000000,
				0x6800000: 0x80000,
				0x7800000: 0x40080010,
				0x8800000: 0x80010,
				0x9800000: 0x0,
				0xa800000: 0x4000,
				0xb800000: 0x40080000,
				0xc800000: 0x40000010,
				0xd800000: 0x84000,
				0xe800000: 0x40084000,
				0xf800000: 0x4010,
				0x10000000: 0x0,
				0x11000000: 0x40080010,
				0x12000000: 0x40004010,
				0x13000000: 0x40084000,
				0x14000000: 0x40080000,
				0x15000000: 0x10,
				0x16000000: 0x84010,
				0x17000000: 0x4000,
				0x18000000: 0x4010,
				0x19000000: 0x80000,
				0x1a000000: 0x80010,
				0x1b000000: 0x40000010,
				0x1c000000: 0x84000,
				0x1d000000: 0x40004000,
				0x1e000000: 0x40000000,
				0x1f000000: 0x40084010,
				0x10800000: 0x84010,
				0x11800000: 0x80000,
				0x12800000: 0x40080000,
				0x13800000: 0x4000,
				0x14800000: 0x40004000,
				0x15800000: 0x40084010,
				0x16800000: 0x10,
				0x17800000: 0x40000000,
				0x18800000: 0x40084000,
				0x19800000: 0x40000010,
				0x1a800000: 0x40004010,
				0x1b800000: 0x80010,
				0x1c800000: 0x0,
				0x1d800000: 0x4010,
				0x1e800000: 0x40080010,
				0x1f800000: 0x84000
			},
			{
				0x0: 0x104,
				0x100000: 0x0,
				0x200000: 0x4000100,
				0x300000: 0x10104,
				0x400000: 0x10004,
				0x500000: 0x4000004,
				0x600000: 0x4010104,
				0x700000: 0x4010000,
				0x800000: 0x4000000,
				0x900000: 0x4010100,
				0xa00000: 0x10100,
				0xb00000: 0x4010004,
				0xc00000: 0x4000104,
				0xd00000: 0x10000,
				0xe00000: 0x4,
				0xf00000: 0x100,
				0x80000: 0x4010100,
				0x180000: 0x4010004,
				0x280000: 0x0,
				0x380000: 0x4000100,
				0x480000: 0x4000004,
				0x580000: 0x10000,
				0x680000: 0x10004,
				0x780000: 0x104,
				0x880000: 0x4,
				0x980000: 0x100,
				0xa80000: 0x4010000,
				0xb80000: 0x10104,
				0xc80000: 0x10100,
				0xd80000: 0x4000104,
				0xe80000: 0x4010104,
				0xf80000: 0x4000000,
				0x1000000: 0x4010100,
				0x1100000: 0x10004,
				0x1200000: 0x10000,
				0x1300000: 0x4000100,
				0x1400000: 0x100,
				0x1500000: 0x4010104,
				0x1600000: 0x4000004,
				0x1700000: 0x0,
				0x1800000: 0x4000104,
				0x1900000: 0x4000000,
				0x1a00000: 0x4,
				0x1b00000: 0x10100,
				0x1c00000: 0x4010000,
				0x1d00000: 0x104,
				0x1e00000: 0x10104,
				0x1f00000: 0x4010004,
				0x1080000: 0x4000000,
				0x1180000: 0x104,
				0x1280000: 0x4010100,
				0x1380000: 0x0,
				0x1480000: 0x10004,
				0x1580000: 0x4000100,
				0x1680000: 0x100,
				0x1780000: 0x4010004,
				0x1880000: 0x10000,
				0x1980000: 0x4010104,
				0x1a80000: 0x10104,
				0x1b80000: 0x4000004,
				0x1c80000: 0x4000104,
				0x1d80000: 0x4010000,
				0x1e80000: 0x4,
				0x1f80000: 0x10100
			},
			{
				0x0: 0x80401000,
				0x10000: 0x80001040,
				0x20000: 0x401040,
				0x30000: 0x80400000,
				0x40000: 0x0,
				0x50000: 0x401000,
				0x60000: 0x80000040,
				0x70000: 0x400040,
				0x80000: 0x80000000,
				0x90000: 0x400000,
				0xa0000: 0x40,
				0xb0000: 0x80001000,
				0xc0000: 0x80400040,
				0xd0000: 0x1040,
				0xe0000: 0x1000,
				0xf0000: 0x80401040,
				0x8000: 0x80001040,
				0x18000: 0x40,
				0x28000: 0x80400040,
				0x38000: 0x80001000,
				0x48000: 0x401000,
				0x58000: 0x80401040,
				0x68000: 0x0,
				0x78000: 0x80400000,
				0x88000: 0x1000,
				0x98000: 0x80401000,
				0xa8000: 0x400000,
				0xb8000: 0x1040,
				0xc8000: 0x80000000,
				0xd8000: 0x400040,
				0xe8000: 0x401040,
				0xf8000: 0x80000040,
				0x100000: 0x400040,
				0x110000: 0x401000,
				0x120000: 0x80000040,
				0x130000: 0x0,
				0x140000: 0x1040,
				0x150000: 0x80400040,
				0x160000: 0x80401000,
				0x170000: 0x80001040,
				0x180000: 0x80401040,
				0x190000: 0x80000000,
				0x1a0000: 0x80400000,
				0x1b0000: 0x401040,
				0x1c0000: 0x80001000,
				0x1d0000: 0x400000,
				0x1e0000: 0x40,
				0x1f0000: 0x1000,
				0x108000: 0x80400000,
				0x118000: 0x80401040,
				0x128000: 0x0,
				0x138000: 0x401000,
				0x148000: 0x400040,
				0x158000: 0x80000000,
				0x168000: 0x80001040,
				0x178000: 0x40,
				0x188000: 0x80000040,
				0x198000: 0x1000,
				0x1a8000: 0x80001000,
				0x1b8000: 0x80400040,
				0x1c8000: 0x1040,
				0x1d8000: 0x80401000,
				0x1e8000: 0x400000,
				0x1f8000: 0x401040
			},
			{
				0x0: 0x80,
				0x1000: 0x1040000,
				0x2000: 0x40000,
				0x3000: 0x20000000,
				0x4000: 0x20040080,
				0x5000: 0x1000080,
				0x6000: 0x21000080,
				0x7000: 0x40080,
				0x8000: 0x1000000,
				0x9000: 0x20040000,
				0xa000: 0x20000080,
				0xb000: 0x21040080,
				0xc000: 0x21040000,
				0xd000: 0x0,
				0xe000: 0x1040080,
				0xf000: 0x21000000,
				0x800: 0x1040080,
				0x1800: 0x21000080,
				0x2800: 0x80,
				0x3800: 0x1040000,
				0x4800: 0x40000,
				0x5800: 0x20040080,
				0x6800: 0x21040000,
				0x7800: 0x20000000,
				0x8800: 0x20040000,
				0x9800: 0x0,
				0xa800: 0x21040080,
				0xb800: 0x1000080,
				0xc800: 0x20000080,
				0xd800: 0x21000000,
				0xe800: 0x1000000,
				0xf800: 0x40080,
				0x10000: 0x40000,
				0x11000: 0x80,
				0x12000: 0x20000000,
				0x13000: 0x21000080,
				0x14000: 0x1000080,
				0x15000: 0x21040000,
				0x16000: 0x20040080,
				0x17000: 0x1000000,
				0x18000: 0x21040080,
				0x19000: 0x21000000,
				0x1a000: 0x1040000,
				0x1b000: 0x20040000,
				0x1c000: 0x40080,
				0x1d000: 0x20000080,
				0x1e000: 0x0,
				0x1f000: 0x1040080,
				0x10800: 0x21000080,
				0x11800: 0x1000000,
				0x12800: 0x1040000,
				0x13800: 0x20040080,
				0x14800: 0x20000000,
				0x15800: 0x1040080,
				0x16800: 0x80,
				0x17800: 0x21040000,
				0x18800: 0x40080,
				0x19800: 0x21040080,
				0x1a800: 0x0,
				0x1b800: 0x21000000,
				0x1c800: 0x1000080,
				0x1d800: 0x40000,
				0x1e800: 0x20040000,
				0x1f800: 0x20000080
			},
			{
				0x0: 0x10000008,
				0x100: 0x2000,
				0x200: 0x10200000,
				0x300: 0x10202008,
				0x400: 0x10002000,
				0x500: 0x200000,
				0x600: 0x200008,
				0x700: 0x10000000,
				0x800: 0x0,
				0x900: 0x10002008,
				0xa00: 0x202000,
				0xb00: 0x8,
				0xc00: 0x10200008,
				0xd00: 0x202008,
				0xe00: 0x2008,
				0xf00: 0x10202000,
				0x80: 0x10200000,
				0x180: 0x10202008,
				0x280: 0x8,
				0x380: 0x200000,
				0x480: 0x202008,
				0x580: 0x10000008,
				0x680: 0x10002000,
				0x780: 0x2008,
				0x880: 0x200008,
				0x980: 0x2000,
				0xa80: 0x10002008,
				0xb80: 0x10200008,
				0xc80: 0x0,
				0xd80: 0x10202000,
				0xe80: 0x202000,
				0xf80: 0x10000000,
				0x1000: 0x10002000,
				0x1100: 0x10200008,
				0x1200: 0x10202008,
				0x1300: 0x2008,
				0x1400: 0x200000,
				0x1500: 0x10000000,
				0x1600: 0x10000008,
				0x1700: 0x202000,
				0x1800: 0x202008,
				0x1900: 0x0,
				0x1a00: 0x8,
				0x1b00: 0x10200000,
				0x1c00: 0x2000,
				0x1d00: 0x10002008,
				0x1e00: 0x10202000,
				0x1f00: 0x200008,
				0x1080: 0x8,
				0x1180: 0x202000,
				0x1280: 0x200000,
				0x1380: 0x10000008,
				0x1480: 0x10002000,
				0x1580: 0x2008,
				0x1680: 0x10202008,
				0x1780: 0x10200000,
				0x1880: 0x10202000,
				0x1980: 0x10200008,
				0x1a80: 0x2000,
				0x1b80: 0x202008,
				0x1c80: 0x200008,
				0x1d80: 0x0,
				0x1e80: 0x10000000,
				0x1f80: 0x10002008
			},
			{
				0x0: 0x100000,
				0x10: 0x2000401,
				0x20: 0x400,
				0x30: 0x100401,
				0x40: 0x2100401,
				0x50: 0x0,
				0x60: 0x1,
				0x70: 0x2100001,
				0x80: 0x2000400,
				0x90: 0x100001,
				0xa0: 0x2000001,
				0xb0: 0x2100400,
				0xc0: 0x2100000,
				0xd0: 0x401,
				0xe0: 0x100400,
				0xf0: 0x2000000,
				0x8: 0x2100001,
				0x18: 0x0,
				0x28: 0x2000401,
				0x38: 0x2100400,
				0x48: 0x100000,
				0x58: 0x2000001,
				0x68: 0x2000000,
				0x78: 0x401,
				0x88: 0x100401,
				0x98: 0x2000400,
				0xa8: 0x2100000,
				0xb8: 0x100001,
				0xc8: 0x400,
				0xd8: 0x2100401,
				0xe8: 0x1,
				0xf8: 0x100400,
				0x100: 0x2000000,
				0x110: 0x100000,
				0x120: 0x2000401,
				0x130: 0x2100001,
				0x140: 0x100001,
				0x150: 0x2000400,
				0x160: 0x2100400,
				0x170: 0x100401,
				0x180: 0x401,
				0x190: 0x2100401,
				0x1a0: 0x100400,
				0x1b0: 0x1,
				0x1c0: 0x0,
				0x1d0: 0x2100000,
				0x1e0: 0x2000001,
				0x1f0: 0x400,
				0x108: 0x100400,
				0x118: 0x2000401,
				0x128: 0x2100001,
				0x138: 0x1,
				0x148: 0x2000000,
				0x158: 0x100000,
				0x168: 0x401,
				0x178: 0x2100400,
				0x188: 0x2000001,
				0x198: 0x2100000,
				0x1a8: 0x0,
				0x1b8: 0x2100401,
				0x1c8: 0x100401,
				0x1d8: 0x400,
				0x1e8: 0x2000400,
				0x1f8: 0x100001
			},
			{
				0x0: 0x8000820,
				0x1: 0x20000,
				0x2: 0x8000000,
				0x3: 0x20,
				0x4: 0x20020,
				0x5: 0x8020820,
				0x6: 0x8020800,
				0x7: 0x800,
				0x8: 0x8020000,
				0x9: 0x8000800,
				0xa: 0x20800,
				0xb: 0x8020020,
				0xc: 0x820,
				0xd: 0x0,
				0xe: 0x8000020,
				0xf: 0x20820,
				0x80000000: 0x800,
				0x80000001: 0x8020820,
				0x80000002: 0x8000820,
				0x80000003: 0x8000000,
				0x80000004: 0x8020000,
				0x80000005: 0x20800,
				0x80000006: 0x20820,
				0x80000007: 0x20,
				0x80000008: 0x8000020,
				0x80000009: 0x820,
				0x8000000a: 0x20020,
				0x8000000b: 0x8020800,
				0x8000000c: 0x0,
				0x8000000d: 0x8020020,
				0x8000000e: 0x8000800,
				0x8000000f: 0x20000,
				0x10: 0x20820,
				0x11: 0x8020800,
				0x12: 0x20,
				0x13: 0x800,
				0x14: 0x8000800,
				0x15: 0x8000020,
				0x16: 0x8020020,
				0x17: 0x20000,
				0x18: 0x0,
				0x19: 0x20020,
				0x1a: 0x8020000,
				0x1b: 0x8000820,
				0x1c: 0x8020820,
				0x1d: 0x20800,
				0x1e: 0x820,
				0x1f: 0x8000000,
				0x80000010: 0x20000,
				0x80000011: 0x800,
				0x80000012: 0x8020020,
				0x80000013: 0x20820,
				0x80000014: 0x20,
				0x80000015: 0x8020000,
				0x80000016: 0x8000000,
				0x80000017: 0x8000820,
				0x80000018: 0x8020820,
				0x80000019: 0x8000020,
				0x8000001a: 0x8000800,
				0x8000001b: 0x0,
				0x8000001c: 0x20800,
				0x8000001d: 0x820,
				0x8000001e: 0x20020,
				0x8000001f: 0x8020800
			}
		];

		// Masks that select the SBOX input
		var SBOX_MASK = [
			0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
			0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f
		];

	    /**
	     * DES block cipher algorithm.
	     */
		var DES = C_algo.DES = BlockCipher.extend({
			_doReset: function () {
				// Shortcuts
				var key = this._key;
				var keyWords = key.words;

				// Select 56 bits according to PC1
				var keyBits = [];
				for (var i = 0; i < 56; i++) {
					var keyBitPos = PC1[i] - 1;
					keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
				}

				// Assemble 16 subkeys
				var subKeys = this._subKeys = [];
				for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
					// Create subkey
					var subKey = subKeys[nSubKey] = [];

					// Shortcut
					var bitShift = BIT_SHIFTS[nSubKey];

					// Select 48 bits according to PC2
					for (var i = 0; i < 24; i++) {
						// Select from the left 28 key bits
						subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);

						// Select from the right 28 key bits
						subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
					}

					// Since each subkey is applied to an expanded 32-bit input,
					// the subkey can be broken into 8 values scaled to 32-bits,
					// which allows the key to be used without expansion
					subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
					for (var i = 1; i < 7; i++) {
						subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
					}
					subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
				}

				// Compute inverse subkeys
				var invSubKeys = this._invSubKeys = [];
				for (var i = 0; i < 16; i++) {
					invSubKeys[i] = subKeys[15 - i];
				}
			},

			encryptBlock: function (M, offset) {
				this._doCryptBlock(M, offset, this._subKeys);
			},

			decryptBlock: function (M, offset) {
				this._doCryptBlock(M, offset, this._invSubKeys);
			},

			_doCryptBlock: function (M, offset, subKeys) {
				// Get input
				this._lBlock = M[offset];
				this._rBlock = M[offset + 1];

				// Initial permutation
				exchangeLR.call(this, 4, 0x0f0f0f0f);
				exchangeLR.call(this, 16, 0x0000ffff);
				exchangeRL.call(this, 2, 0x33333333);
				exchangeRL.call(this, 8, 0x00ff00ff);
				exchangeLR.call(this, 1, 0x55555555);

				// Rounds
				for (var round = 0; round < 16; round++) {
					// Shortcuts
					var subKey = subKeys[round];
					var lBlock = this._lBlock;
					var rBlock = this._rBlock;

					// Feistel function
					var f = 0;
					for (var i = 0; i < 8; i++) {
						f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
					}
					this._lBlock = rBlock;
					this._rBlock = lBlock ^ f;
				}

				// Undo swap from last round
				var t = this._lBlock;
				this._lBlock = this._rBlock;
				this._rBlock = t;

				// Final permutation
				exchangeLR.call(this, 1, 0x55555555);
				exchangeRL.call(this, 8, 0x00ff00ff);
				exchangeRL.call(this, 2, 0x33333333);
				exchangeLR.call(this, 16, 0x0000ffff);
				exchangeLR.call(this, 4, 0x0f0f0f0f);

				// Set output
				M[offset] = this._lBlock;
				M[offset + 1] = this._rBlock;
			},

			keySize: 64 / 32,

			ivSize: 64 / 32,

			blockSize: 64 / 32
		});

		// Swap bits across the left and right words
		function exchangeLR(offset, mask) {
			var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
			this._rBlock ^= t;
			this._lBlock ^= t << offset;
		}

		function exchangeRL(offset, mask) {
			var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
			this._lBlock ^= t;
			this._rBlock ^= t << offset;
		}

	    /**
	     * Shortcut functions to the cipher's object interface.
	     *
	     * @example
	     *
	     *     var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
	     *     var plaintext  = CryptoJS.DES.decrypt(ciphertext, key, cfg);
	     */
		C.DES = BlockCipher._createHelper(DES);

	    /**
	     * Triple-DES block cipher algorithm.
	     */
		var TripleDES = C_algo.TripleDES = BlockCipher.extend({
			_doReset: function () {
				// Shortcuts
				var key = this._key;
				var keyWords = key.words;

				// Create DES instances
				this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2)));
				this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4)));
				this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6)));
			},

			encryptBlock: function (M, offset) {
				this._des1.encryptBlock(M, offset);
				this._des2.decryptBlock(M, offset);
				this._des3.encryptBlock(M, offset);
			},

			decryptBlock: function (M, offset) {
				this._des3.decryptBlock(M, offset);
				this._des2.encryptBlock(M, offset);
				this._des1.decryptBlock(M, offset);
			},

			keySize: 192 / 32,

			ivSize: 64 / 32,

			blockSize: 64 / 32
		});

	    /**
	     * Shortcut functions to the cipher's object interface.
	     *
	     * @example
	     *
	     *     var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
	     *     var plaintext  = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
	     */
		C.TripleDES = BlockCipher._createHelper(TripleDES);
	}());


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var StreamCipher = C_lib.StreamCipher;
		var C_algo = C.algo;

	    /**
	     * RC4 stream cipher algorithm.
	     */
		var RC4 = C_algo.RC4 = StreamCipher.extend({
			_doReset: function () {
				// Shortcuts
				var key = this._key;
				var keyWords = key.words;
				var keySigBytes = key.sigBytes;

				// Init sbox
				var S = this._S = [];
				for (var i = 0; i < 256; i++) {
					S[i] = i;
				}

				// Key setup
				for (var i = 0, j = 0; i < 256; i++) {
					var keyByteIndex = i % keySigBytes;
					var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;

					j = (j + S[i] + keyByte) % 256;

					// Swap
					var t = S[i];
					S[i] = S[j];
					S[j] = t;
				}

				// Counters
				this._i = this._j = 0;
			},

			_doProcessBlock: function (M, offset) {
				M[offset] ^= generateKeystreamWord.call(this);
			},

			keySize: 256 / 32,

			ivSize: 0
		});

		function generateKeystreamWord() {
			// Shortcuts
			var S = this._S;
			var i = this._i;
			var j = this._j;

			// Generate keystream word
			var keystreamWord = 0;
			for (var n = 0; n < 4; n++) {
				i = (i + 1) % 256;
				j = (j + S[i]) % 256;

				// Swap
				var t = S[i];
				S[i] = S[j];
				S[j] = t;

				keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
			}

			// Update counters
			this._i = i;
			this._j = j;

			return keystreamWord;
		}

	    /**
	     * Shortcut functions to the cipher's object interface.
	     *
	     * @example
	     *
	     *     var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
	     *     var plaintext  = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
	     */
		C.RC4 = StreamCipher._createHelper(RC4);

	    /**
	     * Modified RC4 stream cipher algorithm.
	     */
		var RC4Drop = C_algo.RC4Drop = RC4.extend({
	        /**
	         * Configuration options.
	         *
	         * @property {number} drop The number of keystream words to drop. Default 192
	         */
			cfg: RC4.cfg.extend({
				drop: 192
			}),

			_doReset: function () {
				RC4._doReset.call(this);

				// Drop
				for (var i = this.cfg.drop; i > 0; i--) {
					generateKeystreamWord.call(this);
				}
			}
		});

	    /**
	     * Shortcut functions to the cipher's object interface.
	     *
	     * @example
	     *
	     *     var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
	     *     var plaintext  = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
	     */
		C.RC4Drop = StreamCipher._createHelper(RC4Drop);
	}());


	/** @preserve
	 * Counter block mode compatible with  Dr Brian Gladman fileenc.c
	 * derived from CryptoJS.mode.CTR
	 * Jan Hruby jhruby.web@gmail.com
	 */
	CryptoJS.mode.CTRGladman = (function () {
		var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();

		function incWord(word) {
			if (((word >> 24) & 0xff) === 0xff) { //overflow
				var b1 = (word >> 16) & 0xff;
				var b2 = (word >> 8) & 0xff;
				var b3 = word & 0xff;

				if (b1 === 0xff) // overflow b1
				{
					b1 = 0;
					if (b2 === 0xff) {
						b2 = 0;
						if (b3 === 0xff) {
							b3 = 0;
						}
						else {
							++b3;
						}
					}
					else {
						++b2;
					}
				}
				else {
					++b1;
				}

				word = 0;
				word += (b1 << 16);
				word += (b2 << 8);
				word += b3;
			}
			else {
				word += (0x01 << 24);
			}
			return word;
		}

		function incCounter(counter) {
			if ((counter[0] = incWord(counter[0])) === 0) {
				// encr_data in fileenc.c from  Dr Brian Gladman's counts only with DWORD j < 8
				counter[1] = incWord(counter[1]);
			}
			return counter;
		}

		var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
			processBlock: function (words, offset) {
				// Shortcuts
				var cipher = this._cipher
				var blockSize = cipher.blockSize;
				var iv = this._iv;
				var counter = this._counter;

				// Generate keystream
				if (iv) {
					counter = this._counter = iv.slice(0);

					// Remove IV for subsequent blocks
					this._iv = undefined;
				}

				incCounter(counter);

				var keystream = counter.slice(0);
				cipher.encryptBlock(keystream, 0);

				// Encrypt
				for (var i = 0; i < blockSize; i++) {
					words[offset + i] ^= keystream[i];
				}
			}
		});

		CTRGladman.Decryptor = Encryptor;

		return CTRGladman;
	}());




	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var StreamCipher = C_lib.StreamCipher;
		var C_algo = C.algo;

		// Reusable objects
		var S = [];
		var C_ = [];
		var G = [];

	    /**
	     * Rabbit stream cipher algorithm
	     */
		var Rabbit = C_algo.Rabbit = StreamCipher.extend({
			_doReset: function () {
				// Shortcuts
				var K = this._key.words;
				var iv = this.cfg.iv;

				// Swap endian
				for (var i = 0; i < 4; i++) {
					K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) |
						(((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);
				}

				// Generate initial state values
				var X = this._X = [
					K[0], (K[3] << 16) | (K[2] >>> 16),
					K[1], (K[0] << 16) | (K[3] >>> 16),
					K[2], (K[1] << 16) | (K[0] >>> 16),
					K[3], (K[2] << 16) | (K[1] >>> 16)
				];

				// Generate initial counter values
				var C = this._C = [
					(K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
					(K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
					(K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
					(K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
				];

				// Carry bit
				this._b = 0;

				// Iterate the system four times
				for (var i = 0; i < 4; i++) {
					nextState.call(this);
				}

				// Modify the counters
				for (var i = 0; i < 8; i++) {
					C[i] ^= X[(i + 4) & 7];
				}

				// IV setup
				if (iv) {
					// Shortcuts
					var IV = iv.words;
					var IV_0 = IV[0];
					var IV_1 = IV[1];

					// Generate four subvectors
					var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
					var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
					var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
					var i3 = (i2 << 16) | (i0 & 0x0000ffff);

					// Modify counter values
					C[0] ^= i0;
					C[1] ^= i1;
					C[2] ^= i2;
					C[3] ^= i3;
					C[4] ^= i0;
					C[5] ^= i1;
					C[6] ^= i2;
					C[7] ^= i3;

					// Iterate the system four times
					for (var i = 0; i < 4; i++) {
						nextState.call(this);
					}
				}
			},

			_doProcessBlock: function (M, offset) {
				// Shortcut
				var X = this._X;

				// Iterate the system
				nextState.call(this);

				// Generate four keystream words
				S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
				S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
				S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
				S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);

				for (var i = 0; i < 4; i++) {
					// Swap endian
					S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
						(((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);

					// Encrypt
					M[offset + i] ^= S[i];
				}
			},

			blockSize: 128 / 32,

			ivSize: 64 / 32
		});

		function nextState() {
			// Shortcuts
			var X = this._X;
			var C = this._C;

			// Save old counter values
			for (var i = 0; i < 8; i++) {
				C_[i] = C[i];
			}

			// Calculate new counter values
			C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
			C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
			C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
			C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
			C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
			C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
			C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
			C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
			this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;

			// Calculate the g-values
			for (var i = 0; i < 8; i++) {
				var gx = X[i] + C[i];

				// Construct high and low argument for squaring
				var ga = gx & 0xffff;
				var gb = gx >>> 16;

				// Calculate high and low result of squaring
				var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
				var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);

				// High XOR low
				G[i] = gh ^ gl;
			}

			// Calculate new state values
			X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
			X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
			X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
			X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
			X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
			X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
			X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
			X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
		}

	    /**
	     * Shortcut functions to the cipher's object interface.
	     *
	     * @example
	     *
	     *     var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
	     *     var plaintext  = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
	     */
		C.Rabbit = StreamCipher._createHelper(Rabbit);
	}());


	/**
	 * Counter block mode.
	 */
	CryptoJS.mode.CTR = (function () {
		var CTR = CryptoJS.lib.BlockCipherMode.extend();

		var Encryptor = CTR.Encryptor = CTR.extend({
			processBlock: function (words, offset) {
				// Shortcuts
				var cipher = this._cipher
				var blockSize = cipher.blockSize;
				var iv = this._iv;
				var counter = this._counter;

				// Generate keystream
				if (iv) {
					counter = this._counter = iv.slice(0);

					// Remove IV for subsequent blocks
					this._iv = undefined;
				}
				var keystream = counter.slice(0);
				cipher.encryptBlock(keystream, 0);

				// Increment counter
				counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0

				// Encrypt
				for (var i = 0; i < blockSize; i++) {
					words[offset + i] ^= keystream[i];
				}
			}
		});

		CTR.Decryptor = Encryptor;

		return CTR;
	}());


	(function () {
		// Shortcuts
		var C = CryptoJS;
		var C_lib = C.lib;
		var StreamCipher = C_lib.StreamCipher;
		var C_algo = C.algo;

		// Reusable objects
		var S = [];
		var C_ = [];
		var G = [];

	    /**
	     * Rabbit stream cipher algorithm.
	     *
	     * This is a legacy version that neglected to convert the key to little-endian.
	     * This error doesn't affect the cipher's security,
	     * but it does affect its compatibility with other implementations.
	     */
		var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
			_doReset: function () {
				// Shortcuts
				var K = this._key.words;
				var iv = this.cfg.iv;

				// Generate initial state values
				var X = this._X = [
					K[0], (K[3] << 16) | (K[2] >>> 16),
					K[1], (K[0] << 16) | (K[3] >>> 16),
					K[2], (K[1] << 16) | (K[0] >>> 16),
					K[3], (K[2] << 16) | (K[1] >>> 16)
				];

				// Generate initial counter values
				var C = this._C = [
					(K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
					(K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
					(K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
					(K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
				];

				// Carry bit
				this._b = 0;

				// Iterate the system four times
				for (var i = 0; i < 4; i++) {
					nextState.call(this);
				}

				// Modify the counters
				for (var i = 0; i < 8; i++) {
					C[i] ^= X[(i + 4) & 7];
				}

				// IV setup
				if (iv) {
					// Shortcuts
					var IV = iv.words;
					var IV_0 = IV[0];
					var IV_1 = IV[1];

					// Generate four subvectors
					var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
					var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
					var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
					var i3 = (i2 << 16) | (i0 & 0x0000ffff);

					// Modify counter values
					C[0] ^= i0;
					C[1] ^= i1;
					C[2] ^= i2;
					C[3] ^= i3;
					C[4] ^= i0;
					C[5] ^= i1;
					C[6] ^= i2;
					C[7] ^= i3;

					// Iterate the system four times
					for (var i = 0; i < 4; i++) {
						nextState.call(this);
					}
				}
			},

			_doProcessBlock: function (M, offset) {
				// Shortcut
				var X = this._X;

				// Iterate the system
				nextState.call(this);

				// Generate four keystream words
				S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
				S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
				S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
				S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);

				for (var i = 0; i < 4; i++) {
					// Swap endian
					S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
						(((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);

					// Encrypt
					M[offset + i] ^= S[i];
				}
			},

			blockSize: 128 / 32,

			ivSize: 64 / 32
		});

		function nextState() {
			// Shortcuts
			var X = this._X;
			var C = this._C;

			// Save old counter values
			for (var i = 0; i < 8; i++) {
				C_[i] = C[i];
			}

			// Calculate new counter values
			C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
			C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
			C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
			C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
			C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
			C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
			C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
			C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
			this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;

			// Calculate the g-values
			for (var i = 0; i < 8; i++) {
				var gx = X[i] + C[i];

				// Construct high and low argument for squaring
				var ga = gx & 0xffff;
				var gb = gx >>> 16;

				// Calculate high and low result of squaring
				var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
				var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);

				// High XOR low
				G[i] = gh ^ gl;
			}

			// Calculate new state values
			X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
			X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
			X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
			X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
			X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
			X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
			X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
			X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
		}

	    /**
	     * Shortcut functions to the cipher's object interface.
	     *
	     * @example
	     *
	     *     var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
	     *     var plaintext  = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
	     */
		C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
	}());


	/**
	 * Zero padding strategy.
	 */
	CryptoJS.pad.ZeroPadding = {
		pad: function (data, blockSize) {
			// Shortcut
			var blockSizeBytes = blockSize * 4;

			// Pad
			data.clamp();
			data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
		},

		unpad: function (data) {
			// Shortcut
			var dataWords = data.words;

			// Unpad
			var i = data.sigBytes - 1;
			while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
				i--;
			}
			data.sigBytes = i + 1;
		}
	};


	return CryptoJS;

}));;
function decrypt(org_key, org_iv, value) {

    var usedKey = getByteKeys(org_key);
    var key = CryptoJS.enc.Hex.parse(toHexString(usedKey));

    var ivBytes = Base64Binary.decode(org_iv);
    var iv = CryptoJS.enc.Hex.parse(toHexString(ivBytes));

    var decrypted = CryptoJS.AES.decrypt(value, key,
        {
            iv: iv
        }
    );

    decryptedData = decrypted.toString(CryptoJS.enc.Utf8);
    return decryptedData;
}

function encrypt(org_key, org_iv, value) {
    var usedKey = getByteKeys(org_key);
    var key = CryptoJS.enc.Hex.parse(toHexString(usedKey));

    var ivBytes = Base64Binary.decode(org_iv);
    var iv = CryptoJS.enc.Hex.parse(toHexString(ivBytes));

    // Logger.info('key: ' +  key );
    // Logger.info('iv: ' +   iv);

    var encrypted = CryptoJS.AES.encrypt(value, key,
        {
            iv: iv
        }
    );

    var result = encrypted.ciphertext.toString(CryptoJS.enc.Base64);
    return result;
}

function toHexString(bytes) {
    var str = "";

    for (i = 0; i < bytes.length; i++) {
        str += lpad(bytes[i].toString(16), '0', 2);
    }

    return str;
}

function lpad(string, padString, length) {
    while (string.length < length) string = padString + string;
    return string;
}

function getBytes(value) {
    var bytes = [];

    for (var i = 0; i < value.length; i++) {
        bytes.push(value.charCodeAt(i));
    }
    return bytes;
}

function getByteKeys(key) {
    var bKey = getBytes(key);
    var useKey = new Uint8Array(32);

    var i = 0;
    for (i = 0; i < useKey.length; i++) {
        useKey[i] = (i + 1);
    }

    var copyLength = Math.min(useKey.length, bKey.length);
    for (i = 0; i < copyLength; i++) {
        useKey[i] = bKey[i];
    }

    return useKey;
};
/*

 LIGHTSTREAMER - www.lightstreamer.com
 Lightstreamer Web Client
 Version 8.0.4 build 1803
 Copyright (c) Lightstreamer Srl. All Rights Reserved.
 Licensed under the Apache License, Version 2.0
   See http://www.apache.org/licenses/LICENSE-2.0
 Contains: LightstreamerClient, Subscription, ConnectionSharing, RemoteAppender, 
   MpnDevice, MpnSubscription, SafariMpnBuilder, FirebaseMpnBuilder, 
   LogMessages, Chart, DynaGrid, SimpleChartListener, 
   StaticGrid, StatusWidget, AlertAppender, BufferAppender, 
   ConsoleAppender, DOMAppender, FunctionAppender, SimpleLoggerProvider, 
   PromisePolyfill
 @overview es6-promise - a tiny implementation of Promises/A+.
 @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
 @license   Licensed under MIT license
            See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
 @version   3.0.2

 @private
*/
(function(){function Xe(){for(var S=window.document.getElementsByTagName("script"),ba=0,cb=S.length;ba<cb;ba++)if("data-lightstreamer-ns"in S[ba].attributes)return S[ba].attributes["data-lightstreamer-ns"].value;return null}function Ye(S,ba){if(!S)return ba;S=S.split(".");ba=ba||window;for(var cb=0;cb<S.length;cb++){var J=S[cb],lb=ba[J];lb&&"object"==typeof lb||(lb=ba[J]={});ba=lb}return ba}var H=function(){function S(){}function ba(a){this.et=a||{}}function cb(a){this.ta=a}function J(a){this.c=a;
this.state=0}function lb(a){this.c=a;this.W=new qc;this.ma=new Ua}function Gd(a){this.c=a;this.W=new Ua;this.ma=new Ua}function Hd(){this.v=new qc}function Id(a){this.c=a;this.W=new Jd;this.ma=new Ua;this.se=new Kd(a)}function Kd(a){this.c=a;this.state=rc;this.Tf=new Ld}function Md(a){this.f=a;this.m=null}function Jd(){this.W=new qc}function Nd(a){this.c=a}function Od(a){this.c=a}function Pd(a){this.c=a;this.tf=new Qd}function sc(a,b,c,d){this._callSuperConstructor(sc,[a,d,c]);this.f=b}function Wc(a,
b){this._callSuperConstructor(Wc);this.subscriptionId=b.vd();this.ba("LS_op","deactivate");this.ba("PN_deviceId",a);this.ba("PN_subscriptionId",this.subscriptionId)}function Wb(a,b,c,d){this._callSuperConstructor(Wb,[a,d,c]);this.filter=b}function Xc(a,b){this._callSuperConstructor(Xc);this.ba("LS_op","deactivate");this.ba("PN_deviceId",a);"ALL"!=b&&this.ba("PN_subscriptionStatus",b)}function tc(a,b,c,d,e){this._callSuperConstructor(tc,[a,e,d]);this.TA=b;this.f=c}function Yc(a,b,c){this._callSuperConstructor(Yc);
this.subscriptionId=a;this.ba("LS_subId",a);this.ba("LS_op","activate");this.ba("LS_group",c.items);this.ba("LS_schema",c.lb);this.ba("LS_mode",c.Zf());this.ba("PN_deviceId",b);null!=c.rj()&&this.ba("LS_data_adapter",c.rj());null!=c.vd()&&this.ba("PN_subscriptionId",c.vd());null!=c.Nl()&&this.ba("PN_notificationFormat",c.Nl());null!=c.Gp()&&this.ba("PN_trigger",c.Gp());c.Wt&&this.ba("PN_coalescing","true");null!=c.yj()&&this.ba("LS_requested_buffer_size",c.yj());null!=c.zj()&&this.ba("LS_requested_max_frequency",
c.zj())}function Zc(a){this._callSuperConstructor(Zc);this.ba("LS_op","register");this.ba("PN_type",a.platform);this.ba("PN_appId",a.appId);null==a.Fm?this.ba("PN_deviceToken",a.Io):(this.ba("PN_deviceToken",a.Fm),this.ba("PN_newDeviceToken",a.Io))}function Xb(){this.query={};this.kk=G.le();this.ba("LS_reqId",this.kk)}function uc(a,b,c){this._callSuperConstructor(uc,[a,c,b])}function mb(a,b,c){this._callSuperConstructor(mb,[c.Fa.ol,a]);this.ix=!1;this.tf=b;this.c=c}function Qd(){this.ae=!1}function Rd(a){this.c=
a}function Sd(a){this.f=a}function Td(a,b){this.f=a;this.lB=b}function Ud(a){this.f=a;this.nq=new Eb(null)}function Vd(a){this.f=a}function Eb(a){this.frequency=a}function Fb(a){this._callSuperConstructor(Fb);this.name=a}function Gb(a){this._callSuperConstructor(Gb);this.list=a;for(var b={},c=0;c<a.length;c++)b[a[c]]=c+1;this.mx=b;this.xc=a.length}function $c(){this.gd=null;this.xc=0}function va(a,b,c,d,e){this.bE=b;this.aE=a;this.kz=d;this.Ra=c;this.Fg=e}function db(a,b,c){this.Zh=a;this.Mv=b;this.Lm=
c}function nb(a,b){this._callSuperConstructor(nb,[a]);this.tu="remote";this.Op(b,p.Qk);this.yJ(b)}function Va(a,b){this.T=a;this.J=b;this.xa=this.id=null;this.Ga=Ze}function Yb(a){this._callSuperConstructor(Yb);this.Ga=a;this.dn=null}function Wd(a,b,c,d,e,f,h){this.Ja=new Zb(a);this.Ja.mi(this,!0);this.Kc=new aa(c);this.Kc.mi(this,!0);this.rc=new v(b);this.rc.mi(this,!0);this.eq=null;this.aa=new Pa(this,this.Ja,this.Kc,this.rc);if(d&&d.Yl())this.Id=d.rA(this,x.Ta(this.ca,this),f),a=this.Id.Jl(),null!=
a&&(this.co=d.qA(this,a),this.co.addListener(this.aa)),this.id=this.Id.Ma();else{this.Id=null;do this.id="NS"+Xd++;while(W.Rl(this.id,"lsEngine"))}W.Da(this.id,"lsEngine",this);this.o=new vc(this,this.aa,h);this.At(e,p.Ls);this.Ja.Zi&&this.qu()}function vc(a,b,c){this.va=$e++;ha.h()&&ha.a(k.resolve(785),this.va);this.status=1;this.Z=0;this.po=this.j=null;this.ge="";this.$a=a;this.Ia=b;this.l=a.rc;this.tb=a.Kc;this.vb=a.Xf();this.Dc=new Yd(this.l,this.vb);this.ZF=new wc(this.vb,b);V.Xg(this);this.YA();
this.hj=null;this.$=new Zd(this,a.rc,this.vb,!1);this.ff=new $d(this.$,this.Ia,this.l);this.c=c;this.qq=0}function ae(a){this.lh=[];this.ov=!1;this.lsc={};this.lsc.LS_window=W["_"+a];this.Hc=this.lsc.window=this.lsc.LS_window;this.Ks=this.Hc.LS_u;this.Kg=this.Hc.LS_w;this.Ai=this.Hc.LS_e;this.Gy=this.Hc.LS_svrname;this.Ey=this.Hc.LS_n;this.Js=this.Hc.LS_s;this.Fy=this.Hc.LS_o;this.Bi=this.Hc.LS_l;this.Dy=this.Hc.LS_MPNREG;this.Cy=this.Hc.LS_MPNOK;this.By=this.Hc.LS_MPNDEL;this.zA=this.BB(this.lsc);
this.Vv=!1;this.Xn=[]}function be(a){this.Nh=a;this.lb=a.split(",")}function $d(a,b,c){this.active=!1;this.mm=0;this.gf={};this.Eg={};this.by=0;this.$=a;this.Ia=b;this.dh=c}function Hb(a,b,c,d,e,f,h){this._callSuperConstructor(Hb,[b]);this.xr=d;this.ne=e;this.Qm=f;this.b=c;this.Qd=a;this.EJ=h}function ce(){this.b=this.request=this.be=this.ib=null}function Zd(a,b,c,d){this.mq=this.Kp=this.rl=this.jm=this.Do=this.lq=this.sb=this.qd=null;this.lk=this.Xe=this.Oc=0;this.b=this.status=this.Z=1;this.Kk=
0;this.N=null;this.hB=!1;this.Qd=a;this.l=b;this.sa=null;this.kr={};this.ei(d);this.Rd()}function Yd(a){this.Km=0;this.Bb=null;this.Fj=!1;this.l=a;this.j=null}function wa(a,b,c,d,e,f,h){this._callSuperConstructor(wa,arguments);this.sa=null;this.jd=1;this.Yh=null;this.nh=!1}function Ja(a,b,c,d,e,f,h){this._callSuperConstructor(Ja,arguments);this.Tg=this.om=this.qd=this.Xa=this.gu=null;this.ei(f)}function de(){this.pm=!1}function oa(a,b,c){this.jq=a;this.Qz=b;this.Bt=c;this.Em=-1}function Qa(){this._callSuperConstructor(Qa);
this.Ac=null;this.La=Qa}function Ka(){this._callSuperConstructor(Ka);this.error=this.response=this.od=this.sender=this.Y=null;this.K=!1;this.b=0;this.LS_x=this.ZE;this.ke=null;this.La=Ka}function $b(a){this.path=a;this.Mi=I.Gd();this.status=L.ua()&&(window.ActiveXObject||"undefined"!=typeof XMLHttpRequest)?2:-1;this.fl=++af;this.Mb="LS_AJAXFRAME_"+this.fl;this.Rp();this.Mz()}function eb(a){this._callSuperConstructor(eb);this.target=G.nr(a);this.Vd=0;this.K=!1;this.Hl=null;Wa.Ve(this.target,!0);this.La=
eb}function ob(a){this._callSuperConstructor(ob);a&&(this.target=G.nr(a),Wa.Ve(a,!0));this.K=!1;this.La=ob;this.hm=0}function xc(){}function ad(){}function pb(){this._callSuperConstructor(pb)}function Ca(){this._callSuperConstructor(Ca);this.K=!1;this.fb=this.Ac=this.Y=null;this.Gm=0;this.La=Ca}function yc(){this.Pw=0}function U(a,b,c,d,e,f,h,g){this.va=bf++;M.h()&&M.a(k.resolve(575),"oid="+this.va);this.$n=x.Ta(this.GF,this);this.Zn=x.Ta(this.Kq,this);this.Yn=x.Ta(this.Jq,this);this.ja=a;this.Tc=
b;this.Pc=0;this.b=1;this.ab=0;this.bb=100*I.Gd(100);this.m=c;this.U=d;this.Dc=c.Dc;this.l=c.l;this.tb=c.tb;this.wb=null;this.$=c.$;this.vb=c.Xf();this.Ov=this.xi=this.wk=0;this.wg=this.ef=this.cq=null;this.reset();this.uk=this.am=this.df=!1;e?(this.Yg=e.Yg,this.Pc=e.Pc,M.a(k.resolve(576),this.Pc),this.sessionId=e.sessionId,this.hf=e.hf,this.bb=e.bb,this.wk=e.wk,this.yr=e.yr,this.Lp=e.Lp,this.ic=new bd(h,e.ic)):(Y.assert(!h,"Recovery unexpected"),this.ic=new bd);this.c=g;if(L.Rb()){var l=this;this.Oq=
function(){0>=l.ic.en(l.l.li)&&l.kb("recovery.timeout.elapsed",!0,!1);l.Oa("online.again",0)};try{window.addEventListener("online",this.Oq,!1)}catch(n){}}}function bd(){0==arguments.length?this.tA():(Y.assert(2==arguments.length,"Recovery error (1)"),this.uA(arguments[0],arguments[1]));Y.assert(this.tD(),"Recovery error (2)")}function zc(a,b,c,d){this._callSuperConstructor(zc,[d]);this.Zy=a;this.oz=c;this.j=b}function Ib(a){this.JJ=a}function Pa(a,b,c,d){this.J=a;this.xo=b;this.BA=c;this.options=
d;this.jc=0;this.Cc=!1;this.aa={};this.Oe=0;this.v={};this.af={};this.cA=x.Wg(this.Tt,5E3,this);V.Fn(this);V.Xg(this)}function Ac(a,b,c,d,e,f,h){this._callSuperConstructor(Ac,[a,h]);this.Kd=b;this.Hw=c;this.$a=d;this.Uz=e;this.ij=f}function ac(a,b,c,d,e){this._callSuperConstructor(ac,[a,e]);this.Kd=b;this.$a=c;this.ij=d}function Bc(a,b,c,d,e){this._callSuperConstructor(Bc,[a,e]);this.Kd=b;this.$a=c;this.ij=d}function qb(a,b){this.ou=!1;this.dh=a;this.rf=this.eC?this.dh.El:b?2*b:4E3}function wc(a){this.ZA(a)}
function ee(a){this.AE=0;this.mc={};this.Dg={};this.EB=1;this.hc={};this.Fd={};this.Zb=null;this.l=a;this.b=0}function fe(a){this.Gh=-1;this.bk={};this.Cm={};this.ck={};this.Bm=0;this.ga=a;this.fk=new Jb}function ma(){for(var a in{gb:!0})this.An=a;this.La=ma}function Xa(){}function cd(){}function xa(a,b,c,d,e,f){this.fI(a);this.yg(b);this.setData(c);this.Vm(d);this.xk(e);this.yk(f)}function rb(a){this.client=a;this.Cc=!1;this.jc=-1;this.vb=null;this.tu="local"}function aa(){this.tk=ge;this.sessionId=
this.zx=this.yx=this.password=this.hn=this.el=null;this.wi=dd;this._callSuperConstructor(aa,arguments);this.La="ConnectionDetails"}function v(){this.Co=4E6;this.Ul=19E3;this.Eh=0;this.we=-1;this.rg=0;this.ef=3E3;this.$m=2E3;this.gi=4E3;this.Qp(this.gi);this.Pp(this.gi);this.Bl=100;this.Nr=!1;this.Gl=null;this.eu=this.zr=!1;this.hi=0;this.Qo=!1;this.Or=5E3;this.Ej=this.Zm=null;this.Tl=!1;this.li=15E3;this.pl=this.vs=!0;this.El=2E3;this.Zr=4E3;this.ik={};this.wi=ed;this._callSuperConstructor(v,arguments);
this.La="ConnectionOptions"}function he(a){this.Pp(a)}function ie(a){this.Qp(a)}function Zb(a){this.Zi=!1;this.Oe=0;this.bw=cf;this.wi=fd;this._callSuperConstructor(Zb,arguments);this.La="Configuration"}function bc(a){this.La="Bean";this.parent=null;this.Ct=!1;a&&this.pA(a)}function sa(a,b,c){this.ss=a;this.In=b;this.jx=c||!1}function F(a,b,c,d,e){this.request=a;this.QG=b;this.Uw=d;this.bl=c;this.tg=e}function df(){return!1}function ef(){return!0}function ff(a,b){var c=b?a:[];c.Yd=[];b||(c[0]=parseInt(a[0]),
c[1]=parseInt(a[1]));for(var d=2,e=a.length;d<e;d++)a[d]?-1==a[d].length?c[d]=p.Fi:(b||(c[d]=a[d].toString()),c.Yd.push(d-1)):(b||(c[d]=""===a[d]?"":null),c.Yd.push(d-1));return c}function gf(a,b,c){this.Tq=this.xx=this.Uq=!1;this.ak=0;this.Dm=!1;this.wA=c;this.xz=b;this.bf=a}function ja(a){this._callSuperConstructor(ja);this.va=hf++;ka.h()&&ka.a(k.resolve(557),this.va);this.K=!1;this.Hb=this.zm=this.Db=this.wl=null;this.Cd=this.Xh=!1;this.vk=null;this.Pq=!1;this.ju=null;this.kn=a;this.La=ja;this.KJ=
new Ib(this)}function jf(a){a=0==a.indexOf("http://")?a.replace("http://","ws://"):a.replace("https://","wss://");if(Cc){var b="";(void 0).forEach(function(d){""!==b&&(b+="; ");b+=d.name+"="+d.value});var c={};0<b.length&&(c.headers={Cookie:b});return new Cc(a,gd,c)}if("undefined"!=typeof WebSocket)return new WebSocket(a,gd);if("undefined"!=typeof MozWebSocket)return new MozWebSocket(a,gd);ja.gj();return null}function kf(a){var b="{",c;for(c in a)b+=c+"="+a[c]+" ";return b+"}"}function Fa(){this._callSuperConstructor(Fa);
this.va=lf++;za.h()&&za.a(k.resolve(628),this.va);this.K=!1;this.Ac=this.wa=this.od=this.Y=null;this.Sr=!1;this.La=Fa}function mf(a){return function(){x.ha(a)}}function Dc(a){return function(){x.ha(a)}}function cc(){return!1}function je(a){a&&a!=hd||(hd++,Ec=1)}function fb(a){this.Ua=[];this.keys={};this.Lf=a;this.qE=0}function id(a,b){a=parseInt(a,10);if(isNaN(a))throw Error(b);return a}function La(a){switch(a){case 1:return"No session";case 2:return"WS Streaming";case 3:return"prepare WS Streaming";
case 4:return"WS Polling";case 5:return"prepare WS Polling";case 6:return"HTTP Streaming";case 7:return"prepare HTTP Streaming";case 8:return"HTTP Polling";case 9:return"prepare HTTP Polling";case 10:return"Shutting down"}}function ke(a){var b="{",c;for(c in a)b+=c+"="+a[c]+" ";return b+"}"}function Kb(a,b){this.J=a;this.id=b}function le(a,b,c){this.id=a;this.T=b;this.status=c}function sb(){this._callSuperConstructor(sb);this.fd=this.xf=null}function dc(){this._callSuperConstructor(dc);this.Pf={};
this.fd=null;this.XF=1}function Ra(a,b,c){this.receiver=a;this.target=c;this.id=nf++;this.buffer=[];this.ready=!1;this.cf={};this.BE=0;b&&this.AH(b)}function Lb(a,b){this.Op(a,b)}function tb(a,b,c){this._callSuperConstructor(tb,[a,c]);this.Op(b,c)}function gb(a,b){this._callSuperConstructor(gb);this.xa=b;this.J=a;this.xa.addListener(this)}function me(a){this.Mb=a}function ne(a,b){var c=Va.bv();c.no(b,a);c.jk(b,a)}function Ya(a,b,c,d,e,f,h){this.T=b;this.fE=e;this.Wq=c;this.Jw=d;this.nf=f;this.vj=
0;this.Vi={};this.vg=0;this.client=a;this.lr=!1;this.Ni=h||p.ry;this.qm=this.ok=null;this.rm=!1}function of(a){return{enableSharing:function(b,c,d,e,f){c==d&&"ABORT"==c?a.Ro(null):a.Ro(new oe(b,c,d,e,f))},isMaster:function(){return a.Kj()}}}function Ua(){this.Sb=[]}function qc(){this.map={}}function Ld(){this.set={};this.size=0}function Fc(a){this.name=a}function pe(a){null!=a&&(a=a.toUpperCase());null==a?a="ALL":"SUBSCRIBED"==a&&(a="ACTIVE");this.filter=a}function qe(a){this.Fa=a;this.O=new J(this);
this.Eb=new Pd(this);this.H=new Rd(this);this.Ho=new Od(this);this.Vr=new Nd(this);this.Fb=new Id(this);this.v=new Hd;this.vf=new lb(this);this.ti=new Gd(this)}"undefined"==typeof Promise&&function(){function a(w,A){Mb[Za]=w;Mb[Za+1]=A;Za+=2;2===Za&&(Ha?Ha(h):pf())}function b(w){return"function"===typeof w}function c(){return function(){process.nextTick(h)}}function d(){var w=0,A=new ub(h),P=document.createTextNode("");A.observe(P,{characterData:!0});return function(){P.data=w=++w%2}}function e(){var w=
new MessageChannel;w.port1.onmessage=h;return function(){w.port2.postMessage(0)}}function f(){return function(){setTimeout(h,1)}}function h(){for(var w=0;w<Za;w+=2)(0,Mb[w])(Mb[w+1]),Mb[w]=void 0,Mb[w+1]=void 0;Za=0}function g(){}function l(w,A,P,R){try{w.call(A,P,R)}catch(ea){return ea}}function n(w,A,P){a(function(R){var ea=!1,ca=l(P,A,function(ya){ea||(ea=!0,A!==ya?u(R,ya):t(R,ya))},function(ya){ea||(ea=!0,y(R,ya))},"Settle: "+(R.WJ||" unknown promise"));!ea&&ca&&(ea=!0,y(R,ca))},w)}function r(w,
A){1===A.rb?t(w,A.Jb):2===A.rb?y(w,A.Jb):z(A,void 0,function(P){u(w,P)},function(P){y(w,P)})}function u(w,A){if(w===A)y(w,new TypeError("You cannot resolve a promise with itself"));else if("function"===typeof A||"object"===typeof A&&null!==A)if(A.constructor===w.constructor)r(w,A);else{try{var P=A.then}catch(R){Gc.error=R,P=Gc}P===Gc?y(w,Gc.error):void 0===P?t(w,A):b(P)?n(w,A,P):t(w,A)}else t(w,A)}function E(w){w.Cn&&w.Cn(w.Jb);m(w)}function t(w,A){void 0===w.rb&&(w.Jb=A,w.rb=1,0!==w.al.length&&a(m,
w))}function y(w,A){void 0===w.rb&&(w.rb=2,w.Jb=A,a(E,w))}function z(w,A,P,R){var ea=w.al,ca=ea.length;w.Cn=null;ea[ca]=A;ea[ca+1]=P;ea[ca+2]=R;0===ca&&w.rb&&a(m,w)}function m(w){var A=w.al,P=w.rb;if(0!==A.length){for(var R,ea,ca=w.Jb,ya=0;ya<A.length;ya+=3)R=A[ya],ea=A[ya+P],R?B(P,R,ea,ca):ea(ca);w.al.length=0}}function q(){this.error=null}function B(w,A,P,R){var ea=b(P);if(ea){try{var ca=P(R)}catch(qf){jd.error=qf,ca=jd}if(ca===jd){var ya=!0;var rf=ca.error;ca=null}else var re=!0;if(A===ca){y(A,
new TypeError("A promises callback cannot return that same promise."));return}}else ca=R,re=!0;void 0===A.rb&&(ea&&re?u(A,ca):ya?y(A,rf):1===w?t(A,ca):2===w&&y(A,ca))}function K(w,A){try{A(function(P){u(w,P)},function(P){y(w,P)})}catch(P){y(w,P)}}function Z(w,A){this.jz=w;this.ai=new w(g);this.qz(A)?(this.iz=A,this.Zk=this.length=A.length,this.ez(),0===this.length?t(this.ai,this.Jb):(this.length=this.length||0,this.dz(),0===this.Zk&&t(this.ai,this.Jb))):y(this.ai,this.rz())}function X(w){this.Hi=
sf++;this.Jb=this.rb=void 0;this.al=[];if(g!==w){if(!b(w))throw new TypeError("You must pass a resolver function as the first argument to the promise constructor");if(!(this instanceof X))throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.");K(this,w)}}var ec=Array.isArray?Array.isArray:function(w){return"[object Array]"===Object.prototype.toString.call(w)},Za=0,Ha,vb=("undefined"!==typeof window?window:void 0)||
{},ub=vb.MutationObserver||vb.WebKitMutationObserver;vb="undefined"!==typeof process&&"[object process]"==={}.toString.call(process);var tf="undefined"!==typeof Uint8ClampedArray&&"undefined"!==typeof importScripts&&"undefined"!==typeof MessageChannel,Mb=Array(1E3);var pf=vb?c():ub?d():tf?e():f();var Gc=new q,jd=new q;Z.prototype.qz=function(w){return ec(w)};Z.prototype.rz=function(){return Error("Array Methods must be provided an Array")};Z.prototype.ez=function(){this.Jb=Array(this.length)};Z.prototype.dz=
function(){for(var w=this.length,A=this.ai,P=this.iz,R=0;void 0===A.rb&&R<w;R++)this.cz(P[R],R)};Z.prototype.cz=function(w,A){var P=this.jz;"object"===typeof w&&null!==w?w.constructor===P&&void 0!==w.rb?(w.Cn=null,this.Dn(w.rb,A,w.Jb)):this.sz(P.resolve(w),A):(this.Zk--,this.Jb[A]=w)};Z.prototype.Dn=function(w,A,P){var R=this.ai;void 0===R.rb&&(this.Zk--,2===w?y(R,P):this.Jb[A]=P);0===this.Zk&&t(R,this.Jb)};Z.prototype.sz=function(w,A){var P=this;z(w,void 0,function(R){P.Dn(1,A,R)},function(R){P.Dn(2,
A,R)})};var sf=0;X.all=function(w){return(new Z(this,w)).ai};X.race=function(w){function A(ya){u(R,ya)}function P(ya){y(R,ya)}var R=new this(g);if(!ec(w))return y(R,new TypeError("You must pass an array to race.")),R;for(var ea=w.length,ca=0;void 0===R.rb&&ca<ea;ca++)z(this.resolve(w[ca]),void 0,A,P);return R};X.resolve=function(w){if(w&&"object"===typeof w&&w.constructor===this)return w;var A=new this(g);u(A,w);return A};X.reject=function(w){var A=new this(g);y(A,w);return A};X.YJ=function(w){Ha=
w};X.XJ=function(w){a=w};X.UJ=a;X.prototype={constructor:X,then:function(w,A){var P=this.rb;if(1===P&&!w||2===P&&!A)return this;var R=new this.constructor(g),ea=this.Jb;if(P){var ca=arguments[P-1];a(function(){B(P,R,ca,ea)})}else z(this,R,w,A);return R},"catch":function(w){return this.then(null,w)}};(function(){if("undefined"!==typeof global)var w=global;else if("undefined"!==typeof self)w=self;else try{w=Function("return this")()}catch(P){throw Error("polyfill failed because global object is unavailable in this environment");
}var A=w.Promise;if(!A||"[object Promise]"!==Object.prototype.toString.call(A.resolve())||A.dK)X.all=X.all,X.race=X.race,X.reject=X.reject,X.resolve=X.resolve,X.prototype.constructor=X.prototype.constructor,X.prototype.then=X.prototype.then,w.Promise=X})()}.call(window);var O=function(){function a(b){this.name="IllegalStateException";this.message=b}a.prototype={toString:function(){return["[",this.name,this.message,"]"].join("|")}};return a}(),L=function(){var a="undefined"!==typeof window&&"undefined"!==
typeof navigator&&"undefined"!==typeof document,b="undefined"!==typeof importScripts,c="object"==typeof process&&(/node(\.exe)?$/.test(process.execPath)||process.node&&process.v8||process.versions&&process.versions.node&&process.versions.v8);if(a&&!document.getElementById)throw new O("Not supported browser");var d={ua:function(){return a},Rb:function(){return!c&&(a||b)},cg:function(){return!a&&c},cm:function(){return!a&&!c&&b},KD:function(){return!a&&!c&&!b},Mc:function(){if(!this.ua())throw new O("Trying to load a browser-only module on non-browser environment");
}};d.isBrowserDocument=d.ua;d.isBrowser=d.Rb;d.isNodeJS=d.cg;d.isWebWorker=d.cm;d.browserDocumentOrDie=d.Mc;return d}(),I=function(){var a=/^\s*([\s\S]*?)\s*$/,b=/,/g,c=/\./g,d={Na:function(){return(new Date).getTime()},Gd:function(e){return Math.round(Math.random()*(e||1E3))},trim:function(e){return e.replace(a,"$1")},zp:function(e,f){if(e){if(!e.replace)return e;f?(e=e.replace(c,""),e=e.replace(b,".")):e=e.replace(b,"");return new Number(e)}return 0},isArray:function(e){return e&&e.join&&"function"==
typeof e.join},Kb:function(e,f,h){if(!L.ua())return!1;"undefined"!=typeof e.addEventListener?e.addEventListener(f,h,!1):"undefined"!=typeof e.attachEvent&&e.attachEvent("on"+f,h);return!0},Yw:function(e,f,h){if(!L.ua())return!1;"undefined"!=typeof e.removeEventListener?e.removeEventListener(f,h,!1):"undefined"!=typeof e.detachEvent&&e.detachEvent("on"+f,h);return!0}};d.getTimeStamp=d.Na;d.randomG=d.Gd;d.trim=d.trim;d.getNumber=d.zp;d.isArray=d.isArray;d.addEvent=d.Kb;d.removeEvent=d.Yw;return d}(),
p=function(){return{dD:!1,Ng:1E3,Ts:200,Sy:1E4,vy:1,Uk:0,OJ:2,As:3,Ss:4,zs:5,ld:"N",ry:200,Ls:"MAIN",Vk:"wbridge",Ok:"fbridge",Ny:1,My:2,Hg:"1803",Is:"8.0.4",wy:"javascript",xy:"javascript_client",Ay:"pcYgxn8m8%20feOojyA1U661j3g2.pz47Af9o",Ci:!L.ua()||"http:"!=document.location.protocol&&"https:"!=document.location.protocol?"file:":document.location.protocol,Jc:"lightstreamer.stream",Mg:"lightstreamer.protocol",md:"lightstreamer.session",tn:"lightstreamer.requests",Ws:"lightstreamer.subscriptions",
Iy:"lightstreamer.messages",on:"lightstreamer.actions",Ic:"lightstreamer.sharing",NJ:"lightstreamer.crosstab",RJ:"lightstreamer.stats",Va:"lightstreamer.mpn",Cf:"Lightstreamer_",rn:"lightstreamer",pc:"UNORDERED_MESSAGES",Fi:{length:-1,toString:function(){return"[UNCHANGED]"}},CONNECTING:"CONNECTING",Cs:"CONNECTED:",Us:"STREAM-SENSING",Zs:"WS-STREAMING",Pk:"HTTP-STREAMING",Ry:"STALLED",Wk:"WS-POLLING",Af:"HTTP-POLLING",Jg:"DISCONNECTED",vn:"DISCONNECTED:WILL-RETRY",Ys:"DISCONNECTED:TRYING-RECOVERY",
wn:"WS",zi:"HTTP",Oy:"RAW",Es:"DISTINCT",yi:"COMMAND",Ns:"MERGE",Qk:"MASTER",Xs:"TLCP-2.1.0"}}(),ia=function(){function a(n){var r=f;return function(){null===r&&(r=-1<h.indexOf(n));return r}}function b(n){var r=f;return function(){if(null===r){r=!0;for(var u=0;u<n.length;u++)r=r&&n[u]()}return r}}function c(n,r){var u=f,E=f;return function(t,y){null===u&&(E=(u=n())?r():null);return u?t&&E?!0===y?E<=t:!1===y?E>=t:E==t:!0:!1}}function d(n){var r=f;return function(){if(null===r){var u=n.exec(h);if(u&&
2<=u.length)return u[1]}return null}}function e(n){return function(){return!n()}}var f=L.Rb()?null:!1,h=L.Rb()?navigator.userAgent.toLowerCase():null,g=f,l={Gv:a("rekonq"),Tp:a("webkit"),Fv:a("playstation 3"),$l:c(a("chrome/"),d(/chrome\/([0-9]+)/g)),Bv:function(){null===g&&(g=document.childNodes&&!document.all&&!navigator.taintEnabled&&!navigator.ZJ);return g},OD:c(a("konqueror"),d(/konqueror\/([0-9.]+)/g)),ie:function(n,r){return c(a("msie"),d(/msie\s([0-9]+)[.;]/g))(n,r)||c(a("rv:11.0"),function(){return"11"})(n,
r)?!0:!1},Dv:a("edge"),Ev:c(a("firefox"),d(/firefox\/(\d+\.?\d*)/)),Ze:c(function(){return"undefined"!=typeof opera},function(){if(opera.version){var n=opera.version();n=n.replace(/[^0-9.]+/g,"");return parseInt(n)}return 7})};l.Zl=b([a("android"),l.Tp,e(l.$l)]);l.PD=b([l.Ze,a("opera mobi")]);l.Cv=c(b([a("safari"),function(n){var r=f;return function(){if(null===r){r=!1;for(var u=0;u<n.length;u++)r=r||n[u]()}return r}}([a("ipad"),a("iphone"),a("ipod"),b([e(l.Zl),e(l.$l),e(l.Gv)])])]),d(/version\/(\d+\.?\d*)/));
l.isProbablyRekonq=l.Gv;l.isProbablyChrome=l.$l;l.isProbablyAWebkit=l.Tp;l.isProbablyPlaystation=l.Fv;l.isProbablyAndroidBrowser=l.Zl;l.isProbablyOperaMobile=l.PD;l.isProbablyApple=l.Cv;l.isProbablyAKhtml=l.Bv;l.isProbablyKonqueror=l.OD;l.isProbablyIE=l.ie;l.isProbablyEdge=l.Dv;l.isProbablyFX=l.Ev;l.isProbablyOldOpera=l.Ze;return l}(),Jb=function(){function a(){this.data=[]}a.prototype={add:function(b){this.data.push(b)},remove:function(b){b=this.find(b);if(0>b)return!1;this.data.splice(b,1);return!0},
contains:function(b){return 0<=this.find(b)},find:function(b){for(var c=0;c<this.data.length;c++)if(this.data[c]===b)return c;return-1},forEach:function(b){for(var c=0;c<this.data.length;c++)b(this.data[c])},Ln:function(){return[].concat(this.data)},w:function(){this.data=[]}};a.prototype.add=a.prototype.add;a.prototype.remove=a.prototype.remove;a.prototype.forEach=a.prototype.forEach;a.prototype.asArray=a.prototype.Ln;a.prototype.clean=a.prototype.w;return a}(),V=function(){function a(u,E,t,y,z){return function(){u[E]||
(u[t]=!0,y.forEach(function(m){try{if(m[z])m[z]();else m()}catch(q){}}),"preunloading"!=E&&y.w(),u[E]=!0,u[t]=!1)}}function b(u,E){setTimeout(function(){if(u[E])u[E]();else u()},0)}function c(u,E,t,y){setTimeout(function(){t?y?u.apply(t,y):u.apply(t):y?u.apply(null,y):u()},E)}function d(){g=!0}var e=new Jb,f=new Jb,h=new Jb,g=!1,l={Zj:"onloadDone",Ew:"onloadInprogress",Lk:"unloaded",ks:"unloading",Ow:"preunloading"},n={},r;for(r in l)n[l[r]]=r;l={Zj:!1,Ew:!1,Lk:!1,ks:!1,Ow:!1,zv:function(){return this.Zj},
Za:function(){return this.Lk},$p:function(){return this.ks},qt:function(u){this.MD()?f.add(u):b(u,"onloadEvent")},Xg:function(u){this.ND()?e.add(u):b(u,"unloadEvent")},Fn:function(u){h.add(u);this.Ow&&b(u,"preUnloadEvent")},WG:function(u){f.remove(u)},Mm:function(u){e.remove(u)},fr:function(u){h.remove(u)},MD:function(){return!(this.Zj||this.Ew)},ND:function(){return!(this.Lk||this.ks)},Nz:function(){I.Kb(window,"unload",this.hA);I.Kb(window,"beforeunload",this.Pz);if(document&&"undefined"!=typeof document.readyState){if("COMPLETE"==
document.readyState.toUpperCase()){this.hl();return}c(this.cu,1E3,this)}else if(this.xv()){this.hl();return}if(!I.Kb(window,"load",this.Jm))this.hl();else if(ia.Ze()){var u=!1;ia.Ze(9,!1)&&(u=!0,I.Kb(document,"DOMContentLoaded",d));c(this.bu,1E3,this,[u])}},hl:function(){c(this.Jm,0)},cu:function(){this.Zj||("COMPLETE"==document.readyState.toUpperCase()?this.Jm():c(this.cu,1E3,this))},bu:function(u){this.Zj||(g||!u&&this.xv()?this.Jm():c(this.bu,1E3,this,[u]))},xv:function(){return"undefined"!=typeof document.getElementsByTagName&&
"undefined"!=typeof document.getElementById&&(null!=document.getElementsByTagName("body")[0]||null!=document.body)}};l.Jm=a(l,n.onloadDone,n.onloadInprogress,f,"onloadEvent");l.hA=a(l,n.unloaded,n.unloading,e,"unloadEvent");l.Pz=a(l,n.preunloading,n.preunloading,h,"preUnloadEvent");L.ua()?l.Nz():l.hl();l.addOnloadHandler=l.qt;l.addUnloadHandler=l.Xg;l.addBeforeUnloadHandler=l.Fn;l.removeOnloadHandler=l.WG;l.removeUnloadHandler=l.Mm;l.removeBeforeUnloadHandler=l.fr;l.isLoaded=l.zv;l.isUnloaded=l.Za;
l.isUnloading=l.$p;return l}(),W={py:V,toString:function(){return"[Lightstreamer "+this.library+" client version "+this.version+" build "+this.build+"]"},Da:function(a,b,c,d){a=(d||"_")+a;this[a]||(this[a]={});this[a][b]=c;return"Lightstreamer."+a+"."+b},Rl:function(a,b,c){a=(c||"_")+a;return this[a]&&this[a][b]},Vu:function(a,b,c){a=(c||"_")+a;return this[a]?this[a][b]:null},mo:function(a,b,c){a=(c||"_")+a;if(this[a]&&this[a][b]){delete this[a][b];for(var d in this[a])return;delete this[a]}},aA:function(a,
b){a=(b||"_")+a;this[a]&&delete this[a]},im:{},Dz:function(a,b){var c=this.im;c[a]||(c[a]=[]);c[a].push(b)},ZG:function(a,b){var c=this.im[a];if(c){for(var d=0;d<c.length;d++)c[d]==b&&c.splice(d,1);0==c.length&&delete c[a]}},MC:function(a){return this.im[a]&&(a=this.im[a])&&0<a.length?a[0]:null}};L.ua()&&(window.OpenAjax&&window.OpenAjax.hub&&window.OpenAjax.hub.registerLibrary("Lightstreamer","http://www.lightstreamer.com/",W.version),window.Lightstreamer=W);W.library=p.wy;W.version=p.Is;W.build=
p.Hg;var x=function(){function a(){}function b(m,q){return m.time===q.time?m.Rq-q.Rq:m.time-q.time}function c(){y=!1;e()}function d(){if(r)clearInterval(r);else if(L.ua()&&"undefined"!=typeof postMessage){t=function(){try{window.postMessage("Lightstreamer.run",E)}catch(q){try{window.postMessage("Lightstreamer.run",E)}catch(B){}}};var m=function(q){("Lightstreamer.run"==q.data&&"*"==E||q.origin==E)&&c()};I.Kb(window,"message",m);y||(y=!0,t());0==y&&(I.Yw(window,"message",m),t=a)}else L.cg()&&"undefined"!=
typeof process&&process.nextTick&&(t=function(){process.nextTick(c)});r=setInterval(e,50)}function e(){if(V.Lk)clearInterval(r);else{var m=g;g=I.Na();g<m&&(g=m);if(0<h.length)for(f&&(h.sort(b),f=!1);0<h.length&&h[0].time<=g&&!V.Lk;)m=h.shift(),m.oh&&(z.ha(m),m.step&&n.push(m));for(0>=h.length&&(u=0);0<n.length;)m=n.shift(),m.step&&(m.Rq=u++,z.Vg(m,m.step,!0));g>=l&&(l=g+108E5,h=[].concat(h))}}var f=!1,h=[],g=I.Na(),l=g+108E5,n=[],r=null,u=0,E=!L.ua()||"http:"!=document.location.protocol&&"https:"!=
document.location.protocol?"*":document.location.protocol+"//"+document.location.hostname+(document.location.port?":"+document.location.port:""),t=a,y=!1,z={toString:function(){return["[","Executor",50,h.length,"]"].join("|")},yC:function(){return h.length},Ta:function(m,q,B){return{oh:m,context:q||null,Dd:B||null,Rq:u++}},Vg:function(m,q,B){m.step=B?q:null;m.time=g+parseInt(q);if(isNaN(m.time))try{throw Error();}catch(K){throw m="Executor error for time: "+q,K.stack&&(m+=" "+K.stack),m;}h.push(m);
f=!0},Wg:function(m,q,B,K){return this.u(m,q,B,K,!0)},pf:function(m){m&&(m.oh=null,m.step=null)},u:function(m,q,B,K,Z){m=this.Ta(m,B,K);this.Vg(m,q,Z);0!=q||y||(y=!0,t());return m},Xv:function(m,q,B){m.Dd[q]=B},Wv:function(m,q){m.Dd=q},vA:function(m,q){m.time+=q;f=!0},ha:function(m,q){try{var B=q||m.Dd;m.context?B?m.oh.apply(m.context,B):m.oh.apply(m.context):B?m.oh.apply(null,B):m.oh()}catch(K){}}};L.cm()?setTimeout(d,1):d();z.getQueueLength=z.yC;z.packTask=z.Ta;z.addPackedTimedTask=z.Vg;z.addRepetitiveTask=
z.Wg;z.stopRepetitiveTask=z.pf;z.addTimedTask=z.u;z.modifyTaskParam=z.Xv;z.modifyAllTaskParams=z.Wv;z.delayTask=z.vA;z.executeTask=z.ha;return z}(),se=function(){function a(d){this.Jr(d)}function b(){return!1}var c={error:b,warn:b,info:b,debug:b,fatal:b,isDebugEnabled:b,isInfoEnabled:b,isWarnEnabled:b,isErrorEnabled:b,isFatalEnabled:b};a.prototype={Jr:function(d){this.Ib=d||c},gE:function(d){this.DD()&&(d+=this.dg(arguments,1),this.fatal(d))},fatal:function(d,e){this.Ib.fatal(d,e)},DD:function(){return!this.Ib.Jj||
this.Ib.Jj()},g:function(d){this.wv()&&(d+=this.dg(arguments,1),this.error(d))},Nj:function(d,e){this.wv()&&(e+=this.dg(arguments,2),this.error(e,d))},error:function(d,e){this.Ib.error(d,e)},wv:function(){return!this.Ib.Ij||this.Ib.Ij()},Pa:function(d){this.Lv()&&(d+=this.dg(arguments,1),this.warn(d))},warn:function(d,e){this.Ib.warn(d,e)},Lv:function(){return!this.Ib.Lj||this.Ib.Lj()},i:function(d){this.yv()&&(d+=this.dg(arguments,1),this.info(d))},info:function(d,e){this.Ib.info(d,e)},yv:function(){return!this.Ib.Xl||
this.Ib.Xl()},a:function(d){this.h()&&(d+=this.dg(arguments,1),this.debug(d))},debug:function(d,e){this.Ib.debug(d,e)},h:function(){return!this.Ib.Wl||this.Ib.Wl()},dg:function(d,e){var f=" {";for(e=e?e:0;e<d.length;e++)try{var h=d[e];null===h?f+="NULL":0>h.length?f+="*":null!=h.charAt?f+=h:h.message?(f+=h.message,h.stack&&(f+="\n"+h.stack+"\n")):h[0]==h?f+=h:I.isArray(h)?(f+="(",f+=this.dg(h),f+=")"):f+=h;f+=" "}catch(g){f+="??? "}return f+"}"}};a.prototype.debug=a.prototype.debug;a.prototype.isDebugLogEnabled=
a.prototype.h;a.prototype.logDebug=a.prototype.a;a.prototype.info=a.prototype.info;a.prototype.isInfoLogEnabled=a.prototype.yv;a.prototype.logInfo=a.prototype.i;a.prototype.warn=a.prototype.warn;a.prototype.isWarnEnabled=a.prototype.Lj;a.prototype.logWarn=a.prototype.Pa;a.prototype.error=a.prototype.error;a.prototype.isErrorEnabled=a.prototype.Ij;a.prototype.logError=a.prototype.g;a.prototype.logErrorExc=a.prototype.Nj;a.prototype.fatal=a.prototype.fatal;a.prototype.isFatalEnabled=a.prototype.Jj;
a.prototype.logFatal=a.prototype.gE;return a}(),C=function(){function a(b){this.name="IllegalArgumentException";this.message=b}a.prototype={toString:function(){return["[",this.name,this.message,"]"].join("|")}};return a}(),k=function(){var a={},b=null,c={kf:function(d){if(d&&!d.uj)throw new C("The given object is not a LoggerProvider");b=d;for(var e in a)b?a[e].Jr(b.uj(e)):a[e].Jr(null)},s:function(d){a[d]||(a[d]=b?new se(b.uj(d)):new se);return a[d]},resolve:function(d){return d}};c.setLoggerProvider=
c.kf;c.getLoggerProxy=c.s;c.resolve=c.resolve;return c}(),G=function(){var a=/\./g,b=/-/g,c=1,d=1,e={Av:function(){return L.Rb()?!1===navigator.onLine:!1},It:function(){try{return"undefined"!=typeof localStorage&&null!==localStorage&&localStorage.getItem&&localStorage.setItem?(localStorage.setItem("__canUseLocalStorage_test__","true"),localStorage.removeItem("__canUseLocalStorage_test__"),!0):!1}catch(f){return!1}},Vf:function(){try{return document.domain}catch(f){return""}},Ip:function(){if(!L.ua())return!0;
try{return-1<document.location.host.indexOf("[")?!0:e.Vf()==document.location.hostname}catch(f){return!1}},rd:function(f){if("undefined"!=typeof f){if(!0===f||!1===f)return!0===f;if(null!=f){if("number"==typeof f||f instanceof Number)return Number(f);if(I.isArray(f)){for(var h=[],g=0;g<f.length;g++)h[g]=this.rd(f[g]);return h}if("string"==typeof f||f instanceof String)return String(f);if(-1===f.length)return p.Fi;if(isNaN(f)&&"number"==typeof f)return NaN;h={};for(g in f)h[this.rd(g)]=this.rd(f[g]);
return h}}return null},xb:function(f,h){f=f||{};if(h)for(var g in h)f[g]=h[g];return f},nr:function(f){return f.replace(a,"_").replace(b,"__")},Ya:function(f){var h={},g;for(g in f)h[f[g]]=g;return h},gl:function(f){if(f&&!f.pop){for(var h=[],g=0;g<f.length;g++)h.push(f[g]);return h}return f},aG:function(f){if(!f)return[];for(var h={hD:0,next:function(){return f.charAt(this.hD++)}},g=/^\s*Expires/i,l=[],n=h.next();n;){for(var r="",u="";n&&";"!=n&&","!=n;)u+=n,n=h.next();u=u.trim();r+=u;";"==n&&(r+=
"; ",n=h.next());for(;n&&","!=n;){for(u="";n&&";"!=n&&","!=n;)u+=n,n=h.next();if(u.match(g))for(console.assert(","==n),u+=n,n=h.next();n&&";"!=n&&","!=n;)u+=n,n=h.next();u=u.trim();r+=u;";"==n&&(r+="; ",n=h.next())}l.push(r);n=h.next()}return l},le:function(){return c++},$v:function(){return d++},defer:function(){var f,h,g=new Promise(function(l,n){f=l;h=n});g.resolve=f;g.reject=h;return g}};return e}(),D=function(){function a(c,d,e){if(d)return e?d.apply(c,e):d.apply(c)}var b={Inheritance:function(c,
d,e,f){for(var h in d.prototype)if(!c.prototype[h])c.prototype[h]=d.prototype[h];else if(f){a:{var g=void 0;var l=d.prototype;for(g in l)if(l[h]==l[g]&&h!=g)break a;g=null}if(g){if(c.prototype[g]&&c.prototype[g]!==c.prototype[h]&&d.prototype[g]!==d.prototype[g])throw new O("Can't solve alias collision, try to minify the classes again ("+g+", "+h+")");c.prototype[g]=c.prototype[h]}}e||(c.prototype._super_=d,c.prototype._callSuperConstructor=b._callSuperConstructor,c.prototype._callSuperMethod=b._callSuperMethod);
return c},_callSuperMethod:function(c,d,e){return a(this,c.prototype._super_.prototype[d],e)},_callSuperConstructor:function(c,d){a(this,c.prototype._super_,d)}};return b.Inheritance}(),wb=function(){function a(){}function b(d,e,f){var h=new Number(d);if(isNaN(h))throw new C("The given value is not valid. Use a number");if(!f&&h!=Math.round(h))throw new C("The given value is not valid. Use an integer");if(e){if(0>d)throw new C("The given value is not valid. Use a positive number or 0");}else if(0>=
d)throw new C("The given value is not valid. Use a positive number");return h}function c(d,e){if(!0===d||!1===d||e&&!d)return!0===d;throw new C("The given value is not valid. Use true or false");}a.prototype.S=b;a.prototype.Ka=c;a.prototype.checkPositiveNumber=b;a.prototype.checkBool=c;return a}();k.s(p.on);k.s(p.Ic);bc.prototype={Ol:function(a){return this.wi[a]},ka:function(a,b){var c=this.Ol(a),d=this[c];this[c]=G.rd(b);this.parent&&this.Ct&&this.Zg(a);d!=this[c]&&this.dw(a)},V:function(a,b){var c=
this.Ol(a);b!=this[c]&&(this[c]=b,this.Zg(a),this.dw(a))},mi:function(a,b){this.parent=a;this.Ct=b},Zg:function(a){var b=this.Ol(a);return this.parent&&this.parent.Zg&&!this.parent.Zg(this.La,a,G.rd(this[b]))?!1:!0},dw:function(a){var b=this.Ol(a);!this.parent||!this.parent.fw||this.bw&&this.bw[b]||this.parent.fw(a,this)},pA:function(a){var b=this.wi,c;for(c in b)this.ka(c,a[b[c]])},ep:function(a){for(var b in this.wi)a(b,this[this.wi[b]])}};D(bc,wb,!1,!0);var cf={},fd={Zi:"connectionRequested",Oe:"clientsCount"};
fd=G.Ya(fd);Zb.prototype={};D(Zb,bc);var Hc=k.s(p.md);ie.prototype={gx:function(a){this.Qp(a);Hc.h()&&Hc.debug("Reset currentRetryDelay: "+this.Zd)},sv:function(){9<=this.mr&&this.Zd<this.km&&(this.Zd*=2,this.Zd>this.km&&(this.Zd=this.km),Hc.h()&&Hc.debug("Increase currentRetryDelay: "+this.Zd));this.mr++},Qp:function(a){this.vE=this.Zd=a;this.km=Math.max(6E4,a);this.mr=0}};var Nb=k.s(p.md);he.prototype={ex:function(a){this.Pp(a);Nb.h()&&Nb.debug("Reset currentConnectTimeout: "+this.sc)},Np:function(){9<=
this.zo&&this.sc<this.Pj&&(this.sc*=2,this.sc>this.Pj&&(this.sc=this.Pj),Nb.h()&&Nb.debug("Increase currentConnectTimeout: "+this.sc));this.zo++},jD:function(){this.sc=this.Pj;Nb.h()&&Nb.debug("Increase currentConnectTimeout to max: "+this.sc)},Pp:function(a){this.uE=this.sc=a;this.Pj=Math.max(6E4,a);this.zo=0}};var xb={};xb[p.Pk]=!0;xb[p.Wk]=!0;xb[p.Af]=!0;xb[p.Zs]=!0;xb[p.wn]=!0;xb[p.zi]=!0;var ed={Co:"contentLength",Ul:"idleTimeout",Eh:"keepaliveInterval",we:"requestedMaxBandwidth",MG:"realMaxBandwidth",
rg:"pollingInterval",ef:"reconnectTimeout",$m:"stalledTimeout",gi:"retryDelay",Bl:"firstRetryMaxDelay",Nr:"slowingEnabled",Gl:"forcedTransport",zr:"serverInstanceAddressIgnored",eu:"cookieHandlingRequired",hi:"reverseHeartbeatInterval",Qo:"earlyWSOpenEnabled",li:"sessionRecoveryTimeout",Or:"spinFixTimeout",Zm:"spinFixEnabled",vs:"xDomainStreamingEnabled",pl:"corsXHREnabled",El:"forceBindTimeout",Zr:"switchCheckTimeout",Ej:"httpExtraHeaders",Tl:"httpExtraHeadersOnSessionCreationOnly",ik:"remoteAdapterStatusObserver",
Zd:"currentRetryDelay",vE:"minRetryDelay",km:"maxRetryDelay",mr:"retryAttempt",sc:"currentConnectTimeout",uE:"minConnectTimeout",Pj:"maxConnectTimeout",zo:"connectAttempt"};ed=G.Ya(ed);v.prototype={JH:function(a){this.V("contentLength",this.S(a))},WB:function(){return this.Co},Ix:function(a){this.V("idleTimeout",this.S(a,!0))},Xu:function(){return this.Ul},Jx:function(a){this.V("keepaliveInterval",this.S(a,!0))},Zu:function(){return this.Eh},kI:function(a){a="unlimited"==(new String(a)).toLowerCase()?
0:this.S(a,!1,!0);this.V("requestedMaxBandwidth",a)},GC:function(){return 0>=this.we?"unlimited":this.we},zC:function(){return this.MG},Kx:function(a){this.V("pollingInterval",this.S(a,!0))},gv:function(){return this.rg},iI:function(a){this.V("reconnectTimeout",this.S(a))},BC:function(){return this.ef},wI:function(a){this.V("stalledTimeout",this.S(a))},RC:function(){return this.$m},HH:function(){},UB:function(){return String(this.Cp())},MH:function(){},Ue:function(){return this.sc},Lx:function(a){a=
this.S(a);this.V("retryDelay",a);this.gx(a);this.ex(a)},Cp:function(){return this.gi},PH:function(a){this.V("firstRetryMaxDelay",this.S(a))},dC:function(){return this.Bl},sI:function(a){this.V("slowingEnabled",this.Ka(a))},TD:function(){return this.Nr},RH:function(a){if(null!==a&&!xb[a])throw new C("The given value is not valid. Use one of: HTTP-STREAMING, HTTP-POLLING, WS-STREAMING, WS-POLLING, WS, HTTP or null");this.V("forcedTransport",a)},hC:function(){return this.Gl},oI:function(a){this.V("serverInstanceAddressIgnored",
this.Ka(a))},SD:function(){return this.zr},KH:function(a){this.V("cookieHandlingRequired",this.Ka(a))},Yc:function(){return this.eu},OH:function(a){this.V("earlyWSOpenEnabled",this.Ka(a))},CD:function(){return this.Qo},Mx:function(a){this.V("reverseHeartbeatInterval",this.S(a,!0))},jv:function(){return this.hi},WH:function(a){if(a){var b="",c;for(c in a)b+=c+"\n"+a[c]+"\n";this.V("httpExtraHeaders",b)}else this.V("httpExtraHeaders",null)},Wu:function(){if(!this.Ej)return this.Ej;for(var a={},b=this.Ej.split("\n"),
c=0;c<b.length-1;c+=2)a[b[c]]=b[c+1];return a},XH:function(a){this.V("httpExtraHeadersOnSessionCreationOnly",this.Ka(a))},GD:function(){return this.Tl},rI:function(a){this.V("sessionRecoveryTimeout",this.S(a,!0))},LC:function(){return this.li},Dj:function(a){return this.Ej?a?!0:!this.Tl:!1},lj:function(a){return!a&&this.Tl?null:this.Wu()},EI:function(a){this.V("xDomainStreamingEnabled",this.Ka(a))},ZD:function(){return this.vs},LH:function(a){this.V("corsXHREnabled",this.Ka(a))},zD:function(){return this.pl},
QH:function(a){this.V("forceBindTimeout",this.S(a))},fC:function(){return this.El},xI:function(a){this.V("switchCheckTimeout",this.S(a))},SC:function(){return this.Zr},vI:function(a){this.V("spinFixTimeout",this.S(a))},QC:function(){return this.Or},uI:function(a){this.V("spinFixTimeout",null===this.VJ?null:this.Ka(a))},PC:function(){return this.Zm},sD:function(a,b,c,d){this.ik={sE:a,fK:b,sK:c,gk:d}}};v.prototype.setContentLength=v.prototype.JH;v.prototype.getContentLength=v.prototype.WB;v.prototype.setIdleTimeout=
v.prototype.Ix;v.prototype.getIdleTimeout=v.prototype.Xu;v.prototype.setKeepaliveInterval=v.prototype.Jx;v.prototype.getKeepaliveInterval=v.prototype.Zu;v.prototype.setRequestedMaxBandwidth=v.prototype.kI;v.prototype.getRequestedMaxBandwidth=v.prototype.GC;v.prototype.getRealMaxBandwidth=v.prototype.zC;v.prototype.setPollingInterval=v.prototype.Kx;v.prototype.getPollingInterval=v.prototype.gv;v.prototype.setReconnectTimeout=v.prototype.iI;v.prototype.getReconnectTimeout=v.prototype.BC;v.prototype.setStalledTimeout=
v.prototype.wI;v.prototype.getStalledTimeout=v.prototype.RC;v.prototype.setConnectTimeout=v.prototype.HH;v.prototype.getConnectTimeout=v.prototype.UB;v.prototype.setCurrentConnectTimeout=v.prototype.MH;v.prototype.getCurrentConnectTimeout=v.prototype.Ue;v.prototype.setRetryDelay=v.prototype.Lx;v.prototype.getRetryDelay=v.prototype.Cp;v.prototype.setFirstRetryMaxDelay=v.prototype.PH;v.prototype.getFirstRetryMaxDelay=v.prototype.dC;v.prototype.setSlowingEnabled=v.prototype.sI;v.prototype.isSlowingEnabled=
v.prototype.TD;v.prototype.setForcedTransport=v.prototype.RH;v.prototype.getForcedTransport=v.prototype.hC;v.prototype.setServerInstanceAddressIgnored=v.prototype.oI;v.prototype.isServerInstanceAddressIgnored=v.prototype.SD;v.prototype.setCookieHandlingRequired=v.prototype.KH;v.prototype.isCookieHandlingRequired=v.prototype.Yc;v.prototype.setEarlyWSOpenEnabled=v.prototype.OH;v.prototype.isEarlyWSOpenEnabled=v.prototype.CD;v.prototype.setReverseHeartbeatInterval=v.prototype.Mx;v.prototype.getReverseHeartbeatInterval=
v.prototype.jv;v.prototype.setHttpExtraHeaders=v.prototype.WH;v.prototype.getHttpExtraHeaders=v.prototype.Wu;v.prototype.setHttpExtraHeadersOnSessionCreationOnly=v.prototype.XH;v.prototype.isHttpExtraHeadersOnSessionCreationOnly=v.prototype.GD;v.prototype.setSessionRecoveryTimeout=v.prototype.rI;v.prototype.getSessionRecoveryTimeout=v.prototype.LC;v.prototype.setXDomainStreamingEnabled=v.prototype.EI;v.prototype.isXDomainStreamingEnabled=v.prototype.ZD;v.prototype.setCorsXHREnabled=v.prototype.LH;
v.prototype.isCorsXHREnabled=v.prototype.zD;v.prototype.setForceBindTimeout=v.prototype.QH;v.prototype.getForceBindTimeout=v.prototype.fC;v.prototype.setSwitchCheckTimeout=v.prototype.xI;v.prototype.getSwitchCheckTimeout=v.prototype.SC;v.prototype.setSpinFixTimeout=v.prototype.vI;v.prototype.getSpinFixTimeout=v.prototype.QC;v.prototype.setSpinFixEnabled=v.prototype.uI;v.prototype.getSpinFixEnabled=v.prototype.PC;v.prototype.setRetryTimeout=v.prototype.Lx;v.prototype.getRetryTimeout=v.prototype.Cp;
v.prototype.setIdleMillis=v.prototype.Ix;v.prototype.getIdleMillis=v.prototype.Xu;v.prototype.setKeepaliveMillis=v.prototype.Jx;v.prototype.getKeepaliveMillis=v.prototype.Zu;v.prototype.setPollingMillis=v.prototype.Kx;v.prototype.getPollingMillis=v.prototype.gv;v.prototype.setReverseHeartbeatMillis=v.prototype.Mx;v.prototype.getReverseHeartbeatMillis=v.prototype.jv;D(v,bc);D(v,ie,!0);D(v,he,!0);var N=function(){var a=k.s("weswit.test"),b=0,c={},d={VOID:c,cC:function(){return b},iA:function(e,f,h){if(e.length!=
f.length)return this.Qc(),a.g(k.resolve(497),e,f),!1;if(h)for(g=0;g<e.length;g++){if(e[g]!=f[g])return a.g(k.resolve(500),e[g],f[g]),this.Qc(),!1}else{h={};for(var g=0;g<e.length;g++)h[e[g]]=1;for(g=0;g<f.length;g++)if(h[f[g]])h[f[g]]++;else return a.g(k.resolve(498),f[g]),this.Qc(),!1;for(g in h)if(1==h[g])return a.g(k.resolve(499),h[g]),this.Qc(),!1}return!0},Ge:function(e,f,h,g,l){return this.verify(e,f,h,g,!1,l)},zJ:function(e,f,h){return this.verify(e,f,h,null,!0)},AJ:function(e){return null===
e?(this.Qc(),a.g(k.resolve(501),e),!1):!0},ra:function(e,f,h){if(!0===h)h=e===f;else if(h)h=h(e,f);else if(isNaN(e))h=e==f;else{h=e&&e.charAt?e.charAt(0):null;var g=f&&f.charAt?f.charAt(0):null;h="."==h||" "==h||"0"==h||"."==g||" "==g||"0"==g?String(e)==String(f):e==f}return h?!0:(this.Qc(),a.g(k.resolve(502),e,f),!1)},Gg:function(e,f,h){return(h?e===f:e==f)?(this.Qc(),a.g(k.resolve(503),e,f),!1):!0},la:function(e){return e?!0:(this.Qc(),a.g(k.resolve(504)),!1)},Fe:function(e){return e?(this.Qc(),
a.g(k.resolve(505)),!1):!0},ia:function(){a.g(k.resolve(506));this.Qc();return!1},Qc:function(){b++},verify:function(e,f,h,g,l,n){var r=!1,u=null,E=null;try{u=h!==c?e[f].apply(e,h):e[f]()}catch(t){r=!0,E=t}e=l?"succes":"failure";return l!=r?(this.Qc(),a.g(k.resolve(507),e,"for",f,h,g,E),!1):l||g===c?!0:this.ra(u,g,n)}};d.getFailures=d.cC;d.fail=d.ia;d.verifyNotOk=d.Fe;d.verifyOk=d.la;d.verifyDiffValue=d.Gg;d.verifyNotNull=d.AJ;d.verifyValue=d.ra;d.verifyException=d.zJ;d.verifySuccess=d.Ge;d.compareArrays=
d.iA;return d}(),Ob=k.s(p.Mg),te="LS_cid="+p.Ay+"&",uf=/^[a-z][a-z0-9-]+$/,vf=/^((?:[a-z][a-z.0-9-]+).(?:[a-z][a-z-]+))(?![\w.])/,wf=/^((?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))(?![d])/,xf=/^[a-f0-9:]+$/,Ma={CJ:function(a){a=a.toLowerCase();var b=0==a.indexOf("http://")?7:0==a.indexOf("https://")?8:-1;if(-1==b)return"The given server address has not a valid scheme";var c=a.lastIndexOf(":");c=c>b?c:a.length;var d=this.dB(a,a.indexOf("://"));if(null!=
d&&isNaN(d.substring(1)))return"The given server address has not a valid port";d=a.indexOf("/",b);d=d<c?d:c;if("["==a.charAt(b)){if(a=a.substring(b+1,a.lastIndexOf("]")),!xf.test(a))return"The given server address is not a valid IPv6"}else if(a=a.substring(b,d),-1<a.indexOf(".")){if(!vf.test(a)&&!wf.test(a))return"The given server address is not a valid URL"}else if(!uf.test(a))return"The given server address is not a valid machine name";return!0},Rw:function(a){var b={},c=a.indexOf("://");-1!=c?
(b.ug=a.substring(0,c),a=a.substring(c+3)):b.ug=null;c=a.indexOf("/");-1!=c?(b.path=a.substring(c),a=a.substring(0,c)):b.path=null;c=this.eB(a);-1!=c?(b.port=a.substring(c),b.host=a.substring(0,c-1)):(b.port=null,b.host=a);return b},IJ:function(a){var b=a.host;null!=a.ug&&(b=a.ug+"://"+b);null!=a.port&&(b+=":"+a.port);null!=a.path&&(b+=a.path);"/"!=b.substring(b.length-1)&&(b+="/");return b},eB:function(a){var b=a.indexOf(":");return-1>=b?-1:-1<a.indexOf("]")?(b=a.indexOf("]:"),-1>=b?-1:b+2):b!=a.lastIndexOf(":")?
-1:b+1},jA:function(a,b){a=this.Rw(a);b=this.Rw(b);return this.IJ({ug:null!=b.ug?b.ug:a.ug,host:b.host,port:null!=b.port?b.port:a.port,path:b.path})},xC:function(a,b,c,d,e,f,h,g,l,n,r,u){a="LS_phase="+a+"&"+(r&&L.ua()&&!G.Ip()?"LS_domain="+G.Vf()+"&":"")+(g?"LS_cause="+g+"&":"");e||f?(a+="LS_polling=true&",g=n=0,f&&(n=Number(c.rg),null==l||isNaN(l)||(n+=l),g=c.Ul),isNaN(n)||(a+="LS_polling_millis="+n+"&"),isNaN(g)||(a+="LS_idle_millis="+g+"&")):(0<c.Eh&&(a+="LS_keepalive_millis="+c.Eh+"&"),0<c.hi&&
(a+="LS_inactivity_millis="+c.hi+"&"),n&&(a+="LS_content_length="+c.Co+"&"));if(e)return b="",0<c.we&&(b+="LS_requested_max_bandwidth="+c.we+"&"),null!=d.el&&(b+="LS_adapter_set="+encodeURIComponent(d.el)+"&"),null!=d.hn&&(b+="LS_user="+encodeURIComponent(d.hn)+"&"),c=a+te+b,h&&(c+="LS_old_session="+h+"&"),u&&(c+="LS_ttl=unlimited&"),Ob.a(k.resolve(510),c),null!=d.password&&(c+="LS_password="+encodeURIComponent(d.password)+"&"),c;N.la(b)||Ob.g(k.resolve(508));d="LS_session="+b+"&"+a;Ob.a(k.resolve(509),
d);return d},CC:function(a,b,c,d,e,f,h){a="LS_phase="+a+"&"+(f&&L.ua()&&!G.Ip()?"LS_domain="+G.Vf()+"&":"")+(d?"LS_cause="+d+"&":"");d=0;null==e||isNaN(e)||(d+=e);a=a+"LS_polling=true&"+("LS_polling_millis="+d+"&")+"LS_idle_millis=0&";0<c.we&&(a+="LS_requested_max_bandwidth="+c.we+"&");a=a+("LS_session="+b+"&")+("LS_recovery_from="+h+"&");Ob.a(k.resolve(511),a);return a},$B:function(a,b){a={LS_op:"destroy",LS_session:a,LS_reqId:G.le()};b&&(a.LS_cause=b);Ob.a(k.resolve(512));return a},gC:function(a,
b){var c={LS_op:"force_rebind",LS_reqId:G.le()};a&&(c.LS_cause=a);null==b||isNaN(b)||(c.LS_polling_millis=b);Ob.a(k.resolve(513));return c},lC:function(a,b,c){b.LS_build=c;b.LS_phase=a;return b},VB:function(a){return{LS_op:"constrain",LS_requested_max_bandwidth:0<a.we?a.we:"unlimited",LS_reqId:G.le()}},hv:function(a,b,c){return b||null!=c&&0==c.indexOf(".txt")||""==c?a?"create_session"+c:"bind_session"+c:"STREAMING_IN_PROGRESS"},DC:function(a){return"bind_session"+a},iK:function(){return""},qK:function(a){te=
a},dB:function(a,b){var c=a.indexOf(":",b+1);if(-1>=c)return null;if(-1<a.indexOf("]")){c=a.indexOf("]:");if(-1>=c)return null;c+=1}else if(c!=a.lastIndexOf(":"))return null;b=a.indexOf("/",b+3);return-1<b?a.substring(c,b):a.substring(c)}},dd={tk:"serverAddress",el:"adapterSet",hn:"user",password:"password",yx:"serverInstanceAddress",zx:"serverSocketName",sessionId:"sessionId",gA:"clientIp"};dd=G.Ya(dd);var ge=!L.Rb()||"http:"!=location.protocol&&"https:"!=location.protocol?null:location.protocol+
"//"+location.hostname+(location.port?":"+location.port:"")+"/";aa.prototype={Ox:function(a){if(null===a)a=ge;else{"/"!=a.substr(a.length-1)&&(a+="/");var b=Ma.CJ(a);if(!0!==b)throw new C(b);}this.V("serverAddress",a)},kv:function(){return this.tk},Bx:function(a){this.V("adapterSet",a)},GB:function(){return this.el},CI:function(a){this.V("user",a)},YC:function(){return this.hn},eI:function(a){this.V("password",a)},JC:function(){return this.yx},KC:function(){return this.zx},Wc:function(){return this.sessionId},
PB:function(){return this.gA}};aa.prototype.setServerAddress=aa.prototype.Ox;aa.prototype.getServerAddress=aa.prototype.kv;aa.prototype.setAdapterSet=aa.prototype.Bx;aa.prototype.getAdapterSet=aa.prototype.GB;aa.prototype.setUser=aa.prototype.CI;aa.prototype.getUser=aa.prototype.YC;aa.prototype.setPassword=aa.prototype.eI;aa.prototype.getServerInstanceAddress=aa.prototype.JC;aa.prototype.getServerSocketName=aa.prototype.KC;aa.prototype.getSessionId=aa.prototype.Wc;aa.prototype.getClientIp=aa.prototype.PB;
D(aa,bc);var ue={$i:function(a,b){return b.ss?b.In?function(){try{var c=this.target[a].apply(this.target,[this.jc].concat(G.gl(arguments)));return Promise.resolve(c)}catch(d){return Promise.reject(d)}}:function(){try{var c=this.target[a].apply(this.target,arguments);return Promise.resolve(c)}catch(d){return Promise.reject(d)}}:b.In?function(){try{this.target[a].apply(this.target,[this.jc].concat(G.gl(arguments)))}catch(c){console.error(c)}}:function(){try{this.target[a].apply(this.target,arguments)}catch(c){console.error(c)}}}};
sa.Rx=new sa(!1,!1);sa.rK=new sa(!0,!1);sa.Sx=new sa(!0,!1,2E3);sa.j=new sa(!1,!0);sa.uH=new sa(!0,!0);sa.pK=new sa(!0,!0,4E3);var kd=sa.Rx,Pb=sa.j,ld={pw:kd,Dt:Pb,Et:Pb,Kw:sa.Sx,Ek:sa.uH,ui:Pb,Ee:Pb,oj:Pb,Ku:kd,Vt:kd,Ft:Pb},ve=k.s(p.Ic);rb.methods=ld;rb.prototype={hI:function(a){this.target=a},Gx:function(a){ve.i(k.resolve(514),this.tu,a);this.vb=a},Xf:function(){return this.vb},ca:function(){this.client=null},qI:function(a){this.jc=a},Tj:function(a,b,c){("ConnectionDetails"==a?this.client.Kc:"ConnectionOptions"==
a?this.client.rc:this.client.Ja).ka(b,c)},mg:function(a){this.jc=a;this.Cc&&this.Rm(a)},Rm:function(){this.Cc=!1;this.client.Rm()},dc:function(a){this.jc=a;this.Cc=!0;this.client.tH()},Th:function(a,b){ve.i(k.resolve(515),this.vb+" is dead");this.client&&(this.Rm(-1),this.client.QA(a,b))},fo:function(){var a=this;this.Kw().then(function(){},function(){a.client&&a.Th()})},tw:function(){this.fo();x.u(this.fo,1E3,this)},Uh:function(a,b){this.client.sH(a,b)},ec:function(a){this.client.Pn(a)},dd:function(a,
b,c,d,e){this.client.Gb.eJ(a,b,c,d,e)},Vh:function(a,b,c){this.client.Gb.UA(a,b,c)},fc:function(a){this.client.Gb.vJ(a)},Sh:function(a,b){this.client.Gb.ig(a,b)},pg:function(a,b){this.client.Gb.wJ(a,b)},uw:function(a,b,c){this.client.Gb.jg(a,b,c)},tm:function(a,b){this.client.Gb.gg(a,b)},kg:function(a){this.client.X.oE(a)},ww:function(a,b,c){this.client.X.nE(a,b,c)},lg:function(a,b,c){this.client.X.pE(a,b,c)},vw:function(a){this.client.X.mE(a)},xw:function(a){this.client.X.rE(a)},ping:function(){if(null===
this.client)throw"net";return!0},Bd:function(){this.client.Bd()},Wh:function(a,b){this.client.Gb.LA(a,b)}};for(var md in ld)rb.prototype[md]=ue.$i(md,ld[md]);xa.SJ="GET";xa.Xk="POST";xa.prototype={toString:function(){return["[",this.Lc,this.Gi,this.Df,this.Sg,"]"].join("|")},fI:function(a){for(;a&&"/"==a.substring(a.length-1);)a=a.substring(0,a.length-1);this.Lc=a},yg:function(a){for(;a&&"/"==a.substring(0,1);)a=a.substring(1);this.Gi=a},Vm:function(a){this.Sg=a||xa.Xk},xk:function(a){this.du=a||
!1},yk:function(a){this.Yo=a||null},setData:function(a){this.Df=a},getFile:function(){return this.Gi},ag:function(){return this.Gi?this.Lc+"/"+this.Gi:this.Lc},getData:function(){return this.Df},XC:function(){return this.Df?this.ag()+"?"+this.Df:this.ag()},clone:function(){return new xa(this.Lc,this.Gi,this.Df,this.Sg,this.du,this.Yo)},Hv:function(){return!(0==this.Lc.indexOf("http://")||0==this.Lc.indexOf("https://")||0==this.Lc.indexOf("file:///"))},RD:function(a,b){if(!L.Rb())return!1;if(this.Hv())return L.cm()?
location.hostname==a:G.Vf()==a;if(b){if(!this.Jv(b))return!1;if("file:"==b)return""==a}a=a.replace(".",".");return(new RegExp("^https?://(?:[a-z][a-z0-9-]+.)*"+a+"(?:/|$|:)","i")).test(this.Lc)},Jv:function(a){return L.Rb()&&a.indexOf(":")==a.length-1?this.Hv()?location.protocol==a:0==this.Lc.indexOf(a):!1},nb:function(){return L.Rb()?!this.RD(L.cm()?location.hostname:G.Vf(),location.protocol):!0},mb:function(){return L.Rb()?!this.Jv(location.protocol):!0}};xa.vz=new xa("about:blank");var yf=k.s(p.tn);
F.Mk=1;F.sn=2;F.pn=3;F.Ie=4;F.He=5;F.Ig=6;F.qn=7;F.zf=8;F.Bs=9;F.Va=10;F.prototype={toString:function(){var a=yf.h()?JSON.stringify(this.request):this.request;return["[|ControlRequest",this.Uw,this.bl,this.tg,a,"]"].join("|")},Jl:function(){return this.QG},getKey:function(){return this.Uw}};cd.prototype={toString:function(){return"[Encoder]"},nD:function(a,b,c){var d=new xa;a=a.ph();d.yg((a==F.Ie?"msg":a==F.He?"send_log":a==F.zf?"heartbeat":"control")+this.rh());d.Vm(xa.Xk);d.xk(b);d.yk(c);return d},
encode:function(a,b,c){for(c=c?"":"\r\n";0<a.$b();){var d=a.Al(),e=d.Jl(),f=d.bl;if(e&&e.Ge())e.Rj(),a.shift();else return a=d.request,f==F.Ie?c+this.Vo(a,e,b):f==F.Ig?c+this.tl(a,e,b):f==F.zf?c+this.To(a,e,b):f==F.He?c+this.Uo(a,e,b):c+this.So(a,e,b)}return null},expand:function(a,b){var c="";if(a)for(var d in a)d!==b&&(c+=d+"="+a[d]+"&");return c},ih:function(a,b){a=this.expand(a);return a+=this.expand(b)},ul:function(a,b,c){var d=this.expand(a,c);d+=this.expand(b,c);a[c]?d+=c+"="+a[c]:b&&(d+=c+
"="+b[c]);return"LS_unq="+d.length+"&"+d},ts:function(a){return a?a:"\n"},rh:function(){return".txt?LS_protocol="+p.Xs},qp:function(){return 0},tp:function(){return 2},So:function(a,b,c,d){return this.ih(a,d,c)},tl:function(a,b,c,d){return this.ih(a,d,c)},To:function(a,b,c,d){return this.ih(a,d,c)},Uo:function(a,b,c,d){return this.ih(a,d,c)},Vo:function(a,b,c,d){return this.ul(a,d,"LS_message",c)}};var we=1,yb={Vo:"encodeMessageRequest",So:"encodeControlRequest",tl:"encodeDestroyRequest",To:"encodeHeartbeatRequest",
Uo:"encodeLogRequest"};yb=G.Ya(yb);Xa.prototype={Vo:function(a,b,c,d){d=G.xb(d,{LS_session:c});return this._callSuperMethod(Xa,yb.encodeMessageRequest,[a,b,c,d])},So:function(a,b,c,d){d=G.xb(d,{LS_session:c});return this._callSuperMethod(Xa,yb.encodeControlRequest,[a,b,c,d])},tl:function(a,b,c,d){return this._callSuperMethod(Xa,yb.encodeDestroyRequest,[a,b,c,d])},To:function(a,b,c,d){c&&(d=G.xb(d,{LS_session:c}));d=G.xb(d,{LS_unique:we++});return this._callSuperMethod(Xa,yb.encodeHeartbeatRequest,
[a,b,c,d])},Uo:function(a,b,c,d){c&&(d=G.xb(d,{LS_session:c}));d=G.xb(d,{LS_unique:we++});return this._callSuperMethod(Xa,yb.encodeLogRequest,[a,b,c,d])},expand:function(a,b){var c="";if(a)for(var d in a)c=d!==b?c+(d+"="+a[d]+"&"):c+(d+"="+encodeURIComponent(a[d])+"&");return c},ul:function(a,b,c){a=this.expand(a,c);return a+=this.expand(b,c)}};D(Xa,cd);var zf=new Xa;ma.Ud=function(a,b){for(var c in b)a[c]=!0===b[c]?ef:!1===b[c]?df:b[c]};ma.Ud(ma,{Qb:!1,nb:!1,mb:!1,Td:!1,Ke:!1,Bh:!1,Wd:!1});ma.prototype=
{Wa:function(){},Ax:function(a,b,c,d,e){return this.gb(a,b,c,d,e)},gb:function(){return!1},Wf:function(){return zf}};ma.jK=function(){};ma.$J=function(){};var fc=k.s("assertions"),Y={assert:function(a,b){a||this.ia(b)},yt:function(a,b){null==a&&this.ia(b)},bK:function(a,b){null!=a&&this.ia(b)},aK:function(a,b,c){a!==b&&this.ia(c+": Expected "+a+" but found "+b)},kK:function(a,b,c){this.assert(!a||b,c)},ia:function(a){null!=a&&fc.g(a);N.ia()},la:function(a,b){N.la(a)||null!=b&&fc.g(b)},Fe:function(a,
b){N.Fe(a)||null!=b&&fc.g(b)},ra:function(a,b,c){N.ra(a,b,null)||null!=c&&fc.g(c)},Gg:function(a,b,c){N.Gg(a,b,null)||null!=c&&fc.g(c)}};fe.prototype={Fk:function(a){this.ga=a},oC:function(a,b){this.Gh++;this.bk[this.Gh]=b;this.Cm[this.Gh]=a;this.ck[this.Gh]=!1;this.Bm++;return this.Gh},tc:function(a){return this.bk[a]},xj:function(a){return this.Cm[a]},FJ:function(a){return this.ck[a]},bA:function(){this.dA();var a=[],b;for(b in this.bk)a.push(b);a.sort(function(c,d){return c-d});for(b=0;b<a.length;b++)this.lE(a[b]);
Y.ra(this.Bm,0,"Unexpected pending messages");this.Gh=-1;this.bk={};this.Cm={};this.ck={};this.Bm=0},w:function(a){delete this.bk[a];delete this.Cm[a];delete this.ck[a];this.Bm--},rE:function(a){this.tc(a)&&(this.ck[a]=!0)},SA:function(a,b,c,d){this.fk.add({Nh:a,Qm:b,listener:c,timeout:d})},dA:function(){var a=this;this.fk.forEach(function(b){a.fireEvent("onAbort",b.listener,[b.Nh,!1])});this.fk.w()},bD:function(){var a=this;this.fk.forEach(function(b){a.oj(b.Nh,b.Qm,b.listener,b.timeout)});this.fk.w()},
oj:function(a,b,c,d){var e=null;c&&(e=this.oC(a,c));this.ga.oj(a,b,e,d)},fireEvent:function(a,b,c){b&&b[a]&&x.u(b[a],0,b,c)},mE:function(a){this.fireEvent("onProcessed",this.tc(a),[this.xj(a)]);this.w(a)},pE:function(a,b){var c=this.tc(a);32!=b&&33!=b&&this.fireEvent("onError",c,[this.xj(a)]);this.w(a)},nE:function(a,b,c){this.fireEvent("onDeny",this.tc(a),[this.xj(a),b,c]);this.w(a)},oE:function(a){this.fireEvent("onDiscarded",this.tc(a),[this.xj(a)]);this.w(a)},lE:function(a){this.fireEvent("onAbort",
this.tc(a),[this.xj(a),this.FJ(a)]);this.w(a)}};var pa=k.s(p.Ws);ee.prototype={toString:function(){return"[SubscriptionsHandler]"},Fk:function(a){this.Zb=a},pt:function(a){var b=++this.AE;pa.i(k.resolve(516),a);a.vq(b,++this.EB,this);this.mc[b]=a;this.Gw(a)},Ww:function(a){if(this.Zb&&this.Zb.Cc){var b=a.Be;(a.Kv()||a.Ah())&&b&&(this.Zb.ui(b),delete this.Dg[b])}pa.i(k.resolve(517),a);b=a.vd();a.yF();delete this.mc[b];return a},Ee:function(a,b){if(this.Zb&&this.Zb.Cc&&a.zb()){Y.la(a.zb(),"Inactive subscription");
var c=a.vd();if(this.hc[c]){pa.a(k.resolve(518),a);var d=this;this.vl(c,function(e){pa.a(k.resolve(519),a);d.Zb.Ee(e,b)})}else pa.a(k.resolve(520),a),this.Zb.Ee(a.Be,b)}},Gw:function(a){if(this.Zb&&this.Zb.Cc&&a.LD()){var b=a.vd();pa.a(k.resolve(521));var c=this.Zb.Ek(a.FC());this.hc[b]?pa.a(k.resolve(522),b):(Y.Fe(this.hc[b],"Promise unexpected (1)"),Y.Fe(this.Fd[b],"Promise unexpected (2)"));this.hc[b]=c;this.Fd[b]=0;a.HF();pa.a(k.resolve(523),a);var d=this;this.vl(b,function(e){pa.a(k.resolve(524),
a);d.mc[b]?(a.NF(e),d.Dg[e]=b):d.Zb&&d.Zb.ui(e)})}},vl:function(a,b){Y.la(this.hc[a],"Promise not found (1)");0!==this.Fd[a]&&Y.la(this.Fd[a],"Promise not found (2)");var c=this.hc[a];this.Fd[a]++;var d=this,e=this.b;c.then(function(f){d.hc[a]!=c?pa.a(k.resolve(525),a):(Y.la(d.hc[a],"Promise not found (3)"),Y.la(d.Fd[a],"Promise not found (4)"),1<d.Fd[a]?d.Fd[a]--:(delete d.hc[a],delete d.Fd[a]),null!=f&&e==d.b&&b(f))},function(){d.hc[a]!=c?pa.a(k.resolve(526),a):(delete d.hc[a],delete d.Fd[a])})},
cD:function(){pa.a(k.resolve(527));for(var a in this.mc)this.Gw(this.mc[a])},fG:function(a){Y.Fe(a.JD(),"Table removed");pa.a(k.resolve(528),a);delete this.Dg[a.Be];a.uF();a.Vx&&delete this.mc[a.vd()]},eG:function(){pa.a(k.resolve(529));for(var a in this.mc)this.fG(this.mc[a]);this.Dg={};this.b++},Me:function(a,b){var c=this.Dg[a];if(c){var d=this.mc[c];if(this.hc[c]){pa.a(k.resolve(530),d);var e=this;this.vl(c,function(g){pa.a(k.resolve(531),l);Y.ra(g,a,"Wrong table number");if(e.Dg[a]==c){var l=
e.mc[c];l&&b.apply(l)}})}else d&&b.apply(d)}else{pa.a(k.resolve(533),a);e=this;d=0;for(var f in this.hc){var h=this.mc[f];h&&(h.Be?Y.Gg(h.Be,a,"Unexpected table number"):(function(g){e.vl(g,function(l){l==a&&(pa.a(k.resolve(534),a),e.Dg[a]==g&&(l=e.mc[g])&&b.apply(l))})}(f),d++))}pa.a(k.resolve(535),d)}},wJ:function(a,b){this.Me(a[0],function(){this.update(ff(a,!0),b,!1)})},jg:function(a,b,c){this.Me(a,function(){this.hE(b,c)})},ig:function(a,b){this.Me(a,function(){this.Wo(b)})},gg:function(a,b){this.Me(a,
function(){this.eA(b)})},UA:function(a,b,c){this.Me(a,function(){this.rH(b,c)})},eJ:function(a,b,c,d,e){this.Me(a,function(){this.FF(b,c,d,e)})},vJ:function(a){this.Me(a,function(){})},LA:function(a,b){this.Me(a,function(){this.Yi(b)})}};var hb=function(){function a(){this._callSuperConstructor(a)}function b(){this.Vl()}b.prototype={Vl:function(){this.Hk=new a;this.Wx=!1},addListener:function(c){c&&!this.Hk.contains(c)&&(c={m:c,Sv:!0},this.Hk.add(c),this.Mo("onListenStart",[this],c,!0))},removeListener:function(c){c&&
(c=this.Hk.remove(c))&&this.Mo("onListenEnd",[this],c,!0)},yb:function(){return this.Hk.Ln()},jy:function(c){this.Wx=!0===c},Mo:function(c,d,e,f){this.Wx?this.pu(c,d,e,!0):x.u(this.pu,0,this,[c,d,e,f])},pu:function(c,d,e,f){if(e&&e.m[c]&&(f||e.Sv))try{d?e.m[c].apply(e.m,d):e.m[c].apply(e.m)}catch(h){}},dispatchEvent:function(c,d){var e=this;this.Hk.forEach(function(f){e.Mo(c,d,f,!1)})}};b.prototype.initDispatcher=b.prototype.Vl;b.prototype.addListener=b.prototype.addListener;b.prototype.removeListener=
b.prototype.removeListener;b.prototype.getListeners=b.prototype.yb;b.prototype.useSynchEvents=b.prototype.jy;b.prototype.dispatchEvent=b.prototype.dispatchEvent;a.prototype={remove:function(c){c=this.find(c);if(0>c)return!1;var d=this.data[c];d.Sv=!1;this.data.splice(c,1);return d},find:function(c){for(var d=0;d<this.data.length;d++)if(this.data[d].m==c)return d;return-1},Ln:function(){var c=[];this.forEach(function(d){c.push(d.m)});return c}};D(a,Jb);return b}(),Ia=k.s(p.Mg),xe=!1;wc.LI=function(a){xe=
a};wc.prototype={ah:function(a){Ia.a(k.resolve(538),a);this.o=a;this.o.Wc()!=this.Fo&&(this.ub=null)},ZA:function(a){var b=this;W.Da(a,"LS_e",function(c,d,e,f,h,g){b.zw(c,d,e,f,h,g)});W.Da(a,"LS_t",function(){});W.Da(a,"LS_u",function(c,d,e){b.pg(c,d,e)});W.Da(a,"LS_v",function(c,d){b.pg(c,d,!0)});W.Da(a,"LS_o",function(c,d){b.jg(c,d)});W.Da(a,"LS_n",function(c,d){b.ig(c,d)});W.Da(a,"LS_s",function(c,d){d.length?b.gg(c,d):b.zw(6,c,d)});W.Da(a,"LS_l",function(c,d,e,f,h){b.Aa(c,d,e,f,h)});W.Da(a,"LS_w",
function(c,d,e,f,h,g,l){b.VE(c,d,e,f,h,g,l)});W.Da(a,"setTimeout",function(c,d){setTimeout(c,d)});W.Da(a,"alert",function(c){"undefined"!=typeof alert?alert(c):"undefined"!=typeof console&&console.log(c)});W.Da(a,"LS_svrname",function(c){b.Iq(c)});W.Da(a,"LS_MPNREG",function(c,d){b.fF(c,d)});W.Da(a,"LS_MPNOK",function(c,d){b.eF(c,d)});W.Da(a,"LS_MPNDEL",function(c){b.dF(c)})},Ed:function(){var a=!xe&&!V.Za()&&null!=this.o;Ia.h()&&Ia.a(k.resolve(539),a);return a},Bc:function(){this.o.Wc()!=this.Fo&&
(this.ub=null);var a=this.o.Pc;Ia.a(k.resolve(540),a);if(null!=this.ub){N.la(this.ub<=a)||Ia.g(k.resolve(541),this.ub);this.ub++;if(this.ub<=a)return Ia.a(k.resolve(542),this.ub),!1;this.o.qw();a=this.o.Pc;N.ra(this.ub,a)||Ia.g(k.resolve(543),this.ub);return!0}this.o.qw();return!0},zw:function(a,b,c,d,e,f){if(this.Ed(b,null,1==a,3==a||4==a))if(1==a)this.o.sF(c,d,f,e);else if(2==a)this.o.cF(c);else if(3==a)this.o.Xj("syncerror");else if(4==a){a=30;if(null!=c){a=c;if(41==a){this.o.YE();return}if(48==
a){this.o.Xj("expired");return}if(0<a&&30>a||39<a)a=39}c="The session has been forcibly closed by the Server";null!=d&&(c=d);this.Aa(a,b,null,c)}else 5==a?this.o.AF(c):6==a?this.o.LF(c):7==a?this.vF(c,d):this.o.rw("Unsupported Server version")},vF:function(a,b){this.o.Wc()!=this.Fo&&(this.ub=null);var c=this.o.Pc;null==this.ub?(this.ub=a,this.Fo=this.o.Wc(),this.ub>c&&(N.ia(),Ia.g(k.resolve(544),a,c,b),this.o.Fq())):this.ub!=a?(N.ia(),Ia.g(k.resolve(545),a,this.ub,b),this.o.Fq()):a!=c&&(N.ia(),Ia.g(k.resolve(546),
a,c,b),this.o.Fq())},pg:function(a,b,c){2>b.length?this.Ed(a)&&this.o.bF():this.Ed(null,a)&&this.Bc()&&this.o.Nq(b,c||!1)},ig:function(a,b){this.Ed(null,a)&&this.Bc()&&this.o.ig(b)},gg:function(a,b){this.Ed(null,a)&&this.Bc()&&this.o.gg(b)},jg:function(a,b){this.Ed(null,a)&&this.Bc()&&this.o.jg(b)},hF:function(a,b,c,d,e){if(this.Ed())if(N.ra(c.substring(0,3),"MSG")||Ia.g(k.resolve(547),c),c=c.substr(3),e)this.o.lg(c,a,d,b);else if(this.Bc())if(39==a)for(a=parseInt(d),b=parseInt(b),a=b-a+1;a<=b;a++)this.o.kg(c,
a);else 38==a?this.o.kg(c,b):0>=a?this.o.Bq(c,a,d,b):this.o.lg(c,a,d,b)},Aa:function(a,b,c,d,e){null!=c&&isNaN(c)?this.hF(a,b,c,d,e):null!=c?this.Ed(null,b)&&this.o.Mq(c,a,d):this.Ed(b,null,null,!0)&&this.o.wB(a,d)},VE:function(a,b,c,d,e,f,h){this.Ed(null,4==a||5==a||9==a?null:b)&&(4==a?this.o.Aq(c,b):5==a?this.Bc()&&this.o.Dq(c,b):8==a?this.Bc()&&this.o.fc(c):6==a?this.Bc()&&this.o.dd(c,d,e,f+1,h+1):9==a?this.Bc()&&this.o.Wh(c,b,d):Ia.a(k.resolve(548),a))},Iq:function(a){this.o.Iq(a)},fF:function(a,
b){this.Bc()&&this.o.kF(a,b)},eF:function(a,b){this.Bc()&&this.o.mF(a,b)},dF:function(a){this.Bc()&&this.o.oF(a)}};qb.prototype={me:function(a){a?this.sd():x.u(this.og,this.rf+Number(this.dh.rg),this)},og:function(){this.ou||this.Ge()||this.sd()},Ko:function(){this.ou=!0}};Bc.prototype={Ge:function(){return!this.$a.YD(this.Kd)},sd:function(){this.$a.ui(this.Kd,this.ij+1,this.rf)},Rj:function(){this.$a.fc(this.Kd)}};D(Bc,qb);var ye;for(ye in{me:!0})var Af=ye;ac.prototype={Ge:function(){return!this.$a.WD(this.Kd)},
sd:function(){this.$a.Ek(this.Kd,this.ij+1,this.rf)},me:function(a){a||this.$a.fJ(this.Kd);this._callSuperMethod(ac,Af,arguments)},Rj:function(){}};D(ac,qb);Ac.prototype={Ge:function(){return!this.$a.XD(this.Kd,this.Hw)},sd:function(){this.$a.wx(this.Kd,this.Hw,this.Uz,this.ij+1,this.rf)},Rj:function(){}};D(Ac,qb);var zb=k.s(p.Ic);Pa.prototype={toString:function(){return"[|PushPageCollectionHandler|]"},ud:function(){return this.jc},bh:function(a){return a==this.jc},eo:function(a){var b=this.J.Id;
b&&b.uC(this.J.o.Nb())>a&&zb.Pa(k.resolve(549))},Pt:function(){this.v={};for(var a in this.af)this.af[a]={}},Te:function(a){for(var b in this.aa)a(this.aa[b],b)},yw:function(a,b){this.aa[a]=b;this.af[a]={};this.Oe++;this.xo.ka("clientsCount",this.Oe);zb.a(k.resolve(550),this);a!==p.Ls&&(this.BA.ep(function(c,d){b.Tj("ConnectionDetails",c,d)}),this.options.ep(function(c,d){b.Tj("ConnectionOptions",c,d)}),this.xo.ep(function(c,d){b.Tj("Configuration",c,d)}),b.ec(this.J.Ob()),this.Cc?b.dc(this.jc):b.mg(this.jc))},
Aw:function(a){zb.a(k.resolve(551),this,a);if(this.aa[a]){var b=this.af[a],c;for(c in b)this.ax(c);this.aa[a].ca();delete this.aa[a];delete this.af[a];this.Oe--;this.xo.ka("clientsCount",this.Oe)}},We:function(a){a=this.v[a];return a?this.uh(a.bf):(zb.a(k.resolve(552)),null)},uh:function(a){return this.aa[a]?this.aa[a]:(zb.a(k.resolve(553)),null)},JE:function(a){this.Te(function(b){b.ec(a)});return!0},dc:function(){this.Pt();this.Cc=!0;var a=++this.jc;this.Te(function(b){b.dc(a)})},mg:function(){this.Pt();
this.Cc=!1;var a=++this.jc;this.Te(function(b){b.mg(a)})},dd:function(a){this.v[a]&&(this.v[a].Uq=!1)},Vh:function(a){this.fc(a)},WD:function(a){return this.v[a]?this.v[a].Uq&&!this.v[a].Dm:!1},fJ:function(a){this.v[a]&&(this.v[a].xx=!0)},fc:function(a){if(this.v[a]){var b=this.v[a].bf;delete this.v[a];this.af[b]&&delete this.af[b][a]}},YD:function(a){return this.v[a]?this.v[a].xx&&this.v[a].Dm:!1},XD:function(a,b){return this.v[a]?this.v[a].Tq&&this.v[a].ak==b:!1},JF:function(a,b){this.v[a]&&b==
this.v[a].ak&&(this.v[a].Tq=!1)},gD:function(a,b){if(this.aa[a]&&this.J.Wp()){var c=G.$v();this.af[a][c]=!0;b=this.XB(b,c);this.v[c]=new gf(a,b.add,b.remove);zb.a(k.resolve(555));this.Ek(c,1);return c}N.ia();zb.g(k.resolve(554),this,a)},Ek:function(a,b,c){this.v[a]&&(3<=b&&this.eo(1),this.v[a].Uq=!0,c=new ac(this.options,a,this,b,c),this.J.o.lH(a,this.v[a].xz,this,2<=b,c))},ax:function(a){this.v[a]&&!this.v[a].Dm&&this.ui(a,1)},ui:function(a,b,c){if(this.v[a]){3<=b&&this.eo(1);this.v[a].Dm=!0;c=new Bc(this.options,
a,this,b,c);var d=this.v[a].wA;d.LS_reqId=G.le();this.J.o.nH(a,d,this,2<=b,c)}},Ee:function(a,b){if(this.v[a]){var c=++this.v[a].ak;this.wx(a,c,b,1)}},wx:function(a,b,c,d,e){if(this.v[a]&&this.v[a].ak==b){3<=d&&this.eo(1);this.v[a].Tq=!0;var f=this.v[a].ak;b=G.xb({LS_subId:a,LS_op:"reconf",LS_reqId:G.le()},c);c=new Ac(this.options,a,f,this,c,d,e);this.J.o.mH(a,b,c)}},GE:function(){this.Te(function(a){a.tw()})},ew:function(a){var b=this.aa;this.aa={};for(var c in b)b[c].Th(a)},KE:function(a,b){this.Te(function(c){c.Uh(a,
b)})},ca:function(){x.pf(this.cA);V.fr(this);V.Mm(this)},uf:function(){this.ew(!1)},Zq:function(){this.GE()},Tt:function(){var a=this;this.Te(function(b,c){b.ping().then(function(){},function(){a.Aw(c)})})},XB:function(a,b){b={LS_subId:b};G.xb(a,b);return{add:G.xb(a,{LS_op:"add",LS_reqId:G.le()}),remove:G.xb(b,{LS_op:"delete",LS_reqId:G.le()})}},Bd:function(){this.Te(function(a){a.Bd()})}};Pa.prototype.onPushPageLost=Pa.prototype.Aw;Pa.prototype.onNewPushPage=Pa.prototype.yw;Pa.prototype.unloadEvent=
Pa.prototype.uf;Pa.prototype.preUnloadEvent=Pa.prototype.Zq;var ze=ia.Ev(1.5,!0)?10:50,Ic=ze,Qb=0,ib=0,Ab=0,nd=null,Jc=null,od=null,Bf=k.s(p.md),Na={wd:function(){Ic=ze;Ab=ib=Qb=0;od=Jc=nd=null},iD:function(){nd=Qb;Jc=ib;od=Ab;var a=I.Na();Ab||(Ab=a);6E4<=a-Ab&&(Qb=0,Ab=a);ib&&1E3>a-ib&&Qb++;ib=a},ii:function(){Jc!=ib&&(Qb=nd,ib=Jc,Ab=od)},Ht:function(){if(0!=ib){if(!Ic)return!1;if(Qb>=Ic)return Bf.g(k.resolve(556)),Ic=0,!1}return!0}},gc={ih:"encodeRequest",ul:"encodeUnqRequest"};gc=G.Ya(gc);Ib.prototype=
{toString:function(){return"[WSEncoder]"},qp:function(a){return a.length+2},rh:function(){return""},ih:function(a,b,c){b=this.xu(b,c);return this._callSuperMethod(Ib,gc.encodeRequest,[a,b,c])},ul:function(a,b,c,d){b=this.xu(b,d);return this._callSuperMethod(Ib,gc.encodeUnqRequest,[a,b,c,d])},tl:function(a,b,c,d){return this._callSuperMethod(Ib,gc.encodeRequest,[a,d,c])},xu:function(a,b){var c=this.JJ.ju;null==c?a=G.xb(a,{LS_session:b}):Y.ra(c,b,"Unexpected session ID");return a}};D(Ib,cd);var pd=
k.s(p.md),ka=k.s(p.Jc),Cc=null;L.cg()&&(Cc=null);var gd=p.Xs+".lightstreamer.com",hf=1;null==ja.name&&(ja.name="WebSocketConnection");var Rb=!1,hc={};ja.gj=function(a){a?hc[a]=!0:Rb=!0};ja.kx=function(a){a?delete hc[a]:(Rb=!1,hc={})};ja.BD=function(){for(var a in hc)return!0;return Rb};ma.Ud(ja,{Qb:function(a){if(Rb||a&&hc[a])return!1;a=null;"undefined"!=typeof WebSocket?a=WebSocket:"undefined"!=typeof MozWebSocket&&(a=MozWebSocket);return a&&2==a.prototype.CLOSED?!1:Cc||a},nb:!0,mb:function(){return!L.Rb()||
"https:"!=location.protocol},Td:function(){return!0},Ke:!1,Bh:!0,Wd:!1});ja.prototype={toString:function(){return["[|WebSocketConnection",this.K,this.Db,this.wl,this.Up(),"]"].join("|")},Wa:function(){if(this.Hb){ka.a(k.resolve(558));this.Db=null;if(this.Hb)try{this.Hb.close(1E3)}catch(a){ka.a(k.resolve(559),a)}this.Cb()}},UF:function(a,b,c,d,e){if(this.K)ka.g(k.resolve(560));else if(Rb)return!1;this.Cd=!1;this.vk=a.Lc;this.Db=b;try{this.Hb=jf(this.vk)}catch(h){return ka.a(k.resolve(561),h),!1}pd.h()&&
pd.debug("Status timeout in "+this.kn.Ue()+" [currentConnectTimeoutWS]");x.u(this.VF,this.kn.Ue(),this,[this.Db]);var f=this;this.Hb.onmessage=function(h){f.Gq(h,b,c)};this.Hb.onerror=function(){f.$E(b,d)};this.Hb.onclose=function(h){f.UE(h,b,e,d)};this.Hb.onopen=function(){if(L.cg()){var h=f.Hb.headers;h["set-cookie"]&&G.aG(h["set-cookie"])}f.tF(b)};return!0},VF:function(a){if(a==this.Db&&this.Hb&&!this.Pq)try{pd.a(k.resolve(562)),this.kn.l.Np(),this.Hb.close(1E3)}catch(b){ka.a(k.resolve(563))}},
gb:function(a,b){if(this.K)return ka.g(k.resolve(564)),null;if(Rb)return!1;this.zm=a;this.wl=b;ka.a(k.resolve(565),a.ag());this.Up()&&this.rx(b);return!0},yD:function(a){return N.la(this.vk)?0==this.vk.indexOf(a):(ka.g(k.resolve(566)),!1)},Up:function(){return null!=this.Hb&&1==this.Hb.readyState},Ii:function(a,b){if(!this.Up())return null;b&&this.gy(b);ka.h()&&ka.a(k.resolve(567),this.va,a.getFile(),a.getData());try{this.Hb.send(a.getFile()+"\r\n"+a.getData())}catch(c){return ka.g(k.resolve(568),
c),!1}return!0},rx:function(a){var b=this.Ii(this.zm,a);N.la(null!==b)||ka.g(k.resolve(569),a);b&&(this.K=!0,this.kn.mB(this.Db))},gy:function(a){this.wl=a},Gq:function(a,b,c){this.Db!=b||V.Za()||(ka.h()&&ka.a(k.resolve(570),this.va,a.data),this.Xh=!0,x.ha(c,[a.data,this.wl]))},$E:function(a,b){this.Db!=a||V.Za()||(ka.g(k.resolve(571),this.va),this.Cd|=!this.Xh,x.ha(b,["wsc.unknown",this.Db,!0,this.Cd,!1]))},tF:function(a){this.Db!=a||V.Za()||(this.Pq=!0,ka.a(k.resolve(572)),this.zm&&this.rx())},
UE:function(a,b,c,d){this.Db!=b||V.Za()||(a=a?a.code:-1,ka.a(k.resolve(573),a,this.Xh),1E3==a||1001==a?(x.Wv(c,[this.Db,!0]),x.Vg(c,300),this.Cb()):1011==a?(this.Cd|=!this.Xh,c=this.Db,this.Cb(),x.ha(d,["wsc.server",c,!0,this.Cd,!0])):(this.Cd|=!this.Xh,c=this.Db,this.Cb(),x.ha(d,["wsc."+a,c,!0,this.Cd,!1])))},Cb:function(){this.Pq=this.K=!1;this.zm=this.Db=null;this.Xh=!1;this.vk=this.Hb=null},Wf:function(){return this.KJ},NH:function(a){ka.h()&&ka.a(k.resolve(574),a+" on WS connection oid="+this.va);
this.ju=a}};D(ja,ma);zc.prototype={Ge:function(){return!this.j.bh(this.oz)},sd:function(){this.j.Fl(this.Zy)},eC:function(){return this.dh.El},Rj:function(){}};D(zc,qb);bd.prototype={tD:function(){return this.Tb?-1!=this.ed:-1==this.ed},tA:function(){this.Tb=!1;this.ed=-1},uA:function(a,b){b.Tb?a?(this.Tb=!0,this.ed=b.ed):(this.Tb=!1,this.ed=-1):a?(this.Tb=!0,this.ed=Date.now()):(Y.assert(-1==b.ed,"Recovery error (4)"),this.Tb=!1,this.ed=-1)},hH:function(){this.Tb=!1;this.ed=-1},en:function(a){return this.Tb?
(Y.assert(-1!=this.ed,"Recovery error (5)"),a-(Date.now()-this.ed)):a}};var Kc=[,"OFF","CREATING","CREATED","FIRST_PAUSE","FIRST_BINDING","PAUSE","BINDING","RECEIVING","STALLING","STALLED","SLEEP"],M=k.s(p.md),ta=k.s(p.Mg),bf=1;U.xn=1;U.yf=2;U.Ds=3;U.Gs=4;U.Fs=5;U.sy=7;U.Py=8;U.QJ=9;U.TJ=10;U.Ly=6;U.un=11;U.prototype={reset:function(){M.h()&&M.a(k.resolve(577),this.va);this.Yg=0;this.sessionId=this.hf=null;this.wk=this.Pc=0;this.ri=this.Jd=this.Qn=!1;this.Yr="";this.df=this.ze=!1},ei:function(){},
Nc:function(a){M.h()&&M.a(k.resolve(578),this.va,Kc[this.b],"->",Kc[a]);this.b=a;this.ab++;a=this.ab;this.m.UI(this.U);return a==this.ab},Gj:function(){this.bb++},bh:function(a){return this.bb==a},sp:function(){var a=this.b;return 1==a?p.Jg:11==a?this.df?p.Ys:p.vn:2==a?this.ic.Tb?p.Ys:p.CONNECTING:3==a||4==a||5==a?p.Cs+this.Su():10==a?p.Ry:p.Cs+this.Ou()},K:function(){return 1!=this.b&&2!=this.b&&11!=this.b},QD:function(){return 3==this.b||8==this.b||9==this.b||10==this.b},UD:function(){return!this.ja},
Nb:function(){return null==this.hf?this.yr:this.hf},Wc:function(){return this.sessionId},createSession:function(a,b,c){this.uk=c;a=1!=this.b&&11!=this.b?!1:!0;if(!Na.Ht())return M.a(k.resolve(579),this),this.kb("mad",a,!0),!1;0==a&&(M.a(k.resolve(580),this),this.kb("new."+(b||""),!1,!1));M.i(k.resolve(581),this);this.reset();this.Nw();this.tb.ka("sessionId",null);this.tb.ka("serverSocketName",null);this.tb.ka("serverInstanceAddress",null);this.yr=this.tb.tk;this.Lp=this.l.zr;this.Gj();return!0},Mf:function(){if(!Na.Ht())return this.kb("madb",
!1,!0),!1;this.Yg++;N.la(6==this.b||4==this.b||1==this.b)||M.g(k.resolve(582));if(1==this.b){if(!this.Nc(4))return!1;this.Nw()}this.Cj(!0);this.Gj();this.ja?M.a(k.resolve(583),this):M.i(k.resolve(584),this);return!0},zb:function(){return 3==this.b||5==this.b||7==this.b||8==this.b||9==this.b||10==this.b},dx:function(a,b,c){this.U=a;this.Jd||(M.a(k.resolve(585),this),this.ze=!1,2==this.b||11==this.b||1==this.b?(M.g(k.resolve(586)),this.m.fh(this.U,b,c)):6==this.b||4==this.b?this.m.$r(this.U,b,c):(this.Jd=
!0,this.ri=c,this.Yr=b,this.Fl(b)))},dH:function(a){this.U=a;this.ze||(M.a(k.resolve(587),this),N.la(2!=this.b&&11!=this.b&&1!=this.b)||M.g(k.resolve(588)),6==this.b||4==this.b?this.m.Tx(this.U):(this.ze=!0,this.Fl("slow")))},Nw:function(){1!=this.b&&11!=this.b||this.Dc.jG();this.ja&&this.Tc&&this.Dc.hx()},Cj:function(a){this.b!=U.xn&&this.b!=U.yf&&this.b!=U.un&&(0<this.l.hi?this.$.SI(this.l.hi,a):this.$.YI(a))},kb:function(a,b,c){M.i(k.resolve(589),this,a);1!=this.b&&2!=this.b&&11!=this.b?(this.m.xm(this.Nb()),
b||this.jH(a),this.U=this.m.ob(this.U,c),this.tb.ka("sessionId",null),this.tb.ka("serverSocketName",null),this.tb.ka("serverInstanceAddress",null)):this.U=this.m.ob(this.U,c);this.Ag(!c)},fH:function(){this.l.gx(this.l.gi);this.l.ex(this.l.gi)},Ag:function(a){this.Gj();this.reset();this.Nc(a?11:1);if(1==this.b&&this.Oq)try{window.removeEventListener("online",this.Oq)}catch(b){}M.a(k.resolve(590),this)},KA:function(a){if(this.Nc(3==this.b?4:6)){this.Gj();var b=a;this.ja&&(a>=this.l.rg||this.l.ka("pollingInterval",
a),b=this.AC());4!=this.b&&b&&0<b?(M.a(k.resolve(591)),this.Oa("pause",b)):this.og("noPause",this.ab)}},og:function(a,b,c,d){b==this.ab&&(M.h()&&M.a(k.resolve(592),a,Kc[this.b],"sid",this.sessionId,"cause=",d,"preparingRecovery=",this.df),a="timeout."+this.b+"."+this.Yg,11==this.b&&d&&(a=d),2==this.b?(c=this.ic.en(this.l.li),this.ic.Tb&&0<c?(M.h()&&M.a(k.resolve(593),c),this.l.Np(),this.m.hk(this.U,a,this.Tc)):(M.a(k.resolve(594)),this.kb("create.timeout",!0,!1),this.l.Np(),this.Oa("zeroDelay",0,
"create.timeout"))):3==this.b||7==this.b||10==this.b||11==this.b?this.ze||this.Jd?(M.a(k.resolve(595)),this.m.fh(this.U,a+".switch",this.ri)):!this.ja||this.Tc?this.df?(M.a(k.resolve(596)),this.m.hk(this.U,a,this.Tc)):(M.a(k.resolve(597)),this.m.lx(this.U,a,this.Tc,this.uk)):(M.a(this.df?"Timeout: switch transport from polling (ignore recovery)":"Timeout: switch transport from polling"),this.m.fh(this.U,a,!1)):5==this.b?(this.xi--,this.ze||this.Jd?this.m.fh(this.U,a+".switch",this.ri):0<this.xi||
this.Tc?this.m.lx(this.U,a,this.Tc,this.uk):this.ja?this.m.fh(this.U,a+".switch",this.ri):this.cd(this.U,a)):6==this.b?(this.ja&&this.Dc.lJ(c),this.Mf("loop")):4==this.b?this.Mf("loop1"):8==this.b?this.pJ():9==this.b?this.oJ():M.Pa(k.resolve(598),this))},Mr:function(){return this.Tc||this.m.Mr()},cd:function(a,b){var c=this.Mr();c&&this.kb("giveup",1!=this.b&&11!=this.b?!1:!0,!0);this.m.cd(a,b,c)},uB:function(a){var b="",c;for(c in a)b+=c+"="+a[c]+" ";return b},Aa:function(a,b){b=b||{};var c=b.Of,
d=b.gG,e=b.gs,f=b.nK,h=b.gk,g=this.ic.en(this.l.li);M.h()&&M.a(k.resolve(599),Kc[this.b],"reason="+a,"sid="+this.sessionId,"timeLeft="+g,"isRecoveryDisabled="+this.am,this.uB(b));b=e&&0<g;if(8==this.b||10==this.b||9==this.b||7==this.b||6==this.b)b&&!this.am?(M.a(k.resolve(600)),this.df=!0,this.Nc(11),this.Oa("firstRetryMaxDelay",I.Gd(this.l.Bl),a)):(M.a(k.resolve(601)),this.kb(a,c,!1),d?this.Oa("currentRetryDelay",this.Un(),a):h?this.Oa("reconnectMaxDelay",Math.ceil(Math.random()*h),a):this.Oa("firstRetryMaxDelay",
I.Gd(this.l.Bl),a));else if(2==this.b||3==this.b||5==this.b)this.ic.Tb&&0<g&&!c?(M.a(k.resolve(602)),this.df=!0,this.Nc(11),this.Oa("currentRetryDelay",this.Un(),a),this.l.sv()):this.Jd&&!this.Tc||ia.Zl()?(M.a(k.resolve(603)),this.m.fh(this.U,this.Yr+".error",this.ri)):(d=c?"closed on server":"socket error",M.a(k.resolve(604),d),this.kb(a,c,!1),f?(this.Oa("zeroDelay",0,a),this.l.jD()):c?h?this.Oa("reconnectMaxDelay",Math.ceil(Math.random()*h),a):this.Oa("zeroDelay",0,a):this.ic.Tb&&0>=g?this.Oa("zeroDelay",
0,a):(this.Oa("currentRetryDelay",this.Un(),a),this.l.sv()))},zq:function(a){this.wb&&this.wb.AB&&this.wb.AB();8==this.b||9==this.b||10==this.b||3==this.b?this.Jd?this.m.$r(this.U,this.Yr,this.ri):this.ze?this.m.Tx(this.U):this.KA(a):(N.ia(),M.g(k.resolve(605),this))},Qa:function(){2==this.b?this.Nc(3)&&this.nJ():3!=this.b&&(7==this.b||5==this.b||9==this.b||10==this.b||8==this.b?this.Nc(8)&&this.qJ():(N.ia(),M.g(k.resolve(606),this)))},ql:function(){Na.iD();this.wg=I.Na();N.la(1==this.b||11==this.b)||
M.g(k.resolve(607));if(!this.Nc(2))return!1;this.Oa("currentConnectTimeout",this.Ue());this.wb=this.m.np()},Qi:function(){this.wg=I.Na();N.la(6==this.b||4==this.b)||M.g(k.resolve(608),this);if(!this.Nc(6==this.b?7:5))return!1;this.uk=!1;this.Oa("bindTimeout",this.KB());this.wb=this.m.np()},Oa:function(a,b,c){M.h()&&M.a(k.resolve(609),b,a);return x.u(this.og,b,this,[a,this.ab,b,c])},qJ:function(){if(0<this.l.Eh){var a=I.Na();50>a-this.Ov&&this.cq?x.Xv(this.cq,1,this.ab):(this.Ov=a,this.cq=this.Oa("keepaliveInterval",
this.l.Eh))}},pJ:function(){this.Nc(9)&&this.Oa("stalledTimeout",this.l.$m)},oJ:function(){this.Nc(10)&&(this.df=0<this.ic.en(this.l.li)&&!this.am,this.Oa("reconnectTimeout",this.l.ef))},nJ:function(){N.ra(this.b,3)||M.g(k.resolve(610));this.Oa("stalledTimeout",this.l.$m)},KB:function(){return this.ja?this.Ue()+this.l.Ul:0<this.xi&&null!=this.ef?this.ef:this.Ue()},AC:function(){if(4==this.b)return this.l.rg;var a=this.l.rg;if(this.wg){var b=I.Na()-this.wg;a=a>b?a-b:0}return a},Un:function(){var a=
I.Na()-this.wg,b=this.l.Zd;return a>b?0:b-a},Rz:function(){this.wg||(N.ia(),M.g(k.resolve(611),this),this.ef=null);var a=I.Na()-this.wg,b=this.Ue();this.ef=(a>b?b:a)+b},GF:function(a,b){!V.Za()&&this.bh(b)&&""!==a&&(null==a?(Na.ii(),this.Aa("nullresp")):this.wb.gt(b,a))},Kq:function(a,b,c,d,e){!V.Za()&&this.bh(b)&&(Na.ii(),this.Aa("failure."+a,{ip:c,ay:d,gG:e,gs:!0}))},Jq:function(a,b){this.oK&&11==this.b||!this.bh(a)||(Na.ii(),this.Aa("wrongend",{ip:b,gs:!0}))},VA:function(){this.Aa("eval")},DF:function(){this.Jd||
this.ze||this.m.EF(this.U)},MF:function(){ta.h()&&ta.a(k.resolve(612));this.Qa();8==this.b&&(this.xi=1)},AF:function(a){ta.h()&&ta.a(k.resolve(613),a);this.wk=a;this.l.ka("realMaxBandwidth","unmanaged"==a?"unlimited":a)},YE:function(){ta.h()&&ta.a(k.resolve(614));this.Aa("error41",{Of:!0})},bF:function(){ta.h()&&ta.a(k.resolve(615));this.Qa();this.m.Bd()},sF:function(a,b,c,d){ta.h()&&ta.a(k.resolve(616));var e=this.Nb(),f=e;null==b||this.Lp||(f=b=Ma.jA(f,b));this.hf=f;e!=this.hf&&(this.m.xm(e),this.m.Eq(this.hf));
d&&(this.ja?this.l.ka("idleTimeout",d):this.l.ka("keepaliveInterval",d));2==this.b?(null!=this.sessionId&&this.sessionId!=a&&(M.i(k.resolve(617),a,this.sessionId),this.reset()),this.sessionId=a):(N.ra(this.sessionId,a)||M.g(k.resolve(618)),this.Rz());this.Dc.TI(this.ja);this.tb.ka("sessionId",a);this.tb.ka("serverInstanceAddress",this.hf);this.Qa();3==this.b?this.ic.Tb?this.ic.hH():(this.m.dc(c),this.Qn&&(this.kl(),this.Qn=!1)):(this.m.kw(c),this.m.Wj(),this.Wj())},wq:function(a){a&&(this.m.wq(a),
this.tb.ka("clientIp",a))},LF:function(a){ta.h()&&ta.a(k.resolve(619));this.Dc.iJ(a);this.Qa()},cF:function(a){ta.h()&&ta.a(k.resolve(620));this.zq(a)},Xj:function(a){this.Cw(a)},wB:function(a,b){if(a===this.l.ik.sE)this.iF();else switch(a){case 20:this.Xj("syncerror");break;case 4:this.Xj("recovery.error");break;case 5:this.Ha(a,b);break;case 40:case 41:case 48:this.Cw("error"+a);break;default:this.Ha(a,b)}},xB:function(a,b,c){if(20==a)this.Xj("syncerror");else if(11==a||65==a||67==a)11==a?this.Ha(21,
b):this.Ha(a,b);else if(null!=c)try{c()}catch(d){this.m.Ha(d)}else ta.Lv()&&ta.Pa(k.resolve(621),a,b)},vB:function(a,b){this.Ha(a,b)},iF:function(){Na.ii();this.Aa("metadata.adapter.disconnected",{Of:!0,gk:this.l.ik.gk})},Cw:function(a){Na.ii();this.Aa(a,{Of:!0})},Lo:function(){Na.ii();this.Aa("remote.adapter.disconnected",{gk:this.l.ik.gk})},Ha:function(a,b){this.Uh(a,b)},rw:function(a){ta.h()&&ta.a(k.resolve(622),a);this.kb("end",!0,!0)},Fq:function(){this.am=!0},Nq:function(a,b){this.Qa();this.m.Nq(a,
b)},ig:function(a){this.Qa();this.m.ig(a)},gg:function(a){this.Qa();this.m.gg(a)},jg:function(a){this.Qa();this.m.jg(a)},Aq:function(a,b){this.Qa();this.m.Aq(a,b)},Dq:function(a,b){this.Qa();this.m.Dq(a,b)},Bq:function(a,b,c,d){this.Qa();this.m.Bq(a,b,d,c)},kg:function(a,b){this.Qa();this.m.kg(a,b)},lg:function(a,b,c,d){this.Qa();this.m.lg(a,b,d,c)},Mq:function(a,b,c){this.Qa();this.m.Mq(a,b,c)},Uh:function(a,b){this.rw(b);this.m.Uh(a,b)},fc:function(a){this.Qa();this.m.fc(a)},dd:function(a,b,c,d,
e){this.Qa();this.m.dd(a,b,c,d,e)},Wh:function(a,b,c){this.Qa();this.m.Wh(a,b,c)},qw:function(){this.Pc++},Fl:function(a){M.i(k.resolve(623),this);var b=Ma.gC(a,this.Dc.Kl()),c=new zc(a,this,this.bb,this.l);this.$.Wb(this.sessionId,b,F.qn,c,null,{bd:function(){},ad:function(d,e,f,h){c.Ko();M.g(k.resolve(624)+f+" "+h+" - The error will be silently ignored.")}})},jH:function(a){M.i(k.resolve(625),this);a=Ma.$B(this.sessionId,a);this.hp(this.sessionId,a,F.Ig,null,this.Nb(),{bd:function(){},ad:function(b,
c,d,e){M.g(k.resolve(626)+d+" "+e+" - The error will be silently ignored.")}})},kl:function(){if(1!=this.b&&11!=this.b)if(2==this.b)this.Qn=!0;else if("unmanaged"!=this.wk){var a=Ma.VB(this.l);this.$.Wb(null,a,F.pn,null,null,{bd:function(){},ad:function(b,c,d,e){M.g(k.resolve(627)+kf(a)+" caused the error: ",d,e)}})}},Iq:function(a){this.tb.ka("serverSocketName",a)},Wj:function(){this.fH()},hp:function(){throw Error("abstract method");},kF:function(a,b){this.c.H.Vj(a,b)},jF:function(a,b){this.c.H.Uj(a,
b)},mF:function(a,b){this.c.H.Lq(a,b)},lF:function(a,b,c){this.c.H.ng(a,b,c)},oF:function(a){this.c.H.Yj(a)},nF:function(a,b,c){this.c.H.te(a,b,c)},Ue:function(){return this.l.sc}};yc.prototype={Au:function(a,b){if(b)b=a.length;else{b=a.lastIndexOf("\r\n");if(0>b)return null;b+=2}a=a.substring(this.Pw,b);this.Pw=b;return a},Ur:function(a){return this.Au(a,!1)},Tr:function(a){return this.Au(a,!0)}};var za=k.s(p.Jc),Cf=L.Rb()?2:3,qd=!0,Lc;L.cg()&&(Lc=null);var lf=1;null==Fa.name&&(Fa.name="XSXHRConnection");
var $a=null;ma.Ud(Fa,{Qb:function(){if(null!==$a)return $a;ia.ie(9,!0)?$a=!1:"undefined"!=typeof XMLHttpRequest?"undefined"!=typeof(new XMLHttpRequest).withCredentials?$a=!0:L.KD()&&($a=!0):!L.Rb()&&Lc&&($a=!0);null===$a&&($a=!1);return $a},Bh:function(){return!ia.Ze()&&!ia.Fv()},nb:!0,mb:!0,Td:function(){return L.cg()?!0:"file:"!=p.Ci?!0:L.ua()?!1:!0},Ke:!1,Wd:!0});Fa.prototype={toString:function(){return["[|XSXHRConnection",this.K,this.Y,this.od,"]"].join("|")},Wa:function(){if(this.K){za.h()&&
za.a(k.resolve(629),this.va);this.Y=null;if(this.wa)try{this.wa.abort()}catch(a){za.a(k.resolve(630))}this.Cb()}},gb:function(a,b,c,d,e){if(this.K)return null;this.wa=Lc?new Lc:new XMLHttpRequest;this.Ac=new yc;c=x.Ta(this.Gq,this,[b,c,e,d]);this.wa.onreadystatechange=mf(c);this.Y=b;this.od=null;za.h()&&za.a(k.resolve(631),this.va,a.getFile(),a.getData());try{this.wa.open(a.Sg,a.ag(),!0);this.wa.withCredentials=a.du;var f=a.Yo;if(f)for(var h in f)this.wa.setRequestHeader(h,f[h]);this.wa.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");this.wa.send(a.getData());this.K=!0}catch(g){return za.g(k.resolve(632),this.va,g),!1}return!0},Gq:function(a,b,c,d){this.Y!=a||V.Za()||(a=null,this.zh()&&b&&(3==this.wa.readyState?a=this.Ac.Ur(this.wa.responseText):4==this.wa.readyState&&(a=this.Ac.Tr(this.wa.responseText)),za.h()&&a&&za.a(k.resolve(633),this.va,a),null!=a&&x.ha(b,[a,this.Y])),4==this.wa.readyState&&(this.zh()||(this.Sr?(d&&(za.h&&za.a(k.resolve(634),this.va),x.ha(d,["status0",this.Y,!1,qd,!1])),
qd=!qd,this.Sr=!1):b&&x.ha(b,[null,this.Y])),za.h&&za.a(k.resolve(635),this.va),4!=this.wa.readyState&&""!=a||!c||x.u(this.Ph,100,this,[this.Y,c]),this.Cb()))},Ph:function(a,b){x.ha(b,[a])},Cb:function(){this.K=!1;this.Y=null;this.wa&&(delete this.wa.onreadystatechange,delete this.wa)},zh:function(){try{if(null===this.od){if(this.wa.readyState<Cf)return!1;this.od=200<=this.wa.status&&299>=this.wa.status;0==this.wa.status&&(this.Sr=!0)}return this.od}catch(a){return za.a(k.resolve(636),this.va,a),
!1}}};D(Fa,ma);var ab=k.s(p.Jc);null==Ca.name&&(Ca.name="IEXSXHRConnection");var rd=null;ma.Ud(Ca,{Qb:function(){return null!==rd?rd:rd="undefined"!=typeof XDomainRequest?!0:!1},Bh:!0,nb:!0,mb:!1,Td:!1,Ke:!1,Wd:!1});Ca.prototype={toString:function(){return["[|IEXSXHRConnection",this.K,this.Y,"]"].join("|")},Wa:function(){if(this.K){ab.a(k.resolve(637));this.Y=null;if(this.fb)try{this.fb.abort()}catch(a){ab.a(k.resolve(638))}this.Cb()}},gb:function(a,b,c,d,e){if(this.K)return null;this.Gm=0;this.fb=
new XDomainRequest;this.Ac=new yc;e=x.Ta(this.gH,this,[b,c,e]);var f=x.Ta(this.zt,this,[b,d,"xdr.err"]);d=x.Ta(this.zt,this,[b,d,"xdr.timeout"]);c=x.Ta(this.Qw,this,[b,c,!1]);this.fb.onload=Dc(e);this.fb.onerror=Dc(f);this.fb.ontimeout=Dc(d);this.fb.onprogress=Dc(c);this.Y=b;ab.h()&&ab.a(k.resolve(639),a.getFile(),a.getData());try{this.fb.open(a.Sg,a.ag()),this.fb.send(a.getData()),this.K=!0}catch(h){return ab.g(k.resolve(640),h),!1}return!0},zt:function(a,b,c){this.Y!=a||V.Za()||(ab.a(k.resolve(641)),
x.ha(b,[c,a,!1,0==this.Gm,!1]))},Qw:function(a,b,c){this.Y!=a||V.Za()||(this.Gm++,b&&(a=c?this.Ac.Tr(String(this.fb.responseText)):this.Ac.Ur(String(this.fb.responseText)),ab.h()&&ab.a(k.resolve(642),a),null!=a&&x.ha(b,[a,this.Y])))},gH:function(a,b,c){this.Y!=a||V.Za()||(this.Qw(a,b,!0),this.Cb(),ab.a(k.resolve(643)),c&&x.u(this.Ph,100,this,[c,a]))},Ph:function(a,b){x.ha(a,[b])},Cb:function(){this.K=!1;this.Ac=this.Y=null;this.Gm=0;this.fb&&(this.fb.onload=null,this.fb.onerror=null,this.fb.ontimeout=
null,this.fb=this.fb.onprogress=null)}};D(Ca,ma);ma.Ud(pb,{Qb:!1,nb:!1,mb:!1,Td:!1,Ke:!1,Wd:!1});pb.prototype={gb:function(a,b,c){c&&x.u(this.me,1E3,this,[c,b]);return!0},me:function(a,b){x.ha(a,["",b])}};D(pb,ma);var Wa=function(){var a=ia.Tp()&&ia.$l(32,!0)?null:"about:blank",b={},c={fu:function(d,e){if(!L.ua())return null;var f=document.getElementsByTagName("BODY")[0];if(!f)return null;e=e||a;var h=document.createElement("iframe");h.style.visibility="hidden";h.style.height="0px";h.style.width=
"0px";h.style.display="none";h.name=d;h.id=d;ia.ie()||ia.Ze()?(h.src=e,f.appendChild(h)):(f.appendChild(h),h.src=e);try{if(h.contentWindow){try{h.contentWindow.name=d}catch(g){}b[d]=h.contentWindow;return b[d]}return document.frames&&document.frames[d]?(b[d]=document.frames[d],b[d]):null}catch(g){return null}},Ve:function(d,e,f){e&&!b[d]&&this.fu(d,f);return b[d]||null},Oo:function(d){if(b[d]){try{document.getElementsByTagName("BODY")[0].removeChild(document.getElementById(d))}catch(e){}delete b[d]}},
Zw:function(){for(var d in b)try{document.getElementsByTagName("BODY")[0].removeChild(document.getElementById(d))}catch(e){}b={}}};c.createFrame=c.fu;c.getFrameWindow=c.Ve;c.disposeFrame=c.Oo;c.removeFrames=c.Zw;V.Xg(c.Zw);return c}();ad.prototype={qp:function(){return 15},tp:function(a){return a?encodeURIComponent(a).length-a.length:0},ts:function(a){return"LS_querystring="+encodeURIComponent(a)}};D(ad,Xa);xc.prototype={toString:function(){return"[LegacyEncoder]"},rh:function(){return".html"},ts:function(a){return a}};
D(xc,ad);var Df=new xc,Mc=k.s(p.Jc);ma.Ud(ob,{Qb:function(){return L.ua()},nb:!0,mb:!0,Td:!0,Ke:!0,Wd:!1});ob.prototype={toString:function(){return["[|FormConnection",this.target,"]"].join("|")},Wa:function(){Mc.a(k.resolve(644));this.K=!1;this.hm++},gb:function(a,b,c,d){if(this.K)return null;this._callSuperMethod(ob,this.An,[a,b,c,d]);try{this.hm++;var e=this.CB();if(!e)return!1;Mc.h()&&Mc.a(k.resolve(645),a.getFile(),a.getData());e.fe.method=a.Sg;e.fe.target=this.target;e.fe.action=a.ag();e.Hm.value=
a.getData();e.fe.submit();x.u(this.xA,1E3,this,[e.fe,this.hm]);this.K=!0}catch(f){return Mc.g(k.resolve(646),f),!1}return!0},CB:function(){var a=document.getElementsByTagName("BODY")[0];if(!a)return null;var b={};b.fe=document.createElement("FORM");try{b.fe.acceptCharset="utf-8"}catch(c){}b.fe.style.display="none";b.Hm=document.createElement("INPUT");b.Hm.type="hidden";b.Hm.name="LS_querystring";b.fe.appendChild(b.Hm);a.appendChild(b.fe);return b},xA:function(a,b){a.parentNode.removeChild(a);b==this.hm&&
(this.K=!1)},Wf:function(){return Df}};D(ob,pb);var Ef=new xc,ic=k.s(p.Jc);ma.Ud(eb,{Qb:function(){return L.ua()},nb:!1,mb:!1,Td:!0,Ke:!0,Bh:!0,Wd:!1});eb.prototype={toString:function(){return["[|FrameConnection",this.K,this.target,this.Vd,this.Hl,"]"].join("|")},$y:function(a){a==this.Vd&&(this.Vd++,this.K&&(this.it(this.Vd,xa.vz),this.K=!1))},Wa:function(){ic.a(k.resolve(647));var a=++this.Vd;x.u(this.$y,0,this,[a])},it:function(a,b,c,d,e){if(a==this.Vd&&!V.$p()){this._callSuperMethod(eb,this.An,
[b,c,d,e]);this.Vd++;ic.h()&&ic.a(k.resolve(648),b.getFile(),b.getData());try{var f=Wa.Ve(this.target);if(null==f)return ic.g(k.resolve(649)),!1;f.location.replace(b.XC());this.K=!0}catch(h){return ic.g(k.resolve(650),h),!1}return!0}},eE:function(a,b,c,d){this.Hl||(this.Hl=new ob(this.target));this.Vd++;if(a=this.Hl.gb(a,b,c,d))this.K=!0;return a},gb:function(a,b,c,d){if(a.method==xa.Xk)return this.eE(a,b,c,d);var e=++this.Vd;x.u(this.it,0,this,[e,a,b,c,d]);return!0},Wf:function(){return Ef}};D(eb,
pb);var Ae=function(){function a(){this.Rp()}a.prototype={w:function(){},Rp:function(b){this.es=this.xh=0;this.timeout=b||5E3},DJ:function(b){b==this.es&&0>=this.xh&&this.w()},sl:function(){this.xh--;0>=this.xh&&x.u(this.DJ,this.timeout,this,[this.es])},fn:function(){this.es++;0>this.xh&&(this.xh=0);this.xh++}};a.prototype.touch=a.prototype.fn;a.prototype.dismiss=a.prototype.sl;a.prototype.clean=a.prototype.w;a.prototype.initTouches=a.prototype.Rp;return a}(),Bb=k.s(p.Jc),af=0,Sb={};$b.HB=function(a){Sb[a]||
(Sb[a]=new $b(a),Sb[a].gb(!1));return Sb[a]};$b.prototype={toString:function(){return["[|AjaxFrameHandler",this.status,"]"].join("|")},Mz:function(){var a=this;W.Da(this.fl,"LS_a",function(b){a.RE(b)},"A")},w:function(){this.status=-1;W.mo(this.fl,"LS_a","A");var a=this.path;Sb[a]&&delete Sb[a];Wa.Oo(this.Mb)},wd:function(a){this.Mi++;this.status=a?3:0},gb:function(a){if(-1!=this.status&&(Bb.a(k.resolve(651)),!this.uc())){this.wd(a);a=this.Mi;G.Av()&&Bb.a(k.resolve(652));var b="id="+this.fl+"&";G.Ip()||
(b+="domain="+G.Vf()+"&");b=new xa(this.path,"xhr.html",b);(new eb(this.Mb)).gb(b);x.u(this.yB,1E4,this,[a]);x.u(this.$C,2E3,this,[a])}},RE:function(){V.Za()||1==this.status||(Bb.a(k.resolve(653)),this.status=1)},yB:function(a){-1==this.status||this.Mi!=a||this.uc()||(Bb.a(k.resolve(654)),this.gb(!0))},$C:function(a){-1==this.status||this.Mi!=a||this.uc()||(Bb.a(k.resolve(655)),this.status=4)},disable:function(){this.status=-1;this.Mi++},uc:function(){return 1===this.status},vv:function(){return-1===
this.status||3===this.status||4===this.status},pH:function(a,b,c,d){if(this.vv())return!1;if(1!==this.status)return null;Bb.a(k.resolve(656),a);try{var e=!1!==Wa.Ve(this.Mb).sendRequest(a,b,c,d)}catch(f){e=!1,Bb.a(k.resolve(657),f)}!1===e&&this.disable();return e}};D($b,Ae,!0,!0);var Sa=k.s(p.Jc);null==Ka.name&&(Ka.name="XHRConnection");ma.Ud(Ka,{Qb:function(){return L.ua()&&(window.ActiveXObject||"undefined"!=typeof XMLHttpRequest)},nb:!1,mb:!1,Td:!0,Ke:!1,Wd:!0});Ka.prototype={toString:function(){return["[|XHRConnection",
this.K,this.b,this.Y,"]"].join("|")},gb:function(a,b,c,d,e){this.ke=$b.HB(a.Lc);if(this.ke.vv())return this.ke.sl(),!1;if(!this.ke.uc()||this.K)return null;this.ke.fn();this.Y=b;this.od=null;this.response=c;this.error=d;this.$t=e;this.b++;var f=this,h=this.b;this.LS_h=function(){f.Bw(h)};this.K=!0;Sa.h()&&Sa.a(k.resolve(658),a.getFile(),a.getData());return this.ke.pH(a.ag(),a.getData(),this,a.Yo)},Wa:function(){if(this.K){this.Cb();Sa.a(k.resolve(659));try{this.sender&&this.sender.abort&&this.sender.abort()}catch(a){Sa.g(k.resolve(660),
a)}this.ml()}},zh:function(){try{if(null===this.od){if(2>this.sender.readyState)return!1;this.od=200<=this.sender.status&&299>=this.sender.status}return this.od}catch(a){return Sa.a(k.resolve(661),a),!1}},Bw:function(a){V.Za()||a!=this.b||!this.sender||4!=this.sender.readyState&&"complete"!=this.sender.readyState||(a=null,this.zh()&&(a=this.sender.responseText,a=a.toString(),"/*"==a.substring(0,2)&&(a=a.substring(2,a.length-2))),Sa.h()&&Sa.a(k.resolve(662),a),this.response&&x.ha(this.response,[a,
this.Y]),x.u(this.Ph,100,this,[this.Y]),this.Cb(),this.ml())},Ph:function(a){x.ha(this.$t,[a])},ZE:function(){V.Za()||(this.ke.disable(),Sa.a(k.resolve(663)),this.Cb(),this.error&&x.ha(this.error,["xhr.unknown",this.Y,!1,!1,!1]),this.ml())},ml:function(){try{delete this.sender.onreadystatechange}catch(a){Sa.a(k.resolve(664),a)}try{delete this.sender}catch(a){Sa.a(k.resolve(665),a)}this.response=this.error=null;this.ke&&this.ke.sl()},Cb:function(){this.K=!1;this.b++}};D(Ka,ma);var jc=k.s(p.Jc);null==
Qa.name&&(Qa.name="XHRStreamingConnection");var sd=null;ma.Ud(Qa,{Qb:function(){return null!==sd?sd:sd=L.ua()?ia.ie()?!1:"undefined"!=typeof XMLHttpRequest?"undefined"!=typeof(new XMLHttpRequest).addEventListener:!1:!1},Bh:function(){return!ia.Ze()},nb:!1,mb:!1,Td:!0,Ke:!1,Wd:!0});Qa.prototype={toString:function(){return["[|XHRStreamingConnection",this.K,this.b,this.Y,"]"].join("|")},gb:function(a,b,c,d,e){a=this._callSuperMethod(Qa,this.An,[a,b,c,d,e]);jc.a(k.resolve(666));a&&(this.Ac=new yc);return a},
Bw:function(a){!V.Za()&&a==this.b&&this.sender&&(a=null,this.zh()&&this.response&&(3==this.sender.readyState?a=this.Ac.Ur(this.sender.responseText):4==this.sender.readyState&&(a=this.Ac.Tr(this.sender.responseText)),jc.h()&&jc.a(k.resolve(667),a),null!=a&&x.ha(this.response,[a,this.Y])),4==this.sender.readyState&&(!this.zh()&&this.response&&x.ha(this.response,[null,this.Y]),jc.h()&&jc.a(k.resolve(668)),4!=this.sender.readyState&&""!=a||!this.$t||x.u(this.Ph,100,this,[this.Y]),this.Cb(),this.ml()))}};
D(Qa,Ka);var Ga=k.s(p.Jc);oa.gK=function(){ja.Qb=cc};oa.hK=function(){Fa.Qb=cc;Ca.Qb=cc;Qa.Qb=cc;Ka.Qb=cc};oa.Vs=[];for(var td=[Fa,Ca,Qa],Nc=0;Nc<td.length;Nc++)td[Nc].Bh()&&oa.Vs.push(td[Nc]);oa.ty=[Fa,Ca,Ka];oa.Rs=[Fa,Ca,Ka];oa.tK=function(a){return a.La.prototype.me!=pb.prototype.me};oa.yh=function(a,b,c,d,e,f,h){Ga.h()&&Ga.a(k.resolve(669),b.name);if(!b.Qb(a))return Ga.a(k.resolve(670)),!1;if(c&&!b.nb())return Ga.a(k.resolve(671)),!1;if(d&&!b.Td())return Ga.a(k.resolve(672)),!1;if(e&&!b.mb())return Ga.a(k.resolve(673)),
!1;if(f&&!b.Wd())return Ga.a(k.resolve(674)),!1;if(a=h){a:{for(a=0;a<h.length;a++)if(h[a]==b){h=!0;break a}h=!1}a=!h}if(a)return Ga.a(k.resolve(675)),!1;Ga.h()&&Ga.a(k.resolve(676),b.name);return!0};oa.prototype={Jp:function(){return this.Em<this.jq.length-1},dv:function(a,b,c,d,e){for(Ga.h()&&Ga.a(k.resolve(677),"serverToUse",a,"isCrossSite",b,"areCookiesRequired",c,"isCrossProtocol",d,"hasExtraHeaders",e);this.Jp();){this.Em++;var f=this.jq[this.Em];if(!((this.Bt||this.Qz)&&f===Ca||this.Bt&&f===
Fa)&&this.yh(a,f,b,c,d,e))return f}return null},yh:function(a,b,c,d,e,f){return oa.yh(a,b,c,d,e,f,this.jq)},Rd:function(){Ga.a(k.resolve(678));this.Em=-1}};de.prototype={hG:function(a){(this.pm=a===eb)&&Wa.Ve("LS6__HOURGLASS",!0)},WI:function(){x.u(this.XI,900,this)},XI:function(){if(this.pm&&(this.pm=!1,!ia.Bv()&&!ia.ie(6,!0)&&!ia.ie(9,!1)))try{window.open("about:blank","LS6__HOURGLASS",null,!0)}catch(a){}}};var jb={createSession:"createSession",Mf:"bindSession",Ag:"shutdown",Qi:"bindSent",Qa:"onEvent",
Aa:"onErrorEvent"};jb=G.Ya(jb);var Ec=1,hd=1,kc=k.s(p.md);k.s(p.Mg);Ja.prototype={ei:function(a){a=a||!this.l.pl;this.gu=new oa(oa.Rs,!1,a);this.qd=this.ja?new oa(oa.Rs,!1,a):new oa(oa.Vs,!this.l.vs,a);this.Xa=null},Ou:function(){return this.ja?p.Af:p.Pk},Su:function(){return this.ja?p.Af:p.Us},toString:function(){return["[|SessionHTTP","oid="+this.va,this.ja,this.Tc,this.b,this.ab,this.bb,this.xi,this.sessionId,this.Pc,this.Jd,this.ze,"]"].join("|")},createSession:function(a,b,c){if(!this._callSuperMethod(Ja,
jb.createSession,[a,b,c]))return!1;this.Eo(this.ab,b,a);return!0},Eo:function(a,b,c){if(a==this.ab){this.m.Jo();if(G.Av()){if(0>=Ec){kc.a(k.resolve(679));x.u(this.Eo,3E3,this,[a,c,"offline"]);return}Ec--;0==Ec&&x.u(je,2E4,null,[hd])}a=this.Xo(c,this.Eo,b,!1);null!==a&&(a?this.ql():!1===a&&(kc.Pa(k.resolve(680)),this.Aa("no_impl_available",{Of:!0,DE:!0})))}},Mf:function(a){if(!this._callSuperMethod(Ja,jb.bindSession,[a]))return!1;this.Tg&&this.Tg.Wa();this.nB();this.il(this.ab,a);return!0},nB:function(){if(!V.zv()&&
(null===this.l.Zm&&(ia.Zl()||ia.Cv())||!0===this.l.Zm)){var a=this.Yg,b=this;V.qt(function(){x.u(function(){a==b.Yg&&b.b==U.Py&&b.Fl("spinfix")},b.l.Or)})}},il:function(a,b){a==this.ab&&(this.om||this.ja||(this.om=new de),a=this.Xo(null,this.il,b,!1),null!==a&&(a?this.Qi():!1!==a||this.ja||this.cd(this.U,"streaming.unavailable")))},hk:function(){this.Gj();var a=this.Xo(null,this.hk,"network.error",!0);null!==a&&(a?this.ql():!1===a&&(kc.g(k.resolve(681)),this.Aa("no_impl_available",{Of:!0,DE:!0})))},
Ag:function(a){this._callSuperMethod(Ja,jb.shutdown,[a]);this.Tg&&this.Tg.Wa()},generateRequest:function(a,b,c,d){var e=this.b==U.xn||this.b==U.un,f=new xa(this.Nb()+p.rn);f.xk(this.l.Yc());f.yk(this.l.lj(e));var h=!f.mb()&&!f.nb();a=d?Ma.CC(this.bb,this.sessionId,this.l,b,this.Dc.Kl(),h,this.Pc):Ma.xC(this.bb,this.sessionId,this.l,this.tb,e,this.ja,a,b,this.Dc.Kl(),c,h,this.uk);f.setData(a);return f},Xo:function(a,b,c,d){var e=this.b==U.xn||this.b==U.un,f=this.generateRequest(a,c,!0,d),h=this.Nb();
this.$.Mn(null);this.Xa&&this.Xa.La==Ca&&(this.Xa=null);var g=e?this.gu:this.qd;this.Xa&&!g.yh(h,this.Xa.La,f.nb(),this.l.Yc(),f.mb(),this.l.Dj(e))&&(g.Rd(),this.Xa=null);for(var l=!1,n=(this.ja?"LS6__POLLFRAME":"LS6__PUSHFRAME")+"_"+this.vb;(this.Xa||g.Jp())&&!1===l;){if(!this.Xa){l=g.dv(h,f.nb(),this.l.Yc(),f.mb(),this.l.Dj(e));if(!l)return g.Rd(),!1;this.Xa=new l(n)}f.Vm(xa.Xk);d?f.yg(Ma.DC(this.Xa.Wf().rh())):f.yg(Ma.hv(e,this.ja,this.Xa.Wf().rh()));l=this.Xa.Ax(f,this.bb,this.$n,this.Zn,this.Yn,
this.vb);if(null===l)return kc.a(k.resolve(683)),x.u(b,50,this,[this.ab,c,a]),null;!1===l?this.Xa=null:(kc.a(k.resolve(684)),g.Rd(),this.Tg=this.Xa)}return l},Qi:function(){this._callSuperMethod(Ja,jb.bindSent);this.rq()&&this.om.hG(this.Tg.La)},rq:function(){return!this.ja},Aa:function(a,b){b=b||{};var c=b.gs;!b.ay||this.Xa.La!=Fa&&this.Xa.La!=Ca||c||this.m.WE(this.U);this._callSuperMethod(Ja,jb.onErrorEvent,arguments)},Qa:function(){this.b==U.Fs&&je();!this.rq()||this.b!=U.sy&&this.b!=U.Fs||this.om.WI();
this._callSuperMethod(Ja,jb.onEvent)},hp:function(a,b,c,d,e,f){this.$.Wb(a,b,c,d,e,f)}};D(Ja,U);var Da={ql:"createSent",og:"onTimeout",zq:"onLoop",Kq:"onStreamError",Jq:"onStreamEnd",Aa:"onErrorEvent",Ag:"shutdown",cd:"onSessionGivesUp",Wj:"onSessionBound"};Da=G.Ya(Da);var Ea=k.s(p.md);wa.prototype={toString:function(){return["[|SessionWS","oid="+this.va,this.ja,this.Tc,this.b,this.ab,this.bb,this.jd,this.xi,this.sessionId,this.Pc,this.sa,this.Jd,this.ze,"]"].join("|")},Nf:function(a){this.jd=a},
Ou:function(){return this.ja?p.Wk:p.Zs},Su:function(){return p.Us},Qq:function(){N.ra(this.jd,1)||Ea.g(k.resolve(685));this.Yh=this.bb;this.sa=new ja(this);var a=this.Nb(),b=new xa(a+p.rn);b.xk(this.l.Yc());b.yk(this.l.lj(!1));if(oa.yh(a,ja,b.nb(),this.l.Yc(),b.mb(),this.l.Dj(!1))&&(Ea.a(k.resolve(686)),this.sa.UF(b,this.Yh,this.$n,this.Zn,this.Yn)))return this.$.Mn(this.sa),this.Nf(2),!0;this.Nf(5);return!1},ql:function(){this._callSuperMethod(wa,Da.createSent);this.l.Qo&&!this.nh&&this.Qq()},il:function(a,
b){if(a==this.ab)if(this.nh=!1,1==this.jd?this.Qq():2!=this.jd||this.sa.yD(this.Nb())||(Ea.Pa(k.resolve(687)),this.sa.Wa(),this.Nf(1),this.Qq()),6==this.jd)this.cd(this.U,"ws.early.closed");else if(5==this.jd)this.cd(this.U,"ws.notgood");else if(3==this.jd)ja.gj(this.Nb()),this.cd(this.U,"ws.early.openfail");else{var c=this.generateRequest(null,b,!1,!1),d=!1;c.yg(Ma.hv(!1,this.ja,this.sa.Wf().rh()));var e=!1;2==this.jd?(d=this.sa.Ax(c,this.bb,this.$n,this.Zn,this.Yn,this.vb),e=!0):4==this.jd?d=this.sa.Ii(c,
this.bb):(N.ia(),Ea.g(k.resolve(688),this));null===d?(Ea.a(k.resolve(689)),x.u(this.il,50,this,[a,b])):!1===d?(Ea.Pa(k.resolve(690)),this.cd(this.U,"ws.false")):e||(Ea.a(k.resolve(691)),this.Qi())}},mB:function(a){this.Yh==a&&(Ea.a(k.resolve(692)),this.Qi(),this.Nf(4))},og:function(a,b,c,d,e){b==this.ab&&(this.b==U.yf&&(this.nh=!0),this._callSuperMethod(wa,Da.onTimeout,[a,b,c,d,e]))},zq:function(a){this._callSuperMethod(wa,Da.onLoop,[a]);this.sa&&this.sa.gy(this.bb)},Kq:function(a,b,c,d,e){c?b==this.Yh&&
this._callSuperMethod(wa,Da.onStreamError,[a,this.bb,c,d,e]):(this.b==U.yf&&(this.nh=!0),this._callSuperMethod(wa,Da.onStreamError,arguments))},Jq:function(a,b){b?a==this.Yh&&(this.b==U.Ky||this.b==U.yf||this.b==U.Ds?this.Aa("ws.early.end",{ip:!0}):(N.Gg(this.b,U.Gs)||Ea.g(k.resolve(693),this),this._callSuperMethod(wa,Da.onStreamEnd,[this.bb,b]))):(this.b==U.yf&&(this.nh=!0),this._callSuperMethod(wa,Da.onStreamEnd,arguments))},Aa:function(a,b){b=b||{};var c=b.Of,d=b.ay;b.ip?(N.Gg(this.jd,1)||Ea.g(k.resolve(694),
this),d?this.Nf(3):this.Nf(6),this.b==U.Ky||this.b==U.yf||this.b==U.Ds?Ea.a(k.resolve(695),this):this.b==U.Gs?(Ea.a(k.resolve(696),this),d&&ja.gj(this.Nb()),this.cd(this.U,"ws.error."+a)):this.ja&&this.b==U.Ly?(N.Fe(d)||Ea.g(k.resolve(697),this),Ea.a(k.resolve(698),this),this.kb(a,c,!1),this.og("zeroDelay",this.ab,0,"ws.broken.wait")):this._callSuperMethod(wa,Da.onErrorEvent,arguments)):(this.b==U.yf&&(this.nh=!0),this._callSuperMethod(wa,Da.onErrorEvent,arguments))},Ag:function(a){this._callSuperMethod(wa,
Da.shutdown,[a]);this.sa&&(this.Yh=null,this.sa.Wa(),this.sa=null,this.$.Mn(null));this.Nf(1)},rq:function(){return!1},cd:function(a,b){ja.gj(this.Nb());this._callSuperMethod(wa,Da.onSessionGivesUp,[a,b])},Wj:function(){this._callSuperMethod(wa,Da.onSessionBound);this.sa.NH(this.sessionId)},hp:function(a,b,c,d,e,f){this.$.Fz(a,b,c,d,e,f)}};D(wa,Ja);var Ff=k.s(p.Mg),lc=k.s(p.md);Yd.prototype={toString:function(){return["[","SlowingHandler",this.Bb,this.Km,.5,7E3,"]"].join("|")},HD:function(a){return null!=
this.Bb&&this.Bb>a},ah:function(a){this.j=a},Kl:function(){return null!=this.Bb&&0<this.Bb?Math.round(this.Bb):null},hx:function(){this.Bb=null;this.Fj=!1},jG:function(){this.Fj=!1},lJ:function(a){this.Yx(a)},iJ:function(a){N.la(this.j.QD())||Ff.g(k.resolve(699));this.j.UD()&&(this.Yx(1E3*a)?this.l.Nr&&this.j.DF():this.j.MF())},TI:function(a){a||this.hx();this.Km=I.Na()},Yx:function(a){if(!this.Km)return!0;a=I.Na()-this.Km-a;if(null==this.Bb)return this.Bb=a,lc.a(k.resolve(700)),!1;if(2E4<a&&a>2*
this.Bb&&(this.Fj=!this.Fj))return lc.i(k.resolve(701)),7E3<this.Bb;this.Bb=.5*this.Bb+.5*a;if(60>this.Bb)return this.Bb=0,lc.a(k.resolve(702)),!1;if(this.HD(7E3))return lc.i(k.resolve(703)),!0;lc.a(k.resolve(704));return!1}};var ua=k.s(p.tn);fb.prototype={toString:function(){return["[|ControlRequestBatch",this.Lf,this.Ua.length,"]"].join("|")},Hn:function(a,b){this.keys[a]=b;this.Ua.push(a);if(this.Lf==F.Ie){a=b.LS_sequence;var c=b.LS_msg_prog;if(null!=a&&null!=c)for(var d=0,e=this.Ua.length-1;d<
e;d++){var f=this.Ua[d],h=f.LS_msg_prog;a==f.LS_sequence&&c==h&&(ua.h()&&ua.Nj(Error("backtrace"),"Duplicated message","seq=",a,"prog=",c,"ptr=",b===f),ua.g(k.resolve(705),"seq=",a,"prog=",c))}}},Gz:function(a,b){this.keys[a]?this.keys[a]=b:this.Hn(a,b)},Hf:function(a,b){var c=a.bl;if(c==F.Ie||c==F.He||c==F.zf){if(this.Lf!=c)return N.ia(),ua.g(k.resolve(706),this),!1;c==F.zf?this.Gz("H",a):this.Hn(this.qE++,a);return!0}if(this.Lf!=F.Mk&&this.Lf!=F.Va)return N.ia(),ua.g(k.resolve(707),this),!1;switch(c){case F.pn:var d=
"C";break;case F.qn:d="F";break;case F.Bs:d="X"+a.getKey();break;case F.Va:d="M"+a.getKey();break;default:d=a.getKey()}var e=this.keys[d];ua.a(k.resolve(708),this,d,a);if(e){if(c==F.pn||c==F.qn||c==F.Va){b||(ua.a(k.resolve(709)),this.Wr(d,a));return}if(c==F.sn){e.tg?(ua.a(k.resolve(710)),b||this.Wr(d,a)):e.bl==F.sn?ua.a(k.resolve(711)):(ua.a(k.resolve(712)),N.Fe(b)||ua.g(k.resolve(713),this),b||this.XG(d));return}if(c==F.Ig){for(;e&&a.tg!=e.tg;)ua.a(k.resolve(714)),d+="_",e=this.keys[d];if(e){ua.a(k.resolve(715));
return}}else{b||(ua.a(k.resolve(716)),this.Wr(d,a));return}}ua.a(k.resolve(717));this.Hn(d,a)},$b:function(){return this.Ua.length},Wr:function(a,b){this.keys[a]=b},hr:function(a){if(this.Ua.length<=a)return ua.g(k.resolve(718)),null;var b=this.Ua[a];this.Ua.splice(a,1);a=this.keys[b];delete this.keys[b];return a},XG:function(a){if(!this.keys[a])return ua.g(k.resolve(719)),null;for(var b=0;b<this.Ua.length;b++)if(this.Ua[b]==a)return this.hr(b)},shift:function(){return this.hr(0)},pop:function(){return this.hr(this.Ua.length-
1)},Fh:function(){return this.Bp(this.Ua.length-1)},Al:function(){return this.Bp(0)},Bp:function(a){return 0>=this.Ua.length?null:this.keys[this.Ua[a]]},ph:function(){return this.Lf}};var Q=k.s(p.tn),Be=k.s(p.Jc),ud={1:"IDLE",2:"STAND BY",3:"WAITING RESP"};Zd.prototype={toString:function(){return["[|ControlConnectionHandler",ud[this.status],this.N,this.lk,this.Oc,"]"].join("|")},jI:function(a){this.lk=a;Q.a(k.resolve(720),this)},SI:function(a,b){b?(this.Xe=this.Oc=a,Q.i(k.resolve(721),this)):0==this.Xe||
a<this.Xe?(this.Oc=a,Q.i(k.resolve(722),this)):(this.Oc=this.Xe,Q.i(k.resolve(723),this));1==this.status&&this.sx(this.Z)},sx:function(a){1==this.status&&this.Z==a&&0!=this.Oc&&(Q.a(k.resolve(724),this),this.Wb(null,"",F.zf))},YI:function(a){a?(Q.i(k.resolve(725),this),this.Xe=this.Oc=0):0==this.Xe?(Q.i(k.resolve(726),this),this.Oc=0):(Q.i(k.resolve(727),this),this.Oc=this.Xe)},ei:function(a){this.qd=new oa(oa.ty,!1,!this.l.pl||a);this.sb=null},Wa:function(){Q.a(k.resolve(728));this.sb&&this.sb.Wa()},
Ba:function(a,b){this.Z++;1==a&&0<this.Oc&&x.u(this.sx,this.Oc,this,[this.Z]);Q.h()&&Q.a(k.resolve(729),b+ud[this.status]+" -> "+ud[a]);this.status=a},Rd:function(){Q.a(k.resolve(730),this);this.lk=0;this.lq=new fb(F.Ie);this.Do=new fb(F.Mk);this.Kp=new fb(F.zf);this.mq=new fb(F.Va);this.sa=null;this.Xe=this.Oc=0;this.jm||(this.jm=new fb(F.He));this.rl||(this.rl=new fb(F.Mk));this.Nm=[this.lq,this.Do,this.jm,this.rl,this.Kp,this.mq];this.b++;var a=this.N?this.N.ph():null;null!==a&&a!==F.Ig&&a!==F.He?
(N.Gg(this.status,1)||Q.g(k.resolve(731)),this.Wa(),this.N=null,this.Ba(1,"_reset"),this.$d(!1,"reset1")):null===a&&(N.ra(this.status,1)||Q.g(k.resolve(732)),N.ra(this.N,null)||Q.g(k.resolve(733)),this.$d(!1,"reset2"))},Mn:function(a){a?Q.a(k.resolve(734),this):this.sa&&Q.a(k.resolve(735),this);this.sa=a},Wb:function(a,b,c,d,e,f){this.Cz(b,f);x.u(this.st,0,this,[this.b,a,b,c,d,e])},Fz:function(a,b,c,d,e){this.st(this.b,a,b,c,d,e)},$z:function(a,b){return b==F.Ig||b==F.He?!0:this.b===a},ut:function(a,
b){a==F.Ie?this.lq.Hf(b):a==F.He?this.jm.Hf(b):a==F.Ig?this.rl.Hf(b):a==F.zf?this.Kp.Hf(b):a==F.Va?this.mq.Hf(b):this.Do.Hf(b)},st:function(a,b,c,d,e,f){this.$z(a,d)&&(Q.i(k.resolve(736),this,c),this.ut(d,new F(c,e,d,b,f)),1==this.status?this.$d(!0,"add"):Q.a(k.resolve(737),this))},$d:function(a,b){!0===a?(Q.a(k.resolve(738),a,this),this.mu(this.Z,b)):(Q.a(k.resolve(739),a,this),x.u(this.mu,!1===a?0:a,this,[this.Z,"async."+b]))},mu:function(a,b){if(a==this.Z){for(a=0;1>a;){a++;this.Ba(2,"dequeueControlRequests");
Q.a(k.resolve(740),b,this);if(null!=this.N){Q.a(k.resolve(741));var c=this.qx(this.N)}else Q.a(k.resolve(742)),c=this.iH();if(1==c)Q.i(k.resolve(743)),this.N=null;else{if(2==c){Q.i(k.resolve(744));this.$d(200,"later");return}if(3==c){Q.Pa(k.resolve(745));this.N&&this.N.uq(!0);this.N=null;this.$d(!1,"no");return}if(4==c){Q.i(k.resolve(746));this.Ba(3,"dequeueControlRequests");this.N&&this.N.uq();this.$d(4E3,"http");return}if(5==c)Q.i(k.resolve(747)),this.Ba(3,"dequeueControlRequests"),this.N&&this.N.uq(),
this.N=null,this.Ba(1,"dequeueControlRequests");else{Q.i(k.resolve(748));this.Wa();this.Ba(1,"dequeueControlRequests");return}}}this.$d(!1,"limit")}},iH:function(){for(var a=0;a<this.Nm.length;){this.Kk=this.Kk<this.Nm.length-1?this.Kk+1:0;if(0<this.Nm[this.Kk].$b())return this.qx(this.Nm[this.Kk]);a++}return null},qx:function(a){if(a.Lf==F.Ie)for(var b=0,c=a.Ua.length;b<c;b++){var d=a.Ua[b],e=d.LS_sequence,f=d.LS_msg_prog;if(null!=e&&null!=f)for(var h=b+1,g=a.Ua.length;h<g;h++){var l=a.Ua[h],n=l.LS_msg_prog;
e==l.LS_sequence&&f==n&&(Q.h()&&Q.Nj(Error("backtrace"),"Duplicated message","seq=",e,"prog=",f,"ptr=",d===l),Q.g(k.resolve(749),"seq=",e,"prog=",f))}}b=this.Qd.Nb();c=this.l.Yc();d=this.l.lj(!1);(e=a.Al())?(e=new xa((e.tg&&!0!==e.tg?e.tg:b)+p.rn),e.xk(c),e.yk(d),c=e):c=null;if(null==c)return Q.a(k.resolve(750)),1;Q.a(k.resolve(751));d=!1;if(this.sa){Q.a(k.resolve(752));d=this.iu(a,this.sa);if(null==d)return Q.a(k.resolve(753)),1;c.yg(d.getFile());c.setData(d.getData());d=this.sa.Ii(c);if(!1===d)this.sa=
null;else return null===d?2:5}this.sb&&!this.qd.yh(b,this.sb.La,c.nb(),this.l.Yc(),c.mb(),this.l.Dj(!1))&&(this.qd.Rd(),this.sb=null);for(;this.sb||this.qd.Jp();){if(!this.sb){d=this.qd.dv(b,c.nb(),this.l.Yc(),c.mb(),this.l.Dj(!1));if(!d)return Q.Pa(k.resolve(754),this.sb),this.qd.Rd(),3;this.sb=new d("LS6__CONTROLFRAME");Q.a(k.resolve(755),this.sb)}d=this.iu(a,this.sb);if(null==d)return Q.a(k.resolve(756)),1;c.yg(d.getFile());c.setData(d.getData());c.Vm(d.Sg);this.N.gI(this.Z);this.sb.Wa();this.hB&&
(c.Df=c.Df.replace(/LS_session=.*&/g,"LS_session=FAKE&"));d=this.sb.gb(c,this.N.b,x.Ta(this.wF,this),x.Ta(this.Aa,this));if(!1===d)Q.a(k.resolve(757)),this.sb=null;else{if(null===d)return Q.a(k.resolve(758)),2;this.qd.Rd();return 4}}!1!==d&&(N.ia(),Q.g(k.resolve(759)));return 3},iu:function(a,b){b=b.Wf();if(null==this.N)this.N=new ce,this.N.Fx(b),this.N.fill(a,this.lk,this.Qd.Wc(),this.l.Yc(),this.l.lj(!1));else if(this.N.yE(b)&&(this.N.Fx(b),a=this.N.OG(this.lk,this.Qd.Wc(),this.l.Yc(),this.l.lj(!1))))for(b=
a.ph();0<a.$b();)this.ut(b,a.shift());return this.N.ac()?this.N=null:this.N.request},wF:function(a,b){this.N&&b==this.N.b&&(Be.h()&&Be.a(k.resolve(760),b,a),Q.i(k.resolve(761),b),this.Ba(1,"onReadyForNextRequest"),this.N=null,this.Qd.RA(a),this.$d(!1,"ready4next"))},Aa:function(a,b){this.N&&b==this.N.b&&(Q.i(k.resolve(762),this,a),this.Ba(1,"onErrorEvent"),this.N=null,this.$d(!1,"error"))},Cz:function(a,b){a=a.LS_reqId;null!=a&&null!=b&&(this.kr[a]=b)},IB:function(a){var b=this.kr[a];delete this.kr[a];
return b}};ce.prototype={toString:function(){return this.ib?this.ib.toString():null},ph:function(){return this.ib?this.ib.ph():null},Al:function(){return this.ib?this.ib.Al():null},$b:function(){return this.ib?this.ib.$b():0},shift:function(){return this.ib?this.ib.shift():null},yE:function(a){return a!=this.be},Fx:function(a){this.be=a},fill:function(a,b,c,d,e){if(!(0>=a.$b()))if(this.ib=new fb(a.ph()),this.request=this.be.nD(a,d,e),d="",e=this.be.encode(a,c,!0),null===e)this.request=this.ib=null;
else{var f=this.be.qp(this.request.getFile()),h=this.be.tp(e)+e.length;0<b&&h+f>b&&Q.Pa(k.resolve(763),d);do d+=e,this.ib.Hf(a.shift()),f+=h,0<a.$b()&&(e=this.be.encode(a,c))&&(h=this.be.tp(e)+e.length);while(e&&(0==b||f+h<b)&&0<a.$b());this.request.setData(this.be.ts(d))}},OG:function(a,b,c,d){var e=this.ib;this.ib=null;this.fill(e,a,b,c,d);return 0<e.$b()?e:null},gI:function(a){this.b=a},ac:function(){return 0>=this.$b()},uq:function(a){for(var b=0,c;c=this.ib.Bp(b);)(c=c.Jl())&&x.u(c.me,0,c,[a]),
b++}};var Ce;for(Ce in{me:!0})var Gf=Ce;Hb.prototype={me:function(a){this._callSuperMethod(Hb,Gf,[a]);a||(this.Qd.qH(this.Qm,this.ne),this.EJ||this.Qd.CE(this.Qm,this.ne))},Ge:function(){return this.Qd.Zz(this.b)&&this.xr.X[this.ne]&&null!=this.xr.X[this.ne].query?!1:!0},sd:function(){this.Qd.eH(this.ne,this)},Rj:function(){}};D(Hb,qb);var Aa=k.s(p.Iy);$d.prototype={Wa:function(){this.active=!1;this.gf={};this.by=0;this.Eg={};this.mm++;Aa.a(k.resolve(764))},Ff:function(){Aa.a(k.resolve(765));if(!this.active){for(var a in this.gf){var b=
this.gf[a],c;for(c in b.X){var d=b.X[c].query;if(null!=d){var e=new Hb(this,this.dh,this.mm,b,c);this.sr(c,d,e)}}}this.active=!0}},Ii:function(a,b,c,d){Aa.a(k.resolve(766));var e=this.gf[b];null==e&&(e={Kh:0,X:{}},this.gf[b]=e);e.Kh++;a={LS_message:a,LS_reqId:G.le()};var f=!1;c?f=!0:a.LS_outcome="false";b!=p.pc&&(a.LS_sequence=encodeURIComponent(b),f=!0,d&&(a.LS_max_wait=d));f?a.LS_msg_prog=b==p.pc?this.jE(e.Kh):e.Kh:null==c&&(a.LS_ack="false");d={};d.query=a;d.listener=c;e.X[e.Kh]=d;this.active&&
(Aa.i(k.resolve(767),a),b=new Hb(this,this.dh,this.mm,e,e.Kh,b,f),this.sr(e.Kh,a,b))},jE:function(a){var b=++this.by;this.Eg[b]=a;return b},nk:function(a){return this.Eg[a]?this.Eg[a]:a},SG:function(a){for(var b in this.Eg)if(this.Eg[b]==a){delete this.Eg[b];break}},Zz:function(a){return a==this.mm},eH:function(a,b){var c=b.xr.X[a].query;Aa.a(k.resolve(768),c);this.sr(a,c,b)},sr:function(a,b,c){var d=null==b.LS_sequence?p.pc:b.LS_sequence,e="false"!=b.LS_ack;this.$.Wb(a,b,F.Ie,c,null,{bd:function(f){e&&
f.Kg(4,a,d,0,0)},ad:function(f,h,g,l){f.Bi(g,a,"MSG"+d,l,!0)}})},wz:function(a,b){b=a==p.pc?this.nk(b):b;Aa.i(k.resolve(769),a,b);var c=this.gf[a];c.X[b]&&(null!=c.X[b].query&&(Aa.a(k.resolve(770)),c.X[b].query=null),null==c.X[b].listener&&(Aa.a(k.resolve(771)),this.Rg(a,b)))},CE:function(a,b){Aa.a(k.resolve(772),a,b);this.Rg(a,b)},Rg:function(a,b){Aa.a(k.resolve(773));var c=this.gf[a];c&&c.X[b]&&(delete c.X[b],a==p.pc&&this.SG(b))},tc:function(a,b){return(a=this.gf[a])&&a.X[b]&&a.X[b].listener?a.X[b].listener:
null},qH:function(a,b){Aa.a(k.resolve(774),a,b);(a=this.tc(a,b))&&(b=this.Ia.uh(a.bf))&&b.xw(a.ek)},az:function(a,b){b=a==p.pc?this.nk(b):b;Aa.i(k.resolve(775),a,b);var c=this.tc(a,b);if(c){var d=this.Ia.uh(c.bf);d&&d.vw(c.ek)}this.Rg(a,b)},FE:function(a,b){b=a==p.pc?this.nk(b):b;Aa.i(k.resolve(776),a,b);var c=this.tc(a,b);if(c){var d=this.Ia.uh(c.bf);d&&d.kg(c.ek)}this.Rg(a,b)},EE:function(a,b,c,d){d=a==p.pc?this.nk(d):d;Aa.i(k.resolve(777),a,d);var e=this.tc(a,d);if(e){var f=this.Ia.uh(e.bf);f&&
f.ww(e.ek,b,c)}this.Rg(a,d)},HE:function(a,b,c,d){d=a==p.pc?this.nk(d):d;Aa.i(k.resolve(778),a,d);var e=this.tc(a,d);if(e){var f=this.Ia.uh(e.bf);f&&f.lg(e.ek,b,c)}this.Rg(a,d)}};var De={cy:decodeURIComponent};be.prototype={da:function(a){if(a>=this.lb.length)throw Error("Field "+a+" does not exist");return this.lb[a]},tj:function(a){return De.cy(this.da(a))},P:function(a){a=this.da(a);a=parseInt(a,10);if(isNaN(a))throw Error("Not an integer field");return a},Qu:function(a){a=this.da(a);a=parseFloat(a);
if(isNaN(a))throw Error("Not a float field");return a}};var kb=k.s(p.Jc);ae.prototype={toString:function(){return"[EvalQueue|"+this.lh.length+"]"},BB:function(){var a=this;return function(b){try{a.bG(b)}catch(c){a.Bi(61,null,null,"Malformed message received")}}},gt:function(a,b){this.Ux()&&(this.lh.push({p:a,d:b}),kb.h()&&kb.a(k.resolve(779)),x.u(this.AA,0,this))},ah:function(a){this.j=a},AA:function(){for(kb.h()&&kb.a(k.resolve(780),this.lh.length);0<this.lh.length;){var a=this.lh.shift();if(this.j&&
this.j.bh(a.p))try{this.zA(a.d)}catch(b){this.ov=!0,this.lh=[],console.log(b),kb.g(k.resolve(782),b,a.d),this.j.VA()}else kb.Pa(k.resolve(781),a.p,a.d,this.j)}},Ux:function(){return!this.ov},ca:function(){},bG:function(a){a=a.split("\r\n");for(var b=0;b<a.length;b++){var c=a[b];if(""!=c)try{var d=new be(c);this.Vv&&this.Xn.push(d.Nh);switch(d.da(0)){case "U":this.JG(d);break;case "REQOK":this.DG(d);break;case "SUBOK":this.GG(d);break;case "SUBCMD":this.FG(d);break;case "UNSUB":this.IG(d);break;case "CONOK":this.nG(d);
break;case "SERVNAME":this.EG(d);break;case "CLIENTIP":this.kG(d);break;case "CONS":this.oG(d);break;case "LOOP":this.tG(d);break;case "PROG":this.BG(d);break;case "CONERR":this.lG(d);break;case "REQERR":this.CG(d);break;case "ERROR":this.sG(d);break;case "MSGDONE":this.xG(d);break;case "MSGFAIL":this.yG(d);break;case "EOS":this.rG(d);break;case "CS":this.pG(d);break;case "OV":this.zG(d);break;case "CONF":this.mG(d);break;case "PROBE":this.AG(d);break;case "SYNC":this.HG(d);break;case "NOOP":break;
case "END":this.qG(d);break;case "MPNREG":this.wG(d);break;case "MPNOK":this.vG(d);break;case "MPNDEL":this.uG(d);break;default:throw Error("Unknown message: "+c);}}catch(e){throw kb.g(k.resolve(783),c,e),Error("Malformed message: "+c);}}},JG:function(a){var b=a.P(1),c=a.P(2);a=this.cG(a.Nh);try{this.Ks(null,[b,c].concat(a))}catch(d){kb.g(k.resolve(784),d)}},GG:function(a){var b=a.P(1),c=a.P(2);a=a.P(3);this.Kg(6,null,b,c,a,-1,-1)},FG:function(a){var b=a.P(1),c=a.P(2),d=a.P(3),e=a.P(4);a=a.P(5);this.Kg(6,
null,b,c,d,e-1,a-1)},IG:function(a){a=a.P(1);this.Kg(8,null,a)},nG:function(a){var b=a.da(1),c=a.P(2),d=a.P(3);a="*"==a.da(4)?null:a.da(4);this.Ai(1,null,b,a,d,c)},EG:function(a){a=a.da(1);this.Gy(a)},kG:function(a){a=a.da(1);null!=this.j&&this.j.wq(a)},oG:function(a){var b=a.da(1);a="unlimited"==b||"unmanaged"==b?b:a.Qu(1);this.Ai(5,null,a)},tG:function(a){a=a.P(1);this.Ai(2,null,a)},lG:function(a){var b=a.P(1);a=a.tj(2);this.Bi(b,null,null,a)},DG:function(a){"REQOK"!=a.Nh&&(a=a.P(1),a=this.iv(a),
null!=a&&a.bd(this))},CG:function(a){var b=a.P(1),c=a.P(2),d=a.tj(3),e=this.iv(b);a=null;if(null!=e){var f=this;a=function(){e.ad(f,null,c,d)}}null!=this.j&&this.j.xB(c,d,a)},sG:function(a){var b=a.P(1);a=a.tj(2);null!=this.j&&this.j.vB(b,a)},rG:function(a){var b=a.P(1);a=a.P(2);this.Ey(null,[b,a])},pG:function(a){var b=a.P(1);a=a.P(2);this.Js(null,[b,a])},xG:function(a){var b=a.da(1);"*"==b&&(b=p.pc);a=a.P(2);this.Kg(5,a,b,0,0)},yG:function(a){var b=a.da(1);"*"==b&&(b=p.pc);var c=a.P(2),d=a.P(3);
a=a.tj(4);this.Bi(d,c,"MSG"+b,a)},zG:function(a){var b=a.P(1),c=a.P(2);a=a.P(3);this.Fy(null,[b,c,a])},mG:function(a){var b=a.P(1),c=a.da(2),d=a.da(3);if("filtered"!=d&&"unfiltered"!=d)throw Error("Unknown mode");a="unlimited"==c?c:a.Qu(2);this.Kg(9,null,b,a)},BG:function(a){a=a.P(1);this.Ai(7,null,a,this.Xn);this.Vv=!0;this.Xn=[]},AG:function(){this.Ks(null,[])},qG:function(a){var b=a.P(1);a=a.tj(2);this.Ai(4,null,b,a)},HG:function(a){a=a.P(1);this.Js(null,a)},wG:function(a){var b=a.da(1);a=a.da(2);
this.Dy(b,a)},vG:function(a){var b=a.da(1);a=a.da(2);this.Cy(b,a)},uG:function(a){a=a.da(1);this.By(a)},cG:function(a){var b=a.indexOf(",")+1;N.la(2==b);var c=a.indexOf(",",b)+1;if(0>=c)throw Error("Missing subscription field");var d=a.indexOf(",",c)+1;if(0>=d)throw Error("Missing item field");N.la("U,"==a.substring(0,b));id(a.substring(b,c-1),"Invalid subscription");id(a.substring(c,d-1),"Invalid item");b={length:-1};c=[];var e=d-1;for(N.la(","==a.charAt(e));e<a.length;){d=a.indexOf("|",e+1);-1==
d&&(d=a.length);e=a.substring(e+1,d);if(""==e)c.push(b);else if("#"==e.charAt(0)){if(1!=e.length)throw Error("Wrong field quoting");c.push(null)}else if("$"==e.charAt(0)){if(1!=e.length)throw Error("Wrong field quoting");c.push("")}else if("^"==e.charAt(0))for(e=id(e.substring(1),"Invalid field count");0<e--;)c.push(b);else e=De.cy(e),c.push(e);e=d}return c},iv:function(a){return null!=this.j&&(a=this.j.$.IB(a),null!=a)?a:null}};var Hf={2:7,6:9,4:3,8:3,_2:3,_6:9,_4:3,_8:7},Ee={2:7,6:9,4:3,8:3,_2:3,
_6:9,_4:3,_8:9},Fe={2:3,6:7,4:5,8:9},If={2:5,6:9,7:9,9:9},Ge={3:!0,5:!0,7:!0,9:!0},T=k.s(p.Mg),ha=k.s(p.md),$e=1;vc.prototype={YA:function(){var a=this;W.Da(this.vb,"LS_forceReload",function(){a.j&&a.j.Aa("server.exit",{Of:!0})})},Ba:function(a){ha.h()&&ha.a(k.resolve(786),La(this.status),"->",La(a));this.status=a;this.Z++},kb:function(a,b,c){1!=this.status&&10!=this.status&&this.j&&this.j.kb(a?"api":b,!1,c)},Lo:function(){1!=this.status&&10!=this.status&&this.j&&this.j.Lo()},vD:function(){return 1!=
this.status&&10!=this.status},Tz:function(a,b,c,d,e){null!=this.j&&this.j.zb()?this.gh(a,b,c,d,e):(this.status=d?e?9:5:e?7:3,this.j.Jd=!0)},lx:function(a,b,c,d){a==this.Z&&this.createSession(!1,this.ge,c,2===this.status||6===this.status?!1:!0,2===this.status||4===this.status?!1:!0,b,d)},gh:function(a,b,c,d,e,f,h){!h&&this.vD()?this.gJ(a,b,c,d,e,f):this.createSession(a,b,c,d,e,f,!1)},gJ:function(a,b,c,d,e,f){a&&Na.wd();this.Jo();a=a?"api":f;this.ge=b?"_":"";this.Ba(d?e?9:5:e?7:3);this.Rr(a);this.j.dx(this.Z,
a,c)},createSession:function(a,b,c,d,e,f,h){a&&Na.wd();this.Jo();a=a?"api":f;this.ge=b?"_":"";this.fx();b=this.j?this.j.Wc():null;a="new."+a;this.kb(!1,a,!1);this.Ba(d?e?8:4:e?6:2);null!=this.j&&this.j.Ag(!1);this.$q(d,c,e);this.j.createSession(b,a,h)},$q:function(a,b,c,d,e){var f=null!==this.hj;c=c?Ja:wa;e&&(f=!1);this.j=new c(a,b,this,this.Z,d,f,e,this.c);d&&d.Ag();this.Dc.ah(this.j);this.wb&&this.wb.ah(this.j);this.ZF.ah(this.j)},Mf:function(a,b,c,d){this.Ba(b?c?8:4:c?6:2);this.$q(b,a,c,this.j);
this.j.Mf(d)},hk:function(a,b,c){ha.a(k.resolve(787),b);a!=this.Z?ha.a(k.resolve(788)):(b=Fe[this.status]||this.status,a=3==b||7==b?!1:!0,b=3==b||5==b?!1:!0,this.Ba(a?b?8:4:b?6:2),this.$q(a,c,b,this.j,!0),this.j.hk())},Mr:function(){return"_"==this.ge&&Fe[this.status]==Ee[this.ge+this.status]},cd:function(a,b,c){a==this.Z&&(c?(ha.i(k.resolve(789)),this.Ba(1)):(a=Ee[this.status]||this.status,7==a&&ia.Dv()&&(a=9),ha.i(k.resolve(790),La(this.status),La(a)),1==a||10==a?(N.ia(),ha.g(k.resolve(791))):(this.Ba(a),
this.Rr(b),this.j.dx(this.Z,b,!1))))},EF:function(a){a==this.Z&&(a=If[this.status],ha.i(k.resolve(792),La(this.status),La(a)),a?(this.Ba(a),this.Rr("slow"),this.j.dH(this.Z)):(N.ia(),ha.g(k.resolve(793),La(this.status),this.j)))},fh:function(a,b,c){a==this.Z&&(a=Hf[this.ge+this.status]||this.status,ha.i(k.resolve(794),La(this.status),La(a)),1==a||10==a?(N.ia(),ha.g(k.resolve(795))):this.gh(!1,"_"==this.ge,c,3==a||7==a?!1:!0,3==a||5==a?!1:!0,b,!0))},$r:function(a,b,c){a==this.Z&&(a=this.status,ha.i(k.resolve(796),
La(this.status)),Ge[a]?this.Mf(c,3==a||7==a?!1:!0,3==a||5==a?!1:!0,b):(N.ia(),ha.g(k.resolve(797))))},Tx:function(a){ha.i(k.resolve(798));this.$r(a,"slow",!1)},hJ:function(a,b){a==this.Z&&(a=this.status,ha.i(k.resolve(799),La(this.status)),Ge[a]?this.gh(!1,"_"==this.ge,!1,3==a||7==a?!1:!0,3==a||5==a?!1:!0,"switch.timeout."+b,!0):(N.ia(),ha.g(k.resolve(800))))},Rr:function(a){x.u(this.hJ,this.l.Zr+(this.Dc.Kl()||0),this,[this.Z,a])},fx:function(){this.$.Rd();this.ff.Wa()},Bo:function(){var a=null!==
this.hj;this.j&&this.j.ei(a);this.$&&this.$.ei(a)},WE:function(a){a==this.Z&&this.Bo()},Jo:function(){null!==this.hj&&1E3<I.Na()-this.hj&&(this.hj=null,this.Bo())},Wp:function(){return this.j?this.j.K()||this.j.ic.Tb:null},sp:function(){return this.j?this.j.sp():p.Jg},Nb:function(){return this.j?this.j.Nb():this.tb.tk},Wc:function(){return this.j?this.j.Wc():null},np:function(){this.wb&&this.wb.Ux()||(this.wb=new ae(this.vb),this.wb.ah(this.j));return this.wb},ca:function(){this.wb&&this.wb.ca();
V.Mm(this)},uf:function(){this.kb(!1,"unload",!0);this.Ba(10)},Xf:function(){return this.vb},UI:function(a){a==this.Z&&this.$a.IE()},dc:function(a){ha.i(k.resolve(801),this.j);this.kw(a);this.ff.Ff();this.$a.dc();this.Cj(!1);this.qq=0},kw:function(a){a&&this.$.jI(a)},Wj:function(){0==this.qq&&this.c.H.dc();this.qq++},ob:function(a,b){if(a!=this.Z)return null;ha.a(k.resolve(802),this.j);this.fx();this.$a.mg();b?this.Ba(1):this.Ba(this.status);this.c.H.ob(!b);return this.Z},Nq:function(a,b){var c=this.Ia.We(a[0]);
c?(T.h()&&T.a(k.resolve(804),a),c.pg(a,b)):T.a(k.resolve(803),this)},jg:function(a){var b=this.Ia.We(a[0]);b?(T.h()&&T.a(k.resolve(806),a),b.uw(a[0],a[1],a[2])):T.a(k.resolve(805),this)},ig:function(a){var b=this.Ia.We(a[0]);b?(T.h()&&T.a(k.resolve(808),a),b.Sh(a[0],a[1])):T.a(k.resolve(807),this)},gg:function(a){var b=this.Ia.We(a[0]);b?(T.h()&&T.a(k.resolve(810),a),b.tm(a[0],a[1])):T.a(k.resolve(809),this)},Uh:function(a,b){T.h()&&T.a(k.resolve(811),a,b);this.Ba(1);this.Ia.KE(a,b)},Mq:function(a,
b,c){var d=this.Ia.We(a);d?(T.h()&&T.a(k.resolve(812),a,b,c),d.Vh(a,b,c)):T.a(k.resolve(813),this);this.Ia.Vh(a)},fc:function(a){var b=this.Ia.We(a);b?(T.h()&&T.a(k.resolve(814),a),b.fc(a)):T.a(k.resolve(815),this);this.Ia.fc(a)},Wh:function(a,b,c){T.h()&&T.a(k.resolve(816),a,b,c);this.Ia.JF(a,b);b=this.Ia.We(a);null!=b?b.Wh(a,c):T.Pa(k.resolve(817),a)},dd:function(a,b,c,d,e){this.Ia.dd(a);var f=this.Ia.We(a);f?(T.h()&&T.a(k.resolve(819),a,b,c,d,e),f.dd(a,d,e,b,c)):T.a(k.resolve(818),this)},Aq:function(a,
b){T.h()&&T.a(k.resolve(820),a,b);this.ff.wz(a,b)},Dq:function(a,b){T.h()&&T.a(k.resolve(821),a,b);this.ff.az(a,b)},Bq:function(a,b,c,d){T.h()&&T.a(k.resolve(822),a,d,b,c);this.ff.EE(a,b,d,c)},kg:function(a,b){T.h()&&T.a(k.resolve(823),a,b);this.ff.FE(a,b)},lg:function(a,b,c,d){T.h()&&T.a(k.resolve(824),a,d,b,c);this.ff.HE(a,b,d,c)},xm:function(a){this.$a.xm(a)},Eq:function(a){T.h()&&T.a(k.resolve(825),a);this.$a.Eq(a)},wq:function(a){this.po&&a!=this.po&&ja.BD()&&(ja.kx(),this.gh(!1,"_"==this.ge,
!1,!1,!1,"ip",!1));this.po=a},Bd:function(){this.$a.Bd()},rr:function(a,b,c,d){this.ff.Ii(a,b,c,d)},rk:function(a,b){a=Ma.lC(this.Z,a,b);this.$.Wb(null,a,F.He,null)},kl:function(){this.j&&this.j.kl()},lH:function(a,b,c,d,e){this.$.Wb(a,b,F.Mk,e,d,{bd:function(){},ad:function(f,h,g,l){f.Bi(g,h,a,l)}})},nH:function(a,b,c,d,e){this.$.Wb(a,b,F.sn,e,d,{bd:function(){},ad:function(f,h,g,l){19!=g&&e.Ko();ha.g(k.resolve(826)+ke(b)+" caused the error: ",g,l)}})},mH:function(a,b,c){this.$.Wb(a,b,F.Bs,c,null,
{bd:function(){},ad:function(d,e,f,h){c.Ko();ha.g(k.resolve(827)+ke(b)+"] caused the error: "+f+" "+h)}})},Cj:function(a){this.j&&this.j.Cj(a)},RA:function(a){var b=null==this.j?null:this.j.bb;this.np().gt(b,a)},wr:function(a,b){var c=this;this.$.Wb(a.kk,a.query,F.Va,b,null,{bd:function(){b.re()},ad:function(d,e,f,h){b.re();null!=c.j&&c.j.jF(f,h)}})},ur:function(a,b){var c=this;this.$.Wb(a.kk,a.query,F.Va,b,null,{bd:function(){b.re()},ad:function(d,e,f,h){b.re();null!=c.j&&c.j.lF(a.subscriptionId,
f,h)}})},vr:function(a,b){var c=this;this.$.Wb(a.kk,a.query,F.Va,b,null,{bd:function(){b.re()},ad:function(d,e,f,h){b.re();null!=c.j&&c.j.nF(a.subscriptionId,f,h)}})},tr:function(a,b){this.$.Wb(a.kk,a.query,F.Va,b,null,{bd:function(){b.re()},ad:function(){b.re()}})},Ha:function(a){ha.g(k.resolve(828),a.stack||a);this.j&&this.j.Ha(61,"Internal error: "+a)}};vc.prototype.unloadEvent=vc.prototype.uf;var la=sa.Rx,vd={Tj:la,Th:la,ec:la,dc:la,mg:la,tw:la,Uh:la,Bd:la,ping:sa.Sx,dd:la,fc:la,Sh:la,pg:la,uw:la,
tm:la,Vh:la,kg:la,ww:la,lg:la,vw:la,xw:la,Wh:la};Kb.methods=vd;Kb.prototype={Tm:function(a){this.target=a},pw:function(a,b,c){("ConnectionDetails"==a?this.J.Kc:"ConnectionOptions"==a?this.J.rc:this.J.Ja).ka(b,c)},Dt:function(a){a==this.J.ud()&&this.J.qu()},Et:function(a){a==this.J.ud()&&this.J.HA()},Ft:function(a){a==this.J.ud()&&this.J.IA()},Kw:function(){if(null===this.J)throw"net";return!0},Vt:function(){x.u(this.J.Mt,0,this.J);x.u(this.J.Mt,1E3,this.J)},Ek:function(a,b){return a!=this.J.ud()?
null:this.J.subscribe(this.id,b)},ui:function(a,b){return a!=this.J.ud()?null:this.J.unsubscribe(b)},Ee:function(a,b,c){return a!=this.J.ud()?null:this.J.Ee(b,c)},oj:function(a,b,c,d,e){if(a!=this.J.ud())return null;this.J.rr(b,c,null==d?null:{ek:d,bf:this.id},e)},Ku:function(a){this.J.rk(a)},ca:function(){this.J=null}};for(var wd in vd)Kb.prototype[wd]=ue.$i(wd,vd[wd]);var Xd=I.Gd(),xd=p.Hg;isNaN(xd)&&(xd=0);var yd=k.s(p.md);Wd.prototype={toString:function(){return"[LightstreamerEngine "+this.id+
"]"},At:function(a,b){b||(b="LOCAL"+Xd++);var c=new Kb(this,b);c.Tm(a);a.hI(c);this.aa.yw(b,c)},Xf:function(){return this.id},Wp:function(){return this.o.Wp()},ud:function(){return this.aa.ud()},mg:function(){this.aa.mg()},dc:function(){this.aa.dc()},ca:function(){this.o.kb(!1,"suicide",!0);this.o.ca();W.aA(this.id);this.Id&&this.Id.ca();this.aa.ew(!0);this.aa.ca();this.co&&this.co.ca()},HA:function(){yd.i(k.resolve(829));this.Ja.ka("connectionRequested",!1);this.o.kb(!0,"api",!0)},IA:function(){this.Ja.ka("connectionRequested",
!1);this.o.Lo()},EA:function(){var a=this.rc.Gl;yd.i(k.resolve(830),a);if(null===a){var b=!0,c=!1,d=!1,e=!1;a=!1}else b=!0,c=a==p.wn||a==p.zi,d=!c,e=a==p.Wk||a==p.Af,a=a==p.Af||a==p.Pk||a==p.zi;this.o.Tz(b,c,d,e,a)},qu:function(){yd.i(k.resolve(831));this.Ja.ka("connectionRequested",!0);var a=this.rc.Gl;null===a?this.o.gh(!0,!1,!1,!1,!1):this.FA(a)},FA:function(a){var b=a==p.wn||a==p.zi;this.o.gh(!0,b,!b,a==p.Wk||a==p.Af,a==p.Af||a==p.Pk||a==p.zi)},Zg:function(a,b,c){this.aa.Te(function(d){d.Tj(a,
b,c)});"requestedMaxBandwidth"==b?this.o.kl(c):"forcedTransport"==b?this.Ja.Zi&&this.EA():"reverseHeartbeatInterval"==b?this.o.Cj(!1):("corsXHREnabled"==b||"xDomainStreamingEnabled"==b)&&this.o.Bo();return!0},xm:function(a){this.Id&&this.Id.Xw(a)},Eq:function(a){this.Id&&this.Id.yz(a)},Ob:function(){return this.o.sp()},IE:function(){var a=this.Ob();if(this.eq!=a){var b=this.eq;this.eq=a;this.aa.JE(a,b);this.ec&&this.ec(a)}},rr:function(a,b,c,d){var e=this.Ob();if(e==p.Jg||e==p.vn)return!1;this.o.rr(a,
b,c,d);return!0},rk:function(a){this.o.rk(a,xd);return!0},subscribe:function(a,b){return this.aa.gD(a,b)},unsubscribe:function(a){this.aa.ax(a)},Ee:function(a,b){this.aa.Ee(a,b)},Mt:function(){this.aa.Tt()},Bd:function(){this.aa.Bd()},wr:function(a,b){this.o.wr(a,b)},ur:function(a,b){this.o.ur(a,b)},vr:function(a,b){this.o.vr(a,b)},tr:function(a,b){this.o.tr(a,b)},Ha:function(a){this.o.Ha(a)}};le.prototype={Ob:function(){return this.status}};var zd={bi:function(a,b){return this.cr(b+"_"+a)},HJ:function(a,
b,c){c=c.join("|");this.write(p.Cf+b+"_"+a,c)},no:function(a,b){this.w(p.Cf+b+"_"+a)},dr:function(a){return this.cr(a)},LG:function(a){a=this.cr(a);if(!a)return null;for(var b=[],c=0;c<a.length;c++){var d=a[c].split("_");if(2==d.length){var e=this.bi(d[1],d[0]);null!=e&&b.push(new le(d[0],d[1],e))}}return b},Gn:function(a,b,c){a=p.Cf+a;b+=c?"_"+c:"";c=this.read(a);if(!c)c="|";else if(-1<c.indexOf("|"+b+"|"))return!1;this.write(a,c+(b+"|"));return!0},jk:function(a,b,c){a=p.Cf+a;b+=c?"_"+c:"";if(c=
this.read(a))b="|"+b+"|",-1<c.indexOf(b)&&(c=c.replace(b,"|"),"|"==c?this.w(a):this.write(a,c))},getAllKeys:function(){for(var a=this.keys(),b=[],c=0;c<a.length;c++)0==a[c].indexOf(p.Cf)&&(a[c]=a[c].substring(p.Cf.length),b.push(a[c]));return b},cr:function(a){a=p.Cf+a;a=this.read(a);if(!a)return null;a=a.split("|");""==a[0]&&a.shift();""==a[a.length-1]&&a.pop();return 0<a.length?a:null}},He=G.xb({read:function(a){return localStorage.getItem(a)},write:function(a,b){localStorage.setItem(a,b)},w:function(a){localStorage.removeItem(a)},
keys:function(){for(var a=[],b=0;b<localStorage.length;b++)a.push(localStorage.key(b));return a}},zd),Oc=function(){var a=!1,b={Oi:function(){return a},jp:function(){return this.Oi()?document.cookie.toString():null},us:function(c,d){this.oy(c,d,"")},oy:function(c,d,e){this.Oi()&&(c=encodeURIComponent(c)+"="+d+"; "+e+"path=/;",document.cookie=c)},Im:function(c){if(!this.Oi())return null;c=encodeURIComponent(c)+"=";var d=this.jp();d=d.split(";");for(var e=0;e<d.length;e++)if(d[e]=I.trim(d[e]),0==d[e].indexOf(c))return d[e].substring(c.length,
d[e].length);return null},gr:function(c){if(this.Oi()){var d=new Date;d.setTime(d.getTime()-864E5);this.oy(c,"deleting","expires="+d.toUTCString()+"; ")}},Xz:function(){if(L.ua()&&("http:"==document.location.protocol||"https:"==document.location.protocol)){a=!0;var c="LS__cookie_test"+I.Gd();this.us(c,"testing");var d=this.Im(c);if("testing"==d&&(this.gr(c),d=this.Im(c),null==d))return;a=!1}}};b.Xz();b.areCookiesEnabled=b.Oi;b.getAllCookiesAsSingleString=b.jp;b.writeCookie=b.us;b.removeCookie=b.gr;
b.readCookie=b.Im;return b}(),Ad=G.xb({read:function(a){return Oc.Im(a)},write:function(a,b){Oc.us(a,b)},w:function(a){Oc.gr(a)},keys:function(){var a=Oc.jp().split(";");for(var b=0;b<a.length;b++)a[b]=I.trim(a[b]),a[b]=a[b].substring(0,a[b].indexOf("=")),a[b]=decodeURIComponent(a[b]);return a}},zd),Ta=[],Jf=p.Ng+p.Ts,Ie=6E4;Yb.prototype={start:function(){this.dn&&x.pf(this.dn);this.dn=x.Wg(this.Yt,Ie,this);x.u(this.Yt,0,this)},w:function(){x.pf(this.dn);for(var a=0;a<Ta.length;a++)if(Ta[a]==this){Ta.splice(a,
1);break}},Yt:function(){for(var a=I.Na(),b=this.Ga.getAllKeys(),c=0;c<b.length;c++)0<b[c].indexOf("_")&&this.ho(b[c],null,a);for(c=0;c<b.length;c++)-1>=b[c].indexOf("_")&&this.Yz(b[c])},ho:function(a,b,c){if(!b){b=a.split("_");if(2!=b.length)return!1;a=b[0];b=b[1]}var d=this.Ga.bi(b,a);return d?c?c-d[p.Uk]>Jf?(this.Ga.no(b,a),!1):!0:!0:!1},Yz:function(a){for(var b=this.Ga.dr(a),c=0;c<b.length;c++)0<b[c].indexOf("_")?this.ho(b[c])||this.Ga.jk(a,b[c]):this.ho(b[c],a)||this.Ga.jk(a,b[c])}};D(Yb,Ae,
!1,!0);var Kf=new Yb(He),Bd=new Yb(Ad),Je=G.It()?Kf:Bd,Cd={start:function(a){a=a?Bd:Je;for(var b=0;b<Ta.length;b++)if(Ta[b]==a){a.fn();return}Ta.push(a);a.fn();a.start()},stop:function(a){a=a?Bd:Je;for(var b=0;b<Ta.length;b++)Ta[b]==a&&a.sl()},eK:function(a){Ie=a;for(a=0;a<Ta.length;a++)Ta[a].start()}},Pc={},Ze=G.xb({read:function(a){return Pc[a]},write:function(a,b){Pc[a]=b},w:function(a){delete Pc[a]},keys:function(){var a=[],b;for(b in Pc)a.push(b);return a}},zd),Qc={Gt:function(){return L.ua()&&
"undefined"!==typeof SharedWorker&&"undefined"!==typeof Blob&&window.URL},sA:function(a){return window.URL.createObjectURL(new Blob([a]))},bH:function(a){window.URL.revokeObjectURL(a)}},Lf=p.Qk,Cb=k.s(p.Ic);sb.Yy='var listeners={},nextId=0,MASTER="MASTER",REMOTE="REMOTE",INITIALIZATION="INITIALIZATION",REMOVE="REMOVE",ALL="ALL",FAILED="FAILED",KILL="KILL";onconnect=function(a){var b=a.ports[0];a=nextId++;listeners[MASTER]||(a=MASTER);listeners[a]=b;b.addEventListener("message",function(a){a=a.data;if(a.type==REMOVE)delete listeners[a.target];else if(a.type==KILL)terminate();else if(a.target===ALL)for(var c in listeners)listeners[c]!=b&&sendMessage(c,a,b);else sendMessage(a.target,a,b)});b.start();b.postMessage({type:INITIALIZATION,id:a});a!==MASTER&&listeners[MASTER].postMessage({type:REMOTE,id:a})};function sendMessage(a,b,d){(a=listeners[a])?a.postMessage(b):(b.type=FAILED,d.postMessage(b))}function terminate(){self.close();for(var a in listeners)listeners[a].close()};';
sb.prototype={uc:function(){return null!==this.fd},start:function(a){var b=new SharedWorker(a);a=new Promise(function(d,e){b.onerror=function(){Cb.i(k.resolve(833));e("SharedWorker broken")}});this.xf=b.port;var c=this;this.xf.onmessage=function(d){c.wm(d.data)};this.xf.start();return a},ca:function(){try{this.fd==Lf&&this.xf.postMessage({type:"KILL"}),this.xf.close()}catch(a){}this.xf=null},wm:function(a){try{if(Cb.h()){var b="RECEIVED",c;for(c in a)b+=" "+c.toString()+":"+a[c];Cb.a(b)}"INITIALIZATION"==
a.type?(this.fd=a.id,this.dispatchEvent("onReady")):"REMOTE"==a.type?this.dispatchEvent("onRemote",[a.id]):"FAILED"==a.type?this.dispatchEvent("onMessageFail",[a.target,a.kq]):this.dispatchEvent("onMessage",[a])}catch(d){Cb.g(k.resolve(836),d)}},bx:function(a){a||(a=this.fd);try{this.xf.postMessage({type:"REMOVE",target:a})}catch(b){}},ki:function(a,b,c,d){if(!this.uc())return!1;b={type:b,sender:this.fd,target:a,kq:c,Dd:d};if(Cb.h()){d="SENDING";for(var e in b)d+=" "+e.toString()+":"+b[e];Cb.a(d)}try{this.xf.postMessage(b)}catch(f){Cb.g(k.resolve(837),
f),this.dispatchEvent("onMessageFail",[a,c])}return!0}};D(sb,hb);var Dd=k.s(p.Ic),Ke=p.Qk;dc.prototype={uc:function(){return null!==this.fd},start:function(a){this.ready=!0;if(a){this.Pf[Ke]=a;var b=this;x.u(function(){try{a.connect(b)}catch(c){-2147467260!=c.gw&&Dd.g(k.resolve(838),c)}},0)}else this.fd=Ke,this.dispatchEvent("onReady")},ca:function(){},connect:function(a){x.u(this.bz,0,this,[a])},bz:function(a){var b=this.XF++;this.Pf[b]=a;this.dispatchEvent("onRemote",[b]);this.ki(b,"INITIALIZATION",
-1,[b])},bx:function(a){delete this.Pf[a]},ki:function(a,b,c,d){if(!this.uc())return!1;if("ALL"==a)for(var e in this.Pf)this.lt(e,b,c,d);else this.lt(a,b,c,d);return!0},lt:function(a,b,c,d){try{if(this.Pf[a]&&this.Pf[a].wm){var e=this;x.u(function(){try{e.Pf[a].wm(a,e.fd,b,c,d)}catch(f){-2147467260!=f.gw&&(Dd.g(k.resolve(839),f),e.dispatchEvent("onMessageFail",[a,c]))}},0)}else this.dispatchEvent("onMessageFail",[a,c])}catch(f){this.dispatchEvent("onMessageFail",[a,c])}},wm:function(a,b,c,d,e){a=
{target:G.rd(a),type:G.rd(c),kq:G.rd(d),sender:G.rd(b)};if(e)for(a.Dd=[],b=0;b<e.length;b++)a.Dd[b]=G.rd(e[b]);this.nz(a)},nz:function(a){try{"INITIALIZATION"==a.type?(this.fd=a.Dd[0],this.dispatchEvent("onReady")):this.dispatchEvent("onMessage",[a])}catch(b){-2147467260!=b.gw&&Dd.g(k.resolve(840),b)}}};D(dc,hb,!1,!0);var Ba=k.s(p.Ic),Le=G.It()?He:Ad,Mf=I.Gd(),Rc=p.Uk;Va.bv=function(){return Le};Va.prototype={toString:function(){return["[SharedStatus",this.id,this.T,"]"].join("|")},Jl:function(){return this.xa},
Ji:function(){this.ox=!0;V.Fn(this);V.Xg(this)},HI:function(a,b,c,d){if(this.ox)return!1;this.NA=b||{};this.fm=null;this.Xm=500;this.Xr=a;this.Qf=null;this.host=location.host;this.Ri=this.Mb=p.ld;this.Yq=!1;this.Fu=0;c?(this.Ga=Ad,Cd.start(!0)):(this.Ga=Le,Cd.start());this.rB=c;this.ds=this.an=null;this.Yk();this.mt();this.xa=null;d||!Qc.Gt()?this.Mb=this.Lu():this.Ri=this.DB();this.Qj={};Ba.i(k.resolve(841));this.Ji();return!0},II:function(){if(this.ox)return!1;this.Yk(!0);this.mt();Ba.i(k.resolve(842));
this.Ji();return!0},mt:function(){W.Dz(this.T,this.J)},Yk:function(a){do this.id=Mf++;while(W.Rl(this.id,"lsEngine"));a||(this.Ga.Gn(this.T,this.id)?this.Ga.bi(this.T,this.id)&&this.Yk():this.Yk())},pz:function(){this.ds=x.Wg(this.PG,p.Ng,this);Ba.i(k.resolve(843),this)},Lu:function(){var a=this.Mb;a==p.ld&&(a=G.nr("LSF__"+G.Vf()+"_"+this.id+"_"+this.T),this.xa=new dc,W.Da(this.id,p.Ok,this.xa));Wa.Ve(a,!0)?(this.Xm=500,this.nt()):(this.an=x.u(this.Lu,this.Xm,this),this.Xm*=2);return a},DB:function(){var a=
Qc.sA(sb.Yy);this.xa=new sb;this.nt(a);W.Da(this.id,p.Vk,a);return a},nt:function(a){var b=this;this.xa.addListener({onReady:function(){b.Tw();b.an=x.u(b.pz,0,b);b.xa.removeListener(this)}});this.xa.start(a)},Ma:function(){return this.id},yz:function(a){a!=this.Qf&&(this.Qf=a,this.Ga.Gn(a,this.id,this.T))},Xw:function(a){this.Qf!=a?null==this.Qf?Ba.Pa(k.resolve(844),a):Ba.g(k.resolve(845),this.Qf,a):this.Qf=null;this.Ga.jk(a,this.id,this.T)},uC:function(a){a=this.Ga.LG(a);if(!a)return 0;for(var b=
0,c=0;c<a.length;c++)I.Na()-a[c].Ob()[Rc]>p.Ng||b++;return b},Tw:function(){this.fm=I.Na()+this.Fu;this.Ga.HJ(this.T,this.id,[this.fm,this.Mb,this.host,p.Hg,p.Ci,this.Ri])},PG:function(){if(this.Yq)Ba.a(k.resolve(846)),this.Yq=!1;else{var a=!1;if(this.Xr){Ba.a(k.resolve(847),this);var b=this.Ga.dr(this.T);if(b){Ba.a(k.resolve(849),this.T);for(var c=0;c<b.length;c++)if(b[c]!=this.id){var d=this.Ga.bi(this.T,b[c]);d?d[p.As]!=p.Hg||d[p.Ss]!=p.Ci?Ba.a(k.resolve(851),b[c]):(d[Rc]==this.fm&&(this.Fu=I.Gd(5)),
d[Rc]>this.fm?a|=this.zE(b[c],d[Rc]):this.Qj[b[c]]&&delete this.Qj[b[c]]):Ba.a(k.resolve(850),b[c])}}else Ba.a(k.resolve(848),this)}a||(Ba.a(k.resolve(852)),this.Ga.Gn(this.T,this.id),this.Tw())}},zE:function(a,b){Ba.a(k.resolve(853),a+" with a newer status");if(this.Qj[a]){if(this.Qj[a]==b||this.NA[a])return!1;Ba.i(k.resolve(854),this.id);this.WA()}this.Qj[a]=b;return!0},WA:function(){this.w();this.Xr&&x.ha(this.Xr)},Pv:function(){this.Ga.no(this.T,this.id);this.Ga.jk(this.T,this.id);this.Yq=!0},
w:function(){Ba.i(k.resolve(855),this);x.pf(this.ds);x.pf(this.an);this.an=this.ds=null;this.Mb!=p.ld?Wa.Oo(this.Mb):this.Ri!=p.ld&&Qc.bH(this.Ri);this.Ri=this.Mb=p.ld;this.Xw(this.Qf);this.T&&W.ZG(this.T,this.J);this.xa&&(W.mo(this.id,p.Ok),W.mo(this.id,p.Vk));this.xa=null;this.Pv()},uf:function(){this.w()},Zq:function(){this.Pv()},ca:function(){this.w();V.fr(this);V.Mm(this);Cd.stop(this.rB)}};Va.prototype.unloadEvent=Va.prototype.uf;Va.prototype.preUnloadEvent=Va.prototype.Zq;var nf=0;Ra.prototype=
{AH:function(a){this.xa=a;a.addListener(this);a.uc()&&this.Hq()},ca:function(a){this.xa&&!a&&this.xa.ca()},pe:function(){this.xa.uc()&&this.Hq()},Hq:function(){if(!this.ready){this.ready=!0;for(var a=0;a<this.buffer.length;a++){var b=this.buffer[a],c=this.call(b.method,b.Dd,b.yu);b.yu&&b.KG(c)}this.buffer=[]}},gF:function(a){this.mz(a.sender,a.kq,a.type,a.Dd)},mz:function(a,b,c,d){"RESPONSE"==c?this.cf[b]&&(this.cf[b].ok(d[0]),delete this.cf[b]):a===this.target&&(c=this.receiver[c].apply(this.receiver,
d),"undefined"!==typeof c&&this.kH(a,b,c))},Cq:function(a,b){this.cf[b]&&(this.cf[b].qm(p.My),delete this.cf[b])},kH:function(a,b,c){this.xa.ki(a,"RESPONSE",b,[c])},call:function(a,b,c,d){b=G.gl(b);if(this.ready){var e=this.id+"_"+this.BE++;this.xa.ki(this.target,a,e,b);if(c){var f=this;return new Promise(function(g,l){f.cf[e]={ok:g,qm:l};d&&x.u(function(){f.cf[e]&&l(p.Ny)},d)})}}else{var h={target:this.target,method:a,Dd:b,yu:c,cK:d};this.buffer.push(h);if(c)return new Promise(function(g){h.KG=g})}}};
Ra.prototype.onReady=Ra.prototype.Hq;Ra.prototype.onMessageFail=Ra.prototype.Cq;Ra.prototype.onMessage=Ra.prototype.gF;Ra.prototype.onListenStart=Ra.prototype.pe;Lb.$i=function(a,b){return b.In?function(){return this.channel.call(a,[this.jc].concat(G.gl(arguments)),b.ss,b.jx)}:function(){return this.channel.call(a,arguments,b.ss,b.jx)}};Lb.prototype={Op:function(a,b){this.channel=new Ra(this,a,b)},Xx:function(a){this.channel.ca(a)}};var Tb;for(Tb in{ca:!0})var Nf=Tb;tb.prototype={ca:function(){this._callSuperMethod(tb,
Nf);this.Xx(!0)}};var Me=Kb.methods;for(Tb in Me)tb.prototype[Tb]=Lb.$i(Tb,Me[Tb]);D(tb,Kb);D(tb,Lb,!0);gb.prototype={xF:function(a){var b=new tb(this.J,this.xa,a);this.dispatchEvent("onNewPushPage",[a,b])},Cq:function(a){this.xa.bx(a);this.dispatchEvent("onPushPageLost",[a])},ca:function(){this.xa.ca()}};gb.prototype.onRemote=gb.prototype.xF;gb.prototype.onMessageFail=gb.prototype.Cq;D(gb,hb);var Ub;for(Ub in{ca:!0})var Of=Ub;var Pf=k.s(p.Ic),Ne=2E3;nb.prototype={yJ:function(a){var b=this;a.uc()?
this.Vw(a):(a.addListener({onReady:function(){b.Vw(a)}}),x.u(this.BJ,Ne,this))},BJ:function(a){a.uc()||(Ne*=2,this.Th())},Vw:function(a){a.fd==p.Qk&&(Pf.i(k.resolve(856),this.vb+" is a master but should be a slave: engine must die"),x.u(this.Th,0,this,[!1,!0]))},ca:function(){this._callSuperMethod(nb,Of);this.Xx()}};var Oe=rb.methods;for(Ub in Oe)nb.prototype[Ub]=Lb.$i(Ub,Oe[Ub]);D(nb,rb);D(nb,Lb,!0);var Qf=function(){function a(){this.Sw=null}function b(l,n){return"var callFun = "+function(r,u){window.name!=
r||window!=top||window.Lightstreamer&&window.Lightstreamer.py||(window.name=u,window.close())}.toString()+"; callFun('"+l+"', '"+n+"');"}var c=0,d=0,e=!1,f=!1,h=k.s(p.Ic),g=[];a.prototype={dE:function(l,n){var r=null;try{g[l]&&(r=g[l])}catch(y){r=null}if(r&&(delete g[l],this.Rv(r,l,n)))return!0;a:{r="javascript:"+('eval("'+b(l,l+"__TRASH")+'; ")');var u=null;h.a(k.resolve(857));if(f)r=!1;else{try{try{if(window.SymError){var E=!0;-5>d-c&&(E=!1);if(window.SymRealWinOpen&&E){c++;var t=window.SymRealWinOpen(r,
l,"height=100,width=100",!0)}else e||(e=!0,h.Pa(k.resolve(859))),c=0,t=null}else t=window.open(r,l,"height=100,width=100",!0);u=t}catch(y){u=null}}catch(y){h.a(k.resolve(858),y);r=!1;break a}if(u)try{d++}catch(y){f=!0}r=u}}if(!1===r)return h.a(k.resolve(860)),!1;if(!r)return h.a(k.resolve(861)),!0;h.a(k.resolve(862));this.Rv(r,l,n);return!0},Rv:function(l,n,r){try{h.a(k.resolve(863));if(l.closed)return h.a(k.resolve(864)),!1;var u=l;if(r){if(l==l.top&&!l.Lightstreamer){h.a(k.resolve(865));try{l.name!=
n&&l.name!=n+"__TRASH"||l.close()}catch(E){h.a(k.resolve(866),E)}return!1}u=l.parent;if(null==u)return h.a(k.resolve(867)),!1}if(!u.Lightstreamer)return h.a(k.resolve(868)),!1;if(!u.Lightstreamer.py)return h.a(k.resolve(869)),!1;h.a(k.resolve(870));this.Sw=u;g[n]=l}catch(E){return h.a(k.resolve(871),E),!1}return!0}};return a}(),Pe={};me.prototype={EC:function(){if(Pe[this.Mb])return Promise.resolve(null);var a=new Qf;return a.dE(this.Mb,!0)?(a=a.Sw,null==a?(Pe[this.Mb]=!0,Promise.resolve(null)):Promise.resolve(a)):
Promise.resolve(null)}};var da=k.s(p.Ic);Ya.ot=0;Ya.prototype={stop:function(){da.i(k.resolve(873));this.vg++;this.lr||this.yn()},find:function(a){this.Vi=a||{};a=this.lz();this.Ef(this.vg,!1);return a},mp:function(){return this.Vi},at:function(a){this.lr=!0;this.ok(a);this.stop()},yn:function(){this.lr=!0;this.qm();this.stop()},jt:function(){this.rm=!0},kt:function(){"CREATE"==this.Jw?(da.i(k.resolve(874)),this.at(null)):"WAIT"==this.Jw?(da.i(k.resolve(875),1E3),x.u(this.Ef,1E3,this,[this.vg,!1])):
(da.i(k.resolve(876)),this.yn())},Bn:function(a,b,c){if("ABORT"==this.Wq)da.i(k.resolve(877)),this.yn();else if("IGNORE"!=this.Wq){da.i(k.resolve(878),c);if(1==a){var d=new rb(this.client);b.At(d)}else a=2==a?new dc:new sb,b=a.start(b),d=new nb(this.client,a),b.then(null,function(){da.i(k.resolve(879),c+" must die");d.Th(!1,!0)});d.Gx(c);this.at(d)}else da.i(k.resolve(880)),this.stop()},Ef:function(a,b){if(this.vg==a)if(a=++this.vg,da.a(k.resolve(881)),this.fE)da.a(k.resolve(883)),this.kt();else if(this.nf){da.a(k.resolve(884));
try{var c=this.nf.Lightstreamer,d=c.MC(this.T);da.a(k.resolve(885),d+" ("+this.T+").");if(null!=d){var e=d.Xf();if(c.Rl(e,p.Vk)){this.Bn(3,c.Vu(e,p.Vk),e);return}if(c.Rl(e,p.Ok)){this.Bn(2,c.Vu(e,p.Ok),e);return}}else 1==b&&this.jt()}catch(g){da.a(k.resolve(886),g)}this.nf=null;this.Ef(this.vg,!1)}else{da.a(k.resolve(887));var f=this,h=++this.vj;x.u(function(){h==f.vj&&f.vj++},p.Sy);Ya.ot++;this.zn(this.vj).then(function(g){Ya.ot--;if(a==f.vg)if(da.a(k.resolve(888)),null==g)da.a(k.resolve(889)),f.kt();
else{da.i(k.resolve(890),g.id);var l=g.values,n=l[p.zs],r=l[p.vy];if(n!==p.ld)try{da.a(k.resolve(891),g.id+" shares through shared worker",n),f.Bn(3,n,g.id)}catch(u){f.Ef(a,!1)}else r!==p.ld?(da.a(k.resolve(892),g.id+" shares through direct communication",r),g=(new me(r)).EC(),null!=g?g.then(function(u){(f.nf=u)||f.jt();f.Ef(a,!0)}):f.Ef(a,!1)):(da.i(k.resolve(893),l),f.Ef(a,!1))}})}},lz:function(){var a=this;return new Promise(function(b,c){a.ok=b;a.qm=c})},zn:function(a,b){if(this.vj!=a)return Promise.resolve(null);
var c=this,d=p.Ng,e=p.Ng+p.Ts,f=Va.bv();return new Promise(function(h){if(b)for(var g in b){var l=f.bi(c.T,g);if(l&&l[p.Uk]!=b[g]){c.Vi[g]=!0;h({id:g,values:l});return}}var n={};if(g=f.dr(c.T))for(var r=!1,u=0;u<g.length;u++)if(!c.Vi[g[u]])if(l=f.bi(c.T,g[u]),!l||5>l.length)ne(g[u],c.T),da.a(k.resolve(894),g[u]);else if(l[p.As]!=p.Hg||l[p.Ss]!=p.Ci)da.a(k.resolve(895),l);else{var E=parseInt(l[p.Uk]),t=I.Na()-E,y=l[p.zs]!=p.ld||"ATTACH:FAST"==c.Wq;if(t<=(y?d:e)){if(y){c.Vi[g[u]]=!0;h({id:g[u],values:l});
return}r=!0;n[g[u]]=E}else y&&t<=e?(r=!0,n[g[u]]=E):6E4<t&&(da.i(k.resolve(896)),ne(g[u],c.T))}r?(da.a(k.resolve(897)),x.u(function(){c.zn(a,n).then(function(z){h(z)})},p.Ng)):b?(da.a(k.resolve(898)),h(null)):(da.a(k.resolve(899),c.Ni),x.u(function(){c.zn(a,{}).then(function(z){h(z)})},c.Ni))})}};Ya.gB={stop:function(){},find:function(){return Promise.resolve(null)},mp:function(){return{}}};Ya.uz={stop:function(){},find:function(){return Promise.reject(null)},mp:function(){return{}}};var oe=function(){function a(h,
g,l,n,r){if(!h)throw new C("The share name is missing");if(!b.test(h))throw new C("The given share name is not valid, use only alphanumeric characters");if(!d[l])throw new C("sharePolicyOnNotFound must be one of: CREATE, ABORT, WAIT");if(!c[g])throw new C("sharePolicyOnFound must be one of: ATTACH, ATTACH:FAST, IGNORE, ABORT");this.sg=this.Ka(n,!0);if(!L.ua()){if(e[g])throw new C("ATTACH* can only be used if the LightstreamerClient is loaded inside a browser document");this.sg=!0}"file:"!=p.Ci||n||
(f.Pa(k.resolve(900)),n=!0);this.sg=n;this.T=h;this.ye=g;this.Ak=l;this.nf=r;this.Ni=null;this.aw=!1;f.h()&&f.a(k.resolve(901),"shareName="+this.T,"sharePolicyOnFound="+this.ye,"sharePolicyOnNotFound="+this.Ak,"preventCrossWindowShare="+this.sg,"shareRef="+this.nf)}var b=/^[a-zA-Z0-9]*$/,c={ATTACH:!0,"ATTACH:FAST":!0,IGNORE:!0,ABORT:!0},d={CREATE:!0,ABORT:!0,WAIT:!0},e={ATTACH:!0,"ATTACH:FAST":!0},f=k.s(p.Ic);a.prototype={rA:function(h,g,l){h=new Va(this.T,h);this.sg?h.II():(g=this.Oz()?null:g,h.HI(g,
l));return h},qA:function(h,g){return new gb(h,g)},Oz:function(){return"IGNORE"===this.ye||this.aw},rm:function(){this.aw=!0},oA:function(h,g){g=new a(this.T,g?"IGNORE":this.ye,"ATTACH"==this.ye||"ATTACH:FAST"==this.ye?"CREATE":this.Ak,this.sg,this.nf);g.Ni=h;return g},jB:function(h){if("IGNORE"==this.ye&&"CREATE"==this.Ak)return f.i(k.resolve(902)),Ya.gB;if("IGNORE"!=this.ye&&"ABORT"!=this.ye||"ABORT"!=this.Ak)return f.i(k.resolve(904)),new Ya(h,this.T,this.ye,this.Ak,this.sg,this.nf,this.Ni);f.i(k.resolve(903));
return Ya.uz},NC:function(){return this.T},Yl:function(){return this.sg||Qc.Gt()}};a.prototype.getShareName=a.prototype.NC;D(a,wb,!0,!0);return a}();db.prototype={aF:function(a,b,c){this.Lr()&&(Y.ra(b,1,"Unexpected item position"),this.Zh.QI(this.Lm,c))},Vh:function(a,b){this.Lr()&&this.Zh.RI(a,b,this.Lm)},xq:function(a){if(this.Lr())return Y.ra(a.vp(),1,"Unexpected item position"),a=a.Fg,this.Zh.mI(a.length-2),a=this.nA(a),this.Zh.update(a,!1,!0)},Lr:function(){return this.Zh.pv(this.Mv,this.Lm)},
nA:function(a){var b=this.Zh,c=this.Mv,d=[];d[0]=b.Be;d[1]=c;d.Yd=[];c=b.Uu()+2;for(var e=2,f=2;f<c;f++)f==b.keyCode+1?d[f]=this.Lm:f==b.Yb+1?d[f]="UPDATE":f<=b.Ra.xc+1?d[f]=p.Fi:(d[f]=a[e],a.hs[e]?d[f]=p.Fi:d.Yd.push(f-1),e++);return d}};db.prototype.onSubscriptionError=db.prototype.Vh;db.prototype.onItemUpdate=db.prototype.xq;db.prototype.onItemLostUpdates=db.prototype.aF;var Qe=k.s(p.on);va.prototype={Yu:function(){return this.aE},vp:function(){return this.bE},G:function(a){a=this.Jk(a);return(a=
this.Fg[a])&&a.mK?a.value:a},Zc:function(a){a=this.Jk(a);return!this.Fg.hs[a]},Xp:function(){return this.kz},Cl:function(a){for(var b=this.Fg.Yd,c=0;c<b.length;c++){var d=this.Ra.getName(b[c]),e=this.Fg[b[c]+1];try{a(d,b[c],e)}catch(f){Qe.Nj(f,k.resolve(905))}}},Hu:function(a){for(var b=2;b<this.Fg.length;b++){var c=b-1,d=this.Ra.getName(c),e=this.Fg[b];try{a(d,c,e)}catch(f){Qe.Nj(f,k.resolve(906))}}},Jk:function(a){a=isNaN(a)?this.Ra.$f(a):a;if(null==a)throw new C("the specified field does not exist");
if(0>=a||a>this.Ra.rp()+1)throw new C("the specified field position is out of bounds");return a+1}};va.prototype.getItemName=va.prototype.Yu;va.prototype.getItemPos=va.prototype.vp;va.prototype.getValue=va.prototype.G;va.prototype.isValueChanged=va.prototype.Zc;va.prototype.isSnapshot=va.prototype.Xp;va.prototype.forEachChangedField=va.prototype.Cl;va.prototype.forEachField=va.prototype.Hu;$c.prototype={Px:function(a){this.gd=a},rp:function(){return this.gd?this.xc+this.gd.xc:this.xc},lf:function(a){this.xc=
a}};Gb.prototype={lf:function(){},pj:function(){return this.list.join(" ")},$f:function(a){return this.mx[a]?this.mx[a]:this.gd?(a=this.gd.$f(a),null!==a?a+this.xc:null):null},getName:function(a){return a>this.xc&&this.gd?this.gd.getName(a-this.xc):this.list[a-1]||null},he:function(){return this.list}};D(Gb,$c);Fb.prototype={pj:function(){return this.name},$f:function(a){return this.gd?(a=this.gd.$f(a),null!==a?a+this.xc:null):null},getName:function(a){return this.gd?this.gd.getName(a-this.xc):null},
he:function(){return this.name}};D(Fb,$c);var Oa=function(){function a(b){this.za=b||{}}a.prototype={xd:function(b,c,d){c in this.za||(this.za[c]={});this.za[c][d]=b},get:function(b,c){return b in this.za&&c in this.za[b]?this.za[b][c]:null},ej:function(b,c){if(!(!b in this.za)){c in this.za[b]&&delete this.za[b][c];for(var d in this.za[b])return;delete this.za[b]}},insertRow:function(b,c){this.za[c]=b},Ea:function(b){return b in this.za?this.za[b]:null},Pe:function(b){b in this.za&&delete this.za[b]},
Pu:function(){return this.za},ac:function(){for(var b in this.za)return!1;return!0},nj:function(b){for(var c in this.za)this.Dl(c,b)},fp:function(b){for(var c in this.za)b(c)},Dl:function(b,c){var d=this.za[b],e;for(e in d)c(d[e],b,e)}};a.prototype.insert=a.prototype.xd;a.prototype.get=a.prototype.get;a.prototype.del=a.prototype.ej;a.prototype.insertRow=a.prototype.insertRow;a.prototype.getRow=a.prototype.Ea;a.prototype.delRow=a.prototype.Pe;a.prototype.getEntireMatrix=a.prototype.Pu;a.prototype.forEachElement=
a.prototype.nj;a.prototype.forEachElementInRow=a.prototype.Dl;a.prototype.forEachRow=a.prototype.fp;a.prototype.isEmpty=a.prototype.ac;return a}();Eb.prototype={ED:function(a){return"unlimited"==this.frequency?!0:"unlimited"==a.frequency?!1:this.frequency>a.frequency},vu:function(a){return this.frequency==a.frequency}};Vd.prototype={Yi:function(a){var b=this.f.ve;this.f.ve=new Eb(a);b.vu(this.f.ve)||this.f.dispatchEvent("onRealMaxFrequency",[this.f.ve.frequency])}};Ud.prototype={Yi:function(a){this.f.ve=
new Eb(a);this.yo()},yo:function(){var a=this.f.ve;this.f.Ae.nj(function(b){b.ve.ED(a)&&(a=b.ve)});a.vu(this.nq)||(this.nq=a,this.f.dispatchEvent("onRealMaxFrequency",[this.nq.frequency]))},XE:function(){this.yo()}};Td.prototype={Yi:function(a){this.f.ve=new Eb(a);this.lB.ci.yo()}};var fa={Nt:function(a,b){if(!I.isArray(a))throw new C("Please specifiy a valid array");for(var c=0;c<a.length;c++)if(a[c]){if(-1<a[c].indexOf(" "))throw new C(b+" name cannot contain spaces");if(!isNaN(a[c]))throw new C(b+
" name cannot be a number");}else throw new C(b+" name cannot be empty");},io:function(a,b){if(!I.isArray(a))throw new C("Please specifiy a valid array");for(var c=0;c<a.length;c++){if(!a[c])throw new C(b+" name cannot be empty");if(-1<a[c].indexOf(" "))throw new C(b+" name cannot contain spaces");}},Sk:"The field list/field schema of this Subscription was not initiated",Rk:"The item list/item group of this Subscription was not initiated",Xy:"This Subscription was initiated using an item group, use getItemGroup instead of using getItems",
Wy:"This Subscription was initiated using an item list, use getItems instead of using getItemGroup",Vy:"This Subscription was initiated using a field schema, use getFieldSchema instead of using getFields",Uy:"This Subscription was initiated using a field list, use getFields instead of using getFieldSchema",Ms:"The given value is not valid for this setting; use null, 'unlimited' or a positive number instead",Hy:"The given value is not valid for this setting; use null, 'unlimited', 'unfiltered' or a positive number instead",
$s:"Please specify a valid item or item list",Ps:"Please specify a valid field list"},mc=function(){function a(g,l,n){this._callSuperConstructor(a);g=(new String(g)).toUpperCase();if(!g||!d[g])throw new C("The given value is not a valid subscription mode. Admitted values are MERGE, DISTINCT, RAW, COMMAND");this.qc=g;this.Ra=this.de=this.Rc=this.wc=this.Ch=this.Dh=null;this.vc="RAW"===g?null:"yes";this.Om=this.Be=this.dj=this.$k=this.ft=this.Ji=this.cb=this.pa=null;this.ve=new Eb(null);this.ci=null;
this.fg=new Oa;this.oe=new Oa;this.m=null;this.Ub=1;this.jJ=0;this.Hi=null;this.Pm=this.vm=0;this.Ar(this.qc==p.yi?2:1);this.js=this.keyCode=this.Yb=null;this.Ae=new Oa;this.Dk=this.Cg=this.qf=null;this.$I=p.Ns;if(l){if(!n||!I.isArray(n))throw new C(fa.Ps);I.isArray(l)?this.jf(l):this.jf([l]);this.ni(n)}else if(n)throw new C(fa.$s);}function b(g,l){return g-l}function c(g){this.Eu=!0;this.uu=!1;this.state=h.Os;this.f=g}var d={COMMAND:!0,RAW:!0,MERGE:!0,DISTINCT:!0},e=p.Fi,f=k.s(p.Ws);a.prototype=
{toString:function(){return["[|Subscription",this.Ub,this.jJ,this.Hi,this.Be,"]"].join("|")},Qt:function(){this.Be=null;this.fg=new Oa;this.oe=new Oa;this.Bg=null;this.Ra.lf(0);this.wc.lf(0);3==this.behavior&&(this.Ra.Px(null),this.Ae=new Oa);f.a(k.resolve(907),this)},vq:function(g,l,n){this.yc();if(!this.wc)throw new C("Invalid Subscription, please specify an item list or item group");if(!this.Ra)throw new C("Invalid Subscription, please specify a field list or field schema");this.Ub=5;this.Hi=g;
this.m=n;this.vm++;Y.ra(this.vm,1,"Wrong count while adding");f.i(k.resolve(908),this);return!0},HF:function(){this.Ub=2;f.a(k.resolve(909),this)},NF:function(g){this.Be=g;this.Ub=3;f.a(k.resolve(910),this)},uF:function(){var g=this.Ah();this.Ub=5;this.Qt();g&&this.sw();f.a(k.resolve(911),this)},yF:function(){this.wD();var g=this.Ah();this.Ub=1;this.Hi=null;delete this.Om;3==this.behavior&&this.$G();this.Qt();this.vm--;Y.ra(this.vm,0,"Wrong count while removing");g&&this.sw();this.m=null;f.a(k.resolve(912),
this)},FF:function(g,l,n,r){this.Ub=4;this.Pm++;Y.ra(this.Pm,1,"Wrong count starting push");f.i(k.resolve(913),this);3==this.behavior&&this.Ra.Px(this.Dk);this.de&&1!=this.behavior&&this.pI(l,g);this.wc.lf(n);this.Ra.lf(r);this.Bg=[];for(g=1;g<=n;g++)this.Bg[g]=new c(this);this.dispatchEvent("onSubscription")},sw:function(){this.Pm--;Y.ra(this.Pm,0,"Wrong count ending push");f.i(k.resolve(914),this);this.dispatchEvent("onUnsubscription")},$G:function(){var g=this;this.Ae.nj(function(l,n,r){g.ir(n,
r)})},TG:function(){var g=this;this.Ae.Dl(function(l,n,r){g.ir(n,r)})},FC:function(){this.generateRequest();return this.Om},Mu:function(){return null!=this.pa?{LS_requested_max_frequency:this.pa}:{}},generateRequest:function(){var g={LS_mode:this.qc,LS_group:encodeURIComponent(this.wc.pj()),LS_schema:encodeURIComponent(this.Ra.pj())};null!=this.dj&&(g.LS_data_adapter=encodeURIComponent(this.dj));null!=this.$k&&(g.LS_selector=encodeURIComponent(this.$k));null!=this.Ji&&(g.LS_start=this.Ji);null!=this.ft&&
(g.LS_end=this.ft);null!=this.vc&&(g.LS_snapshot="yes"===this.vc?"true":"no"===this.vc?"false":this.vc);G.xb(g,this.Mu());if(null!=this.cb){var l=this.cb;if("unlimited"==l||0<l)g.LS_requested_buffer_size=l}f.a(k.resolve(915),this);return this.Om=g},lI:function(){if(this.qc==p.yi&&null!=this.Rc&&(this.Yb=this.Rc.$f("command"),this.keyCode=this.Rc.$f("key"),!this.Yb||!this.keyCode))throw new C("A field list for a COMMAND subscription must contain the key and command fields");},pI:function(g,l){f.a(k.resolve(916),
this,g,l);this.Yb=g;this.keyCode=l},vd:function(){return this.Hi},yc:function(){if(this.zb())throw new O("Cannot modify an active Subscription, please unsubscribe before applying any change");},wD:function(){if(!this.zb())throw new O("Subscription is not active");},qr:function(){if(this.qc!=p.yi)throw new O("Second level field list is only available on COMMAND Subscriptions");},uo:function(){if(this.qc!=p.yi)throw new O("This method can only be used on COMMAND subscriptions");},JD:function(){return 1==
this.Ub},VD:function(){return 2==this.Ub},Kv:function(){return 3==this.Ub},Ah:function(){return 4==this.Ub},LD:function(){return 5==this.Ub},zb:function(){return 1!=this.Ub},je:function(){return this.Ah()},jf:function(g){this.yc();fa.Nt(g,"An item");this.Dh=null==g?null:new Gb(g);this.Ch=null;this.wc=this.Dh},wp:function(){if(!this.Dh){if(this.Ch)throw new O(fa.Xy);throw new O(fa.Rk);}return this.Dh.he()},Cr:function(g){this.yc();this.Dh=null;this.wc=this.Ch=null==g?null:new Fb(g)},up:function(){if(!this.Ch){if(this.Dh)throw new O(fa.Wy);
throw new O(fa.Rk);}return this.Ch.he()},ni:function(g){this.yc();fa.io(g,"A field");this.Rc=null==g?null:new Gb(g);this.de=null;this.Ra=this.Rc;this.lI()},Ll:function(){if(!this.Rc){if(this.de)throw new O(fa.Vy);throw new O(fa.Sk);}return this.Rc.he()},Um:function(g){this.yc();this.Rc=null;this.Ra=this.de=null==g?null:new Fb(g)},pp:function(){if(!this.de){if(this.Rc)throw new O(fa.Uy);throw new O(fa.Sk);}return this.de.he()},Zf:function(){return this.qc},xg:function(g){this.yc();this.dj=g;f.a(k.resolve(917),
this,g)},rj:function(){return this.dj},nI:function(g){this.yc();this.$k=g;f.a(k.resolve(918),this,g)},IC:function(){return this.$k},oi:function(g){g&&(g=new String(g),g=g.toLowerCase());var l=this.pa;if(this.zb()){if(!g&&0!=g)throw new O("Can't change the frequency from/to 'unfiltered' or to null while the Subscription is active");if("unfiltered"==g||"unfiltered"==this.pa)throw new O("Can't change the frequency from/to 'unfiltered' or to null while the Subscription is active");}if(g||0==g)if("unfiltered"==
g||"unlimited"==g)this.pa=g;else try{this.pa=this.S(g,!1,!0)}catch(r){throw new C(fa.Hy);}else this.pa=null;if((this.VD()||this.Kv()||this.Ah())&&String(l)!=String(this.pa)&&(this.m.Ee(this,this.Mu()),3==this.behavior)){var n=this;this.Ae.nj(function(r){Y.la(n.Ah(),"Table not pushing");r.oi(n.pa)})}f.a(k.resolve(919),this,this.pa)},zj:function(){return null==this.pa?null:String(this.pa)},Fr:function(g){this.yc();if(g||0==g)if(g=new String(g),g=g.toLowerCase(),"unlimited"==g)this.cb=g;else try{this.cb=
this.S(g)}catch(l){throw new C(fa.Ms);}else this.cb=null;f.a(k.resolve(920),this,this.cb)},yj:function(){return null==this.cb?null:String(this.cb)},Gr:function(g){this.yc();if(g||0==g)if(g=new String(g),g=g.toLowerCase(),"no"==g)this.vc=g;else{if(this.qc==p.Oy)throw new O("Snapshot is not permitted if RAW was specified as mode");if("yes"==g)this.vc=g;else{if(isNaN(g))throw new C("The given value is not valid for this setting; use null, 'yes', 'no' or a positive number instead");if(this.qc!=p.Es)throw new O("Numeric values are only allowed when the subscription mode is DISTINCT");
try{this.vc=this.S(g)}catch(l){throw new C("The given value is not valid for this setting; use null, 'yes', 'no' or a positive number instead");}}}else this.vc=null;f.a(k.resolve(921),this,this.vc)},HC:function(){return this.vc},Ex:function(g){this.yc();this.qr();fa.io(g,"A field");this.qf=null==g?null:new Gb(g);this.Cg=null;this.Dk=this.qf;this.Mw()},SB:function(){if(!this.qf){if(this.Cg)throw new O("The second level of this Subscription was initiated using a field schema, use getCommandSecondLevelFieldSchema instead of using getCommandSecondLevelFields");
throw new O("The second level of this Subscription was not initiated");}return this.qf.he()},GH:function(g){this.yc();this.qr();this.qf=null;this.Dk=this.Cg=null==g?null:new Fb(g);this.Mw()},RB:function(){if(!this.Cg){if(this.qf)throw new O("The second level of this Subscription was initiated using a field list, use getCommandSecondLevelFields instead of using getCommandSecondLevelFieldSchema");throw new O("The second level of this Subscription was not initiated");}return this.Cg.he()},Dx:function(g){this.yc();
this.qr();this.js=g;f.a(k.resolve(922),this,g)},QB:function(){return this.js},G:function(g,l){return this.fg.get(this.$x(g),this.Zx(l))},TB:function(g,l,n){this.uo();return this.oe.get(this.$x(g)+" "+l,this.Zx(n,!0))},$u:function(){this.uo();if(!this.de&&this.Rc)throw new O("This Subscription was initiated using a field list, key field is always 'key'");if(null==this.keyCode)throw new O("The position of the key field is currently unknown");return this.keyCode},Nu:function(){this.uo();if(!this.de&&
this.Rc)throw new O("This Subscription was initiated using a field list, command field is always 'command'");if(null==this.Yb)throw new O("The position of the command field is currently unknown");return this.Yb},Zx:function(g,l){g=this.Jk(g,this.Ra,l);if(null===g)throw new C("the specified field does not exist");if(!1===g)throw new C("the specified field position is out of bounds");return g},$x:function(g){g=this.Jk(g,this.wc);if(null===g)throw new C("the specified item does not exist");if(!1===g)throw new C("the specified item position is out of bounds");
return g},Jk:function(g,l,n){g=isNaN(g)?l.$f(g):g;return null==g?null:0>=g||g>(n?l.rp():l.xc)?!1:g},Mw:function(){null==this.Dk?this.Ar(2):this.Ar(3)},Wo:function(g){var l=this.wc.getName(g);Y.yt(this.Bg[g],"Item index out of range");this.Bg[g].Wo();this.dispatchEvent("onEndOfSnapshot",[l,g])},eA:function(g){var l=this.wc.getName(g);2==this.behavior?this.oe=new Oa:3==this.behavior&&(this.oe=new Oa,this.TG(g));this.dispatchEvent("onClearSnapshot",[l,g])},hE:function(g,l){this.dispatchEvent("onItemLostUpdates",
[this.wc.getName(g),g,l])},QI:function(g,l){this.dispatchEvent("onCommandSecondLevelItemLostUpdates",[l,g])},rH:function(g,l){this.dispatchEvent("onSubscriptionError",[g,l])},RI:function(g,l,n){this.dispatchEvent("onCommandSecondLevelSubscriptionError",[g,l,n])},update:function(g,l,n){Y.ra(4,this.Ub,"Wrong table phase");l=g[1];Y.yt(this.Bg[l],"Item index out of range");this.Bg[l].update();var r=this.Bg[l].Xp(),u=new String(l);1!=this.behavior&&(u=this.WF(g,l,n));3!=this.behavior||n||this.eD(g);1==
this.behavior?this.hy(this.fg,l,g,!0):this.hy(this.oe,u,g,!0);this.dispatchEvent("onItemUpdate",[new va(this.wc.getName(l),l,this.Ra,r,g)]);"DELETE"==this.oe.get(u,this.Yb)&&this.oe.Pe(u)},hy:function(g,l,n,r){var u=n.length-2,E=1,t=2;for(n.hs={};E<=u;E++,t++)n[t]!==e?g.xd(n[t],l,E):r&&(n[t]=g.get(l,E),n.hs[t]=!0)},WF:function(g,l,n){if("undefined"==typeof g[this.keyCode+1]||"undefined"==typeof g[this.Yb+1])return f.Pa(k.resolve(923)),null;var r=g[this.keyCode+1]==e?l+" "+this.fg.get(l,this.keyCode):
l+" "+g[this.keyCode+1];if(n)g[this.keyCode+1]=e,g[this.Yb+1]==this.oe.get(r,this.Yb)?g[this.Yb+1]=e:(g.Yd.push(this.Yb),g.Yd.sort(b));else{g.Yd=[];for(n=2;n<g.length;n++)g[n]&&g[n]==e?g[n]=this.fg.get(l,n-1):this.fg.xd(g[n],l,n-1),g[n]==this.oe.get(r,n-1)?g[n]=e:g.Yd.push(n-1);if(3==this.behavior&&(l=this.Uu()+2,l>g.length))for(n=g.length;n<l;n++)g[n]=e}return r},eD:function(g){var l=g[1],n=g[this.keyCode+1]==e?this.fg.get(l,this.keyCode):g[this.keyCode+1];g=g[this.Yb+1];var r=this.pv(l,n);"DELETE"==
g?r&&this.ir(l,n):r||this.Ez(l,n)},iE:function(g){this.Vx=!0;this.ci=new Td(this,g)},pv:function(g,l){return null!==this.Ae.get(g,l)},ir:function(g,l){this.m.Ww(this.Ae.get(g,l));this.Ae.ej(g,l);this.ci.XE()},Ez:function(g,l){var n=new a(this.$I);n.iE(this);try{n.jf([l]),this.Ae.xd(n,g,l)}catch(r){this.dispatchEvent("onCommandSecondLevelSubscriptionError",[14,"The received key value is not a valid name for an Item",l]);return}this.qf?n.ni(this.qf.he()):n.Um(this.Cg.he());n.xg(this.js);n.Gr("yes");
n.pa=this.pa;n.addListener(new db(this,g,l));this.m.pt(n)},mI:function(g){this.Dk.lf(g)},Uu:function(){return this.Ra.rp()},addListener:function(g){this._callSuperMethod(a,"addListener",[g])},removeListener:function(g){this._callSuperMethod(a,"removeListener",[g])},yb:function(){return this._callSuperMethod(a,"getListeners")},Ar:function(g){this.behavior=g;switch(g){case 1:case 2:this.ci=new Vd(this);break;case 3:this.ci=new Ud(this);break;default:N.la(!1)}},Yi:function(g){this.ci.Yi(g)}};c.prototype.update=
function(){this.state==h.Os?this.state=h.Qs:this.state==h.Qs&&(this.state=h.Jy,this.Eu=!1)};c.prototype.Wo=function(){this.uu=!0};c.prototype.OI=function(){return null!=this.f.vc&&"no"!=this.f.vc};c.prototype.Xp=function(){return this.OI()?p.Ns==this.f.qc?this.Eu:p.yi==this.f.qc||p.Es==this.f.qc?!this.uu:!1:!1};var h={Os:0,Qs:1,Jy:2};a.prototype.isActive=a.prototype.zb;a.prototype.isSubscribed=a.prototype.je;a.prototype.setItems=a.prototype.jf;a.prototype.getItems=a.prototype.wp;a.prototype.setItemGroup=
a.prototype.Cr;a.prototype.getItemGroup=a.prototype.up;a.prototype.setFields=a.prototype.ni;a.prototype.getFields=a.prototype.Ll;a.prototype.setFieldSchema=a.prototype.Um;a.prototype.getFieldSchema=a.prototype.pp;a.prototype.getMode=a.prototype.Zf;a.prototype.setDataAdapter=a.prototype.xg;a.prototype.getDataAdapter=a.prototype.rj;a.prototype.setSelector=a.prototype.nI;a.prototype.getSelector=a.prototype.IC;a.prototype.setRequestedMaxFrequency=a.prototype.oi;a.prototype.getRequestedMaxFrequency=a.prototype.zj;
a.prototype.setRequestedBufferSize=a.prototype.Fr;a.prototype.getRequestedBufferSize=a.prototype.yj;a.prototype.setRequestedSnapshot=a.prototype.Gr;a.prototype.getRequestedSnapshot=a.prototype.HC;a.prototype.setCommandSecondLevelFields=a.prototype.Ex;a.prototype.getCommandSecondLevelFields=a.prototype.SB;a.prototype.setCommandSecondLevelFieldSchema=a.prototype.GH;a.prototype.getCommandSecondLevelFieldSchema=a.prototype.RB;a.prototype.setCommandSecondLevelDataAdapter=a.prototype.Dx;a.prototype.getCommandSecondLevelDataAdapter=
a.prototype.QB;a.prototype.getValue=a.prototype.G;a.prototype.getCommandValue=a.prototype.TB;a.prototype.getKeyPosition=a.prototype.$u;a.prototype.getCommandPosition=a.prototype.Nu;a.prototype.addListener=a.prototype.addListener;a.prototype.removeListener=a.prototype.removeListener;a.prototype.getListeners=a.prototype.yb;D(a,hb,!1,!0);D(a,wb,!0,!0);return a}(),Rf=k.s(p.Va);Sd.prototype={IF:function(a){this.f.Wt=a;this.f.O.subscribe()},OF:function(){this.f.O.unsubscribe()},Qx:function(a){this.f.Bf=
a},Lq:function(a){this.Qx(a)},ec:function(a,b){this.f.Ec=b;switch(a){case "ACTIVE":this.f.O.Ff();break;case "TRIGGERED":this.f.O.sf();break;default:throw a="Unknown status "+a+" ("+this.f.Bf+")",Rf.g(a),Error(a);}},ng:function(a,b){this.f.O.ng(a,b)},te:function(a,b){this.f.O.te(a,b)},MI:function(a,b){this.f.Ec=b;"ACTIVE"==a?this.f.O.OE():this.f.O.PE()},NI:function(){this.f.O.Sj()},Wn:function(){this.f.O.Wn()},SE:function(a){this.f.mode!=a&&(this.f.mode=a,this.qe("mode"))},jw:function(a){this.f.items!=
a&&(this.f.items=a,this.qe("group"))},nw:function(a){this.f.lb!=a&&(this.f.lb=a,this.qe("schema"))},iw:function(a){this.f.format!=a&&(this.f.format=a,this.qe("notification_format"))},ow:function(a){this.f.sf!=a&&(this.f.sf=a,this.qe("trigger"))},hw:function(a){this.f.Gf!=a&&(this.f.Gf=a,this.qe("adapter"))},lw:function(a){a=this.f.ct(a);this.f.cb!=a&&(this.f.cb=a,this.qe("requested_buffer_size"))},mw:function(a){a=this.f.dt(a);this.f.pa!=a&&(this.f.pa=a,this.qe("requested_max_frequency"))},TE:function(a){this.f.Ec!=
a&&(this.f.Ec=a,this.qe("status_timestamp"))},qe:function(a){this.f.dispatchEvent("onPropertyChanged",[a])}};var Re=function(){function a(e){this.f=e;this.state=c.Nd}function b(e,f,h){this.Vl();this.Bf=this.Gf=this.lb=this.items=this.sf=this.format=this.mode=null;this.Ec=0;this.cb=-1;this.pa=-2;this.Wt=!1;this.sq=!0;this.H=new Sd(this);this.O=new a(this);if("string"==typeof e||e instanceof String)this.fz(e,f,h);else if(e instanceof b)this.gz(e);else if(e instanceof mc)this.hz(e);else throw Error("Wrong arguments for MpnSubscription constructor");
}function c(e,f,h,g,l){this.zb=e;this.je=f;this.Zp=h;this.status=g;this.Sp=l}var d=k.s(p.Va);b.prototype={fz:function(e,f,h){e=(new String(e)).toUpperCase();if("MERGE"!=e&&"DISTINCT"!=e)throw new C("Only MERGE and DISTINCT modes are allowed for MPN subscriptions");this.mode=e;if(null!=f){if(null==h)throw new C(fa.Ps);I.isArray(f)?this.jf(f):this.jf([f]);this.ni(h)}else if(null!=h)throw new C(fa.$s);},hz:function(e){this.mode=e.qc;this.items=e.wc.pj();this.lb=e.Ra.pj();this.Gf=e.dj},gz:function(e){this.mode=
e.mode;this.items=e.items;this.lb=e.lb;this.format=e.format;this.sf=e.sf;this.Gf=e.Gf;this.Bf=e.Bf;this.cb=e.cb;this.pa=e.pa},addListener:function(e){this._callSuperMethod(b,"addListener",[e])},removeListener:function(e){this._callSuperMethod(b,"removeListener",[e])},yb:function(){return this._callSuperMethod(b,"getListeners")},Nl:function(){return this.format},bI:function(e){this.Ce();this.format=e},Gp:function(){return this.sf},yI:function(e){this.Ce();this.sf=e},zb:function(){return this.O.state.zb},
je:function(){return this.O.state.je},Zp:function(){return this.O.state.Zp},Ob:function(){return this.O.state.status},Dp:function(){return this.Ec},jf:function(e){this.Ce();fa.Nt(e,"An item");this.items=e.join(" ")},wp:function(){if(null==this.items)throw new O(fa.Rk);return this.items.split(" ")},Cr:function(e){this.Ce();this.items=null==e?null:String(e)},up:function(){if(null==this.items)throw new O(fa.Rk);return this.items},ni:function(e){this.Ce();fa.io(e,"A field");this.lb=e.join(" ")},Ll:function(){if(null==
this.lb)throw new O(fa.Sk);return this.lb.split(" ")},Um:function(e){this.Ce();this.lb=null==e?null:String(e)},pp:function(){if(null==this.lb)throw new O(fa.Sk);return this.lb},xg:function(e){this.Ce();this.Gf=e},rj:function(){return this.Gf},Fr:function(e){this.Ce();e=this.ct(e);if(isNaN(e))throw new C(fa.Ms);this.cb=e},ct:function(e){if(null==e)return-1;if("unlimited"==(new String(e)).toLowerCase())return 0;e=parseInt(e,10);return 0<e?e:NaN},yj:function(){return-1==this.cb?null:0==this.cb?"unlimited":
String(this.cb)},oi:function(e){this.Ce();e=this.dt(e);if(isNaN(e))throw new C("The given value is not valid for this setting; use null, 'unlimited' or a positive number instead");this.pa=e},dt:function(e){if(null==e)return-2;if("unlimited"==String(e).toLowerCase())return 0;e=parseFloat(e);return 0<e?e:NaN},zj:function(){return-2==this.pa?null:0==this.pa?"unlimited":String(this.pa)},Zf:function(){return this.mode},vd:function(){return this.Bf},Ce:function(){if(this.O.state.zb)throw new O("Cannot modify an active subscription, please unsubscribe before applying any change");
},mJ:function(){if(this.O.state==c.Nd||this.O.state==c.nd)throw new O("MpnSubscription is not active");}};c.Nd=new c(!1,!1,!1,"UNKNOWN","INACTIVE");c.Ei=new c(!0,!1,!1,"ACTIVE","SUBSCRIBING");c.Og=new c(!0,!0,!1,"SUBSCRIBED","SUBSCRIBED");c.Pg=new c(!0,!0,!0,"TRIGGERED","TRIGGERED");c.nd=new c(!0,!1,!1,"UNKNOWN","UNSUBSCRIBING");a.prototype={subscribe:function(){switch(this.state){case c.Nd:this.next(c.Ei,"subscribe");break;default:this.qa("subscribe")}},unsubscribe:function(){switch(this.state){case c.Ei:case c.Og:case c.Pg:this.next(c.nd,
"unsubscribe");break;default:this.qa("unsubscribe")}},Wn:function(){switch(this.state){case c.nd:this.next(c.Nd,"cancelSubscription");this.f.dispatchEvent("onUnsubscription");break;default:this.qa("cancelSubscription")}},Ff:function(){switch(this.state){case c.Ei:case c.Pg:this.next(c.Og,"activate");this.f.dispatchEvent("onSubscription");break;case c.nd:this.next(c.nd,"activate");this.f.dispatchEvent("onSubscription");break;case c.Og:break;default:this.qa("activate")}},sf:function(){switch(this.state){case c.Ei:case c.Og:this.next(c.Pg,
"trigger");this.f.dispatchEvent("onTriggered");break;case c.nd:this.next(c.nd,"trigger");this.f.dispatchEvent("onSubscription");break;case c.Pg:break;default:this.qa("trigger")}},Sj:function(){switch(this.state){case c.Og:case c.Pg:case c.nd:this.f.dispatchEvent("onUnsubscription");this.next(c.Nd,"onDelete");break;default:this.qa("onDelete")}},ng:function(e,f){switch(this.state){case c.Ei:case c.nd:this.f.dispatchEvent("onSubscriptionError",[e,f]);this.next(c.Nd,"onREQERR");break;default:this.qa("onREQERR")}},
te:function(e,f){switch(this.state){case c.nd:this.f.dispatchEvent("onUnsubscriptionError",[e,f]);this.next(c.Nd,"onREQERR");break;default:this.qa("onREQERR")}},OE:function(){this.state!=c.Nd&&this.qa("onAddAsSubscribed");this.next(c.Og,"onAddAsSubscribed");this.f.dispatchEvent("onSubscription")},PE:function(){this.state!=c.Nd&&this.qa("onAddAsTriggered");this.next(c.Pg,"onAddAsTriggered");this.f.dispatchEvent("onTriggered")},next:function(e,f){if(d.h()){var h=this.state.Sp,g=e.Sp;d.a(k.resolve(924),
this.f.Bf+" on '"+f+"': "+h+" -> "+g)}f=this.state;this.state=e;f.status!=e.status&&this.f.dispatchEvent("onStatusChanged",[this.state.status,this.f.Ec])},qa:function(e){e="Unexpected event '"+e+"' in state "+this.state.Sp+" ("+this.f.Bf+")";d.g(e);throw Error(e);}};b.prototype.getNotificationFormat=b.prototype.Nl;b.prototype.setNotificationFormat=b.prototype.bI;b.prototype.getTriggerExpression=b.prototype.Gp;b.prototype.setTriggerExpression=b.prototype.yI;b.prototype.isActive=b.prototype.zb;b.prototype.isSubscribed=
b.prototype.je;b.prototype.isTriggered=b.prototype.Zp;b.prototype.getStatus=b.prototype.Ob;b.prototype.getStatusTimestamp=b.prototype.Dp;b.prototype.setItems=b.prototype.jf;b.prototype.getItems=b.prototype.wp;b.prototype.setItemGroup=b.prototype.Cr;b.prototype.getItemGroup=b.prototype.up;b.prototype.setFields=b.prototype.ni;b.prototype.getFields=b.prototype.Ll;b.prototype.setFieldSchema=b.prototype.Um;b.prototype.getFieldSchema=b.prototype.pp;b.prototype.setDataAdapter=b.prototype.xg;b.prototype.getDataAdapter=
b.prototype.rj;b.prototype.setRequestedBufferSize=b.prototype.Fr;b.prototype.getRequestedBufferSize=b.prototype.yj;b.prototype.setRequestedMaxFrequency=b.prototype.oi;b.prototype.getRequestedMaxFrequency=b.prototype.zj;b.prototype.getMode=b.prototype.Zf;b.prototype.getSubscriptionId=b.prototype.vd;b.prototype.addListener=b.prototype.addListener;b.prototype.removeListener=b.prototype.removeListener;b.prototype.getListeners=b.prototype.yb;D(b,hb);return b}();Rd.prototype={dc:function(){try{this.c.O.dc()}catch(a){this.c.Ha(a)}},
ob:function(a){try{this.c.O.ob(a)}catch(b){this.c.Ha(b)}},Vj:function(a,b){try{this.c.O.Vj(a,b)}catch(c){this.c.Ha(c)}},Uj:function(a,b){this.c.O.Uj(a,b)},Lq:function(a,b){this.c.Fb.RF(a,b)},ng:function(a,b,c){this.c.Fb.ng(a,b,c)},Yj:function(a){this.c.Fb.Yj(a)},te:function(a,b,c){this.c.vf.te(a,b,c)}};mb.prototype={re:function(){this.ix=!0},Ge:function(){return this.ix||this.tf.ae}};D(mb,qb);uc.prototype={sd:function(){this.c.Eb.sk(this.rf)}};D(uc,mb);Xb.prototype={ba:function(a,b){this.query[a]=
encodeURIComponent(b)}};D(Zc,Xb);D(Yc,Xb);tc.prototype={sd:function(){this.c.Eb.tx(this.rf,this.TA,this.f)}};D(tc,mb);D(Xc,Xb);Wb.prototype={sd:function(){this.c.Eb.ux(this.rf,this.filter)},re:function(){this._callSuperMethod(Wb,"onResponse");this.c.Eb.QF(this.filter)}};D(Wb,mb);D(Wc,Xb);sc.prototype={sd:function(){this.c.Eb.vx(this.rf,this.f)}};D(sc,mb);Pd.prototype={hu:function(){this.tf.ae=!0;this.tf=new Qd},sk:function(a){var b=new Zc(this.c.oa),c=new uc(a,this.c,this.tf);this.c.Fa.th().then(function(d){d.wr(b,
c)})},tx:function(a,b,c){var d=new Yc(b,this.c.oa.td(),c),e=new tc(a,b,c,this.c,this.tf);this.c.Fa.th().then(function(f){f.ur(d,e)})},vx:function(a,b){var c=new Wc(this.c.oa.td(),b),d=new sc(a,b,this.c,this.tf);this.c.Fa.th().then(function(e){e.vr(c,d)})},ux:function(a,b){var c=new Xc(this.c.oa.td(),b.filter),d=new Wb(a,b,this.c,this.tf);this.c.Fa.th().then(function(e){e.tr(c,d)})},oH:function(){this.c.Fb.dJ();this.c.vf.ms();this.c.ti.ms()},QF:function(a){this.c.ti.PF(a)}};Od.prototype={bJ:function(){var a=
this;this.listener={ae:!1,onItemUpdate:function(b){if(!this.ae)try{var c=b.G("status"),d=parseInt(b.G("status_timestamp"),10);a.c.oa.H.ec(c,d)}catch(e){a.c.Ha(e)}}};this.f=new mc("MERGE","DEV-"+this.c.oa.deviceId,["status","status_timestamp"]);this.f.xg(this.c.oa.dl);this.f.oi("unfiltered");this.f.addListener(this.listener);this.c.Fa.subscribe(this.f)},dy:function(){null!=this.f&&(this.c.Fa.unsubscribe(this.f),this.f.removeListener(this.listener),this.listener.ae=!0,this.listener=this.f=null)}};Nd.prototype=
{cJ:function(){var a=this;this.listener={ae:!1,onItemUpdate:function(b){if(!this.ae)try{switch(b.G("command")){case "UPDATE":a.pg(b);break;case "ADD":a.vq(b);break;case "DELETE":a.Sj(b)}}catch(c){a.c.Ha(c)}},onEndOfSnapshot:function(){if(!this.ae)try{a.c.Fb.Sh()}catch(b){a.c.Ha(b)}}};this.f=new mc("COMMAND","SUBS-"+this.c.oa.deviceId,["key","command"]);this.f.xg(this.c.oa.dl);this.f.oi("unfiltered");this.f.Ex("status status_timestamp notification_format trigger group schema adapter mode requested_buffer_size requested_max_frequency".split(" "));
this.f.Dx(this.c.oa.dl);this.f.addListener(this.listener);this.c.Fa.subscribe(this.f)},ey:function(){null!=this.f&&(this.c.Fa.unsubscribe(this.f),this.f.removeListener(this.listener),this.listener.ae=!0,this.listener=this.f=null)},pg:function(a){var b=this,c=this.Ep(a);this.c.v.qB(c,{hg:function(){b.GA(c,a)},jn:function(d){b.MA(d,a)}})},MA:function(a,b){var c=a.sq;if(c||b.Zc("mode")){var d=b.G("mode");a.H.SE(d)}if(c||b.Zc("group"))d=b.G("group"),a.H.jw(d);if(c||b.Zc("schema"))d=b.G("schema"),a.H.nw(d);
if(c||b.Zc("adapter"))d=b.G("adapter"),a.H.hw(d);if(c||b.Zc("notification_format"))d=b.G("notification_format"),a.H.iw(d);if(c||b.Zc("trigger"))d=b.G("trigger"),a.H.ow(d);if(c||b.Zc("requested_buffer_size"))d=b.G("requested_buffer_size"),a.H.lw(d);if(c||b.Zc("requested_max_frequency"))d=b.G("requested_max_frequency"),a.H.mw(d);if(c||b.Zc("status_timestamp")){var e=b.G("status_timestamp");e=null==e?0:parseInt(e,10);a.H.TE(e)}if(c||b.Zc("status"))d=b.G("status"),e=b.G("status_timestamp"),e=null==e?
0:parseInt(e,10),a.H.ec(d,e);c&&(a.sq=!1)},GA:function(a,b){var c=b.G("mode"),d=b.G("group"),e=b.G("schema"),f=b.G("adapter"),h=b.G("notification_format"),g=b.G("trigger"),l=b.G("requested_buffer_size"),n=b.G("requested_max_frequency"),r=b.G("status");b=parseInt(b.G("status_timestamp"),10);c=new Re(c);c.H.jw(d);c.H.nw(e);c.H.hw(f);c.H.iw(h);c.H.ow(g);c.H.lw(l);c.H.mw(n);c.H.Qx(a);c.H.MI(r,b);c.sq=!1;this.c.Fb.BF(a,c)},Sj:function(a){a=this.Ep(a);this.c.Fb.Sj(a)},vq:function(a){a=this.Ep(a);this.c.Fb.QE(a)},
Ep:function(a){return a.G("key").substring(4)}};Ua.prototype={add:function(a){this.Sb.push(a)},addAll:function(a){for(var b=0,c=a.size();b<c;b++)this.add(a.get(b))},remove:function(a){for(var b=0,c=this.Sb.length;b<c;b++)if(this.Sb[b]==a)return this.Sb.splice(b,1),!0;return!1},contains:function(a){for(var b=0,c=this.Sb.length;b<c;b++)if(this.Sb[b]==a)return!0;return!1},clear:function(){this.Sb.splice(0)},get:function(a){return this.Sb[a]},av:function(){return 0==this.Sb.length?null:this.Sb[this.Sb.length-
1]},size:function(){return this.Sb.length},ac:function(){return 0==this.Sb.length}};qc.prototype={get:function(a){return this.map[a]},put:function(a,b){this.map[a]=b},remove:function(a){var b=this.map[a];delete this.map[a];return b},clear:function(){for(var a in this.map)delete this.map[a]},au:function(a){return null!=this.get(a)},values:function(){var a=new Ua,b;for(b in this.map)a.add(this.map[b]);return a}};Ld.prototype={add:function(a){this.set[a]||(this.set[a]=!0,this.size++)},remove:function(a){var b=
!!this.set[a];b&&(delete this.set[a],this.size--);return b},contains:function(a){return!!this.set[a]},clear:function(){for(var a in this.set)delete this.set[a];this.size=0},ac:function(){return 0==this.size}};Jd.prototype={put:function(a,b){this.W.put(a,new Md(b))},remove:function(a){return this.W.remove(a)},values:function(){for(var a=new Ua,b=this.W.values(),c=0,d=b.size();c<d;c++){var e=b.get(c);a.add(e.f)}return a},clear:function(){this.W.clear()},Ap:function(a){for(var b=this.W.values(),c=0,
d=b.size();c<d;c++){var e=b.get(c);if(e.f==a)return e}return null}};Md.prototype={dI:function(a){Y.assert(null==this.m);this.m=a},um:function(a){null!=this.m&&(this.m.um(a),this.m=null)}};var bb=k.s(p.Va);Kd.prototype={reset:function(){this.next(rc,"reset");this.Tf.clear()},rF:function(a){bb.h()&&bb.debug("Server subscription added subId="+a);switch(this.state){case rc:this.Tf.add(a);this.next(Sc,"ADD");break;case Sc:this.Tf.add(a);break;case nc:case Tc:break;default:this.qa("onNewServerSubscription (subId="+
a+")")}},Sh:function(){switch(this.state){case rc:this.Uf("empty EOS");this.next(Tc,"EOS");break;case Sc:this.Tf.ac()?(this.next(nc,"EOS"),this.hg()):this.next(nc,"EOS");break;default:this.qa("onEndOfSnapshot")}},CF:function(a){bb.h()&&bb.debug("Server subscription subscribed subId="+a);switch(this.state){case Sc:this.Tf.remove(a);break;case nc:this.Tf.remove(a);this.Tf.ac()&&this.hg();break;case Tc:this.Uf("UPD");break;default:this.qa("onSeverSubscriptionOK (subId="+a+")")}},hg:function(){switch(this.state){case nc:this.Uf("EOS");
this.next(Tc,"EMPTY");break;default:this.qa("onEmpty")}},Uf:function(a){bb.h()&&bb.debug("onSubscriptionsUpdated ("+this.c.td()+") fired event="+a);null!=this.c.oa&&this.c.oa.H.KF()},next:function(a,b){bb.h()&&bb.debug("OnSubscriptionsUpdated state change ("+this.c.td()+") on '"+b+"': "+this.state.name+" -> "+a.name);this.state=a},qa:function(a){a="Unexpected event '"+a+"' in state "+this.state.name+" ("+this.c.td()+")";bb.g(a);throw Error(a);}};var rc=new Fc("INIT"),Sc=new Fc("NOT_EMPTY"),nc=new Fc("EOS"),
Tc=new Fc("DONE"),Vb=k.s(p.Va);Id.prototype={reset:function(){this.c.v.clear();this.W.clear();this.ma.clear();this.se.reset()},Li:function(a){this.ma.add(a)},aH:function(a){return this.ma.remove(a)},dJ:function(){for(var a=this.ma.size(),b=0;b<a;b++){var c=this.ma.get(b);this.subscribe(c)}this.ma.clear()},Ap:function(a){return this.W.Ap(a)},subscribe:function(a){var b=G.$v();this.W.put(b,a);this.c.Eb.tx(0,b,a)},Sh:function(){this.se.Sh()},ng:function(a,b,c){var d=this.W.remove(a);null==d?Vb.warn("Discarded unexpected subscription error subId="+
a):(d.f.H.ng(b,c),d.um(!1))},RF:function(a,b){var c=this.W.remove(a);null==c?Vb.warn("Discarded unexpected subscription: subId="+a):(a=c.f,this.c.v.add(b,a),a.H.Lq(b),this.se.Uf("MPNOK"),c.um(!0))},BF:function(a,b){this.c.v.add(a,b);this.se.CF(a)},QE:function(a){this.c.v.je(a)||this.se.rF(a)},Yj:function(a){Vb.h()&&Vb.debug("MPNDEL subId="+a);this.c.vf.Yj(a)},Sj:function(a){var b=this;this.c.v.remove(a,{hg:function(){Vb.warn("MpnSubscription not found subId="+a)},jn:function(c){c.H.NI()},Kn:function(){b.se.Uf("DELETE")}})},
te:function(a,b,c){var d=this;this.c.v.remove(a,{hg:function(){Vb.warn("MPN subscription not found subId="+a)},jn:function(e){e.H.te(b,c)},Kn:function(){d.se.Uf("REQERR")}})},ob:function(a){a?(this.ma.addAll(this.W.values()),this.W.clear()):(this.ma.clear(),this.W.clear(),this.c.v.clear(),this.se.Uf("Session close"));this.se.reset()}};Hd.prototype={Bj:function(a){for(var b=new Ua,c=null==a||"ALL"==a,d=this.v.values(),e=0,f=d.size();e<f;e++){var h=d.get(e).av();(c||h.Ob()==a)&&b.add(h)}return b},bp:function(a){a=
this.v.get(a);return null==a?null:a.av()},je:function(a){return this.v.au(a)},add:function(a,b){var c=this.v.get(a);null==c&&(c=new Ua,this.v.put(a,c));c.add(b)},remove:function(a,b){a=this.v.remove(a);this.forEach(a,b)},clear:function(){this.v.clear()},qB:function(a,b){a=this.v.get(a);this.forEach(a,b)},forEach:function(a,b){if(null==a||a.ac())null!=b.hg&&b.hg();else{if(null!=b.jn)for(var c=0,d=a.size();c<d;c++){var e=a.get(c);b.jn(e)}null!=b.Kn&&b.Kn()}}};Gd.prototype={reset:function(){this.W.clear();
this.ma.clear()},Li:function(a){this.ma.add(new pe(a))},ms:function(){for(var a=0,b=this.ma.size();a<b;a++){var c=this.ma.get(a);this.unsubscribe(c)}this.ma.clear()},unsubscribe:function(a){Y.assert(!this.W.contains(a));this.W.add(a);this.c.Eb.ux(0,a)},PF:function(a){a=this.W.remove(a);Y.assert(a)},ob:function(a){a?this.ma.addAll(this.W):this.ma.clear();this.W.clear()}};var Sf=k.s(p.Va);lb.prototype={reset:function(){this.W.clear();this.ma.clear()},Li:function(a){this.ma.add(a)},ms:function(){for(var a=
0,b=this.ma.size();a<b;a++){var c=this.ma.get(a);this.unsubscribe(c)}this.ma.clear()},unsubscribe:function(a){var b=a.vd();Y.assert(null!=b);Y.assert(!this.W.au(b));this.W.put(b,a);this.c.Eb.vx(0,a)},Yj:function(a){this.W.remove(a)},te:function(a,b,c){null==this.W.remove(a)?Sf.warn("Discarded unexpected unsubscription error subId="+a):this.c.Fb.te(a,b,c)},ob:function(a){a?this.ma.addAll(this.W.values()):this.ma.clear();this.W.clear()}};var Ed=k.s(p.Va);qe.prototype={er:function(a){this.O.register(a)},
subscribe:function(a,b){try{a.H.IF(b),this.O.subscribe(a)}catch(c){this.Ha(c)}},unsubscribe:function(a){a.mJ();try{a.H.OF(),this.O.unsubscribe(a)}catch(b){this.Ha(b)}},ls:function(a){this.O.ls(a)},Bj:function(a){return this.v.Bj(a)},bp:function(a){return this.v.bp(a)},td:function(){return null==this.oa?null:this.oa.deviceId},Ha:function(a){this.Fa.th().then(function(b){b.Ha(a)})}};J.Lg=0;J.Di=1;J.Od=2;J.Pd=3;J.oc=4;J.Je=[];J.Je[J.Lg]="NO_SESSION";J.Je[J.Di]="SESSION_OK";J.Je[J.Od]="READY";J.Je[J.Pd]=
"REGISTERING";J.Je[J.oc]="REGISTERED";J.prototype={dc:function(){switch(this.state){case J.Lg:this.next(J.Di,"onSessionStart");break;case J.Od:this.c.Eb.sk(0);this.next(J.Pd,"onSessionStart");break;default:this.qa("onSessionStart")}},ob:function(a){this.c.Ho.dy();this.c.Vr.ey();this.c.Eb.hu();this.c.Fb.ob(a);this.c.vf.ob(a);this.c.ti.ob(a);null!=this.c.oa&&this.c.oa.H.ob(a);switch(this.state){case J.Lg:this.next(J.Lg,"onSessionClose");break;case J.Di:this.next(J.Lg,"onSessionClose");break;case J.Od:this.next(J.Od,
"onSessionClose");break;case J.Pd:this.next(J.Od,"onSessionClose");break;case J.oc:this.next(J.Od,"onSessionClose")}},register:function(a){switch(this.state){case J.Lg:this.mk(a);this.next(J.Od,"register");break;case J.Di:this.mk(a);this.c.Eb.sk(0);this.next(J.Pd,"register");break;case J.Od:this.mk(a);this.next(J.Od,"register");break;case J.Pd:this.mk(a);this.c.Eb.sk(0);this.next(J.Pd,"register");break;case J.oc:this.mk(a),this.c.Eb.sk(0),this.next(J.Pd,"register")}},Vj:function(a,b){switch(this.state){case J.Pd:this.c.oa.H.Vj(a,
b);this.c.Eb.oH();this.c.Ho.bJ();this.c.Vr.cJ();this.next(J.oc,"onRegisterOK");break;default:this.qa("onRegisterOK")}},Uj:function(a,b){switch(this.state){case J.Pd:this.c.oa.H.Uj(a,b);this.next(J.Di,"onRegisterError");break;default:this.qa("onRegisterError")}},subscribe:function(a){switch(this.state){case J.oc:this.c.Fb.subscribe(a);break;default:this.c.Fb.Li(a)}},unsubscribe:function(a){switch(this.state){case J.oc:var b=this.c.Fb.Ap(a);if(null==b)this.c.vf.unsubscribe(a);else{var c=this;b.dI({um:function(d){d&&
c.c.vf.unsubscribe(a)}})}break;default:this.c.Fb.aH(a)?a.H.Wn():this.c.vf.Li(a)}},ls:function(a){switch(this.state){case J.oc:this.c.ti.unsubscribe(new pe(a));break;default:this.c.ti.Li(a)}},mk:function(a){this.c.Ho.dy();this.c.Vr.ey();this.c.Eb.hu();this.c.Fb.reset();this.c.vf.reset();this.c.ti.reset();this.c.oa=a},next:function(a,b){if(Ed.h()){var c=J.Je[this.state],d=J.Je[a];Ed.a(k.resolve(925),this.c.td(),"on '"+b+"': "+c+" -> "+d)}this.state=a},qa:function(a){a="Unexpected event '"+a+"' in state "+
J.Je[this.state]+" ("+this.c.td()+")";Ed.g(a);throw Error(a);}};var Tf=function(){function a(f,h){this.C=a;this._callSuperConstructor(a);this.ol=new v;this.Ao=new aa;this.connectionOptions=this.ol;this.connectionDetails=this.Ao;this.connectionSharing=of(this);this.Ja=new Zb;this.rc=this.ol;this.Kc=this.Ao;f&&this.Kc.Ox(f);h&&this.Kc.Bx(h);this.Ja.mi(this);this.rc.mi(this);this.Kc.mi(this);this.Gb=new ee(this.rc);this.zg=this.ga=null;this.jj=this.Bk=0;this.sJ=++d;this.X=new fe;this.Mj=p.Jg;this.ll=
null;this.ky={};V.Xg(this);this.c=new qe(this)}var b=k.s(p.on),c=k.s(p.Ic),d=0,e=/^[a-zA-Z0-9_]*$/;a.zz=function(){};a.YB=function(){if(L.cg()){var f=[];(void 0).forEach(function(h){f.push(h.toString())});return f}};a.kf=function(f){k.kf(f)};a.yy=p.xy;a.zy=p.Is+" build "+p.Hg;a.simulateSilence=function(f){wc.LI(f)};a.prototype={toString:function(){return["[|LightstreamerClient",this.sJ,this.Z,this.lK,"]"].join("|")},Tm:function(f){this.ga=f;this.Gb.Fk(f);this.X.Fk(f);this.Hx=this.jj;this.ll=x.Wg(f.fo,
5E3,f)},Ut:function(){this.ga&&(this.ky[this.ga.Xf()]=!0,this.Gb.Fk(null),this.X.Fk(null),this.ll&&(x.pf(this.ll),this.ll=null),this.ga.ca(),this.ga=null,this.$e&&(this.$e.ca(),this.$e=null),this.Ja.Zi?this.Pn(p.vn):this.Pn(p.Jg));this.search&&(this.search.stop(),this.search=null)},Zg:function(f,h,g){this.ga&&this.ga.pw(f,h,g);return!0},fw:function(f,h){h!=this.Ja&&this.dispatchEvent("onPropertyChange",[f])},Ro:function(f){if(this.xE)throw new O("Sharing is not available when MPN is enabled");var h=
L.Rb()?navigator.userAgent.toLowerCase():null;null==h||-1==h.indexOf("ucbrowser")&&-1==h.indexOf("ubrowser")?(this.jj++,x.u(this.su,0,this,[f,this.jj]),this.JI=null!=f):c.i(k.resolve(926))},su:function(f,h){if(h==this.jj)if(this.Bk++,this.Ut(),(this.zg=f)&&!f.Yl()&&c.i(k.resolve(927)),f&&f.Yl()){h=this.Bk;var g=this,l=f.jB(this);this.search=l;this.search.find(this.ky).then(function(n){h==g.Bk&&(1==g.search.rm&&g.zg.rm(),null===n?g.Kr(h,l.mp()):g.Tm(n))},function(){h==g.Bk&&g.dispatchEvent("onShareAbort")})}else null==
f&&this.Ja.Zi&&this.Kr()},QA:function(f,h){if(this.Hx==this.jj)if(this.Ut(),V.$p()||V.Za())b.i(k.resolve(928));else if(this.zg){b.i(k.resolve(930));var g=null;2>=this.Ja.Oe||(f?g=1E4:(g=200+500*I.Gd(this.Ja.Oe),5E3<g&&(g=5E3)));f=this.zg.oA(g,h);this.su(f,this.Hx)}else N.ia(),b.g(k.resolve(929))},uf:function(){this.disconnect();this.ga&&this.ga.Vt()},Kr:function(f,h){if(!f||f==this.Bk)return this.Tm(new rb(this)),this.$e=new Wd(this.Ja,this.rc,this.Kc,this.zg,this.ga,h,this.c),this.ga.Gx(this.$e.Xf()),
this.ga.qI(this.$e.ud()),this.ga},Kj:function(){return null!=this.$e},connect:function(){if(!this.Kc.tk)throw new O("Configure the server address before trying to connect");b.i(k.resolve(931));x.u(this.Kz,0,this)},Kz:function(){if(!this.Mj||this.Mj==p.Jg){null!=this.zg&&this.zg.Yl()||this.$e||this.Kr();b.a(k.resolve(932));this.Ja.ka("connectionRequested",!0);var f=this.ga;f&&f.Dt()}},disconnect:function(){b.i(k.resolve(933));x.u(this.Lz,0,this)},Lz:function(){b.a(k.resolve(934));this.Ja.ka("connectionRequested",
!1);var f=this.ga;f&&f.Et()},Ob:function(){return this.Mj},ki:function(f,h,g,l,n){if(!h)h=p.pc;else if(!e.test(h))throw new C("The given sequence name is not valid, use only alphanumeric characters plus underscore, or null");g=g||0==g?this.S(g,!0):null;n=this.Ka(n,!0);x.u(this.Jz,0,this,[f,h,l,g,n])},Jz:function(f,h,g,l,n){this.ga&&this.ga.Cc?this.X.oj(f,h,g,l):n?this.X.SA(f,h,g,l):g&&this.X.fireEvent("onAbort",g,[f,!1])},sH:function(f,h){this.dispatchEvent("onServerError",[f,h])},Rm:function(){this.Gb.eG();
this.X.bA()},tH:function(){this.Gb.cD();this.X.bD();this.th().resolve(this.$e)},Pn:function(f){f!=this.Mj&&(this.Mj=f,this.dispatchEvent("onStatusChange",[f]))},rk:function(f){return this.ga&&this.ga.Cc?(this.ga.Ku(f),!0):!1},Bd:function(){this.dispatchEvent("onServerKeepalive")},Bj:function(){var f=[],h=this.Gb.mc,g;for(g in h)h[g].Vx||f.push(h[g]);return f},subscribe:function(f){this.Gb.pt(f)},unsubscribe:function(f){this.Gb.Ww(f)},addListener:function(f){this._callSuperMethod(a,"addListener",[f])},
removeListener:function(f){this._callSuperMethod(a,"removeListener",[f])},yb:function(){return this._callSuperMethod(a,"getListeners")},th:function(){null==this.Tv&&(this.Tv=G.defer());return this.Tv},er:function(f){if(this.JI)throw new O("MPN is not available when sharing is enabled");if(null==f)throw new C("Device cannot be null");this.oa=f;this.c.er(f);this.xE=!0},aJ:function(f,h){if(null==f)throw new C("MpnSubscription is null");if(null==f.lb)throw new C("Invalid MpnSubscription, please specify a field list or field schema");
if(null==f.items)throw new C("Invalid MpnSubscription, please specify an item list or item group");if(null==f.Nl())throw new C("Invalid MpnSubscription, please specify a notification format");if(f.zb())throw new O("MpnSubscription is already active");if(null==this.oa)throw new O("No MPN device registered");this.c.subscribe(f,!!h)},tJ:function(f){if(!f.zb())throw new O("MpnSubscription is not active");if(null==this.oa)throw new O("No MPN device registered");this.c.unsubscribe(f)},uJ:function(f){if(null!=
f&&"ALL"!=f&&"SUBSCRIBED"!=f&&"TRIGGERED"!=f)throw new C("The given value is not valid for this setting. Use null, ALL, TRIGGERED or SUBSCRIBED instead");if(null==this.oa)throw new O("No MPN device registered");this.c.ls(f)},qC:function(f){if(null!=f&&"ALL"!=f&&"SUBSCRIBED"!=f&&"TRIGGERED"!=f)throw new C("The given value is not valid for this setting. Use null, ALL, TRIGGERED or SUBSCRIBED instead");if(null==this.oa)throw new O("No MPN device registered");return this.c.Bj(f).Sb},kB:function(f){if(null==
f)throw new C("Subscription id must be not null");return this.c.bp(f)},fD:function(f,h,g,l){this.ol.sD(f,h,g,l);f=new mc("MERGE",g,["status"]);f.xg(h);f.Gr("yes");var n=this;f.addListener({onItemUpdate:function(r){r=r.G("status");console.log("STATUS",r);r&&"connected"!=r&&(r=n.ga)&&r.Ft()}});x.u(this.subscribe,0,this,[f])}};a.__restoreWs=ja.kx;a.__disableWs=ja.gj;a.__handleError5=p.dD;a.addCookies=a.zz;a.getCookies=a.YB;a.setLoggerProvider=a.kf;a.LIB_NAME=a.yy;a.LIB_VERSION=a.zy;a.prototype.connect=
a.prototype.connect;a.prototype.disconnect=a.prototype.disconnect;a.prototype.getStatus=a.prototype.Ob;a.prototype.sendMessage=a.prototype.ki;a.prototype.getSubscriptions=a.prototype.Bj;a.prototype.subscribe=a.prototype.subscribe;a.prototype.unsubscribe=a.prototype.unsubscribe;a.prototype.addListener=a.prototype.addListener;a.prototype.removeListener=a.prototype.removeListener;a.prototype.getListeners=a.prototype.yb;a.prototype.registerForMpn=a.prototype.er;a.prototype.subscribeMpn=a.prototype.aJ;
a.prototype.unsubscribeMpn=a.prototype.tJ;a.prototype.unsubscribeMpnSubscriptions=a.prototype.uJ;a.prototype.findMpnSubscription=a.prototype.kB;a.prototype.getMpnSubscriptions=a.prototype.qC;a.prototype.handleRemoteAdapterStatus=a.prototype.fD;a.prototype.enableSharing=a.prototype.Ro;a.prototype.isMaster=a.prototype.Kj;a.prototype.unloadEvent=a.prototype.uf;a.prototype.preUnloadEvent=a.prototype.uf;D(a,hb,!1,!0);D(a,wb,!0,!0);return a}(),qa=function(){var a={FATAL:5,ERROR:4,WARN:3,INFO:2,DEBUG:1},
b={priority:function(c){return a[c]||0}};b.priority=b.priority;return b}(),oc=function(){function a(b,c){this.oq=qa.priority(b)?b:"INFO";this.Jt=c||"*";this.pq=null}a.prototype={kf:function(b){b&&b.uj&&b.Ju&&(this.pq=b)},log:function(){},Xi:function(b,c,d,e){return b+" | "+c+" | "+e+" | "+d},sh:function(){return this.oq},zk:function(b){this.oq=b=qa.priority(b)?b:"INFO";null!=this.pq&&this.pq.Ju()},lp:function(){return this.Jt},BH:function(b){this.Jt=b||"*"}};a.prototype.log=a.prototype.log;a.prototype.setLoggerProvider=
a.prototype.kf;a.prototype.composeLine=a.prototype.Xi;a.prototype.getLevel=a.prototype.sh;a.prototype.setLevel=a.prototype.zk;a.prototype.getCategoryFilter=a.prototype.lp;a.prototype.setCategoryFilter=a.prototype.BH;return a}(),Uc=function(){function a(b,c,d){this._callSuperConstructor(a,[b,c]);this.qv=!d||0>d?0:d;this.first=0;this.Fh=-1;this.buffer={}}a.prototype={reset:function(){this.first=0;this.Fh=-1;this.buffer={}},Zo:function(b){b=this.xp(null,b);this.reset();return b},xp:function(b,c,d){var e=
"";b?(b=this.Fh-b+1,b<this.first&&(b=this.first)):b=this.first;c=c||"\n";for(d=qa.priority(d||"DEBUG");b<=this.Fh;)qa.priority(this.buffer[b].level)>=d&&(e+=this.buffer[b].tE),e+=c,b++;return e},log:function(b,c,d,e){var f=++this.Fh;0!=this.qv&&f>=this.qv&&(this.buffer[this.first]=null,this.first++);d=this.Xi(b,c,d,e);this.buffer[f]={level:c,tE:d}},$b:function(){return this.Fh-this.first+1}};a.prototype.reset=a.prototype.reset;a.prototype.getLog=a.prototype.xp;a.prototype.extractLog=a.prototype.Zo;
a.prototype.log=a.prototype.log;a.prototype.getLength=a.prototype.$b;D(a,oc);return a}(),Uf=function(){function a(b,c,d){this._callSuperConstructor(a,[b,c,10]);this.waiting=!1;if(!d)throw new C("a LightstreamerClient instance is necessary for a RemoteAppender to work.");this.bt=d}a.prototype={log:function(b,c,d,e){this._callSuperMethod(a,"log",[b,c,d,e]);this.ht(!0)},ht:function(b){if(!(0>=this.$b())){if(0==this.bt.Ob().indexOf("CONNECTED")){var c=this.cB();if(this.bt.rk(c)){this.reset();this.waiting=
!1;return}}this.waiting&&b||(this.waiting=!0,x.u(this.ht,2E3,this))}},cB:function(b,c){b=this._callSuperMethod(a,"extractLog",["LS_log"]);b=b.split("LS_log");c="LS_log";for(var d={},e=0;e<b.length;e++)0!=b[e].length&&(d[c+(e+1)]=encodeURIComponent(b[e].replace(/[\n\r\f]/g,"||")));return d},Zo:function(){return null}};a.prototype.extractLog=a.prototype.Zo;a.prototype.log=a.prototype.log;D(a,Uc,!1,!0);return a}();cb.prototype={ob:function(a){a||(this.ta.O.ob(),this.ta.deviceId=null,this.ta.dl=null,
this.ta.Ec=0)},Vj:function(a,b){this.ta.deviceId=a;this.ta.dl=b},Uj:function(a,b){this.ta.O.error(a,b)},ec:function(a,b){switch(a){case "ACTIVE":this.ta.O.Ff(b);break;case "SUSPENDED":this.ta.O.suspend(b)}},KF:function(){this.ta.dispatchEvent("onSubscriptionsUpdated")}};var Vf=function(){function a(e){this.ta=e;this.state=c.Qg}function b(e,f,h){if(null==e)throw new C("Please specify a valid device token");if(null==f)throw new C("Please specify a valid application ID");if("Google"!=h&&"Apple"!=h)throw new C("Please specify a valid platform: Google or Apple");
this.Vl();this.Io=e;this.appId=f;this.platform=h;this.deviceId=null;this.Ec=0;try{this.Fm=window.localStorage.getItem("com.lightstreamer.mpn.device_token"),window.localStorage.setItem("com.lightstreamer.mpn.device_token",e)}catch(g){this.Fm=null,d.error("Local storage not available",g)}this.H=new cb(this);this.O=new a(this)}function c(e,f,h){this.Vp=e;this.Yp=f;this.status=h}var d=k.s(p.Va);b.prototype={addListener:function(e){this._callSuperMethod(b,"addListener",[e])},removeListener:function(e){this._callSuperMethod(b,
"removeListener",[e])},yb:function(){return this._callSuperMethod(b,"getListeners")},vC:function(){return this.platform},JB:function(){return this.appId},aC:function(){return this.Io},wC:function(){return this.Fm},Vp:function(){return this.O.state.Vp},Yp:function(){return this.O.state.Yp},Ob:function(){return this.O.state.status},Dp:function(){return this.Ec},td:function(){return this.deviceId}};c.Qg=new c(!1,!1,"UNKNOWN");c.oc=new c(!0,!1,"REGISTERED");c.Tk=new c(!0,!0,"SUSPENDED");a.prototype={Ff:function(e){this.ta.Ec=
e;switch(this.state){case c.Qg:this.next(c.oc,"activate");this.ta.dispatchEvent("onRegistered");break;case c.Tk:this.next(c.oc,"activate");this.ta.dispatchEvent("onResumed");break;case c.oc:break;default:this.qa("activate")}},suspend:function(e){this.ta.Ec=e;switch(this.state){case c.Qg:this.next(c.Tk,"suspend");this.ta.dispatchEvent("onSuspended");break;case c.oc:this.next(c.Tk,"suspend");this.ta.dispatchEvent("onSuspended");break;case c.Tk:break;default:this.qa("suspend")}},error:function(e,f){switch(this.state){case c.Qg:this.next(c.Qg,
"error");this.ta.dispatchEvent("onRegistrationFailed",[e,f]);break;default:this.qa("error ("+e+" - "+f+")")}},ob:function(){this.next(c.Qg,"onSessionClose")},next:function(e,f){if(d.h()){var h=this.state.status,g=e.status;d.a(k.resolve(935),this.ta.deviceId+" on '"+f+"': "+h+" -> "+g)}e!=this.state&&(this.state=e,this.ta.dispatchEvent("onStatusChanged",[this.state.status,this.ta.Ec]))},qa:function(e){e="Unexpected event '"+e+"' in state "+this.state.status+" ("+this.ta.deviceId+")";d.g(e);throw Error(e);
}};b.prototype.getPlatform=b.prototype.vC;b.prototype.getApplicationId=b.prototype.JB;b.prototype.getDeviceToken=b.prototype.aC;b.prototype.getPreviousDeviceToken=b.prototype.wC;b.prototype.isRegistered=b.prototype.Vp;b.prototype.isSuspended=b.prototype.Yp;b.prototype.getStatus=b.prototype.Ob;b.prototype.getStatusTimestamp=b.prototype.Dp;b.prototype.getDeviceId=b.prototype.td;b.prototype.addListener=b.prototype.addListener;b.prototype.removeListener=b.prototype.removeListener;b.prototype.getListeners=
b.prototype.yb;D(b,hb);return b}();ba.prototype={ar:function(a,b){a=this.Yf(a);for(var c in b)a[c]=b[c]},mf:function(a,b,c){null!=c?this.Yf(a)[b]=c:delete this.Yf(a)[b];return this},G:function(a,b){return this.Yf(a)[b]},Yf:function(a){var b=this.et;a=a.split(".");for(var c=0,d=a.length;c<d;c++){var e=a[c],f=b[e];null==f&&(f={},b[e]=f);b=f}return b},Si:function(){return this.et}};ba.prototype.putAll=ba.prototype.ar;ba.prototype.setValue=ba.prototype.mf;ba.prototype.getValue=ba.prototype.G;ba.prototype.getMap=
ba.prototype.Yf;ba.prototype.build=ba.prototype.Si;var Wf=function(){function a(b){b?(b=JSON.parse(b),this._callSuperConstructor(a,[b])):this._callSuperConstructor(a)}a.prototype={Si:function(){var b=this._callSuperMethod(a,"build");return JSON.stringify(b)},Fp:function(){return this.G("aps.alert","title")},Ir:function(b){return this.mf("aps.alert","title",b)},kp:function(){return this.G("aps.alert","body")},Br:function(b){return this.mf("aps.alert","body",b)},FB:function(){return this.G("aps.alert",
"action")},vH:function(b){return this.mf("aps.alert","action",b)},WC:function(){return this.G("aps","url-args")},AI:function(b){return this.mf("aps","url-args",b)}};a.prototype.build=a.prototype.Si;a.prototype.getTitle=a.prototype.Fp;a.prototype.setTitle=a.prototype.Ir;a.prototype.getBody=a.prototype.kp;a.prototype.setBody=a.prototype.Br;a.prototype.getAction=a.prototype.FB;a.prototype.setAction=a.prototype.vH;a.prototype.getUrlArguments=a.prototype.WC;a.prototype.setUrlArguments=a.prototype.AI;D(a,
ba);return a}(),Xf=function(){function a(b){b?(b=JSON.parse(b),this._callSuperConstructor(a,[b])):this._callSuperConstructor(a)}a.prototype={Si:function(){var b=this._callSuperMethod(a,"build");return JSON.stringify(b)},iC:function(){return this.G("webpush","headers")},SH:function(b){null!=b?this.ar("webpush.headers",b):delete this.Yf("webpush").headers;return this},Fp:function(){return this.G("webpush.notification","title")},Ir:function(b){return this.mf("webpush.notification","title",b)},kp:function(){return this.G("webpush.notification",
"body")},Br:function(b){return this.mf("webpush.notification","body",b)},kC:function(){return this.G("webpush.notification","icon")},YH:function(b){return this.mf("webpush.notification","icon",b)},getData:function(){return this.G("webpush","data")},setData:function(b){null!=b?this.ar("webpush.data",b):delete this.Yf("webpush").data;return this}};a.prototype.build=a.prototype.Si;a.prototype.getHeaders=a.prototype.iC;a.prototype.setHeaders=a.prototype.SH;a.prototype.getTitle=a.prototype.Fp;a.prototype.setTitle=
a.prototype.Ir;a.prototype.getBody=a.prototype.kp;a.prototype.setBody=a.prototype.Br;a.prototype.getIcon=a.prototype.kC;a.prototype.setIcon=a.prototype.YH;a.prototype.getData=a.prototype.getData;a.prototype.setData=a.prototype.setData;D(a,ba);return a}(),Se=[];Se="New value for setting received from internal settings{New value for setting received from API{Broadcasting setting to shared LightstreamerClient instances{Setting changed, firing notification{Wong length!{Missing from first array{Missing from second array{Wrong  element{Not expecting a NULL{Expecting a different value{Expecting 2 different values{Expecting a valid value{Expecting a not valid value{ASSERT failed{Unexpected{Unexpectedly missing session id{Bind request generated{Create request generated{Recovery request generated{Destroy request generated{Force rebind request generated{New engine created{Engine{Subscribing subscription{Unsubscribing subscription{Enqueueing subscription update{Resuming subscription update{Executing subscription update{sending Subscription to the engine{Overriding old promise for table {Delaying subscription completion{Resuming subscription completion{Ignored old promise triggered for table {Ignored old promise failed for table {Restoring all pending Subscriptions{Pausing active Subscription{Pausing all active Subscriptions{Delaying subscription action{Resuming subscription action{Executing subscription action{Delaying subscription action{Resuming subscription action{Subscription action had to be delayed on multiple instances{An error occurred while executing an event on a listener{Dispatching event on listeners{Changing reference session{Command phase check{Adding notification{Unexpected progressive{Skipping replicated progressive{Unexpected progressive{Received event prog higher than expected{Received event prog different than expected{Received event prog different than actual{Unexpected message outcome sequence{Unexpected command received, ignoring{There is probably another web application connected to the same Lightstreamer Server within this browser instance. That could prevent the current application from connecting to the Server. Please close the other application to unblock the current one{New client attached to engine{Dismissing client{Can't find subscription anymore{Can't find page anymore{Client or session unexpectedly disappeared while handling subscription{Notify back to the client that the subscription was handled{It has been detected that the JavaScript engine of this browser is not respecting the timeouts in setTimeout method calls. The Client has been disconnected from the Server in order to avoid reconnection loops. To try again, just refresh the page.{New WS connection oid={Closing WebSocket connection{Error closing WebSocket connection{Unexpected openSocket call{Error opening WebSocket connection{Timeout event [currentConnectTimeoutWS]{error on closing a timed out WS{Unexpected WebSocket _load call{Preparing to bind on WebSocket connection{Open path is disappeared{WebSocket transport sending oid={Error sending data over WebSocket{Unexpected send outcome while websocket is ready-to-send{WebSocket transport receiving oid={Error on WebSocket connection oid={WebSocket connection ready{WebSocket connection close event received{New sessionId{New session{Copying prog {Resetting session oid={Session state change{Mad timeouts? Avoid connection{Opening on server, send destroy{Opening new session{Unexpected phase during binding of session{Binding session{Binding session{Switch requested{Unexpected creation of a session while another one is still creating{Slow requested{Unexpected phase during slow handling{Closing session{Session shutdown{Make pause before next bind{Timeout event{Start session recovery. Cause: no response timeLeft={Start new session. Cause: no response{Timeout: switch transport{Timeout: recover session{Timeout: new session{Unexpected timeout event while session is _OFF{Error event{Start session recovery. Cause: socket failure while receiving{Start new session. Cause: socket failure while receiving{Start session recovery. Cause: socket failure while recovering{Switching transport{Start new session. Cause: {Unexpected loop event while session is an non-active status{Unexpected push event while session is an non-active status{Unexpected phase after create request sent{Unexpected phase after bind request sent{Status timeout in {Unexpected phase during OK execution{Unexpected empty start time{Synch event received{Available bandwidth event received{Error41 event received{Keepalive event received{OK event received{Initializing session{Unexpected session id received on bind OK{Sync event received{Loop event received{Ignore error{End event received{Sending request to the server to force a rebind on the current connection{force_rebind request caused the error: {Sending request to the server to destroy the current session{destroy request caused the error: {constrain request {New CORS-XHR connection oid={CORS-XHR connection closed oid={Error non closing connection opened using CORS-XHR{CORS-XHR transport sending oid={Error opening CORS-XHR connection oid={CORS-XHR transport receiving oid={CORS-XHR connection error oid={CORS-XHR request completed oid={Error reading CORS-XHR status oid={Closing connection opened using IEXSXHR{Error non closing connection opened using IEXSXHR{IEXSXHR transport sending{Error opening connection using IEXSXHR{Error on connection opened using IEXSXHR{IEXSXHR transport receiving{Connection opened using IEXSXHR completed{Closing connection opened using html form; actually doing nothing{Html form transport sending{Error while sending request using html form{Closing connection opened using replace on forever-frame{Replace on forever-frame transport sending{Replace on forever-frame not available{Error while sending request using  replace on forever-frame{Loading XHR frame to perform non-cross-origin requests{Client is offline, will retry later to load XHR frame{XHR frame loaded{XHR frame loading timeout expired, try to reload{XHR frame loading timeout expired again, will not try again{Passing request to the XHR frame{Error passing request to the XHR frame{XHR transport sending{Closing connection opened using XHR{Error closing connection opened using XHR{Error reading XHR status{XHR transport receiving{Error on connection opened using XHR{Error on disposing XHR's callback{Error on disposing XHR{Streaming enabled on XHR{XHR transport receiving{XHR transport receiving{Verify connection class{This class is not available on the current environment{Cross-origin request is needed, this class is not able to make cross-origin requests{Cookies on request are required, this class can't guarantee that cookies will be actually sent{Cross-protocol request is needed, this class is not able to make cross-protocol requests{Extra headers are given, this class is not able to send requests containing extra headers{This class can't be used in the current context{Connection class is good{Searching for an appropriate connection class{Restart connection selector{Client is offline, delaying connection to server{Unable to use available connections to connect to server{Unable to use available connections to connect to server{Connection request generated{Connection currently unavailable, delaying connection{Connection open to the server{Unexpected ws phase while opening connection{Open WebSocket to server{A control link was received while earlyWSOpenEnabled is set to true, a WebSocket was wasted.{Unexpected ws phase during binding{WebSockets currently unavailable, delaying connection{Unexpected WebSocket failure{Connection to server bound upon WebSocket{Connection to server open upon WebSocket{Unexpected phase for an clean end of a WS{Unexpected connection error on a connection that was not yet open{WebSocket was broken before it was used{WebSocket was broken while we were waiting the first bind{can't be unable-to-open since the connection is already open{WebSocket was broken while we were waiting{Sync message received while session wasn't in receiving status{First sync message, check not performed{Huge delay detected by sync signals. Restored from standby/hibernation?{No delay detected by sync signals{Delay detected by sync signals{No delay detected by sync signals{Duplicated message{Unexpected request type was given to this batch{Unexpected request type was given to this batch; expecting ADD REMOVE DESTROY CONSTRAIN or MPN{Storing request{Substituting CONSTRAINT/FORCE_REBIND/MPN request{Replacing 'second' ADD request with a REMOVE request for the same subscription{REMOVE request already stored, skipping{ADD request for the involved subscription was not yet sent; there is no need to send the related REMOVE request or the original ADD one, removing both{ADD after REMOVE?{Same session id on different servers, store two different DESTROY requests{Verified duplicated DESTROY request, skipping{Duplicated ADD or CHANGE_SUB request, substitute the old one with the new one{Storing confirmed{Trying to remove by index non-existent request{Trying to remove by key non-existent request{Batch length limit changed{Start sending reverse heartbeat to the server{Start sending reverse heartbeat to the server{Keep sending reverse heartbeat to the server{Preparing reverse heartbeat{Stop sending reverse heartbeat to the server{Stop sending reverse heartbeat to the server{Keep sending reverse heartbeat to the server{Close current connection if any and applicable{ControlConnectionHandler state change '{Reset Controls handler status{Batch handler unexpectedly idle; a batch was waiting{Batch handler unexpectedly not idle; nothing ready to be sent was found{Batch object not null{Enabling control requests over WebSocket now{Disabling control requests over WebSocket now{New request to be sent{Still waiting previous batch{Ready to dequeue{Waiting for dequeue{starting dequeuing{Send previous batch{Send new batch{Some requests don't need to be sent anymore, keep on dequeing{Delaying requests; waiting for a connection{Can't find a connection to send batch{Request sent through HTTP connection{Request sent through WebSocket, keep on dequeuing{Request queue is now empty{Duplicated message{Empty batch, exit{Ready to send batch, choosing connection{WebSocket should be available, try to send through it{Empty request was generated, exit{Unable to find a connection for control requests, will try again later{Connection for control batch chosen{Empty request for HTTP was generated, exit{Connection failed, will try a different connection{Connection temporarily unavailable, will try later{Unexpected sending outcome{Control request got answer{Control request got answer{Error from network{A single request size exceeds the <request_limit> configuration setting for the Server. Trying to send it anyway although it will be refused{Closing message handler{Activating message handler{Preparing message request{Forward prepared message to control handler{No ack was received for a message; forwarding it again to the control handler{Ack received for message{Ack received, stopping automatic retransmissions{Ack received, no outcome expected, clean structures{Not waiting for ack, purging{Message handled, clean structures{Message on the net notification{OK outcome received{DISCARDED outcome received{DENIED outcome received{ERROR outcome received{Enqueuing received data{Dequeuing received data{Data can't be handled{Unexpected error occurred while executing server-sent commands!{Malformed message: {Unexpected update{New session handler oid={SessionManager state change:{Session recovery{Session recovery: cancelled{Can't initiate session, giving up, disabling automatic reconnections{Unable to establish session of the current type. Switching session type{Unexpected fallback type; switching because the current session type cannot be established{Slow session detected. Switching session type{Unexpected fallback type; switching because of a slow connection was detected{Setting up new session type{Unexpected fallback type switching with new session{Switching current session type{Unexpected fallback type switching with a force rebind{Slow session switching{Failed to switch session type. Starting new session{Unexpected fallback type switching because of a failed force rebind{Session started{Session closed{Discarding update for dismissed page{Received new update{Discarding lost updates notification for dismissed page{Received lost updates event{Discarding end of snapshot notification for dismissed page{Received end of snapshot event{Discarding snapshot clearing notification for dismissed page{Received snapshot clearing event{Received server error event{Received subscription error event{Discarding subscription error notification for dismissed page{Received unsubscription event{Discarding unsubscription notification for dismissed page{Received reconfiguration OK event{Table of reconfiguration not found{Discarding subscription notification for dismissed page{Received subscription event{Received message ack{Received message-ok notification{Received message-deny notification{Received message-discarded notification{Received message-error notification{New control link received{unsubscription request {configuration request [{Fatal error: {Dismissing current session and stopping automatic reconnections.{Transport change requested{Opening a new session and starting automatic reconnections.{RUNNING EXECUTOR AT {Shared worker is broken{RESUMED TO {DELAYED TO {SharedWorker receiving error{SharedWorker sending error{Unexpected sharing error{Unexpected dispatching error{Unexpected error on dispatching{SharedStatus remote sharing is ready{SharedStatus local sharing is ready{Started refresh thread{Address already removed?{Removing wrong address?{Engine is probably dying, skip one cookie refresh{Checking status{No engines{Checking shared status to verify if there are similar engines alive{Engine found, no values though{Engine found, not compatible though{Write engine shared status{Found engine{There is a concurrent engine. Close engine {Stopped refresh thread{Remote engine{Trying to attach to a cross-page engine{Exception while trying to attach to a cross-page engine{You have Norton Internet Security or Norton\nPersonal Firewall installed on this computer.\nIf no real-time data show up, then you need\nto disable Ad Blocking in Norton Internet\nSecurity and then refresh this page{Cross-page engine not found{Probably blocked popup detected: firefox-safari case{Cross-page engine attached{Verify if the found cross-page engine can be used{can't use found cross-page engine: page is now closed{can't use found cross-page engine: uneffective popup detected, chrome case{problem closing the generated popup{Probably blocked popup detected: opera common case{can't use found cross-page engine: Lightstreamer singleton not available{can't use found cross-page engine: Lightstreamer singleton content unavailable{Ready to use found cross-page engine: looks ok{can't use found cross-page engine: exception throw while accessing it{Skipping already-used cookie{Stop search for an engine{No sharing was found, a new sharing will be created{No sharing was found, will keep on searching after a pause{No sharing was found, no sharing will be created, this client will fail{A sharing was found but attaching is disabled, this client will fail{A sharing was found, this will attach to{Engine{A sharing was found, but accordingly with the configuration it will be ignored{Searching for available sharing{Local engine found{Local engine not found. Can't search on other pages because of the current sharing configuration{Search remote engine in other page{RemoteEngine ={Can't access reference {Search remote engine in shared storage{Storage inspection complete{No valid engine found{Valid engine found: {Engine {Engine {invalid values{Unexpected missing values in sharing cookie{Skipping not compatible engine{Found a likely dead engine{Valid engine values found. Wait for popup-protection timeout{No compatible sharing detected{No valid engine values found. Check again in {Forcing preventCrossWindowShare because page is on file:///{New connection sharing{A new sharing will be immediately created{No way to obtain a sharing, this client will fail immediately{A sharing will now be searched{An exception was thrown while executing the Function passed to the forEachChangedField method{An exception was thrown while executing the Function passed to the forEachField method{Subscription reset{Subscription entered the active state{Subscription waiting to be sent to server{Subscription queued to be sent to server{Subscription is now on hold{Subscription exits the active status; it can now be modified{Subscription is now subscribed to{Subscription is not subscribed to anymore{Subscription request generated{Received position of COMMAND and KEY fields from server{Adapter Set assigned{Selector assigned{Requested Max Frequency assigned{Requested Buffer Size assigned{Snapshot Required assigned{Second level Data Adapter Set assigned{key and/or command position not correctly configured{MpnSubscription state change{MpnManager state change{Sharing is not available on UCBrowser{Connection sharing is not available{Page is closing, won't search a new engine{no sharing on mourning room?{Sharing lost, trying to obtain a new one{Connect requested{Executing connect{Disconnect requested{Executing disconnect{MpnDevice state change{Can't remove row that does not exist{Removing row{Postpone new update until the current update/remove is completed{Postpone new remove until the current update/remove is completed{Inserting new row{Updating row{Cleaning the model{New ChartLine{Clearing ChartLine{Repainting ChartLine{ChartLine re-painted{Calculated Y unit{Y labels generated{Y labels cleared{Y labels now configured{Line style configured{Y axis is now positioned{Painter configured{Chart is now ready to be used{A DOM element must be provided as an anchor for the chart{Creating a new label for the chart{Drawing line on the chart{New line coordinates{New line was drawn{Repaint All{Calculated X unit{X labels generated{X labels cleared{Got double nulls, clear line{Got a null, ignore point{Cannot create line. Please declare the Y axis{Line removed{Cleaned all{Parse html for Chart{X axis is now configured on field{Configuring multiple Y axis{Y axis is now configured on field{removing multiple Y axis{Y axis is now removed{X axis is now positioned{X labels now configured{Merging this update values with the values of the current update{Filling formatted values in cell{Scroll direction is ignored if sort is enabled{Exception thrown while executing the iterator Function{Cannot find the scroll element{Perform auto-scroll{Can't find value for sort key field{Calculate number of pages{Unexpected position of row to be wiped{New value for setting received from internal settings{New value for setting received from API{Broadcasting setting to shared LightstreamerClient instances{Setting changed, firing notification{Wong length!{Missing from first array{Missing from second array{Wrong  element{Not expecting a NULL{Expecting a different value{Expecting 2 different values{Expecting a valid value{Expecting a not valid value{ASSERT failed{Unexpected{Unexpectedly missing session id{Bind request generated{Create request generated{Recovery request generated{Destroy request generated{Force rebind request generated{New engine created{Engine{Subscribing subscription{Unsubscribing subscription{Enqueueing subscription update{Resuming subscription update{Executing subscription update{sending Subscription to the engine{Overriding old promise for table {Delaying subscription completion{Resuming subscription completion{Ignored old promise triggered for table {Ignored old promise failed for table {Restoring all pending Subscriptions{Pausing active Subscription{Pausing all active Subscriptions{Delaying subscription action{Resuming subscription action{Executing subscription action{Delaying subscription action{Resuming subscription action{Subscription action had to be delayed on multiple instances{An error occurred while executing an event on a listener{Dispatching event on listeners{Changing reference session{Command phase check{Adding notification{Unexpected progressive{Skipping replicated progressive{Unexpected progressive{Received event prog higher than expected{Received event prog different than expected{Received event prog different than actual{Unexpected message outcome sequence{Unexpected command received, ignoring{There is probably another web application connected to the same Lightstreamer Server within this browser instance. That could prevent the current application from connecting to the Server. Please close the other application to unblock the current one{New client attached to engine{Dismissing client{Can't find subscription anymore{Can't find page anymore{Client or session unexpectedly disappeared while handling subscription{Notify back to the client that the subscription was handled{It has been detected that the JavaScript engine of this browser is not respecting the timeouts in setTimeout method calls. The Client has been disconnected from the Server in order to avoid reconnection loops. To try again, just refresh the page.{New WS connection oid={Closing WebSocket connection{Error closing WebSocket connection{Unexpected openSocket call{Error opening WebSocket connection{Timeout event [currentConnectTimeoutWS]{error on closing a timed out WS{Unexpected WebSocket _load call{Preparing to bind on WebSocket connection{Open path is disappeared{WebSocket transport sending oid={Error sending data over WebSocket{Unexpected send outcome while websocket is ready-to-send{WebSocket transport receiving oid={Error on WebSocket connection oid={WebSocket connection ready{WebSocket connection close event received{New sessionId{New session{Copying prog {Resetting session oid={Session state change{Mad timeouts? Avoid connection{Opening on server, send destroy{Opening new session{Unexpected phase during binding of session{Binding session{Binding session{Switch requested{Unexpected creation of a session while another one is still creating{Slow requested{Unexpected phase during slow handling{Closing session{Session shutdown{Make pause before next bind{Timeout event{Start session recovery. Cause: no response timeLeft={Start new session. Cause: no response{Timeout: switch transport{Timeout: recover session{Timeout: new session{Unexpected timeout event while session is _OFF{Error event{Start session recovery. Cause: socket failure while receiving{Start new session. Cause: socket failure while receiving{Start session recovery. Cause: socket failure while recovering{Switching transport{Start new session. Cause: {Unexpected loop event while session is an non-active status{Unexpected push event while session is an non-active status{Unexpected phase after create request sent{Unexpected phase after bind request sent{Status timeout in {Unexpected phase during OK execution{Unexpected empty start time{Synch event received{Available bandwidth event received{Error41 event received{Keepalive event received{OK event received{Initializing session{Unexpected session id received on bind OK{Sync event received{Loop event received{Ignore error{End event received{Sending request to the server to force a rebind on the current connection{force_rebind request caused the error: {Sending request to the server to destroy the current session{destroy request caused the error: {constrain request {New CORS-XHR connection oid={CORS-XHR connection closed oid={Error non closing connection opened using CORS-XHR{CORS-XHR transport sending oid={Error opening CORS-XHR connection oid={CORS-XHR transport receiving oid={CORS-XHR connection error oid={CORS-XHR request completed oid={Error reading CORS-XHR status oid={Closing connection opened using IEXSXHR{Error non closing connection opened using IEXSXHR{IEXSXHR transport sending{Error opening connection using IEXSXHR{Error on connection opened using IEXSXHR{IEXSXHR transport receiving{Connection opened using IEXSXHR completed{Closing connection opened using html form; actually doing nothing{Html form transport sending{Error while sending request using html form{Closing connection opened using replace on forever-frame{Replace on forever-frame transport sending{Replace on forever-frame not available{Error while sending request using  replace on forever-frame{Loading XHR frame to perform non-cross-origin requests{Client is offline, will retry later to load XHR frame{XHR frame loaded{XHR frame loading timeout expired, try to reload{XHR frame loading timeout expired again, will not try again{Passing request to the XHR frame{Error passing request to the XHR frame{XHR transport sending{Closing connection opened using XHR{Error closing connection opened using XHR{Error reading XHR status{XHR transport receiving{Error on connection opened using XHR{Error on disposing XHR's callback{Error on disposing XHR{Streaming enabled on XHR{XHR transport receiving{XHR transport receiving{Verify connection class{This class is not available on the current environment{Cross-origin request is needed, this class is not able to make cross-origin requests{Cookies on request are required, this class can't guarantee that cookies will be actually sent{Cross-protocol request is needed, this class is not able to make cross-protocol requests{Extra headers are given, this class is not able to send requests containing extra headers{This class can't be used in the current context{Connection class is good{Searching for an appropriate connection class{Restart connection selector{Client is offline, delaying connection to server{Unable to use available connections to connect to server{Unable to use available connections to connect to server{Connection request generated{Connection currently unavailable, delaying connection{Connection open to the server{Unexpected ws phase while opening connection{Open WebSocket to server{A control link was received while earlyWSOpenEnabled is set to true, a WebSocket was wasted.{Unexpected ws phase during binding{WebSockets currently unavailable, delaying connection{Unexpected WebSocket failure{Connection to server bound upon WebSocket{Connection to server open upon WebSocket{Unexpected phase for an clean end of a WS{Unexpected connection error on a connection that was not yet open{WebSocket was broken before it was used{WebSocket was broken while we were waiting the first bind{can't be unable-to-open since the connection is already open{WebSocket was broken while we were waiting{Sync message received while session wasn't in receiving status{First sync message, check not performed{Huge delay detected by sync signals. Restored from standby/hibernation?{No delay detected by sync signals{Delay detected by sync signals{No delay detected by sync signals{Duplicated message{Unexpected request type was given to this batch{Unexpected request type was given to this batch; expecting ADD REMOVE DESTROY CONSTRAIN or MPN{Storing request{Substituting CONSTRAINT/FORCE_REBIND/MPN request{Replacing 'second' ADD request with a REMOVE request for the same subscription{REMOVE request already stored, skipping{ADD request for the involved subscription was not yet sent; there is no need to send the related REMOVE request or the original ADD one, removing both{ADD after REMOVE?{Same session id on different servers, store two different DESTROY requests{Verified duplicated DESTROY request, skipping{Duplicated ADD or CHANGE_SUB request, substitute the old one with the new one{Storing confirmed{Trying to remove by index non-existent request{Trying to remove by key non-existent request{Batch length limit changed{Start sending reverse heartbeat to the server{Start sending reverse heartbeat to the server{Keep sending reverse heartbeat to the server{Preparing reverse heartbeat{Stop sending reverse heartbeat to the server{Stop sending reverse heartbeat to the server{Keep sending reverse heartbeat to the server{Close current connection if any and applicable{ControlConnectionHandler state change '{Reset Controls handler status{Batch handler unexpectedly idle; a batch was waiting{Batch handler unexpectedly not idle; nothing ready to be sent was found{Batch object not null{Enabling control requests over WebSocket now{Disabling control requests over WebSocket now{New request to be sent{Still waiting previous batch{Ready to dequeue{Waiting for dequeue{starting dequeuing{Send previous batch{Send new batch{Some requests don't need to be sent anymore, keep on dequeing{Delaying requests; waiting for a connection{Can't find a connection to send batch{Request sent through HTTP connection{Request sent through WebSocket, keep on dequeuing{Request queue is now empty{Duplicated message{Empty batch, exit{Ready to send batch, choosing connection{WebSocket should be available, try to send through it{Empty request was generated, exit{Unable to find a connection for control requests, will try again later{Connection for control batch chosen{Empty request for HTTP was generated, exit{Connection failed, will try a different connection{Connection temporarily unavailable, will try later{Unexpected sending outcome{Control request got answer{Control request got answer{Error from network{A single request size exceeds the <request_limit> configuration setting for the Server. Trying to send it anyway although it will be refused{Closing message handler{Activating message handler{Preparing message request{Forward prepared message to control handler{No ack was received for a message; forwarding it again to the control handler{Ack received for message{Ack received, stopping automatic retransmissions{Ack received, no outcome expected, clean structures{Not waiting for ack, purging{Message handled, clean structures{Message on the net notification{OK outcome received{DISCARDED outcome received{DENIED outcome received{ERROR outcome received{Enqueuing received data{Dequeuing received data{Data can't be handled{Unexpected error occurred while executing server-sent commands!{Malformed message: {Unexpected update{New session handler oid={SessionManager state change:{Session recovery{Session recovery: cancelled{Can't initiate session, giving up, disabling automatic reconnections{Unable to establish session of the current type. Switching session type{Unexpected fallback type; switching because the current session type cannot be established{Slow session detected. Switching session type{Unexpected fallback type; switching because of a slow connection was detected{Setting up new session type{Unexpected fallback type switching with new session{Switching current session type{Unexpected fallback type switching with a force rebind{Slow session switching{Failed to switch session type. Starting new session{Unexpected fallback type switching because of a failed force rebind{Session started{Session closed{Discarding update for dismissed page{Received new update{Discarding lost updates notification for dismissed page{Received lost updates event{Discarding end of snapshot notification for dismissed page{Received end of snapshot event{Discarding snapshot clearing notification for dismissed page{Received snapshot clearing event{Received server error event{Received subscription error event{Discarding subscription error notification for dismissed page{Received unsubscription event{Discarding unsubscription notification for dismissed page{Received reconfiguration OK event{Table of reconfiguration not found{Discarding subscription notification for dismissed page{Received subscription event{Received message ack{Received message-ok notification{Received message-deny notification{Received message-discarded notification{Received message-error notification{New control link received{unsubscription request {configuration request [{Fatal error: {Dismissing current session and stopping automatic reconnections.{Transport change requested{Opening a new session and starting automatic reconnections.{RUNNING EXECUTOR AT {Shared worker is broken{RESUMED TO {DELAYED TO {SharedWorker receiving error{SharedWorker sending error{Unexpected sharing error{Unexpected dispatching error{Unexpected error on dispatching{SharedStatus remote sharing is ready{SharedStatus local sharing is ready{Started refresh thread{Address already removed?{Removing wrong address?{Engine is probably dying, skip one cookie refresh{Checking status{No engines{Checking shared status to verify if there are similar engines alive{Engine found, no values though{Engine found, not compatible though{Write engine shared status{Found engine{There is a concurrent engine. Close engine {Stopped refresh thread{Remote engine{Trying to attach to a cross-page engine{Exception while trying to attach to a cross-page engine{You have Norton Internet Security or Norton\nPersonal Firewall installed on this computer.\nIf no real-time data show up, then you need\nto disable Ad Blocking in Norton Internet\nSecurity and then refresh this page{Cross-page engine not found{Probably blocked popup detected: firefox-safari case{Cross-page engine attached{Verify if the found cross-page engine can be used{can't use found cross-page engine: page is now closed{can't use found cross-page engine: uneffective popup detected, chrome case{problem closing the generated popup{Probably blocked popup detected: opera common case{can't use found cross-page engine: Lightstreamer singleton not available{can't use found cross-page engine: Lightstreamer singleton content unavailable{Ready to use found cross-page engine: looks ok{can't use found cross-page engine: exception throw while accessing it{Skipping already-used cookie{Stop search for an engine{No sharing was found, a new sharing will be created{No sharing was found, will keep on searching after a pause{No sharing was found, no sharing will be created, this client will fail{A sharing was found but attaching is disabled, this client will fail{A sharing was found, this will attach to{Engine{A sharing was found, but accordingly with the configuration it will be ignored{Searching for available sharing{Local engine found{Local engine not found. Can't search on other pages because of the current sharing configuration{Search remote engine in other page{RemoteEngine ={Can't access reference {Search remote engine in shared storage{Storage inspection complete{No valid engine found{Valid engine found: {Engine {Engine {invalid values{Unexpected missing values in sharing cookie{Skipping not compatible engine{Found a likely dead engine{Valid engine values found. Wait for popup-protection timeout{No compatible sharing detected{No valid engine values found. Check again in {Forcing preventCrossWindowShare because page is on file:///{New connection sharing{A new sharing will be immediately created{No way to obtain a sharing, this client will fail immediately{A sharing will now be searched{An exception was thrown while executing the Function passed to the forEachChangedField method{An exception was thrown while executing the Function passed to the forEachField method{Subscription reset{Subscription entered the active state{Subscription waiting to be sent to server{Subscription queued to be sent to server{Subscription is now on hold{Subscription exits the active status; it can now be modified{Subscription is now subscribed to{Subscription is not subscribed to anymore{Subscription request generated{Received position of COMMAND and KEY fields from server{Adapter Set assigned{Selector assigned{Requested Max Frequency assigned{Requested Buffer Size assigned{Snapshot Required assigned{Second level Data Adapter Set assigned{key and/or command position not correctly configured{MpnSubscription state change{MpnManager state change{Sharing is not available on UCBrowser{Connection sharing is not available{Page is closing, won't search a new engine{no sharing on mourning room?{Sharing lost, trying to obtain a new one{Connect requested{Executing connect{Disconnect requested{Executing disconnect{MpnDevice state change{Can't remove row that does not exist{Removing row{Postpone new update until the current update/remove is completed{Postpone new remove until the current update/remove is completed{Inserting new row{Updating row{Cleaning the model{New ChartLine{Clearing ChartLine{Repainting ChartLine{ChartLine re-painted{Calculated Y unit{Y labels generated{Y labels cleared{Y labels now configured{Line style configured{Y axis is now positioned{Painter configured{Chart is now ready to be used{A DOM element must be provided as an anchor for the chart{Creating a new label for the chart{Drawing line on the chart{New line coordinates{New line was drawn{Repaint All{Calculated X unit{X labels generated{X labels cleared{Got double nulls, clear line{Got a null, ignore point{Cannot create line. Please declare the Y axis{Line removed{Cleaned all{Parse html for Chart{X axis is now configured on field{Configuring multiple Y axis{Y axis is now configured on field{removing multiple Y axis{Y axis is now removed{X axis is now positioned{X labels now configured{Merging this update values with the values of the current update{Filling formatted values in cell{Scroll direction is ignored if sort is enabled{Exception thrown while executing the iterator Function{Cannot find the scroll element{Perform auto-scroll{Can't find value for sort key field{Calculate number of pages{Unexpected position of row to be wiped".split("{");
k.resolve=function(a){return a+"] "+Se[a]};S.nC=function(a){return k.resolve(a)};k.resolve=k.resolve;S.getMessage=S.nC;var Yf=function(){function a(){this._callSuperConstructor(a);this.pk={}}a.prototype={xd:function(b,c,d){"undefined"==typeof this.pk[d]&&(this.pk[d]=c,this._callSuperMethod(a,"insert",[b,c,d]))},ej:function(b,c){this._callSuperMethod(a,"del",[b,c]);delete this.pk[c]},ku:function(b){var c=this.pk[b];"undefined"!=typeof c&&this.ej(c,b)},Pe:function(b){var c=this.Ea(b),d;for(d in c)delete this.pk[d];
this._callSuperMethod(a,"delRow",[b])}};a.prototype.insert=a.prototype.xd;a.prototype.del=a.prototype.ej;a.prototype.delReverse=a.prototype.ku;a.prototype.delRow=a.prototype.Pe;D(a,Oa);return a}(),pc=function(){function a(c){this._callSuperConstructor(a);this.kind="ITEM_IS_KEY";this.vo=this.em=null;this.De=0;this.$o=null;this.values=new Oa;this.parsed=!1;this.id=c;this.jy(!0);this.St=this.Rt=!1;this.cl=0;this.Ih=null;this.gp=!1;this.wf=null;this.cn=[];this.Sc=[];this.mj={};this.ee=this.zl=0;this.dm=
new Yf}var b=k.s("lightstreamer.grids");a.Hs="ITEM_IS_KEY";a.Ty="UPDATE_IS_KEY";a.prototype={Ma:function(){return this.id},jo:function(){if(!this.parsed)throw new O("Please parse html before calling this method");},xq:function(c){var d=c.Yu(),e=c.vp();this.De++;e=null==d?e:d;d=this.$D()?e:this.eb()?this.De:e+" "+c.G(this.em);var f={};this.eb()?c.Hu(this.Tu(f)):c.Cl(this.Tu(f));this.Nv()&&"DELETE"==f[this.vo]?this.di(d):(this.ps(d,f),this.dm.xd(!0,e,d))},tm:function(c,d){c=null==c?d:c;d=this.dm.Ea(c);
this.dm.Pe(c);for(var e in d)this.di(e)},dd:function(){0==this.cl&&this.Rt&&this.w();this.Nv()&&!this.em&&(this.em=this.Ih.$u(),this.vo=this.Ih.Nu());this.cl++},fc:function(){this.cl--;0==this.cl&&this.St&&this.w()},pe:function(c){this.Ih||(this.Ih=c,this.gp||this.Ot());c.je()&&this.dd()},yq:function(c){c.je()&&this.fc()},Ot:function(){if(this.Ih){var c=this.Ih;if("MERGE"==c.Zf()||"RAW"==c.Zf())this.kind="ITEM_IS_KEY";else if("DISTINCT"==c.Zf())this.kind="UPDATE_IS_KEY";else{this.kind="KEY_IS_KEY";
try{c.Ll(),this.em="key",this.vo="command"}catch(d){}}}else this.kind="ITEM_IS_KEY"},Tu:function(c){var d=this;return function(e,f,h){null===d.$o&&(d.$o=null==e);c[d.$o?f:e]=h}},$D:function(){return"ITEM_IS_KEY"==this.kind},eb:function(){return"UPDATE_IS_KEY"==this.kind},Nv:function(){return"KEY_IS_KEY"==this.kind},fv:function(){return this.ee>=this.Sc.length?null:this.Sc[this.ee]},$w:function(c){var d=this.mj[c];delete this.mj[c];this.Sc[d]=null;this.zl++;if(d==this.ee){for(;null===this.Sc[this.ee]&&
this.ee<this.Sc.length;)this.ee++;if(this.ee>=this.Sc.length){this.Sc=[];this.mj={};this.ee=this.zl=0;return}}if(100<=this.zl)for(this.mj={},c=this.Sc,this.Sc=[],d=this.zl=this.ee=0;d<c.length;d++)null!==c[d]&&this.Yv(c[d])},Yv:function(c){this.mj[c]=this.Sc.length;this.Sc.push(c)},di:function(c){this.jo();if(this.wf)this.yA(c);else if(this.values.Ea(c)){b.h()&&b.a(k.resolve(937),c,this);this.wf={};var d=null;try{this.Hd(c),this.values.Pe(c),this.dm.ku(c),this.eb()&&this.$w(c)}catch(e){d=e}this.wf=
null;this.nu();if(null!==d)throw d;}else b.Pa(k.resolve(936),c,this)},fy:function(c,d){b.h()&&b.a(k.resolve(938),this);this.cn.push({type:2,key:c,LE:d})},yA:function(c){b.h()&&b.a(k.resolve(939),this);this.cn.push({type:1,key:c})},nu:function(){for(;0<this.cn.length;){var c=this.cn.shift();1==c.type?this.di(c.key):this.ps(c.key,c.LE)}},ps:function(c,d){this.jo();if(this.wf)c==this.wf?this.lm(c,d):this.fy(c,d);else{this.wf=c;var e=null;try{if(this.Ld(c,d),this.values.Ea(c)){b.h()&&b.a(k.resolve(941),
c,this);for(var f in d)this.values.xd(d[f],c,f)}else b.h()&&b.a(k.resolve(940),c,this),this.eb()&&this.Yv(c),this.values.insertRow(d,c)}catch(h){e=h}this.wf=null;this.nu();if(null!==e)throw e;}},w:function(){b.i(k.resolve(942),this);var c=[];this.values.fp(function(e){c.push(e)});for(var d=0;d<c.length;d++)this.di(c[d])},G:function(c,d){return this.values.get(c,d)},yH:function(c,d){this.Rt=this.Ka(c);this.St=this.Ka(d)},zc:function(){},Ld:function(){},Hd:function(){},lm:function(){}};a.prototype.onItemUpdate=
a.prototype.xq;a.prototype.onClearSnapshot=a.prototype.tm;a.prototype.onSubscription=a.prototype.dd;a.prototype.onUnsubscription=a.prototype.fc;a.prototype.onListenStart=a.prototype.pe;a.prototype.onListenEnd=a.prototype.yq;a.prototype.removeRow=a.prototype.di;a.prototype.updateRow=a.prototype.ps;a.prototype.clean=a.prototype.w;a.prototype.getValue=a.prototype.G;a.prototype.setAutoCleanBehavior=a.prototype.yH;a.prototype.parseHtml=a.prototype.zc;a.prototype.updateRowExecution=a.prototype.Ld;a.prototype.removeRowExecution=
a.prototype.Hd;a.prototype.mergeUpdate=a.prototype.lm;D(a,hb,!1,!0);D(a,wb,!0,!0);return a}(),ra=function(){function a(m,q){this.I=m;this.Sa=!0;this.xl=0;q||(q=this.VC());q?0==q.toLowerCase().indexOf("style.")?(m=q.slice(6),this.vi=f(m),this.fi=h(m)):(this.vi=u(q),this.fi=E(q)):m.nodeName.toLowerCase()in y?(this.vi=g,this.fi=l):(this.vi=n,this.fi=r);this.Ui=z++;this.De=0;this.yd=this.zd=this.eg=null;this.qD=this.fi(!0);this.oD=this.I.className;this.pD=this.Bu()}function b(m,q){if(!1===a.gn)return c(m,
q);if(!0===a.gn)return m.getAttribute(q);var B=c(m,q);if(B)return a.gn=!1,B;if(B=m.getAttribute(q))a.gn=!0;return B}function c(m,q){return m.dataset?m.dataset[q]?m.dataset[q]:m.getAttribute("data-"+q):m.getAttribute("data-"+q)}function d(m,q){if(!m)return q;for(var B in q)m[B]||null===m[B]||""===m[B]||(m[B]=q[B]);return m}function e(m){return(m=b(m,"source"))&&"lightstreamer"==m.toLowerCase()}function f(m){return function(q){this.I.style[m]="\u00a0"===q?null:q}}function h(m){return function(){return this.I.style[m]||
""}}function g(m){this.I.value=m&&"\u00a0"!==m?m:""}function l(){return this.I.value}function n(m,q){q?this.I.innerHTML=m:1!=this.I.childNodes.length||3!=this.I.firstChild.nodeType?(null!=this.I.firstChild&&(this.I.innerHTML=""),this.I.appendChild(document.createTextNode(m))):this.I.firstChild.nodeValue=m}function r(m){return m?this.I.innerHTML:this.I.firstChild?this.I.firstChild.nodeValue:""}function u(m){return"value"===m?g:function(q){q&&"\u00a0"!==q?this.I.setAttribute(m,q):this.I.removeAttribute(m)}}
function E(m){return"value"===m?l:function(){return this.I.getAttribute(m)}}L.Mc();var t={extra:!0,"first-level":!0,"second-level":!0},y={input:!0,textarea:!0},z=0;a.PJ=1;a.Nk=2;a.uy="first-level";a.Qy="second-level";a.gn=null;a.Ml=function(m,q){var B=[];q||(q=["*"]);for(var K=0;K<q.length;K++)for(var Z=m.getElementsByTagName(q[K]),X=0;X<Z.length;X++)e(Z[X])&&B.push(new a(Z[X]));return B};a.ly=e;a.Ye=function(m){for(var q=null;null!=m&&m!=document;)q=m,m=m.parentNode;return null==m?null!=q&&"HTML"==
q.nodeName?!0:!1:!0};a.prototype={pr:function(m,q){this.vi(m.fi(),q);this.eg=m.eg;this.zd=m.zd;this.yd=m.yd;this.De=m.De;this.Sm(m.Bu());this.os(m.I.className);this.xl=m.xl},sj:function(){return this.I},Bu:function(){var m={},q;for(q in this.I.style)m[q]=this.I.style[q];return m},os:function(m){null!==m&&this.I.className!=m&&(this.I.className=m)},Sm:function(m){if(m)for(var q in m){"CLASS"==q&&this.os(m[q]);try{null!==m[q]&&(this.I.style[q]=m[q])}catch(B){}}},If:function(m,q){m==this.De&&(1==q?(this.Sm(this.zd),
this.zd=null):(this.Sm(this.yd),this.yd=null))},Jf:function(m,q){m==this.De&&(this.vi(this.eg,q),this.eg=null,this.If(m,1))},zI:function(){this.De++;return this.De},da:function(){var m=b(this.I,"field");return m?m:null},Vc:function(){var m=b(this.I,"replica");return m?m:null},Ru:function(){var m=b(this.I,"fieldtype");if(!m)return"first-level";m=m.toLowerCase();return t[m]?m:"first-level"},mv:function(){return b(this.I,"grid")},Ea:function(){var m=b(this.I,"item");m||(m=b(this.I,"row"));return m},
VC:function(){return b(this.I,"update")},Mp:function(){return++this.xl},op:function(){return this.xl},Iv:function(m){return m.I===this.I},Ye:function(){return a.Ye(this.I)},uv:function(){return this.I.id?document.getElementById(this.I.id)===this.I:this.Ye(this.I)},Er:function(m){this.eg=""===m?"\u00a0":m},Ki:function(m,q,B){this.zd||(this.zd={});this.yd||(this.yd={});this.zd[B]=m||"";this.yd[B]=q||""},tC:function(m){m&&(this.zd=d(this.zd,m));return this.zd},sC:function(m){m&&(this.yd=d(this.yd,m));
return this.yd},w:function(){this.vi(this.qD,!0);this.os(this.oD);this.Sm(this.pD)}};return a}(),Zf=function(){function a(d,e,f,h){this.parent=e;this.MJ=h;this.iq=this.Vq="black";this.gm=this.$h=1;this.nn=this.kd=this.Gc=null;this.Rh=0;this.Ab=null;this.ln=[];this.xs=[];this.labels=[];this.Vz=c++;b.a(k.resolve(943),this)}var b=k.s("lightstreamer.charts"),c=0;a.prototype={toString:function(){return["[|ChartLine",this.parent,"]"].join("|")},Ma:function(){return this.Vz},PA:function(){b.a(k.resolve(944),
this);this.xs=[];this.ln=[]},ac:function(){return 0>=this.ln.length},reset:function(){this.PA();this.parent.oo(this)},jr:function(){b.a(k.resolve(945),this);var d=this.ln,e=this.xs;for(this.reset();0<d.length;)(1<d.length&&d[1]>=this.parent.Vb||d[0]>=this.parent.Vb)&&this.rt(d[0],e[0]),d.shift(),e.shift();b.a(k.resolve(946),this)},rt:function(d,e){this.ln.push(d);this.xs.push(e);this.parent.OA(d,e,this)},jl:function(){this.nn=(this.kd-this.Gc)/this.parent.screenY;b.a(k.resolve(947),this,this.nn)},
aq:function(){return null!==this.kd},isPointInRange:function(d){return d<this.kd&&d>this.Gc},$j:function(){this.Wi();if(!(0>=this.Rh)){if(0<this.Rh){var d=this.Ab?this.Ab(this.Gc):this.Gc;var e=this.Ql(this.Gc);this.labels[this.labels.length]=this.parent.eh(this.lo,d,e,"Y")}1<this.Rh&&(d=this.Ab?this.Ab(this.kd):this.kd,e=this.Ql(this.kd),this.labels[this.labels.length]=this.parent.eh(this.lo,d,e,"Y"));if(2<this.Rh)for(var f=this.Rh-1,h=(this.kd-this.Gc)/f,g=this.Gc,l=1;l<f;l++)g+=h,d=this.Ab?this.Ab(g):
g,e=this.Ql(g),this.labels[this.labels.length]=this.parent.eh(this.lo,d,e,"Y");b.a(k.resolve(948),this)}},Ql:function(d){return Math.round((new Number(d)-this.Gc)/this.nn)},Wi:function(){for(var d=0;d<this.labels.length;d++)this.labels[d]&&ra.Ye(this.labels[d])&&this.labels[d].parentNode.removeChild(this.labels[d]);this.labels=[];b.a(k.resolve(949),this)},GI:function(d,e,f){this.Rh=this.S(d,!0);this.lo=e;this.Ab=f||null;b.a(k.resolve(950),this);null!=this.nn&&this.parent&&this.parent.ea&&this.$j()},
Hr:function(d,e,f,h){this.Vq=d;this.iq=e;this.$h=this.S(f);this.gm=this.S(h);b.a(k.resolve(951),this)},Lw:function(d,e){this.kd=Number(e);this.Gc=Number(d);if(isNaN(this.kd)||isNaN(this.Gc))throw new C("Min and max must be numbers");if(this.Gc>this.kd)throw new C("The maximum value must be greater than the minimum value");this.parent&&null!=this.parent.screenY&&this.parent.ea&&(this.jl(),this.$j(),this.ac()||this.jr());b.a(k.resolve(952),this)},ZC:function(){return this.MJ}};a.prototype.setYLabels=
a.prototype.GI;a.prototype.setStyle=a.prototype.Hr;a.prototype.positionYAxis=a.prototype.Lw;a.prototype.getYField=a.prototype.ZC;D(a,wb,"O");return a}(),$f=function(){function a(d,e){this.Xb=d;this.$c=this.bc=null;this.ea=e;this.qg=[]}function b(d,e){this.Xb=d;this.$c=this.bc=null;this.ea=e;this.Ne=this.pd=null}function c(d){var e=!1;if(!d)try{document.createElement("canvas").getContext&&(e=!0)}catch(f){}this.xJ=e;this.jb;this.lines={}}c.prototype={IH:function(d){this.jb=document.createElement("div");
this.jb.style.position="absolute";this.jb.style.overflow="hidden";d.appendChild(this.jb)},w:function(){this.jb&&ra.Ye(this.jb)&&this.jb.parentNode.removeChild(this.jb)},lf:function(d,e){this.jb.style.width=d+"px";this.jb.style.height=e+"px";this.Pi=e;this.Iz=d},cI:function(d,e){this.jb.style.top=e+"px";this.jb.style.left=d+"px"},xH:function(d){this.jb.className=d},Az:function(d){this.lines[d.Ma()]=this.xJ?new b(d,this):new a(d,this)},UG:function(d){d=d.Ma();this.lines[d]&&(this.lines[d].remove(),
delete this.lines[d])},oo:function(d){d=d.Ma();this.lines[d]&&this.lines[d].clear()},$F:function(d,e,f){var h=d.Ma();this.lines[h]||this.Az(d);this.lines[h].ru(e,f)}};b.prototype={kD:function(){if(!this.Ne){var d=document.createElement("canvas");d.style.position="absolute";d.style.overflow="hidden";var e=d.getContext("2d");this.ea.jb.appendChild(d);this.Ne=d;this.pd=e}this.Ne.width=this.ea.Iz;this.Ne.height=this.ea.Pi},ru:function(d,e){e=this.ea.Pi-e;null===this.bc?this.kD():(this.pd.beginPath(),
this.pd.strokeStyle=this.Xb.iq,this.pd.lineWidth=this.Xb.gm,this.pd.moveTo(this.bc,this.$c),this.pd.lineTo(d,e),this.pd.stroke());this.Po(d,e)},Po:function(d,e){this.bc=d;this.$c=e;var f=Math.round(this.Xb.$h/2);this.pd.fillStyle=this.Xb.Vq;this.pd.fillRect(d-f,e-f,this.Xb.$h,this.Xb.$h)},clear:function(){this.$c=this.bc=null;this.pd.clearRect(0,0,this.Ne.width,this.Ne.height)},remove:function(){this.$c=this.bc=null;this.ea.jb.removeChild(this.Ne);this.Ne=null}};a.prototype={ru:function(d,e){if(null!==
this.bc){var f=d-this.bc,h=e-this.$c,g=Math.abs(f),l=Math.abs(h);if(g>=l){var n=h/f;var r=f;f=0<=f?1:-1}else n=f/h,r=h,f=0<=h?1:-1;var u=h=0,E=null,t=null,y=!0,z=!0;g<l&&(z=!1);for(l=0;l!=r;l+=f){var m=!1;l+f==r&&(y=m=!0);g=document.createElement("div");m?(g.style.backgroundColor=this.Xb.Vq,g.style.width=this.Xb.$h+"px",g.style.height=this.Xb.$h+"px"):(g.style.backgroundColor=this.Xb.iq,g.style.width=this.Xb.gm+"px",g.style.height=this.Xb.gm+"px");g.style.position="absolute";g.style.fontSize="0px";
this.ea.jb.appendChild(g);this.qg.push(g);y&&(y=!1,E=Math.ceil(g.offsetWidth/2),t=Math.ceil(g.offsetHeight/2),h=g.offsetWidth,u=g.offsetHeight);var q=h;var B=u;if(z){var K=Math.round(l+this.bc);var Z=Math.round(this.ea.Pi-(n*l+this.$c));if(!m){for(m=0;l+f!=r-f&&Z==Math.round(this.ea.Pi-(n*(l+f)+this.$c));)l+=f,m++;m*=E;q=h+m;0>f&&(K-=m)}}else if(K=Math.round(n*l+this.bc),Z=Math.round(this.ea.Pi-(l+this.$c)),!m){for(m=0;l+f!=r-f&&K==Math.round(n*(l+f)+this.bc);)l+=f,m++;m*=t;B=u+m;0<f&&(Z-=m)}K-=Math.floor(E/
2);Z-=Math.floor(t/2);g.style.left=K+"px";g.style.top=Z+"px";g.style.width=q+"px";g.style.height=B+"px"}}this.Po(d,e)},Po:function(d,e){this.bc=d;this.$c=e},clear:function(){if(this.qg[0]&&ra.Ye(this.qg[0]))for(var d=0;d<this.qg.length;d++)this.qg[d].parentNode.removeChild(this.qg[d]);this.qg=[];this.$c=this.bc=null},remove:function(){this.clear()}};return c}(),ag=function(){function a(c){this._callSuperConstructor(a,arguments);this.$g=document.createElement("div");this.$g.style.position="relative";
this.$g.style.overflow="visible";this.xt="";this.offsetX=this.offsetY=0;this.screenY=this.screenX=null;this.labels=[];this.Ab=null;this.Qh=0;this.qy=this.mn=this.nc=this.Vb=this.ws=null;this.ya={};this.ys={};this.tB=!1;this.ea=null;this.zc()}L.Mc();var b=k.s("lightstreamer.charts");a.prototype={toString:function(){return["[|Chart",this.id,"]"].join("|")},mD:function(){this.ea=new $f(this.tB);this.ea.IH(this.$g);this.Zt()},Zt:function(){this.ea&&(this.ea.lf(this.screenX,this.screenY),this.ea.cI(this.offsetX,
this.offsetY),this.ea.xH(this.xt),b.a(k.resolve(953)))},Cx:function(c,d){if(!this.ea)if(c&&c.appendChild){c.appendChild(this.$g);null==this.screenX&&(this.screenX=c.offsetWidth);null==this.screenY&&(this.screenY=c.offsetHeight);this.mD();null!=this.nc&&(this.Sn(),this.Am());for(var e in this.ya)for(var f in this.ya[e])(d=this.ya[e][f])&&d.aq()&&(d.jl(),d.$j());b.i(k.resolve(954),this,c)}else d||b.g(k.resolve(955),this)},eh:function(c,d,e,f){b.a(k.resolve(956),this);var h=document.createElement("div");
null!=c&&(h.className=c);h.style.position="absolute";h.appendChild(document.createTextNode(d));this.$g.appendChild(h);c=h.offsetWidth;"X"==f.toUpperCase()?(h.style.top=this.screenY+5+this.offsetY+"px",h.style.left=e-h.offsetWidth/2+this.offsetX+"px"):"Y"==f.toUpperCase()&&(h.style.left=this.offsetX-c+"px",h.style.top=this.screenY-e-h.offsetHeight/2+this.offsetY+"px");return h},oo:function(c){this.ea.oo(c)},OA:function(c,d,e){b.h()&&b.a(k.resolve(957),this);c=this.Pl(c);d=e.Ql(d);b.h()&&b.a(k.resolve(958),
c,d);this.ea.$F(e,c,d);b.h()&&b.a(k.resolve(959))},cH:function(){b.a(k.resolve(960));for(var c in this.ya)for(var d in this.ya[c]){var e=this.ya[c][d];e&&!e.ac()&&e.jr()}},Sn:function(){this.mn=(this.nc-this.Vb)/this.screenX;b.h()&&b.a(k.resolve(961),this,this.mn)},Am:function(){this.Wi();if(!(0>=this.Qh)){if(0<this.Qh){var c=this.Ab?this.Ab(this.Vb):this.Vb;var d=this.Pl(this.Vb);this.labels[this.labels.length]=this.eh(this.ko,c,d,"X")}1<this.Qh&&(c=this.Ab?this.Ab(this.nc):this.nc,d=this.Pl(this.nc),
this.labels[this.labels.length]=this.eh(this.ko,c,d,"X"));if(2<this.Qh)for(var e=this.Qh-1,f=(this.nc-this.Vb)/e,h=this.Vb,g=1;g<e;g++)h+=f,c=this.Ab?this.Ab(h):h,d=this.Pl(h),this.labels[this.labels.length]=this.eh(this.ko,c,d,"X");b.a(k.resolve(962),this)}},Pl:function(c){return Math.round((new Number(c)-this.Vb)/this.mn)},Wi:function(){for(var c=0;c<this.labels.length;c++)this.labels[c]&&ra.Ye(this.labels[c])&&this.labels[c].parentNode.removeChild(this.labels[c]);this.labels=[];b.a(k.resolve(963),
this)},pe:function(c){this._callSuperMethod(a,"onListenStart",[c]);this.eb()&&(this.kind=pc.Hs)},Fw:function(c,d,e,f){d=null===d[e]||"undefined"==typeof d[e]?this.values.get(c,e):d[e];d=f?f(d,c):d;return null===d?null:I.zp(d)},lm:function(c,d){this.fy(c,d)},Ld:function(c,d){var e=this.Fw(c,d,this.ws,this.qy);if(null!==e&&!(isNaN(e)||null!==e&&e<this.Vb)){e>this.nc&&this.dispatchEvent("onXOverflow",[c,e,this.Vb,this.nc]);for(var f in this.ya){var h=this.Fw(c,d,f,this.ys[f]);if(!isNaN(h)){var g=this.ya[f][c];
if(null==e||null==h)g&&null==e&&null==h?(b.i(k.resolve(964),this,g),g.reset()):b.a(k.resolve(965),this,g);else{if(!g){g=new Zf(c,this,this.ws,f);this.dispatchEvent("onNewLine",[c,g,e,h]);if(!g.aq()){b.g(k.resolve(966),this);break}g.jl();g.$j();this.ya[f][c]=g}g.isPointInRange(h)||this.dispatchEvent("onYOverflow",[c,g,h,g.Gc,g.kd]);g.rt(e,h)}}}}},Hd:function(c){for(var d in this.ya)this.lu(c,d)},lu:function(c,d){if(this.ya[d]){var e=this.ya[d][c];e.reset();e.Wi();this.ea.UG(e);delete this.ya[d][c];
this.dispatchEvent("onRemovedLine",[c,e]);b.a(k.resolve(967),this,c,d)}},w:function(){this._callSuperMethod(a,"clean");this.Wi();this.ea&&this.ea.w();delete this.ea;this.Cx(this.$g.parentNode,!0);b.a(k.resolve(968),this)},zc:function(){b.i(k.resolve(969),this);var c=document.getElementById(this.id);if(c){if(!ra.ly(c))throw new O("A DOM element must be provided as an anchor for the chart");this.Cx(c);this.parsed=!0}},lA:function(c,d,e,f,h){c&&(this.xt=c);f&&(this.offsetY=this.S(f,!0));h&&(this.offsetX=
this.S(h,!0));d&&(this.screenY=this.S(d,!0));e&&(this.screenX=this.S(e,!0));this.Zt();if(e||d){e&&null!=this.nc&&(this.Sn(),this.Am());for(var g in this.ya)for(var l in this.ya[g])(c=this.ya[g][l])&&c.aq()&&null!=this.nc&&(d&&(c.jl(),c.$j()),c&&!c.ac()&&c.jr())}},DI:function(c,d){this.ws=c;this.qy=d;this.w();b.a(k.resolve(970),c,this)},Jn:function(c,d){if(I.isArray(c)){b.a(k.resolve(971),this);for(var e=0;e<c.length;e++)I.isArray(d)?this.Jn(c[e],d[e]):this.Jn(c[e],d)}else this.ya[c]||(this.ya[c]=
{}),this.ys[c]=d,b.a(k.resolve(972),c,this)},cx:function(c){if(I.isArray(c)){b.a(k.resolve(973),this);for(var d=0;d<c.length;d++)this.cx(c[d])}else if(this.ya[c]){for(d in this.ya[c])this.lu(d,c);delete this.ya[c];delete this.ys[c];b.a(k.resolve(974),c,this)}},Xq:function(c,d){this.nc=Number(d);this.Vb=Number(c);if(isNaN(this.nc)||isNaN(this.Vb))throw new C("Min and max must be numbers");if(this.Vb>this.nc)throw new C("The maximum value must be greater than the minimum value");null!=this.screenX&&
(this.Sn(),this.Am());this.cH();b.a(k.resolve(975),this)},FI:function(c,d,e){this.Qh=this.S(c,!0);this.ko=d;this.Ab=e||null;null!=this.mn&&this.Am();b.a(k.resolve(976),this)},addListener:function(c){this._callSuperMethod(a,"addListener",[c])},removeListener:function(c){this._callSuperMethod(a,"removeListener",[c])},yb:function(){return this._callSuperMethod(a,"getListeners")}};a.prototype.parseHtml=a.prototype.zc;a.prototype.configureArea=a.prototype.lA;a.prototype.setXAxis=a.prototype.DI;a.prototype.addYAxis=
a.prototype.Jn;a.prototype.removeYAxis=a.prototype.cx;a.prototype.positionXAxis=a.prototype.Xq;a.prototype.setXLabels=a.prototype.FI;a.prototype.addListener=a.prototype.addListener;a.prototype.removeListener=a.prototype.removeListener;a.prototype.getListeners=a.prototype.yb;a.prototype.clean=a.prototype.w;a.prototype.onListenStart=a.prototype.pe;a.prototype.updateRowExecution=a.prototype.Ld;a.prototype.removeRowExecution=a.prototype.Hd;D(a,pc);return a}(),Db=function(){function a(d){this._callSuperConstructor(a,
[d])}function b(d,e){var f=new ra(document.createElement("p"));f.pr(d,e);var h=d.Vc();f.Vc=function(){return h};return f}function c(d){if(d.Sa)d.w();else for(var e=0;e<d.length;e++)d[e].w()}a.ji=function(d,e,f){var h={};for(l in d)h[l]=!0;if(e)for(l in e)h[l]=!0;else e={};for(var g in h)if(d[g])if(e[g])if(e[g].Sa&&d[g].Sa)e[g].pr(d[g],f);else{h=d[g].Sa?[d[g]]:d[g];e[g].Sa&&(e[g]=[e[g]]);var l=[].concat(e[g]);for(var n=0;n<h.length;n++){for(var r=!1,u=0;u<l.length;u++)if(l[u].Vc()===h[n].Vc()){l[u].pr(h[n],
f);r=!0;l.splice(u,1);break}r||e[g].push(b(h[n],f))}c(l)}else{h=e;l=g;n=d[g];r=f;if(n.Sa)n=b(n,r);else{u=[];for(var E=0;E<n.length;E++)u[E]=b(n[E],r);n=u}h[l]=n}else c(e[g]);return e};a.prototype={Hz:function(d){var e=this.qh(d.Ea(),d.da());if(!e)return!1;if(e.Sa)return e.Iv(d);for(var f=0;f<e.length;f++)if(e[f].Iv(d))return!0;return!1},Ug:function(d,e,f){e=e||d.Ea();f=f||d.da();var h=this.qh(e,f);h?h.Sa?this.xd([h,d],e,f):h.push(d):this.xd(d,e,f)},oB:function(d){var e=this;this.nj(function(f,h,g){e.cp(f,
h,g,d)})},Gu:function(d,e){var f=this;this.Dl(d,function(h,g,l){f.cp(h,g,l,e)})},pB:function(d,e,f){var h=this.get(d,e);h&&this.cp(h,d,e,f)},cp:function(d,e,f,h){if(d.Sa)h(d,e,f);else for(var g=0;g<d.length;g++)h(d[g],e,f,d[g].Vc())},qh:function(d,e,f){if(f){if(d=this.get(d,e))if(!d.Sa)for(e=0;e<d.length;e++){if(d[e].Vc()==f)return d[e]}else if(d.Vc()==f)return d;return null}return this.get(d,e)},Sz:function(){var d=this.Pu(),e;for(e in d){var f=void 0,h=d[e],g=!1;for(f in h){var l=h[f];if(l.Sa)l=
l.uv();else{for(var n=!1,r=0;r<l.length;)l[r].uv()?(n=!0,r++):l.splice(r,1);l=n}l?g=!0:delete h[f]}g||delete d[e]}}};D(a,Oa,!1,!0);return a}(),Vc=function(){function a(t){0==t.indexOf("#")&&(t=t.substring(1,t.length));if(3==t.length)t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2);else if(6!=t.length)return g.warn("A hexadecimal color value must be 3 or 6 character long. An invalid value was specified, will be ignored"),null;var y=t.substring(2,4),z=t.substring(4,6);t=c(t.substring(0,
2));y=c(y);z=c(z);return null==t||null==y||null==z?null:[t,y,z]}function b(t){if(0<=t&&9>=t)return new Number(t);t=t.toUpperCase();if(l[t])return l[t];g.warn("A hexadecimal number must contain numbers between 0 and 9 and letters between A and F. An invalid value was specified, will be ignored");return null}function c(t){var y=0,z=0,m;for(m=t.length;1<=m;m--){var q=b(t.substring(m-1,m));if(null==q)return null;var B;for(B=1;B<=z;B++)q*=16;z++;y+=q}return y}function d(t){if(t.indexOf("%")==t.length-
1){t=parseFloat(t.substring(0,t.length-1));if(100<t||0>t)return g.warn("A RGB element must be a number >=0 and <=255 or a percentile >=0 and <=100. An invalid value was specified, will be ignored"),null;t*=2.55}return t}function e(t,y){return t&&""!=t?y?t!=y?!0:!1:!0:!1}function f(t){var y=document.createElement("DIV");y.style.backgroundColor=t;var z=E.Aj(y,n,t);if(null==z)return null;if(255==z[0]&&255==z[1]&&255==z[2]&&"WHITE"!=t.toUpperCase()){var m=document.getElementsByTagName("BODY")[0];m&&(m.appendChild(y),
z=E.Aj(y,n,t),m.removeChild(y))}r[t]=z;return r[t]}function h(t){var y="";if(r[t])return r[t];if(ia.ie())try{if(u=Wa.Ve("weswit__ColorFrame",!0))u.document.bgColor=t,y=u.document.bgColor}catch(m){y=null}else return f(t);if(!y||y==t){var z=document.bgColor;document.bgColor=t;y=document.bgColor;document.bgColor=z}if(!y||y==t)return f(t);r[t]=a(y);return r[t]}L.Mc();var g=k.s("lightstreamer.grids"),l={A:10,B:11,C:12,D:13,E:14,F:15},n="backgroundColor",r={},u=null,E={fs:function(t){if(0==t.indexOf("rgb"))a:{if(0==
t.indexOf("rgb(")){var y=4;var z=")"}else if(0==t.indexOf("rgba("))y=5,z=",";else{g.warn("A RGB color value must be in the form 'rgb(x, y, z)' or 'rgba(x, y, z, a)'. An invalid value was specified, will be ignored");t=null;break a}t=t.substring(y,t.length);var m=t.indexOf(",");y=d(t.substring(0,m));var q=t.indexOf(",",m+1);m=d(t.substring(m+1,q));t=d(t.substring(q+1,t.indexOf(z,q+1)));t=null==y||null==m||null==t?null:[y,m,t]}else t=0==t.indexOf("#")?a(t):h(t);return t},Aj:function(t,y,z){if(null==
t)return[255,255,255];var m="";try{if(window.getComputedStyle||document.defaultView&&document.defaultView.getComputedStyle){var q=document.defaultView.getComputedStyle(t,null);if(q){var B=y==n?"background-color":y;m=q.getPropertyValue(B)}}}catch(K){}try{!e(m,z)&&t.currentStyle&&(B="background-color"==y?n:y,m=t.currentStyle[B])}catch(K){}try{if(!e(m,z))if(q="background-color"==y?n:y,""!=t.style[q])m=t.style[q];else return[255,255,255]}catch(K){}return"transparent"==m&&t.parentNode?this.Aj(t.parentNode,
y):"transparent"==m?[255,255,255]:e(m,z)?this.fs(m):[255,255,255]}};return E}(),bg=function(){function a(e,f,h,g,l,n,r){this.wd(e,f,h,g,l,n,r)}function b(){this.length=0;this.Iw={}}function c(e){this.Re=e;this.Il=new b;this.Du=0;this.mh={};this.yl=!1;this.xe={}}function d(e){return function(){e.style.backgroundColor="transparent"}}L.Mc();c.prototype={yp:function(e,f,h,g,l,n){l=this.jC(l);var r=e.Mp();if(r){var u=this.Il.get();if(null==u)return this.mh[this.Du]=new a(e,f,h,g,l,r,n),this.Du++;this.mh[u].wd(e,
f,h,g,l,r,n);return u}},jC:function(e){e/=this.Re;return 1<e?e:1},fq:function(e){var f=this.mh[e],h=f.Xd.op();if(!h)this.bn(f.Xd);else if(!(f.b<h)){h=this.xe[f.Xd.Ui];var g=this.mh[h];g&&(g.nv||(f.nv?g.kh&&x.ha(g.kh):(f.hb=g.hb,f.pb<g.pb&&(f.pb=g.pb))),this.Il.put(h));this.xe[f.Xd.Ui]=e;f.jh&&(f.pi=Vc.Aj(f.Xd.sj(),"backgroundColor"));f.kj&&(f.Qr=Vc.Aj(f.Xd.sj(),"color"));this.yl||this.fB(this.Re)}},bn:function(e){var f=this.xe[e.Ui];if(f||0==f)delete this.xe[e.Ui],this.Il.put(f)},JA:function(e){var f=
I.Na(),h=0;e&&(h=f-(e+this.Re));e=!1;for(var g in this.xe){var l=this.xe[g],n=this.mh[l];if(n.hb>n.pb)this.Il.put(l),delete this.xe[g],n.kh&&x.Vg(n.kh,0);else{l=n.Xd.sj();if(!l){this.bn(n.Xd);continue}if("transparent"==n.jh)try{l.style.backgroundColor="rgba("+n.pi[0]+","+n.pi[1]+","+n.pi[2]+","+this.Sf(100,0,n.pb,n.hb)/100+")"}catch(u){var r=(n.pb-n.hb)*this.Re;x.u(d(l),r);n.kh&&x.Vg(n.kh,r);this.bn(n.Xd);continue}else n.jh&&(l.style.backgroundColor="rgb("+this.Sf(n.pi[0],n.jh[0],n.pb,n.hb)+","+this.Sf(n.pi[1],
n.jh[1],n.pb,n.hb)+","+this.Sf(n.pi[2],n.jh[2],n.pb,n.hb)+")");n.kj&&(l.style.color="rgb("+this.Sf(n.Qr[0],n.kj[0],n.pb,n.hb)+","+this.Sf(n.Qr[1],n.kj[1],n.pb,n.hb)+","+this.Sf(n.Qr[2],n.kj[2],n.pb,n.hb)+")");e=!0}n.hb++}e?(g=I.Na(),f=g-f+h,f>this.Re&&(h=f/this.Re,f=Math.floor(h),h-=f,this.NG(f),f=this.Re*h),this.Zv(this.Re-f,g)):this.yl=!1},Zv:function(e,f){x.u(this.JA,e,this,[f])},NG:function(e){for(var f in this.xe){var h=this.mh[this.xe[f]];h.hb>h.pb||(h.hb=h.hb+e<h.pb?h.hb+e:h.pb)}},fB:function(e){1!=
this.yl&&(this.yl=!0,this.Zv(e))},Sf:function(e,f,h,g){e=new Number(e);f=new Number(f);return Math.ceil(e+1/h*g*(f-e))}};b.prototype={put:function(e){this.Iw[this.length]=e;this.length++},get:function(){if(0>=this.length)return null;this.length--;return this.Iw[this.length]}};a.prototype={wd:function(e,f,h,g,l,n,r){this.kh=r?r:null;this.nv=f;this.Xd=e;this.jh=""===h||"transparent"==h?"transparent":h?Vc.fs(h):null;this.kj=g?Vc.fs(g):null;this.pb=l;this.b=n;this.hb=0}};return c}(),Te=function(){function a(){this._callSuperConstructor(a,
arguments);this.qb=!1;this.Gk=b;this.Sd=!1;this.R=null;this.to=this.sm=this.fj=!1;this.ce=new bg(50);this.cj=this.bj=null;this.L=this.M=0;this.fa=new Db}L.Mc();var b=["div","span","input"],c=k.s("lightstreamer.grids");a.prototype={lm:function(d,e){c.h()&&c.a(k.resolve(977),this);for(var f in e)this.cj[f]=e[f];this.ap(this.bj,e)},ap:function(d,e){for(var f in e)this.fa.pB(d,f,function(h){c.h()&&c.a(k.resolve(978),d,f);var g=e[f];h.Er(null===g?"":g)})},bg:function(d,e){return null!=d&&null!=e||d==e?
this.fj?d>e:d<e:null==d?!this.fj:this.fj},VH:function(d){this.qb=this.Ka(d)},FD:function(){return this.qb},aI:function(d){if(d&&0<d.length)this.Gk=d;else throw new C("The given array is not valid or empty");},ev:function(){return this.Gk},wH:function(d){null!=this.R&&c.Pa(k.resolve(979));this.Sd=this.Ka(d)},uD:function(){return this.Sd},tI:function(d,e,f,h){d?(this.R=d,this.fj=this.Ka(e,!0),this.sm=this.Ka(f,!0),this.to=this.Ka(h,!0),this.Ym()):this.R=null},OC:function(){return this.R},AD:function(){return null===
this.R?null:this.fj},ID:function(){return null===this.R?null:this.sm},xD:function(){return null!==this.R&&this.sm?this.to:null},aB:function(){return this.Cu(ra.uy)},$A:function(){return this.Cu(ra.Qy)},zc:function(){},sB:function(d){if(0<this.M)throw new O("This method can only be called while the grid is empty.");if(d){if(d!=pc.Ty&&d!=pc.Hs)throw new C("The given value is not valid, use UPDATE_IS_KEY or ITEM_IS_KEY.");this.kind=d;this.gp=!0}else this.gp=!1,this.Ot()},Cu:function(d){d=this.wo(d);
var e=[],f;for(f in d)e.push(f);return e},cc:function(d){return this.sm?I.zp(d,this.to):null===d?d:(new String(d)).toUpperCase()},my:function(d,e,f){f=f||d;var h=e.Xt,g=h+e.rv,l=g+e.wh,n=e.Sl,r=e.so,u=[];d=this.fa.Ea(d);for(var E in d)for(var t=-1,y=d[E],z=0;y&&(y.Sa||z<y.length);z++){var m=y.Sa?y:y[z];y=y.Sa?null:y;null===m.Vc()&&t++;var q=this.lv?this.lv(m,f,E,m.Vc(),t):m;if(null!=m.eg){var B=m.zI(),K=m.sC(r),Z=m.tC(n);if(Z){var X=!1,ec=!1;m=!1;var Za=null,Ha=null,vb=null,ub=null;Z&&(Z.backgroundColor&&
(X=!0,Za=Z.backgroundColor,Ha=K.backgroundColor),Z.color&&(X=!0,vb=Z.color,ub=K.color));X&&(0<h?(K=x.Ta(q.Jf,q,[B,this.qb]),K=this.ce.yp(q,!1,Za,vb,h,K),this.ce.fq(K),ec=!0):this.ce.bn(q),0<e.wh&&(m=x.Ta(q.If,q,[B,ra.Nk]),K=this.ce.yp(q,!0,Ha,ub,e.wh,m),x.u(this.ce.fq,g,this.ce,[K]),m=!0));ec||(0<h?x.u(q.Jf,h,q,[B,this.qb]):(Ha=x.Ta(q.Jf,q,[B,this.qb]),u.push(Ha)));m||x.u(q.If,l,q,[B,ra.Nk])}else 0<h?x.u(q.Jf,h,q,[B,this.qb]):(Ha=x.Ta(q.Jf,q,[B,this.qb]),u.push(Ha)),K&&(0<e.wh?(Ha=K.backgroundColor,
ub=K.color,m=x.Ta(q.If,q,[B,ra.Nk]),K=this.ce.yp(q,!0,Ha,ub,e.wh,m),x.u(this.ce.fq,g,this.ce,[K])):x.u(q.If,l,q,[B,ra.Nk]))}}for(e=0;e<u.length;e++)x.ha(u[e])},Ld:function(){},Hd:function(){},Ym:function(){},wo:function(){}};a.prototype.setHtmlInterpretationEnabled=a.prototype.VH;a.prototype.isHtmlInterpretationEnabled=a.prototype.FD;a.prototype.setNodeTypes=a.prototype.aI;a.prototype.getNodeTypes=a.prototype.ev;a.prototype.setAddOnTop=a.prototype.wH;a.prototype.isAddOnTop=a.prototype.uD;a.prototype.setSort=
a.prototype.tI;a.prototype.getSortField=a.prototype.OC;a.prototype.isDescendingSort=a.prototype.AD;a.prototype.isNumericSort=a.prototype.ID;a.prototype.isCommaAsDecimalSeparator=a.prototype.xD;a.prototype.extractFieldList=a.prototype.aB;a.prototype.extractCommandSecondLevelFieldList=a.prototype.$A;a.prototype.parseHtml=a.prototype.zc;a.prototype.forceSubscriptionInterpretation=a.prototype.sB;a.prototype.updateRowExecution=a.prototype.Ld;a.prototype.removeRowExecution=a.prototype.Hd;D(a,pc);return a}(),
Ue=function(){function a(){}a.prototype={wd:function(){this.length=0;this.Pb={};this.Dw||(this.map={})}};return a}(),cg=function(){function a(b,c,d){this._callSuperConstructor(a);this.Qe=b;this.Ik=c;this.NE=d;this.Dw=!0;this.si=this.Ik;this.wd()}a.prototype={removeChild:function(b){if(!(0>=this.length)){this.length--;delete this.Pb[b.Ma()];var c=b.element();c==this.si&&(this.si=c.nextSibling);this.Qe.removeChild(c);b.Wm(null)}},insertBefore:function(b,c){c!=b&&b&&(c?null==this.Pb[c.Ma()]?this.appendChild(b,
!0):(this.Hj(b),this.Qe.insertBefore(b.element(),c.element())):this.appendChild(b,!0))},appendChild:function(b,c){b&&(this.Hj(b),b=b.element(),c?(this.si||(this.si=b),this.Ik?this.Qe.insertBefore(b,this.Ik):this.Qe.appendChild(b)):(this.Qe.insertBefore(b,this.si),this.si=b))},Hj:function(b){b.bm(this)||(this.length++,this.Pb[b.Ma()]=b,b.bq(),b.Wm(this))},Uc:function(b){if(this.length<=b)return null;b+=this.NE;b=this.Qe.childNodes[b].getAttribute("id");return this.getElementById(b)},getElementById:function(b){return this.Pb[b]},
w:function(){this.Qe&&delete this.Qe;this.Ik&&delete this.Ik;for(var b in this.Pb)this.Pb[b].w()}};D(a,Ue);return a}(),Fd=function(){function a(){this._callSuperConstructor(a);this.Dw=!1;this.wd()}a.prototype={removeChild:function(b){if(!(0>=this.length)){this.length--;var c;for(c=this.Pb[b.Ma()];c<this.length;c++)this.map[c]=this.map[c+1],this.Pb[this.map[c].Ma()]=c;this.Pb[b.Ma()]=null;this.map[this.length]=null;b.Wm(null)}},insertBefore:function(b,c){if(c!=b&&b)if(c)if(null==this.Pb[c.Ma()])this.appendChild(b,
!0);else{b.bq();c=this.Pb[c.Ma()];for(var d=this.length;d>=c+1;d--)this.map[d]=this.map[d-1],this.Pb[this.map[d].Ma()]=d;this.Hj(b,c)}else this.appendChild(b,!0)},appendChild:function(b,c){b&&(b.bq(),c||0==this.length?this.Hj(b,this.length):this.insertBefore(b,this.map[0]))},Hj:function(b,c){this.length++;this.Pb[b.Ma()]=c;this.map[c]=b;b.Wm(this)},Uc:function(b){return this.map[b]},getElementById:function(b){return this.map[this.Pb[b]]},w:function(){for(var b=0;b<this.length;b++)this.map[b].w()}};
D(a,Ue);return a}(),dg=function(){function a(b,c){this.key=b;this.Sq=c;this.node=this.Oh=null;this.id="hc6|"+c.Ma()+"|"+b}a.prototype={Wm:function(b){this.Oh=b},bq:function(){this.Oh&&this.Oh.removeChild(this)},bm:function(b){return this.Oh==b},getKey:function(){return this.key},Ma:function(){return this.id},element:function(){if(null!=this.node)return this.node;this.node=this.Sq.TC();this.node.setAttribute("id",this.id);for(var b=ra.Ml(this.node,this.Sq.ev()),c=0;c<b.length;c++){var d=b[c],e=d.da();
e&&this.Sq.pF(d,this.key,e)}return this.node},w:function(){this.node&&delete this.node}};return a}(),Ve=function(){function a(c,d,e){this.ao=c;this.rs=d;this.key=e;this.wh=this.Xt=0;this.rv=1200;this.so=this.Sl=null}var b=k.s("lightstreamer.grids");a.prototype={MB:function(c,d){c=this.ao.qh(this.key,c,d);if(!c)throw new C("No cell defined for this field");c.Sa||(c=c[0]);return c.eg||c.fi()},EH:function(c,d,e){c=this.ao.qh(this.key,c,e);if(!c)throw new C("No cell defined for this field");if(c.Sa)c.Er(d);
else for(e=0;e<c.length;e++)c[e].Er(d)},NB:function(c){return this.rs[c]||null},TH:function(c){this.rv=this.S(c,!0)},FH:function(c){this.Xt=this.S(c,!0)},UH:function(c){this.wh=this.S(c,!0)},Ki:function(c,d,e,f,h){c=this.ao.qh(this.key,c,h);if(!c)throw new C("No cell defined for this field");if(c.Sa)c.Ki(d,e,f);else for(h=0;h<c.length;h++)c[h].Ki(d,e,f)},tt:function(c,d,e){this.Sl||(this.Sl={},this.so={});this.Sl[e]=c||"";this.so[e]=d||""},setAttribute:function(c,d,e){this.tt(c,d,e)},Hr:function(c,
d){this.tt(c,d,"CLASS")},CH:function(c,d,e,f,h){this.Ki(c,d,e,f,h)},DH:function(c,d,e,f){this.Ki(c,d,e,"CLASS",f)},Cl:function(c){for(var d in this.rs)try{c(d,this.rs[d])}catch(e){b.g(k.resolve(980),e)}}};a.prototype.getCellValue=a.prototype.MB;a.prototype.setCellValue=a.prototype.EH;a.prototype.getChangedFieldValue=a.prototype.NB;a.prototype.setHotTime=a.prototype.TH;a.prototype.setColdToHotTime=a.prototype.FH;a.prototype.setHotToColdTime=a.prototype.UH;a.prototype.setAttribute=a.prototype.setAttribute;
a.prototype.setStyle=a.prototype.Hr;a.prototype.setCellAttribute=a.prototype.CH;a.prototype.setCellStyle=a.prototype.DH;a.prototype.forEachChangedField=a.prototype.Cl;D(a,wb,!0,!0);return a}(),eg=function(){function a(c,d){this._callSuperConstructor(a,[c]);this.ue=1;this.aj=0;this.Le=null;this.Kf="OFF";this.tv();(d=this.Ka(d,!0))&&this.zc()}L.Mc();var b=k.s("lightstreamer.grids");a.prototype={toString:function(){return["[",this.id,this.M,this.aj,"]"].join("|")},ZH:function(c){this.L=c&&"unlimited"!=
(new String(c)).toLowerCase()?this.S(c,!0):0;this.eb()?this.Qv():(this.Tn(),this.Ym(),this.Kt(1))},mC:function(){return 0==this.L?"unlimited":this.L},aD:function(c){if(this.eb())throw new O("This grid is configured to no support pagination");if(0==this.L)throw new O("Can't switch pages while 'no-page mode' is used");c=this.S(c);this.Kt(c)},ZB:function(){return 0==this.L?1:this.aj},zH:function(c,d){if(!c)throw new C("The given value is not a valid scroll type. Admitted values are OFF, ELEMENT, PAGE");
c=(new String(c)).toUpperCase();if("ELEMENT"==c)if(d)this.Le=d;else throw new C("Please specify an element id in order to use ELEMENT autoscroll");else if("PAGE"!=c&&"OFF"!=c)throw new C("The given value is not a valid scroll type. Admitted values are OFF, ELEMENT, PAGE");this.Kf=c;this.iG()},zc:function(){this.parsed=!0;var c=this.qo;if(c){if(ra.Ye(c))return!0;this.tv()}c=document.getElementById(this.id);if(!this.kJ(c))return!1;this.cs=c.cloneNode(!0);this.cs.removeAttribute("id");this.qo=c;var d=
c.parentNode;c.style.display="none";var e=d.childNodes,f,h=0,g=null;for(f=0;f<e.length;f++)if(e[f]==c){e[f+1]&&(g=e[f+1]);h=f+1;break}this.Ca=new cg(d,g,h);this.Ad=new Fd;this.gc=new Fd;return!0},wo:function(c){for(var d=ra.Ml(this.qo,this.Gk),e={},f=0;f<d.length;f++)if(d[f].Ru()==c){var h=d[f].da();h&&(e[h]=!0)}return e},kJ:function(c){if(!c)throw new C("No template defined");if(!ra.ly(c))throw new C("The template defined for the grid does not define the 'data-source' attribute");var d=[];c=ra.Ml(c,
this.Gk);for(var e=0;e<c.length;e++)c[e].da()&&d.push(c[e]);if(0>=d.length)throw new C("No valid cells defined for grid");return!0},iG:function(){if(!("ELEMENT"!=this.Kf||this.Le&&this.Le.appendChild)){var c=document.getElementById(this.Le);c?this.Le=c:(b.g(k.resolve(981),this),this.Kf="OFF")}},tv:function(){this.gc=this.Ad=this.Ca=this.cs=this.qo=null;this.nl={}},TC:function(){return this.cs.cloneNode(!0)},pF:function(c,d,e){this.fa.Ug(c,d,e)},w:function(){this._callSuperMethod(a,"clean")},GJ:function(){if("OFF"==
this.Kf)return!1;if(this.eb()){var c="ELEMENT"==this.Kf?this.Le:document.body;return this.Sd?0==c.scrollTop:ia.Ze()?!0:1>=Math.abs(c.clientHeight+c.scrollTop-c.scrollHeight)}return!0},rC:function(c){var d="PAGE"==this.Kf?document.body:this.Le;return this.eb()?this.Sd?0:d.scrollHeight-d.clientHeight:c.offsetTop-d.offsetTop},CA:function(c){b.h()&&b.a(k.resolve(982),this,c);"PAGE"==this.Kf?window.scrollTo(0,c):this.Le.scrollTop=c},Ym:function(){for(var c=this.R,d=new Fd,e=1;0<this.M;){var f=this.wj(e);
if(f)if(null==c)d.appendChild(f,!0),this.M--;else{var h=f.getKey();if(""==h)this.M--,e++;else{h=this.cc(this.values.get(h,this.R));for(var g=0,l=d.length-1;g<l;){var n=Math.floor((g+l)/2),r=d.Uc(n);(r=this.cc(this.values.get(r.getKey(),this.R)))||b.Pa(k.resolve(983),this);this.bg(h,r)?l=n-1:g=n+1}r=d.Uc(g);g==l?(g=this.cc(this.values.get(r.getKey(),this.R)),this.bg(h,g)?d.insertBefore(f,r):(h=d.Uc(l+1))?d.insertBefore(f,h):d.appendChild(f,!0)):r?d.insertBefore(f,r):d.appendChild(f,!0);this.M--}}else this.M--,
e++}for(;0<d.length;)this.M++,c=d.Uc(0),this.M<=this.L*(this.ue-1)?this.gc.appendChild(c,!0):0>=this.L||this.M<=this.L*this.ue?this.Ca.appendChild(c,!0):this.Ad.appendChild(c,!0)},Kt:function(c){if(!(0>=this.M)){if(this.ue>=c)for(;this.Ck(this.gc,this.Ca,(c-1)*this.L);)this.Ck(this.Ca,this.Ad,this.L);else for(;this.Se(this.Ca,this.gc,(c-1)*this.L,!1);)this.Se(this.Ad,this.Ca,this.L,!1);this.ue=c}},Tn:function(){b.h()&&b.a(k.resolve(984),this);var c=0>=this.L?1:Math.ceil(this.M/this.L);this.aj!=c&&
(this.aj=c,this.dispatchEvent("onCurrentPagesChanged",[this.aj]));return c},Hd:function(c){var d=this.nl[c];if(d){this.M--;this.Tn();var e=!1,f=this.gc,h=this.Ad;this.dispatchEvent("onVisualUpdate",[c,null,d.element()]);this.eb()&&this.Sd&&null==this.R&&(e=this.Sd,f=this.Ad,h=this.gc);d.bm(this.Ca)?(this.Ca.removeChild(d),this.Se(h,this.Ca,this.L,e)):d.bm(h)?h.removeChild(d):(this.gc.removeChild(d),this.Se(this.Ca,f,this.L*(this.ue-1),e)&&this.Se(h,this.Ca,this.L,e));this.fa.Pe(c);delete this.nl[c]}},
Ld:function(c,d){var e=!1,f=this.nl[c];f||(f=new dg(c,this),this.nl[c]=f,f.element());N.la(f);this.ap(c,d);var h=this.No(c,d,f),g=this.GJ(),l=!this.values.Ea(c),n=null!=this.R?this.cc(this.values.get(c,this.R)):null,r=null!=this.R?this.cc(d[this.R]):null;d=n==r||!d[this.R]&&null!==d[this.R];null!=this.R&&0==d?(n=this.Vn(f,n,r),this.rD(n,f),l&&(this.M++,e=!0)):l&&(this.wt(f,!this.Sd),this.M++,e=!0);this.my(c,h);this.wf=null;l&&this.eb()&&this.Qv();g&&f.bm(this.Ca)&&(c=this.rC(f.element()),this.CA(c));
e&&this.Tn()},No:function(c,d,e){this.bj=c;this.cj=d;d=new Ve(this.fa,d,c);this.dispatchEvent("onVisualUpdate",[c,d,e.element()]);this.cj=this.bj=null;return d},Vn:function(c,d,e){for(var f=1,h=this.M,g;f<h;){g=Math.floor((f+h)/2);var l=null;g<=this.M&&(l=this.wj(g),l=l==c?d:this.cc(this.values.get(l.getKey(),this.R)));this.bg(e,l)?h=g-1:f=g+1}return f==h?(l=this.wj(f),c=this.cc(this.values.get(l.getKey(),this.R)),this.bg(e,c)?f:f+1):f},wj:function(c){if(c>this.M||0>=c)return null;if(c<=this.gc.length)return this.gc.Uc(c-
1);c-=this.gc.length;if(c<=this.Ca.length)return this.Ca.Uc(c-1);c-=this.Ca.length;return this.Ad.Uc(c-1)},wt:function(c,d){var e=d?this.gc:this.Ad,f=d?this.Ad:this.gc;if(0<f.length||this.Ca.length==this.L&&0<this.L)return f.appendChild(c,d),f;if(0<this.Ca.length||e.length==this.L*(this.ue-1))return this.Ca.appendChild(c,d),this.Ca;e.appendChild(c,d);return e},rD:function(c,d){if(!(c>this.M+1||0>=c)&&d!=this.wj(c)){var e=d.Oh,f=this.Ca,h=this.Ad,g=this.gc,l=this.wj(c);null==l?c=this.wt(d,!0):(c=l.Oh,
c.insertBefore(d,l));c==f?e&&e!=h?e==g&&this.Se(f,g,this.L*(this.ue-1),!1):this.Ck(f,h,this.L):c==g?e!=g&&this.Ck(g,f,this.L*(this.ue-1))&&this.Ck(f,h,this.L):c==h&&(e==g&&this.Se(f,g,this.L*(this.ue-1),!1),this.Se(h,f,this.L,!1))}},Se:function(c,d,e,f){return 0>=this.L?!1:d.length<e&&0<c.length?(c=c.Uc(0),d.appendChild(c,!f),!0):!1},Ck:function(c,d,e){return 0>=this.L?!1:c.length>e?(c=c.Uc(c.length-1),d.insertBefore(c,d.Uc(0)),!0):!1},Qv:function(){for(;0<this.L&&this.M>this.L;)this.di(this.fv())},
addListener:function(c){this._callSuperMethod(a,"addListener",[c])},removeListener:function(c){this._callSuperMethod(a,"removeListener",[c])},yb:function(){return this._callSuperMethod(a,"getListeners")}};a.prototype.setMaxDynaRows=a.prototype.ZH;a.prototype.getMaxDynaRows=a.prototype.mC;a.prototype.goToPage=a.prototype.aD;a.prototype.getCurrentPages=a.prototype.ZB;a.prototype.setAutoScroll=a.prototype.zH;a.prototype.parseHtml=a.prototype.zc;a.prototype.clean=a.prototype.w;a.prototype.addListener=
a.prototype.addListener;a.prototype.removeListener=a.prototype.removeListener;a.prototype.getListeners=a.prototype.yb;a.prototype.updateRowExecution=a.prototype.Ld;a.prototype.removeRowExecution=a.prototype.Hd;D(a,Te);return a}(),fg=function(){function a(b,c){this.LJ=b||60;c=(c||20)/100;this.wE=1+c;this.cE=1-c;this.Hp=new Jb;this.Mh;this.Jh}a.prototype={pe:function(b){this.Lt=b},TF:function(b,c,d,e,f){b=(f-e)/2;d>f?(f+=b,d>f&&(f=d),this.Jh=f,this.qs(e,f)):d<e&&(e-=b,d<e&&(e=d),this.Mh=e,this.qs(e,
f))},SF:function(b,c,d,e){c>e&&(b=(e+d)/2,this.Lt.Xq(b,b+(e-d)))},qF:function(b,c,d,e){this.Lt.Xq(d,d+this.LJ);b=e*this.cE;e*=this.wE;this.Hp.add(c);this.Mh=null!==this.Mh&&this.Mh<=b?this.Mh:b;this.Jh=null!==this.Jh&&this.Jh>=e?this.Jh:e;this.qs(this.Mh,this.Jh)},zF:function(b,c){this.Hp.remove(c)},qs:function(b,c){this.Hp.forEach(function(d){d.Lw(b,c)})}};a.prototype.onListenStart=a.prototype.pe;a.prototype.onYOverflow=a.prototype.TF;a.prototype.onXOverflow=a.prototype.SF;a.prototype.onNewLine=
a.prototype.qF;a.prototype.onRemovedLine=a.prototype.zF;return a}(),gg=function(){function a(c,d,e,f,h){this.YF=c;this.key=d;this.iB=e;this.ne=f||null;this.cw=h;this.Ui="s"+b++}var b=0;a.prototype={qj:function(){var c=this.YF.LB(this.key,this.iB,this.ne);if(!c)return null;if(c.Sa){if(this.ne===c.Vc()&&0>=this.cw)return c}else for(var d=-1,e=0;e<c.length;e++){var f=c[e].Vc();null===f&&d++;if(this.ne===f&&this.cw==d)return c[e]}return null},Mp:function(){var c=this.qj();return c?c.Mp():null},op:function(){var c=
this.qj();return c?c.op():null},sj:function(){var c=this.qj();return c?c.sj():null},If:function(c,d){var e=this.qj();e&&e.If(c,d)},Jf:function(c,d){var e=this.qj();e&&e.Jf(c,d)}};return a}(),We=function(){function a(){this.map={};this.qk={}}function b(d){return null!==d&&"undefined"!=typeof d}function c(d,e,f){var h=d[f];b(h)&&(delete d[f],delete e[h])}a.prototype={set:function(d,e){var f=this.map,h=this.qk;if(!b(d)||!b(e))throw new C("values can't be null nor missing");var g=f[d],l=h[e];b(g)?g!==
e&&(b(l)?(f[l]=g,f[d]=e,h[e]=d,h[g]=l):(delete h[f[d]],f[d]=e,h[e]=d)):b(l)?(delete f[h[e]],h[e]=d,f[d]=e):(f[d]=e,h[e]=d)},remove:function(d){c(this.map,this.qk,d)},YG:function(d){c(this.qk,this.map,d)},get:function(d){return this.map[d]},Ya:function(d){return this.qk[d]},XA:function(d){return"undefined"!=typeof this.get(d)},wu:function(d){return"undefined"!=typeof this.Ya(d)},forEach:function(d){var e=this.map,f;for(f in e)d(f,e[f])},Iu:function(d){var e=this.qk,f;for(f in e)d(f,e[f])}};a.prototype.set=
a.prototype.set;a.prototype.remove=a.prototype.remove;a.prototype.removeReverse=a.prototype.YG;a.prototype.get=a.prototype.get;a.prototype.getReverse=a.prototype.Ya;a.prototype.exist=a.prototype.XA;a.prototype.existReverse=a.prototype.wu;a.prototype.forEach=a.prototype.forEach;a.prototype.forEachReverse=a.prototype.Iu;return a}(),hg=function(){function a(d,e,f,h){this._callSuperConstructor(a,[d]);this.zu=!1;this.nx=null;this.Nx(f||document);this.bs=[];h&&this.Ug(h);this.na=new We;this.hd=null;(e=
this.Ka(e,!0))&&this.zc()}function b(d,e,f){var h=d[e];d[e]=d[f];d[f]=h}L.Mc();var c=k.s("lightstreamer.grids");a.prototype={toString:function(){return["[",this.id,"]"].join("|")},Ug:function(d){if(!d)throw new C("The given cell is null or undefined");if(I.isArray(d))for(var e=0;e<d.length;e++)this.Ug(d[e]);else{d=new ra(d);e=d.mv();if(!e||e!=this.id)throw new C("The cell does not belong to the Grid");this.zu=!0;this.bs.push(d)}},Nx:function(d){if(d&&d.getElementsByTagName)this.nx=d;else throw new C("The given root element is not valid");
},bB:function(){this.jo();if(!1===this.hd)throw new O("Can\u0092t extract schema from cells declared with the data-row property; use data-item instead.");var d=this.kA(),e=[],f;for(f in d)e.push(f);return e},zc:function(){this.parsed=!0;this.fa.Sz();if(this.zu){var d=this.bs;this.bs=[]}else d=ra.Ml(this.nx,this.Gk);for(var e=0;e<d.length;e++){var f=d[e].mv();if(f&&f==this.id&&(f=d[e].Ea())){isNaN(f)||(f=Number(f));if(null===this.hd)this.hd=isNaN(f);else if(this.hd!=isNaN(f))throw O("Can\u0092t mix data-item and data-row declarations on the same grid");
this.hd||(this.L=f>this.L?f:this.L);d[e].da()&&(this.fa.Hz(d[e])||this.fa.Ug(d[e]))}}if(this.fa.ac())throw new O("Please specify at least one cell");},wo:function(d){var e={};this.fa.oB(function(f,h,g){f.Ru()==d&&(e[g]=!0)});return e},kA:function(){var d={};this.fa.fp(function(e){d[e]=!0});return d},Ld:function(d,e){var f=!this.values.Ea(d);if(this.hd)var h=d;else{h=null!=this.R?this.cc(this.values.get(d,this.R)):null;var g=null!=this.R?this.cc(e[this.R]):null,l=h==g||"undefined"==typeof e[this.R];
h=null!=this.R&&0==l?this.Vn(d,h,g):f?this.Sd?1:this.eb()?this.M==this.L?this.M:this.M+1:this.M+1:this.na.get(d);this.eb()&&this.L==this.M&&f&&null!=this.R&&(f=this.px(this.fv()),f<h&&h--,this.na.set(d,f),this.M++,f=!1);this.na.wu(h)&&this.na.Ya(h)!=d&&this.Uv(h,d);this.na.set(d,h)}f&&this.M++;!this.eb()&&h>this.L&&!this.fa.Ea(h)&&(f=this.fa.Ea(h-1),f=Db.ji(f,null,this.qb),this.fa.insertRow(f,h));this.ap(h,e);e=this.No(d,h,e);this.my(h,e,d)},No:function(d,e,f){this.bj=e;this.cj=f;f=new Ve(this.fa,
f,e);this.dispatchEvent("onVisualUpdate",[d,f,e]);this.cj=this.bj=null;return f},lv:function(d,e,f,h,g){return this.hd?d:new gg(this,e,f,h,g)},LB:function(d,e,f){d=this.na.get(d);return this.fa.qh(d,e,f)},Hd:function(d){var e=this.hd?d:this.na.get(d);this.dispatchEvent("onVisualUpdate",[d,null,e]);this.hd||(e!=this.M&&(this.Uv(this.M,d),e=this.na.get(d)),N.ra(this.M,e)||c.g(k.resolve(985)));this.fa.Gu(e,function(f){f.w()});this.M--;this.hd||this.na.remove(d)},px:function(d){var e=this.na.get(d);this.na.remove(d);
this.M--;this.values.Pe(d);this.eb()&&this.$w(d);return e},Uv:function(d,e){e=this.na.get(e);if(d!=e){var f=e?Db.ji(this.fa.Ea(e),null,this.qb):null,h=e?this.na.Ya(e):null;if(e)if(e>d){var g=e-1;var l=d;var n=-1}else g=e+1,l=d,n=1;else null!=this.R||this.Sd?(l=d,g=this.M,n=-1):(g=1,l=d,n=1);for(var r=g;r-n!=l;r+=n){var u=r-n,E=this.fa.Ea(r),t=this.fa.Ea(u);t||this.eb()||(t={},this.fa.insertRow(t,u),N.Fe(e));t?(Db.ji(E,t,this.qb),E=this.na.Ya(r),this.na.set(E,u)):(N.la(this.eb()),N.ra(r,g),E=this.na.Ya(r),
this.px(E))}f?(Db.ji(f,this.fa.Ea(d),this.qb),this.na.set(h,d)):this.fa.Gu(d,function(y){y.w()})}},Vn:function(d,e,f){for(var h=1,g=this.M,l;h<g;){l=Math.floor((h+g)/2);var n=null;l<=this.M&&(n=this.na.Ya(l),n=n==d?e:this.cc(this.values.get(n,this.R)));this.bg(f,n)?g=l-1:h=l+1}return h==g?(n=this.na.Ya(h),d=this.cc(this.values.get(n,this.R)),this.bg(f,d)?h:h+1):h},dG:function(d,e,f,h){var g=this.cc(this.values.get(d[h],this.R));b(d,f,h);for(h=e;e<f;e++){var l=this.cc(this.values.get(d[e],this.R));
this.bg(g,l)||(b(d,e,h),h++)}b(d,h,f);return h},br:function(d,e,f){if(e<f){var h=this.dG(d,e,f,Math.round(e+(f-e)/2));this.br(d,e,h-1);this.br(d,h+1,f)}},Ym:function(){if(!this.hd){var d={};this.na.Iu(function(n,r){d[n]=r});this.br(d,1,this.M);var e={},f=new We,h;for(h in d){f.set(d[h],h);var g=this.na.Ya(h);if(d[h]!=g){var l=this.fa.Ea(h);e[g]=Db.ji(l,null,this.qb);g=d[h];g=e[g]?e[g]:this.fa.Ea(this.na.get(g));Db.ji(g,l,this.qb)}}this.na=f}},addListener:function(d){this._callSuperMethod(a,"addListener",
[d])},removeListener:function(d){this._callSuperMethod(a,"removeListener",[d])},yb:function(){return this._callSuperMethod(a,"getListeners")}};a.prototype.addCell=a.prototype.Ug;a.prototype.setRootNode=a.prototype.Nx;a.prototype.extractItemList=a.prototype.bB;a.prototype.parseHtml=a.prototype.zc;a.prototype.addListener=a.prototype.addListener;a.prototype.removeListener=a.prototype.removeListener;a.prototype.getListeners=a.prototype.yb;a.prototype.updateRowExecution=a.prototype.Ld;a.prototype.removeRowExecution=
a.prototype.Hd;D(a,Te);return a}(),ig=function(){function a(m,q,B,K){if(!h){this.ready=!1;this.Fa=this.Rn=null;m=m||"left";if(!u[m])throw new C("The given value is not valid. Admitted values are no, left and right");K=K||"closed";if(!E[K])throw new C("The given value is not valid. Admitted values are open, closed and dyna");var Z=B?q:"auto";B=B?"auto":q;this.lc=e("div");q=e("div");this.kc=e("div");d(this.lc,{zIndex:"99999"});d(q,{width:"42px",height:"42px",opacity:"0.95",filter:"alpha(opacity=95)",
backgroundColor:"#135656",zIndex:"99999",position:"relative"});d(this.kc,{width:"245px",height:"42px",backgroundColor:"#ECE981",fontFamily:"'Open Sans',Arial,sans-serif",fontSize:"11px",color:"#3E5B3E",position:"absolute",zIndex:"99998",visibility:"hidden",opacity:"0",filter:"alpha(opacity=0)",transition:"all 0.5s",MozTransition:"all 0.5s","-webkit-transition":"all 0.5s",OTransition:"all 0.5s","-ms-transition":"all 0.5s"});"no"==m?(d(this.lc,{position:"absolute"}),d(q,{borderRadius:"4px","float":"left"}),
d(this.kc,{borderTopRightRadius:"4px",borderBottomRightRadius:"4px",left:"38px"})):(d(this.lc,{position:"fixed",top:Z,bottom:B}),"left"==m?(d(this.lc,{left:"0px"}),d(q,{borderTopRightRadius:"4px",borderBottomRightRadius:"4px","float":"left"}),d(this.kc,{borderTopRightRadius:"4px",borderBottomRightRadius:"4px",left:"38px"})):(d(this.lc,{right:"0px"}),d(q,{borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px","float":"right"}),d(this.kc,{borderTopLeftRadius:"4px",borderBottomLeftRadius:"4px",right:"38px"})));
this.lc.appendChild(q);this.lc.appendChild(this.kc);m=e("div");d(m,{position:"absolute",top:"2px",left:"5px",width:"32px",height:"32px"});q.appendChild(m);this.lD(m);this.rJ=new f(q,1);this.ZI=new f(q,2);this.kE=new f(q,3);this.Go=e("div");d(this.Go,{position:"absolute",top:"7px",left:"13px"});this.kc.appendChild(this.Go);this.statusText=e("div");d(this.statusText,{position:"absolute",top:"21px",left:"13px"});this.kc.appendChild(this.statusText);this.Fc(z,z,z,"Ready","DATA STREAMING STATUS",this.Xc);
this.Ff();this.Rf=2;this.dk=!1;"closed"!=K&&(this.ym(!0),"dyna"==K?x.u(this.cv(),1E3):this.dk=!0);K=this.UC();I.Kb(this.kc,"transitionend",K);I.Kb(this.kc,"webkitTransitionEnd",K);I.Kb(this.kc,"MSTransitionEnd",K);I.Kb(this.kc,"oTransitionEnd",K);I.Kb(this.lc,"click",this.OB());I.Kb(this.lc,"mouseover",this.pC());I.Kb(this.lc,"mouseout",this.cv())}}function b(m){var q=e("img");q.src=m;d(q,{display:"none"});return q}function c(){for(var m={},q=0;q<arguments.length;q++)m[arguments[q]]=!0;return m}function d(m,
q){for(var B in q)m.style[B]=q[B]}function e(m){m=document.createElement(m);d(m,{backgroundColor:"transparent"});return m}function f(m,q){this.gq=e("div");d(this.gq,{position:"absolute",bottom:"3px",left:5+11*(q-1)+"px",width:"10px",height:"3px",borderRadius:"2px",backgroundColor:z});m.appendChild(this.gq)}L.Mc();var h=ia.ie(6,!0),g=b("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALDwAACw8BkvkDpQAAABl0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuN6eEncwAAAQDSURBVFhH7ZZtaJVlGMet1IpcgZHVF6XQCAJBxVkUEeGG7KzlS8xe9PiyM888vnBg7gyXExbOkmDH3M7mmmVDK9nOKJ2bw41UfJ3tKCgOF80PRUUvREQQZNvd7/9wP3US5vN4Zh8CBz/uc3au+3/9n+u5X64xY279/Z8r0Hn+zXGQDWGogRbohuNwFNqhCabftOdEbAK8BltgLzRbkozH4ApchSE4CE/dlOQITYZqWAUTXdGSd0smQR6UQR20RHatPrz+/chJPidhJ1TAQph8w2ZIlmXL+wvjLAkgNAPegjdgAUyDh+BReAZC0AAXYRiM5U/GJpjgywgJp8KXYCDOxBzotWIhifz0fVUWPAshSyljHbRA8+XByo8/ORk719xTumff0Q1P+EqsIBLeCZdtcrOlrfQz92miuyM9iEfhNPwOG+HedHG+T4IF0AQ/goFhuARvQ/Z1zZC40E2++1iFWdawzCljuLHIdJ2NSkiCotjrqYgZB/Ohy5r4gzGlio04l+RVroGK1mJTWFuIgbBZmSgw3Z+vd5MPInKbl4FrKnMfc8Z7ziH5q66B2L4ikx/PN8HEYrOiLs/s7FzuGvjUUyjTAJKPh/Mykegucwzkx+eZxe/kmlB9wFz8olwmzmSq72seyR+GlEys2xPEQMDk1TxnCuLPm5KmfHNhoHwIE4/5Ess0yO6GzQf6qn+NNC81gZocx4R4qXau2d6x5Pi2jkV3Z6rve55Ov/bU1opNyVXfvLB97t8mZOSVhrzv4l3RGDH3+BbMNFBro3p/JLhwR06/WwmNMrW5LfzDwdTWTelHdaZ5POd19K65q7Zz6YlFO/6phl7PGl6TXhcmKvX6PIVGE8ACfDzVXzZU3BhwFqYqoYWqBWu3cJ8W8mhyeM7FRN+5/jJTlAg4W1RbVVtWW9ea0Fb2Png8M40QgIEOHcm17UHnkAomXnYM6PByDzIdar70ERrrK9AGEX87fC0Dh3rXcky/6NwXOrY3thSnG6gaUZfJy+Ew/Ay6JFohF+7wMkPMOvdS6jwTvRpuDDkGdHHpAkurQOH1DIxFZB7o2vzKFWT8FuqhAB645kK5n/9VwW/W/Iq1763usn3CMFf3kbTkAze0Gw71ls/+6MiG5IFTsUsDVyqTJPgQNKrJULOhxkNVywZnm5G4yCY/y5hLQjWoqoCamWlelXR+V5tk2yW1TW4LpXbqAtTbJE8zPgIPwlSYD2rLtsFM6ZBwJqh9i8O/mhS/RqYgpgbydWiENjWYNJrdfG6FBMQgICOuqE4/UMOqxnWKr2ReQQg9Cert1WKr1R4E9fut8IFFrbla9CWQ5aXp+3fEpsMuUG+vRSV6bHKVtwTmwH93yPh2eytwFBX4C/nwkj6r2tmsAAAAAElFTkSuQmCC"),
l=b("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALDgAACw4BQL7hQQAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAD00lEQVRYR+2WWWhUVxzG1bq0aBQsbi+KoiIIgpbGFsW3SmlB1AcfVEQxLi9CFjohZt/IIlRCJqNmAnGIEsjEENCEyczEKCpGM9rEYqlQ81BpCy2IlEJBTa6/73JOSYV4rxP7UHDgx5lkzvm+7557lv+0ae8//+cZGBgYmAWZcAy+hQ5IwA24BpchDBve2XMiNg/2QRVcgIihk/Y6jMILGIMr8Pk7MUdoOVTDUVhoRaurqxfDV/ANBKGjpqYmXldXd4vvnXAWTsJuWP7WYTDLMNP7jPYTCSC0EWqhAnbBGlgKq2ArZMEZ+B7GwTG8pA3DPF9BMFwNP4EDpxn4BdwxYlkSGR0dzYBtkGXIow1CB0SGh4fbe3p67kej0bbu7u71vozVCcM58KMxd5qbm6/ap6mvr08ing234W8ogPkTxfl7MeyCMPwBDozDQzgFmW8Mg/Eea97V1eWUlpa601hZWenE43EJSVAc8Xoq+syCnRAzIZ7T3tOMTToW83IbIBgMOgUFBW6A4uJiJ5FIWPPHiEz3CvDazCxgzGzPMZjvtQEaGhqcvLw817yoqMhpa2uzAbo9hdLtgPls+E4h2tvb3QC5ublOfn6+U1JS4qRSKYUYTFff1zjMl8E9hWDhuSGys7PdIBUVFc7Q0NAYIdb6Eku3k9kNJclk8s/a2lonJyfHDSE0G62trTdaWlo+Slff9zidfv39/Sebmpp+sTNhgxQWFv7GugjQZ65vwXQ7am2Ew+EDgUDgBxtArUKFQqHfCVk08ahO18dzXCwW+zASidwkyD+vRK+HO8DR6yJEsV6fp9BUOrAA1w0ODo6VlZW5C9POhBas2cIpLeSpeHiOJUSKEO4ZoUWpIHod2romhLay98Hj6TRJBwL06EhmN7iHlIIogA4ve5DpUPOlj9BMXx1NJ/rPgCcK0NfX55rruNax3djYODFA+aS6DD4IcXgKuiSisB0+8ApDnxP2UmJRvqiqqnID6OLSBTZhBva8KcBMRL4EXZs/W0HaXyEEO2DRaxfKx/yvHP4y4Q9xSMVMnTDO1Y23W0OIR2+1G7hqPyV9Z29v78ORkZFODC6CWhUZKjZUeGjWMsHdZhgfNuZ3abdjqAJV5ipm1njNpPu7yiRTLqlssiWUyqkHEDImW2hXwhJYDTtBZVkdbJIOhptA5dtp+FeR4jfICsRUQBbCObikApNCM8H3KDRBAL5WECuK2UJQwarCdYUvM69OCH0Gqu1VYqvUfgyq96Nw3qDSXCX6fsjw0vT9O2IboAVU29tP0phreo/DZvjvDhnfad93nMIMvAIArtySMI7UCwAAAABJRU5ErkJggg=="),
n=b("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALDgAACw4BQL7hQQAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAECElEQVRYR+2WX2hbZRjGp9uq4qqguOnNhrKJIAycWJWJdw5RkM2LXaiIYnXeCMLYwLkJFQeK4G5mVOqFQ0VoK+iyxJg2bZrEpK3LRpqky9iyLq3705b9UcSBs/38PWffGWfV5JxOxxC8+PGlzTnv++T9vvf9nnmhUGje1eSqJtcP/28LqE3tWwgtsAE+gA7ohjQkIQztsLLeNs+5AgRbBM/CO/AF7LJ0sfbDETgP07AHHm50xgILINBS2A6vwC1u0P6R/sXwBGyCndCRGknFMwdSP/C5Cz6GLfA0LJ0txlcAyZptec+y3q8ABLoP3oW3YR2sgNvhLngEWuEjKMIMGMsfrO2wyBXSUAAJl8NhMLCDFx+DQRusVUHO/fZjMzwKrZaNrDuhA3ad+XnoqyMncvsqP2U/P3Qse2/gCpDwOqjY5CZfzfa6vyZTSfUQ/HXIwTl4A27yBufvxbAO2mEKDMxAGd6HloZtSOL1bvLK8QGTKCUulLHcZ8YmMgqkgOJlv0HGMwthLcSsiN9Z86pY3S0geZsrYKCaNPFi3BHQV4qa8cmMm7xKkGv8BMyqzM280+R7Bkj+jCsgd6jPRAtRqhA3vcWIKdd6XQHfzCX53z3bqAJNCNgvEaXxrCMgWthj4sNhqhAxp87mJGLgiglQYJLfAXmJSB9MICBiIoVvWXezHVFz6kxuGhF3/xMRQeaAuuGt0cn8L6lKAgFhR4T4vrjbFGo96f212A2XK8JXgBtY0+/oVH7LYDV5TBVwRWjtLkVOFMYym3nmxrkKCSzAI6QpP5p6PjYcHvGKkKihav8kIrd6R7WfoDkLuChkInV9sZbIxIa91QgbbZO2CxHbNMyumAA7hu+ZOp2dTpYjzsG8cEAjzoG1LbxXB/lfuQ3rBaEL9iLCaU21qFpVLavWtSLUyhcHT+C7wK907vcIiGgkF48mnCGVKHU7AjS83EGmoVYv3iVngEALgia2W3At74xLQG0iTRW+c8a1xvbA4aRXQFtdAbz8AsThNOiS6IQ1MN9PDM+85l5KtZOZ87qoJEAXly4wTwXWNxKwgCCPg67NMc8td5zPIXgKbpt1odzK/9rgVyv+xfSBVMz6hBmu7j5P8oONuuEvbVibyD2AcegaPZkrYya6SPAlaJXJkNmQ8VDVWsBpMxK/ZJMPsa4hoQyqKiAzsyJQF8gmWbsk2+RaKNmpYQjZJKtZ74QlsBzWgmzZe7DK3h+rSCr7tgMuMSmBbkMCLQMZyDfhE/haBhOj2c3nTvgQNsOTEuId1SSUYZVxXeZ3ftzv/TzhQwSTt5fFltWugvx+J3xmkTWXRX8OmoMm9hVAsJXwKcjb61CJHptc5X0VHoS6QyaImMu+C4IED/LM/wL+BDxNDVItZyFPAAAAAElFTkSuQmCC"),
r=!1,u=c("no","left","right"),E=c("dyna","open","closed");a.prototype={bC:function(){return this.lc},lD:function(m){this.Xc=l.cloneNode(!0);m.appendChild(this.Xc);if(!r&&32!=this.Xc.height&&ia.ie(7)){m.removeChild(this.Xc);var q=e("div");d(q,{textAlign:"center",textOverflow:"ellipsis",fontFamily:"Arial, Helvetica, sans-serif",fontSize:"10px",color:"#333333",verticalAlign:"middle",paddingTop:"3px",width:"32px",height:"32px",display:"none"});q.innerHTML="Net<br/>State";l=g=n=q;r=!0;this.Xc=l.cloneNode(!0);
m.appendChild(this.Xc)}this.vh=g.cloneNode(!0);m.appendChild(this.vh);this.hq=n.cloneNode(!0);m.appendChild(this.hq)},Ff:function(){if(!this.ready){var m=document.getElementsByTagName("body");if(m&&0!=m.length)m[0].appendChild(this.lc),this.ready=!0;else{var q=this;I.Kb(document,"DOMContentLoaded",function(){document.getElementsByTagName("body")[0].appendChild(q.lc);q.ready=!0;q.Rn&&q.ec(q.Rn);0==q.Rf?q.ym():q.ro()})}}},pe:function(m){h||(this.ec(m.Ob()),this.Fa=m)},yq:function(){h||(this.Fc(z,z,
z,"Ready","DATA STREAMING STATUS"),this.Fa=null)},Fc:function(m,q,B,K,Z,X){this.rJ.bo(m);this.ZI.bo(q);this.kE.bo(B);this.statusText.innerHTML=K;this.Go.innerHTML=Z;this.iy(X,!0)},iy:function(m,q){q&&this.VI();this.ny&&(this.ny.style.display="none");m.style.display="";this.ny=m},VI:function(){this.On&&(this.Nn=!1,x.pf(this.On),this.On=null)},Pr:function(){this.On=x.Wg(this.DA,500,this)},DA:function(){this.iy(this.Nn?this.Xc:this.vh);this.Nn=!this.Nn},ec:function(m){if(!this.ready||h)this.Rn=m;else{var q=
this.Fa&&(this.Fa.Kj&&this.Fa.Kj()||this.Fa.mA&&this.Fa.mA.Kj()),B=q?t:y;q=q?"DATA STREAMING STATUS":"DATA STREAMING STATUS (attached)";if("DISCONNECTED"==m)this.Fc(z,z,z,"Disconnected","DATA STREAMING STATUS",this.Xc);else if("CONNECTING"==m)this.Fc(z,z,B,"Connecting...",q,this.Xc),this.Pr();else if(0==m.indexOf("CONNECTED:")){var K=this.Fa&&0==this.Fa.Ao.kv().indexOf("https")?"S in ":" in ";"CONNECTED:STREAM-SENSING"==m?(this.Fc(y,y,B,"Stream-sensing...",q,this.Xc),this.Pr()):"CONNECTED:WS-STREAMING"==
m?this.Fc(t,t,B,"Connected over WS"+K+"streaming mode",q,this.vh):"CONNECTED:HTTP-STREAMING"==m?this.Fc(y,t,B,"Connected over HTTP"+K+"streaming mode",q,this.vh):"CONNECTED:WS-POLLING"==m?this.Fc(t,y,B,"Connected over WS"+K+"polling mode",q,this.vh):"CONNECTED:HTTP-POLLING"==m&&this.Fc(y,y,B,"Connected over HTTP"+K+"polling mode",q,this.vh)}else"STALLED"==m?this.Fc(z,z,B,"Stalled",q,this.hq):"DISCONNECTED:TRYING-RECOVERY"==m?(this.Fc(z,z,B,"Recovering...",q,this.hq),this.Pr()):this.Fc(z,z,B,"Disconnected (will retry)",
q,this.Xc)}},ym:function(){0!=this.Rf&&1!=this.Rf&&(this.Rf=1,d(this.kc,{visibility:"",opacity:"1",filter:"alpha(opacity=100)"}))},ro:function(){2!=this.Rf&&3!=this.Rf&&(this.Rf=3,d(this.kc,{visibility:"hidden",opacity:"0",filter:"alpha(opacity=0)"}),this.dk=!1)},pC:function(){var m=this;return function(){m.ym()}},cv:function(){var m=this;return function(){m.dk||m.ro()}},OB:function(){var m=this;return function(){m.fA()}},fA:function(){this.dk?this.ro():(this.dk=!0,this.ym())},UC:function(){return function(){}}};
var t="#709F70",y="#ECE981",z="#135656";f.prototype.bo=function(m){d(this.gq,{backgroundColor:m})};a.prototype.onStatusChange=a.prototype.ec;a.prototype.onListenStart=a.prototype.pe;a.prototype.onListenEnd=a.prototype.yq;a.prototype.getDomNode=a.prototype.bC;return a}(),jg=function(){function a(b,c,d){this._callSuperConstructor(a,[b,c]);this.vt=!d||0>d?5:d;this.En=0;this.buffer=new Uc(b,c)}L.Mc();a.prototype={KI:function(b){alert(b)},log:function(b,c,d,e){this.En++;this.buffer.log(b,c,d,e);this.En>=
this.vt&&(this.En=0,x.u(this.KI,0,this,[this.buffer.xp(this.vt,"\n","",!1,this.oq)]),this.buffer=new Uc)}};a.prototype.log=a.prototype.log;D(a,oc);return a}(),kg=function(){function a(b,c){if("undefined"==typeof console)throw new O("This appender can't work if a console is not available. Enable the Browser console if possible or change appender.");this._callSuperConstructor(a,[b,c])}a.prototype={log:function(b,c,d,e){d=this.Xi(b,c,d,e);switch(c){case "DEBUG":if(console.debug){console.debug(d);return}break;
case "INFO":if(console.info){console.info(d);return}break;case "WARN":if(console.warn){console.warn(d);return}default:if(console.error){console.error(d);return}}console.log(d)}};a.prototype.log=a.prototype.log;D(a,oc);return a}(),lg=function(){function a(b,c,d){this._callSuperConstructor(a,[b,c]);if(!d)throw new C("a DOMElement instance is necessary for a DOMAppender to work.");this.Md=d;this.qb=this.tq=!1}L.Mc();a.prototype={BI:function(b){this.qb=!0===b},$H:function(b){this.tq=!0===b},log:function(b,
c,d,e){b=this.Xi(b,c,d,e);this.qb?this.Md.innerHTML=this.tq?b+"<br>"+this.Md.innerHTML:this.Md.innerHTML+(b+"<br>"):this.tq?(b=document.createTextNode(b),c=document.createElement("br"),this.Md.insertBefore(c,this.Md.firstChild),this.Md.insertBefore(b,this.Md.firstChild)):(b=document.createTextNode(b),c=document.createElement("br"),this.Md.appendChild(b),this.Md.appendChild(c))}};a.prototype.setUseInnerHtml=a.prototype.BI;a.prototype.setNextOnTop=a.prototype.$H;a.prototype.log=a.prototype.log;D(a,
oc);return a}(),mg=function(){function a(b,c,d,e){this._callSuperConstructor(a,[b,c]);this.zB=d;this.ME=e||null}a.prototype={log:function(b,c,d,e){var f=this.zB;if(f.apply){b=this.Xi(b,c,d,e);try{f.apply(this.ME,[b])}catch(h){}}}};a.prototype.log=a.prototype.log;D(a,oc);return a}(),ng=function(){function a(b,c){this.Oj=b;this.Ti=c;this.Lh="DEBUG"}a.prototype={fatal:function(b){this.Jj()&&this.Oj.hh(this.Ti,"FATAL",b)},Jj:function(){return qa.priority("FATAL")>=qa.priority(this.Lh)},error:function(b){this.Ij()&&
this.Oj.hh(this.Ti,"ERROR",b)},Ij:function(){return qa.priority("ERROR")>=qa.priority(this.Lh)},warn:function(b){this.Lj()&&this.Oj.hh(this.Ti,"WARN",b)},Lj:function(){return qa.priority("WARN")>=qa.priority(this.Lh)},info:function(b){this.Xl()&&this.Oj.hh(this.Ti,"INFO",b)},Xl:function(){return qa.priority("INFO")>=qa.priority(this.Lh)},debug:function(b){this.Wl()&&this.Oj.hh(this.Ti,"DEBUG",b)},Wl:function(){return qa.priority("DEBUG")>=qa.priority(this.Lh)},zk:function(b){this.Lh=qa.priority(b)?
b:"DEBUG"}};a.prototype.fatal=a.prototype.fatal;a.prototype.isFatalEnabled=a.prototype.Jj;a.prototype.error=a.prototype.error;a.prototype.isErrorEnabled=a.prototype.Ij;a.prototype.warn=a.prototype.warn;a.prototype.isWarnEnabled=a.prototype.Lj;a.prototype.info=a.prototype.info;a.prototype.isInfoEnabled=a.prototype.Xl;a.prototype.debug=a.prototype.debug;a.prototype.isDebugEnabled=a.prototype.Wl;a.prototype.setLevel=a.prototype.zk;return a}(),og=function(){function a(){this.Lb=[];this.Hh={}}a.prototype=
{nm:function(){var b=100,c=0;if(0<this.Lb.length){for(var d=0;d<this.Lb.length;d++)qa.priority(this.Lb[d].sh())<b&&(b=qa.priority(this.Lb[d].sh()),c=d);return this.Lb[c].sh()}return null},Dr:function(b){for(var c in this.Hh)this.Hh[c].zk(b)},Wz:function(b,c){if("*"===b.lp())return!0;b=b.lp().split(" ");for(var d=0;d<b.length;d++)if(b[d]==c)return!0;return!1},Bz:function(b){b&&b.log&&b.sh&&(this.Lb.push(b),b.kf&&b.kf(this));this.Dr(this.nm())},VG:function(b){for(var c=0;c<this.Lb.length;c++)if(this.Lb[c]===
b){this.Lb.splice(c,1);this.Dr(this.nm());break}},Ju:function(){this.Dr(this.nm())},uj:function(b){this.Hh[b]||(this.Hh[b]=new ng(this,b),0<this.Lb.length&&this.Hh[b].zk(this.nm()));return this.Hh[b]},hh:function(b,c,d){var e="undefined"!=typeof window?window.name+" ":"";var f=new Date;var h=f.getHours();10>h&&(e+="0");e=e+h+":";h=f.getMinutes();10>h&&(e+="0");e=e+h+":";h=f.getSeconds();10>h&&(e+="0");e=e+h+","+f.getMilliseconds();h=qa.priority(c);for(f=0;f<this.Lb.length;f++)qa.priority(this.Lb[f].sh())<=
h&&this.Wz(this.Lb[f],b)&&this.Lb[f].log(b,c,d,e)}};a.prototype.addLoggerAppender=a.prototype.Bz;a.prototype.removeLoggerAppender=a.prototype.VG;a.prototype.getLogger=a.prototype.uj;a.prototype.dispatchLog=a.prototype.hh;return a}();return{LightstreamerClient:Tf,Subscription:mc,ConnectionSharing:oe,RemoteAppender:Uf,MpnDevice:Vf,MpnSubscription:Re,SafariMpnBuilder:Wf,FirebaseMpnBuilder:Xf,LogMessages:S,Chart:ag,DynaGrid:eg,SimpleChartListener:fg,StaticGrid:hg,StatusWidget:ig,AlertAppender:jg,BufferAppender:Uc,
ConsoleAppender:kg,DOMAppender:lg,FunctionAppender:mg,SimpleLoggerProvider:og}}();if("function"===typeof define&&define.amd)define("lightstreamer",["module"],function(S){S=S.config().ns?S.config().ns+"/":"";define(S+"LightstreamerClient",function(){return H.LightstreamerClient});define(S+"Subscription",function(){return H.Subscription});define(S+"ConnectionSharing",function(){return H.ConnectionSharing});define(S+"RemoteAppender",function(){return H.RemoteAppender});define(S+"MpnDevice",function(){return H.MpnDevice});
define(S+"MpnSubscription",function(){return H.MpnSubscription});define(S+"SafariMpnBuilder",function(){return H.SafariMpnBuilder});define(S+"FirebaseMpnBuilder",function(){return H.FirebaseMpnBuilder});define(S+"LogMessages",function(){return H.LogMessages});define(S+"Chart",function(){return H.Chart});define(S+"DynaGrid",function(){return H.DynaGrid});define(S+"SimpleChartListener",function(){return H.SimpleChartListener});define(S+"StaticGrid",function(){return H.StaticGrid});define(S+"StatusWidget",
function(){return H.StatusWidget});define(S+"AlertAppender",function(){return H.AlertAppender});define(S+"BufferAppender",function(){return H.BufferAppender});define(S+"ConsoleAppender",function(){return H.ConsoleAppender});define(S+"DOMAppender",function(){return H.DOMAppender});define(S+"FunctionAppender",function(){return H.FunctionAppender});define(S+"SimpleLoggerProvider",function(){return H.SimpleLoggerProvider})}),require(["lightstreamer"]);else if("object"===typeof module&&module.exports)exports.LightstreamerClient=
H.LightstreamerClient,exports.Subscription=H.Subscription,exports.ConnectionSharing=H.ConnectionSharing,exports.RemoteAppender=H.RemoteAppender,exports.MpnDevice=H.MpnDevice,exports.MpnSubscription=H.MpnSubscription,exports.SafariMpnBuilder=H.SafariMpnBuilder,exports.FirebaseMpnBuilder=H.FirebaseMpnBuilder,exports.LogMessages=H.LogMessages,exports.Chart=H.Chart,exports.DynaGrid=H.DynaGrid,exports.SimpleChartListener=H.SimpleChartListener,exports.StaticGrid=H.StaticGrid,exports.StatusWidget=H.StatusWidget,
exports.AlertAppender=H.AlertAppender,exports.BufferAppender=H.BufferAppender,exports.ConsoleAppender=H.ConsoleAppender,exports.DOMAppender=H.DOMAppender,exports.FunctionAppender=H.FunctionAppender,exports.SimpleLoggerProvider=H.SimpleLoggerProvider;else{var na=Ye(Xe(),window);na.LightstreamerClient=H.LightstreamerClient;na.Subscription=H.Subscription;na.ConnectionSharing=H.ConnectionSharing;na.RemoteAppender=H.RemoteAppender;na.MpnDevice=H.MpnDevice;na.MpnSubscription=H.MpnSubscription;na.SafariMpnBuilder=
H.SafariMpnBuilder;na.FirebaseMpnBuilder=H.FirebaseMpnBuilder;na.LogMessages=H.LogMessages;na.Chart=H.Chart;na.DynaGrid=H.DynaGrid;na.SimpleChartListener=H.SimpleChartListener;na.StaticGrid=H.StaticGrid;na.StatusWidget=H.StatusWidget;na.AlertAppender=H.AlertAppender;na.BufferAppender=H.BufferAppender;na.ConsoleAppender=H.ConsoleAppender;na.DOMAppender=H.DOMAppender;na.FunctionAppender=H.FunctionAppender;na.SimpleLoggerProvider=H.SimpleLoggerProvider}})();
//# sourceMappingURL=lightstreamer.min.js.map
;
!function(e){"use strict";"undefined"!=typeof module&&module.exports&&(e=global);var t,n,i,r={global:e,isNode:"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0),emptyFn:function(){},identity:function(e){return e},Deconstruct:function(e){for(var t=Array.prototype.slice.call(arguments,1),n=0;n<t.length;n++)t[n].v=7==n?e.Rest:e["Item"+(n+1)]},toString:function(e){if(null==e)throw new System.ArgumentNullException;var t=Bridge.$toStringGuard[Bridge.$toStringGuard.length-1];if(e.toString===Object.prototype.toString||t&&t===e)return Bridge.Reflection.getTypeFullName(e);Bridge.$toStringGuard.push(e);e=e.toString();return Bridge.$toStringGuard.pop(),e},geti:function(e,t,n){if(void 0!==e[t])return t;if(n&&null!=e[n])return n;n=n||t,t=n.lastIndexOf("$");return/\$\d+$/g.test(n)&&(t=n.lastIndexOf("$",t-1)),n.substr(t+1)},box:function(e,t,n,i){return e&&e.$boxed||null==e?e:(e.$clone&&(e=e.$clone()),{$boxed:!0,fn:{toString:n,getHashCode:i},v:e,type:t,constructor:t,getHashCode:function(){return(this.fn.getHashCode?this.fn:Bridge).getHashCode(this.v)},equals:function(e){if(this===e)return!0;var t=this.equals;this.equals=null;e=Bridge.equals(this.v,e);return this.equals=t,e},valueOf:function(){return this.v},toString:function(){return this.fn.toString?this.fn.toString(this.v):this.v.toString()}})},unbox:function(e,t){var n;if(t&&Bridge.isFunction(t)&&(n=t,t=!1),e&&e.$boxed){var i=e.v,r=e.type;if(n&&n.$nullable&&(n=n.$nullableType),n&&"enum"===n.$kind&&(n=System.Enum.getUnderlyingType(n)),r.$nullable&&(r=r.$nullableType),"enum"===r.$kind&&(r=System.Enum.getUnderlyingType(r)),n&&n!==r&&!Bridge.isObject(n))throw new System.InvalidCastException.$ctor1("Specified cast is not valid.");return!t&&i&&i.$clone&&(i=i.$clone()),i}if(Bridge.isArray(e))for(var s=0;s<e.length;s++){var o=e[s];o&&o.$boxed?(o=o.v).$clone&&(o=o.$clone()):!t&&o&&o.$clone&&(o=o.$clone()),e[s]=o}return e&&!t&&e.$clone&&(e=e.$clone()),e},virtualc:function(e){return Bridge.virtual(e,!0)},virtual:function(e,t){var n,i=Bridge.unroll(e);return i&&Bridge.isFunction(i)||(n=Bridge.Class.staticInitAllow,i=t?Bridge.define(e):Bridge.definei(e),Bridge.Class.staticInitAllow=!0,i.$staticInit&&i.$staticInit(),Bridge.Class.staticInitAllow=n),i},safe:function(e){try{return e()}catch(e){}return!1},literal:function(e,t){return t.$getType=function(){return e},t},isJSObject:function(e){return"[object Object]"===Object.prototype.toString.call(e)},isPlainObject:function(e){if("object"!=typeof e||null===e)return!1;if("function"!=typeof Object.getPrototypeOf)return"[object Object]"===Object.prototype.toString.call(e);e=Object.getPrototypeOf(e);return e===Object.prototype||null===e},toPlain:function(e){if(!e||Bridge.isPlainObject(e)||"object"!=typeof e)return e;if("function"==typeof e.toJSON)return e.toJSON();if(Bridge.isArray(e)){for(var t=[],n=0;n<e.length;n++)t.push(Bridge.toPlain(e[n]));return t}var i,r,s={};for(r in e)i=e[r],Bridge.isFunction(i)||(s[r]=i);return s},ref:function(t,n){Bridge.isArray(n)&&(n=System.Array.toIndex(t,n));var e={};return Object.defineProperty(e,"v",{get:function(){return null==n?t:t[n]},set:function(e){null==n&&(e&&e.$clone?e.$clone(t):t=e),t[n]=e}}),e},ensureBaseProperty:function(t,n,e){var i=Bridge.getType(t),r=i.$descriptors||[];if(t.$propMap=t.$propMap||{},t.$propMap[n])return t;if(i.$descriptors&&0!==i.$descriptors.length||!e)for(var s=0;s<r.length;s++){var o=r[s];o.name===n&&(a={},u="$"+Bridge.getTypeAlias(o.cls)+"$"+n,o.get&&(a.get=o.get),o.set&&(a.set=o.set),Bridge.property(t,u,a,!1,i,!0))}else{var a,u="$"+e+"$"+n;(a={}).get=function(){return t[n]},a.set=function(e){t[n]=e},Bridge.property(t,u,a,!1,i,!0)}return t.$propMap[n]=!0,t},property:function(e,t,n,i,r,s){var o,a,u={enumerable:!s,configurable:!0};return n&&n.get&&(u.get=n.get),n&&n.set&&(u.set=n.set),n&&(n.get||n.set)||(s=Bridge.getTypeAlias(r)+"$"+t,r.$init=r.$init||{},i&&(r.$init[s]=n),o=s,a=n,(n=u).get=function(){var e=this.$init[o];return void 0===e?a:e},n.set=function(e){this.$init[o]=e}),Object.defineProperty(e,t,u),u},event:function(e,t,n,i){e[t]=n;var r,s,o,a,u="$"===t.charAt(0)?t.slice(1):t,l="add"+u,n="remove"+u,u=t.lastIndexOf("$");0<u&&0<t.length-u-1&&!isNaN(parseInt(t.substr(u+1)))&&(u=t.substring(0,u-1).lastIndexOf("$")),0<u&&u!==t.length-1&&(l=t.substring(0,u)+"add"+t.substr(u+1),n=t.substring(0,u)+"remove"+t.substr(u+1)),e[l]=(r=t,s=e,i?function(e){s[r]=Bridge.fn.combine(s[r],e)}:function(e){this[r]=Bridge.fn.combine(this[r],e)}),e[n]=(o=t,a=e,i?function(e){a[o]=Bridge.fn.remove(a[o],e)}:function(e){this[o]=Bridge.fn.remove(this[o],e)})},createInstance:function(e,t,n){if(Bridge.isArray(t)&&(n=t,t=!1),e===System.Decimal)return System.Decimal.Zero;if(e===System.Int64)return System.Int64.Zero;if(e===System.UInt64)return System.UInt64.Zero;if(e===System.Double||e===System.Single||e===System.Byte||e===System.SByte||e===System.Int16||e===System.UInt16||e===System.Int32||e===System.UInt32||e===Bridge.Int)return 0;if("function"==typeof e.createInstance)return e.createInstance();if("function"==typeof e.getDefaultValue)return e.getDefaultValue();if(e===Boolean||e===System.Boolean)return!1;if(e===System.DateTime)return System.DateTime.getDefaultValue();if(e===Date)return new Date;if(e===Number)return 0;if(e===String||e===System.String)return"";if(e&&e.$literal)return e.ctor();if(n&&0<n.length)return Bridge.Reflection.applyConstructor(e,n);if("interface"===e.$kind)throw new System.MissingMethodException.$ctor1("Default constructor not found for type "+Bridge.getTypeName(e));n=Bridge.Reflection.getMembers(e,1,54);if(0<n.length){for(var i=n.filter(function(e){return!e.isSynthetic&&!e.sm}),r=0;r<i.length;r++){var s=i[r];if(0===(s.pi||[]).length){if(t||2===s.a)return Bridge.Reflection.invokeCI(s,[]);throw new System.MissingMethodException.$ctor1("Default constructor not found for type "+Bridge.getTypeName(e))}}if(e.$$name&&(1!=n.length||!n[0].isSynthetic))throw new System.MissingMethodException.$ctor1("Default constructor not found for type "+Bridge.getTypeName(e))}return new e},clone:function(e){return null==e?e:Bridge.isArray(e)?System.Array.clone(e):Bridge.isString(e)?e:Bridge.isFunction(Bridge.getProperty(e,"System$ICloneable$clone"))?e.System$ICloneable$clone():Bridge.is(e,System.ICloneable)?e.clone():Bridge.isFunction(e.$clone)?e.$clone():null},copy:function(e,t,n,i){"string"==typeof n&&(n=n.split(/[,;\s]+/));for(var r,s=0,o=n?n.length:0;s<o;s++)r=n[s],!0===i&&null!=e[r]||(Bridge.is(t[r],System.ICloneable)?e[r]=Bridge.clone(t[r]):e[r]=t[r]);return e},get:function(e){return e&&null!==e.$staticInit&&e.$staticInit(),e},ns:function(e,t){var n=e.split("."),i=0;for(t=t||Bridge.global,i=0;i<n.length;i++)void 0===t[n[i]]&&(t[n[i]]={}),t=t[n[i]];return t},ready:function(e,t){function n(){t?e.apply(t):e()}void 0!==Bridge.global.jQuery?Bridge.global.jQuery(n):void 0===Bridge.global.document||"complete"===Bridge.global.document.readyState||"loaded"===Bridge.global.document.readyState||"interactive"===Bridge.global.document.readyState?n():Bridge.on("DOMContentLoaded",Bridge.global.document,n)},on:function(e,t,n,i){t.addEventListener?t.addEventListener(e,function(e){var t=n.apply(i||this,arguments);return!1===t&&(e.stopPropagation(),e.preventDefault()),t},!1):t.attachEvent("on"+e,function(){var e=n.call(i||t,Bridge.global.event);return!1===e&&(Bridge.global.event.returnValue=!1,Bridge.global.event.cancelBubble=!0),e})},addHash:function(e,t,n){if(isNaN(t)&&(t=17),isNaN(n)&&(n=23),Bridge.isArray(e)){for(var i=0;i<e.length;i++)t=t+((t*n|0)+(null==e[i]?0:Bridge.getHashCode(e[i])))|0;return t}return t+((t*n|0)+(null==e?0:Bridge.getHashCode(e)))|0},getHashCode:function(e,t,n){if(e&&e.$boxed&&e.type.getHashCode)return e.type.getHashCode(Bridge.unbox(e,!0));if(e=Bridge.unbox(e,!0),Bridge.isEmpty(e,!0)){if(t)return 0;throw new System.InvalidOperationException.$ctor1("HashCode cannot be calculated for empty value")}if(e.getHashCode&&Bridge.isFunction(e.getHashCode)&&!e.__insideHashCode&&0===e.getHashCode.length){e.__insideHashCode=!0;t=e.getHashCode();return delete e.__insideHashCode,t}if(Bridge.isBoolean(e))return e?1:0;if(Bridge.isDate(e))return 4294967295&(void 0!==e.ticks?e.ticks:System.DateTime.getTicks(e)).toNumber();if(e===Number.POSITIVE_INFINITY)return 2146435072;if(e===Number.NEGATIVE_INFINITY)return 4293918720;if(Bridge.isNumber(e)){if(Math.floor(e)===e)return e;e=e.toExponential()}if(Bridge.isString(e)){if(Math.imul){for(var i=0,r=0;i<e.length;i++)r=Math.imul(31,r)+e.charCodeAt(i)|0;return r}var r=0,s=e.length,i=0;if(0<s)for(;i<s;)r=(r<<5)-r+e.charCodeAt(i++)|0;return r}if(e.$$hashCode)return e.$$hashCode;if(!1!==n&&e.hasOwnProperty("Item1")&&Bridge.isPlainObject(e)&&(n=!0),n&&"object"==typeof e){var o,a=0;for(o in e)e.hasOwnProperty(o)&&(a=29*a+(Bridge.isEmpty(e[o],!0)?0:Bridge.getHashCode(e[o])));if(0!==a)return e.$$hashCode=a}return e.$$hashCode=4294967296*Math.random()|0,e.$$hashCode},getDefaultValue:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("type");return e.getDefaultValue&&0===e.getDefaultValue.length?e.getDefaultValue():Bridge.Reflection.isEnum(e)?System.Enum.parse(e,0):e!==Boolean&&e!==System.Boolean&&(e===System.DateTime?System.DateTime.getDefaultValue():e===Date?new Date:e===Number?0:null)},$$aliasCache:[],getTypeAlias:function(e){if(e.$$alias)return e.$$alias;var t=e.$$name||"function"==typeof e?e:Bridge.getType(e);if(t.$$alias)return t.$$alias;if(n=Bridge.$$aliasCache[t])return n;if(t.$isArray){var n=Bridge.getTypeAlias(t.$elementType)+"$Array"+(1<t.$rank?"$"+t.$rank:"");return t.$$name?t.$$alias=n:Bridge.$$aliasCache[t]=n,n}var i=e.$$name||Bridge.getTypeName(e);if(t.$typeArguments&&!t.$isGenericTypeDefinition){i=t.$genericTypeDefinition.$$name;for(var r=0;r<t.$typeArguments.length;r++){var s=t.$typeArguments[r];i+="$"+Bridge.getTypeAlias(s)}}return n=i.replace(/[\.\(\)\,\+]/g,"$"),t.$module&&(n=t.$module+"$"+n),t.$$name?t.$$alias=n:Bridge.$$aliasCache[t]=n,n},getTypeName:function(e){return Bridge.Reflection.getTypeFullName(e)},hasValue:function(e){return null!=Bridge.unbox(e,!0)},hasValue$1:function(){if(0===arguments.length)return!1;for(var e=0;e<arguments.length;e++)if(null==Bridge.unbox(arguments[e],!0))return!1;return!0},isObject:function(e){return e===Object||e===System.Object},is:function(e,t,n,i){if(null==e)return!!i;t===System.Object&&(t=Object);var r=typeof t;if("boolean"==r)return t;if(e.$boxed){if("enum"===e.type.$kind&&(e.type.prototype.$utype===t||t===System.Enum||t===System.IFormattable||t===System.IComparable))return!0;if(!Bridge.Reflection.isInterface(t)&&!t.$nullable)return e.type===t||Bridge.isObject(t)||t===System.ValueType&&Bridge.Reflection.isValueType(e.type);if(!0!==n&&t.$is)return t.$is(Bridge.unbox(e,!0));if(Bridge.Reflection.isAssignableFrom(t,e.type))return!0;e=Bridge.unbox(e,!0)}var s=e.constructor===Object&&e.$getType?e.$getType():Bridge.Reflection.convertType(e.constructor);if(t.constructor===Function&&e instanceof t||s===t||Bridge.isObject(t))return!0;var o=s.$kind||s.$$inherits,i=t.$kind;if(o||i){if(t.$isInterface){if(o)return s.$isArrayEnumerator?System.Array.is(e,t):t.isAssignableFrom?t.isAssignableFrom(s):0<=Bridge.Reflection.getInterfaces(s).indexOf(t);if(Bridge.isArray(e,s))return System.Array.is(e,t)}return!0!==n&&t.$is?t.$is(e):!(!t.$literal||!Bridge.isPlainObject(e))&&(!e.$getType||Bridge.Reflection.isAssignableFrom(t,e.$getType()))}if("string"==r&&(t=Bridge.unroll(t)),"function"==r&&Bridge.getType(e).prototype instanceof t)return!0;if(!0!==n){if("function"==typeof t.$is)return t.$is(e);if("function"==typeof t.isAssignableFrom)return t.isAssignableFrom(Bridge.getType(e))}return Bridge.isArray(e)?System.Array.is(e,t):"object"==r&&(s===t||e instanceof t)},as:function(e,t,n){return Bridge.is(e,t,!1,n)?null!=e&&e.$boxed&&t!==Object&&t!==System.Object?e.v:e:null},cast:function(e,t,n){if(null==e)return e;n=Bridge.is(e,t,!1,n)?e:null;if(null===n)throw new System.InvalidCastException.$ctor1("Unable to cast type "+(e?Bridge.getTypeName(e):"'null'")+" to type "+Bridge.getTypeName(t));return e.$boxed&&t!==Object&&t!==System.Object?e.v:n},apply:function(e,t,n){for(var i=Bridge.getPropertyNames(t,!0),r=0;r<i.length;r++){var s=i[r];"function"==typeof e[s]&&"function"!=typeof t[s]?e[s](t[s]):e[s]=t[s]}return n&&n.call(e,e),e},copyProperties:function(e,t){for(var n=Bridge.getPropertyNames(t,!1),i=0;i<n.length;i++){var r=n[i],s=t.hasOwnProperty(r),o=r.split("$").length;s&&(1===o||2===o&&r.match("$d+$"))&&(e[r]=t[r])}return e},merge:function(e,t,n,i){if(null==e)return t;if(e instanceof System.Decimal&&"number"==typeof t)return new System.Decimal(t);if(e instanceof System.Int64&&Bridge.isNumber(t))return new System.Int64(t);if(e instanceof System.UInt64&&Bridge.isNumber(t))return new System.UInt64(t);if(e instanceof Boolean||Bridge.isBoolean(e)||"number"==typeof e||e instanceof String||Bridge.isString(e)||e instanceof Function||Bridge.isFunction(e)||e instanceof Date||Bridge.isDate(e)||Bridge.getType(e).$number)return t;var r,s,o;if(Bridge.isArray(t)&&Bridge.isFunction(e.add||e.push))for(o=Bridge.isArray(e)?e.push:e.add,m=0;m<t.length;m++){var a=t[m];Bridge.isArray(a)||(a=[void 0===i?a:Bridge.merge(i(),a)]),o.apply(e,a)}else{var u=Bridge.getType(e),l=u&&u.$descriptors;if(!t)return n&&n.call(e,e),t;for(r in t){s=t[r];var c=null;if(l)for(var m=l.length-1;0<=m;m--)if(l[m].name===r){c=l[m];break}if(null!=c)c.set?e[r]=Bridge.merge(e[r],s):Bridge.merge(e[r],s);else if("function"==typeof e[r])r.match(/^\s*get[A-Z]/)?Bridge.merge(e[r](),s):e[r](s);else{var y,h="set"+r.charAt(0).toUpperCase()+r.slice(1),d="set"+r;if("function"==typeof e[h]&&"function"!=typeof s)"function"==typeof e[y="g"+h.slice(1)]?e[h](Bridge.merge(e[y](),s)):e[h](s);else if("function"==typeof e[d]&&"function"!=typeof s)"function"==typeof e[y="g"+d.slice(1)]?e[d](Bridge.merge(e[y](),s)):e[d](s);else if(s&&s.constructor===Object&&e[r])f=e[r],Bridge.merge(f,s);else{var f=Bridge.isNumber(t);if(e[r]instanceof System.Decimal&&f)return new System.Decimal(t);if(e[r]instanceof System.Int64&&f)return new System.Int64(t);if(e[r]instanceof System.UInt64&&f)return new System.UInt64(t);e[r]=s}}}}return n&&n.call(e,e),e},getEnumerator:function(e,t,n){if("string"==typeof e&&(e=System.String.toCharArray(e)),2===arguments.length&&Bridge.isFunction(t)&&(n=t,t=null),t&&e&&e[t])return e[t].call(e);if(!n&&e&&e.GetEnumerator)return e.GetEnumerator();var i;if(n&&Bridge.isFunction(Bridge.getProperty(e,i="System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(n)+"$GetEnumerator")))return e[i]();if(n&&Bridge.isFunction(Bridge.getProperty(e,i="System$Collections$Generic$IEnumerable$1$GetEnumerator")))return e[i]();if(Bridge.isFunction(Bridge.getProperty(e,i="System$Collections$IEnumerable$GetEnumerator")))return e[i]();if(n&&e&&e.GetEnumerator)return e.GetEnumerator();if("[object Array]"===Object.prototype.toString.call(e)||e&&Bridge.isDefined(e.length))return new Bridge.ArrayEnumerator(e,n);throw new System.InvalidOperationException.$ctor1("Cannot create Enumerator.")},getPropertyNames:function(e,t){var n,i=[];for(n in e)!t&&"function"==typeof e[n]||i.push(n);return i},getProperty:function(e,t){if(!Bridge.isHtmlAttributeCollection(e)||this.isValidHtmlAttributeName(t))return e[t]},isValidHtmlAttributeName:function(e){if(!e||!e.length)return!1;return/^[a-zA-Z_][\w\-]*$/.test(e)},isHtmlAttributeCollection:function(e){return void 0!==e&&"[object NamedNodeMap]"===Object.prototype.toString.call(e)},isDefined:function(e,t){return void 0!==e&&(!t||null!==e)},isEmpty:function(e,t){return null==e||!t&&""===e||!(t||!Bridge.isArray(e))&&0===e.length},toArray:function(e){var t,n,i,r=[];if(Bridge.isArray(e))for(t=0,i=e.length;t<i;++t)r.push(e[t]);else for(t=Bridge.getEnumerator(e);t.moveNext();)n=t.Current,r.push(n);return r},toList:function(e,t){return new(System.Collections.Generic.List$1(t||System.Object).$ctor1)(e)},arrayTypes:[e.Array,e.Uint8Array,e.Int8Array,e.Int16Array,e.Uint16Array,e.Int32Array,e.Uint32Array,e.Float32Array,e.Float64Array,e.Uint8ClampedArray],isArray:function(e,t){t=t||(null!=e?e.constructor:null);return!!t&&(0<=Bridge.arrayTypes.indexOf(t)||t.$isArray||Array.isArray(e))},isFunction:function(e){return"function"==typeof e},isDate:function(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)},isNull:function(e){return null==e},isBoolean:function(e){return"boolean"==typeof e},isNumber:function(e){return"number"==typeof e&&isFinite(e)},isString:function(e){return"string"==typeof e},unroll:function(e,t){if(!Bridge.isArray(e)){for(var n=e.split("."),i=(t||Bridge.global)[n[0]],r=1;r<n.length;r++){if(!i)return null;i=i[n[r]]}return i}for(var r=0;r<e.length;r++){var s=e[r];Bridge.isString(s)&&(e[r]=Bridge.unroll(s,t))}},referenceEquals:function(e,t){return Bridge.hasValue(e)?e===t:!Bridge.hasValue(t)},staticEquals:function(e,t){return Bridge.hasValue(e)?!!Bridge.hasValue(t)&&Bridge.equals(e,t):!Bridge.hasValue(t)},equals:function(e,t){if(null==e&&null==t)return!0;var n=Bridge.$equalsGuard[Bridge.$equalsGuard.length-1];if(n&&n.a===e&&n.b===t)return e===t;Bridge.$equalsGuard.push({a:e,b:t});t=function(e,t){if(e&&e.$boxed&&e.type.equals&&2===e.type.equals.length)return e.type.equals(e,t);if(t&&t.$boxed&&t.type.equals&&2===t.type.equals.length)return t.type.equals(t,e);if(e&&Bridge.isFunction(e.equals)&&1===e.equals.length)return e.equals(t);if(t&&Bridge.isFunction(t.equals)&&1===t.equals.length)return t.equals(e);if(Bridge.isFunction(e)&&Bridge.isFunction(t))return Bridge.fn.equals.call(e,t);if(Bridge.isDate(e)&&Bridge.isDate(t))return void 0!==e.kind&&void 0!==e.ticks&&void 0!==t.kind&&void 0!==t.ticks?e.ticks.equals(t.ticks):e.valueOf()===t.valueOf();if(Bridge.isNull(e)&&Bridge.isNull(t))return!0;if(Bridge.isNull(e)!==Bridge.isNull(t))return!1;var n=e===t;return n||"object"!=typeof e||"object"!=typeof t||null===e||null===t||"struct"!==e.$kind||"struct"!==t.$kind||e.$$name!==t.$$name?!n&&e&&t&&e.hasOwnProperty("Item1")&&Bridge.isPlainObject(e)&&t.hasOwnProperty("Item1")&&Bridge.isPlainObject(t)?Bridge.objectEquals(e,t,!0):n:Bridge.getHashCode(e)===Bridge.getHashCode(t)&&Bridge.objectEquals(e,t)}(e,t);return Bridge.$equalsGuard.pop(),t},objectEquals:function(e,t,n){Bridge.$$leftChain=[],Bridge.$$rightChain=[];n=Bridge.deepEquals(e,t,n);return delete Bridge.$$leftChain,delete Bridge.$$rightChain,n},deepEquals:function(e,t,n){if("object"!=typeof e||"object"!=typeof t)return Bridge.equals(e,t);if(e===t)return!0;if(-1<Bridge.$$leftChain.indexOf(e)||-1<Bridge.$$rightChain.indexOf(t))return!1;for(var i in t){if(t.hasOwnProperty(i)!==e.hasOwnProperty(i))return!1;if(typeof t[i]!=typeof e[i])return!1}for(i in e){if(t.hasOwnProperty(i)!==e.hasOwnProperty(i))return!1;if(typeof e[i]!=typeof t[i])return!1;if(e[i]!==t[i])if("object"!=typeof e[i]||n){if(!Bridge.equals(e[i],t[i]))return!1}else{if(Bridge.$$leftChain.push(e),Bridge.$$rightChain.push(t),!Bridge.deepEquals(e[i],t[i]))return!1;Bridge.$$leftChain.pop(),Bridge.$$rightChain.pop()}}return!0},numberCompare:function(e,t){return e<t?-1:t<e?1:e==t?0:isNaN(e)?isNaN(t)?0:-1:1},compare:function(e,t,n,i){if(e&&e.$boxed&&(e=Bridge.unbox(e,!0)),t&&t.$boxed&&(t=Bridge.unbox(t,!0)),"number"==typeof e&&"number"==typeof t)return Bridge.numberCompare(e,t);if(!Bridge.isDefined(e,!0)){if(n)return 0;throw new System.NullReferenceException}if(Bridge.isString(e))return System.String.compare(e,t);if(Bridge.isNumber(e)||Bridge.isBoolean(e))return e<t?-1:t<e?1:0;if(Bridge.isDate(e))return void 0!==e.kind&&void 0!==e.ticks?Bridge.compare(System.DateTime.getTicks(e),System.DateTime.getTicks(t)):Bridge.compare(e.valueOf(),t.valueOf());var r;if(i&&Bridge.isFunction(Bridge.getProperty(e,r="System$IComparable$1$"+Bridge.getTypeAlias(i)+"$compareTo")))return e[r](t);if(i&&Bridge.isFunction(Bridge.getProperty(e,r="System$IComparable$1$compareTo")))return e[r](t);if(Bridge.isFunction(Bridge.getProperty(e,r="System$IComparable$compareTo")))return e[r](t);if(Bridge.isFunction(e.compareTo))return e.compareTo(t);if(i&&Bridge.isFunction(Bridge.getProperty(t,r="System$IComparable$1$"+Bridge.getTypeAlias(i)+"$compareTo")))return-t[r](e);if(i&&Bridge.isFunction(Bridge.getProperty(t,r="System$IComparable$1$compareTo")))return-t[r](e);if(Bridge.isFunction(Bridge.getProperty(t,r="System$IComparable$compareTo")))return-t[r](e);if(Bridge.isFunction(t.compareTo))return-t.compareTo(e);if(n)return 0;throw new System.Exception("Cannot compare items")},equalsT:function(e,t,n){if(e&&e.$boxed&&e.type.equalsT&&2===e.type.equalsT.length)return e.type.equalsT(e,t);if(t&&t.$boxed&&t.type.equalsT&&2===t.type.equalsT.length)return t.type.equalsT(t,e);if(!Bridge.isDefined(e,!0))throw new System.NullReferenceException;return Bridge.isNumber(e)||Bridge.isString(e)||Bridge.isBoolean(e)?e===t:Bridge.isDate(e)?void 0!==e.kind&&void 0!==e.ticks?System.DateTime.getTicks(e).equals(System.DateTime.getTicks(t)):e.valueOf()===t.valueOf():n&&null!=e&&Bridge.isFunction(Bridge.getProperty(e,i="System$IEquatable$1$"+Bridge.getTypeAlias(n)+"$equalsT"))?e[i](t):n&&null!=t&&Bridge.isFunction(Bridge.getProperty(t,i="System$IEquatable$1$"+Bridge.getTypeAlias(n)+"$equalsT"))?t[i](e):Bridge.isFunction(e)&&Bridge.isFunction(t)?Bridge.fn.equals.call(e,t):e.equalsT?e.equalsT(t):t.equalsT(e);var i},format:function(e,t,n){if(e&&e.$boxed){if("enum"===e.type.$kind)return System.Enum.format(e.type,e.v,t);if(e.type===System.Char)return System.Char.format(Bridge.unbox(e,!0),t,n);if(e.type.format)return e.type.format(Bridge.unbox(e,!0),t,n)}return Bridge.isNumber(e)?Bridge.Int.format(e,t,n):Bridge.isDate(e)?System.DateTime.format(e,t,n):Bridge.isFunction(Bridge.getProperty(e,"System$IFormattable$format"))?e.System$IFormattable$format(t,n):e.format(t,n)},getType:function(e,t){if(e&&e.$boxed)return e.type;if(null==e)throw new System.NullReferenceException.$ctor1("instance is null");if(t){var n=Bridge.getType(e);return Bridge.Reflection.isAssignableFrom(t,n)?n:t}if("number"==typeof e)return!isNaN(e)&&isFinite(e)&&Math.floor(e,0)===e?System.Int32:System.Double;if(e.$type)return e.$type;if(e.$getType)return e.$getType();var i=null;try{i=e.constructor}catch(e){i=Object}return i===Object&&(t=e.toString(),"Object"!=((t=/\[object (.{1,})\]/.exec(t))&&1<t.length?t[1]:"Object")&&(i=e)),Bridge.Reflection.convertType(i)},isLower:function(e){e=String.fromCharCode(e);return e===e.toLowerCase()&&e!==e.toUpperCase()},isUpper:function(e){e=String.fromCharCode(e);return e!==e.toLowerCase()&&e===e.toUpperCase()},coalesce:function(e,t){return Bridge.hasValue(e)?e:t},fn:{equals:function(e){if(this===e)return!0;if(null==e||this.constructor!==e.constructor)return!1;if(this.$invocationList&&e.$invocationList){if(this.$invocationList.length!==e.$invocationList.length)return!1;for(var t=0;t<this.$invocationList.length;t++)if(this.$invocationList[t]!==e.$invocationList[t])return!1;return!0}return this.equals&&this.equals===e.equals&&this.$method&&this.$method===e.$method&&this.$scope&&this.$scope===e.$scope},call:function(e,t){var n=Array.prototype.slice.call(arguments,2);return(e=e||Bridge.global)[t].apply(e,n)},makeFn:function(C,e){switch(e){case 0:return function(){return C.apply(this,arguments)};case 1:return function(e){return C.apply(this,arguments)};case 2:return function(e,t){return C.apply(this,arguments)};case 3:return function(e,t,n){return C.apply(this,arguments)};case 4:return function(e,t,n,i){return C.apply(this,arguments)};case 5:return function(e,t,n,i,r){return C.apply(this,arguments)};case 6:return function(e,t,n,i,r,s){return C.apply(this,arguments)};case 7:return function(e,t,n,i,r,s,o){return C.apply(this,arguments)};case 8:return function(e,t,n,i,r,s,o,a){return C.apply(this,arguments)};case 9:return function(e,t,n,i,r,s,o,a,u){return C.apply(this,arguments)};case 10:return function(e,t,n,i,r,s,o,a,u,l){return C.apply(this,arguments)};case 11:return function(e,t,n,i,r,s,o,a,u,l,c){return C.apply(this,arguments)};case 12:return function(e,t,n,i,r,s,o,a,u,l,c,m){return C.apply(this,arguments)};case 13:return function(e,t,n,i,r,s,o,a,u,l,c,m,y){return C.apply(this,arguments)};case 14:return function(e,t,n,i,r,s,o,a,u,l,c,m,y,h){return C.apply(this,arguments)};case 15:return function(e,t,n,i,r,s,o,a,u,l,c,m,y,h,d){return C.apply(this,arguments)};case 16:return function(e,t,n,i,r,s,o,a,u,l,c,m,y,h,d,f){return C.apply(this,arguments)};case 17:return function(e,t,n,i,r,s,o,a,u,l,c,m,y,h,d,f,g){return C.apply(this,arguments)};case 18:return function(e,t,n,i,r,s,o,a,u,l,c,m,y,h,d,f,g,S){return C.apply(this,arguments)};case 19:return function(e,t,n,i,r,s,o,a,u,l,c,m,y,h,d,f,g,S,p){return C.apply(this,arguments)};default:return function(e,t,n,i,r,s,o,a,u,l,c,m,y,h,d,f,g,S,p,$){return C.apply(this,arguments)}}},cacheBind:function(e,t,n,i){return Bridge.fn.bind(e,t,n,i,!0)},bind:function(n,i,r,s,e){if(i&&i.$method===i&&i.$scope===n)return i;if(n&&e&&n.$$bind)for(var t=0;t<n.$$bind.length;t++)if(n.$$bind[t].$method===i)return n.$$bind[t];var o=2===arguments.length?Bridge.fn.makeFn(function(){Bridge.caller.unshift(this);var e=null;try{e=i.apply(n,arguments)}finally{Bridge.caller.shift(this)}return e},i.length):Bridge.fn.makeFn(function(){var e=r||arguments;!0===s?e=(e=Array.prototype.slice.call(arguments,0)).concat(r):"number"==typeof s&&(e=Array.prototype.slice.call(arguments,0),0===s?e.unshift.apply(e,r):s<e.length?e.splice.apply(e,[s,0].concat(r)):e.push.apply(e,r)),Bridge.caller.unshift(this);var t=null;try{t=i.apply(n,e)}finally{Bridge.caller.shift(this)}return t},i.length);return n&&e&&(n.$$bind=n.$$bind||[],n.$$bind.push(o)),o.$method=i,o.$scope=n,o.equals=Bridge.fn.equals,o},bindScope:function(n,i){var e=Bridge.fn.makeFn(function(){var e=Array.prototype.slice.call(arguments,0);e.unshift.apply(e,[n]),Bridge.caller.unshift(this);var t=null;try{t=i.apply(n,e)}finally{Bridge.caller.shift(this)}return t},i.length);return e.$method=i,e.$scope=n,e.equals=Bridge.fn.equals,e},$build:function(n){if(!n||0===n.length)return null;function e(){for(var e=null,t=0;t<n.length;t++)e=n[t].apply(null,arguments);return e}return e.$invocationList=n?Array.prototype.slice.call(n,0):[],n=e.$invocationList.slice(),e},combine:function(e,t){if(!e||!t){var n=e||t;return n&&Bridge.fn.$build([n])}e=e.$invocationList||[e],t=t.$invocationList||[t];return Bridge.fn.$build(e.concat(t))},getInvocationList:function(e){if(null==e)throw new System.ArgumentNullException;return e.$invocationList||(e.$invocationList=[e]),e.$invocationList},remove:function(e,t){if(!e||!t)return e||null;for(var n=e.$invocationList?e.$invocationList.slice(0):[e],i=t.$invocationList||[t],r=n.length-i.length;0<=r;r--)if(Bridge.fn.equalInvocationLists(n,i,r,i.length))return n.length-i.length==0?null:n.length-i.length==1?n[0!=r?0:n.length-1]:(n.splice(r,i.length),Bridge.fn.$build(n));return e},equalInvocationLists:function(e,t,n,i){for(var r=0;r<i;r=r+1|0)if(!Bridge.equals(e[System.Array.index(n+r|0,e)],t[System.Array.index(r,t)]))return!1;return!0}},sleep:function(e,t){if(Bridge.hasValue(t)&&(e=t.getTotalMilliseconds()),isNaN(e)||e<-1||2147483647<e)throw new System.ArgumentOutOfRangeException.$ctor4("timeout","Number must be either non-negative and less than or equal to Int32.MaxValue or -1");-1==e&&(e=2147483647);for(var n=(new Date).getTime();(new Date).getTime()-n<e&&!(2147483647<(new Date).getTime()-n););},getMetadata:function(e){return e.$getMetadata?e.$getMetadata():e.$metadata},loadModule:function(e,n){var t,i=e.amd,r=e.cjs,e=e.fn,s=new System.Threading.Tasks.TaskCompletionSource,o=Bridge.global[e||"require"];if(i&&0<i.length)return o(i,function(){var e=Array.prototype.slice.call(arguments,0);if(r&&0<r.length)for(var t=0;t<r.length;t++)e.push(o(r[t]));n.apply(Bridge.global,e),s.setResult()}),s.task;if(r&&0<r.length){(t=new System.Threading.Tasks.Task).status=System.Threading.Tasks.TaskStatus.ranToCompletion;for(var a=[],u=0;u<r.length;u++)a.push(o(r[u]));return n.apply(Bridge.global,a),t}return(t=new System.Threading.Tasks.Task).status=System.Threading.Tasks.TaskStatus.ranToCompletion,t}};function s(e){e.data==i&&(e=(t=t.next).func,delete t.func,e())}e.setImmediate?r.setImmediate=e.setImmediate.bind(e):r.setImmediate=(n=t={},i=Math.random(),"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("message",s):window.attachEvent("onmessage",s)),function(e){n=n.next={func:e},"undefined"!=typeof window&&window.postMessage(i,"*")}),e.Bridge=r,e.Bridge.caller=[],e.Bridge.$equalsGuard=[],e.Bridge.$toStringGuard=[],e.console&&(e.Bridge.Console=e.console),e.System={},e.System.Diagnostics={},e.System.Diagnostics.Contracts={},e.System.Threading={};var o=function(e){return Bridge.global.navigator&&e.test(Bridge.global.navigator.userAgent.toLowerCase())},a=Bridge.global.document&&"CSS1Compat"===Bridge.global.document.compatMode,u=function(e,t){var n;return Bridge.global.navigator&&e&&(n=t.exec(navigator.userAgent.toLowerCase()))?parseFloat(n[1]):0},l=Bridge.global.document?Bridge.global.document.documentMode:null,c=o(/opera/),m=c&&o(/version\/10\.5/),y=o(/\bchrome\b/),h=o(/webkit/),d=!y&&o(/safari/),f=d&&o(/applewebkit\/4/),g=d&&o(/version\/3/),S=d&&o(/version\/4/),p=d&&o(/version\/5\.0/),$=d&&o(/version\/5/),C=!c&&(o(/msie/)||o(/trident/)),I=C&&(o(/msie 7/)&&8!==l&&9!==l&&10!==l||7===l),E=C&&(o(/msie 8/)&&7!==l&&9!==l&&10!==l||8===l),x=C&&(o(/msie 9/)&&7!==l&&8!==l&&10!==l||9===l),A=C&&(o(/msie 10/)&&7!==l&&8!==l&&9!==l||10===l),B=C&&(o(/trident\/7\.0/)&&7!==l&&8!==l&&9!==l&&10!==l||11===l),w=C&&o(/msie 6/),v=!h&&!C&&o(/gecko/),_=v&&o(/rv:1\.9/),T=v&&o(/rv:2\.0/),b=v&&o(/rv:5\./),R=v&&o(/rv:10\./),D=_&&o(/rv:1\.9\.0/),N=_&&o(/rv:1\.9\.1/),O=_&&o(/rv:1\.9\.2/),k=o(/windows|win32/),G=o(/macintosh|mac os x/),F=o(/linux/),P=u(!0,/\bchrome\/(\d+\.\d+)/),L=u(!0,/\bfirefox\/(\d+\.\d+)/),V=u(C,/msie (\d+\.\d+)/),M=u(c,/version\/(\d+\.\d+)/),z=u(d,/version\/(\d+\.\d+)/),q=u(h,/webkit\/(\d+\.\d+)/),H=!!Bridge.global.location&&/^https/i.test(Bridge.global.location.protocol),U=Bridge.global.navigator&&/iPhone/i.test(Bridge.global.navigator.platform),r=Bridge.global.navigator&&/iPod/i.test(Bridge.global.navigator.platform),e=Bridge.global.navigator&&/iPad/i.test(Bridge.global.navigator.userAgent),l=Bridge.global.navigator&&/Blackberry/i.test(Bridge.global.navigator.userAgent),o=Bridge.global.navigator&&/Android/i.test(Bridge.global.navigator.userAgent),r={isStrict:a,isIEQuirks:C&&!a&&(w||I||E||x),isOpera:c,isOpera10_5:m,isWebKit:h,isChrome:y,isSafari:d,isSafari3:g,isSafari4:S,isSafari5:$,isSafari5_0:p,isSafari2:f,isIE:C,isIE6:w,isIE7:I,isIE7m:w||I,isIE7p:C&&!w,isIE8:E,isIE8m:w||I||E,isIE8p:C&&!(w||I),isIE9:x,isIE9m:w||I||E||x,isIE9p:C&&!(w||I||E),isIE10:A,isIE10m:w||I||E||x||A,isIE10p:C&&!(w||I||E||x),isIE11:B,isIE11m:w||I||E||x||A||B,isIE11p:C&&!(w||I||E||x||A),isGecko:v,isGecko3:_,isGecko4:T,isGecko5:b,isGecko10:R,isFF3_0:D,isFF3_5:N,isFF3_6:O,isFF4:4<=L&&L<5,isFF5:5<=L&&L<6,isFF10:10<=L&&L<11,isLinux:F,isWindows:k,isMac:G,chromeVersion:P,firefoxVersion:L,ieVersion:V,operaVersion:M,safariVersion:z,webKitVersion:q,isSecure:H,isiPhone:U,isiPod:r,isiPad:e,isBlackberry:l,isAndroid:o,isDesktop:u=G||k||F&&!o,isTablet:e,isPhone:!u&&!e,iOS:U||e||r,standalone:!!Bridge.global.navigator&&!!Bridge.global.navigator.standalone};Bridge.Browser=r,r={_initialize:function(){this.$init||(this.$init={},this.$staticInit&&this.$staticInit(),this.$initMembers&&this.$initMembers())},initConfig:function(e,t,n,i,u,l){var r,s,o=i?u:u.ctor,c=o.$descriptors,m=o.$aliases;if(n.fields)for(s in n.fields)u[s]=n.fields[s];var a=n.properties;if(a)for(s in a){var y,h=a[s];if(null!=h&&Bridge.isPlainObject(h)&&(!h.get||!h.set)){for(var d=0;d<c.length;d++)c[d].name===s&&(y=c[d]);y&&y.get&&!h.get&&(h.get=y.get),y&&y.set&&!h.set&&(h.set=y.set)}(h=Bridge.property(i?u:l,s,h,i,o)).name=s,h.cls=o,c.push(h)}if(n.events)for(s in n.events)Bridge.event(u,s,n.events[s],i);if(n.alias)for(var f=0;f<n.alias.length;f++)!function(e,t,n){for(var i=null,r=c.length-1;0<=r;r--)if(c[r].name===t){i=c[r];break}for(var s,o=Array.isArray(n)?n:[n],a=0;a<o.length;a++)n=o[a],null!=i?(Object.defineProperty(e,n,i),m.push({alias:n,descriptor:i})):(u.hasOwnProperty(t)||!l?void 0===(s=u[t])&&l&&(s=l[t]):void 0===(s=l[t])&&(s=u[t]),Bridge.isFunction(s)?(e[n]=s,m.push({fn:t,alias:n})):(i={get:function(){return this[t]},set:function(e){this[t]=e}},Object.defineProperty(e,n,i),m.push({alias:n,descriptor:i})))}(i?u:l,n.alias[f],n.alias[f+1]),f++;n.init&&(r=n.init),(r||e&&!i&&t.$initMembers)&&(u.$initMembers=function(){e&&!i&&t.$initMembers&&t.$initMembers.call(this),r&&r.call(this)})},convertScheme:function(e){function t(e,t){for(var n=["fields","methods","events","props","properties","alias","ctors"],i=Object.keys(e),r=0;r<i.length;r++){var s=i[r];-1===n.indexOf(s)&&(t[s]=e[s])}e.fields&&Bridge.apply(t,e.fields),e.methods&&Bridge.apply(t,e.methods);var o={},a=!1;e.props?(o.properties=e.props,a=!0):e.properties&&(o.properties=e.properties,a=!0),e.events&&(o.events=e.events,a=!0),e.alias&&(o.alias=e.alias,a=!0),e.ctors&&(e.ctors.init&&(o.init=e.ctors.init,a=!0,delete e.ctors.init),Bridge.apply(t,e.ctors)),a&&(t.$config=o)}var n={};return e.main&&(n.$main=e.main,delete e.main),t(e,n),(e.statics||e.$statics)&&(n.$statics={},t(e.statics||e.$statics,n.$statics)),n},definei:function(e,t,n){!0!==n&&n||!t?n?n.$kind="interface":t={$kind:"interface"}:t.$kind="interface";n=Bridge.define(e,t,n);return n.$kind="interface",n.$isInterface=!0,n},define:function(n,e,i,t){var r,s=!1;if(!0===i?(s=!0,i=e,e=Bridge.global):i||(i=e,e=Bridge.global),Bridge.isFunction(i))return(r=function(){var e,t=Bridge.Class.getCachedType(r,arguments);return t?t.type:(e=Array.prototype.slice.call(arguments),t=i.apply(null,e),e=Bridge.define(Bridge.Class.genericName(n,e),t,!0,{fn:r,args:e}),Bridge.Class.staticInitAllow||Bridge.Class.queueIsBlocked||Bridge.Class.$queue.push(e),Bridge.get(e))}).$cache=[],Bridge.Class.generic(n,e,r,i);s||(Bridge.Class.staticInitAllow=!1),(i=i||{}).$kind=i.$kind||"class";var o=!1;null!==i.$kind.match("^nested ")&&(o=!0,i.$kind=i.$kind.substr(7)),"enum"!==i.$kind||i.inherits||(i.inherits=[System.IComparable,System.IFormattable]);var a=["fields","events","props","ctors","methods"],u=Bridge.isFunction(i.main)?0:1,l=function(e){if(e.config&&Bridge.isPlainObject(e.config)||e.$main&&Bridge.isFunction(e.$main)||e.hasOwnProperty("ctor")&&Bridge.isFunction(e.ctor))return!(u=1);if(e.alias&&Bridge.isArray(e.alias)&&0<e.alias.length&&e.alias.length%2==0)return!0;for(var t=0;t<a.length;t++)if(e[a[t]]&&Bridge.isPlainObject(e[a[t]]))return!0;return!1},c=l(i);!c&&i.statics&&(c=l(i.statics)),(c=c||0==u)&&(i=Bridge.Class.convertScheme(i));var m,y,h,d,f,g,S=i.$inherits||i.inherits,p=i.$statics||i.statics,$=i.$entryPoint,C=i.$scope||e||Bridge.global,l=Bridge.global.System&&Bridge.global.System.Object||Object,c=!0;"enum"===i.$kind&&(S=[System.Enum]),!0===i.$noRegister&&(c=!1,delete i.$noRegister),i.$inherits?delete i.$inherits:delete i.inherits,$&&delete i.$entryPoint,Bridge.isFunction(p)?p=null:i.$statics?delete i.$statics:delete i.statics;var I,E,e=i.hasOwnProperty("ctor")&&i.ctor;if(e?I=e:(I=i.$literal?function(e){return(e=e||{}).$getType=function(){return I},e}:function(){this.$initialize(),I.$base&&(I.$$inherits&&0<I.$$inherits.length&&I.$$inherits[0].$staticInit&&I.$$inherits[0].$staticInit(),I.$base.ctor?I.$base.ctor.call(this):Bridge.isFunction(I.$base.constructor)&&I.$base.constructor.call(this))},i.ctor=I),i.$literal&&(p&&p.createInstance||(I.createInstance=function(){var e={$getType:function(){return I}};return e}),I.$literal=!0,delete i.$literal),!s&&c&&Bridge.Class.set(C,n,I),t&&t.fn.$cache.push({type:I,args:t.args}),I.$$name=n,o&&(E=I.$$name.lastIndexOf("."),I.$$name=I.$$name.substr(0,E)+"+"+I.$$name.substr(E+1)),I.$kind=i.$kind,i.$module&&(I.$module=i.$module),i.$metadata&&(I.$metadata=i.$metadata),t&&s){I.$genericTypeDefinition=t.fn,I.$typeArguments=t.args,I.$assembly=t.fn.$assembly||Bridge.$currentAssembly;for(var x=Bridge.Reflection.getTypeFullName(t.fn),A=0;A<t.args.length;A++)x+=(0===A?"[":",")+"["+Bridge.Reflection.getTypeQName(t.args[A])+"]";x+="]",I.$$fullname=x}else I.$$fullname=I.$$name;S&&Bridge.isFunction(S)&&(S=S()),Bridge.Class.createInheritors(I,S),S&&"interface"!==S[0].$kind||(S=null),m=(S?S[0]:this).prototype,I.$base=m,y=S&&!S[0].$$initCtor?(e=S[0],((E=function(){}).prototype=e.prototype).constructor=e,E.prototype.$$fullname=Bridge.Reflection.getTypeFullName(e),new E):new(S?S[0].$$initCtor:l.$$initCtor||l),I.$$initCtor=function(){},I.$$initCtor.prototype=y,(I.$$initCtor.prototype.constructor=I).$$initCtor.prototype.$$fullname=t&&s?I.$$fullname:I.$$name,!p||(B=p.$config||p.config)&&!Bridge.isFunction(B)&&(Bridge.Class.initConfig(S,m,B,!0,I),p.$config?delete p.$config:delete p.config);var B=i.$config||i.config;B&&!Bridge.isFunction(B)?(Bridge.Class.initConfig(S,m,B,!1,i,y),i.$config?delete i.$config:delete i.config):S&&m.$initMembers&&(i.$initMembers=function(){m.$initMembers.call(this)}),i.$initialize=Bridge.Class._initialize;var w=[];for(g in i)w.push(g);for(A=0;A<w.length;A++){g=w[A],h=i[g],d="ctor"===g,f=g,Bridge.isFunction(h)&&(d||null!==g.match("^\\$ctor"))&&(d=!0);var v=i[g];d&&(I[f]=v,I[f].prototype=y,I[f].prototype.constructor=I),y[f]=v}if(y.$$name=n,y.toJSON||(y.toJSON=Bridge.Class.toJSON),p){for(g in p){v=p[g];"ctor"===g?I.$ctor=v:("enum"!==i.$kind||Bridge.isFunction(v)||"$"===g.charAt(0)||(I.$names=I.$names||[],I.$names.push({name:g,value:v})),I[g]=v)}"enum"===i.$kind&&I.$names&&(I.$names=I.$names.sort(function(e,t){return Bridge.isFunction(e.value.eq)?e.value.sub(t.value).sign():e.value-t.value}).map(function(e){return e.name}))}return S=S||[l].concat(I.$interfaces),Bridge.Class.setInheritors(I,S),r=function(){Bridge.Class.staticInitAllow&&!I.$isGenericTypeDefinition&&(I.$staticInit=null,I.$initMembers&&I.$initMembers(),I.$ctor&&I.$ctor())},($||Bridge.isFunction(y.$main))&&(y.$main&&($=y.$main.name||"Main",I[$]||(I[$]=y.$main)),Bridge.Class.$queueEntry.push(I)),I.$staticInit=r,!s&&c&&Bridge.Class.registerType(n,I),Bridge.Reflection&&(I.$getMetadata=Bridge.Reflection.getMetadata),"enum"===I.$kind&&(I.prototype.$utype||(I.prototype.$utype=System.Int32),I.$is=function(e){var t=I.prototype.$utype;return t===String?"string"==typeof e:t&&t.$is?t.$is(e):"number"==typeof e},I.getDefaultValue=function(){var e=I.prototype.$utype;return e===String||e===System.String?null:0}),"interface"===I.$kind&&(I.prototype.$variance&&(I.isAssignableFrom=Bridge.Class.varianceAssignable),I.$isInterface=!0),I},toCtorString:function(){return Bridge.Reflection.getTypeName(this)},createInheritors:function(e,t){var n=[],i=[],r=[],s=[];if(t)for(var o=0;o<t.length;o++){var a=t[o],u=(a.$interfaces||[]).concat(a.$baseInterfaces||[]),l=a.$descriptors,c=a.$aliases;if(l&&0<l.length)for(var m=0;m<l.length;m++)r.push(l[m]);if(c&&0<c.length)for(m=0;m<c.length;m++)s.push(c[m]);if(0<u.length)for(var y=0;y<u.length;y++)i.indexOf(u[y])<0&&i.push(u[y]);"interface"===a.$kind&&n.push(a)}e.$descriptors=r,e.$aliases=s,e.$baseInterfaces=i,e.$interfaces=n,e.$allInterfaces=n.concat(i)},toJSON:function(){var e,t={},n=Bridge.getType(this).$descriptors||[];for(e in this){var i=this.hasOwnProperty(e),r=null;if(!i)for(var s=n.length-1;0<=s;s--)if(n[s].name===e){r=n[s];break}var o=e.split("$").length;(i||null!=r)&&(1===o||2===o&&e.match("$d+$"))&&(t[e]=this[e])}return t},setInheritors:function(e,t){e.$$inherits=t;for(var n=0;n<t.length;n++){var i=t[n];i.$$inheritors||(i.$$inheritors=[]),i.$$inheritors.push(e)}},varianceAssignable:function(e){function t(e,t){if(t.$genericTypeDefinition===e.$genericTypeDefinition&&t.$typeArguments.length===e.$typeArguments.length){for(var n=0;n<e.$typeArguments.length;n++){var i=e.prototype.$variance[n],r=e.$typeArguments[n],s=t.$typeArguments[n];switch(i){case 1:if(!Bridge.Reflection.isAssignableFrom(r,s))return;break;case 2:if(!Bridge.Reflection.isAssignableFrom(s,r))return;break;default:if(s!==r)return}}return 1}}if("interface"===e.$kind&&t(this,e))return!0;for(var n=Bridge.Reflection.getInterfaces(e),i=0;i<n.length;i++)if(n[i]===this||t(this,n[i]))return!0;return!1},registerType:function(e,t){Bridge.$currentAssembly&&((Bridge.$currentAssembly.$types[e]=t).$assembly=Bridge.$currentAssembly)},addExtend:function(e,t){var n,i;for(Array.prototype.push.apply(e.$$inherits,t),e.$interfaces=e.$interfaces||[],e.$baseInterfaces=e.$baseInterfaces||[],n=0;n<t.length;n++){(i=t[n]).$$inheritors||(i.$$inheritors=[]),i.$$inheritors.push(e);var r=(i.$interfaces||[]).concat(i.$baseInterfaces||[]);if(0<r.length)for(var s=0;s<r.length;s++)e.$baseInterfaces.indexOf(r[s])<0&&e.$baseInterfaces.push(r[s]);"interface"===i.$kind&&e.$interfaces.push(i)}e.$allInterfaces=e.$interfaces.concat(e.$baseInterfaces)},set:function(e,t,n,i){for(var r,s,o,a,u,l,c=t.split("."),m=0;m<c.length-1;m++)void 0===e[c[m]]&&(e[c[m]]={}),e=e[c[m]];if(o=e[r=c[c.length-1]]){if(o.$$name===t)throw"Class '"+t+"' is already defined";for(s in o){var y=o[s];"function"==typeof y&&y.$$name&&function(e,t,n){Object.defineProperty(e,t,{get:function(){return Bridge.Class.staticInitAllow&&(n.$staticInit&&n.$staticInit(),Bridge.Class.defineProperty(e,t,n)),n},set:function(e){n=e},enumerable:!0,configurable:!0})}(n,s,y)}}return!0!==i?(a=e,u=r,l=n,Object.defineProperty(a,u,{get:function(){return Bridge.Class.staticInitAllow&&(l.$staticInit&&l.$staticInit(),Bridge.Class.defineProperty(a,u,l)),l},set:function(e){l=e},enumerable:!0,configurable:!0})):e[r]=n,e},defineProperty:function(e,t,n){Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0})},genericName:function(e,t){for(var n=e,i=0;i<t.length;i++){var r=t[i];n+="$"+(r.$$name||Bridge.getTypeName(r))}return n},getCachedType:function(e,t){for(var n,i,r,s=e.$cache,o=s.length,a=0;a<o;a++)if((n=s[a]).args.length===t.length){for(i=!0,r=0;r<n.args.length;r++)if(n.args[r]!==t[r]){i=!1;break}if(i)return n}return null},generic:function(e,t,r,s){return r.$$name=e,r.$kind="class",Bridge.Class.set(t,e,r,!0),Bridge.Class.registerType(e,r),r.$typeArgumentCount=s.length,r.$isGenericTypeDefinition=!0,r.$getMetadata=Bridge.Reflection.getMetadata,r.$staticInit=function(){r.$typeArguments=Bridge.Reflection.createTypeParams(s);var e=Bridge.Class.staticInitAllow,t=Bridge.Class.queueIsBlocked;Bridge.Class.staticInitAllow=!1,Bridge.Class.queueIsBlocked=!0;var n=s.apply(null,r.$typeArguments),i=n.$inherits||n.inherits;Bridge.Class.staticInitAllow=e,Bridge.Class.queueIsBlocked=t,i&&Bridge.isFunction(i)&&(i=i()),Bridge.Class.createInheritors(r,i);t=Bridge.global.System&&Bridge.global.System.Object||Object,i=i||[t].concat(r.$interfaces);Bridge.Class.setInheritors(r,i);t=new(i?i[0].$$initCtor||i[0]:t);r.prototype=t,(r.prototype.constructor=r).$kind=n.$kind||"class",n.$module&&(r.$module=n.$module)},Bridge.Class.$queue.push(r),r},init:function(e){if(Bridge.Reflection){var t=Bridge.Reflection.deferredMeta,n=t.length;if(0<n){Bridge.Reflection.deferredMeta=[];for(var i=0;i<n;i++){var r=t[i];Bridge.setMetadata(r.typeName,r.metadata,r.ns)}}}if(e){var s=Bridge.Class.staticInitAllow;return Bridge.Class.staticInitAllow=!0,e(),void(Bridge.Class.staticInitAllow=s)}Bridge.Class.staticInitAllow=!0;var o=Bridge.Class.$queue.concat(Bridge.Class.$queueEntry);Bridge.Class.$queue.length=0;for(i=Bridge.Class.$queueEntry.length=0;i<o.length;i++){var a=o[i];a.$staticInit&&a.$staticInit(),a.prototype.$main&&(function(t,n){Bridge.ready(function(){var e=t[n]();e&&e.continueWith&&e.continueWith(function(){setTimeout(function(){e.getAwaitedResult()},0)})})}(a,a.prototype.$main.name||"Main"),a.prototype.$main=null)}}},Bridge.Class=r,Bridge.Class.$queue=[],Bridge.Class.$queueEntry=[],Bridge.define=Bridge.Class.define,Bridge.definei=Bridge.Class.definei,Bridge.init=Bridge.Class.init,Bridge.assembly=function(e,t,n,i){n||(n=t,t={}),e=e||"Bridge.$Unknown";var r=System.Reflection.Assembly.assemblies[e];r?Bridge.apply(r.res,t||{}):r=new System.Reflection.Assembly(e,t);e=Bridge.$currentAssembly;Bridge.$currentAssembly=r,n&&(t=Bridge.Class.staticInitAllow,Bridge.Class.staticInitAllow=!1,n.call(Bridge.global,r,Bridge.global),Bridge.Class.staticInitAllow=t),Bridge.init(),i&&(Bridge.$currentAssembly=e)},Bridge.define("System.Reflection.Assembly",{statics:{assemblies:{}},ctor:function(e,t){this.$initialize(),this.name=e,this.res=t||{},this.$types={},this.$={},System.Reflection.Assembly.assemblies[e]=this},toString:function(){return this.name},getManifestResourceNames:function(){return Object.keys(this.res)},getManifestResourceDataAsBase64:function(e,t){return 1===arguments.length&&(t=e,e=null),e&&(t=Bridge.Reflection.getTypeNamespace(e)+"."+t),this.res[t]||null},getManifestResourceData:function(e,t){1===arguments.length&&(t=e,e=null),e&&(t=Bridge.Reflection.getTypeNamespace(e)+"."+t);t=this.res[t];return t?System.Convert.fromBase64String(t):null},getCustomAttributes:function(t){return this.attr&&t&&!Bridge.isBoolean(t)?this.attr.filter(function(e){return Bridge.is(e,t)}):this.attr||[]}}),Bridge.$currentAssembly=new System.Reflection.Assembly("mscorlib"),Bridge.SystemAssembly=Bridge.$currentAssembly,Bridge.SystemAssembly.$types["System.Reflection.Assembly"]=System.Reflection.Assembly,System.Reflection.Assembly.$assembly=Bridge.SystemAssembly;var W=Bridge.$currentAssembly;Bridge.define("System.Object",{}),Bridge.define("System.Void",{$kind:"struct",statics:{methods:{getDefaultValue:function(){return new System.Void}}},methods:{$clone:function(e){return this}}}),Bridge.init(function(){Bridge.SystemAssembly.version="17.10.1",Bridge.SystemAssembly.compiler="17.10.1"}),Bridge.define("Bridge.Utils.SystemAssemblyVersion"),Bridge.Reflection={deferredMeta:[],setMetadata:function(e,t,n){if(Bridge.isString(e)){var i=e;if(null==(e=Bridge.unroll(i)))return void Bridge.Reflection.deferredMeta.push({typeName:i,metadata:t,ns:n})}n=Bridge.unroll(n),e.$getMetadata=Bridge.Reflection.getMetadata,e.$metadata=t},initMetaData:function(e,t){if(t.m)for(var n=0;n<t.m.length;n++){var i=t.m[n];if(i.td=e,i.ad&&(i.ad.td=e),i.r&&(i.r.td=e),i.g&&(i.g.td=e),i.s&&(i.s.td=e),i.tprm&&Bridge.isArray(i.tprm))for(var r=0;r<i.tprm.length;r++)i.tprm[r]=Bridge.Reflection.createTypeParam(i.tprm[r],e,i,r)}e.$metadata=t,e.$initMetaData=!0},getMetadata:function(){!this.$metadata&&this.$genericTypeDefinition&&(this.$metadata=this.$genericTypeDefinition.$factoryMetadata||this.$genericTypeDefinition.$metadata);var e,t=this.$metadata;return"function"==typeof t&&(this.$isGenericTypeDefinition&&!this.$factoryMetadata&&(this.$factoryMetadata=this.$metadata),t=this.$typeArguments?this.$metadata.apply(null,this.$typeArguments):this.$isGenericTypeDefinition?(e=Bridge.Reflection.createTypeParams(this.$metadata),this.$typeArguments=e,this.$metadata.apply(null,e)):this.$metadata()),!this.$initMetaData&&t&&Bridge.Reflection.initMetaData(this,t),t},createTypeParams:function(e,t){for(var n=[],e=e.toString(),i=e.slice(e.indexOf("(")+1,e.indexOf(")")).match(/([^\s,]+)/g)||[],r=0;r<i.length;r++)n.push(Bridge.Reflection.createTypeParam(i[r],t,null,r));return n},createTypeParam:function(e,t,n,i){function r(){}return r.$$name=e,r.$isTypeParameter=!0,t&&(r.td=t),n&&(r.md=n),null!=i&&(r.gPrmPos=i),r},load:function(e){return System.Reflection.Assembly.assemblies[e]||require(e)},getGenericTypeDefinition:function(e){if(e.$isGenericTypeDefinition)return e;if(!e.$genericTypeDefinition)throw new System.InvalidOperationException.$ctor1("This operation is only valid on generic types.");return e.$genericTypeDefinition},getGenericParameterCount:function(e){return e.$typeArgumentCount||0},getGenericArguments:function(e){return e.$typeArguments||[]},getMethodGenericArguments:function(e){return e.tprm||[]},isGenericTypeDefinition:function(e){return e.$isGenericTypeDefinition||!1},isGenericType:function(e){return null!=e.$genericTypeDefinition||Bridge.Reflection.isGenericTypeDefinition(e)},convertType:function(e){return e===Boolean?System.Boolean:e===String?System.String:e===Object?System.Object:e===Date?System.DateTime:e},getBaseType:function(e){if(Bridge.isObject(e)||Bridge.Reflection.isInterface(e)||null==e.prototype)return null;if(Object.getPrototypeOf)return Bridge.Reflection.convertType(Object.getPrototypeOf(e.prototype).constructor);var t,n=e.prototype;if(Object.prototype.hasOwnProperty.call(n,"constructor"))try{return t=n.constructor,delete n.constructor,Bridge.Reflection.convertType(n.constructor)}finally{n.constructor=t}return Bridge.Reflection.convertType(n.constructor)},getTypeFullName:function(e){if(e.$$fullname?r=e.$$fullname:e.$$name&&(r=e.$$name),r){var t=Bridge.Reflection.getTypeNamespace(e,r);return t&&(i=r.indexOf("["),n=r.substring(t.length+1,-1===i?r.length:i),new RegExp(/[\.\$]/).test(n)&&(r=t+"."+n.replace(/\.|\$/g,function(e){return"."===e?"+":"`"})+(-1===i?"":r.substring(i)))),r}if(e.constructor===Object){r=e.toString();var n,i=/\[object (.{1,})\]/.exec(r);return"Object"==(n=i&&1<i.length?i[1]:"Object")?"System.Object":n}r=(e.constructor===Function?e:e.constructor).toString();var r=/function (.{1,})\(/.exec(r);return r&&1<r.length?r[1]:"System.Object"},_makeQName:function(e,t){return e+(t?", "+t.name:"")},getTypeQName:function(e){return Bridge.Reflection._makeQName(Bridge.Reflection.getTypeFullName(e),e.$assembly)},getTypeName:function(e){var t=Bridge.Reflection.getTypeFullName(e),n=t.indexOf("["),i=t.lastIndexOf("+",0<=n?n:t.length),i=-1<i?i:t.lastIndexOf(".",0<=n?n:t.length),t=0<i?0<=n?t.substring(i+1,n):t.substr(i+1):t;return e.$isArray?t+"[]":t},getTypeNamespace:function(e,t){var n=t||Bridge.Reflection.getTypeFullName(e),t=n.indexOf("["),t=n.lastIndexOf(".",0<=t?t:n.length),t=0<t?n.substr(0,t):"";return!e.$assembly||(e=Bridge.Reflection._getAssemblyType(e.$assembly,t))&&(t=Bridge.Reflection.getTypeNamespace(e)),t},getTypeAssembly:function(e){return e.$isArray?Bridge.Reflection.getTypeAssembly(e.$elementType):!System.Array.contains([Date,Number,Boolean,String,Function,Array],e)&&e.$assembly||Bridge.SystemAssembly},_extractArrayRank:function(e){var t=-1,n=/<(\d+)>$/g.exec(e);return n&&(e=e.substring(0,n.index),t=parseInt(n[1])),(n=/\[(,*)\]$/g.exec(e))&&(e=e.substring(0,n.index),t=n[1].length+1),{rank:t,name:e}},_getAssemblyType:function(e,t){var n=!1;new RegExp(/[\+\`]/).test(t)&&(t=t.replace(/\+|\`/g,function(e){return"+"===e?".":"$"})),e||(e=Bridge.SystemAssembly,n=!0);var i=Bridge.Reflection._extractArrayRank(t),r=i.rank;if(t=i.name,e.$types){i=e.$types[t]||null;if(i)return-1<r?System.Array.type(i,r):i;if("mscorlib"!==e.name)return null;e=Bridge.global}for(var s=t.split("."),o=e,a=0;a<s.length;a++)if(!(o=o[s[a]]))return null;return"function"!=typeof o||!n&&o.$assembly&&e.name!==o.$assembly.name?null:-1<r?System.Array.type(o,r):o},getAssemblyTypes:function(e){var i=[];if(e.$types)for(var t in e.$types)e.$types.hasOwnProperty(t)&&i.push(e.$types[t]);else{var r=function(e,t){for(var n in e)e.hasOwnProperty(n)&&r(e[n],n);"function"==typeof e&&Bridge.isUpper(t.charCodeAt(0))&&i.push(e)};r(e,"")}return i},createAssemblyInstance:function(e,t){e=Bridge.Reflection.getType(t,e);return e?Bridge.createInstance(e):null},getInterfaces:function(e){var t;return e.$allInterfaces||(e===Date?[System.IComparable$1(Date),System.IEquatable$1(Date),System.IComparable,System.IFormattable]:e===Number?[System.IComparable$1(Bridge.Int),System.IEquatable$1(Bridge.Int),System.IComparable,System.IFormattable]:e===Boolean?[System.IComparable$1(Boolean),System.IEquatable$1(Boolean),System.IComparable]:e===String?[System.IComparable$1(String),System.IEquatable$1(String),System.IComparable,System.ICloneable,System.Collections.IEnumerable,System.Collections.Generic.IEnumerable$1(System.Char)]:e===Array||e.$isArray||(t=System.Array._typedArrays[Bridge.getTypeName(e)])?(t=t||e.$elementType||System.Object,[System.Collections.IEnumerable,System.Collections.ICollection,System.ICloneable,System.Collections.IList,System.Collections.Generic.IEnumerable$1(t),System.Collections.Generic.ICollection$1(t),System.Collections.Generic.IList$1(t)]):[])},isInstanceOfType:function(e,t){return Bridge.is(e,t)},isAssignableFrom:function(e,t){if(null==e)throw new System.NullReferenceException;if(null==t)return!1;if(e===t||Bridge.isObject(e))return!0;if(Bridge.isFunction(e.isAssignableFrom))return e.isAssignableFrom(t);if(t===Array)return System.Array.is([],e);if(Bridge.Reflection.isInterface(e)&&System.Array.contains(Bridge.Reflection.getInterfaces(t),e))return!0;if(e.$elementType&&e.$isArray&&t.$elementType&&t.$isArray)return Bridge.Reflection.isValueType(e.$elementType)===Bridge.Reflection.isValueType(t.$elementType)&&(e.$rank===t.$rank&&Bridge.Reflection.isAssignableFrom(e.$elementType,t.$elementType));var n,i=t.$$inherits;if(!i)return e.isPrototypeOf(t);for(n=0;n<i.length;n++)if(Bridge.Reflection.isAssignableFrom(e,i[n]))return!0;return!1},isClass:function(e){return"class"===e.$kind||"nested class"===e.$kind||e===Array||e===Function||e===RegExp||e===String||e===Error||e===Object},isEnum:function(e){return"enum"===e.$kind},isFlags:function(e){return!(!e.prototype||!e.prototype.$flags)},isInterface:function(e){return"interface"===e.$kind||"nested interface"===e.$kind},isAbstract:function(e){return e===Function||e===System.Type||0!=(128&Bridge.Reflection.getMetaValue(e,"att",0))},_getType:function(t,e,n,i){var r=!n;r&&(t=t.replace(/\[(,*)\]/g,function(e,t){return"<"+(t.length+1)+">"}));function s(){for(;;){var e=n.exec(t);if((!e||"["!=e[0]||"]"!==t[e.index+1]&&","!==t[e.index+1])&&((!e||"]"!=e[0]||"["!==t[e.index-1]&&","!==t[e.index-1])&&(!e||","!=e[0]||"]"!==t[e.index+1]&&","!==t[e.index+1])))return e}}var o=(n=n||/[[,\]]/g).lastIndex,a=s(),u=[],l=!e;if(a)switch(m=t.substring(o,a.index),a[0]){case"[":if("["!==t[a.index+1])return null;for(;;){if(s(),!(y=Bridge.Reflection._getType(t,null,n)))return null;if(u.push(y),"]"===(a=s())[0])break;if(","!==a[0])return null}var c=/^\s*<(\d+)>/g.exec(t.substring(a.index+1));if(c&&(m=m+"<"+parseInt(c[1])+">"),a=s(),a&&","===a[0]&&(s(),!(e=System.Reflection.Assembly.assemblies[(0<n.lastIndex?t.substring(a.index+1,n.lastIndex-1):t.substring(a.index+1)).trim()])))return null;break;case"]":break;case",":if(s(),!(e=System.Reflection.Assembly.assemblies[(0<n.lastIndex?t.substring(a.index+1,n.lastIndex-1):t.substring(a.index+1)).trim()]))return null}else m=t.substring(o);if(r&&n.lastIndex)return null;m=m.trim();var o=Bridge.Reflection._extractArrayRank(m),r=o.rank,m=o.name,y=Bridge.Reflection._getAssemblyType(e,m);if(i)return y;if(!y&&l)for(var h in System.Reflection.Assembly.assemblies)if(System.Reflection.Assembly.assemblies.hasOwnProperty(h)&&System.Reflection.Assembly.assemblies[h]!==e&&(y=Bridge.Reflection._getType(t,System.Reflection.Assembly.assemblies[h],null,!0)))break;return(y=u.length?y.apply(null,u):y)&&y.$staticInit&&y.$staticInit(),-1<r&&(y=System.Array.type(y,r)),y},getType:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("typeName");return e?Bridge.Reflection._getType(e,t):null},isPrimitive:function(e){return e===System.Int64||e===System.UInt64||e===System.Double||e===System.Single||e===System.Byte||e===System.SByte||e===System.Int16||e===System.UInt16||e===System.Int32||e===System.UInt32||e===System.Boolean||e===Boolean||e===System.Char||e===Number},canAcceptNull:function(e){return"struct"!==e.$kind&&"enum"!==e.$kind&&e!==System.Decimal&&e!==System.Int64&&e!==System.UInt64&&e!==System.Double&&e!==System.Single&&e!==System.Byte&&e!==System.SByte&&e!==System.Int16&&e!==System.UInt16&&e!==System.Int32&&e!==System.UInt32&&e!==Bridge.Int&&e!==System.Boolean&&e!==System.DateTime&&e!==Boolean&&e!==Date&&e!==Number},applyConstructor:function(e,t){if(!t||0===t.length)return new e;if(e.$$initCtor&&"anonymous"!==e.$kind){var n=0;if(Bridge.getMetadata(e))for(var i,r=Bridge.Reflection.getMembers(e,1,28),s=0;s<r.length;s++){var o=r[s];if(o.p&&o.p.length===t.length){i=!0;for(var a=0;a<o.p.length;a++){var u=o.p[a];if(!Bridge.is(t[a],u)||null==t[a]&&!Bridge.Reflection.canAcceptNull(u)){i=!1;break}}i&&(e=e[o.sn],n++)}}else if(Bridge.isFunction(e.ctor)&&e.ctor.length===t.length)e=e.ctor;else for(var l="$ctor",c=1;Bridge.isFunction(e[l+c]);)e[l+c].length===t.length&&(e=e[l+c],n++),c++;if(1<n)throw new System.Exception("The ambiguous constructor call")}function m(){e.apply(this,t)}return m.prototype=e.prototype,new m},getAttributes:function(e,t,n){var i,r,s,o,a,u=[];if(n){n=Bridge.Reflection.getBaseType(e);if(n)for(s=Bridge.Reflection.getAttributes(n,t,!0),i=0;i<s.length;i++)r=Bridge.getType(s[i]),(o=Bridge.getMetadata(r))&&o.ni||u.push(s[i])}if((a=Bridge.getMetadata(e))&&a.at)for(i=0;i<a.at.length;i++)if(s=a.at[i],null==t||Bridge.Reflection.isInstanceOfType(s,t)){if(r=Bridge.getType(s),!(o=Bridge.getMetadata(r))||!o.am)for(var l=u.length-1;0<=l;l--)Bridge.Reflection.isInstanceOfType(u[l],r)&&u.splice(l,1);u.push(s)}return u},getMembers:function(e,n,i,r,s){var t,o=[];72!=(72&i)&&4!=(6&i)||(t=Bridge.Reflection.getBaseType(e))&&(o=Bridge.Reflection.getMembers(t,-2&n,i&(64&i?255:247)&(2&i?251:255),r,s));function a(t){if(n&t.t&&(4&i&&!t.is||8&i&&t.is)&&(!r||(1==(1&i)?t.n.toUpperCase()===r.toUpperCase():t.n===r))&&(16==(16&i)&&2===t.a||32==(32&i)&&2!==t.a)){if(s){if((t.p||[]).length!==s.length)return;for(var e=0;e<s.length;e++)if(s[e]!==t.p[e])return}(t.ov||t.v)&&(o=o.filter(function(e){return!(e.n==t.n&&e.t==t.t)})),o.splice(u++,0,t)}}var u=0,l=Bridge.getMetadata(e);if(l&&l.m)for(var c=["g","s","ad","r"],m=0;m<l.m.length;m++){var y=l.m[m];a(y);for(var h=0;h<4;h++){var d=c[h];y[d]&&a(y[d])}}if(256&i){for(;e;){for(var f=[],m=0;m<o.length;m++)o[m].td===e&&f.push(o[m]);if(1<f.length)throw new System.Reflection.AmbiguousMatchException.$ctor1("Ambiguous match");if(1===f.length)return f[0];e=Bridge.Reflection.getBaseType(e)}return null}return o},createDelegate:function(t,n){var e=t.is||t.sm,i=null!=n&&!e,r=Bridge.Reflection.midel(t,n,null,i);return i?r:e?function(){var e=null!=n?[n]:[];return r.apply(t.td,e.concat(Array.prototype.slice.call(arguments,0)))}:function(e){return r.apply(e,Array.prototype.slice.call(arguments,1))}},midel:function(s,e,t,n){if(!1!==n){if(s.is&&e)throw new System.ArgumentException.$ctor1("Cannot specify target for static method");if(!s.is&&!e)throw new System.ArgumentException.$ctor1("Must specify target for instance method")}var i,r;if(s.fg)a=function(){return(s.is?s.td:this)[s.fg]};else if(s.fs)a=function(e){(s.is?s.td:this)[s.fs]=e};else{if(a=s.def||(s.is||s.sm?s.td:e||s.td.prototype)[s.sn],s.tpc){if(!s.constructed||t&&0!=t.length||(t=s.tprm),!t||t.length!==s.tpc)throw new System.ArgumentException.$ctor1("Wrong number of type arguments");var o=a,a=function(){return o.apply(this,t.concat(Array.prototype.slice.call(arguments)))}}else if(t&&t.length)throw new System.ArgumentException.$ctor1("Cannot specify type arguments for non-generic method");s.exp&&(i=a,a=function(){return i.apply(this,Array.prototype.slice.call(arguments,0,arguments.length-1).concat(arguments[arguments.length-1]))}),s.sm&&(r=a,a=function(){return r.apply(null,[this].concat(Array.prototype.slice.call(arguments)))})}var u=a;return!(a=function(){var e,t=[],n=s.pi||[];!n.length&&s.p&&s.p.length&&(n=s.p.map(function(e){return{pt:e}}));for(var i,r=0;r<arguments.length;r++)e=n[r]||n[n.length-1],i=arguments[r],t[r]=e&&e.pt===System.Object?i:Bridge.unbox(arguments[r]),null==i&&e&&Bridge.Reflection.isValueType(e.pt)&&(t[r]=Bridge.getDefaultValue(e.pt));return null!=(i=u.apply(this,t))&&s.box?s.box(i):i})!==n?Bridge.fn.bind(e,a):a},invokeCI:function(e,t){return e.exp&&(t=t.slice(0,t.length-1).concat(t[t.length-1])),e.def?e.def.apply(null,t):e.sm?e.td[e.sn].apply(null,t):e.td.$literal?(e.sn?e.td[e.sn]:e.td).apply(e.td,t):Bridge.Reflection.applyConstructor(e.sn?e.td[e.sn]:e.td,t)},fieldAccess:function(e,t){if(e.is&&t)throw new System.ArgumentException.$ctor1("Cannot specify target for static field");if(!e.is&&!t)throw new System.ArgumentException.$ctor1("Must specify target for instance field");if(t=e.is?e.td:t,3!==arguments.length)return e.box?e.box(t[e.sn]):t[e.sn];var n=arguments[2];null==n&&Bridge.Reflection.isValueType(e.rt)&&(n=Bridge.getDefaultValue(e.rt)),t[e.sn]=n},getMetaValue:function(e,t,n){e=e.$isTypeParameter?e:Bridge.getMetadata(e);return e&&e[t]||n},isArray:function(e){return 0<=Bridge.arrayTypes.indexOf(e)},isValueType:function(e){return!Bridge.Reflection.canAcceptNull(e)},getNestedTypes:function(e,t){var n=Bridge.Reflection.getMetaValue(e,"nested",[]);if(t){for(var i=[],r=0;r<n.length;r++){var s=n[r],o=7&Bridge.Reflection.getMetaValue(s,"att",0),o=1==o||2==o;(16==(16&t)&&o||32==(32&t)&&!o)&&i.push(s)}n=i}return n},getNestedType:function(e,t,n){for(var i=Bridge.Reflection.getNestedTypes(e,n),r=0;r<i.length;r++)if(Bridge.Reflection.getTypeName(i[r])===t)return i[r];return null},isGenericMethodDefinition:function(e){return Bridge.Reflection.isGenericMethod(e)&&!e.constructed},isGenericMethod:function(e){return!!e.tpc},containsGenericParameters:function(e){if(e.$typeArguments)for(var t=0;t<e.$typeArguments.length;t++)if(e.$typeArguments[t].$isTypeParameter)return!0;for(var n=e.tprm||[],t=0;t<n.length;t++)if(n[t].$isTypeParameter)return!0;return!1},genericParameterPosition:function(e){if(!e.$isTypeParameter)throw new System.InvalidOperationException.$ctor1("The current type does not represent a type parameter.");return e.gPrmPos||0},makeGenericMethod:function(e,t){var n=Bridge.apply({},e);return n.tprm=t,n.p=t,n.gd=e,n.constructed=!0,n},getGenericMethodDefinition:function(e){if(!e.tpc)throw new System.InvalidOperationException.$ctor1("The current method is not a generic method. ");return e.gd||e}},Bridge.setMetadata=Bridge.Reflection.setMetadata,System.Reflection.ConstructorInfo={$is:function(e){return null!=e&&1===e.t}},System.Reflection.EventInfo={$is:function(e){return null!=e&&2===e.t}},System.Reflection.FieldInfo={$is:function(e){return null!=e&&4===e.t}},System.Reflection.MethodBase={$is:function(e){return null!=e&&(1===e.t||8===e.t)}},System.Reflection.MethodInfo={$is:function(e){return null!=e&&8===e.t}},System.Reflection.PropertyInfo={$is:function(e){return null!=e&&16===e.t}},System.AppDomain={getAssemblies:function(){return Object.keys(System.Reflection.Assembly.assemblies).map(function(e){return System.Reflection.Assembly.assemblies[e]})}},Bridge.define("System.IFormattable",{$kind:"interface",statics:{$is:function(e){return!(!Bridge.isNumber(e)&&!Bridge.isDate(e))||Bridge.is(e,System.IFormattable,!0)}}}),Bridge.define("System.IComparable",{$kind:"interface",statics:{$is:function(e){return!!(Bridge.isNumber(e)||Bridge.isDate(e)||Bridge.isBoolean(e)||Bridge.isString(e))||Bridge.is(e,System.IComparable,!0)}}}),Bridge.define("System.IFormatProvider",{$kind:"interface"}),Bridge.define("System.ICloneable",{$kind:"interface"}),Bridge.define("System.IComparable$1",function(t){return{$kind:"interface",statics:{$is:function(e){return!!(Bridge.isNumber(e)&&t.$number&&t.$is(e)||Bridge.isDate(e)&&(t===Date||t===System.DateTime)||Bridge.isBoolean(e)&&(t===Boolean||t===System.Boolean)||Bridge.isString(e)&&(t===String||t===System.String))||Bridge.is(e,System.IComparable$1(t),!0)},isAssignableFrom:function(e){return e===System.DateTime&&t===Date||0<=Bridge.Reflection.getInterfaces(e).indexOf(System.IComparable$1(t))}}}}),Bridge.define("System.IEquatable$1",function(t){return{$kind:"interface",statics:{$is:function(e){return!!(Bridge.isNumber(e)&&t.$number&&t.$is(e)||Bridge.isDate(e)&&(t===Date||t===System.DateTime)||Bridge.isBoolean(e)&&(t===Boolean||t===System.Boolean)||Bridge.isString(e)&&(t===String||t===System.String))||Bridge.is(e,System.IEquatable$1(t),!0)},isAssignableFrom:function(e){return e===System.DateTime&&t===Date||0<=Bridge.Reflection.getInterfaces(e).indexOf(System.IEquatable$1(t))}}}}),Bridge.define("Bridge.IPromise",{$kind:"interface"}),Bridge.define("System.IDisposable",{$kind:"interface"}),Bridge.define("System.IAsyncResult",{$kind:"interface"}),Bridge.define("System.ValueType",{statics:{methods:{$is:function(e){return Bridge.Reflection.isValueType(Bridge.getType(e))}}}});var K={nameEquals:function(e,t,n){return n?e.toLowerCase()===t.toLowerCase():e.charAt(0).toLowerCase()+e.slice(1)===t.charAt(0).toLowerCase()+t.slice(1)},checkEnumType:function(e){if(!e)throw new System.ArgumentNullException.$ctor1("enumType");if(e.prototype&&"enum"!==e.$kind)throw new System.ArgumentException.$ctor1("","enumType")},getUnderlyingType:function(e){return System.Enum.checkEnumType(e),e.prototype.$utype||System.Int32},toName:function(e){return e},toObject:function(e,t){return null==(t=Bridge.unbox(t,!0))?null:K.parse(e,t.toString(),!1,!0)},parse:function(t,e,n,i){if(System.Enum.checkEnumType(t),null!=e){if(t===Number||t===System.String||t.$number)return e;var r={};if(System.Int32.tryParse(e,r))return Bridge.box(r.v,t,function(e){return System.Enum.toString(t,e)});var s=System.Enum.getNames(t),o=t;if(t.prototype&&t.prototype.$flags){for(var a=e.split(","),u=0,l=!0,c=a.length-1;0<=c;c--){for(var m=a[c].trim(),y=!1,h=0;h<s.length;h++){d=s[h];if(K.nameEquals(d,m,n)){u|=o[d],y=!0;break}}if(!y){l=!1;break}}if(l)return Bridge.box(u,t,function(e){return System.Enum.toString(t,e)})}else for(var c=0;c<s.length;c++){var d=s[c];if(K.nameEquals(d,e,n))return Bridge.box(o[d],t,function(e){return System.Enum.toString(t,e)})}}if(!0!==i)throw new System.ArgumentException.$ctor3("silent","Invalid Enumeration Value");return null},toStringFn:function(t){return function(e){return System.Enum.toString(t,e)}},toString:function(e,t,n){if(0===arguments.length)return"System.Enum";if(t&&t.$boxed&&e===System.Enum&&(e=t.type),t=Bridge.unbox(t,!0),e===Number||e===System.String||e.$number)return t.toString();System.Enum.checkEnumType(e);var i=e,r=System.Enum.getNames(e),s=System.Int64.is64Bit(t);if((e.prototype&&e.prototype.$flags||!0===n)&&0!==t){for(var o=[],a=System.Enum.getValuesAndNames(e),u=a.length-1,e=t;0<=u;){var l=a[u],c=s&&System.Int64.is64Bit(l.value);if(0==u&&(c?l.value.isZero():0==l.value))break;(c?t.and(l.value).eq(l.value):(t&l.value)==l.value)&&(c?t=t.sub(l.value):t-=l.value,o.unshift(l.name)),u--}return(s?t.isZero():0===t)?(s?e.isZero():0===e)?(l=a[0])&&(System.Int64.is64Bit(l.value)?l.value.isZero():0==l.value)?l.name:"0":o.join(", "):e.toString()}for(var m=0;m<r.length;m++){var y=r[m];if(s&&System.Int64.is64Bit(i[y])?i[y].eq(t):i[y]===t)return K.toName(y)}return t.toString()},getValuesAndNames:function(e){System.Enum.checkEnumType(e);for(var t=[],n=System.Enum.getNames(e),i=e,r=0;r<n.length;r++)t.push({name:n[r],value:i[n[r]]});return t.sort(function(e,t){return System.Int64.is64Bit(e.value)?e.value.sub(t.value).sign():e.value-t.value})},getValues:function(e){System.Enum.checkEnumType(e);for(var t=[],n=System.Enum.getNames(e),i=e,r=0;r<n.length;r++)t.push(i[n[r]]);return t.sort(function(e,t){return System.Int64.is64Bit(e)?e.sub(t).sign():e-t})},format:function(e,t,n){var i;if(System.Enum.checkEnumType(e),Bridge.hasValue(t)?!Bridge.hasValue(n)&&(i="format"):i="value")throw new System.ArgumentNullException.$ctor1(i);switch(t=Bridge.unbox(t,!0),n){case"G":case"g":return System.Enum.toString(e,t);case"x":case"X":return t.toString(16);case"d":case"D":return t.toString();case"f":case"F":return System.Enum.toString(e,t,!0);default:throw new System.FormatException}},getNames:function(e){System.Enum.checkEnumType(e);var t,n=[],i=e;if(e.$names)return e.$names.slice(0);for(t in i)i.hasOwnProperty(t)&&t.indexOf("$")<0&&"function"!=typeof i[t]&&n.push([K.toName(t),i[t]]);return n.sort(function(e,t){return System.Int64.is64Bit(e[1])?e[1].sub(t[1]).sign():e[1]-t[1]}).map(function(e){return e[0]})},getName:function(e,t){if(null==(t=Bridge.unbox(t,!0)))throw new System.ArgumentNullException.$ctor1("value");var n=System.Int64.is64Bit(t);if(!n&&("number"!=typeof t||Math.floor(t,0)!==t))throw new System.ArgumentException.$ctor1("Argument must be integer","value");System.Enum.checkEnumType(e);for(var i=System.Enum.getNames(e),r=e,s=0;s<i.length;s++){var o=i[s];if(n?t.eq(r[o]):r[o]===t)return o}return null},hasFlag:function(e,t){t=Bridge.unbox(t,!0);var n=System.Int64.is64Bit(e);return 0===t||(n?!e.and(t).isZero():!!(e&t))},isDefined:function(e,t){t=Bridge.unbox(t,!0),System.Enum.checkEnumType(e);for(var n=e,i=System.Enum.getNames(e),r=Bridge.isString(t),s=System.Int64.is64Bit(t),o=0;o<i.length;o++){var a=i[o];if(r?K.nameEquals(a,t,!1):s?t.eq(n[a]):n[a]===t)return!0}return!1},tryParse:function(e,t,n,i){return n.v=Bridge.unbox(K.parse(e,t,i,!0),!0),null!=n.v||(n.v=0,!1)},equals:function(e,t,n){return!(t&&t.$boxed&&(e&&e.$boxed||n)&&t.type!==(e.type||n))&&System.Enum.equalsT(e,t)},equalsT:function(e,t){return Bridge.equals(Bridge.unbox(e,!0),Bridge.unbox(t,!0))}};Bridge.define("System.Enum",{inherits:[System.IComparable,System.IFormattable],statics:{methods:K}});var j,r={hasValue:Bridge.hasValue,getValue:function(e){if(e=Bridge.unbox(e,!0),!Bridge.hasValue(e))throw new System.InvalidOperationException.$ctor1("Nullable instance doesn't have a value.");return e},getValueOrDefault:function(e,t){return Bridge.hasValue(e)?e:t},add:function(e,t){return Bridge.hasValue$1(e,t)?e+t:null},band:function(e,t){return Bridge.hasValue$1(e,t)?e&t:null},bor:function(e,t){return Bridge.hasValue$1(e,t)?e|t:null},and:function(e,t){return!0===e&&!0===t||!1!==e&&!1!==t&&null},or:function(e,t){return!0===e||!0===t||(!1!==e||!1!==t)&&null},div:function(e,t){return Bridge.hasValue$1(e,t)?e/t:null},eq:function(e,t){return Bridge.hasValue(e)?e===t:!Bridge.hasValue(t)},equals:function(e,t,n){return Bridge.hasValue(e)?n?n(e,t):Bridge.equals(e,t):!Bridge.hasValue(t)},toString:function(e,t){return Bridge.hasValue(e)?t?t(e):e.toString():""},toStringFn:function(t){return function(e){return System.Nullable.toString(e,t)}},getHashCode:function(e,t){return Bridge.hasValue(e)?t?t(e):Bridge.getHashCode(e):0},getHashCodeFn:function(t){return function(e){return System.Nullable.getHashCode(e,t)}},xor:function(e,t){return Bridge.hasValue$1(e,t)?Bridge.isBoolean(e)&&Bridge.isBoolean(t)?e!=t:e^t:null},gt:function(e,t){return Bridge.hasValue$1(e,t)&&t<e},gte:function(e,t){return Bridge.hasValue$1(e,t)&&t<=e},neq:function(e,t){return Bridge.hasValue(e)?e!==t:Bridge.hasValue(t)},lt:function(e,t){return Bridge.hasValue$1(e,t)&&e<t},lte:function(e,t){return Bridge.hasValue$1(e,t)&&e<=t},mod:function(e,t){return Bridge.hasValue$1(e,t)?e%t:null},mul:function(e,t){return Bridge.hasValue$1(e,t)?e*t:null},imul:function(e,t){return Bridge.hasValue$1(e,t)?Bridge.Int.mul(e,t):null},sl:function(e,t){return Bridge.hasValue$1(e,t)?e<<t:null},sr:function(e,t){return Bridge.hasValue$1(e,t)?e>>t:null},srr:function(e,t){return Bridge.hasValue$1(e,t)?e>>>t:null},sub:function(e,t){return Bridge.hasValue$1(e,t)?e-t:null},bnot:function(e){return Bridge.hasValue(e)?~e:null},neg:function(e){return Bridge.hasValue(e)?-e:null},not:function(e){return Bridge.hasValue(e)?!e:null},pos:function(e){return Bridge.hasValue(e)?+e:null},lift:function(){for(var e=1;e<arguments.length;e++)if(!Bridge.hasValue(arguments[e]))return null;return null==arguments[0]?null:null==arguments[0].apply?arguments[0]:arguments[0].apply(null,Array.prototype.slice.call(arguments,1))},lift1:function(e,t){return Bridge.hasValue(t)?"function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)):null},lift2:function(e,t,n){return Bridge.hasValue$1(t,n)?"function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)):null},liftcmp:function(e,t,n){return!!Bridge.hasValue$1(t,n)&&("function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)))},lifteq:function(e,t,n){var i=Bridge.hasValue(t),n=Bridge.hasValue(n);return!i&&!n||i&&n&&("function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)))},liftne:function(e,t,n){var i=Bridge.hasValue(t);return i!==Bridge.hasValue(n)||i&&("function"==typeof e?e.apply(null,Array.prototype.slice.call(arguments,1)):t[e].apply(t,Array.prototype.slice.call(arguments,2)))},getUnderlyingType:function(e){if(!e)throw new System.ArgumentNullException.$ctor1("nullableType");if(Bridge.Reflection.isGenericType(e)&&!Bridge.Reflection.isGenericTypeDefinition(e)&&Bridge.Reflection.getGenericTypeDefinition(e)===System.Nullable$1)return Bridge.Reflection.getGenericArguments(e)[0];return null},compare:function(e,t){return System.Collections.Generic.Comparer$1.$default.compare(e,t)}};function J(e,i,r,t,s){var o=Bridge.define(e,{inherits:[System.IComparable,System.IFormattable],statics:{$number:!0,toUnsign:s,min:i,max:r,precision:t,$is:function(e){return"number"==typeof e&&Math.floor(e,0)===e&&i<=e&&e<=r},getDefaultValue:function(){return 0},parse:function(e,t){return Bridge.Int.parseInt(e,i,r,t)},tryParse:function(e,t,n){return Bridge.Int.tryParseInt(e,t,i,r,n)},format:function(e,t,n){return Bridge.Int.format(e,t,n,o,s)},equals:function(e,t){return!(!Bridge.is(e,o)||!Bridge.is(t,o))&&Bridge.unbox(e,!0)===Bridge.unbox(t,!0)},equalsT:function(e,t){return Bridge.unbox(e,!0)===Bridge.unbox(t,!0)}}});o.$kind="",Bridge.Class.addExtend(o,[System.IComparable$1(o),System.IEquatable$1(o)])}System.Nullable=r,Bridge.define("System.Nullable$1",function(t){return{$kind:"struct",statics:{$nullable:!0,$nullableType:t,getDefaultValue:function(){return null},$is:function(e){return Bridge.is(e,t)}}}}),Bridge.define("System.Char",{inherits:[System.IComparable,System.IFormattable],$kind:"struct",statics:{min:0,max:65535,$is:function(e){return"number"==typeof e&&Math.round(e,0)==e&&e>=System.Char.min&&e<=System.Char.max},getDefaultValue:function(){return 0},parse:function(e){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("s");if(1!==e.length)throw new System.FormatException;return e.charCodeAt(0)},tryParse:function(e,t){var n=e&&1===e.length;return t.v=n?e.charCodeAt(0):0,n},format:function(e,t,n){return Bridge.Int.format(e,t,n)},charCodeAt:function(e,t){if(null==e)throw new System.ArgumentNullException;if(1!=e.length)throw new System.FormatException.$ctor1("String must be exactly one character long");return e.charCodeAt(t)},_isWhiteSpaceMatch:/[^\s\x09-\x0D\x85\xA0]/,isWhiteSpace:function(e){return!System.Char._isWhiteSpaceMatch.test(e)},_isDigitMatch:new RegExp(/[0-9\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]/),isDigit:function(e){return e<256?48<=e&&e<=57:System.Char._isDigitMatch.test(String.fromCharCode(e))},_isLetterMatch:new RegExp(/[A-Za-z\u0061-\u007A\u00B5\u00DF-\u00F6\u00F8-\u00FF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0561-\u0587\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7FA\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A\u0041-\u005A\u00C0-\u00D6\u00D8-\u00DE\u0100\u0102\u0104\u0106\u0108\u010A\u010C\u010E\u0110\u0112\u0114\u0116\u0118\u011A\u011C\u011E\u0120\u0122\u0124\u0126\u0128\u012A\u012C\u012E\u0130\u0132\u0134\u0136\u0139\u013B\u013D\u013F\u0141\u0143\u0145\u0147\u014A\u014C\u014E\u0150\u0152\u0154\u0156\u0158\u015A\u015C\u015E\u0160\u0162\u0164\u0166\u0168\u016A\u016C\u016E\u0170\u0172\u0174\u0176\u0178\u0179\u017B\u017D\u0181\u0182\u0184\u0186\u0187\u0189-\u018B\u018E-\u0191\u0193\u0194\u0196-\u0198\u019C\u019D\u019F\u01A0\u01A2\u01A4\u01A6\u01A7\u01A9\u01AC\u01AE\u01AF\u01B1-\u01B3\u01B5\u01B7\u01B8\u01BC\u01C4\u01C7\u01CA\u01CD\u01CF\u01D1\u01D3\u01D5\u01D7\u01D9\u01DB\u01DE\u01E0\u01E2\u01E4\u01E6\u01E8\u01EA\u01EC\u01EE\u01F1\u01F4\u01F6-\u01F8\u01FA\u01FC\u01FE\u0200\u0202\u0204\u0206\u0208\u020A\u020C\u020E\u0210\u0212\u0214\u0216\u0218\u021A\u021C\u021E\u0220\u0222\u0224\u0226\u0228\u022A\u022C\u022E\u0230\u0232\u023A\u023B\u023D\u023E\u0241\u0243-\u0246\u0248\u024A\u024C\u024E\u0370\u0372\u0376\u0386\u0388-\u038A\u038C\u038E\u038F\u0391-\u03A1\u03A3-\u03AB\u03CF\u03D2-\u03D4\u03D8\u03DA\u03DC\u03DE\u03E0\u03E2\u03E4\u03E6\u03E8\u03EA\u03EC\u03EE\u03F4\u03F7\u03F9\u03FA\u03FD-\u042F\u0460\u0462\u0464\u0466\u0468\u046A\u046C\u046E\u0470\u0472\u0474\u0476\u0478\u047A\u047C\u047E\u0480\u048A\u048C\u048E\u0490\u0492\u0494\u0496\u0498\u049A\u049C\u049E\u04A0\u04A2\u04A4\u04A6\u04A8\u04AA\u04AC\u04AE\u04B0\u04B2\u04B4\u04B6\u04B8\u04BA\u04BC\u04BE\u04C0\u04C1\u04C3\u04C5\u04C7\u04C9\u04CB\u04CD\u04D0\u04D2\u04D4\u04D6\u04D8\u04DA\u04DC\u04DE\u04E0\u04E2\u04E4\u04E6\u04E8\u04EA\u04EC\u04EE\u04F0\u04F2\u04F4\u04F6\u04F8\u04FA\u04FC\u04FE\u0500\u0502\u0504\u0506\u0508\u050A\u050C\u050E\u0510\u0512\u0514\u0516\u0518\u051A\u051C\u051E\u0520\u0522\u0524\u0526\u0531-\u0556\u10A0-\u10C5\u10C7\u10CD\u1E00\u1E02\u1E04\u1E06\u1E08\u1E0A\u1E0C\u1E0E\u1E10\u1E12\u1E14\u1E16\u1E18\u1E1A\u1E1C\u1E1E\u1E20\u1E22\u1E24\u1E26\u1E28\u1E2A\u1E2C\u1E2E\u1E30\u1E32\u1E34\u1E36\u1E38\u1E3A\u1E3C\u1E3E\u1E40\u1E42\u1E44\u1E46\u1E48\u1E4A\u1E4C\u1E4E\u1E50\u1E52\u1E54\u1E56\u1E58\u1E5A\u1E5C\u1E5E\u1E60\u1E62\u1E64\u1E66\u1E68\u1E6A\u1E6C\u1E6E\u1E70\u1E72\u1E74\u1E76\u1E78\u1E7A\u1E7C\u1E7E\u1E80\u1E82\u1E84\u1E86\u1E88\u1E8A\u1E8C\u1E8E\u1E90\u1E92\u1E94\u1E9E\u1EA0\u1EA2\u1EA4\u1EA6\u1EA8\u1EAA\u1EAC\u1EAE\u1EB0\u1EB2\u1EB4\u1EB6\u1EB8\u1EBA\u1EBC\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1EC8\u1ECA\u1ECC\u1ECE\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EDA\u1EDC\u1EDE\u1EE0\u1EE2\u1EE4\u1EE6\u1EE8\u1EEA\u1EEC\u1EEE\u1EF0\u1EF2\u1EF4\u1EF6\u1EF8\u1EFA\u1EFC\u1EFE\u1F08-\u1F0F\u1F18-\u1F1D\u1F28-\u1F2F\u1F38-\u1F3F\u1F48-\u1F4D\u1F59\u1F5B\u1F5D\u1F5F\u1F68-\u1F6F\u1FB8-\u1FBB\u1FC8-\u1FCB\u1FD8-\u1FDB\u1FE8-\u1FEC\u1FF8-\u1FFB\u2102\u2107\u210B-\u210D\u2110-\u2112\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u2130-\u2133\u213E\u213F\u2145\u2183\u2C00-\u2C2E\u2C60\u2C62-\u2C64\u2C67\u2C69\u2C6B\u2C6D-\u2C70\u2C72\u2C75\u2C7E-\u2C80\u2C82\u2C84\u2C86\u2C88\u2C8A\u2C8C\u2C8E\u2C90\u2C92\u2C94\u2C96\u2C98\u2C9A\u2C9C\u2C9E\u2CA0\u2CA2\u2CA4\u2CA6\u2CA8\u2CAA\u2CAC\u2CAE\u2CB0\u2CB2\u2CB4\u2CB6\u2CB8\u2CBA\u2CBC\u2CBE\u2CC0\u2CC2\u2CC4\u2CC6\u2CC8\u2CCA\u2CCC\u2CCE\u2CD0\u2CD2\u2CD4\u2CD6\u2CD8\u2CDA\u2CDC\u2CDE\u2CE0\u2CE2\u2CEB\u2CED\u2CF2\uA640\uA642\uA644\uA646\uA648\uA64A\uA64C\uA64E\uA650\uA652\uA654\uA656\uA658\uA65A\uA65C\uA65E\uA660\uA662\uA664\uA666\uA668\uA66A\uA66C\uA680\uA682\uA684\uA686\uA688\uA68A\uA68C\uA68E\uA690\uA692\uA694\uA696\uA722\uA724\uA726\uA728\uA72A\uA72C\uA72E\uA732\uA734\uA736\uA738\uA73A\uA73C\uA73E\uA740\uA742\uA744\uA746\uA748\uA74A\uA74C\uA74E\uA750\uA752\uA754\uA756\uA758\uA75A\uA75C\uA75E\uA760\uA762\uA764\uA766\uA768\uA76A\uA76C\uA76E\uA779\uA77B\uA77D\uA77E\uA780\uA782\uA784\uA786\uA78B\uA78D\uA790\uA792\uA7A0\uA7A2\uA7A4\uA7A6\uA7A8\uA7AA\uFF21-\uFF3A\u01C5\u01C8\u01CB\u01F2\u1F88-\u1F8F\u1F98-\u1F9F\u1FA8-\u1FAF\u1FBC\u1FCC\u1FFC\u02B0-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0374\u037A\u0559\u0640\u06E5\u06E6\u07F4\u07F5\u07FA\u081A\u0824\u0828\u0971\u0E46\u0EC6\u10FC\u17D7\u1843\u1AA7\u1C78-\u1C7D\u1D2C-\u1D6A\u1D78\u1D9B-\u1DBF\u2071\u207F\u2090-\u209C\u2C7C\u2C7D\u2D6F\u2E2F\u3005\u3031-\u3035\u303B\u309D\u309E\u30FC-\u30FE\uA015\uA4F8-\uA4FD\uA60C\uA67F\uA717-\uA71F\uA770\uA788\uA7F8\uA7F9\uA9CF\uAA70\uAADD\uAAF3\uAAF4\uFF70\uFF9E\uFF9F\u00AA\u00BA\u01BB\u01C0-\u01C3\u0294\u05D0-\u05EA\u05F0-\u05F2\u0620-\u063F\u0641-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u0800-\u0815\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0972-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E45\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10D0-\u10FA\u10FD-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17DC\u1820-\u1842\u1844-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C77\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u2135-\u2138\u2D30-\u2D67\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3006\u303C\u3041-\u3096\u309F\u30A1-\u30FA\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA014\uA016-\uA48C\uA4D0-\uA4F7\uA500-\uA60B\uA610-\uA61F\uA62A\uA62B\uA66E\uA6A0-\uA6E5\uA7FB-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA6F\uAA71-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB\uAADC\uAAE0-\uAAEA\uAAF2\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF66-\uFF6F\uFF71-\uFF9D\uFFA0-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/),isLetter:function(e){return e<256?65<=e&&e<=90||97<=e&&e<=122:System.Char._isLetterMatch.test(String.fromCharCode(e))},_isHighSurrogateMatch:new RegExp(/[\uD800-\uDBFF]/),isHighSurrogate:function(e){return System.Char._isHighSurrogateMatch.test(String.fromCharCode(e))},_isLowSurrogateMatch:new RegExp(/[\uDC00-\uDFFF]/),isLowSurrogate:function(e){return System.Char._isLowSurrogateMatch.test(String.fromCharCode(e))},_isSurrogateMatch:new RegExp(/[\uD800-\uDFFF]/),isSurrogate:function(e){return System.Char._isSurrogateMatch.test(String.fromCharCode(e))},_isNullMatch:new RegExp("\0"),isNull:function(e){return System.Char._isNullMatch.test(String.fromCharCode(e))},_isSymbolMatch:new RegExp(/[\u20A0-\u20CF\u20D0-\u20FF\u2100-\u214F\u2150-\u218F\u2190-\u21FF\u2200-\u22FF\u2300-\u23FF\u25A0-\u25FF\u2600-\u26FF\u2700-\u27BF\u27C0-\u27EF\u27F0-\u27FF\u2800-\u28FF\u2900-\u297F\u2980-\u29FF\u2A00-\u2AFF\u2B00-\u2BFF]/),isSymbol:function(e){return e<256?-1!=[36,43,60,61,62,94,96,124,126,162,163,164,165,166,167,168,169,172,174,175,176,177,180,182,184,215,247].indexOf(e):System.Char._isSymbolMatch.test(String.fromCharCode(e))},_isSeparatorMatch:new RegExp(/[\u2028\u2029\u0020\u00A0\u1680\u180E\u2000-\u200A\u202F\u205F\u3000]/),isSeparator:function(e){return e<256?32==e||160==e:System.Char._isSeparatorMatch.test(String.fromCharCode(e))},_isPunctuationMatch:new RegExp(/[\u0021-\u0023\u0025-\u002A\u002C-\u002F\u003A\u003B\u003F\u0040\u005B-\u005D\u005F\u007B\u007D\u00A1\u00A7\u00AB\u00B6\u00B7\u00BB\u00BF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E3B\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65\u002D\u058A\u05BE\u1400\u1806\u2010-\u2015\u2E17\u2E1A\u2E3A\u2E3B\u301C\u3030\u30A0\uFE31\uFE32\uFE58\uFE63\uFF0D\u0028\u005B\u007B\u0F3A\u0F3C\u169B\u201A\u201E\u2045\u207D\u208D\u2329\u2768\u276A\u276C\u276E\u2770\u2772\u2774\u27C5\u27E6\u27E8\u27EA\u27EC\u27EE\u2983\u2985\u2987\u2989\u298B\u298D\u298F\u2991\u2993\u2995\u2997\u29D8\u29DA\u29FC\u2E22\u2E24\u2E26\u2E28\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\u301D\uFD3E\uFE17\uFE35\uFE37\uFE39\uFE3B\uFE3D\uFE3F\uFE41\uFE43\uFE47\uFE59\uFE5B\uFE5D\uFF08\uFF3B\uFF5B\uFF5F\uFF62\u0029\u005D\u007D\u0F3B\u0F3D\u169C\u2046\u207E\u208E\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3F\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63\u00AB\u2018\u201B\u201C\u201F\u2039\u2E02\u2E04\u2E09\u2E0C\u2E1C\u2E20\u00BB\u2019\u201D\u203A\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u005F\u203F\u2040\u2054\uFE33\uFE34\uFE4D-\uFE4F\uFF3F\u0021-\u0023\u0025-\u0027\u002A\u002C\u002E\u002F\u003A\u003B\u003F\u0040\u005C\u00A1\u00A7\u00B6\u00B7\u00BF\u037E\u0387\u055A-\u055F\u0589\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u166D\u166E\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u1805\u1807-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2016\u2017\u2020-\u2027\u2030-\u2038\u203B-\u203E\u2041-\u2043\u2047-\u2051\u2053\u2055-\u205E\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00\u2E01\u2E06-\u2E08\u2E0B\u2E0E-\u2E16\u2E18\u2E19\u2E1B\u2E1E\u2E1F\u2E2A-\u2E2E\u2E30-\u2E39\u3001-\u3003\u303D\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFE10-\uFE16\uFE19\uFE30\uFE45\uFE46\uFE49-\uFE4C\uFE50-\uFE52\uFE54-\uFE57\uFE5F-\uFE61\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF07\uFF0A\uFF0C\uFF0E\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3C\uFF61\uFF64\uFF65]/),isPunctuation:function(e){return e<256?-1!=[33,34,35,37,38,39,40,41,42,44,45,46,47,58,59,63,64,91,92,93,95,123,125,161,171,173,183,187,191].indexOf(e):System.Char._isPunctuationMatch.test(String.fromCharCode(e))},_isNumberMatch:new RegExp(/[\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19\u16EE-\u16F0\u2160-\u2182\u2185-\u2188\u3007\u3021-\u3029\u3038-\u303A\uA6E6-\uA6EF\u00B2\u00B3\u00B9\u00BC-\u00BE\u09F4-\u09F9\u0B72-\u0B77\u0BF0-\u0BF2\u0C78-\u0C7E\u0D70-\u0D75\u0F2A-\u0F33\u1369-\u137C\u17F0-\u17F9\u19DA\u2070\u2074-\u2079\u2080-\u2089\u2150-\u215F\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA830-\uA835]/),isNumber:function(e){return e<256?-1!=[48,49,50,51,52,53,54,55,56,57,178,179,185,188,189,190].indexOf(e):System.Char._isNumberMatch.test(String.fromCharCode(e))},_isControlMatch:new RegExp(/[\u0000-\u001F\u007F\u0080-\u009F]/),isControl:function(e){return e<256?0<=e&&e<=31||127<=e&&e<=159:System.Char._isControlMatch.test(String.fromCharCode(e))},isLatin1:function(e){return e<=255},isAscii:function(e){return e<=127},isUpper:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("s");if(t>>>0>=e.length>>>0)throw new System.ArgumentOutOfRangeException.$ctor1("index");t=e.charCodeAt(t);return System.Char.isLatin1(t)&&System.Char.isAscii(t)?65<=t&&t<=90:Bridge.isUpper(t)},equals:function(e,t){return!(!Bridge.is(e,System.Char)||!Bridge.is(t,System.Char))&&Bridge.unbox(e,!0)===Bridge.unbox(t,!0)},equalsT:function(e,t){return Bridge.unbox(e,!0)===Bridge.unbox(t,!0)},getHashCode:function(e){return e|e<<16}}}),Bridge.Class.addExtend(System.Char,[System.IComparable$1(System.Char),System.IEquatable$1(System.Char)]),Bridge.define("Bridge.Ref$1",function(e){return{statics:{methods:{op_Implicit:function(e){return e.Value}}},fields:{getter:null,setter:null},props:{Value:{get:function(){return this.getter()},set:function(e){this.setter(e)}},v:{get:function(){return this.Value},set:function(e){this.Value=e}}},ctors:{ctor:function(e,t){this.$initialize(),this.getter=e,this.setter=t}},methods:{toString:function(){return Bridge.toString(this.Value)},valueOf:function(){return this.Value}}}}),Bridge.define("System.IConvertible",{$kind:"interface"}),Bridge.define("System.HResults"),Bridge.define("System.Exception",{config:{properties:{Message:{get:function(){return this.message}},InnerException:{get:function(){return this.innerException}},StackTrace:{get:function(){return this.errorStack.stack}},Data:{get:function(){return this.data}},HResult:{get:function(){return this._HResult},set:function(e){this._HResult=e}}}},ctor:function(e,t){this.$initialize(),this.message=e||"Exception of type '"+Bridge.getTypeName(this)+"' was thrown.",this.innerException=t||null,this.errorStack=new Error(this.message),this.data=new(System.Collections.Generic.Dictionary$2(System.Object,System.Object))},getBaseException:function(){for(var e=this.innerException,t=this;null!=e;)e=(t=e).innerException;return t},toString:function(){var e=Bridge.getTypeName(this);return null!=this.Message?e+=": "+this.Message+"\n":e+="\n",null!=this.StackTrace&&(e+=this.StackTrace+"\n"),e},statics:{create:function(e){if(Bridge.is(e,System.Exception))return e;var t;if(e instanceof TypeError)t=new System.NullReferenceException.$ctor1(e.message);else if(e instanceof RangeError)t=new System.ArgumentOutOfRangeException.$ctor1(e.message);else{if(e instanceof Error)return new System.SystemException.$ctor1(e);t=e&&e.error&&e.error.stack?new System.Exception(e.error.stack):new System.Exception(e?e.message||e.toString():null)}return t.errorStack=e,t}}}),Bridge.define("System.SystemException",{inherits:[System.Exception],ctors:{ctor:function(){this.$initialize(),System.Exception.ctor.call(this,"System error."),this.HResult=-2146233087},$ctor1:function(e){this.$initialize(),System.Exception.ctor.call(this,e),this.HResult=-2146233087},$ctor2:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e,t),this.HResult=-2146233087}}}),Bridge.define("System.OutOfMemoryException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Insufficient memory to continue the execution of the program."),this.HResult=-2147024362},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2147024362},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2147024362}}}),Bridge.define("System.ArrayTypeMismatchException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Attempted to access an element as a type incompatible with the array."),this.HResult=-2146233085},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233085},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233085}}}),Bridge.define("System.Resources.MissingManifestResourceException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Unable to find manifest resource."),this.HResult=-2146233038},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233038},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233038}}}),Bridge.define("System.Globalization.TextInfo",{inherits:[System.ICloneable],fields:{listSeparator:null},props:{ANSICodePage:0,CultureName:null,EBCDICCodePage:0,IsReadOnly:!1,IsRightToLeft:!1,LCID:0,ListSeparator:{get:function(){return this.listSeparator},set:function(e){this.VerifyWritable(),this.listSeparator=e}},MacCodePage:0,OEMCodePage:0},alias:["clone","System$ICloneable$clone"],methods:{clone:function(){return Bridge.copy(new System.Globalization.TextInfo,this,System.Array.init(["ANSICodePage","CultureName","EBCDICCodePage","IsRightToLeft","LCID","listSeparator","MacCodePage","OEMCodePage","IsReadOnly"],System.String))},VerifyWritable:function(){if(this.IsReadOnly)throw new System.InvalidOperationException.$ctor1("Instance is read-only.")}}}),Bridge.define("System.Globalization.BidiCategory",{$kind:"enum",statics:{fields:{LeftToRight:0,LeftToRightEmbedding:1,LeftToRightOverride:2,RightToLeft:3,RightToLeftArabic:4,RightToLeftEmbedding:5,RightToLeftOverride:6,PopDirectionalFormat:7,EuropeanNumber:8,EuropeanNumberSeparator:9,EuropeanNumberTerminator:10,ArabicNumber:11,CommonNumberSeparator:12,NonSpacingMark:13,BoundaryNeutral:14,ParagraphSeparator:15,SegmentSeparator:16,Whitespace:17,OtherNeutrals:18,LeftToRightIsolate:19,RightToLeftIsolate:20,FirstStrongIsolate:21,PopDirectionIsolate:22}}}),Bridge.define("System.Globalization.SortVersion",{inherits:function(){return[System.IEquatable$1(System.Globalization.SortVersion)]},statics:{methods:{op_Equality:function(e,t){return null!=e?e.equalsT(t):null==t||t.equalsT(e)},op_Inequality:function(e,t){return!System.Globalization.SortVersion.op_Equality(e,t)}}},fields:{m_NlsVersion:0,m_SortId:null},props:{FullVersion:{get:function(){return this.m_NlsVersion}},SortId:{get:function(){return this.m_SortId}}},alias:["equalsT","System$IEquatable$1$System$Globalization$SortVersion$equalsT"],ctors:{init:function(){this.m_SortId=new System.Guid},ctor:function(e,t){this.$initialize(),this.m_SortId=t,this.m_NlsVersion=e},$ctor1:function(e,t,n){var i,r;this.$initialize(),this.m_NlsVersion=e,System.Guid.op_Equality(n,System.Guid.Empty)&&(i=t>>24&255,r=(16711680&t)>>16&255,e=(65280&t)>>8&255,t=255&t,n=new System.Guid.$ctor2(0,0,0,0,0,0,0,i,r,e,t)),this.m_SortId=n}},methods:{equals:function(e){e=Bridge.as(e,System.Globalization.SortVersion);return!!System.Globalization.SortVersion.op_Inequality(e,null)&&this.equalsT(e)},equalsT:function(e){return!System.Globalization.SortVersion.op_Equality(e,null)&&(this.m_NlsVersion===e.m_NlsVersion&&System.Guid.op_Equality(this.m_SortId,e.m_SortId))},getHashCode:function(){return Bridge.Int.mul(this.m_NlsVersion,7)|this.m_SortId.getHashCode()}}}),Bridge.define("System.Globalization.UnicodeCategory",{$kind:"enum",statics:{fields:{UppercaseLetter:0,LowercaseLetter:1,TitlecaseLetter:2,ModifierLetter:3,OtherLetter:4,NonSpacingMark:5,SpacingCombiningMark:6,EnclosingMark:7,DecimalDigitNumber:8,LetterNumber:9,OtherNumber:10,SpaceSeparator:11,LineSeparator:12,ParagraphSeparator:13,Control:14,Format:15,Surrogate:16,PrivateUse:17,ConnectorPunctuation:18,DashPunctuation:19,OpenPunctuation:20,ClosePunctuation:21,InitialQuotePunctuation:22,FinalQuotePunctuation:23,OtherPunctuation:24,MathSymbol:25,CurrencySymbol:26,ModifierSymbol:27,OtherSymbol:28,OtherNotAssigned:29}}}),Bridge.define("System.Globalization.DaylightTimeStruct",{$kind:"struct",statics:{methods:{getDefaultValue:function(){return new System.Globalization.DaylightTimeStruct}}},fields:{Start:null,End:null,Delta:null},ctors:{init:function(){this.Start=System.DateTime.getDefaultValue(),this.End=System.DateTime.getDefaultValue(),this.Delta=new System.TimeSpan},$ctor1:function(e,t,n){this.$initialize(),this.Start=e,this.End=t,this.Delta=n},ctor:function(){this.$initialize()}},methods:{getHashCode:function(){return Bridge.addHash([7445027511,this.Start,this.End,this.Delta])},equals:function(e){return!!Bridge.is(e,System.Globalization.DaylightTimeStruct)&&(Bridge.equals(this.Start,e.Start)&&Bridge.equals(this.End,e.End)&&Bridge.equals(this.Delta,e.Delta))},$clone:function(e){e=e||new System.Globalization.DaylightTimeStruct;return e.Start=this.Start,e.End=this.End,e.Delta=this.Delta,e}}}),Bridge.define("System.Globalization.DaylightTime",{fields:{_start:null,_end:null,_delta:null},props:{Start:{get:function(){return this._start}},End:{get:function(){return this._end}},Delta:{get:function(){return this._delta}}},ctors:{init:function(){this._start=System.DateTime.getDefaultValue(),this._end=System.DateTime.getDefaultValue(),this._delta=new System.TimeSpan},ctor:function(){this.$initialize()},$ctor1:function(e,t,n){this.$initialize(),this._start=e,this._end=t,this._delta=n}}}),Bridge.define("System.Globalization.DateTimeFormatInfo",{inherits:[System.IFormatProvider,System.ICloneable],config:{alias:["getFormat","System$IFormatProvider$getFormat"]},statics:{$allStandardFormats:{d:"shortDatePattern",D:"longDatePattern",f:"longDatePattern shortTimePattern",F:"longDatePattern longTimePattern",g:"shortDatePattern shortTimePattern",G:"shortDatePattern longTimePattern",m:"monthDayPattern",M:"monthDayPattern",o:"roundtripFormat",O:"roundtripFormat",r:"rfc1123",R:"rfc1123",s:"sortableDateTimePattern",S:"sortableDateTimePattern1",t:"shortTimePattern",T:"longTimePattern",u:"universalSortableDateTimePattern",U:"longDatePattern longTimePattern",y:"yearMonthPattern",Y:"yearMonthPattern"},ctor:function(){this.invariantInfo=Bridge.merge(new System.Globalization.DateTimeFormatInfo,{abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],abbreviatedMonthGenitiveNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],amDesignator:"AM",dateSeparator:"/",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],firstDayOfWeek:0,fullDateTimePattern:"dddd, dd MMMM yyyy HH:mm:ss",longDatePattern:"dddd, dd MMMM yyyy",longTimePattern:"HH:mm:ss",monthDayPattern:"MMMM dd",monthGenitiveNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December",""],pmDesignator:"PM",rfc1123:"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'",shortDatePattern:"MM/dd/yyyy",shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],shortTimePattern:"HH:mm",sortableDateTimePattern:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",sortableDateTimePattern1:"yyyy'-'MM'-'dd",timeSeparator:":",universalSortableDateTimePattern:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",yearMonthPattern:"yyyy MMMM",roundtripFormat:"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffzzz"})}},getFormat:function(e){return e!==System.Globalization.DateTimeFormatInfo?null:this},getAbbreviatedDayName:function(e){if(e<0||6<e)throw new System.ArgumentOutOfRangeException$ctor1("dayofweek");return this.abbreviatedDayNames[e]},getAbbreviatedMonthName:function(e){if(e<1||13<e)throw new System.ArgumentOutOfRangeException.$ctor1("month");return this.abbreviatedMonthNames[e-1]},getAllDateTimePatterns:function(e,t){var n,i,r,s,o=System.Globalization.DateTimeFormatInfo.$allStandardFormats,a=[];if(e){if(!o[e]){if(t)return null;throw new System.ArgumentException.$ctor3("","format")}(n={})[e]=o[e]}else n=o;for(o in n){for(i=n[o].split(" "),r="",s=0;s<i.length;s++)r=(0===s?"":r+" ")+this[i[s]];a.push(r)}return a},getDayName:function(e){if(e<0||6<e)throw new System.ArgumentOutOfRangeException.$ctor1("dayofweek");return this.dayNames[e]},getMonthName:function(e){if(e<1||13<e)throw new System.ArgumentOutOfRangeException.$ctor1("month");return this.monthNames[e-1]},getShortestDayName:function(e){if(e<0||6<e)throw new System.ArgumentOutOfRangeException.$ctor1("dayOfWeek");return this.shortestDayNames[e]},clone:function(){return Bridge.copy(new System.Globalization.DateTimeFormatInfo,this,["abbreviatedDayNames","abbreviatedMonthGenitiveNames","abbreviatedMonthNames","amDesignator","dateSeparator","dayNames","firstDayOfWeek","fullDateTimePattern","longDatePattern","longTimePattern","monthDayPattern","monthGenitiveNames","monthNames","pmDesignator","rfc1123","shortDatePattern","shortestDayNames","shortTimePattern","sortableDateTimePattern","timeSeparator","universalSortableDateTimePattern","yearMonthPattern","roundtripFormat"])}}),Bridge.define("System.Globalization.NumberFormatInfo",{inherits:[System.IFormatProvider,System.ICloneable],config:{alias:["getFormat","System$IFormatProvider$getFormat"]},statics:{ctor:function(){this.numberNegativePatterns=["(n)","-n","- n","n-","n -"],this.currencyNegativePatterns=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"],this.currencyPositivePatterns=["$n","n$","$ n","n $"],this.percentNegativePatterns=["-n %","-n%","-%n","%-n","%n-","n-%","n%-","-% n","n %-","% n-","% -n","n- %"],this.percentPositivePatterns=["n %","n%","%n","% n"],this.invariantInfo=Bridge.merge(new System.Globalization.NumberFormatInfo,{nanSymbol:"NaN",negativeSign:"-",positiveSign:"+",negativeInfinitySymbol:"-Infinity",positiveInfinitySymbol:"Infinity",percentSymbol:"%",percentGroupSizes:[3],percentDecimalDigits:2,percentDecimalSeparator:".",percentGroupSeparator:",",percentPositivePattern:0,percentNegativePattern:0,currencySymbol:"¤",currencyGroupSizes:[3],currencyDecimalDigits:2,currencyDecimalSeparator:".",currencyGroupSeparator:",",currencyNegativePattern:0,currencyPositivePattern:0,numberGroupSizes:[3],numberDecimalDigits:2,numberDecimalSeparator:".",numberGroupSeparator:",",numberNegativePattern:1})}},getFormat:function(e){return e!==System.Globalization.NumberFormatInfo?null:this},clone:function(){return Bridge.copy(new System.Globalization.NumberFormatInfo,this,["nanSymbol","negativeSign","positiveSign","negativeInfinitySymbol","positiveInfinitySymbol","percentSymbol","percentGroupSizes","percentDecimalDigits","percentDecimalSeparator","percentGroupSeparator","percentPositivePattern","percentNegativePattern","currencySymbol","currencyGroupSizes","currencyDecimalDigits","currencyDecimalSeparator","currencyGroupSeparator","currencyNegativePattern","currencyPositivePattern","numberGroupSizes","numberDecimalDigits","numberDecimalSeparator","numberGroupSeparator","numberNegativePattern"])}}),Bridge.define("System.Globalization.CultureInfo",{inherits:[System.IFormatProvider,System.ICloneable],config:{alias:["getFormat","System$IFormatProvider$getFormat"]},$entryPoint:!0,statics:{ctor:function(){this.cultures=this.cultures||{},this.invariantCulture=Bridge.merge(new System.Globalization.CultureInfo("iv",!0),{englishName:"Invariant Language (Invariant Country)",nativeName:"Invariant Language (Invariant Country)",numberFormat:System.Globalization.NumberFormatInfo.invariantInfo,dateTimeFormat:System.Globalization.DateTimeFormatInfo.invariantInfo,TextInfo:Bridge.merge(new System.Globalization.TextInfo,{ANSICodePage:1252,CultureName:"",EBCDICCodePage:37,listSeparator:",",IsRightToLeft:!1,LCID:127,MacCodePage:1e4,OEMCodePage:437,IsReadOnly:!0})}),this.setCurrentCulture(System.Globalization.CultureInfo.invariantCulture)},getCurrentCulture:function(){return this.currentCulture},setCurrentCulture:function(e){this.currentCulture=e,System.Globalization.DateTimeFormatInfo.currentInfo=e.dateTimeFormat,System.Globalization.NumberFormatInfo.currentInfo=e.numberFormat},getCultureInfo:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("name");if(""===e)return System.Globalization.CultureInfo.invariantCulture;var t=this.cultures[e];if(null==t)throw new System.Globalization.CultureNotFoundException.$ctor5("name",e);return t},getCultures:function(){for(var e=Bridge.getPropertyNames(this.cultures),t=[],n=0;n<e.length;n++)t.push(this.cultures[e[n]]);return t}},ctor:function(e,t){if(this.$initialize(),this.name=e,System.Globalization.CultureInfo.cultures||(System.Globalization.CultureInfo.cultures={}),null==e)throw new System.ArgumentNullException.$ctor1("name");var n=""===e?System.Globalization.CultureInfo.invariantCulture:System.Globalization.CultureInfo.cultures[e];if(null==n){if(!t)throw new System.Globalization.CultureNotFoundException.$ctor5("name",e);System.Globalization.CultureInfo.cultures[e]=this}else Bridge.copy(this,n,["englishName","nativeName","numberFormat","dateTimeFormat","TextInfo"]),this.TextInfo.IsReadOnly=!1},getFormat:function(e){switch(e){case System.Globalization.NumberFormatInfo:return this.numberFormat;case System.Globalization.DateTimeFormatInfo:return this.dateTimeFormat;default:return null}},clone:function(){return new System.Globalization.CultureInfo(this.name)}}),Bridge.define("System.Environment",{statics:{fields:{Variables:null},props:{Location:{get:function(){var e=Bridge.global;return e&&e.location?e.location:null}},CommandLine:{get:function(){return System.Environment.GetCommandLineArgs().join(" ")}},CurrentDirectory:{get:function(){var e=System.Environment.Location;return e?e.pathname:""},set:function(e){var t=System.Environment.Location;t&&(t.pathname=e)}},ExitCode:0,Is64BitOperatingSystem:{get:function(){var e=Bridge.global?Bridge.global.navigator:null;return!(!e||Bridge.referenceEquals(e.userAgent.indexOf("WOW64"),-1)&&Bridge.referenceEquals(e.userAgent.indexOf("Win64"),-1))}},ProcessorCount:{get:function(){var e=Bridge.global?Bridge.global.navigator:null;return e&&e.hardwareConcurrency?e.hardwareConcurrency:1}},StackTrace:{get:function(){var e=(new Error).stack;return!System.String.isNullOrEmpty(e)&&0<=System.String.indexOf(e,"at")?e.substr(System.String.indexOf(e,"at")):""}},Version:{get:function(){var e=Bridge.SystemAssembly.compiler,t={};return System.Version.tryParse(e,t)?t.v:new System.Version.ctor}}},ctors:{init:function(){this.ExitCode=0},ctor:function(){System.Environment.Variables=new(System.Collections.Generic.Dictionary$2(System.String,System.String).ctor),System.Environment.PatchDictionary(System.Environment.Variables)}},methods:{GetResourceString:function(e){return e},GetResourceString$1:function(e,t){void 0===t&&(t=[]);e=System.Environment.GetResourceString(e);return System.String.formatProvider.apply(System.String,[System.Globalization.CultureInfo.getCurrentCulture(),e].concat(t))},PatchDictionary:function(e){return e.noKeyCheck=!0,e},Exit:function(e){System.Environment.ExitCode=e},ExpandEnvironmentVariables:function(e){var t;if(null==e)throw new System.ArgumentNullException.$ctor1(e);t=Bridge.getEnumerator(System.Environment.Variables);try{for(;t.moveNext();){var n=t.Current;e=System.String.replaceAll(e,"%"+(n.key||"")+"%",n.value)}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}return e},FailFast:function(e){throw new System.Exception(e)},FailFast$1:function(e,t){throw new System.Exception(e,t)},GetCommandLineArgs:function(){var e=System.Environment.Location;if(e){var t=new(System.Collections.Generic.List$1(System.String).ctor),n=e.pathname;System.String.isNullOrEmpty(n)||t.add(n);e=e.search;if(!System.String.isNullOrEmpty(e)&&1<e.length)for(var i=System.String.split(e.substr(1),[38].map(function(e){return String.fromCharCode(e)})),r=0;r<i.length;r=r+1|0)for(var s=System.String.split(i[System.Array.index(r,i)],[61].map(function(e){return String.fromCharCode(e)})),o=0;o<s.length;o=o+1|0)t.add(s[System.Array.index(o,s)]);return t.ToArray()}return System.Array.init(0,null,System.String)},GetEnvironmentVariable:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("variable");var t={};return System.Environment.Variables.tryGetValue(e.toLowerCase(),t)?t.v:null},GetEnvironmentVariable$1:function(e,t){return System.Environment.GetEnvironmentVariable(e)},GetEnvironmentVariables:function(){return System.Environment.PatchDictionary(new(System.Collections.Generic.Dictionary$2(System.String,System.String).$ctor1)(System.Environment.Variables))},GetEnvironmentVariables$1:function(e){return System.Environment.GetEnvironmentVariables()},GetLogicalDrives:function(){return System.Array.init(0,null,System.String)},SetEnvironmentVariable:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("variable");if(System.String.isNullOrEmpty(e)||System.String.startsWith(e,String.fromCharCode(0))||System.String.contains(e,"=")||32767<e.length)throw new System.ArgumentException.$ctor1("Incorrect variable (cannot be empty, contain zero character nor equal sign, be longer than 32767).");e=e.toLowerCase(),System.String.isNullOrEmpty(t)?System.Environment.Variables.containsKey(e)&&System.Environment.Variables.remove(e):System.Environment.Variables.setItem(e,t)},SetEnvironmentVariable$1:function(e,t,n){System.Environment.SetEnvironmentVariable(e,t)}}}}),Bridge.define("System.StringSplitOptions",{$kind:"enum",statics:{fields:{None:0,RemoveEmptyEntries:1}},$flags:!0}),Bridge.define("System.TypeCode",{$kind:"enum",statics:{fields:{Empty:0,Object:1,DBNull:2,Boolean:3,Char:4,SByte:5,Byte:6,Int16:7,UInt16:8,Int32:9,UInt32:10,Int64:11,UInt64:12,Single:13,Double:14,Decimal:15,DateTime:16,String:18}}}),Bridge.define("System.TypeCodeValues",{statics:{fields:{Empty:null,Object:null,DBNull:null,Boolean:null,Char:null,SByte:null,Byte:null,Int16:null,UInt16:null,Int32:null,UInt32:null,Int64:null,UInt64:null,Single:null,Double:null,Decimal:null,DateTime:null,String:null},ctors:{init:function(){this.Empty="0",this.Object="1",this.DBNull="2",this.Boolean="3",this.Char="4",this.SByte="5",this.Byte="6",this.Int16="7",this.UInt16="8",this.Int32="9",this.UInt32="10",this.Int64="11",this.UInt64="12",this.Single="13",this.Double="14",this.Decimal="15",this.DateTime="16",this.String="18"}}}}),Bridge.define("System.Type",{statics:{$is:function(e){return e&&e.constructor===Function},getTypeCode:function(e){return null==e?System.TypeCode.Empty:e===System.Double?System.TypeCode.Double:e===System.Single?System.TypeCode.Single:e===System.Decimal?System.TypeCode.Decimal:e===System.Byte?System.TypeCode.Byte:e===System.SByte?System.TypeCode.SByte:e===System.UInt16?System.TypeCode.UInt16:e===System.Int16?System.TypeCode.Int16:e===System.UInt32?System.TypeCode.UInt32:e===System.Int32?System.TypeCode.Int32:e===System.UInt64?System.TypeCode.UInt64:e===System.Int64?System.TypeCode.Int64:e===System.Boolean?System.TypeCode.Boolean:e===System.Char?System.TypeCode.Char:e===System.DateTime?System.TypeCode.DateTime:e===System.String?System.TypeCode.String:System.TypeCode.Object}}}),Bridge.Math={divRem:function(e,t,n){var i=e%t;return(e-(n.v=i))/t},round:function(e,t,n){var i=Math.pow(10,t||0),t=0<(e*=i)|-(e<0);if(e%1!=.5*t)return Math.round(e)/i;e=Math.floor(e);return(e+(4===n?0<t:e%2*t))/i},log10:Math.log10||function(e){return Math.log(e)/Math.LN10},logWithBase:function(e,t){return isNaN(e)?e:isNaN(t)?t:1!==t&&(1===e||0!==t&&t!==Number.POSITIVE_INFINITY)?Bridge.Math.log10(e)/Bridge.Math.log10(t):NaN},log:function(e){return 0===e?Number.NEGATIVE_INFINITY:e<0||isNaN(e)?NaN:e===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:e===Number.NEGATIVE_INFINITY?NaN:Math.log(e)},sinh:Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},cosh:Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},tanh:Math.tanh||function(e){if(e===1/0)return 1;if(e===-1/0)return-1;e=Math.exp(2*e);return(e-1)/(e+1)},IEEERemainder:function(e,t){var n,i=e%t;if(isNaN(i))return Number.NaN;if(0==i&&e<0)return-0;if(n=i-Math.abs(t)*Bridge.Int.sign(e),Math.abs(n)!==Math.abs(i))return Math.abs(n)<Math.abs(i)?n:i;e/=t,t=Bridge.Math.round(e,0,6);return Math.abs(t)>Math.abs(e)?n:i}},Bridge.define("System.Boolean",{inherits:[System.IComparable],statics:{trueString:"True",falseString:"False",$is:function(e){return"boolean"==typeof e},getDefaultValue:function(){return!1},createInstance:function(){return!1},toString:function(e){return e?System.Boolean.trueString:System.Boolean.falseString},parse:function(e){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("value");var t={v:!1};if(!System.Boolean.tryParse(e,t))throw new System.FormatException.$ctor1("Bad format for Boolean value");return t.v},tryParse:function(e,t){if(t.v=!1,!Bridge.hasValue(e))return!1;if(System.String.equals(System.Boolean.trueString,e,5))return t.v=!0;if(System.String.equals(System.Boolean.falseString,e,5))return!(t.v=!1);for(var n=0,i=e.length-1;n<e.length&&(System.Char.isWhiteSpace(e[n])||System.Char.isNull(e.charCodeAt(n)));)n++;for(;n<=i&&(System.Char.isWhiteSpace(e[i])||System.Char.isNull(e.charCodeAt(i)));)i--;return e=e.substr(n,i-n+1),System.String.equals(System.Boolean.trueString,e,5)?t.v=!0:!!System.String.equals(System.Boolean.falseString,e,5)&&!(t.v=!1)}}}),System.Boolean.$kind="",Bridge.Class.addExtend(System.Boolean,[System.IComparable$1(System.Boolean),System.IEquatable$1(System.Boolean)]),Bridge.define("Bridge.Int",{inherits:[System.IComparable,System.IFormattable],statics:{$number:!0,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-(Math.pow(2,53)-1),$is:function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e,0)===e},getDefaultValue:function(){return 0},format:function(e,t,n,i,r){var s,o,a,u,l=(n||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo),c=l.numberDecimalSeparator,m=(l.numberGroupSeparator,e instanceof System.Decimal),y=e instanceof System.Int64||e instanceof System.UInt64,h=m||y?!e.isZero()&&e.isNegative():e<0;if(!y&&(m?!e.isFinite():!isFinite(e)))return Number.NEGATIVE_INFINITY===e||m&&h?l.negativeInfinitySymbol:isNaN(e)?l.nanSymbol:l.positiveInfinitySymbol;if(s=(t=t||"G").match(/^([a-zA-Z])(\d*)$/))switch(a=s[1].toUpperCase(),o=parseInt(s[2],10),a){case"D":return this.defaultFormat(e,isNaN(o)?1:o,0,0,l,!0);case"F":case"N":return isNaN(o)&&(o=l.numberDecimalDigits),this.defaultFormat(e,1,o,o,l,"F"===a);case"G":case"E":for(var d,f,g=0,S=m||y?y&&e.eq(System.Int64.MinValue)?System.Int64(e.value.toUnsigned()):e.abs():Math.abs(e),p=s[1],$=3;m||y?S.gte(10):10<=S;)m||y?S=S.div(10):S/=10,g++;for(;m||y?S.ne(0)&&S.lt(1):0!==S&&S<1;)m||y?S=S.mul(10):S*=10,g--;if("G"===a){var C=isNaN(o);if(C&&(o=m?29:y?e instanceof System.Int64?19:20:i&&i.precision?i.precision:15),-5<g&&g<o||m&&C)return f=o-((d=0)<g?g+1:1),this.defaultFormat(e,1,m?Math.min(27,Math.max(d,e.$precision)):d,f,l,!0);p="G"===p?"E":"e",$=2,d=0,f=(o||15)-1}else d=f=isNaN(o)?6:o;return 0<=g?p+=l.positiveSign:(p+=l.negativeSign,g=-g),h&&(m||y?S=S.mul(-1):S*=-1),this.defaultFormat(S,1,m?Math.min(27,Math.max(d,e.$precision)):d,f,l)+p+this.defaultFormat(g,$,0,0,l,!0);case"P":return isNaN(o)&&(o=l.percentDecimalDigits),this.defaultFormat(100*e,1,o,o,l,!1,"percent");case"X":for(u=m?e.round().value.toHex().substr(2):(y?r?r(e):e:r?r(Math.round(e)):Math.round(e)>>>0).toString(16),"X"===s[1]&&(u=u.toUpperCase()),o-=u.length;0<o--;)u="0"+u;return u;case"C":return isNaN(o)&&(o=l.currencyDecimalDigits),this.defaultFormat(e,1,o,o,l,!1,"currency");case"R":$=m||y?e.toString():""+e;return"."!==c&&($=$.replace(".",c)),$=$.replace("e","E")}if(-1!==t.indexOf(",.")||System.String.endsWith(t,",")){var I=0,E=t.indexOf(",.");for(-1===E&&(E=t.length-1);-1<E&&","===t.charAt(E);)I++,E--;m||y?e=e.div(Math.pow(1e3,I)):e/=Math.pow(1e3,I)}return-1!==t.indexOf("%")&&(m||y?e=e.mul(100):e*=100),-1!==t.indexOf("‰")&&(m||y?e=e.mul(1e3):e*=1e3),n=t.split(";"),t=(m||y?e.lt(0):e<0)&&1<n.length?(m||y?e=e.mul(-1):e*=-1,n[1]):n[(m||y?e.ne(0):!e)&&2<n.length?2:0],this.customFormat(e,t,l,!t.match(/^[^\.]*[0#],[0#]/))},defaultFormat:function(e,t,n,i,r,s,o){o=o||"number";var a,u,l,c,m,y,h,d,f,g=(r||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo),S=g[o+"GroupSizes"],p="",$=e instanceof System.Decimal,C=e instanceof System.Int64||e instanceof System.UInt64,I=$||C?!e.isZero()&&e.isNegative():e<0,r=!1,E=(Math.pow(10,i),$?e.abs().toDecimalPlaces(i).toFixed():C?(e.eq(System.Int64.MinValue)?e.value.toUnsigned():e.abs()).toString():""+ +Math.abs(e).toFixed(i)),r=E.split("").every(function(e){return"0"===e||"."===e}),e=E.indexOf(".");if(0<e&&(l=g[o+"DecimalSeparator"]+E.substr(e+1),E=E.substr(0,e)),E.length<t&&(E=Array(t-E.length+1).join("0")+E),l?(l.length-1<n&&(l+=Array(n-l.length+2).join("0")),0===i?l=null:l.length-1>i&&(l=l.substr(0,i+1))):0<n&&(l=g[o+"DecimalSeparator"]+Array(n+1).join("0")),u=S[a=0],E.length<u)p=E,l&&(p+=l);else{for(c=E.length,m=!1,f=s?"":g[o+"GroupSeparator"];!m&&((y=c-(h=u))<0&&(u+=y,h+=y,m=!(y=0)),h);)d=E.substr(y,h),p=p.length?d+f+p:d,c-=h,a<S.length-1&&(u=S[++a]);l&&(p+=l)}return I&&!r?System.Globalization.NumberFormatInfo[o+"NegativePatterns"][g[o+"NegativePattern"]].replace("-",g.negativeSign).replace("%",g.percentSymbol).replace("$",g.currencySymbol).replace("n",p):System.Globalization.NumberFormatInfo[o+"PositivePatterns"]?System.Globalization.NumberFormatInfo[o+"PositivePatterns"][g[o+"PositivePattern"]].replace("%",g.percentSymbol).replace("$",g.currencySymbol).replace("n",p):p},customFormat:function(e,t,n,i){var r,s,o,a,u,l,c,m=0,y=-1,h=0,d=-1,f=0,g=1,S=!1,p="",$=!1,C=!1,I=!1,E=e instanceof System.Decimal,x=e instanceof System.Int64||e instanceof System.UInt64,A=E||x?!e.isZero()&&e.isNegative():e<0,B="number";for(-1!==t.indexOf("%")?B="percent":-1!==t.indexOf("$")&&(B="currency"),o=0;o<t.length;o++)if("'"===(s=t.charAt(o))||'"'===s){if((o=t.indexOf(s,o+1))<0)break}else"\\"===s?o++:("0"!==s&&"#"!==s||(h+=f,"0"===s&&(f?d=h:y<0&&(y=m)),m+=!f),f=f||"."===s);for(y=y<0?1:m-y,A&&(S=!0),A=Math.pow(10,h),l=(e=E?System.Decimal.round(e.abs().mul(A),4).div(A).toString():x?(e.eq(System.Int64.MinValue)?System.Int64(e.value.toUnsigned()):e.abs()).mul(A).div(A).toString():""+Math.round(Math.abs(e)*A)/A).split("").every(function(e){return"0"===e||"."===e}),o=(r=(A=e.indexOf("."))<0?e.length:A)-m,c={groupIndex:Math.max(r,y),sep:i?"":n[B+"GroupSeparator"]},1===r&&"0"===e.charAt(0)&&($=!0),a=0;a<t.length;a++)if("'"===(s=t.charAt(a))||'"'===s){if(u=t.indexOf(s,a+1),p+=t.substring(a+1,u<0?t.length:u),u<0)break;a=u}else"\\"===s?(p+=t.charAt(a+1),a++):"#"===s||"0"===s?(I=!0,!C&&$&&"#"===s||(c.buffer=p,o<r?(0<=o?(g&&this.addGroup(e.substr(0,o),c),this.addGroup(e.charAt(o),c)):r-y<=o&&this.addGroup("0",c),g=0):(0<d--||o<e.length)&&this.addGroup(o>=e.length?"0":e.charAt(o),c),p=c.buffer),o++):"."===s?(I||$||(p+=e.substr(0,r),I=!0),(e.length>++o||0<d)&&(C=!0,p+=n[B+"DecimalSeparator"])):","!==s&&(p+=s);return S&&!l&&(p="-"+p),p},addGroup:function(e,t){for(var n=t.buffer,i=t.sep,r=t.groupIndex,s=0,o=e.length;s<o;s++)n+=e.charAt(s),i&&1<r&&r--%3==1&&(n+=i);t.buffer=n,t.groupIndex=r},parseFloat:function(e,t){var n={};return Bridge.Int.tryParseFloat(e,t,n,!1),n.v},tryParseFloat:function(e,t,n,i){if(n.v=0,null==i&&(i=!0),null==e){if(i)return!1;throw new System.ArgumentNullException.$ctor1("s")}e=e.trim();var r=(t||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo),s=r.numberDecimalSeparator,o=r.numberGroupSeparator,a="Input string was not in a correct format.",u=e.indexOf(s),t=o?e.indexOf(o):-1;if(-1<u&&(u<t||-1<t&&u<e.indexOf(o,u)||-1<e.indexOf(s,u+1))){if(i)return!1;throw new System.FormatException.$ctor1(a)}if("."!==s&&"."!==o&&-1<e.indexOf(".")){if(i)return!1;throw new System.FormatException.$ctor1(a)}if(-1<t){for(var l="",c=0;c<e.length;c++)e[c]!==o&&(l+=e[c]);e=l}if(e===r.negativeInfinitySymbol)return n.v=Number.NEGATIVE_INFINITY,!0;if(e===r.positiveInfinitySymbol)return n.v=Number.POSITIVE_INFINITY,!0;if(e===r.nanSymbol)return n.v=Number.NaN,!0;for(var m=0,y=!1,c=0;c<e.length;c++)if(System.Char.isNumber(e[c].charCodeAt(0))||"."===e[c]||","===e[c]||e[c]===r.positiveSign&&(0===c||y)||e[c]===r.negativeSign&&(0===c||y)||e[c]===s||e[c]===o)y=!1;else{if("e"!==e[c].toLowerCase()){if(y=!1,i)return!1;throw new System.FormatException.$ctor1(a)}if(y=!0,1<++m){if(i)return!1;throw new System.FormatException.$ctor1(a)}}t=parseFloat(e.replace(s,"."));if(isNaN(t)){if(i)return!1;throw new System.FormatException.$ctor1(a)}return n.v=t,!0},parseInt:function(e,t,n,i){if(i=i||10,null==e)throw new System.ArgumentNullException.$ctor1("str");if(e=e.trim(),i<=10&&!/^[+-]?[0-9]+$/.test(e)||16==i&&!/^[+-]?[0-9A-F]+$/gi.test(e))throw new System.FormatException.$ctor1("Input string was not in a correct format.");i=parseInt(e,i);if(isNaN(i))throw new System.FormatException.$ctor1("Input string was not in a correct format.");if(i<t||n<i)throw new System.OverflowException;return i},tryParseInt:function(e,t,n,i,r){return t.v=0,r=r||10,null!=e&&e.trim==="".trim&&(e=e.trim()),!(r<=10&&!/^[+-]?[0-9]+$/.test(e)||16==r&&!/^[+-]?[0-9A-F]+$/gi.test(e))&&(t.v=parseInt(e,r),!(t.v<n||t.v>i)||(t.v=0,!1))},isInfinite:function(e){return e===Number.POSITIVE_INFINITY||e===Number.NEGATIVE_INFINITY},trunc:function(e){return Bridge.isNumber(e)?0<e?Math.floor(e):Math.ceil(e):Bridge.Int.isInfinite(e)?e:null},div:function(e,t){if(null==e||null==t)return null;if(0===t)throw new System.DivideByZeroException;return this.trunc(e/t)},mod:function(e,t){if(null==e||null==t)return null;if(0===t)throw new System.DivideByZeroException;return e%t},check:function(e,t){if(System.Int64.is64Bit(e))return System.Int64.check(e,t);if(e instanceof System.Decimal)return System.Decimal.toInt(e,t);if(Bridge.isNumber(e)){if(System.Int64.is64BitType(t)){if(t===System.UInt64&&e<0)throw new System.OverflowException;return t===System.Int64?System.Int64(e):System.UInt64(e)}if(!t.$is(e))throw new System.OverflowException}return Bridge.Int.isInfinite(e)||isNaN(e)?System.Int64.is64BitType(t)?t.MinValue:t.min:e},sxb:function(e){return Bridge.isNumber(e)?e|(128&e?4294967040:0):Bridge.Int.isInfinite(e)||isNaN(e)?System.SByte.min:null},sxs:function(e){return Bridge.isNumber(e)?e|(32768&e?4294901760:0):Bridge.Int.isInfinite(e)||isNaN(e)?System.Int16.min:null},clip8:function(e){return Bridge.isNumber(e)?Bridge.Int.sxb(255&e):Bridge.Int.isInfinite(e)||isNaN(e)?System.SByte.min:null},clipu8:function(e){return Bridge.isNumber(e)?255&e:Bridge.Int.isInfinite(e)||isNaN(e)?System.Byte.min:null},clip16:function(e){return Bridge.isNumber(e)?Bridge.Int.sxs(65535&e):Bridge.Int.isInfinite(e)||isNaN(e)?System.Int16.min:null},clipu16:function(e){return Bridge.isNumber(e)?65535&e:Bridge.Int.isInfinite(e)||isNaN(e)?System.UInt16.min:null},clip32:function(e){return Bridge.isNumber(e)?0|e:Bridge.Int.isInfinite(e)||isNaN(e)?System.Int32.min:null},clipu32:function(e){return Bridge.isNumber(e)?e>>>0:Bridge.Int.isInfinite(e)||isNaN(e)?System.UInt32.min:null},clip64:function(e){return Bridge.isNumber(e)?System.Int64(Bridge.Int.trunc(e)):Bridge.Int.isInfinite(e)||isNaN(e)?System.Int64.MinValue:null},clipu64:function(e){return Bridge.isNumber(e)?System.UInt64(Bridge.Int.trunc(e)):Bridge.Int.isInfinite(e)||isNaN(e)?System.UInt64.MinValue:null},sign:function(e){return e===Number.POSITIVE_INFINITY?1:e===Number.NEGATIVE_INFINITY?-1:Bridge.isNumber(e)?0===e?0:e<0?-1:1:null},$mul:Math.imul||function(e,t){var n=65535&e,i=65535&t;return n*i+((e>>>16&65535)*i+n*(t>>>16&65535)<<16>>>0)|0},mul:function(e,t,n){return null==e||null==t?null:(n&&Bridge.Int.check(e*t,System.Int32),Bridge.Int.$mul(e,t))},umul:function(e,t,n){return null==e||null==t?null:(n&&Bridge.Int.check(e*t,System.UInt32),Bridge.Int.$mul(e,t)>>>0)}}}),Bridge.Int.$kind="",Bridge.Class.addExtend(Bridge.Int,[System.IComparable$1(Bridge.Int),System.IEquatable$1(Bridge.Int)]),J("System.Byte",0,255,3),J("System.SByte",-128,127,3,Bridge.Int.clipu8),J("System.Int16",-32768,32767,5,Bridge.Int.clipu16),J("System.UInt16",0,65535,5),J("System.Int32",-2147483648,2147483647,10,Bridge.Int.clipu32),J("System.UInt32",0,4294967295,10),Bridge.define("System.Double",{inherits:[System.IComparable,System.IFormattable],statics:{min:-Number.MAX_VALUE,max:Number.MAX_VALUE,precision:15,$number:!0,$is:function(e){return"number"==typeof e},getDefaultValue:function(){return 0},parse:function(e,t){return Bridge.Int.parseFloat(e,t)},tryParse:function(e,t,n){return Bridge.Int.tryParseFloat(e,t,n)},format:function(e,t,n){return Bridge.Int.format(e,t||"G",n,System.Double)},equals:function(e,t){return!(!Bridge.is(e,System.Double)||!Bridge.is(t,System.Double))&&(e=Bridge.unbox(e,!0),t=Bridge.unbox(t,!0),!(!isNaN(e)||!isNaN(t))||e===t)},equalsT:function(e,t){return Bridge.unbox(e,!0)===Bridge.unbox(t,!0)},getHashCode:function(e){e=Bridge.unbox(e,!0);return 0===e?0:e===Number.POSITIVE_INFINITY?2146435072:e===Number.NEGATIVE_INFINITY?4293918720:Bridge.getHashCode(e.toExponential())}}}),System.Double.$kind="",Bridge.Class.addExtend(System.Double,[System.IComparable$1(System.Double),System.IEquatable$1(System.Double)]),Bridge.define("System.Single",{inherits:[System.IComparable,System.IFormattable],statics:{min:-34028234663852886e22,max:34028234663852886e22,precision:7,$number:!0,$is:System.Double.$is,getDefaultValue:System.Double.getDefaultValue,parse:System.Double.parse,tryParse:System.Double.tryParse,format:function(e,t,n){return Bridge.Int.format(e,t||"G",n,System.Single)},equals:function(e,t){return!(!Bridge.is(e,System.Single)||!Bridge.is(t,System.Single))&&(e=Bridge.unbox(e,!0),t=Bridge.unbox(t,!0),!(!isNaN(e)||!isNaN(t))||e===t)},equalsT:function(e,t){return Bridge.unbox(e,!0)===Bridge.unbox(t,!0)},getHashCode:System.Double.getHashCode}}),System.Single.$kind="",Bridge.Class.addExtend(System.Single,[System.IComparable$1(System.Single),System.IEquatable$1(System.Single)]),function(e){function i(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function y(e){return!0===(e&&e.__isLong__)}function t(e,t){var n,i;if(t){if(e>>>=0,(i=0<=e&&e<256)&&(n=s[e]))return n;n=d(e,(0|e)<0?-1:0,!0),i&&(s[e]=n)}else{if(e|=0,(i=-128<=e&&e<128)&&(n=r[e]))return n;n=d(e,e<0?-1:0,!1),i&&(r[e]=n)}return n}function h(e,t){if(isNaN(e)||!isFinite(e))return t?a:S;if(t){if(e<0)return a;if(n<=e)return C}else{if(e<=-o)return I;if(o<=e+1)return $}return e<0?h(-e,t).neg():d(e%4294967296|0,e/4294967296|0,t)}function d(e,t,n){return new i(e,t,n)}function u(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return S;if(t="number"==typeof t?(n=t,!1):!!t,(n=n||10)<2||36<n)throw RangeError("radix");var i;if(0<(i=e.indexOf("-")))throw Error("interior hyphen");if(0===i)return u(e.substring(1),t,n).neg();i=h(l(n,8));for(var r=S,s=0;s<e.length;s+=8)var o=Math.min(8,e.length-s),a=parseInt(e.substring(s,s+o),n),r=o<8?(o=h(l(n,o)),r.mul(o).add(h(a))):(r=r.mul(i)).add(h(a));return r.unsigned=t,r}function f(e){return e instanceof i?e:"number"==typeof e?h(e):"string"==typeof e?u(e):d(e.low,e.high,e.unsigned)}e.Bridge.$Long=i,Object.defineProperty(i.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),i.isLong=y;var r={},s={};i.fromInt=t,i.fromNumber=h,i.fromBits=d;var l=Math.pow;i.fromString=u,i.fromValue=f;var n=0x10000000000000000,o=n/2,g=t(16777216),S=t(0);i.ZERO=S;var a=t(0,!0);i.UZERO=a;var c=t(1);i.ONE=c;var m=t(1,!0);i.UONE=m;var p=t(-1);i.NEG_ONE=p;var $=d(-1,2147483647,!1);i.MAX_VALUE=$;var C=d(-1,-1,!0);i.MAX_UNSIGNED_VALUE=C;var I=d(0,-2147483648,!1);i.MIN_VALUE=I,(e=i.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},e.toNumber=function(){return this.unsigned?4294967296*(this.high>>>0)+(this.low>>>0):4294967296*this.high+(this.low>>>0)},e.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(I)){var t=h(e),t=(n=this.div(t)).mul(t).sub(this);return n.toString(e)+t.toInt().toString(e)}return(void 0===e||10===e?"-":"")+this.neg().toString(e)}for(var n=h(l(e,6),this.unsigned),t=this,i="";;){var r=t.div(n),s=(t.sub(r.mul(n)).toInt()>>>0).toString(e);if((t=r).isZero())return s+i;for(;s.length<6;)s="0"+s;i=""+s+i}},e.getHighBits=function(){return this.high},e.getHighBitsUnsigned=function(){return this.high>>>0},e.getLowBits=function(){return this.low},e.getLowBitsUnsigned=function(){return this.low>>>0},e.getNumBitsAbs=function(){if(this.isNegative())return this.eq(I)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;0<t&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},e.isZero=function(){return 0===this.high&&0===this.low},e.isNegative=function(){return!this.unsigned&&this.high<0},e.isPositive=function(){return this.unsigned||0<=this.high},e.isOdd=function(){return 1==(1&this.low)},e.isEven=function(){return 0==(1&this.low)},e.equals=function(e){return y(e)||(e=f(e)),(this.unsigned===e.unsigned||1!=this.high>>>31||1!=e.high>>>31)&&(this.high===e.high&&this.low===e.low)},e.eq=e.equals,e.notEquals=function(e){return!this.eq(e)},e.neq=e.notEquals,e.lessThan=function(e){return this.comp(e)<0},e.lt=e.lessThan,e.lessThanOrEqual=function(e){return this.comp(e)<=0},e.lte=e.lessThanOrEqual,e.greaterThan=function(e){return 0<this.comp(e)},e.gt=e.greaterThan,e.greaterThanOrEqual=function(e){return 0<=this.comp(e)},e.gte=e.greaterThanOrEqual,e.compare=function(e){if(y(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},e.comp=e.compare,e.negate=function(){return!this.unsigned&&this.eq(I)?I:this.not().add(c)},e.neg=e.negate,e.add=function(e){y(e)||(e=f(e));var t=this.high>>>16,n=65535&this.high,i=this.low>>>16,r=e.high>>>16,s=65535&e.high,o=e.low>>>16,a=(65535&this.low)+(65535&e.low);return e=a>>>16,i=(e+=i+o)>>>16,d((65535&e)<<16|65535&a,(t+r+((i+=n+s)>>>16)&65535)<<16|65535&i,this.unsigned)},e.subtract=function(e){return y(e)||(e=f(e)),this.add(e.neg())},e.sub=e.subtract,e.multiply=function(e){if(this.isZero())return S;if(y(e)||(e=f(e)),e.isZero())return S;if(this.eq(I))return e.isOdd()?I:S;if(e.eq(I))return this.isOdd()?I:S;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(g)&&e.lt(g))return h(this.toNumber()*e.toNumber(),this.unsigned);var t,n,i=this.high>>>16,r=65535&this.high,s=this.low>>>16,o=65535&this.low,a=e.high>>>16,u=65535&e.high,l=e.low>>>16,c=(n=0+o*(e=65535&e.low))>>>16,m=(c+=s*e)>>>16;return m+=(c=(65535&c)+o*l)>>>16,t=(m+=r*e)>>>16,t+=(m=(65535&m)+s*l)>>>16,m&=65535,d((c&=65535)<<16|65535&n,(i*e+r*l+s*u+o*a+(t+=(m+=o*u)>>>16)&65535)<<16|(m&=65535),this.unsigned)},e.mul=e.multiply,e.divide=function(e){if(y(e)||(e=f(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?a:S;var t,n,i;if(this.unsigned)e.unsigned||(e=e.toUnsigned());else{if(this.eq(I))return e.eq(c)||e.eq(p)?I:e.eq(I)?c:(t=this.shr(1).div(e).shl(1)).eq(S)?e.isNegative()?c:p:(n=this.sub(e.mul(t)),t.add(n.div(e)));if(e.eq(I))return this.unsigned?a:S;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg()}if(this.unsigned){if(e.gt(this))return a;if(e.gt(this.shru(1)))return m;i=a}else i=S;for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var r=(r=Math.ceil(Math.log(t)/Math.LN2))<=48?1:l(2,r-48),s=h(t),o=s.mul(e);o.isNegative()||o.gt(n);)o=(s=h(t-=r,this.unsigned)).mul(e);s.isZero()&&(s=c),i=i.add(s),n=n.sub(o)}return i},e.div=e.divide,e.modulo=function(e){return y(e)||(e=f(e)),this.sub(this.div(e).mul(e))},e.mod=e.modulo,e.not=function(){return d(~this.low,~this.high,this.unsigned)},e.and=function(e){return y(e)||(e=f(e)),d(this.low&e.low,this.high&e.high,this.unsigned)},e.or=function(e){return y(e)||(e=f(e)),d(this.low|e.low,this.high|e.high,this.unsigned)},e.xor=function(e){return y(e)||(e=f(e)),d(this.low^e.low,this.high^e.high,this.unsigned)},e.shiftLeft=function(e){return y(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?d(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):d(0,this.low<<e-32,this.unsigned)},e.shl=e.shiftLeft,e.shiftRight=function(e){return y(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?d(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):d(this.high>>e-32,0<=this.high?0:-1,this.unsigned)},e.shr=e.shiftRight,e.shiftRightUnsigned=function(e){if(y(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?d(this.low>>>e|t<<32-e,t>>>e,this.unsigned):d(32===e?t:t>>>e-32,0,this.unsigned)},e.shru=e.shiftRightUnsigned,e.toSigned=function(){return this.unsigned?d(this.low,this.high,!1):this},e.toUnsigned=function(){return this.unsigned?this:d(this.low,this.high,!0)}}(Bridge.global),System.Int64=function(e){if(this.constructor!==System.Int64)return new System.Int64(e);Bridge.hasValue(e)||(e=0),this.T=System.Int64,this.unsigned=!1,this.value=System.Int64.getValue(e)},System.Int64.$number=!0,System.Int64.TWO_PWR_16_DBL=65536,System.Int64.TWO_PWR_32_DBL=System.Int64.TWO_PWR_16_DBL*System.Int64.TWO_PWR_16_DBL,System.Int64.TWO_PWR_64_DBL=System.Int64.TWO_PWR_32_DBL*System.Int64.TWO_PWR_32_DBL,System.Int64.TWO_PWR_63_DBL=System.Int64.TWO_PWR_64_DBL/2,System.Int64.$$name="System.Int64",System.Int64.prototype.$$name="System.Int64",System.Int64.$kind="struct",System.Int64.prototype.$kind="struct",System.Int64.$$inherits=[],Bridge.Class.addExtend(System.Int64,[System.IComparable,System.IFormattable,System.IComparable$1(System.Int64),System.IEquatable$1(System.Int64)]),System.Int64.$is=function(e){return e instanceof System.Int64},System.Int64.is64Bit=function(e){return e instanceof System.Int64||e instanceof System.UInt64},System.Int64.is64BitType=function(e){return e===System.Int64||e===System.UInt64},System.Int64.getDefaultValue=function(){return System.Int64.Zero},System.Int64.getValue=function(e){return Bridge.hasValue(e)?e instanceof Bridge.$Long?e:e instanceof System.Int64?e.value:e instanceof System.UInt64?e.value.toSigned():Bridge.isArray(e)?new Bridge.$Long(e[0],e[1]):Bridge.isString(e)?Bridge.$Long.fromString(e):Bridge.isNumber(e)?e+1>=System.Int64.TWO_PWR_63_DBL?new System.UInt64(e).value.toSigned():Bridge.$Long.fromNumber(e):e instanceof System.Decimal?Bridge.$Long.fromString(e.toString()):Bridge.$Long.fromValue(e):null},System.Int64.create=function(e){return Bridge.hasValue(e)?e instanceof System.Int64?e:new System.Int64(e):null},System.Int64.lift=function(e){return Bridge.hasValue(e)?System.Int64.create(e):null},System.Int64.toNumber=function(e){return e?e.toNumber():null},System.Int64.prototype.toNumberDivided=function(e){var t=this.div(e),e=this.mod(e).toNumber()/e;return t.toNumber()+e},System.Int64.prototype.toJSON=function(){return this.gt(Bridge.Int.MAX_SAFE_INTEGER)||this.lt(Bridge.Int.MIN_SAFE_INTEGER)?this.toString():this.toNumber()},System.Int64.prototype.toString=function(e,t){return e||t?Bridge.isNumber(e)&&!t?this.value.toString(e):Bridge.Int.format(this,e,t,System.Int64,System.Int64.clipu64):this.value.toString()},System.Int64.prototype.format=function(e,t){return Bridge.Int.format(this,e,t,System.Int64,System.Int64.clipu64)},System.Int64.prototype.isNegative=function(){return this.value.isNegative()},System.Int64.prototype.abs=function(){if(this.T===System.Int64&&this.eq(System.Int64.MinValue))throw new System.OverflowException;return new this.T(this.value.isNegative()?this.value.neg():this.value)},System.Int64.prototype.compareTo=function(e){return this.value.compare(this.T.getValue(e))},System.Int64.prototype.add=function(e,t){var n=this.T.getValue(e),i=new this.T(this.value.add(n));if(t){var r=this.value.isNegative(),e=n.isNegative(),t=i.value.isNegative();if(r&&e&&!t||!r&&!e&&t||this.T===System.UInt64&&i.lt(System.UInt64.max(this,n)))throw new System.OverflowException}return i},System.Int64.prototype.sub=function(e,t){var n=this.T.getValue(e),i=new this.T(this.value.sub(n));if(t){var r=this.value.isNegative(),e=n.isNegative(),t=i.value.isNegative();if(r&&!e&&!t||!r&&e&&t||this.T===System.UInt64&&this.value.lt(n))throw new System.OverflowException}return i},System.Int64.prototype.isZero=function(){return this.value.isZero()},System.Int64.prototype.mul=function(e,t){var n=this.T.getValue(e),i=new this.T(this.value.mul(n));if(t){var r,s=this.sign(),e=n.isZero()?0:n.isNegative()?-1:1,t=i.sign();if(this.T===System.Int64){if(this.eq(System.Int64.MinValue)||this.eq(System.Int64.MaxValue)){if(n.neq(1)&&n.neq(0))throw new System.OverflowException;return i}if(n.eq(Bridge.$Long.MIN_VALUE)||n.eq(Bridge.$Long.MAX_VALUE)){if(this.neq(1)&&this.neq(0))throw new System.OverflowException;return i}if(-1===s&&-1==e&&1!==t||1===s&&1==e&&1!==t||-1===s&&1==e&&-1!==t||1===s&&-1==e&&-1!==t)throw new System.OverflowException;if((r=i.abs()).lt(this.abs())||r.lt(System.Int64(n).abs()))throw new System.OverflowException}else{if(this.eq(System.UInt64.MaxValue)){if(n.neq(1)&&n.neq(0))throw new System.OverflowException;return i}if(n.eq(Bridge.$Long.MAX_UNSIGNED_VALUE)){if(this.neq(1)&&this.neq(0))throw new System.OverflowException;return i}if((r=i.abs()).lt(this.abs())||r.lt(System.Int64(n).abs()))throw new System.OverflowException}}return i},System.Int64.prototype.div=function(e){return new this.T(this.value.div(this.T.getValue(e)))},System.Int64.prototype.mod=function(e){return new this.T(this.value.mod(this.T.getValue(e)))},System.Int64.prototype.neg=function(e){if(e&&this.T===System.Int64&&this.eq(System.Int64.MinValue))throw new System.OverflowException;return new this.T(this.value.neg())},System.Int64.prototype.inc=function(e){return this.add(1,e)},System.Int64.prototype.dec=function(e){return this.sub(1,e)},System.Int64.prototype.sign=function(){return this.value.isZero()?0:this.value.isNegative()?-1:1},System.Int64.prototype.clone=function(){return new this.T(this)},System.Int64.prototype.ne=function(e){return this.value.neq(this.T.getValue(e))},System.Int64.prototype.neq=function(e){return this.value.neq(this.T.getValue(e))},System.Int64.prototype.eq=function(e){return this.value.eq(this.T.getValue(e))},System.Int64.prototype.lt=function(e){return this.value.lt(this.T.getValue(e))},System.Int64.prototype.lte=function(e){return this.value.lte(this.T.getValue(e))},System.Int64.prototype.gt=function(e){return this.value.gt(this.T.getValue(e))},System.Int64.prototype.gte=function(e){return this.value.gte(this.T.getValue(e))},System.Int64.prototype.equals=function(e){return this.value.eq(this.T.getValue(e))},System.Int64.prototype.equalsT=function(e){return this.equals(e)},System.Int64.prototype.getHashCode=function(){return 397*(397*this.sign()+this.value.high|0)+this.value.low|0},System.Int64.prototype.toNumber=function(){return this.value.toNumber()},System.Int64.parse=function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("str");if(!/^[+-]?[0-9]+$/.test(e))throw new System.FormatException.$ctor1("Input string was not in a correct format.");var t=new System.Int64(e);if(System.String.trimStartZeros(e)!==t.toString())throw new System.OverflowException;return t},System.Int64.tryParse=function(e,t){try{return null!=e&&/^[+-]?[0-9]+$/.test(e)?(t.v=new System.Int64(e),System.String.trimStartZeros(e)===t.v.toString()||(t.v=System.Int64(Bridge.$Long.ZERO),!1)):(t.v=System.Int64(Bridge.$Long.ZERO),!1)}catch(e){return t.v=System.Int64(Bridge.$Long.ZERO),!1}},System.Int64.divRem=function(e,t,n){e=System.Int64(e),t=System.Int64(t);var i=e.mod(t);return n.v=i,e.sub(i).div(t)},System.Int64.min=function(){for(var e,t=[],n=0,i=arguments.length;n<i;n++)t.push(System.Int64.getValue(arguments[n]));for(e=t[n=0];++n<t.length;)t[n].lt(e)&&(e=t[n]);return new System.Int64(e)},System.Int64.max=function(){for(var e,t=[],n=0,i=arguments.length;n<i;n++)t.push(System.Int64.getValue(arguments[n]));for(e=t[n=0];++n<t.length;)t[n].gt(e)&&(e=t[n]);return new System.Int64(e)},System.Int64.prototype.and=function(e){return new this.T(this.value.and(this.T.getValue(e)))},System.Int64.prototype.not=function(){return new this.T(this.value.not())},System.Int64.prototype.or=function(e){return new this.T(this.value.or(this.T.getValue(e)))},System.Int64.prototype.shl=function(e){return new this.T(this.value.shl(e))},System.Int64.prototype.shr=function(e){return new this.T(this.value.shr(e))},System.Int64.prototype.shru=function(e){return new this.T(this.value.shru(e))},System.Int64.prototype.xor=function(e){return new this.T(this.value.xor(this.T.getValue(e)))},System.Int64.check=function(e,t){if(Bridge.Int.isInfinite(e))return t===System.Int64||t===System.UInt64?t.MinValue:t.min;if(!e)return null;var n,i;if(t===System.Int64){if(e instanceof System.Int64)return e;if((n=e.value.toString())!==(i=new System.Int64(n)).value.toString())throw new System.OverflowException;return i}if(t!==System.UInt64)return Bridge.Int.check(e.toNumber(),t);if(e instanceof System.UInt64)return e;if(e.value.isNegative())throw new System.OverflowException;if((n=e.value.toString())!==(i=new System.UInt64(n)).value.toString())throw new System.OverflowException;return i},System.Int64.clip8=function(e){return(e=null==e||System.Int64.is64Bit(e)?e:new System.Int64(e))?Bridge.Int.sxb(255&e.value.low):Bridge.Int.isInfinite(e)?System.SByte.min:null},System.Int64.clipu8=function(e){return(e=null==e||System.Int64.is64Bit(e)?e:new System.Int64(e))?255&e.value.low:Bridge.Int.isInfinite(e)?System.Byte.min:null},System.Int64.clip16=function(e){return(e=null==e||System.Int64.is64Bit(e)?e:new System.Int64(e))?Bridge.Int.sxs(65535&e.value.low):Bridge.Int.isInfinite(e)?System.Int16.min:null},System.Int64.clipu16=function(e){return(e=null==e||System.Int64.is64Bit(e)?e:new System.Int64(e))?65535&e.value.low:Bridge.Int.isInfinite(e)?System.UInt16.min:null},System.Int64.clip32=function(e){return(e=null==e||System.Int64.is64Bit(e)?e:new System.Int64(e))?0|e.value.low:Bridge.Int.isInfinite(e)?System.Int32.min:null},System.Int64.clipu32=function(e){return(e=null==e||System.Int64.is64Bit(e)?e:new System.Int64(e))?e.value.low>>>0:Bridge.Int.isInfinite(e)?System.UInt32.min:null},System.Int64.clip64=function(e){return(e=null==e||System.Int64.is64Bit(e)?e:new System.UInt64(e))?new System.Int64(e.value.toSigned()):Bridge.Int.isInfinite(e)?System.Int64.MinValue:null},System.Int64.clipu64=function(e){return(e=null==e||System.Int64.is64Bit(e)?e:new System.Int64(e))?new System.UInt64(e.value.toUnsigned()):Bridge.Int.isInfinite(e)?System.UInt64.MinValue:null},System.Int64.Zero=System.Int64(Bridge.$Long.ZERO),System.Int64.MinValue=System.Int64(Bridge.$Long.MIN_VALUE),System.Int64.MaxValue=System.Int64(Bridge.$Long.MAX_VALUE),System.Int64.precision=19,System.UInt64=function(e){if(this.constructor!==System.UInt64)return new System.UInt64(e);Bridge.hasValue(e)||(e=0),this.T=System.UInt64,this.unsigned=!0,this.value=System.UInt64.getValue(e,!0)},System.UInt64.$number=!0,System.UInt64.$$name="System.UInt64",System.UInt64.prototype.$$name="System.UInt64",System.UInt64.$kind="struct",System.UInt64.prototype.$kind="struct",System.UInt64.$$inherits=[],Bridge.Class.addExtend(System.UInt64,[System.IComparable,System.IFormattable,System.IComparable$1(System.UInt64),System.IEquatable$1(System.UInt64)]),System.UInt64.$is=function(e){return e instanceof System.UInt64},System.UInt64.getDefaultValue=function(){return System.UInt64.Zero},System.UInt64.getValue=function(e){return Bridge.hasValue(e)?e instanceof Bridge.$Long?e:e instanceof System.UInt64?e.value:e instanceof System.Int64?e.value.toUnsigned():Bridge.isArray(e)?new Bridge.$Long(e[0],e[1],!0):Bridge.isString(e)?Bridge.$Long.fromString(e,!0):Bridge.isNumber(e)?e<0?new System.Int64(e).value.toUnsigned():Bridge.$Long.fromNumber(e,!0):e instanceof System.Decimal?Bridge.$Long.fromString(e.toString(),!0):Bridge.$Long.fromValue(e):null},System.UInt64.create=function(e){return Bridge.hasValue(e)?e instanceof System.UInt64?e:new System.UInt64(e):null},System.UInt64.lift=function(e){return Bridge.hasValue(e)?System.UInt64.create(e):null},System.UInt64.prototype.toString=System.Int64.prototype.toString,System.UInt64.prototype.format=System.Int64.prototype.format,System.UInt64.prototype.isNegative=System.Int64.prototype.isNegative,System.UInt64.prototype.abs=System.Int64.prototype.abs,System.UInt64.prototype.compareTo=System.Int64.prototype.compareTo,System.UInt64.prototype.add=System.Int64.prototype.add,System.UInt64.prototype.sub=System.Int64.prototype.sub,System.UInt64.prototype.isZero=System.Int64.prototype.isZero,System.UInt64.prototype.mul=System.Int64.prototype.mul,System.UInt64.prototype.div=System.Int64.prototype.div,System.UInt64.prototype.toNumberDivided=System.Int64.prototype.toNumberDivided,System.UInt64.prototype.mod=System.Int64.prototype.mod,System.UInt64.prototype.neg=System.Int64.prototype.neg,System.UInt64.prototype.inc=System.Int64.prototype.inc,System.UInt64.prototype.dec=System.Int64.prototype.dec,System.UInt64.prototype.sign=System.Int64.prototype.sign,System.UInt64.prototype.clone=System.Int64.prototype.clone,System.UInt64.prototype.ne=System.Int64.prototype.ne,System.UInt64.prototype.neq=System.Int64.prototype.neq,System.UInt64.prototype.eq=System.Int64.prototype.eq,System.UInt64.prototype.lt=System.Int64.prototype.lt,System.UInt64.prototype.lte=System.Int64.prototype.lte,System.UInt64.prototype.gt=System.Int64.prototype.gt,System.UInt64.prototype.gte=System.Int64.prototype.gte,System.UInt64.prototype.equals=System.Int64.prototype.equals,System.UInt64.prototype.equalsT=System.Int64.prototype.equalsT,System.UInt64.prototype.getHashCode=System.Int64.prototype.getHashCode,System.UInt64.prototype.toNumber=System.Int64.prototype.toNumber,System.UInt64.parse=function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("str");if(!/^[+-]?[0-9]+$/.test(e))throw new System.FormatException.$ctor1("Input string was not in a correct format.");var t=new System.UInt64(e);if(t.value.isNegative())throw new System.OverflowException;if(System.String.trimStartZeros(e)!==t.toString())throw new System.OverflowException;return t},System.UInt64.tryParse=function(e,t){try{return null!=e&&/^[+-]?[0-9]+$/.test(e)?(t.v=new System.UInt64(e),!t.v.isNegative()&&System.String.trimStartZeros(e)===t.v.toString()||(t.v=System.UInt64(Bridge.$Long.UZERO),!1)):(t.v=System.UInt64(Bridge.$Long.UZERO),!1)}catch(e){return t.v=System.UInt64(Bridge.$Long.UZERO),!1}},System.UInt64.min=function(){for(var e,t=[],n=0,i=arguments.length;n<i;n++)t.push(System.UInt64.getValue(arguments[n]));for(e=t[n=0];++n<t.length;)t[n].lt(e)&&(e=t[n]);return new System.UInt64(e)},System.UInt64.max=function(){for(var e,t=[],n=0,i=arguments.length;n<i;n++)t.push(System.UInt64.getValue(arguments[n]));for(e=t[n=0];++n<t.length;)t[n].gt(e)&&(e=t[n]);return new System.UInt64(e)},System.UInt64.divRem=function(e,t,n){e=System.UInt64(e),t=System.UInt64(t);var i=e.mod(t);return n.v=i,e.sub(i).div(t)},System.UInt64.prototype.toJSON=function(){return this.gt(Bridge.Int.MAX_SAFE_INTEGER)?this.toString():this.toNumber()},System.UInt64.prototype.and=System.Int64.prototype.and,System.UInt64.prototype.not=System.Int64.prototype.not,System.UInt64.prototype.or=System.Int64.prototype.or,System.UInt64.prototype.shl=System.Int64.prototype.shl,System.UInt64.prototype.shr=System.Int64.prototype.shr,System.UInt64.prototype.shru=System.Int64.prototype.shru,System.UInt64.prototype.xor=System.Int64.prototype.xor,System.UInt64.Zero=System.UInt64(Bridge.$Long.UZERO),System.UInt64.MinValue=System.UInt64.Zero,System.UInt64.MaxValue=System.UInt64(Bridge.$Long.MAX_UNSIGNED_VALUE),System.UInt64.precision=20,function(e){function $(e){var t,n,i,r=e.length-1,s="",o=e[0];if(0<r){for(s+=o,t=1;t<r;t++)i=e[t]+"",(n=ve-i.length)&&(s+=a(n)),s+=i;o=e[t],(n=ve-(i=o+"").length)&&(s+=a(n))}else if(0===o)return"0";for(;o%10==0;)o/=10;return s+o}function d(e,t,n){if(e!==~~e||e<t||n<e)throw Error(Se+e)}function C(e,t,n,i){for(var r,s,o=e[0];10<=o;o/=10)--t;return--t<0?(t+=ve,r=0):(r=Math.ceil((t+1)/ve),t%=ve),o=Ie(10,ve-t),s=e[r]%o|0,null==i?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),n<4&&99999==s||3<n&&49999==s||5e4==s||0==s):(n<4&&s+1==o||3<n&&s+1==o/2)&&(e[r+1]/o/100|0)==Ie(10,t-2)-1||(s==o/2||0==s)&&0==(e[r+1]/o/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),(i||n<4)&&9999==s||!i&&3<n&&4999==s):((i||n<4)&&s+1==o||!i&&3<n&&s+1==o/2)&&(e[r+1]/o/1e3|0)==Ie(10,t-3)-1}function f(e,t,n){for(var i,r,s=[0],o=0,a=e.length;o<a;){for(r=s.length;r--;)s[r]*=t;for(s[0]+=me.indexOf(e.charAt(o++)),i=0;i<s.length;i++)s[i]>n-1&&(void 0===s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/n|0,s[i]%=n)}return s.reverse()}function T(e,t,n,i){var r,s,o,a,u,l,c,m,y=e.constructor;e:if(null!=t){if(!(c=e.d))return e;for(r=1,a=c[0];10<=a;a/=10)r++;if((s=t-r)<0)s+=ve,o=t,u=(l=c[m=0])/Ie(10,r-o-1)%10|0;else if(m=Math.ceil((s+1)/ve),(a=c.length)<=m){if(!i)break e;for(;a++<=m;)c.push(0);l=u=0,o=(s%=ve)-ve+(r=1)}else{for(l=a=c[m],r=1;10<=a;a/=10)r++;u=(o=(s%=ve)-ve+r)<0?0:l/Ie(10,r-o-1)%10|0}if(i=i||t<0||void 0!==c[m+1]||(o<0?l:l%Ie(10,r-o-1)),u=n<4?(u||i)&&(0==n||n==(e.s<0?3:2)):5<u||5==u&&(4==n||i||6==n&&(0<s?0<o?l/Ie(10,r-o):0:c[m-1])%10&1||n==(e.s<0?8:7)),t<1||!c[0])return c.length=0,u?(t-=e.e+1,c[0]=Ie(10,(ve-t%ve)%ve),e.e=-t||0):c[0]=e.e=0,e;if(0==s?(c.length=m,a=1,m--):(c.length=m+1,a=Ie(10,ve-s),c[m]=0<o?(l/Ie(10,r-o)%Ie(10,o)|0)*a:0),u)for(;;){if(0==m){for(s=1,o=c[0];10<=o;o/=10)s++;for(o=c[0]+=a,a=1;10<=o;o/=10)a++;s!=a&&(e.e++,c[0]==we&&(c[0]=1));break}if(c[m]+=a,c[m]!=we)break;c[m--]=0,a=1}for(s=c.length;0===c[--s];)c.pop()}return fe&&(e.e>y.maxE?(e.d=null,e.e=NaN):e.e<y.minE&&(e.e=0,e.d=[0])),e}function g(e,t,n){if(!e.isFinite())return x(e);var i,r=e.e,s=$(e.d),o=s.length;return t?(n&&0<(i=n-o)?s=s.charAt(0)+"."+s.slice(1)+a(i):1<o&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+a(-r-1)+s,n&&0<(i=n-o)&&(s+=a(i))):o<=r?(s+=a(r+1-o),n&&0<(i=n-r-1)&&(s=s+"."+a(i))):((i=r+1)<o&&(s=s.slice(0,i)+"."+s.slice(i)),n&&0<(i=n-o)&&(r+1===o&&(s+="."),s+=a(i))),s}function S(e,t){for(var n=1,i=e[0];10<=i;i/=10)n++;return n+t*ve-1}function I(e,t,n){if(_e<t)throw fe=!0,n&&(e.precision=n),Error(pe);return T(new e(ye),t,1,!0)}function h(e,t,n){if(Te<t)throw Error(pe);return T(new e(he),t,n,!0)}function p(e){var t=e.length-1,n=t*ve+1;if(t=e[t]){for(;t%10==0;t/=10)n--;for(t=e[0];10<=t;t/=10)n++}return n}function a(e){for(var t="";e--;)t+="0";return t}function m(e,t,n,i){var r,s=new e(1),o=Math.ceil(i/ve+4);for(fe=!1;;){if(n%2&&(u((s=s.times(t)).d,o)&&(r=!0)),0===(n=Ce(n/2))){n=s.d.length-1,r&&0===s.d[n]&&++s.d[n];break}u((t=t.times(t)).d,o)}return fe=!0,s}function s(e){return 1&e.d[e.d.length-1]}function t(e,t,n){for(var i,r=new e(t[0]),s=0;++s<t.length;){if(!(i=new e(t[s])).s){r=i;break}r[n](i)&&(r=i)}return r}function y(e,t){var n,i,r,s,o,a,u,l=0,c=0,m=0,y=e.constructor,h=y.rounding,d=y.precision;if(!e.d||!e.d[0]||17<e.e)return new y(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(u=null==t?(fe=!1,d):t,a=new y(.03125);-2<e.e;)e=e.times(a),m+=5;for(u+=i=Math.log(Ie(2,m))/Math.LN10*2+5|0,n=s=o=new y(1),y.precision=u;;){if(s=T(s.times(e),u,1),n=n.times(++c),$((a=o.plus(Re(s,n,u,1))).d).slice(0,u)===$(o.d).slice(0,u)){for(r=m;r--;)o=T(o.times(o),u,1);if(null!=t)return y.precision=d,o;if(!(l<3&&C(o.d,u-i,h,l)))return T(o,y.precision=d,h,fe=!0);y.precision=u+=10,n=s=a=new y(1),c=0,l++}o=a}}function E(e,t){var n,i,r,s,o,a,u,l,c,m,y,h=1,d=e,f=d.d,g=d.constructor,S=g.rounding,p=g.precision;if(d.s<0||!f||!f[0]||!d.e&&1==f[0]&&1==f.length)return new g(f&&!f[0]?-1/0:1!=d.s?NaN:f?0:d);if(c=null==t?(fe=!1,p):t,g.precision=c+=10,i=(n=$(f)).charAt(0),!(Math.abs(s=d.e)<15e14))return l=I(g,c+2,p).times(s+""),d=E(new g(i+"."+n.slice(1)),c-10).plus(l),g.precision=p,null==t?T(d,p,S,fe=!0):d;for(;i<7&&1!=i||1==i&&3<n.charAt(1);)i=(n=$((d=d.times(e)).d)).charAt(0),h++;for(s=d.e,1<i?(d=new g("0."+n),s++):d=new g(i+"."+n.slice(1)),u=o=d=Re((m=d).minus(1),d.plus(1),c,1),y=T(d.times(d),c,1),r=3;;){if(o=T(o.times(y),c,1),$((l=u.plus(Re(o,new g(r),c,1))).d).slice(0,c)===$(u.d).slice(0,c)){if(u=u.times(2),0!==s&&(u=u.plus(I(g,c+2,p).times(s+""))),u=Re(u,new g(h),c,1),null!=t)return g.precision=p,u;if(!C(u.d,c-10,S,a))return T(u,g.precision=p,S,fe=!0);g.precision=c+=10,l=o=d=Re(m.minus(1),m.plus(1),c,1),y=T(d.times(d),c,1),r=a=1}u=l,r+=2}}function x(e){return String(e.s*e.s/0)}function o(e,t){var n,i,r;for(-1<(n=t.indexOf("."))&&(t=t.replace(".","")),0<(i=t.search(/e/i))?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;48===t.charCodeAt(i);i++);for(r=t.length;48===t.charCodeAt(r-1);--r);if(t=t.slice(i,r)){if(r-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%ve,n<0&&(i+=ve),i<r){for(i&&e.d.push(+t.slice(0,i)),r-=ve;i<r;)e.d.push(+t.slice(i,i+=ve));t=t.slice(i),i=ve-t.length}else i-=r;for(;i--;)t+="0";e.d.push(+t),fe&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function c(e,t,n,i,r){var s,o,a,u,l=e.precision,c=Math.ceil(l/ve);for(fe=!1,u=n.times(n),a=new e(i);;){if(o=Re(a.times(u),new e(t++*t++),l,1),a=r?i.plus(o):i.minus(o),i=Re(o.times(u),new e(t++*t++),l,1),void 0!==(o=a.plus(i)).d[c]){for(s=c;o.d[s]===a.d[s]&&s--;);if(-1==s)break}s=a,a=i,i=o,o=s,0}return fe=!0,o.d.length=c+1,o}function r(e,t){var n=t.s<0,i=h(e,e.precision,1),r=i.times(.5);if((t=t.abs()).lte(r))return ue=n?4:1,t;if((e=t.divToInt(i)).isZero())ue=n?3:2;else{if((t=t.minus(e.times(i))).lte(r))return ue=s(e)?n?2:3:n?4:1,t;ue=s(e)?n?1:4:n?3:2}return t.minus(i).abs()}function n(e,t,n,i){var r,s,o,a,u,l,c,m,y=e.constructor,h=void 0!==n;if(h?(d(n,1,ce),void 0===i?i=y.rounding:d(i,0,8)):(n=y.precision,i=y.rounding),e.isFinite()){for(h?(r=2,16==t?n=4*n-3:8==t&&(n=3*n-2)):r=t,0<=(o=(l=g(e)).indexOf("."))&&(l=l.replace(".",""),(m=new y(1)).e=l.length-o,m.d=f(g(m),10,r),m.e=m.d.length),s=a=(c=f(l,10,r)).length;0==c[--a];)c.pop();if(c[0]){if(o<0?s--:((e=new y(e)).d=c,e.e=s,c=(e=Re(e,m,n,i,0,r)).d,s=e.e,u=ae),o=c[n],m=r/2,u=u||void 0!==c[n+1],u=i<4?(void 0!==o||u)&&(0===i||i===(e.s<0?3:2)):m<o||o===m&&(4===i||u||6===i&&1&c[n-1]||i===(e.s<0?8:7)),c.length=n,u)for(;++c[--n]>r-1;)c[n]=0,n||(++s,c.unshift(1));for(a=c.length;!c[a-1];--a);for(o=0,l="";o<a;o++)l+=me.charAt(c[o]);if(h){if(1<a)if(16==t||8==t){for(o=16==t?4:3,--a;a%o;a++)l+="0";for(a=(c=f(l,r,t)).length;!c[a-1];--a);for(o=1,l="1.";o<a;o++)l+=me.charAt(c[o])}else l=l.charAt(0)+"."+l.slice(1);l=l+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)l="0"+l;l="0."+l}else if(++s>a)for(s-=a;s--;)l+="0";else s<a&&(l=l.slice(0,s)+"."+l.slice(s))}else l=h?"0p+0":"0";l=(16==t?"0x":2==t?"0b":8==t?"0o":"")+l}else l=x(e);return e.s<0?"-"+l:l}function u(e,t){return e.length>t&&(e.length=t,1)}function l(e){return new this(e).abs()}function A(e){return new this(e).acos()}function B(e){return new this(e).acosh()}function w(e,t){return new this(e).plus(t)}function v(e){return new this(e).asin()}function _(e){return new this(e).asinh()}function b(e){return new this(e).atan()}function R(e){return new this(e).atanh()}function D(e,t){e=new this(e),t=new this(t);var n,i=this.precision,r=this.rounding,s=i+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?h(this,i,r):new this(0)).s=e.s:!e.d||t.isZero()?(n=h(this,s,1).times(.5)).s=e.s:n=t.s<0?(this.precision=s,this.rounding=1,n=this.atan(Re(e,t,s,1)),t=h(this,s,1),this.precision=i,this.rounding=r,e.s<0?n.minus(t):n.plus(t)):this.atan(Re(e,t,s,1)):(n=h(this,s,1).times(0<t.s?.25:.75)).s=e.s:n=new this(NaN),n}function N(e){return new this(e).cbrt()}function O(e){return T(e=new this(e),e.e+1,2)}function k(e){if(!e||"object"!=typeof e)throw Error(ge+"Object expected");for(var t,n,i=["precision",1,ce,"rounding",0,8,"toExpNeg",-le,0,"toExpPos",0,le,"maxE",0,le,"minE",-le,0,"modulo",0,9],r=0;r<i.length;r+=3)if(void 0!==(n=e[t=i[r]])){if(!(Ce(n)===n&&i[r+1]<=n&&n<=i[r+2]))throw Error(Se+t+": "+n);this[t]=n}if(void 0!==(n=e[t="crypto"])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(Se+t+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error($e);this[t]=!0}else this[t]=!1}return this}function G(e){return new this(e).cos()}function F(e){return new this(e).cosh()}function P(e,t){return new this(e).div(t)}function L(e){return new this(e).exp()}function V(e){return T(e=new this(e),e.e+1,3)}function M(){var e,t,n=new this(0);for(fe=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return fe=!0,new this(1/0);n=t}return fe=!0,n.sqrt()}function z(e){return new this(e).ln()}function q(e,t){return new this(e).log(t)}function H(e){return new this(e).log(2)}function U(e){return new this(e).log(10)}function W(){return t(this,arguments,"lt")}function K(){return t(this,arguments,"gt")}function j(e,t){return new this(e).mod(t)}function J(e,t){return new this(e).mul(t)}function Z(e,t){return new this(e).pow(t)}function Y(e){var t,n,i,r,s=0,o=new this(1),a=[];if(void 0===e?e=this.precision:d(e,1,ce),i=Math.ceil(e/ve),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));s<i;)429e7<=(r=t[s])?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=r%1e7;else{if(!crypto.randomBytes)throw Error($e);for(t=crypto.randomBytes(i*=4);s<i;)214e7<=(r=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((127&t[s+3])<<24))?crypto.randomBytes(4).copy(t,s):(a.push(r%1e7),s+=4);s=i/4}else for(;s<i;)a[s++]=1e7*Math.random()|0;for(i=a[--s],e%=ve,i&&e&&(r=Ie(10,ve-e),a[s]=(i/r|0)*r);0===a[s];s--)a.pop();if(s<0)a=[n=0];else{for(n=-1;0===a[0];n-=ve)a.shift();for(i=1,r=a[0];10<=r;r/=10)i++;i<ve&&(n-=ve-i)}return o.e=n,o.d=a,o}function X(e){return T(e=new this(e),e.e+1,this.rounding)}function Q(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function ee(e){return new this(e).sin()}function te(e){return new this(e).sinh()}function ne(e){return new this(e).sqrt()}function ie(e,t){return new this(e).sub(t)}function re(e){return new this(e).tan()}function se(e){return new this(e).tanh()}function oe(e){return T(e=new this(e),e.e+1,1)}var ae,i,ue,le=9e15,ce=1e9,me="0123456789abcdef",ye="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",he="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",de={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-le,maxE:le,crypto:!1},fe=!0,ge="[DecimalError] ",Se=ge+"Invalid argument: ",pe=ge+"Precision limit exceeded",$e=ge+"crypto unavailable",Ce=Math.floor,Ie=Math.pow,Ee=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,xe=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ae=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Be=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,we=1e7,ve=7,_e=ye.length-1,Te=he.length-1,be={};be.absoluteValue=be.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),T(e)},be.ceil=function(){return T(new this.constructor(this),this.e+1,2)},be.comparedTo=be.cmp=function(e){var t,n,i=this,r=i.d,s=(e=new i.constructor(e)).d,o=i.s,a=e.s;if(!r||!s)return o&&a?o!==a?o:r===s?0:!r^o<0?1:-1:NaN;if(!r[0]||!s[0])return r[0]?o:s[0]?-a:0;if(o!==a)return o;if(i.e!==e.e)return i.e>e.e^o<0?1:-1;for(t=0,n=(i=r.length)<(e=s.length)?i:e;t<n;++t)if(r[t]!==s[t])return r[t]>s[t]^o<0?1:-1;return i===e?0:e<i^o<0?1:-1},be.cosine=be.cos=function(){var e,t,n=this,i=n.constructor;return n.d?n.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+ve,i.rounding=1,n=function(e,t){var n,i=(i=t.d.length)<32?(n=Math.ceil(i/3),Math.pow(4,-n).toString()):(n=16,"2.3283064365386962890625e-10");e.precision+=n,t=c(e,1,t.times(i),new e(1));for(var r=n;r--;){var s=t.times(t);t=s.times(s).minus(s).times(8).plus(1)}return e.precision-=n,t}(i,r(i,n)),i.precision=e,i.rounding=t,T(2==ue||3==ue?n.neg():n,e,t,!0)):new i(1):new i(NaN)},be.cubeRoot=be.cbrt=function(){var e,t,n,i,r,s,o,a,u,l,c=this,m=c.constructor;if(!c.isFinite()||c.isZero())return new m(c);for(fe=!1,(s=c.s*Math.pow(c.s*c,1/3))&&Math.abs(s)!=1/0?i=new m(s.toString()):(n=$(c.d),(s=((e=c.e)-n.length+1)%3)&&(n+=1==s||-2==s?"0":"00"),s=Math.pow(n,1/3),e=Ce((e+1)/3)-(e%3==(e<0?-1:2)),(i=new m(n=s==1/0?"5e"+e:(n=s.toExponential()).slice(0,n.indexOf("e")+1)+e)).s=c.s),o=(e=m.precision)+3;;)if(l=(u=(a=i).times(a).times(a)).plus(c),i=Re(l.plus(c).times(a),l.plus(u),o+2,1),$(a.d).slice(0,o)===(n=$(i.d)).slice(0,o)){if("9999"!=(n=n.slice(o-3,o+1))&&(r||"4999"!=n)){+n&&(+n.slice(1)||"5"!=n.charAt(0))||(T(i,e+1,1),t=!i.times(i).times(i).eq(c));break}if(!r&&(T(a,e+1,0),a.times(a).times(a).eq(c))){i=a;break}o+=4,r=1}return fe=!0,T(i,e,m.rounding,t)},be.decimalPlaces=be.dp=function(){var e,t=this.d,n=NaN;if(t){if(n=((e=t.length-1)-Ce(this.e/ve))*ve,e=t[e])for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},be.dividedBy=be.div=function(e){return Re(this,new this.constructor(e))},be.dividedToIntegerBy=be.divToInt=function(e){var t=this.constructor;return T(Re(this,new t(e),0,1,1),t.precision,t.rounding)},be.equals=be.eq=function(e){return 0===this.cmp(e)},be.floor=function(){return T(new this.constructor(this),this.e+1,3)},be.greaterThan=be.gt=function(e){return 0<this.cmp(e)},be.greaterThanOrEqualTo=be.gte=function(e){e=this.cmp(e);return 1==e||0===e},be.hyperbolicCosine=be.cosh=function(){var e,t,n,i,r=this,s=r.constructor,o=new s(1);if(!r.isFinite())return new s(r.s?1/0:NaN);if(r.isZero())return o;t=s.precision,n=s.rounding,s.precision=t+Math.max(r.e,r.sd())+4,s.rounding=1,i=(i=r.d.length)<32?(e=Math.ceil(i/3),Math.pow(4,-e).toString()):(e=16,"2.3283064365386962890625e-10"),r=c(s,1,r.times(i),new s(1),!0);for(var a,u=e,l=new s(8);u--;)a=r.times(r),r=o.minus(a.times(l.minus(a.times(l))));return T(r,s.precision=t,s.rounding=n,!0)},be.hyperbolicSine=be.sinh=function(){var e,t,n,i,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(t=s.precision,n=s.rounding,s.precision=t+Math.max(r.e,r.sd())+4,s.rounding=1,(i=r.d.length)<3)r=c(s,2,r,r,!0);else{e=16<(e=1.4*Math.sqrt(i))?16:0|e,r=c(s,2,r=r.times(Math.pow(5,-e)),r,!0);for(var o,a=new s(5),u=new s(16),l=new s(20);e--;)o=r.times(r),r=r.times(a.plus(o.times(u.times(o).plus(l))))}return T(r,s.precision=t,s.rounding=n,!0)},be.hyperbolicTangent=be.tanh=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+7,i.rounding=1,Re(n.sinh(),n.cosh(),i.precision=e,i.rounding=t)):new i(n.s)},be.inverseCosine=be.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),i=t.precision,r=t.rounding;return-1!==n?0===n?e.isNeg()?h(t,i,r):new t(0):new t(NaN):e.isZero()?h(t,i+4,r).times(.5):(t.precision=i+6,t.rounding=1,e=e.asin(),n=h(t,i+4,r).times(.5),t.precision=i,t.rounding=r,n.minus(e))},be.inverseHyperbolicCosine=be.acosh=function(){var e,t,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,fe=!1,n=n.times(n).minus(1).sqrt().plus(n),fe=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)},be.inverseHyperbolicSine=be.asinh=function(){var e,t,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,fe=!1,n=n.times(n).plus(1).sqrt().plus(n),fe=!0,i.precision=e,i.rounding=t,n.ln())},be.inverseHyperbolicTangent=be.atanh=function(){var e,t,n,i=this,r=i.constructor;return i.isFinite()?0<=i.e?new r(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=r.precision,t=r.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?T(new r(i),e,t,!0):(r.precision=n=n-i.e,i=Re(i.plus(1),new r(1).minus(i),n+e,1),r.precision=e+4,r.rounding=1,i=i.ln(),r.precision=e,r.rounding=t,i.times(.5))):new r(NaN)},be.inverseSine=be.asin=function(){var e,t,n,i=this,r=i.constructor;return i.isZero()?new r(i):(e=i.abs().cmp(1),t=r.precision,n=r.rounding,-1!==e?0===e?((e=h(r,t+4,n).times(.5)).s=i.s,e):new r(NaN):(r.precision=t+6,r.rounding=1,i=i.div(new r(1).minus(i.times(i)).sqrt().plus(1)).atan(),r.precision=t,r.rounding=n,i.times(2)))},be.inverseTangent=be.atan=function(){var e,t,n,i,r,s,o,a,u,l=this,c=l.constructor,m=c.precision,y=c.rounding;if(l.isFinite()){if(l.isZero())return new c(l);if(l.abs().eq(1)&&m+4<=Te)return(o=h(c,m+4,y).times(.25)).s=l.s,o}else{if(!l.s)return new c(NaN);if(m+4<=Te)return(o=h(c,m+4,y).times(.5)).s=l.s,o}for(c.precision=a=m+10,c.rounding=1,e=n=Math.min(28,a/ve+2|0);e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(fe=!1,t=Math.ceil(a/ve),i=1,u=l.times(l),o=new c(l),r=l;-1!==e;)if(r=r.times(u),s=o.minus(r.div(i+=2)),r=r.times(u),void 0!==(o=s.plus(r.div(i+=2))).d[t])for(e=t;o.d[e]===s.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),fe=!0,T(o,c.precision=m,c.rounding=y,!0)},be.isFinite=function(){return!!this.d},be.isInteger=be.isInt=function(){return!!this.d&&Ce(this.e/ve)>this.d.length-2},be.isNaN=function(){return!this.s},be.isNegative=be.isNeg=function(){return this.s<0},be.isPositive=be.isPos=function(){return 0<this.s},be.isZero=function(){return!!this.d&&0===this.d[0]},be.lessThan=be.lt=function(e){return this.cmp(e)<0},be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1},be.logarithm=be.log=function(e){var t,n,i,r,s,o,a,u,l=this,c=l.constructor,m=c.precision,y=c.rounding;if(null==e)e=new c(10),t=!0;else{if(n=(e=new c(e)).d,e.s<0||!n||!n[0]||e.eq(1))return new c(NaN);t=e.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new c(n&&!n[0]?-1/0:1!=l.s?NaN:n?0:1/0);if(t)if(1<n.length)s=!0;else{for(r=n[0];r%10==0;)r/=10;s=1!==r}if(fe=!1,o=E(l,a=m+5),i=t?I(c,a+10):E(e,a),C((u=Re(o,i,a,1)).d,r=m,y))do{if(o=E(l,a+=10),i=t?I(c,a+10):E(e,a),u=Re(o,i,a,1),!s){+$(u.d).slice(r+1,r+15)+1==1e14&&(u=T(u,m+1,0));break}}while(C(u.d,r+=10,y));return fe=!0,T(u,m,y)},be.minus=be.sub=function(e){var t,n,i,r,s,o,a,u,l,c,m,y=this,h=y.constructor;if(e=new h(e),!y.d||!e.d)return y.s&&e.s?y.d?e.s=-e.s:e=new h(e.d||y.s!==e.s?y:NaN):e=new h(NaN),e;if(y.s!=e.s)return e.s=-e.s,y.plus(e);if(l=y.d,m=e.d,a=h.precision,u=h.rounding,!l[0]||!m[0]){if(m[0])e.s=-e.s;else{if(!l[0])return new h(3===u?-0:0);e=new h(y)}return fe?T(e,a,u):e}if(n=Ce(e.e/ve),y=Ce(y.e/ve),l=l.slice(),s=y-n){for(o=(c=s<0)?(t=l,s=-s,m.length):(t=m,n=y,l.length),(i=Math.max(Math.ceil(a/ve),o)+2)<s&&(s=i,t.length=1),t.reverse(),i=s;i--;)t.push(0);t.reverse()}else{for((c=(i=l.length)<(o=m.length))&&(o=i),i=0;i<o;i++)if(l[i]!=m[i]){c=l[i]<m[i];break}s=0}for(c&&(t=l,l=m,m=t,e.s=-e.s),o=l.length,i=m.length-o;0<i;--i)l[o++]=0;for(i=m.length;s<i;){if(l[--i]<m[i]){for(r=i;r&&0===l[--r];)l[r]=we-1;--l[r],l[i]+=we}l[i]-=m[i]}for(;0===l[--o];)l.pop();for(;0===l[0];l.shift())--n;return l[0]?(e.d=l,e.e=S(l,n),fe?T(e,a,u):e):new h(3===u?-0:0)},be.modulo=be.mod=function(e){var t,n=this,i=n.constructor;return e=new i(e),!n.d||!e.s||e.d&&!e.d[0]?new i(NaN):!e.d||n.d&&!n.d[0]?T(new i(n),i.precision,i.rounding):(fe=!1,9==i.modulo?(t=Re(n,e.abs(),0,3,1)).s*=e.s:t=Re(n,e,0,i.modulo,1),t=t.times(e),fe=!0,n.minus(t))},be.naturalExponential=be.exp=function(){return y(this)},be.naturalLogarithm=be.ln=function(){return E(this)},be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s,T(e)},be.plus=be.add=function(e){var t,n,i,r,s,o,a,u,l=this,c=l.constructor;if(e=new c(e),!l.d||!e.d)return l.s&&e.s?l.d||(e=new c(e.d||l.s===e.s?l:NaN)):e=new c(NaN),e;if(l.s!=e.s)return e.s=-e.s,l.minus(e);if(a=l.d,u=e.d,s=c.precision,o=c.rounding,!a[0]||!u[0])return u[0]||(e=new c(l)),fe?T(e,s,o):e;if(c=Ce(l.e/ve),l=Ce(e.e/ve),a=a.slice(),i=c-l){for((r=(r=i<0?(n=a,i=-i,u.length):(n=u,l=c,a.length))<(c=Math.ceil(s/ve))?c+1:r+1)<i&&(i=r,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for((r=a.length)-(i=u.length)<0&&(i=r,n=u,u=a,a=n),t=0;i;)t=(a[--i]=a[i]+u[i]+t)/we|0,a[i]%=we;for(t&&(a.unshift(t),++l),r=a.length;0==a[--r];)a.pop();return e.d=a,e.e=S(a,l),fe?T(e,s,o):e},be.precision=be.sd=function(e){var t;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(Se+e);return this.d?(t=p(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},be.round=function(){var e=this.constructor;return T(new e(this),this.e+1,e.rounding)},be.sine=be.sin=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+ve,i.rounding=1,n=function(e,t){var n,i=t.d.length;if(i<3)return c(e,2,t,t);n=16<(n=1.4*Math.sqrt(i))?16:0|n,t=c(e,2,t=t.times(Math.pow(5,-n)),t);for(var r,s=new e(5),o=new e(16),a=new e(20);n--;)r=t.times(t),t=t.times(s.plus(r.times(o.times(r).minus(a))));return t}(i,r(i,n)),i.precision=e,i.rounding=t,T(2<ue?n.neg():n,e,t,!0)):new i(NaN)},be.squareRoot=be.sqrt=function(){var e,t,n,i,r,s,o=this,a=o.d,u=o.e,l=o.s,c=o.constructor;if(1!==l||!a||!a[0])return new c(!l||l<0&&(!a||a[0])?NaN:a?o:1/0);for(fe=!1,i=0==(l=Math.sqrt(+o))||l==1/0?(((t=$(a)).length+u)%2==0&&(t+="0"),l=Math.sqrt(t),u=Ce((u+1)/2)-(u<0||u%2),new c(t=l==1/0?"1e"+u:(t=l.toExponential()).slice(0,t.indexOf("e")+1)+u)):new c(l.toString()),n=(u=c.precision)+3;;)if(i=(s=i).plus(Re(o,s,n+2,1)).times(.5),$(s.d).slice(0,n)===(t=$(i.d)).slice(0,n)){if("9999"!=(t=t.slice(n-3,n+1))&&(r||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(T(i,u+1,1),e=!i.times(i).eq(o));break}if(!r&&(T(s,u+1,0),s.times(s).eq(o))){i=s;break}n+=4,r=1}return fe=!0,T(i,u,c.rounding,e)},be.tangent=be.tan=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,(n=n.sin()).s=1,n=Re(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,T(2==ue||4==ue?n.neg():n,e,t,!0)):new i(NaN)},be.times=be.mul=function(e){var t,n,i,r,s,o,a,u,l,c=this.constructor,m=this.d,y=(e=new c(e)).d;if(e.s*=this.s,!(m&&m[0]&&y&&y[0]))return new c(!e.s||m&&!m[0]&&!y||y&&!y[0]&&!m?NaN:m&&y?0*e.s:e.s/0);for(n=Ce(this.e/ve)+Ce(e.e/ve),(u=m.length)<(l=y.length)&&(s=m,m=y,y=s,o=u,u=l,l=o),s=[],i=o=u+l;i--;)s.push(0);for(i=l;0<=--i;){for(t=0,r=u+i;i<r;)a=s[r]+y[i]*m[r-i-1]+t,s[r--]=a%we|0,t=a/we|0;s[r]=(s[r]+t)%we|0}for(;!s[--o];)s.pop();for(t?++n:s.shift(),i=s.length;!s[--i];)s.pop();return e.d=s,e.e=S(s,n),fe?T(e,c.precision,c.rounding):e},be.toBinary=function(e,t){return n(this,2,e,t)},be.toDecimalPlaces=be.toDP=function(e,t){var n=this.constructor,i=new n(this);return void 0===e?i:(d(e,0,ce),void 0===t?t=n.rounding:d(t,0,8),T(i,e+i.e+1,t))},be.toExponential=function(e,t){var n=this,i=n.constructor,e=void 0===e?g(n,!0):(d(e,0,ce),void 0===t?t=i.rounding:d(t,0,8),g(n=T(new i(n),e+1,t),!0,e+1));return n.isNeg()&&!n.isZero()?"-"+e:e},be.toFixed=function(e,t){var n=this,i=n.constructor,r=void 0===e?g(n):(d(e,0,ce),void 0===t?t=i.rounding:d(t,0,8),g(r=T(new i(n),e+n.e+1,t),!1,e+r.e+1));return n.isNeg()&&!n.isZero()?"-"+r:r},be.toFraction=function(e){var t,n,i,r,s,o,a,u,l,c,m=this,y=m.d,h=m.constructor;if(!y)return new h(m);if(u=n=new h(1),i=a=new h(0),l=(s=(t=new h(i)).e=p(y)-m.e-1)%ve,t.d[0]=Ie(10,l<0?ve+l:l),null==e)e=0<s?t:u;else{if(!(o=new h(e)).isInt()||o.lt(u))throw Error(Se+o);e=o.gt(t)?0<s?t:u:o}for(fe=!1,o=new h($(y)),l=h.precision,h.precision=s=y.length*ve*2;c=Re(o,t,0,1,1),1!=(r=n.plus(c.times(i))).cmp(e);)n=i,i=r,r=u,u=a.plus(c.times(r)),a=r,r=t,t=o.minus(c.times(r)),o=r;return r=Re(e.minus(n),i,0,1,1),a=a.plus(r.times(u)),n=n.plus(r.times(i)),a.s=u.s=m.s,m=Re(u,i,s,1).minus(m).abs().cmp(Re(a,n,s,1).minus(m).abs())<1?[u,i]:[a,n],h.precision=l,fe=!0,m},be.toHexadecimal=be.toHex=function(e,t){return n(this,16,e,t)},be.toNearest=function(e,t){var n=(i=this).constructor,i=new n(i);if(null==e){if(!i.d)return i;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0!==t&&d(t,0,8),!i.d)return e.s?i:e;if(!e.d)return e.s&&(e.s=i.s),e}return e.d[0]?(fe=!1,t<4&&(t=[4,5,7,8][t]),i=Re(i,e,0,t,1).times(e),fe=!0,T(i)):(e.s=i.s,i=e),i},be.toNumber=function(){return+this},be.toOctal=function(e,t){return n(this,8,e,t)},be.toPower=be.pow=function(e){var t,n,i,r,s,o,a,u=this,l=u.constructor,c=+(e=new l(e));if(!(u.d&&e.d&&u.d[0]&&e.d[0]))return new l(Ie(+u,c));if((u=new l(u)).eq(1))return u;if(i=l.precision,s=l.rounding,e.eq(1))return T(u,i,s);if(t=Ce(e.e/ve),a=(n=e.d.length-1)<=t,o=u.s,a){if((n=c<0?-c:c)<=9007199254740991)return r=m(l,u,n,i),e.s<0?new l(1).div(r):T(r,i,s)}else if(o<0)return new l(NaN);return o=o<0&&1&e.d[Math.max(t,n)]?-1:1,(t=0!=(n=Ie(+u,c))&&isFinite(n)?new l(n+"").e:Ce(c*(Math.log("0."+$(u.d))/Math.LN10+u.e+1)))>l.maxE+1||t<l.minE-1?new l(0<t?o/0:0):(fe=!1,l.rounding=u.s=1,n=Math.min(12,(t+"").length),C((r=T(r=y(e.times(E(u,i+n)),i),i+5,1)).d,i,s)&&(t=i+10,+$((r=T(y(e.times(E(u,t+n)),t),t+5,1)).d).slice(i+1,i+15)+1==1e14&&(r=T(r,i+1,0))),r.s=o,fe=!0,T(r,i,l.rounding=s))},be.toPrecision=function(e,t){var n=this,i=n.constructor,e=void 0===e?g(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(d(e,1,ce),void 0===t?t=i.rounding:d(t,0,8),g(n=T(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e));return n.isNeg()&&!n.isZero()?"-"+e:e},be.toSignificantDigits=be.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(d(e,1,ce),void 0===t?t=n.rounding:d(t,0,8)),T(new n(this),e,t)},be.toString=function(){var e=this,t=e.constructor,t=g(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t},be.truncated=be.trunc=function(){return T(new this.constructor(this),this.e+1,1)},be.valueOf=be.toJSON=function(){var e=this,t=e.constructor,t=g(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+t:t};var Re=function(e,t,n,i,r,s){var o,a,u,l,c,m,y,h,d,f,g,S,p,$,C,I,E,x,A,B=e.constructor,w=e.s==t.s?1:-1,v=e.d,_=t.d;if(!(v&&v[0]&&_&&_[0]))return new B(e.s&&t.s&&(v?!_||v[0]!=_[0]:_)?v&&0==v[0]||!_?0*w:w/0:NaN);for(a=s?(c=1,e.e-t.e):(s=we,c=ve,Ce(e.e/c)-Ce(t.e/c)),x=_.length,I=v.length,d=(w=new B(w)).d=[],u=0;_[u]==(v[u]||0);u++);if(_[u]>(v[u]||0)&&a--,null==n?(p=n=B.precision,i=B.rounding):p=r?n+(e.e-t.e)+1:n,p<0)d.push(1),m=!0;else{if(p=p/c+2|0,u=0,1==x){for(_=_[l=0],p++;(u<I||l)&&p--;u++)$=l*s+(v[u]||0),d[u]=$/_|0,l=$%_|0;m=l||u<I}else{for(1<(l=s/(_[0]+1)|0)&&(_=De(_,l,s),v=De(v,l,s),x=_.length,I=v.length),C=x,g=(f=v.slice(0,x)).length;g<x;)f[g++]=0;for(A=_.slice(),A.unshift(0),E=_[0],_[1]>=s/2&&++E;l=0,o=Ne(_,f,x,g),o<0?(S=f[0],x!=g&&(S=S*s+(f[1]||0)),l=S/E|0,1<l?(s<=l&&(l=s-1),y=De(_,l,s),h=y.length,g=f.length,o=Ne(y,f,h,g),1==o&&(l--,Oe(y,x<h?A:_,h,s))):(0==l&&(o=l=1),y=_.slice()),h=y.length,h<g&&y.unshift(0),Oe(f,y,g,s),-1==o&&(g=f.length,o=Ne(_,f,x,g),o<1&&(l++,Oe(f,x<g?A:_,g,s))),g=f.length):0===o&&(l++,f=[0]),d[u++]=l,o&&f[0]?f[g++]=v[C]||0:(f=[v[C]],g=1),(C++<I||void 0!==f[0])&&p--;);m=void 0!==f[0]}d[0]||d.shift()}if(1==c)w.e=a,ae=m;else{for(u=1,l=d[0];10<=l;l/=10)u++;w.e=u+a*c-1,T(w,r?n+w.e+1:n,i,m)}return w};function De(e,t,n){var i,r=0,s=e.length;for(e=e.slice();s--;)i=e[s]*t+r,e[s]=i%n|0,r=i/n|0;return r&&e.unshift(r),e}function Ne(e,t,n,i){var r,s;if(n!=i)s=i<n?1:-1;else for(r=s=0;r<n;r++)if(e[r]!=t[r]){s=e[r]>t[r]?1:-1;break}return s}function Oe(e,t,n,i){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=r*i+e[n]-t[n];for(;!e[0]&&1<e.length;)e.shift()}de=function e(t){function s(e){var t,n,i,r=this;if(!(r instanceof s))return new s(e);if(e instanceof(r.constructor=s))return r.s=e.s,r.e=e.e,void(r.d=(e=e.d)?e.slice():e);if("number"==(i=typeof e)){if(0===e)return r.s=1/e<0?-1:1,r.e=0,void(r.d=[0]);if(e<0?(e=-e,r.s=-1):r.s=1,e===~~e&&e<1e7){for(t=0,n=e;10<=n;n/=10)t++;return r.e=t,void(r.d=[e])}return 0*e!=0?(e||(r.s=NaN),r.e=NaN,void(r.d=null)):o(r,e.toString())}if("string"!=i)throw Error(Se+e);return 45===e.charCodeAt(0)?(e=e.slice(1),r.s=-1):r.s=1,(Be.test(e)?o:function(e,t){var n,i,r,s,o,a,u,l;if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(xe.test(t))l=16,t=t.toLowerCase();else if(Ee.test(t))l=2;else{if(!Ae.test(t))throw Error(Se+t);l=8}for(s=0<=(r=(t=0<(r=t.search(/p/i))?(a=+t.slice(r+1),t.substring(2,r)):t.slice(2)).indexOf(".")),n=e.constructor,s&&(r=(o=(t=t.replace(".","")).length)-r,i=m(n,new n(l),r,2*r)),r=l=(u=f(t,l,we)).length-1;0===u[r];--r)u.pop();return r<0?new n(0*e.s):(e.e=S(u,l),e.d=u,fe=!1,s&&(e=Re(e,i,4*o)),a&&(e=e.times((Math.abs(a)<54?Math:de).pow(2,a))),fe=!0,e)})(r,e)}var n,i,r;if(s.prototype=be,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.EUCLID=9,s.config=s.set=k,s.clone=e,s.abs=l,s.acos=A,s.acosh=B,s.add=w,s.asin=v,s.asinh=_,s.atan=b,s.atanh=R,s.atan2=D,s.cbrt=N,s.ceil=O,s.cos=G,s.cosh=F,s.div=P,s.exp=L,s.floor=V,s.hypot=M,s.ln=z,s.log=q,s.log10=U,s.log2=H,s.max=W,s.min=K,s.mod=j,s.mul=J,s.pow=Z,s.random=Y,s.round=X,s.sign=Q,s.sin=ee,s.sinh=te,s.sqrt=ne,s.sub=ie,s.tan=re,s.tanh=se,s.trunc=oe,void 0===t&&(t={}),t)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],n=0;n<r.length;)t.hasOwnProperty(i=r[n++])||(t[i]=this[i]);return s.config(t),s}(de),ye=new de(ye),he=new de(he),Bridge.$Decimal=de,"function"==typeof define&&define.amd?define("decimal.js",function(){return de}):"undefined"!=typeof module&&module.exports?module.exports=de.default=de.Decimal=de:(e=e||("undefined"!=typeof self&&self&&self.self==self?self:Function("return this")()),i=e.Decimal,de.noConflict=function(){return e.Decimal=i,de})}(Bridge.global),System.Decimal=function(e,t,n){if(this.constructor!==System.Decimal)return new System.Decimal(e,t,n);if(null==e&&(e=0),Bridge.isNumber(t)?(this.$precision=t,t=void 0):this.$precision=0,"string"==typeof e){t=(t=t||System.Globalization.CultureInfo.getCurrentCulture())&&t.getFormat(System.Globalization.NumberFormatInfo);if(t&&"."!==t.numberDecimalSeparator&&(e=e.replace(t.numberDecimalSeparator,".")),!/^\s*[+-]?(\d+|\d+\.|\d*\.\d+)((e|E)[+-]?\d+)?\s*$/.test(e)&&!/^\s*(\d+|\d+\.|\d*\.\d+)((e|E)[+-]?\d+)?[+-]\s*$/.test(e))throw new System.FormatException;e=e.replace(/\s/g,""),/[+-]$/.test(e)?(t=e.length-1,e=e.indexOf("-",t)===t?e.replace(/(.*)(-)$/,"$2$1"):e.substr(0,t)):0===e.lastIndexOf("+",0)&&(e=e.substr(1)),!this.$precision&&0<=(i=e.indexOf("."))&&(this.$precision=e.length-i-1)}if(isNaN(e)||System.Decimal.MaxValue&&"number"==typeof e&&(System.Decimal.MinValue.gt(e)||System.Decimal.MaxValue.lt(e)))throw new System.OverflowException;var i;n&&n.precision&&"number"==typeof e&&Number.isFinite(e)&&(i=(Bridge.Int.trunc(e)+"").length,(i=n.precision-i)<0&&(i=0),e=e.toFixed(i)),e instanceof System.Decimal&&(this.$precision=e.$precision),this.value=System.Decimal.getValue(e)},System.Decimal.$number=!0,System.Decimal.$$name="System.Decimal",System.Decimal.prototype.$$name="System.Decimal",System.Decimal.$kind="struct",System.Decimal.prototype.$kind="struct",System.Decimal.$$inherits=[],Bridge.Class.addExtend(System.Decimal,[System.IComparable,System.IFormattable,System.IComparable$1(System.Decimal),System.IEquatable$1(System.Decimal)]),System.Decimal.$is=function(e){return e instanceof System.Decimal},System.Decimal.getDefaultValue=function(){return new System.Decimal(0)},System.Decimal.getValue=function(e){return Bridge.hasValue(e)?e instanceof System.Decimal?e.value:e instanceof System.Int64||e instanceof System.UInt64?new Bridge.$Decimal(e.toString()):new Bridge.$Decimal(e):this.getDefaultValue()},System.Decimal.create=function(e){return Bridge.hasValue(e)?e instanceof System.Decimal?e:new System.Decimal(e):null},System.Decimal.lift=function(e){return null==e?null:System.Decimal.create(e)},System.Decimal.prototype.toString=function(e,t){return Bridge.Int.format(this,e||"G",t)},System.Decimal.prototype.toFloat=function(){return this.value.toNumber()},System.Decimal.prototype.toJSON=function(){return this.value.toNumber()},System.Decimal.prototype.format=function(e,t){return Bridge.Int.format(this,e,t)},System.Decimal.prototype.decimalPlaces=function(){return this.value.decimalPlaces()},System.Decimal.prototype.dividedToIntegerBy=function(e){return(e=new System.Decimal(this.value.dividedToIntegerBy(System.Decimal.getValue(e)),this.$precision)).$precision=Math.max(e.value.decimalPlaces(),this.$precision),e},System.Decimal.prototype.exponential=function(){return new System.Decimal(this.value.exponential(),this.$precision)},System.Decimal.prototype.abs=function(){return new System.Decimal(this.value.abs(),this.$precision)},System.Decimal.prototype.floor=function(){return new System.Decimal(this.value.floor())},System.Decimal.prototype.ceil=function(){return new System.Decimal(this.value.ceil())},System.Decimal.prototype.trunc=function(){return new System.Decimal(this.value.trunc())},System.Decimal.round=function(e,t){e=System.Decimal.create(e);var n=Bridge.$Decimal.rounding;Bridge.$Decimal.rounding=t;e=new System.Decimal(e.value.round());return Bridge.$Decimal.rounding=n,e},System.Decimal.toDecimalPlaces=function(e,t,n){return e=System.Decimal.create(e),new System.Decimal(e.value.toDecimalPlaces(t,n))},System.Decimal.prototype.compareTo=function(e){return this.value.comparedTo(System.Decimal.getValue(e))},System.Decimal.prototype.add=function(e){var t=new System.Decimal(this.value.plus(System.Decimal.getValue(e)));return t.$precision=Math.max(t.value.decimalPlaces(),Math.max(e.$precision||0,this.$precision)),t},System.Decimal.prototype.sub=function(e){var t=new System.Decimal(this.value.minus(System.Decimal.getValue(e)));return t.$precision=Math.max(t.value.decimalPlaces(),Math.max(e.$precision||0,this.$precision)),t},System.Decimal.prototype.isZero=function(){return this.value.isZero},System.Decimal.prototype.mul=function(e){var t=new System.Decimal(this.value.times(System.Decimal.getValue(e)));return t.$precision=Math.max(t.value.decimalPlaces(),Math.max(e.$precision||0,this.$precision)),t},System.Decimal.prototype.div=function(e){var t=new System.Decimal(this.value.dividedBy(System.Decimal.getValue(e)));return t.$precision=Math.max(t.value.decimalPlaces(),Math.max(e.$precision||0,this.$precision)),t},System.Decimal.prototype.mod=function(e){var t=new System.Decimal(this.value.modulo(System.Decimal.getValue(e)));return t.$precision=Math.max(t.value.decimalPlaces(),Math.max(e.$precision||0,this.$precision)),t},System.Decimal.prototype.neg=function(){return new System.Decimal(this.value.negated(),this.$precision)},System.Decimal.prototype.inc=function(){return new System.Decimal(this.value.plus(System.Decimal.getValue(1)),this.$precision)},System.Decimal.prototype.dec=function(){return new System.Decimal(this.value.minus(System.Decimal.getValue(1)),this.$precision)},System.Decimal.prototype.sign=function(){return this.value.isZero()?0:this.value.isNegative()?-1:1},System.Decimal.prototype.clone=function(){return new System.Decimal(this,this.$precision)},System.Decimal.prototype.ne=function(e){return!!this.compareTo(e)},System.Decimal.prototype.lt=function(e){return this.compareTo(e)<0},System.Decimal.prototype.lte=function(e){return this.compareTo(e)<=0},System.Decimal.prototype.gt=function(e){return 0<this.compareTo(e)},System.Decimal.prototype.gte=function(e){return 0<=this.compareTo(e)},System.Decimal.prototype.equals=function(e){return(e instanceof System.Decimal||"number"==typeof e)&&!this.compareTo(e)},System.Decimal.prototype.equalsT=function(e){return!this.compareTo(e)},System.Decimal.prototype.getHashCode=function(){for(var e=397*this.sign()+this.value.e|0,t=0;t<this.value.d.length;t++)e=397*e+this.value.d[t]|0;return e},System.Decimal.toInt=function(e,t){if(!e)return null;if(t){var n,i;if(t===System.Int64){if((n=e.value.trunc().toString())!==(i=new System.Int64(n)).value.toString())throw new System.OverflowException;return i}if(t!==System.UInt64)return Bridge.Int.check(Bridge.Int.trunc(e.value.toNumber()),t);if(e.value.isNegative())throw new System.OverflowException;if((n=e.value.trunc().toString())!==(i=new System.UInt64(n)).value.toString())throw new System.OverflowException;return i}e=Bridge.Int.trunc(System.Decimal.getValue(e).toNumber());if(!Bridge.Int.$is(e))throw new System.OverflowException;return e},System.Decimal.tryParse=function(e,t,n){try{return n.v=new System.Decimal(e,t),!0}catch(e){return n.v=new System.Decimal(0),!1}},System.Decimal.toFloat=function(e){return e?System.Decimal.getValue(e).toNumber():null},System.Decimal.setConfig=function(e){Bridge.$Decimal.config(e)},System.Decimal.min=function(){for(var e,t,n=[],i=0,r=arguments.length;i<r;i++)n.push(System.Decimal.getValue(arguments[i]));e=Bridge.$Decimal.min.apply(Bridge.$Decimal,n);for(i=0;i<arguments.length;i++)e.eq(n[i])&&(t=arguments[i].$precision);return new System.Decimal(e,t)},System.Decimal.max=function(){for(var e,t,n=[],i=0,r=arguments.length;i<r;i++)n.push(System.Decimal.getValue(arguments[i]));e=Bridge.$Decimal.max.apply(Bridge.$Decimal,n);for(i=0;i<arguments.length;i++)e.eq(n[i])&&(t=arguments[i].$precision);return new System.Decimal(e,t)},System.Decimal.random=function(e){return new System.Decimal(Bridge.$Decimal.random(e))},System.Decimal.exp=function(e){return new System.Decimal(System.Decimal.getValue(e).exp())},System.Decimal.exp=function(e){return new System.Decimal(System.Decimal.getValue(e).exp())},System.Decimal.ln=function(e){return new System.Decimal(System.Decimal.getValue(e).ln())},System.Decimal.log=function(e,t){return new System.Decimal(System.Decimal.getValue(e).log(t))},System.Decimal.pow=function(e,t){return new System.Decimal(System.Decimal.getValue(e).pow(t))},System.Decimal.sqrt=function(e){return new System.Decimal(System.Decimal.getValue(e).sqrt())},System.Decimal.prototype.isFinite=function(){return this.value.isFinite()},System.Decimal.prototype.isInteger=function(){return this.value.isInteger()},System.Decimal.prototype.isNaN=function(){return this.value.isNaN()},System.Decimal.prototype.isNegative=function(){return this.value.isNegative()},System.Decimal.prototype.isZero=function(){return this.value.isZero()},System.Decimal.prototype.log=function(e){e=new System.Decimal(this.value.log(e));return e.$precision=Math.max(e.value.decimalPlaces(),this.$precision),e},System.Decimal.prototype.ln=function(){var e=new System.Decimal(this.value.ln());return e.$precision=Math.max(e.value.decimalPlaces(),this.$precision),e},System.Decimal.prototype.precision=function(){return this.value.precision()},System.Decimal.prototype.round=function(){var e,t=Bridge.$Decimal.rounding;return Bridge.$Decimal.rounding=6,e=new System.Decimal(this.value.round()),Bridge.$Decimal.rounding=t,e},System.Decimal.prototype.sqrt=function(){var e=new System.Decimal(this.value.sqrt());return e.$precision=Math.max(e.value.decimalPlaces(),this.$precision),e},System.Decimal.prototype.toDecimalPlaces=function(e,t){return new System.Decimal(this.value.toDecimalPlaces(e,t))},System.Decimal.prototype.toExponential=function(e,t){return this.value.toExponential(e,t)},System.Decimal.prototype.toFixed=function(e,t){return this.value.toFixed(e,t)},System.Decimal.prototype.pow=function(e){e=new System.Decimal(this.value.pow(e));return e.$precision=Math.max(e.value.decimalPlaces(),this.$precision),e},System.Decimal.prototype.toPrecision=function(e,t){return this.value.toPrecision(e,t)},System.Decimal.prototype.toSignificantDigits=function(e,t){t=new System.Decimal(this.value.toSignificantDigits(e,t));return t.$precision=Math.max(t.value.decimalPlaces(),this.$precision),t},System.Decimal.prototype.valueOf=function(){return this.value.valueOf()},System.Decimal.prototype._toFormat=function(e,t,n){var i=this.value;if(!i.isFinite())return i.toString();var r,s=i.isNeg(),o=n.groupSeparator,a=+n.groupSize,u=+n.secondaryGroupSize,t=i.toFixed(e,t).split("."),l=t[0],t=t[1],c=s?l.slice(1):l,m=c.length;if(u&&(m-=(r=a,a=u,u=r)),0<a&&0<m){for(r=m%a||a,l=c.substr(0,r);r<m;r+=a)l+=o+c.substr(r,a);0<u&&(l+=o+c.slice(r)),s&&(l="-"+l)}return t?l+n.decimalSeparator+((u=+n.fractionGroupSize)?t.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+n.fractionGroupSeparator):t):l},System.Decimal.prototype.toFormat=function(e,t,n){var i={decimalSeparator:".",groupSeparator:",",groupSize:3,secondaryGroupSize:0,fractionGroupSeparator:" ",fractionGroupSize:0},i=(n&&!n.getFormat?i=Bridge.merge(i,n):(n=(n=n||System.Globalization.CultureInfo.getCurrentCulture())&&n.getFormat(System.Globalization.NumberFormatInfo))&&(i.decimalSeparator=n.numberDecimalSeparator,i.groupSeparator=n.numberGroupSeparator,i.groupSize=n.numberGroupSizes[0]),this._toFormat(e,t,i));return i},System.Decimal.prototype.getBytes=function(){var e=this.value.s,t=this.value.e,n=this.value.d,i=System.Array.init(23,0,System.Byte);if(i[0]=255&e,i[1]=t,n&&0<n.length){i[2]=4*n.length;for(var r=0;r<n.length;r++)i[4*r+3]=255&n[r],i[4*r+4]=n[r]>>8&255,i[4*r+5]=n[r]>>16&255,i[4*r+6]=n[r]>>24&255}else i[2]=0;return i},System.Decimal.fromBytes=function(e){var t=new System.Decimal(0),n=Bridge.Int.sxb(255&e[0]),i=e[1],r=e[2],s=[];if(t.value.s=n,t.value.e=i,0<r)for(var o=3;o<r+3;)s.push(e[o]|e[o+1]<<8|e[o+2]<<16|e[o+3]<<24),o+=4;return t.value.d=s,t},Bridge.$Decimal.config({precision:29}),System.Decimal.Zero=System.Decimal(0),System.Decimal.One=System.Decimal(1),System.Decimal.MinusOne=System.Decimal(-1),System.Decimal.MinValue=System.Decimal("-79228162514264337593543950335"),System.Decimal.MaxValue=System.Decimal("79228162514264337593543950335"),System.Decimal.precision=29,Bridge.define("System.DateTime",{inherits:function(){return[System.IComparable,System.IComparable$1(System.DateTime),System.IEquatable$1(System.DateTime),System.IFormattable]},$kind:"struct",fields:{kind:0},methods:{$clone:function(e){return this}},statics:{$minTicks:null,$maxTicks:null,$minOffset:null,$maxOffset:null,$default:null,$min:null,$max:null,TicksPerDay:System.Int64(864e9),DaysTo1970:719162,YearDaysByMonth:[0,31,59,90,120,151,181,212,243,273,304,334],getMinTicks:function(){return null===this.$minTicks&&(this.$minTicks=System.Int64(0)),this.$minTicks},getMaxTicks:function(){return null===this.$maxTicks&&(this.$maxTicks=System.Int64("3652059").mul(this.TicksPerDay).sub(1)),this.$maxTicks},$getMinOffset:function(){return null===this.$minOffset&&(this.$minOffset=System.Int64(621355968e9)),this.$minOffset},$getMaxOffset:function(){return null===this.$maxOffset&&(this.$maxOffset=this.getMaxTicks().sub(this.$getMinOffset())),this.$maxOffset},$is:function(e){return Bridge.isDate(e)},getDefaultValue:function(){return null===this.$default&&(this.$default=this.getMinValue()),this.$default},getMinValue:function(){var e;return null===this.$min&&((e=new Date(1,0,1,0,0,0,0)).setFullYear(1),e.setSeconds(0),e.kind=0,e.ticks=this.getMinTicks(),this.$min=e),this.$min},getMaxValue:function(){var e;return null===this.$max&&((e=new Date(9999,11,31,23,59,59,999)).kind=0,e.ticks=this.getMaxTicks(),this.$max=e),this.$max},$getTzOffset:function(e){return System.Int64(e.getTimezoneOffset()).mul(6e8)},toLocalTime:function(e,t){var n,i=void 0!==e.kind?e.kind:0,r=this.getTicks(e);if(2===i)return(n=new Date(e.getTime())).kind=2,n.ticks=r,n;if((n=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()))).kind=2,n.ticks=r,n.ticks.gt(this.getMaxTicks())||n.ticks.lt(0)){if(t&&!0===t)throw new System.ArgumentException.$ctor1("Specified argument was out of the range of valid values.");n=this.create$2(r.add(this.$getTzOffset(n)),2)}return n},toUniversalTime:function(e){var t,n=void 0!==e.kind?e.kind:0,i=this.getTicks(e);return 1===n?((t=new Date(e.getTime())).kind=1,t.ticks=i):((t=new Date(Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()))).kind=1,t.ticks=i,(t.ticks.gt(this.getMaxTicks())||t.ticks.lt(0))&&(t=this.create$2(i.add(this.$getTzOffset(t)),1))),t},getTicks:function(e){if(e.ticks)return e.ticks;var t=void 0!==e.kind?e.kind:0;return e.ticks=1===t?System.Int64(e.getTime()).mul(1e4).add(this.$getMinOffset()):System.Int64(e.getTime()).mul(1e4).add(this.$getMinOffset()).sub(this.$getTzOffset(e)),e.ticks},create:function(e,t,n,i,r,s,o,a){var u;return e=void 0!==e?e:(new Date).getFullYear(),t=void 0!==t?t:(new Date).getMonth()+1,n=void 0!==n?n:1,i=void 0!==i?i:0,r=void 0!==r?r:0,s=void 0!==s?s:0,o=void 0!==o?o:0,1===(a=void 0!==a?a:0)?(u=new Date(Date.UTC(e,t-1,n,i,r,s,o))).setUTCFullYear(e):(u=new Date(e,t-1,n,i,r,s,o)).setFullYear(e),u.kind=a,u.ticks=this.getTicks(u),u},create$2:function(e,t){var n;return(e=System.Int64.is64Bit(e)?e:System.Int64(e)).lt(this.TicksPerDay)?((n=new Date(0)).setMilliseconds(n.getMilliseconds()+this.$getTzOffset(n).div(1e4).toNumber()),n.setFullYear(1)):(n=new Date(e.sub(this.$getMinOffset()).div(1e4).toNumber()),1!==t&&n.setTime(n.getTime()+6e4*n.getTimezoneOffset())),n.kind=void 0!==t?t:0,n.ticks=e,n},getToday:function(){var e=this.getNow();return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e},getNow:function(){var e=new Date;return e.kind=2,e},getUtcNow:function(){var e=new Date;return e.kind=1,e},getTimeOfDay:function(e){var t=this.getDate(e);return new System.TimeSpan(1e4*(e-t))},getKind:function(e){return e.kind=void 0!==e.kind?e.kind:0,e.kind},specifyKind:function(e,t){var n=new Date(e.getTime());return n.kind=t,n.ticks=void 0!==e.ticks?e.ticks:this.getTicks(n),n},$FileTimeOffset:System.Int64("584388").mul(System.Int64(864e9)),FromFileTime:function(e){return this.toLocalTime(this.FromFileTimeUtc(e))},FromFileTimeUtc:function(e){return e=System.Int64.is64Bit(e)?e:System.Int64(e),this.create$2(e.add(this.$FileTimeOffset),1)},ToFileTime:function(e){return this.ToFileTimeUtc(this.toUniversalTime(e))},ToFileTimeUtc:function(e){return 0!==this.getKind(e)?this.getTicks(this.toUniversalTime(e)):this.getTicks(e)},isUseGenitiveForm:function(e,t,n,i){for(var r=0,s=t-1;0<=s&&e[s]!==i;s--);if(0<=s){for(;0<=--s&&e[s]===i;)r++;if(r<=1)return!0}for(s=t+n;s<e.length&&e[s]!==i;s++);if(s<e.length){for(r=0;++s<e.length&&e[s]===i;)r++;if(r<=1)return!0}return!1},format:function(e,o,t){var a=this,u=e.kind||0,n=1===u||-1<["u","r","R"].indexOf(o),l=(t||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.DateTimeFormatInfo),c=n?e.getUTCFullYear():e.getFullYear(),m=n?e.getUTCMonth():e.getMonth(),y=n?e.getUTCDate():e.getDate(),h=n?e.getUTCDay():e.getDay(),d=n?e.getUTCHours():e.getHours(),f=n?e.getUTCMinutes():e.getMinutes(),g=n?e.getUTCSeconds():e.getSeconds(),S=n?e.getUTCMilliseconds():e.getMilliseconds(),p=e.getTimezoneOffset();1===(o=o||"G").length?(e=l.getAllDateTimePatterns(o,!0),o=e?e[0]:o):2===o.length&&"%"===o.charAt(0)&&(o=o.charAt(1));var $=!1;return o=o.replace(/(\\.|'[^']*'|"[^"]*"|d{1,4}|M{1,4}|yyyy|yy|y|HH?|hh?|mm?|ss?|tt?|u|f{1,7}|F{1,7}|K|z{1,3}|\:|\/)/g,function(e,t,n){var i=e;switch(e){case"dddd":i=l.dayNames[h];break;case"ddd":i=l.abbreviatedDayNames[h];break;case"dd":i=y<10?"0"+y:y;break;case"d":i=y;break;case"MMMM":i=(a.isUseGenitiveForm(o,n,4,"d")?l.monthGenitiveNames:l.monthNames)[m];break;case"MMM":i=(a.isUseGenitiveForm(o,n,3,"d")?l.abbreviatedMonthGenitiveNames:l.abbreviatedMonthNames)[m];break;case"MM":i=m+1<10?"0"+(m+1):m+1;break;case"M":i=m+1;break;case"yyyy":i=("0000"+c).substring(c.toString().length);break;case"yy":1===(i=(c%100).toString()).length&&(i="0"+i);break;case"y":i=c%100;break;case"h":case"hh":(i=d%12)?"hh"===e&&1===i.length&&(i="0"+i):i="12";break;case"HH":1===(i=d.toString()).length&&(i="0"+i);break;case"H":i=d;break;case"mm":1===(i=f.toString()).length&&(i="0"+i);break;case"m":i=f;break;case"ss":1===(i=g.toString()).length&&(i="0"+i);break;case"s":i=g;break;case"t":case"tt":i=d<12?l.amDesignator:l.pmDesignator,"t"===e&&(i=i.charAt(0));break;case"F":case"FF":case"FFF":case"FFFF":case"FFFFF":case"FFFFFF":case"FFFFFFF":(i=S.toString()).length<3&&(i=Array(4-i.length).join("0")+i);for(var r=(i=i.substr(0,e.length)).length-1;0<=r&&"0"===i.charAt(r);r--);i=i.substring(0,r+1),$=0==i.length;break;case"f":case"ff":case"fff":case"ffff":case"fffff":case"ffffff":case"fffffff":(i=S.toString()).length<3&&(i=Array(4-i.length).join("0")+i);var s="u"===e?7:e.length;i.length<s&&(i+=Array(8-i.length).join("0")),i=i.substr(0,s);break;case"z":i=(0<=(i=p/60)?"-":"+")+Math.floor(Math.abs(i));break;case"K":case"zz":case"zzz":0===u?i="":1===u?i="Z":(i=(0<(i=p/60)?"-":"+")+System.String.alignString(Math.floor(Math.abs(i)).toString(),2,"0",2),"zzz"!==e&&"K"!==e||(i+=l.timeSeparator+System.String.alignString(Math.floor(Math.abs(p%60)).toString(),2,"0",2)));break;case":":i=l.timeSeparator;break;case"/":i=l.dateSeparator;break;default:i=e.substr(1,e.length-1-("\\"!==e.charAt(0)))}return i}),$&&(System.String.endsWith(o,".")?o=o.substring(0,o.length-1):System.String.endsWith(o,".Z")?o=o.substring(0,o.length-2)+"Z":2===u&&null!==o.match(/\.([+-])/g)&&(o=o.replace(/\.([+-])/g,"$1"))),o},parse:function(e,t,n,i){n=this.parseExact(e,null,t,n,!0);if(null!==n)return n;if(n=Date.parse(e),!isNaN(n))return new Date(n);if(!i)throw new System.FormatException.$ctor1("String does not contain a valid string representation of a date and time.")},parseExact:function(e,t,n,i,r){if(t=t||["G","g","F","f","D","d","R","r","s","S","U","u","O","o","Y","y","M","m","T","t"],Bridge.isArray(t)){for(var s=0;s<t.length;s++)if(null!=(G=this.parseExact(e,t[s],n,i,!0)))return G;if(r)return null;throw new System.FormatException.$ctor1("String does not contain a valid string representation of a date and time.")}t=t.replace("'Z'","Z");var o,a,u,l,c,m,y,h=new Date,d=(n||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.DateTimeFormatInfo),f=d.amDesignator,g=d.pmDesignator,S=0,p=0,$=0,C=h.getFullYear(),I=h.getMonth()+1,E=h.getDate(),x=0,A=0,B=0,w=0,v="",_=0,T=!1,b=!1,R=0,D=!1,N=0;if(null==e)throw new System.ArgumentNullException.$ctor1("str");for(1===(t=t||"G").length?t=(h=d.getAllDateTimePatterns(t,!0))?h[0]:t:2===t.length&&"%"===t.charAt(0)&&(t=t.charAt(1));p<t.length;){if(o=t.charAt(p),a="","\\"===b)a+=o,p++;else{var O=t.charAt(p+1);for("."!==o||e.charAt(S)===o||"F"!==O&&"f"!==O||(p++,o=O);t.charAt(p)===o&&p<t.length;)a+=o,p++}if(O=!0,!b)if("yyyy"===a||"yy"===a||"y"===a){if("yyyy"===a?C=this.subparseInt(e,S,4,4):"yy"===a?C=this.subparseInt(e,S,2,2):"y"===a&&(C=this.subparseInt(e,S,2,4)),null==C){T=!0;break}S+=C.length,2===C.length&&(C=(30<(C=~~C)?1900:2e3)+C)}else if("MMM"===a||"MMMM"===a){for(I=0,m="MMM"===a?this.isUseGenitiveForm(t,p,3,"d")?d.abbreviatedMonthGenitiveNames:d.abbreviatedMonthNames:this.isUseGenitiveForm(t,p,4,"d")?d.monthGenitiveNames:d.monthNames,$=0;$<m.length;$++)if(y=m[$],e.substring(S,S+y.length).toLowerCase()===y.toLowerCase()){I=$%12+1,S+=y.length;break}if(I<1||12<I){T=!0;break}}else if("MM"===a||"M"===a){if(null==(I=this.subparseInt(e,S,a.length,2))||I<1||12<I){T=!0;break}S+=I.length}else if("dddd"===a||"ddd"===a){for(m="ddd"===a?d.abbreviatedDayNames:d.dayNames,$=0;$<m.length;$++)if(y=m[$],e.substring(S,S+y.length).toLowerCase()===y.toLowerCase()){S+=y.length;break}}else if("dd"===a||"d"===a){if(null==(E=this.subparseInt(e,S,a.length,2))||E<1||31<E){T=!0;break}S+=E.length}else if("hh"===a||"h"===a){if(null==(x=this.subparseInt(e,S,a.length,2))||x<1||12<x){T=!0;break}S+=x.length}else if("HH"===a||"H"===a){if(null==(x=this.subparseInt(e,S,a.length,2))||x<0||23<x){T=!0;break}S+=x.length}else if("mm"===a||"m"===a){if(null==(A=this.subparseInt(e,S,a.length,2))||A<0||59<A)return null;S+=A.length}else if("ss"===a||"s"===a){if(null==(B=this.subparseInt(e,S,a.length,2))||B<0||59<B){T=!0;break}S+=B.length}else if("u"===a){if(null==(w=this.subparseInt(e,S,1,7))){T=!0;break}S+=w.length,3<w.length&&(w=w.substring(0,3))}else if(null!==a.match(/f{1,7}/)){if(null==(w=this.subparseInt(e,S,a.length,7))){T=!0;break}S+=w.length,3<w.length&&(w=w.substring(0,3))}else if(null!==a.match(/F{1,7}/))null!==(w=this.subparseInt(e,S,0,7))&&(S+=w.length,3<w.length&&(w=w.substring(0,3)));else if("t"===a){if(e.substring(S,S+1).toLowerCase()===f.charAt(0).toLowerCase())v=f;else{if(e.substring(S,S+1).toLowerCase()!==g.charAt(0).toLowerCase()){T=!0;break}v=g}S+=1}else if("tt"===a){if(e.substring(S,S+2).toLowerCase()===f.toLowerCase())v=f;else{if(e.substring(S,S+2).toLowerCase()!==g.toLowerCase()){T=!0;break}v=g}S+=2}else if("z"===a||"zz"===a){if("-"===(l=e.charAt(S)))c=!0;else{if("+"!==l){T=!0;break}c=!1}if(S++,null==(_=this.subparseInt(e,S,1,2))||14<_){T=!0;break}S+=_.length,N=60*_*60*1e3,c&&(N=-N)}else{if("Z"===a){var k=e.substring(S,S+1);"Z"===k||"z"===k?S+=R=1:T=!0;break}if("zzz"===a||"K"===a){if("Z"===e.substring(S,S+1)){R=2,D=!0,S+=1;break}if(""===(y=e.substring(S,S+6))){R=0;break}if(S+=y.length,6!==y.length&&5!==y.length){T=!0;break}if("-"===(l=y.charAt(0)))c=!0;else{if("+"!==l){T=!0;break}c=!1}if(k=1,null==(_=this.subparseInt(y,1,1,6===y.length?2:1))||14<_){T=!0;break}if(k+=_.length,y.charAt(k)!==d.timeSeparator){T=!0;break}if(k++,null==(u=this.subparseInt(y,k,1,2))||59<_){T=!0;break}N=60*_*60*1e3+60*u*1e3,c&&(N=-N),R=2}else O=!1}if(b||!O){if(y=e.substring(S,S+a.length),b||":"!==y||a!==d.timeSeparator&&":"!==a){if(!b&&(":"===a&&y!==d.timeSeparator||"/"===a&&y!==d.dateSeparator)||y!==a&&"'"!==a&&'"'!==a&&"\\"!==a){T=!0;break}}else;if("\\"===b&&(b=!1),"'"!==a&&'"'!==a&&"\\"!==a)S+=a.length;else if(!1===b)b=a;else{if(b!==a){T=!0;break}b=!1}}}if(b&&(T=!0),T||(S!==e.length?T=!0:2===I?C%4==0&&C%100!=0||C%400==0?29<E&&(T=!0):28<E&&(T=!0):4!==I&&6!==I&&9!==I&&11!==I||30<E&&(T=!0)),T){if(r)return null;throw new System.FormatException.$ctor1("String does not contain a valid string representation of a date and time.")}v&&(x<12&&v===g?x=+x+12:11<x&&v===f&&(x-=12));var G=this.create(C,I,E,x,A,B,w,R);return 2===R&&(!0===D?G=new Date(G.getTime()-60*G.getTimezoneOffset()*1e3):0!==N&&(G=new Date(G.getTime()-60*G.getTimezoneOffset()*1e3),G=this.addMilliseconds(G,-N)),G.kind=R),G},subparseInt:function(e,t,n,i){for(var r,s=i;n<=s;s--){if((r=e.substring(t,t+s)).length<n)return null;if(/^\d+$/.test(r))return r}return null},tryParse:function(e,t,n,i){return n.v=this.parse(e,t,i,!0),null!=n.v||(n.v=this.getMinValue(),!1)},tryParseExact:function(e,t,n,i,r){return i.v=this.parseExact(e,t,n,r,!0),null!=i.v||(i.v=this.getMinValue(),!1)},isDaylightSavingTime:function(e){if(void 0!==e.kind&&1===e.kind)return!1;var t=new Date(e.getTime());return t.setMonth(0),t.setDate(1),t.getTimezoneOffset()!==e.getTimezoneOffset()},dateAddSubTimeSpan:function(e,t,n){n=t.getTicks().mul(n),n=new Date(e.getTime()+n.div(1e4).toNumber());return n.kind=e.kind,n.ticks=this.getTicks(n),n},subdt:function(e,t){return this.dateAddSubTimeSpan(e,t,-1)},adddt:function(e,t){return this.dateAddSubTimeSpan(e,t,1)},subdd:function(e,t){var n=0,i=this.getTicks(e),r=this.getTicks(t),e=i.toNumber(),t=r.toNumber(),r=i.sub(r);return(0===e&&0!==t||0===t&&0!==e)&&(n=Math.round(6e8*(r.toNumberDivided(6e8)-15*Math.round(r.toNumberDivided(9e9))))),new System.TimeSpan(r.sub(n))},addYears:function(e,t){return this.addMonths(e,12*t)},addMonths:function(e,t){var n=new Date(e.getTime()),i=e.getDate();return n.setDate(1),n.setMonth(n.getMonth()+t),n.setDate(Math.min(i,this.getDaysInMonth(n.getFullYear(),n.getMonth()+1))),n.kind=void 0!==e.kind?e.kind:0,n.ticks=this.getTicks(n),n},addDays:function(e,t){var n=void 0!==e.kind?e.kind:0,e=new Date(e.getTime());return 1===n?(e.setUTCDate(e.getUTCDate()+ +Math.floor(t)),t%1!=0&&e.setUTCMilliseconds(e.getUTCMilliseconds()+Math.round(t%1*864e5))):(e.setDate(e.getDate()+ +Math.floor(t)),t%1!=0&&e.setMilliseconds(e.getMilliseconds()+Math.round(t%1*864e5))),e.kind=n,e.ticks=this.getTicks(e),e},addHours:function(e,t){return this.addMilliseconds(e,36e5*t)},addMinutes:function(e,t){return this.addMilliseconds(e,6e4*t)},addSeconds:function(e,t){return this.addMilliseconds(e,1e3*t)},addMilliseconds:function(e,t){var n=new Date(e.getTime());return n.setMilliseconds(n.getMilliseconds()+t),n.kind=void 0!==e.kind?e.kind:0,n.ticks=this.getTicks(n),n},addTicks:function(e,t){t=System.Int64.is64Bit(t)?t:System.Int64(t);var n=new Date(e.getTime()),i=this.getTicks(e).add(t);return n.setMilliseconds(n.getMilliseconds()+t.div(1e4).toNumber()),n.ticks=i,n.kind=void 0!==e.kind?e.kind:0,n},add:function(e,t){return this.addTicks(e,t.getTicks())},subtract:function(e,t){return this.addTicks(e,t.getTicks().mul(-1))},getIsLeapYear:function(e){return 0==(3&e)&&(e%100!=0||e%400==0)},getDaysInMonth:function(e,t){return[31,this.getIsLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31][t-1]},getDayOfYear:function(e){var t=this.getDate(e),n=t.getMonth(),e=t.getDate(),e=this.YearDaysByMonth[n]+e;return 1<n&&this.getIsLeapYear(t.getFullYear())&&e++,e},getDate:function(e){var t=void 0!==e.kind?e.kind:0,e=new Date(e.getTime());return 1===t?(e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0)):(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)),e.ticks=this.getTicks(e),e.kind=t,e},getDayOfWeek:function(e){return e.getDay()},getYear:function(e){var t=void 0!==e.kind?e.kind:0;return this.getTicks(e).lt(this.TicksPerDay)?1:1===t?e.getUTCFullYear():e.getFullYear()},getMonth:function(e){var t=void 0!==e.kind?e.kind:0;return this.getTicks(e).lt(this.TicksPerDay)?1:1===t?e.getUTCMonth()+1:e.getMonth()+1},getDay:function(e){var t=void 0!==e.kind?e.kind:0;return this.getTicks(e).lt(this.TicksPerDay)?1:1===t?e.getUTCDate():e.getDate()},getHour:function(e){return 1===(void 0!==e.kind?e.kind:0)?e.getUTCHours():e.getHours()},getMinute:function(e){return 1===(void 0!==e.kind?e.kind:0)?e.getUTCMinutes():e.getMinutes()},getSecond:function(e){return e.getSeconds()},getMillisecond:function(e){return e.getMilliseconds()},gt:function(e,t){return null!=e&&null!=t&&this.getTicks(e).gt(this.getTicks(t))},gte:function(e,t){return null!=e&&null!=t&&this.getTicks(e).gte(this.getTicks(t))},lt:function(e,t){return null!=e&&null!=t&&this.getTicks(e).lt(this.getTicks(t))},lte:function(e,t){return null!=e&&null!=t&&this.getTicks(e).lte(this.getTicks(t))}}}),Bridge.define("System.TimeSpan",{inherits:[System.IComparable],config:{alias:["compareTo",["System$IComparable$compareTo","System$IComparable$1$compareTo","System$IComparable$1System$TimeSpan$compareTo"]]},$kind:"struct",statics:{fromDays:function(e){return new System.TimeSpan(864e9*e)},fromHours:function(e){return new System.TimeSpan(36e9*e)},fromMilliseconds:function(e){return new System.TimeSpan(1e4*e)},fromMinutes:function(e){return new System.TimeSpan(6e8*e)},fromSeconds:function(e){return new System.TimeSpan(1e7*e)},fromTicks:function(e){return new System.TimeSpan(e)},ctor:function(){this.zero=new System.TimeSpan(System.Int64.Zero),this.maxValue=new System.TimeSpan(System.Int64.MaxValue),this.minValue=new System.TimeSpan(System.Int64.MinValue)},getDefaultValue:function(){return new System.TimeSpan(System.Int64.Zero)},neg:function(e){return Bridge.hasValue(e)?new System.TimeSpan(e.ticks.neg()):null},sub:function(e,t){return Bridge.hasValue$1(e,t)?new System.TimeSpan(e.ticks.sub(t.ticks)):null},eq:function(e,t){return null===e&&null===t||!!Bridge.hasValue$1(e,t)&&e.ticks.eq(t.ticks)},neq:function(e,t){return(null!==e||null!==t)&&(!Bridge.hasValue$1(e,t)||e.ticks.ne(t.ticks))},plus:function(e){return Bridge.hasValue(e)?new System.TimeSpan(e.ticks):null},add:function(e,t){return Bridge.hasValue$1(e,t)?new System.TimeSpan(e.ticks.add(t.ticks)):null},gt:function(e,t){return!!Bridge.hasValue$1(e,t)&&e.ticks.gt(t.ticks)},gte:function(e,t){return!!Bridge.hasValue$1(e,t)&&e.ticks.gte(t.ticks)},lt:function(e,t){return!!Bridge.hasValue$1(e,t)&&e.ticks.lt(t.ticks)},lte:function(e,t){return!!Bridge.hasValue$1(e,t)&&e.ticks.lte(t.ticks)},timeSpanWithDays:/^(\-)?(\d+)[\.|:](\d+):(\d+):(\d+)(\.\d+)?/,timeSpanNoDays:/^(\-)?(\d+):(\d+):(\d+)(\.\d+)?/,parse:function(e){var t;function n(e){return e?1e3*parseFloat("0"+e):0}if(t=e.match(System.TimeSpan.timeSpanWithDays)){var i=new System.TimeSpan(t[2],t[3],t[4],t[5],n(t[6]));return t[1]?new System.TimeSpan(i.ticks.neg()):i}if(t=e.match(System.TimeSpan.timeSpanNoDays)){i=new System.TimeSpan(0,t[2],t[3],t[4],n(t[5]));return t[1]?new System.TimeSpan(i.ticks.neg()):i}return null},tryParse:function(e,t,n){return n.v=this.parse(e),null!=n.v||(n.v=this.minValue,!1)}},ctor:function(){this.$initialize(),this.ticks=System.Int64.Zero,1===arguments.length?this.ticks=arguments[0]instanceof System.Int64?arguments[0]:new System.Int64(arguments[0]):3===arguments.length?this.ticks=new System.Int64(arguments[0]).mul(60).add(arguments[1]).mul(60).add(arguments[2]).mul(1e7):4===arguments.length?this.ticks=new System.Int64(arguments[0]).mul(24).add(arguments[1]).mul(60).add(arguments[2]).mul(60).add(arguments[3]).mul(1e7):5===arguments.length&&(this.ticks=new System.Int64(arguments[0]).mul(24).add(arguments[1]).mul(60).add(arguments[2]).mul(60).add(arguments[3]).mul(1e3).add(arguments[4]).mul(1e4))},TimeToTicks:function(e,t,n){return System.Int64(e).mul("3600").add(System.Int64(t).mul("60")).add(System.Int64(n)).mul("10000000")},getTicks:function(){return this.ticks},getDays:function(){return this.ticks.div(864e9).toNumber()},getHours:function(){return this.ticks.div(36e9).mod(24).toNumber()},getMilliseconds:function(){return this.ticks.div(1e4).mod(1e3).toNumber()},getMinutes:function(){return this.ticks.div(6e8).mod(60).toNumber()},getSeconds:function(){return this.ticks.div(1e7).mod(60).toNumber()},getTotalDays:function(){return this.ticks.toNumberDivided(864e9)},getTotalHours:function(){return this.ticks.toNumberDivided(36e9)},getTotalMilliseconds:function(){return this.ticks.toNumberDivided(1e4)},getTotalMinutes:function(){return this.ticks.toNumberDivided(6e8)},getTotalSeconds:function(){return this.ticks.toNumberDivided(1e7)},get12HourHour:function(){return 12<this.getHours()?this.getHours()-12:0===this.getHours()?12:this.getHours()},add:function(e){return new System.TimeSpan(this.ticks.add(e.ticks))},subtract:function(e){return new System.TimeSpan(this.ticks.sub(e.ticks))},duration:function(){return new System.TimeSpan(this.ticks.abs())},negate:function(){return new System.TimeSpan(this.ticks.neg())},compareTo:function(e){return this.ticks.compareTo(e.ticks)},equals:function(e){return!!Bridge.is(e,System.TimeSpan)&&e.ticks.eq(this.ticks)},equalsT:function(e){return e.ticks.eq(this.ticks)},format:function(e,t){return this.toString(e,t)},getHashCode:function(){return this.ticks.getHashCode()},toString:function(e,t){function i(e,t,n,i){return System.String.alignString(Math.abs(0|e).toString(),t||2,"0",n||2,i||!1)}var n=this.ticks,r="",s=this,o=(t||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.DateTimeFormatInfo),t=n<0;return e?e.replace(/(\\.|'[^']*'|"[^"]*"|dd?|HH?|hh?|mm?|ss?|tt?|f{1,7}|\:|\/)/g,function(e,t,n){switch(e){case"d":return s.getDays();case"dd":return i(s.getDays());case"H":return s.getHours();case"HH":return i(s.getHours());case"h":return s.get12HourHour();case"hh":return i(s.get12HourHour());case"m":return s.getMinutes();case"mm":return i(s.getMinutes());case"s":return s.getSeconds();case"ss":return i(s.getSeconds());case"t":return(s.getHours()<12?o.amDesignator:o.pmDesignator).substring(0,1);case"tt":return s.getHours()<12?o.amDesignator:o.pmDesignator;case"f":case"ff":case"fff":case"ffff":case"fffff":case"ffffff":case"fffffff":return i(s.getMilliseconds(),e.length,1,!0);default:return e.substr(1,e.length-1-("\\"!==e.charAt(0)))}}):(n.abs().gte(864e9)&&(r+=i(n.toNumberDivided(864e9),1)+".",n=n.mod(864e9)),r+=i(n.toNumberDivided(36e9))+":",n=n.mod(36e9),r+=i(0|n.toNumberDivided(6e8))+":",n=n.mod(6e8),r+=i(n.toNumberDivided(1e7)),(n=n.mod(1e7)).gt(0)&&(r+="."+i(n.toNumber(),7)),(t?"-":"")+r)}}),Bridge.Class.addExtend(System.TimeSpan,[System.IComparable$1(System.TimeSpan),System.IEquatable$1(System.TimeSpan)]),Bridge.define("System.Text.StringBuilder",{ctor:function(){this.$initialize(),this.buffer=[],this.capacity=16,1===arguments.length?this.append(arguments[0]):2===arguments.length?(this.append(arguments[0]),this.setCapacity(arguments[1])):3<=arguments.length&&(this.append(arguments[0],arguments[1],arguments[2]),4===arguments.length&&this.setCapacity(arguments[3]))},getLength:function(){return this.buffer.length<2?this.buffer[0]?this.buffer[0].length:0:this.getString().length},setLength:function(e){if(0===e)this.clear();else{if(e<0)throw new System.ArgumentOutOfRangeException.$ctor4("value","Length cannot be less than zero");var t=this.getLength();e!==t&&(0<(e=e-t)?this.append("\0",e):this.remove(t+e,-e))}},getCapacity:function(){var e=this.getLength();return this.capacity>e?this.capacity:e},setCapacity:function(e){this.getLength()<e&&(this.capacity=e)},toString:function(){var e=this.getString();if(2!==arguments.length)return e;var t=arguments[0],n=arguments[1];return this.checkLimits(e,t,n),e.substr(t,n)},append:function(e){if(null==e)return this;if(2===arguments.length){if(0===(t=arguments[1]))return this;if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","cannot be less than zero");e=Array(t+1).join(e).toString()}else if(3===arguments.length){var t,n=arguments[1];if(0===(t=arguments[2]))return this;this.checkLimits(e,n,t),e=e.substr(n,t)}return this.buffer[this.buffer.length]=e,this.clearString(),this},appendFormat:function(e){return this.append(System.String.format.apply(System.String,arguments))},clear:function(){return this.buffer=[],this.clearString(),this},appendLine:function(){return 1===arguments.length&&this.append(arguments[0]),this.append("\r\n")},equals:function(e){return null!=e&&(e===this||this.toString()===e.toString())},remove:function(e,t){var n=this.getString();return this.checkLimits(n,e,t),n.length===t&&0===e?this.clear():(0<t&&(this.buffer=[],this.buffer[0]=n.substring(0,e),this.buffer[1]=n.substring(e+t,n.length),this.clearString()),this)},insert:function(e,t){if(null==t)return this;if(3===arguments.length){var n=arguments[2];if(0===n)return this;if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","cannot be less than zero");t=Array(n+1).join(t).toString()}n=this.getString();return this.buffer=[],e<1?(this.buffer[0]=t,this.buffer[1]=n):e>=n.length?(this.buffer[0]=n,this.buffer[1]=t):(this.buffer[0]=n.substring(0,e),this.buffer[1]=t,this.buffer[2]=n.substring(e,n.length)),this.clearString(),this},replace:function(e,t){var n,i,r=new RegExp(e,"g"),s=this.buffer.join("");return this.buffer=[],4===arguments.length?(n=arguments[2],i=arguments[3],e=s.substr(n,i),this.checkLimits(s,n,i),this.buffer[0]=s.substring(0,n),this.buffer[1]=e.replace(r,t),this.buffer[2]=s.substring(n+i,s.length)):this.buffer[0]=s.replace(r,t),this.clearString(),this},checkLimits:function(e,t,n){if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("length","must be non-negative");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("startIndex","startIndex cannot be less than zero");if(n>e.length-t)throw new System.ArgumentOutOfRangeException.$ctor4("Index and length must refer to a location within the string")},clearString:function(){this.$str=null},getString:function(){return this.$str||(this.$str=this.buffer.join(""),this.buffer=[],this.buffer[0]=this.$str),this.$str},getChar:function(e){var t=this.getString();if(e<0||e>=t.length)throw new System.IndexOutOfRangeException;return t.charCodeAt(e)},setChar:function(e,t){var n=this.getString();if(e<0||e>=n.length)throw new System.ArgumentOutOfRangeException;t=String.fromCharCode(t),this.buffer=[],this.buffer[0]=n.substring(0,e),this.buffer[1]=t,this.buffer[2]=n.substring(e+1,n.length),this.clearString()}}),j=RegExp("["+["-","[","]","/","{","}","(",")","*","+","?",".","\\","^","$","|"].join("\\")+"]","g"),Bridge.regexpEscape=function(e){return e.replace(j,"\\$&")},Bridge.define("System.Diagnostics.Debug.DebugAssertException",{inherits:[System.Exception],$kind:"nested class",ctors:{ctor:function(e,t,n){this.$initialize(),System.Exception.ctor.call(this,(e||"")+"\n"+(t||"")+"\n"+(n||""))}}}),Bridge.define("System.Diagnostics.Debug",{statics:{fields:{s_lock:null,s_indentLevel:0,s_indentSize:0,s_needIndent:!1,s_indentString:null,s_ShowAssertDialog:null,s_WriteCore:null,s_shouldWriteToStdErr:!1},props:{AutoFlush:{get:function(){return!0},set:function(e){}},IndentLevel:{get:function(){return System.Diagnostics.Debug.s_indentLevel},set:function(e){System.Diagnostics.Debug.s_indentLevel=e<0?0:e}},IndentSize:{get:function(){return System.Diagnostics.Debug.s_indentSize},set:function(e){System.Diagnostics.Debug.s_indentSize=e<0?0:e}}},ctors:{init:function(){this.s_lock={},this.s_indentSize=4,this.s_ShowAssertDialog=System.Diagnostics.Debug.ShowAssertDialog,this.s_WriteCore=System.Diagnostics.Debug.WriteCore,this.s_shouldWriteToStdErr=Bridge.referenceEquals(System.Environment.GetEnvironmentVariable("COMPlus_DebugWriteToStdErr"),"1")}},methods:{Close:function(){},Flush:function(){},Indent:function(){System.Diagnostics.Debug.IndentLevel=System.Diagnostics.Debug.IndentLevel+1|0},Unindent:function(){System.Diagnostics.Debug.IndentLevel=System.Diagnostics.Debug.IndentLevel-1|0},Print:function(e){System.Diagnostics.Debug.Write$2(e)},Print$1:function(e,t){void 0===t&&(t=[]),System.Diagnostics.Debug.Write$2(System.String.formatProvider.apply(System.String,[null,e].concat(t)))},Assert:function(e){System.Diagnostics.Debug.Assert$2(e,"","")},Assert$1:function(e,t){System.Diagnostics.Debug.Assert$2(e,t,"")},Assert$2:function(e,t,n){if(!e){var i;try{throw System.NotImplemented.ByDesign}catch(e){e=System.Exception.create(e),i=""}System.Diagnostics.Debug.WriteLine$2(System.Diagnostics.Debug.FormatAssert(i,t,n)),System.Diagnostics.Debug.s_ShowAssertDialog(i,t,n)}},Assert$3:function(e,t,n,i){void 0===i&&(i=[]),System.Diagnostics.Debug.Assert$2(e,t,System.String.format.apply(System.String,[n].concat(i)))},Fail:function(e){System.Diagnostics.Debug.Assert$2(!1,e,"")},Fail$1:function(e,t){System.Diagnostics.Debug.Assert$2(!1,e,t)},FormatAssert:function(e,t,n){var i=(System.Diagnostics.Debug.GetIndentString()||"")+"\n";return"---- DEBUG ASSERTION FAILED ----"+(i||"")+"---- Assert Short Message ----"+(i||"")+(t||"")+(i||"")+"---- Assert Long Message ----"+(i||"")+(n||"")+(i||"")+(e||"")},WriteLine$2:function(e){System.Diagnostics.Debug.Write$2((e||"")+"\n")},WriteLine:function(e){System.Diagnostics.Debug.WriteLine$2(null!=e?Bridge.toString(e):null)},WriteLine$1:function(e,t){System.Diagnostics.Debug.WriteLine$4(null!=e?Bridge.toString(e):null,t)},WriteLine$3:function(e,t){void 0===t&&(t=[]),System.Diagnostics.Debug.WriteLine$2(System.String.formatProvider.apply(System.String,[null,e].concat(t)))},WriteLine$4:function(e,t){null==t?System.Diagnostics.Debug.WriteLine$2(e):System.Diagnostics.Debug.WriteLine$2((t||"")+":"+(e||""))},Write$2:function(e){System.Diagnostics.Debug.s_lock,null!=e?(System.Diagnostics.Debug.s_needIndent&&(e=(System.Diagnostics.Debug.GetIndentString()||"")+(e||""),System.Diagnostics.Debug.s_needIndent=!1),System.Diagnostics.Debug.s_WriteCore(e),System.String.endsWith(e,"\n")&&(System.Diagnostics.Debug.s_needIndent=!0)):System.Diagnostics.Debug.s_WriteCore("")},Write:function(e){System.Diagnostics.Debug.Write$2(null!=e?Bridge.toString(e):null)},Write$3:function(e,t){null==t?System.Diagnostics.Debug.Write$2(e):System.Diagnostics.Debug.Write$2((t||"")+":"+(e||""))},Write$1:function(e,t){System.Diagnostics.Debug.Write$3(null!=e?Bridge.toString(e):null,t)},WriteIf$2:function(e,t){e&&System.Diagnostics.Debug.Write$2(t)},WriteIf:function(e,t){e&&System.Diagnostics.Debug.Write(t)},WriteIf$3:function(e,t,n){e&&System.Diagnostics.Debug.Write$3(t,n)},WriteIf$1:function(e,t,n){e&&System.Diagnostics.Debug.Write$1(t,n)},WriteLineIf:function(e,t){e&&System.Diagnostics.Debug.WriteLine(t)},WriteLineIf$1:function(e,t,n){e&&System.Diagnostics.Debug.WriteLine$1(t,n)},WriteLineIf$2:function(e,t){e&&System.Diagnostics.Debug.WriteLine$2(t)},WriteLineIf$3:function(e,t,n){e&&System.Diagnostics.Debug.WriteLine$4(t,n)},GetIndentString:function(){var e=Bridge.Int.mul(System.Diagnostics.Debug.IndentSize,System.Diagnostics.Debug.IndentLevel);return System.Nullable.eq(null!=System.Diagnostics.Debug.s_indentString?System.Diagnostics.Debug.s_indentString.length:null,e)?System.Diagnostics.Debug.s_indentString:(e=System.String.fromCharCount(32,e),System.Diagnostics.Debug.s_indentString=e)},ShowAssertDialog:function(e,t,n){System.Diagnostics.Debugger.IsAttached||(e=new System.Diagnostics.Debug.DebugAssertException(t,n,e),System.Environment.FailFast$1(e.Message,e))},WriteCore:function(e){System.Diagnostics.Debug.WriteToDebugger(e),System.Diagnostics.Debug.s_shouldWriteToStdErr&&System.Diagnostics.Debug.WriteToStderr(e)},WriteToDebugger:function(e){System.Diagnostics.Debugger.IsLogging()?System.Diagnostics.Debugger.Log(0,null,e):System.Console.WriteLine(e)},WriteToStderr:function(e){System.Console.WriteLine(e)}}}}),Bridge.define("System.Diagnostics.Debugger",{statics:{fields:{DefaultCategory:null},props:{IsAttached:{get:function(){return!0}}},methods:{IsLogging:function(){return!0},Launch:function(){return!0},Log:function(e,t,n){},NotifyOfCrossThreadDependency:function(){}}}}),Bridge.define("System.Diagnostics.Stopwatch",{ctor:function(){this.$initialize(),this.reset()},start:function(){this.isRunning||(this._startTime=System.Diagnostics.Stopwatch.getTimestamp(),this.isRunning=!0)},stop:function(){var e;this.isRunning&&(e=System.Diagnostics.Stopwatch.getTimestamp().sub(this._startTime),this._elapsed=this._elapsed.add(e),this.isRunning=!1)},reset:function(){this._startTime=System.Int64.Zero,this._elapsed=System.Int64.Zero,this.isRunning=!1},restart:function(){this.isRunning=!1,this._elapsed=System.Int64.Zero,this._startTime=System.Diagnostics.Stopwatch.getTimestamp(),this.start()},ticks:function(){var e,t=this._elapsed;return this.isRunning&&(e=System.Diagnostics.Stopwatch.getTimestamp().sub(this._startTime),t=t.add(e)),t},milliseconds:function(){return this.ticks().mul(1e3).div(System.Diagnostics.Stopwatch.frequency)},timeSpan:function(){return new System.TimeSpan(this.milliseconds().mul(1e4))},statics:{startNew:function(){var e=new System.Diagnostics.Stopwatch;return e.start(),e}}}),"undefined"!=typeof window&&window.performance&&window.performance.now?(System.Diagnostics.Stopwatch.frequency=new System.Int64(1e6),System.Diagnostics.Stopwatch.isHighResolution=!0,System.Diagnostics.Stopwatch.getTimestamp=function(){return new System.Int64(Math.round(1e3*window.performance.now()))}):"undefined"!=typeof process&&process.hrtime?(System.Diagnostics.Stopwatch.frequency=new System.Int64(1e9),System.Diagnostics.Stopwatch.isHighResolution=!0,System.Diagnostics.Stopwatch.getTimestamp=function(){var e=process.hrtime();return new System.Int64(e[0]).mul(1e9).add(e[1])}):(System.Diagnostics.Stopwatch.frequency=new System.Int64(1e3),System.Diagnostics.Stopwatch.isHighResolution=!1,System.Diagnostics.Stopwatch.getTimestamp=function(){return new System.Int64((new Date).valueOf())}),System.Diagnostics.Contracts.Contract={reportFailure:function(e,t,n,i,r){var s=n.toString(),n=(s=(s=s.substring(s.indexOf("return")+7)).substr(0,s.lastIndexOf(";")))?"Contract '"+s+"' failed":"Contract failed",n=t?n+": "+t:n;throw r?new r(s,t):new System.Diagnostics.Contracts.ContractException(e,n,t,s,i)},assert:function(e,t,n,i){n.call(t)||System.Diagnostics.Contracts.Contract.reportFailure(e,i,n,null)},requires:function(e,t,n,i){n.call(t)||System.Diagnostics.Contracts.Contract.reportFailure(0,i,n,null,e)},forAll:function(e,t,n){if(!n)throw new System.ArgumentNullException.$ctor1("predicate");for(;e<t;e++)if(!n(e))return!1;return!0},forAll$1:function(e,t){if(!e)throw new System.ArgumentNullException.$ctor1("collection");if(!t)throw new System.ArgumentNullException.$ctor1("predicate");var n=Bridge.getEnumerator(e);try{for(;n.moveNext();)if(!t(n.Current))return!1;return!0}finally{n.Dispose()}},exists:function(e,t,n){if(!n)throw new System.ArgumentNullException.$ctor1("predicate");for(;e<t;e++)if(n(e))return!0;return!1},exists$1:function(e,t){if(!e)throw new System.ArgumentNullException.$ctor1("collection");if(!t)throw new System.ArgumentNullException.$ctor1("predicate");var n=Bridge.getEnumerator(e);try{for(;n.moveNext();)if(t(n.Current))return!0;return!1}finally{n.Dispose()}}},Bridge.define("System.Diagnostics.Contracts.ContractFailureKind",{$kind:"enum",$statics:{precondition:0,postcondition:1,postconditionOnException:2,invarian:3,assert:4,assume:5}}),Bridge.define("System.Diagnostics.Contracts.ContractException",{inherits:[System.Exception],config:{properties:{Kind:{get:function(){return this._kind}},Failure:{get:function(){return this._failureMessage}},UserMessage:{get:function(){return this._userMessage}},Condition:{get:function(){return this._condition}}}},ctor:function(e,t,n,i,r){this.$initialize(),System.Exception.ctor.call(this,t,r),this._kind=e,this._failureMessage=t||null,this._userMessage=n||null,this._condition=i||null}});var Z={toIndex:function(e,t){if(t.length!==(e.$s?e.$s.length:1))throw new System.ArgumentException.$ctor1("Invalid number of indices");if(t[0]<0||t[0]>=(e.$s?e.$s[0]:e.length))throw new System.IndexOutOfRangeException.$ctor1("Index 0 out of range");var n,i=t[0];if(e.$s)for(n=1;n<e.$s.length;n++){if(t[n]<0||t[n]>=e.$s[n])throw new System.IndexOutOfRangeException.$ctor1("Index "+n+" out of range");i=i*e.$s[n]+t[n]}return i},index:function(e,t){if(e<0||e>=t.length)throw new System.IndexOutOfRangeException;return e},$get:function(e){e=this[System.Array.toIndex(this,e)];return void 0!==e?e:this.$v},get:function(e){if(arguments.length<2)throw new System.ArgumentNullException.$ctor1("indices");for(var t=Array.prototype.slice.call(arguments,1),n=0;n<t.length;n++)if(!Bridge.hasValue(t[n]))throw new System.ArgumentNullException.$ctor1("indices");var i=e[System.Array.toIndex(e,t)];return void 0!==i?i:e.$v},$set:function(e,t){this[System.Array.toIndex(this,e)]=t},set:function(e,t){var n=Array.prototype.slice.call(arguments,2);e[System.Array.toIndex(e,n)]=t},getLength:function(e,t){if(t<0||t>=(e.$s?e.$s.length:1))throw new System.IndexOutOfRangeException;return e.$s?e.$s[t]:e.length},getRank:function(e){return e.$type?e.$type.$rank:e.$s?e.$s.length:1},getLower:function(e,t){return System.Array.getLength(e,t),0},create:function(e,t,n,i){if(null===i)throw new System.ArgumentNullException.$ctor1("length");var r,s,o,a,u,l,c=[],m=3<arguments.length?1:0;if(c.$v=e,c.$s=[],c.get=System.Array.$get,c.set=System.Array.$set,i&&Bridge.isArray(i))for(r=0;r<i.length;r++){if(o=i[r],isNaN(o)||o<0)throw new System.ArgumentOutOfRangeException.$ctor1("length");m*=o,c.$s[r]=o}else for(r=3;r<arguments.length;r++){if(o=arguments[r],isNaN(o)||o<0)throw new System.ArgumentOutOfRangeException.$ctor1("length");m*=o,c.$s[r-3]=o}c.length=m;var y,h=Bridge.isFunction(e);h&&((y=e())&&(y.$kind||"object"==typeof y)||(h=!1,e=y));for(var d=0;d<m;d++)c[d]=h?e():e;if(t)for(r=0;r<c.length;r++){for(u=[],l=r,s=c.$s.length-1;0<=s;s--)a=l%c.$s[s],u.unshift(a),l=Bridge.Int.div(l-a,c.$s[s]);for(y=t,a=0;a<u.length;a++)y=y[u[a]];c[r]=y}return System.Array.init(c,n,c.$s.length),c},init:function(e,t,n,i){if(null==e)throw new System.ArgumentNullException.$ctor1("length");if(Bridge.isArray(e)){var r=n||1;return System.Array.type(t,r,e),e}if(isNaN(e)||e<0)throw new System.ArgumentOutOfRangeException.$ctor1("length");var s=new Array(e),o=!0!==i&&Bridge.isFunction(t);o&&((i=t())&&(i.$kind||"object"==typeof i)||(o=!1,t=i));for(var a=0;a<e;a++)s[a]=o?t():t;return System.Array.init(s,n,1)},toEnumerable:function(e){return new Bridge.ArrayEnumerable(e)},toEnumerator:function(e,t){return new Bridge.ArrayEnumerator(e,t)},_typedArrays:{Float32Array:System.Single,Float64Array:System.Double,Int8Array:System.SByte,Int16Array:System.Int16,Int32Array:System.Int32,Uint8Array:System.Byte,Uint8ClampedArray:System.Byte,Uint16Array:System.UInt16,Uint32Array:System.UInt32},is:function(e,t){if(e instanceof Bridge.ArrayEnumerator)return!!(e.constructor===t||e instanceof t||t===Bridge.ArrayEnumerator||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.IEnumerator")||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.IEnumerator"));if(!Bridge.isArray(e))return!1;if(t.$elementType&&t.$isArray){var n=Bridge.getType(e).$elementType;if(n)return Bridge.Reflection.isValueType(n)===Bridge.Reflection.isValueType(t.$elementType)&&(System.Array.getRank(e)===t.$rank&&Bridge.Reflection.isAssignableFrom(t.$elementType,n));t=Array}if(e.constructor===t||e instanceof t)return!0;if(t===System.Collections.IEnumerable||t===System.Collections.ICollection||t===System.ICloneable||t===System.Collections.IList||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.IEnumerable$1")||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.ICollection$1")||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.IList$1")||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.IReadOnlyCollection$1")||t.$$name&&System.String.startsWith(t.$$name,"System.Collections.Generic.IReadOnlyList$1"))return!0;n=!!System.Array._typedArrays[String.prototype.slice.call(Object.prototype.toString.call(e),8,-1)];return n&&System.Array._typedArrays[t.name]?e instanceof t:n},clone:function(e){var t=1===e.length?[e[0]]:e.slice(0);return t.$type=e.$type,t.$v=e.$v,t.$s=e.$s,t.get=System.Array.$get,t.set=System.Array.$set,t},getCount:function(e,t){var n,i;return Bridge.isArray(e)?e.length:t&&Bridge.isFunction(e[n="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$getCount"])||Bridge.isFunction(e[n="System$Collections$ICollection$getCount"])?e[n]():t&&void 0!==(i=e["System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$Count"])||void 0!==(i=e.System$Collections$ICollection$Count)||void 0!==(i=e.Count)?i:Bridge.isFunction(e.getCount)?e.getCount():0},getIsReadOnly:function(e,t){var n,i;return Bridge.isArray(e)?!!t:t&&Bridge.isFunction(e[n="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$getIsReadOnly"])?e[n]():t&&void 0!==(i=e["System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$IsReadOnly"])?i:Bridge.isFunction(e[n="System$Collections$IList$getIsReadOnly"])?e[n]():void 0!==(i=e.System$Collections$IList$IsReadOnly)||void 0!==(i=e.IsReadOnly)?i:!!Bridge.isFunction(e.getIsReadOnly)&&e.getIsReadOnly()},checkReadOnly:function(e,t,n){if(Bridge.isArray(e)){if(t)throw new System.NotSupportedException.$ctor1(n||"Collection was of a fixed size.")}else if(System.Array.getIsReadOnly(e,t))throw new System.NotSupportedException.$ctor1(n||"Collection is read-only.")},add:function(e,t,n){var i;return System.Array.checkReadOnly(e,n),n&&(t=System.Array.checkNewElementType(t,n)),n&&Bridge.isFunction(e[i="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$add"])||Bridge.isFunction(e[i="System$Collections$IList$add"])?e[i](t):Bridge.isFunction(e.add)?e.add(t):-1},checkNewElementType:function(e,t){var n=Bridge.unbox(e,!0);if(Bridge.isNumber(n)){if(t===System.Decimal)return new System.Decimal(n);if(t===System.Int64)return new System.Int64(n);if(t===System.UInt64)return new System.UInt64(n)}if(Bridge.is(e,t))return n;if(null==e&&null==Bridge.getDefaultValue(t))return null;throw new System.ArgumentException.$ctor1("The value "+n+"is not of type "+Bridge.getTypeName(t)+" and cannot be used in this generic collection.")},clear:function(e,t){var n;System.Array.checkReadOnly(e,t,"Collection is read-only."),Bridge.isArray(e)?System.Array.fill(e,t?t.getDefaultValue||Bridge.getDefaultValue(t):null,0,e.length):t&&Bridge.isFunction(e[n="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$clear"])||Bridge.isFunction(e[n="System$Collections$IList$clear"])?e[n]():Bridge.isFunction(e.clear)&&e.clear()},fill:function(e,t,n,i){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("dst");if(n<0||i<0||n+i>e.length)throw new System.IndexOutOfRangeException;var r,s=Bridge.isFunction(t);for(s&&((r=t())&&(r.$kind||"object"==typeof r)||(s=!1,t=r));0<=--i;)e[n+i]=s?t():t},copy:function(e,t,n,i,r){if(!n)throw new System.ArgumentNullException.$ctor3("dest","Value cannot be null");if(!e)throw new System.ArgumentNullException.$ctor3("src","Value cannot be null");if(t<0||i<0||r<0)throw new System.ArgumentOutOfRangeException.$ctor1("bound","Number was less than the array's lower bound in the first dimension");if(r>e.length-t||r>n.length-i)throw new System.ArgumentException.$ctor1("Destination array was not long enough. Check destIndex and length, and the array's lower bounds");if(t<i&&e===n)for(;0<=--r;)n[i+r]=e[t+r];else for(var s=0;s<r;s++)n[i+s]=e[t+s]},copyTo:function(e,t,n,i){var r;if(Bridge.isArray(e))System.Array.copy(e,0,t,n,e?e.length:0);else if(Bridge.isFunction(e.copyTo))e.copyTo(t,n);else if(i&&Bridge.isFunction(e[r="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(i)+"$copyTo"]))e[r](t,n);else{if(!Bridge.isFunction(e[r="System$Collections$ICollection$copyTo"]))throw new System.NotImplementedException.$ctor1("copyTo");e[r](t,n)}},indexOf:function(e,t,n,i,r){var s;if(Bridge.isArray(e)){for(var o,a=(n=n||0)+(i=Bridge.isNumber(i)?i:e.length),u=n;u<a;u++)if((o=e[u])===t||System.Collections.Generic.EqualityComparer$1.$default.equals2(o,t))return u}else{if(r&&Bridge.isFunction(e[s="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(r)+"$indexOf"]))return e[s](t);if(Bridge.isFunction(e[s="System$Collections$IList$indexOf"]))return e[s](t);if(Bridge.isFunction(e.indexOf))return e.indexOf(t)}return-1},contains:function(e,t,n){var i;return Bridge.isArray(e)?-1<System.Array.indexOf(e,t):n&&Bridge.isFunction(e[i="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$contains"])||Bridge.isFunction(e[i="System$Collections$IList$contains"])?e[i](t):!!Bridge.isFunction(e.contains)&&e.contains(t)},remove:function(e,t,n){var i;if(System.Array.checkReadOnly(e,n),Bridge.isArray(e)){var r=System.Array.indexOf(e,t);if(-1<r)return e.splice(r,1),!0}else{if(n&&Bridge.isFunction(e[i="System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$remove"]))return e[i](t);if(Bridge.isFunction(e[i="System$Collections$IList$remove"]))return e[i](t);if(Bridge.isFunction(e.remove))return e.remove(t)}return!1},insert:function(e,t,n,i){var r;System.Array.checkReadOnly(e,i),i&&(n=System.Array.checkNewElementType(n,i)),i&&Bridge.isFunction(e[r="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(i)+"$insert"])||Bridge.isFunction(e[r="System$Collections$IList$insert"])?e[r](t,n):Bridge.isFunction(e.insert)&&e.insert(t,n)},removeAt:function(e,t,n){var i;System.Array.checkReadOnly(e,n),Bridge.isArray(e)?e.splice(t,1):n&&Bridge.isFunction(e[i="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(n)+"$removeAt"])||Bridge.isFunction(e[i="System$Collections$IList$removeAt"])?e[i](t):Bridge.isFunction(e.removeAt)&&e.removeAt(t)},getItem:function(e,t,n){var i,r;return Bridge.isArray(e)?(r=e[t],!n&&e.$type&&(Bridge.isNumber(r)||Bridge.isBoolean(r)||Bridge.isDate(r))?Bridge.box(r,e.$type.$elementType):r):n&&Bridge.isFunction(e[i="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(n)+"$getItem"])?r=e[i](t):(Bridge.isFunction(e.get)?r=e.get(t):Bridge.isFunction(e.getItem)?r=e.getItem(t):Bridge.isFunction(e[i="System$Collections$IList$$getItem"])?r=e[i](t):Bridge.isFunction(e.get_Item)&&(r=e.get_Item(t)),n&&null!=Bridge.getDefaultValue(n)?Bridge.box(r,n):r)},setItem:function(e,t,n,i){var r;if(Bridge.isArray(e))e.$type&&(n=System.Array.checkElementType(n,e.$type.$elementType)),e[t]=n;else if(i&&(n=System.Array.checkElementType(n,i)),Bridge.isFunction(e.set))e.set(t,n);else if(Bridge.isFunction(e.setItem))e.setItem(t,n);else{if(i&&Bridge.isFunction(e[r="System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(i)+"$setItem"]))return e[r](t,n);{if(i&&Bridge.isFunction(e[r="System$Collections$IList$setItem"]))return e[r](t,n);Bridge.isFunction(e.set_Item)&&e.set_Item(t,n)}}},checkElementType:function(e,t){var n=Bridge.unbox(e,!0);if(Bridge.isNumber(n)){if(t===System.Decimal)return new System.Decimal(n);if(t===System.Int64)return new System.Int64(n);if(t===System.UInt64)return new System.UInt64(n)}if(Bridge.is(e,t))return n;if(null==e)return Bridge.getDefaultValue(t);throw new System.ArgumentException.$ctor1("Cannot widen from source type to target type either because the source type is a not a primitive type or the conversion cannot be accomplished.")},resize:function(e,t,n,i){if(t<0)throw new System.ArgumentOutOfRangeException.$ctor3("newSize",t,"newSize cannot be less than 0.");var r,s=0,o=Bridge.isFunction(n),a=e.v;o&&((r=n())&&(r.$kind||"object"==typeof r)||(o=!1,n=r)),a?(s=a.length,a.length=t):a=System.Array.init(new Array(t),i);for(var u=s;u<t;u++)a[u]=o?n():n;a.$s=[a.length],e.v=a},reverse:function(e,t,n){if(!Z)throw new System.ArgumentNullException.$ctor1("arr");if(t||0===t||(t=0,n=e.length),t<0||n<0)throw new System.ArgumentOutOfRangeException.$ctor4(t<0?"index":"length","Non-negative number required.");if(Z.length-t<n)throw new System.ArgumentException.$ctor1("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");if(1!==System.Array.getRank(e))throw new System.Exception("Only single dimension arrays are supported here.");for(var i=t,r=t+n-1;i<r;){var s=e[i];e[i]=e[r],e[r]=s,i++,r--}},binarySearch:function(e,t,n,i,r){if(!e)throw new System.ArgumentNullException.$ctor1("array");if(t<0||n<0)throw new System.ArgumentOutOfRangeException.$ctor4(t<0?"index":"length","Non-negative number required.");if(e.length-+t<n)throw new System.ArgumentException.$ctor1("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");if(1!==System.Array.getRank(e))throw new System.RankException.$ctor1("Only single dimensional arrays are supported for the requested action.");r=r||System.Collections.Generic.Comparer$1.$default;for(var s,o,a=t,u=t+n-1;a<=u;){s=a+(u-a>>1);try{o=System.Collections.Generic.Comparer$1.get(r)(e[s],i)}catch(e){throw new System.InvalidOperationException.$ctor2("Failed to compare two elements in the array.",e)}if(0===o)return s;o<0?a=s+1:u=s-1}return~a},sortDict:function(e,t,n,i,r){r=r||System.Collections.Generic.Comparer$1.$default;var s=[],o=Bridge.fn.bind(r,System.Collections.Generic.Comparer$1.get(r));null==i&&(i=e.length);for(var a=0;a<e.length;a++)s.push({key:e[a],value:t[a]});if(0===n&&i===s.length)s.sort(function(e,t){return o(e.key,t.key)});else{var u=s.slice(n,n+i);u.sort(function(e,t){return o(e.key,t.key)});for(var l=n;l<n+i;l++)s[l]=u[l-n]}for(var c=0;c<s.length;c++)e[c]=s[c].key,t[c]=s[c].value},sort:function(e,t,n,i){if(!e)throw new System.ArgumentNullException.$ctor1("array");if(2!==arguments.length||"function"!=typeof t)if(2===arguments.length&&"object"==typeof t&&(i=t,t=null),Bridge.isNumber(t)||(t=0),Bridge.isNumber(n)||(n=e.length),i=i||System.Collections.Generic.Comparer$1.$default,0===t&&n===e.length)e.sort(Bridge.fn.bind(i,System.Collections.Generic.Comparer$1.get(i)));else{var r=e.slice(t,t+n);r.sort(Bridge.fn.bind(i,System.Collections.Generic.Comparer$1.get(i)));for(var s=t;s<t+n;s++)e[s]=r[s-t]}else e.sort(t)},min:function(e,t){for(var n=e[0],i=e.length,r=0;r<i;r++)!(e[r]<n||n<t)||e[r]<t||(n=e[r]);return n},max:function(e,t){for(var n=e[0],i=e.length,r=0;r<i;r++)!(e[r]>n||t<n)||e[r]>t||(n=e[r]);return n},addRange:function(e,t){if(Bridge.isArray(t))e.push.apply(e,t);else{var n=Bridge.getEnumerator(t);try{for(;n.moveNext();)e.push(n.Current)}finally{Bridge.is(n,System.IDisposable)&&n.Dispose()}}},convertAll:function(e,t){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("array");if(!Bridge.hasValue(t))throw new System.ArgumentNullException.$ctor1("converter");return e.map(t)},find:function(e,t,n){if(!Bridge.hasValue(t))throw new System.ArgumentNullException.$ctor1("array");if(!Bridge.hasValue(n))throw new System.ArgumentNullException.$ctor1("match");for(var i=0;i<t.length;i++)if(n(t[i]))return t[i];return Bridge.getDefaultValue(e)},findAll:function(e,t){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("array");if(!Bridge.hasValue(t))throw new System.ArgumentNullException.$ctor1("match");for(var n=[],i=0;i<e.length;i++)t(e[i])&&n.push(e[i]);return n},findIndex:function(e,t,n,i){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("array");if(2===arguments.length?(i=t,t=0,n=e.length):3===arguments.length&&(i=n,n=e.length-t),t<0||t>e.length)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex");if(n<0||t>e.length-n)throw new System.ArgumentOutOfRangeException.$ctor1("count");if(!Bridge.hasValue(i))throw new System.ArgumentNullException.$ctor1("match");for(var r=t+n,s=t;s<r;s++)if(i(e[s]))return s;return-1},findLast:function(e,t,n){if(!Bridge.hasValue(t))throw new System.ArgumentNullException.$ctor1("array");if(!Bridge.hasValue(n))throw new System.ArgumentNullException.$ctor1("match");for(var i=t.length-1;0<=i;i--)if(n(t[i]))return t[i];return Bridge.getDefaultValue(e)},findLastIndex:function(e,t,n,i){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("array");if(2===arguments.length?(i=t,t=e.length-1,n=e.length):3===arguments.length&&(i=n,n=t+1),!Bridge.hasValue(i))throw new System.ArgumentNullException.$ctor1("match");if(0===e.length){if(-1!==t)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex")}else if(t<0||t>=e.length)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex");if(n<0||t-n+1<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");for(var r=t-n,s=t;r<s;s--)if(i(e[s]))return s;return-1},forEach:function(e,t){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("array");if(!Bridge.hasValue(t))throw new System.ArgumentNullException.$ctor1("action");for(var n=0;n<e.length;n++)t(e[n],n,e)},indexOfT:function(e,t,n,i){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("array");if(2===arguments.length?(n=0,i=e.length):3===arguments.length&&(i=e.length-n),n<0||n>=e.length&&0<e.length)throw new System.ArgumentOutOfRangeException.$ctor4("startIndex","out of range");if(i<0||i>e.length-n)throw new System.ArgumentOutOfRangeException.$ctor4("count","out of range");return System.Array.indexOf(e,t,n,i)},isFixedSize:function(e){return!!Bridge.isArray(e)||(null!=e.System$Collections$IList$isFixedSize?e.System$Collections$IList$isFixedSize:null!=e.System$Collections$IList$IsFixedSize?e.System$Collections$IList$IsFixedSize:null!=e.isFixedSize?e.isFixedSize:null==e.IsFixedSize||e.IsFixedSize)},isSynchronized:function(e){return!1},lastIndexOfT:function(e,t,n,i){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("array");if(2===arguments.length?(n=e.length-1,i=e.length):3===arguments.length&&(i=0===e.length?0:n+1),n<0||n>=e.length&&0<e.length)throw new System.ArgumentOutOfRangeException.$ctor4("startIndex","out of range");if(i<0||n-i+1<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","out of range");for(var r=n-i+1,s=n;r<=s;s--){var o=e[s];if(o===t||System.Collections.Generic.EqualityComparer$1.$default.equals2(o,t))return s}return-1},syncRoot:function(e){return e},trueForAll:function(e,t){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("array");if(!Bridge.hasValue(t))throw new System.ArgumentNullException.$ctor1("match");for(var n=0;n<e.length;n++)if(!t(e[n]))return!1;return!0},type:function(e,t,n){t=t||1;var i,r=System.Array.$cache[t];r||(r=[],System.Array.$cache[t]=r);for(var s,o,a=0;a<r.length;a++)if(r[a].$elementType===e){o=r[a];break}return o||(i=Bridge.getTypeName(e)+"["+System.String.fromCharCount(",".charCodeAt(0),t-1)+"]",s=Bridge.Class.staticInitAllow,o=Bridge.define(i,{$inherits:[System.Array,System.Collections.ICollection,System.ICloneable,System.Collections.Generic.IList$1(e),System.Collections.Generic.IReadOnlyCollection$1(e)],$noRegister:!0,statics:{$elementType:e,$rank:t,$isArray:!0,$is:function(e){return System.Array.is(e,this)},getDefaultValue:function(){return null},createInstance:function(){var e;if(1===this.$rank)e=[];else{for(var t=[Bridge.getDefaultValue(this.$elementType),null,this.$elementType],n=0;n<this.$rank;n++)t.push(0);e=System.Array.create.apply(System.Array,t)}return e.$type=this,e}}}),r.push(o),Bridge.Class.staticInitAllow=!0,o.$staticInit&&o.$staticInit(),Bridge.Class.staticInitAllow=s),n&&(n.$type=o),n||o},getLongLength:function(e){return System.Int64(e.length)}};Bridge.define("System.Array",{statics:Z}),System.Array.$cache={},Bridge.define("System.ArraySegment",{$kind:"struct",statics:{getDefaultValue:function(){return new System.ArraySegment}},ctor:function(e,t,n){if(this.$initialize(),0===arguments.length)return this.array=null,this.offset=0,void(this.count=0);if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(this.array=e,Bridge.isNumber(t)){if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("offset");this.offset=t}else this.offset=0;if(Bridge.isNumber(n)){if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");this.count=n}else this.count=e.length;if(e.length-this.offset<this.count)throw new ArgumentException},getArray:function(){return this.array},getCount:function(){return this.count},getOffset:function(){return this.offset},getHashCode:function(){return Bridge.addHash([5322976039,this.array,this.count,this.offset])},equals:function(e){return!!Bridge.is(e,System.ArraySegment)&&(Bridge.equals(this.array,e.array)&&Bridge.equals(this.count,e.count)&&Bridge.equals(this.offset,e.offset))},$clone:function(e){return this}}),Bridge.define("System.Collections.IEnumerable",{$kind:"interface"}),Bridge.define("System.Collections.ICollection",{inherits:[System.Collections.IEnumerable],$kind:"interface"}),Bridge.define("System.Collections.IList",{inherits:[System.Collections.ICollection],$kind:"interface"}),Bridge.define("System.Collections.IDictionary",{inherits:[System.Collections.ICollection],$kind:"interface"}),Bridge.define("System.Collections.Generic.IEnumerable$1",function(e){return{inherits:[System.Collections.IEnumerable],$kind:"interface",$variance:[1]}}),Bridge.define("System.Collections.Generic.ICollection$1",function(e){return{inherits:[System.Collections.Generic.IEnumerable$1(e)],$kind:"interface"}}),Bridge.define("System.Collections.Generic.IEqualityComparer$1",function(e){return{$kind:"interface",$variance:[2]}}),Bridge.define("System.Collections.Generic.IDictionary$2",function(e,t){return{inherits:[System.Collections.Generic.ICollection$1(System.Collections.Generic.KeyValuePair$2(e,t))],$kind:"interface"}}),Bridge.define("System.Collections.Generic.IList$1",function(e){return{inherits:[System.Collections.Generic.ICollection$1(e)],$kind:"interface"}}),Bridge.define("System.Collections.Generic.ISet$1",function(e){return{inherits:[System.Collections.Generic.ICollection$1(e)],$kind:"interface"}}),Bridge.define("System.Collections.Generic.IReadOnlyCollection$1",function(e){return{inherits:[System.Collections.Generic.IEnumerable$1(e)],$kind:"interface"}}),Bridge.define("System.Collections.Generic.IReadOnlyList$1",function(e){return{inherits:[System.Collections.Generic.IReadOnlyCollection$1(e)],$kind:"interface",$variance:[1]}}),Bridge.define("System.Collections.Generic.IReadOnlyDictionary$2",function(e,t){return{inherits:[System.Collections.Generic.IReadOnlyCollection$1(System.Collections.Generic.KeyValuePair$2(e,t))],$kind:"interface"}}),Bridge.define("System.String",{inherits:[System.IComparable,System.ICloneable,System.Collections.IEnumerable,System.Collections.Generic.IEnumerable$1(System.Char)],statics:{$is:function(e){return"string"==typeof e},charCodeAt:function(e,t){t=t||0;var n,i=e.charCodeAt(t);if(55296<=i&&i<=56319){if(n=i,t=e.charCodeAt(t+1),isNaN(t))throw new System.Exception("High surrogate not followed by low surrogate");return 1024*(n-55296)+(t-56320)+65536}return!(56320<=i&&i<=57343)&&i},fromCharCode:function(e){return 65535<e?(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e))):String.fromCharCode(e)},fromCharArray:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("chars");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("length");if(e.length-t<n)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex");var i="";(t=t||0)+(n=Bridge.isNumber(n)?n:e.length)>e.length&&(n=e.length-t);for(var r=0;r<n;r++){var s=0|e[r+t];i+=String.fromCharCode(s)}return i},lastIndexOf:function(e,t,n,i){t=e.lastIndexOf(t,n);return t<n-i+1?-1:t},lastIndexOfAny:function(e,t,n,i){var r=e.length;if(!r)return-1;t=String.fromCharCode.apply(null,t);var s=(n=n||r-1)-(i=i||r)+1;s<0&&(s=0);for(var o=n;s<=o;o--)if(0<=t.indexOf(e.charAt(o)))return o;return-1},isNullOrWhiteSpace:function(e){return!e||System.Char.isWhiteSpace(e)},isNullOrEmpty:function(e){return!e},fromCharCount:function(e,t){if(0<=t)return String(Array(t+1).join(String.fromCharCode(e)));throw new System.ArgumentOutOfRangeException.$ctor4("count","cannot be less than zero")},format:function(e,t){return System.String._format(System.Globalization.CultureInfo.getCurrentCulture(),e,Array.isArray(t)&&2==arguments.length?t:Array.prototype.slice.call(arguments,1))},formatProvider:function(e,t,n){return System.String._format(e,t,Array.isArray(n)&&3==arguments.length?n:Array.prototype.slice.call(arguments,2))},_format:function(l,e,c){if(null==e)throw new System.ArgumentNullException.$ctor1("format");function t(e){return e.split("").reverse().join("")}e=t(t(e.replace(/\{\{/g,function(e){return String.fromCharCode(1,1)})).replace(/\}\}/g,function(e){return String.fromCharCode(2,2)}));var m=this,y=this.decodeBraceSequence;return(e=e.replace(/(\{+)((\d+|[a-zA-Z_$]\w+(?:\.[a-zA-Z_$]\w+|\[\d+\])*)(?:\,(-?\d*))?(?:\:([^\}]*))?)(\}+)|(\{+)|(\}+)/g,function(e,t,n,i,r,s,o,a,u){return a?y(a):u?y(u):t.length%2==0||o.length%2==0?y(t)+n+y(o):y(t,!0)+m.handleElement(l,i,r,s,c)+y(o,!0)})).replace(/(\x01\x01)|(\x02\x02)/g,function(e){return e==String.fromCharCode(1,1)?"{":e==String.fromCharCode(2,2)?"}":void 0})},handleElement:function(e,t,n,i,r){if((t=parseInt(t,10))>r.length-1)throw new System.FormatException.$ctor1("Input string was not in a correct format.");return null==(t=r[t])&&(t=""),i&&t.$boxed&&"enum"===t.type.$kind?t=System.Enum.format(t.type,t.v,i):i&&t.$boxed&&t.type.format?t=t.type.format(Bridge.unbox(t,!0),i,e):i&&Bridge.is(t,System.IFormattable)&&(t=Bridge.format(Bridge.unbox(t,!0),i,e)),t=Bridge.isNumber(t)?Bridge.Int.format(t,i,e):Bridge.isDate(t)?System.DateTime.format(t,i,e):""+Bridge.toString(t),n&&(n=parseInt(n,10),Bridge.isNumber(n)||(n=null)),System.String.alignString(Bridge.toString(t),n)},decodeBraceSequence:function(e,t){return e.substr(0,(e.length+(t?0:1))/2)},alignString:function(e,t,n,i,r){if(null==e||!t)return e;if(n=n||" ",Bridge.isNumber(n)&&(n=String.fromCharCode(n)),i=i||(t<0?1:2),t=Math.abs(t),r&&e.length>t&&(e=e.substring(0,t)),t+1>=e.length)switch(i){case 2:e=Array(t+1-e.length).join(n)+e;break;case 3:var s=t-e.length,o=Math.ceil(s/2);e=Array(1+(s-o)).join(n)+e+Array(o+1).join(n);break;case 1:default:e+=Array(t+1-e.length).join(n)}return e},startsWith:function(e,t){return!t.length||!(t.length>e.length)&&System.String.equals(e.slice(0,t.length),t,arguments[2])},endsWith:function(e,t){return!t.length||!(t.length>e.length)&&System.String.equals(e.slice(e.length-t.length,e.length),t,arguments[2])},contains:function(e,t){if(null==t)throw new System.ArgumentNullException;return null!=e&&-1<e.indexOf(t)},indexOfAny:function(e,t){if(null==t)throw new System.ArgumentNullException;if(null==e||""===e)return-1;var n=2<arguments.length?arguments[2]:0;if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("startIndex","startIndex cannot be less than zero");var i=e.length-n;if(3<arguments.length&&null!=arguments[3]&&(i=arguments[3]),i<0)throw new System.ArgumentOutOfRangeException.$ctor4("length","must be non-negative");if(i>e.length-n)throw new System.ArgumentOutOfRangeException.$ctor4("length","Index and length must refer to a location within the string");i=n+i,t=String.fromCharCode.apply(null,t);for(var r=n;r<i;r++)if(0<=t.indexOf(e.charAt(r)))return r;return-1},indexOf:function(e,t){if(null==t)throw new System.ArgumentNullException;if(null==e||""===e)return-1;var n=2<arguments.length?arguments[2]:0;if(n<0||n>e.length)throw new System.ArgumentOutOfRangeException.$ctor4("startIndex","startIndex cannot be less than zero and must refer to a location within the string");if(""===t)return 2<arguments.length?n:0;var i=e.length-n;if(3<arguments.length&&null!=arguments[3]&&(i=arguments[3]),i<0)throw new System.ArgumentOutOfRangeException.$ctor4("length","must be non-negative");if(i>e.length-n)throw new System.ArgumentOutOfRangeException.$ctor4("length","Index and length must refer to a location within the string");e=e.substr(n,i),i=5===arguments.length&&arguments[4]%2!=0?e.toLocaleUpperCase().indexOf(t.toLocaleUpperCase()):e.indexOf(t);return-1<i&&(5!==arguments.length||0===System.String.compare(t,e.substr(i,t.length),arguments[4]))?i+n:-1},equals:function(){return 0===System.String.compare.apply(this,arguments)},swapCase:function(e){return e.replace(/\w/g,function(e){return e===e.toLowerCase()?e.toUpperCase():e.toLowerCase()})},compare:function(e,t){if(null==e)return null==t?0:-1;if(null==t)return 1;if(3<=arguments.length)if(Bridge.isBoolean(arguments[2])){if(arguments[2]&&(e=e.toLocaleUpperCase(),t=t.toLocaleUpperCase()),4===arguments.length)return e.localeCompare(t,arguments[3].name)}else switch(arguments[2]){case 1:return e.localeCompare(t,System.Globalization.CultureInfo.getCurrentCulture().name,{sensitivity:"accent"});case 2:return e.localeCompare(t,System.Globalization.CultureInfo.invariantCulture.name);case 3:return e.localeCompare(t,System.Globalization.CultureInfo.invariantCulture.name,{sensitivity:"accent"});case 4:return e===t?0:t<e?1:-1;case 5:return e.toUpperCase()===t.toUpperCase()?0:e.toUpperCase()>t.toUpperCase()?1:-1}return e.localeCompare(t)},toCharArray:function(e,t,n){if(t<0||t>e.length||t>e.length-n)throw new System.ArgumentOutOfRangeException.$ctor4("startIndex","startIndex cannot be less than zero and must refer to a location within the string");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("length","must be non-negative");Bridge.hasValue(t)||(t=0),Bridge.hasValue(n)||(n=e.length);for(var i=[],r=t;r<t+n;r++)i.push(e.charCodeAt(r));return i},escape:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},replaceAll:function(e,t,n){t=new RegExp(System.String.escape(t),"g");return e.replace(t,n)},insert:function(e,t,n){return 0<e?t.substring(0,e)+n+t.substring(e,t.length):n+t},remove:function(e,t,n){if(null==e)throw new System.NullReferenceException;if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("startIndex","StartIndex cannot be less than zero");if(null!=n){if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","Count cannot be less than zero");if(n>e.length-t)throw new System.ArgumentOutOfRangeException.$ctor4("count","Index and count must refer to a location within the string")}else if(t>=e.length)throw new System.ArgumentOutOfRangeException.$ctor4("startIndex","startIndex must be less than length of string");return null==n||t+n>e.length?e.substr(0,t):e.substr(0,t)+e.substr(t+n)},split:function(e,t,n,i){for(var r,s=Bridge.hasValue(t)&&0!==t.length?new RegExp(t.map(System.String.escape).join("|"),"g"):new RegExp("\\s","g"),o=[],a=0;;a=s.lastIndex){if(!(r=s.exec(e)))return 1===i&&a===e.length||o.push(e.substr(a)),o;if(1!==i||r.index>a){if(o.length===n-1)return o.push(e.substr(a)),o;o.push(e.substring(a,r.index))}}},trimEnd:function(e,t){return e.replace(t?new RegExp("["+System.String.escape(String.fromCharCode.apply(null,t))+"]+$"):/\s*$/,"")},trimStart:function(e,t){return e.replace(t?new RegExp("^["+System.String.escape(String.fromCharCode.apply(null,t))+"]+"):/^\s*/,"")},trim:function(e,t){return System.String.trimStart(System.String.trimEnd(e,t),t)},trimStartZeros:function(e){return e.replace(new RegExp("^[ 0+]+(?=.)"),"")},concat:function(e){for(var t=1==arguments.length&&Array.isArray(e)?e:[].slice.call(arguments),n="",i=0;i<t.length;i++)n+=null==t[i]?"":Bridge.toString(t[i]);return n},copyTo:function(e,t,n,i,r){if(null==n)throw new System.ArgumentNullException.$ctor1("destination");if(null==e)throw new System.ArgumentNullException.$ctor1("str");if(r<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("sourceIndex");if(r>e.length-t)throw new System.ArgumentOutOfRangeException.$ctor1("sourceIndex");if(i>n.length-r||i<0)throw new System.ArgumentOutOfRangeException.$ctor1("destinationIndex");if(0<r)for(var s=0;s<r;s++)n[i+s]=e.charCodeAt(t+s)}}}),Bridge.Class.addExtend(System.String,[System.IComparable$1(System.String),System.IEquatable$1(System.String)]),Bridge.define("System.Collections.Generic.KeyValuePair$2",function(t,n){return{$kind:"struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.KeyValuePair$2(t,n))}}},fields:{key$1:Bridge.getDefaultValue(t),value$1:Bridge.getDefaultValue(n)},props:{key:{get:function(){return this.key$1}},value:{get:function(){return this.value$1}}},ctors:{$ctor1:function(e,t){this.$initialize(),this.key$1=e,this.value$1=t},ctor:function(){this.$initialize()}},methods:{toString:function(){var e=System.Text.StringBuilderCache.Acquire();return e.append(String.fromCharCode(91)),null!=this.key&&e.append(Bridge.toString(this.key)),e.append(", "),null!=this.value&&e.append(Bridge.toString(this.value)),e.append(String.fromCharCode(93)),System.Text.StringBuilderCache.GetStringAndRelease(e)},Deconstruct:function(e,t){e.v=this.key,t.v=this.value},getHashCode:function(){return Bridge.addHash([5072499452,this.key$1,this.value$1])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.KeyValuePair$2(t,n))&&(Bridge.equals(this.key$1,e.key$1)&&Bridge.equals(this.value$1,e.value$1))},$clone:function(e){return this}}}}),Bridge.define("System.Collections.IEnumerator",{$kind:"interface"}),Bridge.define("System.Collections.IComparer",{$kind:"interface"}),Bridge.define("System.Collections.IDictionaryEnumerator",{inherits:[System.Collections.IEnumerator],$kind:"interface"}),Bridge.define("System.Collections.IEqualityComparer",{$kind:"interface"}),Bridge.define("System.Collections.IStructuralComparable",{$kind:"interface"}),Bridge.define("System.Collections.IStructuralEquatable",{$kind:"interface"}),Bridge.definei("System.Collections.Generic.IEnumerator$1",function(e){return{inherits:[System.IDisposable,System.Collections.IEnumerator],$kind:"interface",$variance:[1]}}),Bridge.definei("System.Collections.Generic.IComparer$1",function(e){return{$kind:"interface",$variance:[2]}}),Bridge.define("System.Collections.KeyValuePairs",{fields:{key:null,value:null},props:{Key:{get:function(){return this.key}},Value:{get:function(){return this.value}}},ctors:{ctor:function(e,t){this.$initialize(),this.value=t,this.key=e}}}),Bridge.define("System.Collections.SortedList",{inherits:[System.Collections.IDictionary,System.ICloneable],statics:{fields:{emptyArray:null},ctors:{init:function(){this.emptyArray=System.Array.init(0,null,System.Object)}},methods:{Synchronized:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("list");return new System.Collections.SortedList.SyncSortedList(e)}}},fields:{keys:null,values:null,_size:0,version:0,comparer:null,keyList:null,valueList:null},props:{Capacity:{get:function(){return this.keys.length},set:function(e){if(e<this.Count)throw new System.ArgumentOutOfRangeException.$ctor1("value");var t;e!==this.keys.length&&(0<e?(t=System.Array.init(e,null,System.Object),e=System.Array.init(e,null,System.Object),0<this._size&&(System.Array.copy(this.keys,0,t,0,this._size),System.Array.copy(this.values,0,e,0,this._size)),this.keys=t,this.values=e):(this.keys=System.Collections.SortedList.emptyArray,this.values=System.Collections.SortedList.emptyArray))}},Count:{get:function(){return this._size}},Keys:{get:function(){return this.GetKeyList()}},Values:{get:function(){return this.GetValueList()}},IsReadOnly:{get:function(){return!1}},IsFixedSize:{get:function(){return!1}},IsSynchronized:{get:function(){return!1}},SyncRoot:{get:function(){return null}}},alias:["add","System$Collections$IDictionary$add","Count","System$Collections$ICollection$Count","Keys","System$Collections$IDictionary$Keys","Values","System$Collections$IDictionary$Values","IsReadOnly","System$Collections$IDictionary$IsReadOnly","IsFixedSize","System$Collections$IDictionary$IsFixedSize","IsSynchronized","System$Collections$ICollection$IsSynchronized","SyncRoot","System$Collections$ICollection$SyncRoot","clear","System$Collections$IDictionary$clear","clone","System$ICloneable$clone","contains","System$Collections$IDictionary$contains","copyTo","System$Collections$ICollection$copyTo","GetEnumerator","System$Collections$IDictionary$GetEnumerator","getItem","System$Collections$IDictionary$getItem","setItem","System$Collections$IDictionary$setItem","remove","System$Collections$IDictionary$remove"],ctors:{ctor:function(){this.$initialize(),this.Init()},$ctor5:function(e){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException.$ctor1("initialCapacity");this.keys=System.Array.init(e,null,System.Object),this.values=System.Array.init(e,null,System.Object),this.comparer=new(System.Collections.Generic.Comparer$1(Object))(System.Collections.Generic.Comparer$1.$default.fn)},$ctor1:function(e){System.Collections.SortedList.ctor.call(this),null!=e&&(this.comparer=e)},$ctor2:function(e,t){System.Collections.SortedList.$ctor1.call(this,e),this.Capacity=t},$ctor3:function(e){System.Collections.SortedList.$ctor4.call(this,e,null)},$ctor4:function(e,t){if(System.Collections.SortedList.$ctor2.call(this,t,null!=e?System.Array.getCount(e):0),null==e)throw new System.ArgumentNullException.$ctor1("d");System.Array.copyTo(e.System$Collections$IDictionary$Keys,this.keys,0),System.Array.copyTo(e.System$Collections$IDictionary$Values,this.values,0),System.Array.sortDict(this.keys,this.values,0,null,t),this._size=System.Array.getCount(e)}},methods:{getItem:function(e){e=this.IndexOfKey(e);return 0<=e?this.values[System.Array.index(e,this.values)]:null},setItem:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("key");var n=System.Array.binarySearch(this.keys,0,this._size,e,this.comparer);if(0<=n)return this.values[System.Array.index(n,this.values)]=t,void(this.version=this.version+1|0);this.Insert(~n,e,t)},Init:function(){this.keys=System.Collections.SortedList.emptyArray,this.values=System.Collections.SortedList.emptyArray,this._size=0,this.comparer=new(System.Collections.Generic.Comparer$1(Object))(System.Collections.Generic.Comparer$1.$default.fn)},add:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("key");var n=System.Array.binarySearch(this.keys,0,this._size,e,this.comparer);if(0<=n)throw new System.ArgumentException.ctor;this.Insert(~n,e,t)},clear:function(){this.version=this.version+1|0,System.Array.fill(this.keys,null,0,this._size),System.Array.fill(this.values,null,0,this._size),this._size=0},clone:function(){var e=new System.Collections.SortedList.$ctor5(this._size);return System.Array.copy(this.keys,0,e.keys,0,this._size),System.Array.copy(this.values,0,e.values,0,this._size),e._size=this._size,e.version=this.version,e.comparer=this.comparer,e},contains:function(e){return 0<=this.IndexOfKey(e)},ContainsKey:function(e){return 0<=this.IndexOfKey(e)},ContainsValue:function(e){return 0<=this.IndexOfValue(e)},copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(1!==System.Array.getRank(e))throw new System.ArgumentException.ctor;if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("arrayIndex");if((e.length-t|0)<this.Count)throw new System.ArgumentException.ctor;for(var n=0;n<this.Count;n=n+1|0){var i=new System.Collections.DictionaryEntry.$ctor1(this.keys[System.Array.index(n,this.keys)],this.values[System.Array.index(n,this.values)]);System.Array.set(e,i.$clone(),n+t|0)}},ToKeyValuePairsArray:function(){for(var e=System.Array.init(this.Count,null,System.Collections.KeyValuePairs),t=0;t<this.Count;t=t+1|0)e[System.Array.index(t,e)]=new System.Collections.KeyValuePairs(this.keys[System.Array.index(t,this.keys)],this.values[System.Array.index(t,this.values)]);return e},EnsureCapacity:function(e){var t=0===this.keys.length?16:Bridge.Int.mul(this.keys.length,2);2146435071<t>>>0&&(t=2146435071),t<e&&(t=e),this.Capacity=t},GetByIndex:function(e){if(e<0||e>=this.Count)throw new System.ArgumentOutOfRangeException.$ctor1("index");return this.values[System.Array.index(e,this.values)]},System$Collections$IEnumerable$GetEnumerator:function(){return new System.Collections.SortedList.SortedListEnumerator(this,0,this._size,System.Collections.SortedList.SortedListEnumerator.DictEntry)},GetEnumerator:function(){return new System.Collections.SortedList.SortedListEnumerator(this,0,this._size,System.Collections.SortedList.SortedListEnumerator.DictEntry)},GetKey:function(e){if(e<0||e>=this.Count)throw new System.ArgumentOutOfRangeException.$ctor1("index");return this.keys[System.Array.index(e,this.keys)]},GetKeyList:function(){return null==this.keyList&&(this.keyList=new System.Collections.SortedList.KeyList(this)),this.keyList},GetValueList:function(){return null==this.valueList&&(this.valueList=new System.Collections.SortedList.ValueList(this)),this.valueList},IndexOfKey:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("key");e=System.Array.binarySearch(this.keys,0,this._size,e,this.comparer);return 0<=e?e:-1},IndexOfValue:function(e){return System.Array.indexOfT(this.values,e,0,this._size)},Insert:function(e,t,n){this._size===this.keys.length&&this.EnsureCapacity(this._size+1|0),e<this._size&&(System.Array.copy(this.keys,e,this.keys,e+1|0,this._size-e|0),System.Array.copy(this.values,e,this.values,e+1|0,this._size-e|0)),this.keys[System.Array.index(e,this.keys)]=t,this.values[System.Array.index(e,this.values)]=n,this._size=this._size+1|0,this.version=this.version+1|0},RemoveAt:function(e){if(e<0||e>=this.Count)throw new System.ArgumentOutOfRangeException.$ctor1("index");this._size=this._size-1|0,e<this._size&&(System.Array.copy(this.keys,e+1|0,this.keys,e,this._size-e|0),System.Array.copy(this.values,e+1|0,this.values,e,this._size-e|0)),this.keys[System.Array.index(this._size,this.keys)]=null,this.values[System.Array.index(this._size,this.values)]=null,this.version=this.version+1|0},remove:function(e){e=this.IndexOfKey(e);0<=e&&this.RemoveAt(e)},SetByIndex:function(e,t){if(e<0||e>=this.Count)throw new System.ArgumentOutOfRangeException.$ctor1("index");this.values[System.Array.index(e,this.values)]=t,this.version=this.version+1|0},TrimToSize:function(){this.Capacity=this._size}}}),Bridge.define("System.Collections.SortedList.KeyList",{inherits:[System.Collections.IList],$kind:"nested class",fields:{sortedList:null},props:{Count:{get:function(){return this.sortedList._size}},IsReadOnly:{get:function(){return!0}},IsFixedSize:{get:function(){return!0}},IsSynchronized:{get:function(){return this.sortedList.IsSynchronized}},SyncRoot:{get:function(){return this.sortedList.SyncRoot}}},alias:["Count","System$Collections$ICollection$Count","IsReadOnly","System$Collections$IList$IsReadOnly","IsFixedSize","System$Collections$IList$IsFixedSize","IsSynchronized","System$Collections$ICollection$IsSynchronized","SyncRoot","System$Collections$ICollection$SyncRoot","add","System$Collections$IList$add","clear","System$Collections$IList$clear","contains","System$Collections$IList$contains","copyTo","System$Collections$ICollection$copyTo","insert","System$Collections$IList$insert","getItem","System$Collections$IList$getItem","setItem","System$Collections$IList$setItem","GetEnumerator","System$Collections$IEnumerable$GetEnumerator","indexOf","System$Collections$IList$indexOf","remove","System$Collections$IList$remove","removeAt","System$Collections$IList$removeAt"],ctors:{ctor:function(e){this.$initialize(),this.sortedList=e}},methods:{getItem:function(e){return this.sortedList.GetKey(e)},setItem:function(e,t){throw new System.NotSupportedException.ctor},add:function(e){throw new System.NotSupportedException.ctor},clear:function(){throw new System.NotSupportedException.ctor},contains:function(e){return this.sortedList.contains(e)},copyTo:function(e,t){if(null!=e&&1!==System.Array.getRank(e))throw new System.ArgumentException.ctor;System.Array.copy(this.sortedList.keys,0,e,t,this.sortedList.Count)},insert:function(e,t){throw new System.NotSupportedException.ctor},GetEnumerator:function(){return new System.Collections.SortedList.SortedListEnumerator(this.sortedList,0,this.sortedList.Count,System.Collections.SortedList.SortedListEnumerator.Keys)},indexOf:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("key");e=System.Array.binarySearch(this.sortedList.keys,0,this.sortedList.Count,e,this.sortedList.comparer);return 0<=e?e:-1},remove:function(e){throw new System.NotSupportedException.ctor},removeAt:function(e){throw new System.NotSupportedException.ctor}}}),Bridge.define("System.Collections.SortedList.SortedListDebugView",{$kind:"nested class",fields:{sortedList:null},props:{Items:{get:function(){return this.sortedList.ToKeyValuePairsArray()}}},ctors:{ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("sortedList");this.sortedList=e}}}),Bridge.define("System.Collections.SortedList.SortedListEnumerator",{inherits:[System.Collections.IDictionaryEnumerator,System.ICloneable],$kind:"nested class",statics:{fields:{Keys:0,Values:0,DictEntry:0},ctors:{init:function(){this.Keys=1,this.Values=2,this.DictEntry=3}}},fields:{sortedList:null,key:null,value:null,index:0,startIndex:0,endIndex:0,version:0,current:!1,getObjectRetType:0},props:{Key:{get:function(){if(this.version!==this.sortedList.version)throw new System.InvalidOperationException.ctor;if(!1===this.current)throw new System.InvalidOperationException.ctor;return this.key}},Entry:{get:function(){if(this.version!==this.sortedList.version)throw new System.InvalidOperationException.ctor;if(!1===this.current)throw new System.InvalidOperationException.ctor;return new System.Collections.DictionaryEntry.$ctor1(this.key,this.value)}},Current:{get:function(){if(!1===this.current)throw new System.InvalidOperationException.ctor;return this.getObjectRetType===System.Collections.SortedList.SortedListEnumerator.Keys?this.key:this.getObjectRetType===System.Collections.SortedList.SortedListEnumerator.Values?this.value:new System.Collections.DictionaryEntry.$ctor1(this.key,this.value).$clone()}},Value:{get:function(){if(this.version!==this.sortedList.version)throw new System.InvalidOperationException.ctor;if(!1===this.current)throw new System.InvalidOperationException.ctor;return this.value}}},alias:["clone","System$ICloneable$clone","Key","System$Collections$IDictionaryEnumerator$Key","moveNext","System$Collections$IEnumerator$moveNext","Entry","System$Collections$IDictionaryEnumerator$Entry","Current","System$Collections$IEnumerator$Current","Value","System$Collections$IDictionaryEnumerator$Value","reset","System$Collections$IEnumerator$reset"],ctors:{ctor:function(e,t,n,i){this.$initialize(),this.sortedList=e,this.index=t,this.startIndex=t,this.endIndex=t+n|0,this.version=e.version,this.getObjectRetType=i,this.current=!1}},methods:{clone:function(){return Bridge.clone(this)},moveNext:function(){var e;if(this.version!==this.sortedList.version)throw new System.InvalidOperationException.ctor;return this.index<this.endIndex?(this.key=(e=this.sortedList.keys)[System.Array.index(this.index,e)],this.value=(e=this.sortedList.values)[System.Array.index(this.index,e)],this.index=this.index+1|0,this.current=!0):(this.key=null,this.value=null,this.current=!1)},reset:function(){if(this.version!==this.sortedList.version)throw new System.InvalidOperationException.ctor;this.index=this.startIndex,this.current=!1,this.key=null,this.value=null}}}),Bridge.define("System.Collections.SortedList.SyncSortedList",{inherits:[System.Collections.SortedList],$kind:"nested class",fields:{_list:null,_root:null},props:{Count:{get:function(){return this._root,this._list.Count}},SyncRoot:{get:function(){return this._root}},IsReadOnly:{get:function(){return this._list.IsReadOnly}},IsFixedSize:{get:function(){return this._list.IsFixedSize}},IsSynchronized:{get:function(){return!0}},Capacity:{get:function(){return this._root,this._list.Capacity}}},alias:["Count","System$Collections$ICollection$Count","SyncRoot","System$Collections$ICollection$SyncRoot","IsReadOnly","System$Collections$IDictionary$IsReadOnly","IsFixedSize","System$Collections$IDictionary$IsFixedSize","IsSynchronized","System$Collections$ICollection$IsSynchronized","getItem","System$Collections$IDictionary$getItem","setItem","System$Collections$IDictionary$setItem","add","System$Collections$IDictionary$add","clear","System$Collections$IDictionary$clear","clone","System$ICloneable$clone","contains","System$Collections$IDictionary$contains","copyTo","System$Collections$ICollection$copyTo","GetEnumerator","System$Collections$IDictionary$GetEnumerator","GetEnumerator","System$Collections$IEnumerable$GetEnumerator","remove","System$Collections$IDictionary$remove"],ctors:{ctor:function(e){this.$initialize(),System.Collections.SortedList.ctor.call(this),this._list=e,this._root=e.SyncRoot}},methods:{getItem:function(e){return this._root,this._list.getItem(e)},setItem:function(e,t){this._root,this._list.setItem(e,t)},add:function(e,t){this._root,this._list.add(e,t)},clear:function(){this._root,this._list.clear()},clone:function(){return this._root,this._list.clone()},contains:function(e){return this._root,this._list.contains(e)},ContainsKey:function(e){return this._root,this._list.ContainsKey(e)},ContainsValue:function(e){return this._root,this._list.ContainsValue(e)},copyTo:function(e,t){this._root,this._list.copyTo(e,t)},GetByIndex:function(e){return this._root,this._list.GetByIndex(e)},GetEnumerator:function(){return this._root,this._list.GetEnumerator()},GetKey:function(e){return this._root,this._list.GetKey(e)},GetKeyList:function(){return this._root,this._list.GetKeyList()},GetValueList:function(){return this._root,this._list.GetValueList()},IndexOfKey:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("key");return this._list.IndexOfKey(e)},IndexOfValue:function(e){return this._root,this._list.IndexOfValue(e)},RemoveAt:function(e){this._root,this._list.RemoveAt(e)},remove:function(e){this._root,this._list.remove(e)},SetByIndex:function(e,t){this._root,this._list.SetByIndex(e,t)},ToKeyValuePairsArray:function(){return this._list.ToKeyValuePairsArray()},TrimToSize:function(){this._root,this._list.TrimToSize()}}}),Bridge.define("System.Collections.SortedList.ValueList",{inherits:[System.Collections.IList],$kind:"nested class",fields:{sortedList:null},props:{Count:{get:function(){return this.sortedList._size}},IsReadOnly:{get:function(){return!0}},IsFixedSize:{get:function(){return!0}},IsSynchronized:{get:function(){return this.sortedList.IsSynchronized}},SyncRoot:{get:function(){return this.sortedList.SyncRoot}}},alias:["Count","System$Collections$ICollection$Count","IsReadOnly","System$Collections$IList$IsReadOnly","IsFixedSize","System$Collections$IList$IsFixedSize","IsSynchronized","System$Collections$ICollection$IsSynchronized","SyncRoot","System$Collections$ICollection$SyncRoot","add","System$Collections$IList$add","clear","System$Collections$IList$clear","contains","System$Collections$IList$contains","copyTo","System$Collections$ICollection$copyTo","insert","System$Collections$IList$insert","getItem","System$Collections$IList$getItem","setItem","System$Collections$IList$setItem","GetEnumerator","System$Collections$IEnumerable$GetEnumerator","indexOf","System$Collections$IList$indexOf","remove","System$Collections$IList$remove","removeAt","System$Collections$IList$removeAt"],ctors:{ctor:function(e){this.$initialize(),this.sortedList=e}},methods:{getItem:function(e){return this.sortedList.GetByIndex(e)},setItem:function(e,t){throw new System.NotSupportedException.ctor},add:function(e){throw new System.NotSupportedException.ctor},clear:function(){throw new System.NotSupportedException.ctor},contains:function(e){return this.sortedList.ContainsValue(e)},copyTo:function(e,t){if(null!=e&&1!==System.Array.getRank(e))throw new System.ArgumentException.ctor;System.Array.copy(this.sortedList.values,0,e,t,this.sortedList.Count)},insert:function(e,t){throw new System.NotSupportedException.ctor},GetEnumerator:function(){return new System.Collections.SortedList.SortedListEnumerator(this.sortedList,0,this.sortedList.Count,System.Collections.SortedList.SortedListEnumerator.Values)},indexOf:function(e){return System.Array.indexOfT(this.sortedList.values,e,0,this.sortedList.Count)},remove:function(e){throw new System.NotSupportedException.ctor},removeAt:function(e){throw new System.NotSupportedException.ctor}}}),Bridge.define("System.Collections.Generic.SortedList$2",function(o,a){return{inherits:[System.Collections.Generic.IDictionary$2(o,a),System.Collections.IDictionary,System.Collections.Generic.IReadOnlyDictionary$2(o,a)],statics:{fields:{_defaultCapacity:0,MaxArrayLength:0,emptyKeys:null,emptyValues:null},ctors:{init:function(){this._defaultCapacity=4,this.MaxArrayLength=2146435071,this.emptyKeys=System.Array.init(0,function(){return Bridge.getDefaultValue(o)},o),this.emptyValues=System.Array.init(0,function(){return Bridge.getDefaultValue(a)},a)}},methods:{IsCompatibleKey:function(e){return null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key),Bridge.is(e,o)}}},fields:{keys:null,values:null,_size:0,version:0,comparer:null,keyList:null,valueList:null},props:{Capacity:{get:function(){return this.keys.length},set:function(e){var t;e!==this.keys.length&&(e<this._size&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.value,System.ExceptionResource.ArgumentOutOfRange_SmallCapacity),0<e?(t=System.Array.init(e,function(){return Bridge.getDefaultValue(o)},o),e=System.Array.init(e,function(){return Bridge.getDefaultValue(a)},a),0<this._size&&(System.Array.copy(this.keys,0,t,0,this._size),System.Array.copy(this.values,0,e,0,this._size)),this.keys=t,this.values=e):(this.keys=System.Collections.Generic.SortedList$2(o,a).emptyKeys,this.values=System.Collections.Generic.SortedList$2(o,a).emptyValues))}},Comparer:{get:function(){return this.comparer}},Count:{get:function(){return this._size}},Keys:{get:function(){return this.GetKeyListHelper()}},System$Collections$Generic$IDictionary$2$Keys:{get:function(){return this.GetKeyListHelper()}},System$Collections$IDictionary$Keys:{get:function(){return this.GetKeyListHelper()}},System$Collections$Generic$IReadOnlyDictionary$2$Keys:{get:function(){return this.GetKeyListHelper()}},Values:{get:function(){return this.GetValueListHelper()}},System$Collections$Generic$IDictionary$2$Values:{get:function(){return this.GetValueListHelper()}},System$Collections$IDictionary$Values:{get:function(){return this.GetValueListHelper()}},System$Collections$Generic$IReadOnlyDictionary$2$Values:{get:function(){return this.GetValueListHelper()}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!1}},System$Collections$IDictionary$IsReadOnly:{get:function(){return!1}},System$Collections$IDictionary$IsFixedSize:{get:function(){return!1}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return null}}},alias:["add","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$add","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$add","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$add","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$contains","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$contains","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$remove","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$remove","Count",["System$Collections$Generic$IReadOnlyCollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$Count","System$Collections$Generic$IDictionary$2$Keys","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$Keys","System$Collections$Generic$IReadOnlyDictionary$2$Keys","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$Keys","System$Collections$Generic$IDictionary$2$Values","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$Values","System$Collections$Generic$IReadOnlyDictionary$2$Values","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$Values","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$IsReadOnly","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$IsReadOnly","clear","System$Collections$IDictionary$clear","clear","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$clear","containsKey","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$containsKey","containsKey","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$containsKey","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$copyTo","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$copyTo","System$Collections$Generic$IEnumerable$1$System$Collections$Generic$KeyValuePair$2$GetEnumerator","System$Collections$Generic$IEnumerable$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$GetEnumerator","getItem","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$getItem","setItem","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$setItem","getItem","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$getItem","setItem","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$setItem","getItem$1","System$Collections$IDictionary$getItem","setItem$1","System$Collections$IDictionary$setItem","tryGetValue","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$tryGetValue","tryGetValue","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$tryGetValue","remove","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$remove"],ctors:{ctor:function(){this.$initialize(),this.keys=System.Collections.Generic.SortedList$2(o,a).emptyKeys,this.values=System.Collections.Generic.SortedList$2(o,a).emptyValues,this._size=0,this.comparer=new(System.Collections.Generic.Comparer$1(o))(System.Collections.Generic.Comparer$1.$default.fn)},$ctor4:function(e){this.$initialize(),e<0&&System.ThrowHelper.ThrowArgumentOutOfRangeException$1(System.ExceptionArgument.capacity),this.keys=System.Array.init(e,function(){return Bridge.getDefaultValue(o)},o),this.values=System.Array.init(e,function(){return Bridge.getDefaultValue(a)},a),this.comparer=new(System.Collections.Generic.Comparer$1(o))(System.Collections.Generic.Comparer$1.$default.fn)},$ctor1:function(e){System.Collections.Generic.SortedList$2(o,a).ctor.call(this),null!=e&&(this.comparer=e)},$ctor5:function(e,t){System.Collections.Generic.SortedList$2(o,a).$ctor1.call(this,t),this.Capacity=e},$ctor2:function(e){System.Collections.Generic.SortedList$2(o,a).$ctor3.call(this,e,null)},$ctor3:function(e,t){System.Collections.Generic.SortedList$2(o,a).$ctor5.call(this,null!=e?System.Array.getCount(e,System.Collections.Generic.KeyValuePair$2(o,a)):0,t),null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.dictionary),System.Array.copyTo(e["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$Keys"],this.keys,0,o),System.Array.copyTo(e["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$Values"],this.values,0,a),System.Array.sortDict(this.keys,this.values,0,null,this.comparer),this._size=System.Array.getCount(e,System.Collections.Generic.KeyValuePair$2(o,a))}},methods:{getItem:function(e){e=this.IndexOfKey(e);if(0<=e)return this.values[System.Array.index(e,this.values)];throw new System.Collections.Generic.KeyNotFoundException.ctor},setItem:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key);var n=System.Array.binarySearch(this.keys,0,this._size,e,this.comparer);if(0<=n)return this.values[System.Array.index(n,this.values)]=t,void(this.version=this.version+1|0);this.Insert(~n,e,t)},getItem$1:function(e){if(System.Collections.Generic.SortedList$2(o,a).IsCompatibleKey(e)){e=this.IndexOfKey(Bridge.cast(Bridge.unbox(e,o),o));if(0<=e)return this.values[System.Array.index(e,this.values)]}return null},setItem$1:function(t,n){System.Collections.Generic.SortedList$2(o,a).IsCompatibleKey(t)||System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key),System.ThrowHelper.IfNullAndNullsAreIllegalThenThrow(a,n,System.ExceptionArgument.value);try{var e=Bridge.cast(Bridge.unbox(t,o),o);try{this.setItem(e,Bridge.cast(Bridge.unbox(n,a),a))}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongValueTypeArgumentException(System.Object,n,a)}}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongKeyTypeArgumentException(System.Object,t,o)}},add:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key);var n=System.Array.binarySearch(this.keys,0,this._size,e,this.comparer);0<=n&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_AddingDuplicate),this.Insert(~n,e,t)},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$add:function(e){this.add(e.key,e.value)},System$Collections$IDictionary$add:function(t,n){null==t&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key),System.ThrowHelper.IfNullAndNullsAreIllegalThenThrow(a,n,System.ExceptionArgument.value);try{var e=Bridge.cast(Bridge.unbox(t,o),o);try{this.add(e,Bridge.cast(Bridge.unbox(n,a),a))}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongValueTypeArgumentException(System.Object,n,a)}}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongKeyTypeArgumentException(System.Object,t,o)}},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$contains:function(e){var t=this.IndexOfKey(e.key);return!!(0<=t&&System.Collections.Generic.EqualityComparer$1(a).def.equals2(this.values[System.Array.index(t,this.values)],e.value))},System$Collections$IDictionary$contains:function(e){return!!System.Collections.Generic.SortedList$2(o,a).IsCompatibleKey(e)&&this.containsKey(Bridge.cast(Bridge.unbox(e,o),o))},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$remove:function(e){var t=this.IndexOfKey(e.key);return!!(0<=t&&System.Collections.Generic.EqualityComparer$1(a).def.equals2(this.values[System.Array.index(t,this.values)],e.value))&&(this.RemoveAt(t),!0)},remove:function(e){e=this.IndexOfKey(e);return 0<=e&&this.RemoveAt(e),0<=e},System$Collections$IDictionary$remove:function(e){System.Collections.Generic.SortedList$2(o,a).IsCompatibleKey(e)&&this.remove(Bridge.cast(Bridge.unbox(e,o),o))},GetKeyListHelper:function(){return null==this.keyList&&(this.keyList=new(System.Collections.Generic.SortedList$2.KeyList(o,a))(this)),this.keyList},GetValueListHelper:function(){return null==this.valueList&&(this.valueList=new(System.Collections.Generic.SortedList$2.ValueList(o,a))(this)),this.valueList},clear:function(){this.version=this.version+1|0,System.Array.fill(this.keys,function(){return Bridge.getDefaultValue(o)},0,this._size),System.Array.fill(this.values,function(){return Bridge.getDefaultValue(a)},0,this._size),this._size=0},containsKey:function(e){return 0<=this.IndexOfKey(e)},ContainsValue:function(e){return 0<=this.IndexOfValue(e)},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$copyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),(t<0||t>e.length)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.arrayIndex,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum),(e.length-t|0)<this.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);for(var n=0;n<this.Count;n=n+1|0){var i=new(System.Collections.Generic.KeyValuePair$2(o,a).$ctor1)(this.keys[System.Array.index(n,this.keys)],this.values[System.Array.index(n,this.values)]);e[System.Array.index(t+n|0,e)]=i}},System$Collections$ICollection$copyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),1!==System.Array.getRank(e)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_RankMultiDimNotSupported),0!==System.Array.getLower(e,0)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_NonZeroLowerBound),(t<0||t>e.length)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.arrayIndex,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum),(e.length-t|0)<this.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);var n=Bridge.as(e,System.Array.type(System.Collections.Generic.KeyValuePair$2(o,a)));if(null!=n)for(var i=0;i<this.Count;i=i+1|0)n[System.Array.index(i+t|0,n)]=new(System.Collections.Generic.KeyValuePair$2(o,a).$ctor1)(this.keys[System.Array.index(i,this.keys)],this.values[System.Array.index(i,this.values)]);else{var r=Bridge.as(e,System.Array.type(System.Object));null==r&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType);try{for(var s=0;s<this.Count;s=s+1|0)r[System.Array.index(s+t|0,r)]=new(System.Collections.Generic.KeyValuePair$2(o,a).$ctor1)(this.keys[System.Array.index(s,this.keys)],this.values[System.Array.index(s,this.values)])}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.ArrayTypeMismatchException))throw e;System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType)}}},EnsureCapacity:function(e){var t=0===this.keys.length?System.Collections.Generic.SortedList$2(o,a)._defaultCapacity:Bridge.Int.mul(this.keys.length,2);t>>>0>System.Collections.Generic.SortedList$2(o,a).MaxArrayLength&&(t=System.Collections.Generic.SortedList$2(o,a).MaxArrayLength),t<e&&(t=e),this.Capacity=t},GetByIndex:function(e){return(e<0||e>=this._size)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_Index),this.values[System.Array.index(e,this.values)]},GetEnumerator:function(){return new(System.Collections.Generic.SortedList$2.Enumerator(o,a).$ctor1)(this,System.Collections.Generic.SortedList$2.Enumerator(o,a).KeyValuePair).$clone()},System$Collections$Generic$IEnumerable$1$System$Collections$Generic$KeyValuePair$2$GetEnumerator:function(){return new(System.Collections.Generic.SortedList$2.Enumerator(o,a).$ctor1)(this,System.Collections.Generic.SortedList$2.Enumerator(o,a).KeyValuePair).$clone()},System$Collections$IDictionary$GetEnumerator:function(){return new(System.Collections.Generic.SortedList$2.Enumerator(o,a).$ctor1)(this,System.Collections.Generic.SortedList$2.Enumerator(o,a).DictEntry).$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.SortedList$2.Enumerator(o,a).$ctor1)(this,System.Collections.Generic.SortedList$2.Enumerator(o,a).KeyValuePair).$clone()},GetKey:function(e){return(e<0||e>=this._size)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_Index),this.keys[System.Array.index(e,this.keys)]},IndexOfKey:function(e){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key);e=System.Array.binarySearch(this.keys,0,this._size,e,this.comparer);return 0<=e?e:-1},IndexOfValue:function(e){return System.Array.indexOfT(this.values,e,0,this._size)},Insert:function(e,t,n){this._size===this.keys.length&&this.EnsureCapacity(this._size+1|0),e<this._size&&(System.Array.copy(this.keys,e,this.keys,e+1|0,this._size-e|0),System.Array.copy(this.values,e,this.values,e+1|0,this._size-e|0)),this.keys[System.Array.index(e,this.keys)]=t,this.values[System.Array.index(e,this.values)]=n,this._size=this._size+1|0,this.version=this.version+1|0},tryGetValue:function(e,t){e=this.IndexOfKey(e);return 0<=e?(t.v=this.values[System.Array.index(e,this.values)],!0):(t.v=Bridge.getDefaultValue(a),!1)},RemoveAt:function(e){(e<0||e>=this._size)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_Index),this._size=this._size-1|0,e<this._size&&(System.Array.copy(this.keys,e+1|0,this.keys,e,this._size-e|0),System.Array.copy(this.values,e+1|0,this.values,e,this._size-e|0)),this.keys[System.Array.index(this._size,this.keys)]=Bridge.getDefaultValue(o),this.values[System.Array.index(this._size,this.values)]=Bridge.getDefaultValue(a),this.version=this.version+1|0},TrimExcess:function(){var e=Bridge.Int.clip32(.9*this.keys.length);this._size<e&&(this.Capacity=this._size)}}}}),Bridge.define("System.Collections.Generic.SortedList$2.Enumerator",function(n,i){return{inherits:[System.Collections.Generic.IEnumerator$1(System.Collections.Generic.KeyValuePair$2(n,i)),System.Collections.IDictionaryEnumerator],$kind:"nested struct",statics:{fields:{KeyValuePair:0,DictEntry:0},ctors:{init:function(){this.KeyValuePair=1,this.DictEntry=2}},methods:{getDefaultValue:function(){return new(System.Collections.Generic.SortedList$2.Enumerator(n,i))}}},fields:{_sortedList:null,key:Bridge.getDefaultValue(n),value:Bridge.getDefaultValue(i),index:0,version:0,getEnumeratorRetType:0},props:{System$Collections$IDictionaryEnumerator$Key:{get:function(){return 0!==this.index&&this.index!==(this._sortedList.Count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.key}},System$Collections$IDictionaryEnumerator$Entry:{get:function(){return 0!==this.index&&this.index!==(this._sortedList.Count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),new System.Collections.DictionaryEntry.$ctor1(this.key,this.value)}},Current:{get:function(){return new(System.Collections.Generic.KeyValuePair$2(n,i).$ctor1)(this.key,this.value)}},System$Collections$IEnumerator$Current:{get:function(){return 0!==this.index&&this.index!==(this._sortedList.Count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.getEnumeratorRetType===System.Collections.Generic.SortedList$2.Enumerator(n,i).DictEntry?new System.Collections.DictionaryEntry.$ctor1(this.key,this.value).$clone():new(System.Collections.Generic.KeyValuePair$2(n,i).$ctor1)(this.key,this.value)}},System$Collections$IDictionaryEnumerator$Value:{get:function(){return 0!==this.index&&this.index!==(this._sortedList.Count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.value}}},alias:["Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(n)+"$"+Bridge.getTypeAlias(i)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{$ctor1:function(e,t){this.$initialize(),this._sortedList=e,this.index=0,this.version=this._sortedList.version,this.getEnumeratorRetType=t,this.key=Bridge.getDefaultValue(n),this.value=Bridge.getDefaultValue(i)},ctor:function(){this.$initialize()}},methods:{Dispose:function(){this.index=0,this.key=Bridge.getDefaultValue(n),this.value=Bridge.getDefaultValue(i)},moveNext:function(){var e;return this.version!==this._sortedList.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.index>>>0<this._sortedList.Count>>>0?(this.key=(e=this._sortedList.keys)[System.Array.index(this.index,e)],this.value=(e=this._sortedList.values)[System.Array.index(this.index,e)],this.index=this.index+1|0,!0):(this.index=this._sortedList.Count+1|0,this.key=Bridge.getDefaultValue(n),this.value=Bridge.getDefaultValue(i),!1)},System$Collections$IEnumerator$reset:function(){this.version!==this._sortedList.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.index=0,this.key=Bridge.getDefaultValue(n),this.value=Bridge.getDefaultValue(i)},getHashCode:function(){return Bridge.addHash([3788985113,this._sortedList,this.key,this.value,this.index,this.version,this.getEnumeratorRetType])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.SortedList$2.Enumerator(n,i))&&(Bridge.equals(this._sortedList,e._sortedList)&&Bridge.equals(this.key,e.key)&&Bridge.equals(this.value,e.value)&&Bridge.equals(this.index,e.index)&&Bridge.equals(this.version,e.version)&&Bridge.equals(this.getEnumeratorRetType,e.getEnumeratorRetType))},$clone:function(e){e=e||new(System.Collections.Generic.SortedList$2.Enumerator(n,i));return e._sortedList=this._sortedList,e.key=this.key,e.value=this.value,e.index=this.index,e.version=this.version,e.getEnumeratorRetType=this.getEnumeratorRetType,e}}}}),Bridge.define("System.Collections.Generic.SortedList$2.KeyList",function(e,t){return{inherits:[System.Collections.Generic.IList$1(e),System.Collections.ICollection],$kind:"nested class",fields:{_dict:null},props:{Count:{get:function(){return this._dict._size}},IsReadOnly:{get:function(){return!0}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return Bridge.cast(this._dict,System.Collections.ICollection).System$Collections$ICollection$SyncRoot}}},alias:["Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$Count","IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$IsReadOnly","add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$add","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$copyTo","insert","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$insert","getItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$getItem","setItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$setItem","GetEnumerator",["System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(e)+"$GetEnumerator","System$Collections$Generic$IEnumerable$1$GetEnumerator"],"indexOf","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$indexOf","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(e)+"$remove","removeAt","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(e)+"$removeAt"],ctors:{ctor:function(e){this.$initialize(),this._dict=e}},methods:{getItem:function(e){return this._dict.GetKey(e)},setItem:function(e,t){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_KeyCollectionSet)},add:function(e){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite)},clear:function(){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite)},contains:function(e){return this._dict.containsKey(e)},copyTo:function(e,t){System.Array.copy(this._dict.keys,0,e,t,this._dict.Count)},System$Collections$ICollection$copyTo:function(e,t){null!=e&&1!==System.Array.getRank(e)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_RankMultiDimNotSupported);try{System.Array.copy(this._dict.keys,0,e,t,this._dict.Count)}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.ArrayTypeMismatchException))throw e;System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType)}},insert:function(e,t){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite)},GetEnumerator:function(){return new(System.Collections.Generic.SortedList$2.SortedListKeyEnumerator(e,t))(this._dict)},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.SortedList$2.SortedListKeyEnumerator(e,t))(this._dict)},indexOf:function(e){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key);e=System.Array.binarySearch(this._dict.keys,0,this._dict.Count,e,this._dict.comparer);return 0<=e?e:-1},remove:function(e){return System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite),!1},removeAt:function(e){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite)}}}}),Bridge.define("System.Collections.Generic.SortedList$2.SortedListKeyEnumerator",function(t,e){return{inherits:[System.Collections.Generic.IEnumerator$1(t),System.Collections.IEnumerator],$kind:"nested class",fields:{_sortedList:null,index:0,version:0,currentKey:Bridge.getDefaultValue(t)},props:{Current:{get:function(){return this.currentKey}},System$Collections$IEnumerator$Current:{get:function(){return 0!==this.index&&this.index!==(this._sortedList.Count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.currentKey}}},alias:["Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{ctor:function(e){this.$initialize(),this._sortedList=e,this.version=e.version}},methods:{Dispose:function(){this.index=0,this.currentKey=Bridge.getDefaultValue(t)},moveNext:function(){var e;return this.version!==this._sortedList.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.index>>>0<this._sortedList.Count>>>0?(this.currentKey=(e=this._sortedList.keys)[System.Array.index(this.index,e)],this.index=this.index+1|0,!0):(this.index=this._sortedList.Count+1|0,this.currentKey=Bridge.getDefaultValue(t),!1)},System$Collections$IEnumerator$reset:function(){this.version!==this._sortedList.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.index=0,this.currentKey=Bridge.getDefaultValue(t)}}}}),Bridge.define("System.Collections.Generic.SortedList$2.SortedListValueEnumerator",function(e,t){return{inherits:[System.Collections.Generic.IEnumerator$1(t),System.Collections.IEnumerator],$kind:"nested class",fields:{_sortedList:null,index:0,version:0,currentValue:Bridge.getDefaultValue(t)},props:{Current:{get:function(){return this.currentValue}},System$Collections$IEnumerator$Current:{get:function(){return 0!==this.index&&this.index!==(this._sortedList.Count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.currentValue}}},alias:["Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{ctor:function(e){this.$initialize(),this._sortedList=e,this.version=e.version}},methods:{Dispose:function(){this.index=0,this.currentValue=Bridge.getDefaultValue(t)},moveNext:function(){var e;return this.version!==this._sortedList.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.index>>>0<this._sortedList.Count>>>0?(this.currentValue=(e=this._sortedList.values)[System.Array.index(this.index,e)],this.index=this.index+1|0,!0):(this.index=this._sortedList.Count+1|0,this.currentValue=Bridge.getDefaultValue(t),!1)},System$Collections$IEnumerator$reset:function(){this.version!==this._sortedList.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.index=0,this.currentValue=Bridge.getDefaultValue(t)}}}}),Bridge.define("System.Collections.Generic.SortedList$2.ValueList",function(e,t){return{inherits:[System.Collections.Generic.IList$1(t),System.Collections.ICollection],$kind:"nested class",fields:{_dict:null},props:{Count:{get:function(){return this._dict._size}},IsReadOnly:{get:function(){return!0}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return Bridge.cast(this._dict,System.Collections.ICollection).System$Collections$ICollection$SyncRoot}}},alias:["Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$Count","IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$IsReadOnly","add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$add","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$copyTo","insert","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$insert","getItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$getItem","setItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$setItem","GetEnumerator",["System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(t)+"$GetEnumerator","System$Collections$Generic$IEnumerable$1$GetEnumerator"],"indexOf","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$indexOf","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(t)+"$remove","removeAt","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(t)+"$removeAt"],ctors:{ctor:function(e){this.$initialize(),this._dict=e}},methods:{getItem:function(e){return this._dict.GetByIndex(e)},setItem:function(e,t){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite)},add:function(e){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite)},clear:function(){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite)},contains:function(e){return this._dict.ContainsValue(e)},copyTo:function(e,t){System.Array.copy(this._dict.values,0,e,t,this._dict.Count)},System$Collections$ICollection$copyTo:function(e,t){null!=e&&1!==System.Array.getRank(e)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_RankMultiDimNotSupported);try{System.Array.copy(this._dict.values,0,e,t,this._dict.Count)}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.ArrayTypeMismatchException))throw e;System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType)}},insert:function(e,t){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite)},GetEnumerator:function(){return new(System.Collections.Generic.SortedList$2.SortedListValueEnumerator(e,t))(this._dict)},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.SortedList$2.SortedListValueEnumerator(e,t))(this._dict)},indexOf:function(e){return System.Array.indexOfT(this._dict.values,e,0,this._dict.Count)},remove:function(e){return System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite),!1},removeAt:function(e){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_SortedListNestedWrite)}}}}),Bridge.define("System.Collections.Generic.SortedSet$1",function(y){return{inherits:[System.Collections.Generic.ISet$1(y),System.Collections.Generic.ICollection$1(y),System.Collections.ICollection,System.Collections.Generic.IReadOnlyCollection$1(y)],statics:{fields:{ComparerName:null,CountName:null,ItemsName:null,VersionName:null,TreeName:null,NodeValueName:null,EnumStartName:null,ReverseName:null,EnumVersionName:null,minName:null,maxName:null,lBoundActiveName:null,uBoundActiveName:null,StackAllocThreshold:0},ctors:{init:function(){this.ComparerName="Comparer",this.CountName="Count",this.ItemsName="Items",this.VersionName="Version",this.TreeName="Tree",this.NodeValueName="Item",this.EnumStartName="EnumStarted",this.ReverseName="Reverse",this.EnumVersionName="EnumVersion",this.minName="Min",this.maxName="Max",this.lBoundActiveName="lBoundActive",this.uBoundActiveName="uBoundActive",this.StackAllocThreshold=100}},methods:{GetSibling:function(e,t){return Bridge.referenceEquals(t.Left,e)?t.Right:t.Left},Is2Node:function(e){return System.Collections.Generic.SortedSet$1(y).IsBlack(e)&&System.Collections.Generic.SortedSet$1(y).IsNullOrBlack(e.Left)&&System.Collections.Generic.SortedSet$1(y).IsNullOrBlack(e.Right)},Is4Node:function(e){return System.Collections.Generic.SortedSet$1(y).IsRed(e.Left)&&System.Collections.Generic.SortedSet$1(y).IsRed(e.Right)},IsBlack:function(e){return null!=e&&!e.IsRed},IsNullOrBlack:function(e){return null==e||!e.IsRed},IsRed:function(e){return null!=e&&e.IsRed},Merge2Nodes:function(e,t,n){e.IsRed=!1,t.IsRed=!0,n.IsRed=!0},RotateLeft:function(e){var t=e.Right;return e.Right=t.Left,t.Left=e,t},RotateLeftRight:function(e){var t=e.Left,n=t.Right;return e.Left=n.Right,n.Right=e,t.Right=n.Left,n.Left=t,n},RotateRight:function(e){var t=e.Left;return e.Left=t.Right,t.Right=e,t},RotateRightLeft:function(e){var t=e.Right,n=t.Left;return e.Right=n.Left,n.Left=e,t.Left=n.Right,n.Right=t,n},RotationNeeded:function(e,t,n){return System.Collections.Generic.SortedSet$1(y).IsRed(n.Left)?Bridge.referenceEquals(e.Left,t)?System.Collections.Generic.TreeRotation.RightLeftRotation:System.Collections.Generic.TreeRotation.RightRotation:Bridge.referenceEquals(e.Left,t)?System.Collections.Generic.TreeRotation.LeftRotation:System.Collections.Generic.TreeRotation.LeftRightRotation},CreateSetComparer:function(){return new(System.Collections.Generic.SortedSetEqualityComparer$1(y).ctor)},CreateSetComparer$1:function(e){return new(System.Collections.Generic.SortedSetEqualityComparer$1(y).$ctor3)(e)},SortedSetEquals:function(e,t,n){if(null==e)return null==t;if(null==t)return!1;if(System.Collections.Generic.SortedSet$1(y).AreComparersEqual(e,t))return e.Count===t.Count&&e.setEquals(t);var i=!1,r=Bridge.getEnumerator(e);try{for(;r.moveNext();){var s=r.Current,i=!1,o=Bridge.getEnumerator(t);try{for(;o.moveNext();){var a=o.Current;if(0===n[Bridge.geti(n,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](s,a)){i=!0;break}}}finally{Bridge.is(o,System.IDisposable)&&o.System$IDisposable$Dispose()}if(!i)return!1}}finally{Bridge.is(r,System.IDisposable)&&r.System$IDisposable$Dispose()}return!0},AreComparersEqual:function(e,t){return Bridge.equals(e.Comparer,t.Comparer)},Split4Node:function(e){e.IsRed=!0,e.Left.IsRed=!1,e.Right.IsRed=!1},ConstructRootFromSortedArray:function(e,t,n,i){var r=1+(n-t|0)|0;if(0==r)return null;var s,o=null;return 1==r?(o=new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(e[System.Array.index(t,e)],!1),null!=i&&(o.Left=i)):2==r?((o=new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(e[System.Array.index(t,e)],!1)).Right=new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(e[System.Array.index(n,e)],!1),o.Right.IsRed=!0,null!=i&&(o.Left=i)):3==r?((o=new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(e[System.Array.index(t+1|0,e)],!1)).Left=new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(e[System.Array.index(t,e)],!1),o.Right=new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(e[System.Array.index(n,e)],!1),null!=i&&(o.Left.Left=i)):(s=0|Bridge.Int.div(t+n|0,2),(o=new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(e[System.Array.index(s,e)],!1)).Left=System.Collections.Generic.SortedSet$1(y).ConstructRootFromSortedArray(e,t,s-1|0,i),o.Right=r%2==0?System.Collections.Generic.SortedSet$1(y).ConstructRootFromSortedArray(e,2+s|0,n,new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(e[System.Array.index(1+s|0,e)],!0)):System.Collections.Generic.SortedSet$1(y).ConstructRootFromSortedArray(e,1+s|0,n,null)),o},log2:function(e){for(var t=0;0<e;)t=t+1|0,e>>=1;return t}}},fields:{root:null,comparer:null,count:0,version:0},props:{Count:{get:function(){return this.VersionCheck(),this.count}},Comparer:{get:function(){return this.comparer}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!1}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return null}},Min:{get:function(){var t=Bridge.getDefaultValue(y);return this.InOrderTreeWalk(function(e){return t=e.Item,!1}),t}},Max:{get:function(){var t=Bridge.getDefaultValue(y);return this.InOrderTreeWalk$1(function(e){return t=e.Item,!1},!0),t}}},alias:["Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(y)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$Count","System$Collections$Generic$ICollection$1$IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$IsReadOnly","add","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$add","System$Collections$Generic$ICollection$1$add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$add","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$remove","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$copyTo","System$Collections$Generic$IEnumerable$1$GetEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(y)+"$GetEnumerator","unionWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$unionWith","intersectWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$intersectWith","exceptWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$exceptWith","symmetricExceptWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$symmetricExceptWith","isSubsetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$isSubsetOf","isProperSubsetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$isProperSubsetOf","isSupersetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$isSupersetOf","isProperSupersetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$isProperSupersetOf","setEquals","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$setEquals","overlaps","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$overlaps"],ctors:{ctor:function(){this.$initialize(),this.comparer=new(System.Collections.Generic.Comparer$1(y))(System.Collections.Generic.Comparer$1.$default.fn)},$ctor1:function(e){this.$initialize(),this.comparer=null==e?new(System.Collections.Generic.Comparer$1(y))(System.Collections.Generic.Comparer$1.$default.fn):e},$ctor2:function(e){System.Collections.Generic.SortedSet$1(y).$ctor3.call(this,e,new(System.Collections.Generic.Comparer$1(y))(System.Collections.Generic.Comparer$1.$default.fn))},$ctor3:function(e,t){if(System.Collections.Generic.SortedSet$1(y).$ctor1.call(this,t),null==e)throw new System.ArgumentNullException.$ctor1("collection");var n=Bridge.as(e,System.Collections.Generic.SortedSet$1(y)),t=Bridge.as(e,System.Collections.Generic.SortedSet$1.TreeSubSet(y));if(null!=n&&null==t&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,n)){if(0===n.Count)return this.count=0,this.version=0,void(this.root=null);var i=new(System.Collections.Generic.Stack$1(System.Collections.Generic.SortedSet$1.Node(y)).$ctor2)(Bridge.Int.mul(2,System.Collections.Generic.SortedSet$1(y).log2(n.Count))+2|0),r=new(System.Collections.Generic.Stack$1(System.Collections.Generic.SortedSet$1.Node(y)).$ctor2)(Bridge.Int.mul(2,System.Collections.Generic.SortedSet$1(y).log2(n.Count))+2|0),s=n.root,o=null!=s?new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(s.Item,s.IsRed):null;for(this.root=o;null!=s;)i.Push(s),r.Push(o),o.Left=null!=s.Left?new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(s.Left.Item,s.Left.IsRed):null,s=s.Left,o=o.Left;for(;0!==i.Count;){s=i.Pop(),o=r.Pop();var a=s.Right,u=null;for(null!=a&&(u=new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(a.Item,a.IsRed)),o.Right=u;null!=a;)i.Push(a),r.Push(u),u.Left=null!=a.Left?new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(a.Left.Item,a.Left.IsRed):null,a=a.Left,u=u.Left}this.count=n.count,this.version=0}else{var l=new(System.Collections.Generic.List$1(y).$ctor1)(e);l.Sort$1(this.comparer);for(var c=1;c<l.Count;c=c+1|0)0===this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](l.getItem(c),l.getItem(c-1|0))&&(l.removeAt(c),c=c-1|0);this.root=System.Collections.Generic.SortedSet$1(y).ConstructRootFromSortedArray(l.ToArray(),0,l.Count-1|0,null),this.count=l.Count,this.version=0}}},methods:{AddAllElements:function(e){var t=Bridge.getEnumerator(e,y);try{for(;t.moveNext();){var n=t.Current;this.contains(n)||this.add(n)}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}},RemoveAllElements:function(e){var t=this.Min,n=this.Max,i=Bridge.getEnumerator(e,y);try{for(;i.moveNext();){var r=i.Current;this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](r,t)<0||0<this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](r,n)||!this.contains(r)||this.remove(r)}}finally{Bridge.is(i,System.IDisposable)&&i.System$IDisposable$Dispose()}},ContainsAllElements:function(e){var t=Bridge.getEnumerator(e,y);try{for(;t.moveNext();){var n=t.Current;if(!this.contains(n))return!1}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}return!0},InOrderTreeWalk:function(e){return this.InOrderTreeWalk$1(e,!1)},InOrderTreeWalk$1:function(e,t){if(null==this.root)return!0;for(var n=new(System.Collections.Generic.Stack$1(System.Collections.Generic.SortedSet$1.Node(y)).$ctor2)(Bridge.Int.mul(2,System.Collections.Generic.SortedSet$1(y).log2(this.Count+1|0))),i=this.root;null!=i;)n.Push(i),i=t?i.Right:i.Left;for(;0!==n.Count;){if(!e(i=n.Pop()))return!1;for(var r=t?i.Left:i.Right;null!=r;)n.Push(r),r=t?r.Right:r.Left}return!0},BreadthFirstTreeWalk:function(e){if(null==this.root)return!0;var t,n=new(System.Collections.Generic.List$1(System.Collections.Generic.SortedSet$1.Node(y)).ctor);for(n.add(this.root);0!==n.Count;){if(t=n.getItem(0),n.removeAt(0),!e(t))return!1;null!=t.Left&&n.add(t.Left),null!=t.Right&&n.add(t.Right)}return!0},VersionCheck:function(){},IsWithinRange:function(e){return!0},add:function(e){return this.AddIfNotPresent(e)},System$Collections$Generic$ICollection$1$add:function(e){this.AddIfNotPresent(e)},AddIfNotPresent:function(e){if(null==this.root)return this.root=new(System.Collections.Generic.SortedSet$1.Node(y).$ctor1)(e,!1),this.count=1,this.version=this.version+1|0,!0;var t=this.root,n={v:null},i=null,r=null;this.version=this.version+1|0;for(var s=0;null!=t;){if(0===(s=this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](e,t.Item)))return this.root.IsRed=!1;System.Collections.Generic.SortedSet$1(y).Is4Node(t)&&(System.Collections.Generic.SortedSet$1(y).Split4Node(t),System.Collections.Generic.SortedSet$1(y).IsRed(n.v)&&this.InsertionBalance(t,n,i,r)),r=i,i=n.v,n.v=t,t=s<0?t.Left:t.Right}var o=new(System.Collections.Generic.SortedSet$1.Node(y).ctor)(e);return 0<s?n.v.Right=o:n.v.Left=o,n.v.IsRed&&this.InsertionBalance(o,n,i,r),this.root.IsRed=!1,this.count=this.count+1|0,!0},remove:function(e){return this.DoRemove(e)},DoRemove:function(e){if(null==this.root)return!1;this.version=this.version+1|0;for(var t=this.root,n=null,i=null,r=null,s=null,o=!1;null!=t;){if(System.Collections.Generic.SortedSet$1(y).Is2Node(t))if(null==n)t.IsRed=!0;else{var a=System.Collections.Generic.SortedSet$1(y).GetSibling(t,n);if(a.IsRed&&(Bridge.referenceEquals(n.Right,a)?System.Collections.Generic.SortedSet$1(y).RotateLeft(n):System.Collections.Generic.SortedSet$1(y).RotateRight(n),n.IsRed=!0,a.IsRed=!1,this.ReplaceChildOfNodeOrRoot(i,n,a),i=a,Bridge.referenceEquals(n,r)&&(s=a),a=Bridge.referenceEquals(n.Left,t)?n.Right:n.Left),System.Collections.Generic.SortedSet$1(y).Is2Node(a))System.Collections.Generic.SortedSet$1(y).Merge2Nodes(n,t,a);else{var u=null;switch(System.Collections.Generic.SortedSet$1(y).RotationNeeded(n,t,a)){case System.Collections.Generic.TreeRotation.RightRotation:a.Left.IsRed=!1,u=System.Collections.Generic.SortedSet$1(y).RotateRight(n);break;case System.Collections.Generic.TreeRotation.LeftRotation:a.Right.IsRed=!1,u=System.Collections.Generic.SortedSet$1(y).RotateLeft(n);break;case System.Collections.Generic.TreeRotation.RightLeftRotation:u=System.Collections.Generic.SortedSet$1(y).RotateRightLeft(n);break;case System.Collections.Generic.TreeRotation.LeftRightRotation:u=System.Collections.Generic.SortedSet$1(y).RotateLeftRight(n)}u.IsRed=n.IsRed,n.IsRed=!1,t.IsRed=!0,this.ReplaceChildOfNodeOrRoot(i,n,u),Bridge.referenceEquals(n,r)&&(s=u),i=u}}var l=o?-1:this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](e,t.Item);0===l&&(o=!0,r=t,s=n),i=n,n=t,t=l<0?t.Left:t.Right}return null!=r&&(this.ReplaceNode(r,s,n,i),this.count=this.count-1|0),null!=this.root&&(this.root.IsRed=!1),o},clear:function(){this.root=null,this.count=0,this.version=this.version+1|0},contains:function(e){return null!=this.FindNode(e)},CopyTo:function(e){this.CopyTo$1(e,0,this.Count)},copyTo:function(e,t){this.CopyTo$1(e,t,this.Count)},CopyTo$1:function(t,n,i){if(null==t&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),n<0&&System.ThrowHelper.ThrowArgumentOutOfRangeException$1(System.ExceptionArgument.index),i<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if(n>t.length||i>(t.length-n|0))throw new System.ArgumentException.ctor;i=i+n|0,this.InOrderTreeWalk(function(e){return!(i<=n)&&(t[System.Array.index(Bridge.identity(n,n=n+1|0),t)]=e.Item,!0)})},System$Collections$ICollection$copyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),1!==System.Array.getRank(e)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_RankMultiDimNotSupported),0!==System.Array.getLower(e,0)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_NonZeroLowerBound),t<0&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.arrayIndex,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum),(e.length-t|0)<this.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);var n=Bridge.as(e,System.Array.type(y));if(null!=n)this.copyTo(n,t);else{var i=Bridge.as(e,System.Array.type(System.Object));null==i&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType);try{this.InOrderTreeWalk(function(e){return i[System.Array.index(Bridge.identity(t,t=t+1|0),i)]=e.Item,!0})}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.ArrayTypeMismatchException))throw e;System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType)}}},GetEnumerator:function(){return new(System.Collections.Generic.SortedSet$1.Enumerator(y).$ctor1)(this)},System$Collections$Generic$IEnumerable$1$GetEnumerator:function(){return new(System.Collections.Generic.SortedSet$1.Enumerator(y).$ctor1)(this).$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.SortedSet$1.Enumerator(y).$ctor1)(this).$clone()},InsertionBalance:function(e,t,n,i){var r,s=Bridge.referenceEquals(n.Right,t.v),e=Bridge.referenceEquals(t.v.Right,e);s===e?r=e?System.Collections.Generic.SortedSet$1(y).RotateLeft(n):System.Collections.Generic.SortedSet$1(y).RotateRight(n):(r=e?System.Collections.Generic.SortedSet$1(y).RotateLeftRight(n):System.Collections.Generic.SortedSet$1(y).RotateRightLeft(n),t.v=i),n.IsRed=!0,r.IsRed=!1,this.ReplaceChildOfNodeOrRoot(i,n,r)},ReplaceChildOfNodeOrRoot:function(e,t,n){null!=e?Bridge.referenceEquals(e.Left,t)?e.Left=n:e.Right=n:this.root=n},ReplaceNode:function(e,t,n,i){Bridge.referenceEquals(n,e)?n=e.Left:(null!=n.Right&&(n.Right.IsRed=!1),Bridge.referenceEquals(i,e)||(i.Left=n.Right,n.Right=e.Right),n.Left=e.Left),null!=n&&(n.IsRed=e.IsRed),this.ReplaceChildOfNodeOrRoot(t,e,n)},FindNode:function(e){for(var t=this.root;null!=t;){var n=this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](e,t.Item);if(0===n)return t;t=n<0?t.Left:t.Right}return null},InternalIndexOf:function(e){for(var t=this.root,n=0;null!=t;){var i=this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](e,t.Item);if(0===i)return n;t=i<0?t.Left:t.Right,n=i<0?Bridge.Int.mul(2,n)+1|0:Bridge.Int.mul(2,n)+2|0}return-1},FindRange:function(e,t){return this.FindRange$1(e,t,!0,!0)},FindRange$1:function(e,t,n,i){for(var r=this.root;null!=r;)if(n&&0<this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](e,r.Item))r=r.Right;else{if(!(i&&this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](t,r.Item)<0))return r;r=r.Left}return null},UpdateVersion:function(){this.version=this.version+1|0},ToArray:function(){var e=System.Array.init(this.Count,function(){return Bridge.getDefaultValue(y)},y);return this.CopyTo(e),e},unionWith:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");var t=Bridge.as(e,System.Collections.Generic.SortedSet$1(y)),n=Bridge.as(this,System.Collections.Generic.SortedSet$1.TreeSubSet(y));if(null!=n&&this.VersionCheck(),null!=t&&null==n&&0===this.count){var i=new(System.Collections.Generic.SortedSet$1(y).$ctor3)(t,this.comparer);return this.root=i.root,this.count=i.count,void(this.version=this.version+1|0)}if(null!=t&&null==n&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,t)&&t.Count>(0|Bridge.Int.div(this.Count,2))){for(var r=System.Array.init(t.Count+this.Count|0,function(){return Bridge.getDefaultValue(y)},y),s=0,o=this.GetEnumerator(),a=t.GetEnumerator(),u=!o.moveNext(),l=!a.moveNext();!u&&!l;){var c=(c=this.Comparer)[Bridge.geti(c,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](o.Current,a.Current);c<0?(r[System.Array.index(Bridge.identity(s,s=s+1|0),r)]=o.Current,u=!o.moveNext()):l=(0===c?(r[System.Array.index(Bridge.identity(s,s=s+1|0),r)]=a.Current,u=!o.moveNext()):r[System.Array.index(Bridge.identity(s,s=s+1|0),r)]=a.Current,!a.moveNext())}if(!u||!l)for(var m=u?a:o;r[System.Array.index(Bridge.identity(s,s=s+1|0),r)]=m.Current,m.moveNext(););this.root=null,this.root=System.Collections.Generic.SortedSet$1(y).ConstructRootFromSortedArray(r,0,s-1|0,null),this.count=s,this.version=this.version+1|0}else this.AddAllElements(e)},intersectWith:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0!==this.Count){var t=Bridge.as(e,System.Collections.Generic.SortedSet$1(y)),n=Bridge.as(this,System.Collections.Generic.SortedSet$1.TreeSubSet(y));if(null!=n&&this.VersionCheck(),null!=t&&null==n&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,t)){var i=System.Array.init(this.Count,function(){return Bridge.getDefaultValue(y)},y),r=0,s=this.GetEnumerator(),o=t.GetEnumerator(),a=!s.moveNext(),u=!o.moveNext(),l=this.Max;for(this.Min;!a&&!u&&(c=this.Comparer)[Bridge.geti(c,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](o.Current,l)<=0;){var c=(c=this.Comparer)[Bridge.geti(c,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](s.Current,o.Current);c<0?a=!s.moveNext():u=(0===c&&(i[System.Array.index(Bridge.identity(r,r=r+1|0),i)]=o.Current,a=!s.moveNext()),!o.moveNext())}this.root=null,this.root=System.Collections.Generic.SortedSet$1(y).ConstructRootFromSortedArray(i,0,r-1|0,null),this.count=r,this.version=this.version+1|0}else this.IntersectWithEnumerable(e)}},IntersectWithEnumerable:function(e){var t=new(System.Collections.Generic.List$1(y).$ctor2)(this.Count),n=Bridge.getEnumerator(e,y);try{for(;n.moveNext();){var i=n.Current;this.contains(i)&&(t.add(i),this.remove(i))}}finally{Bridge.is(n,System.IDisposable)&&n.System$IDisposable$Dispose()}this.clear(),this.AddAllElements(t)},exceptWith:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0!==this.count)if(Bridge.referenceEquals(e,this))this.clear();else{var t=Bridge.as(e,System.Collections.Generic.SortedSet$1(y));if(null!=t&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,t)){if(!(this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](t.Max,this.Min)<0||0<this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](t.Min,this.Max))){var n=this.Min,i=this.Max,r=Bridge.getEnumerator(e,y);try{for(;r.moveNext();){var s=r.Current;if(!(this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](s,n)<0)){if(0<this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](s,i))break;this.remove(s)}}}finally{Bridge.is(r,System.IDisposable)&&r.System$IDisposable$Dispose()}}}else this.RemoveAllElements(e)}},symmetricExceptWith:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");var t,n;0!==this.Count?Bridge.referenceEquals(e,this)?this.clear():(t=Bridge.as(e,System.Collections.Generic.SortedSet$1(y)),n=Bridge.as(e,System.Collections.Generic.HashSet$1(y)),null!=t&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,t)?this.SymmetricExceptWithSameEC$1(t):null!=n&&Bridge.equals(this.comparer,new(System.Collections.Generic.Comparer$1(y))(System.Collections.Generic.Comparer$1.$default.fn))&&Bridge.equals(n.Comparer,System.Collections.Generic.EqualityComparer$1(y).def)?this.SymmetricExceptWithSameEC$1(n):(n=new(System.Collections.Generic.List$1(y).$ctor1)(e).ToArray(),System.Array.sort(n,this.Comparer),this.SymmetricExceptWithSameEC(n))):this.unionWith(e)},SymmetricExceptWithSameEC$1:function(e){var t=Bridge.getEnumerator(e,y);try{for(;t.moveNext();){var n=t.Current;this.contains(n)?this.remove(n):this.add(n)}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}},SymmetricExceptWithSameEC:function(e){if(0!==e.length)for(var t=e[System.Array.index(0,e)],n=0;n<e.length;n=n+1|0){for(;n<e.length&&0!==n&&0===this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](e[System.Array.index(n,e)],t);)n=n+1|0;if(n>=e.length)break;this.contains(e[System.Array.index(n,e)])?this.remove(e[System.Array.index(n,e)]):this.add(e[System.Array.index(n,e)]),t=e[System.Array.index(n,e)]}},isSubsetOf:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0===this.Count)return!0;var t=Bridge.as(e,System.Collections.Generic.SortedSet$1(y));if(null!=t&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,t))return!(this.Count>t.Count)&&this.IsSubsetOfSortedSetWithSameEC(t);e=this.CheckUniqueAndUnfoundElements(e,!1);return e.uniqueCount===this.Count&&0<=e.unfoundCount},IsSubsetOfSortedSetWithSameEC:function(e){var t=e.GetViewBetween(this.Min,this.Max),n=Bridge.getEnumerator(this);try{for(;n.moveNext();){var i=n.Current;if(!t.contains(i))return!1}}finally{Bridge.is(n,System.IDisposable)&&n.System$IDisposable$Dispose()}return!0},isProperSubsetOf:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(null!=Bridge.as(e,System.Collections.ICollection)&&0===this.Count)return 0<System.Array.getCount(Bridge.as(e,System.Collections.ICollection));var t=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=t&&Bridge.equals(this.comparer,new(System.Collections.Generic.Comparer$1(y))(System.Collections.Generic.Comparer$1.$default.fn))&&Bridge.equals(t.Comparer,System.Collections.Generic.EqualityComparer$1(y).def))return t.isProperSupersetOf(this);t=Bridge.as(e,System.Collections.Generic.SortedSet$1(y));if(null!=t&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,t))return!(this.Count>=t.Count)&&this.IsSubsetOfSortedSetWithSameEC(t);e=this.CheckUniqueAndUnfoundElements(e,!1);return e.uniqueCount===this.Count&&0<e.unfoundCount},isSupersetOf:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(null!=Bridge.as(e,System.Collections.ICollection)&&0===System.Array.getCount(Bridge.as(e,System.Collections.ICollection)))return!0;var t=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=t&&Bridge.equals(this.comparer,new(System.Collections.Generic.Comparer$1(y))(System.Collections.Generic.Comparer$1.$default.fn))&&Bridge.equals(t.Comparer,System.Collections.Generic.EqualityComparer$1(y).def))return t.isSubsetOf(this);t=Bridge.as(e,System.Collections.Generic.SortedSet$1(y));if(null!=t&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,t)){if(this.Count<t.Count)return!1;var n=this.GetViewBetween(t.Min,t.Max),i=Bridge.getEnumerator(t);try{for(;i.moveNext();){var r=i.Current;if(!n.contains(r))return!1}}finally{Bridge.is(i,System.IDisposable)&&i.System$IDisposable$Dispose()}return!0}return this.ContainsAllElements(e)},isProperSupersetOf:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0===this.Count)return!1;if(null!=Bridge.as(e,System.Collections.ICollection)&&0===System.Array.getCount(Bridge.as(e,System.Collections.ICollection)))return!0;var t=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=t&&Bridge.equals(this.comparer,new(System.Collections.Generic.Comparer$1(y))(System.Collections.Generic.Comparer$1.$default.fn))&&Bridge.equals(t.Comparer,System.Collections.Generic.EqualityComparer$1(y).def))return t.isProperSubsetOf(this);t=Bridge.as(e,System.Collections.Generic.SortedSet$1(y));if(null!=t&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(t,this)){if(t.Count>=this.Count)return!1;var n=this.GetViewBetween(t.Min,t.Max),i=Bridge.getEnumerator(t);try{for(;i.moveNext();){var r=i.Current;if(!n.contains(r))return!1}}finally{Bridge.is(i,System.IDisposable)&&i.System$IDisposable$Dispose()}return!0}e=this.CheckUniqueAndUnfoundElements(e,!0);return e.uniqueCount<this.Count&&0===e.unfoundCount},setEquals:function(e){var t;if(null==e)throw new System.ArgumentNullException.$ctor1("other");var n=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=n&&Bridge.equals(this.comparer,new(System.Collections.Generic.Comparer$1(y))(System.Collections.Generic.Comparer$1.$default.fn))&&Bridge.equals(n.Comparer,System.Collections.Generic.EqualityComparer$1(y).def))return n.setEquals(this);n=Bridge.as(e,System.Collections.Generic.SortedSet$1(y));if(null!=n&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,n)){for(var i=this.GetEnumerator().$clone(),r=n.GetEnumerator().$clone(),s=!i.System$Collections$IEnumerator$moveNext(),o=!r.System$Collections$IEnumerator$moveNext();!s&&!o;){if(0!==(t=this.Comparer)[Bridge.geti(t,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](i[Bridge.geti(i,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(y)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")],r[Bridge.geti(r,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(y)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")]))return!1;s=!i.System$Collections$IEnumerator$moveNext(),o=!r.System$Collections$IEnumerator$moveNext()}return s&&o}e=this.CheckUniqueAndUnfoundElements(e,!0);return e.uniqueCount===this.Count&&0===e.unfoundCount},overlaps:function(e){var t;if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0===this.Count)return!1;if(null!=Bridge.as(e,System.Collections.Generic.ICollection$1(y))&&0===System.Array.getCount(Bridge.as(e,System.Collections.Generic.ICollection$1(y)),y))return!1;var n=Bridge.as(e,System.Collections.Generic.SortedSet$1(y));if(null!=n&&System.Collections.Generic.SortedSet$1(y).AreComparersEqual(this,n)&&(0<this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.Min,n.Max)||this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.Max,n.Min)<0))return!1;n=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=n&&Bridge.equals(this.comparer,new(System.Collections.Generic.Comparer$1(y))(System.Collections.Generic.Comparer$1.$default.fn))&&Bridge.equals(n.Comparer,System.Collections.Generic.EqualityComparer$1(y).def))return n.overlaps(this);t=Bridge.getEnumerator(e,y);try{for(;t.moveNext();){var i=t.Current;if(this.contains(i))return!0}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}return!1},CheckUniqueAndUnfoundElements:function(e,t){var n=new(System.Collections.Generic.SortedSet$1.ElementCount(y));if(0===this.Count){var i=0,r=Bridge.getEnumerator(e,y);try{for(;r.moveNext();){r.Current;i=i+1|0;break}}finally{Bridge.is(r,System.IDisposable)&&r.System$IDisposable$Dispose()}return n.uniqueCount=0,n.unfoundCount=i,n.$clone()}var s=this.Count,o=System.Collections.Generic.BitHelper.ToIntArrayLength(s),s=System.Array.init(o,0,System.Int32),a=new System.Collections.Generic.BitHelper(s,o),u=0,l=0,c=Bridge.getEnumerator(e,y);try{for(;c.moveNext();){var m=c.Current,m=this.InternalIndexOf(m);if(0<=m)a.IsMarked(m)||(a.MarkBit(m),l=l+1|0);else if(u=u+1|0,t)break}}finally{Bridge.is(c,System.IDisposable)&&c.System$IDisposable$Dispose()}return n.uniqueCount=l,n.unfoundCount=u,n.$clone()},RemoveWhere:function(t){if(Bridge.staticEquals(t,null))throw new System.ArgumentNullException.$ctor1("match");var n=new(System.Collections.Generic.List$1(y).$ctor2)(this.Count);this.BreadthFirstTreeWalk(function(e){return t(e.Item)&&n.add(e.Item),!0});for(var e=0,i=n.Count-1|0;0<=i;i=i-1|0)this.remove(n.getItem(i))&&(e=e+1|0);return e},Reverse:function(){return new(Bridge.GeneratorEnumerable$1(y))(Bridge.fn.bind(this,function(){var e,t=0,n=new(Bridge.GeneratorEnumerator$1(y))(Bridge.fn.bind(this,function(){try{for(;;)switch(t){case 0:e=new(System.Collections.Generic.SortedSet$1.Enumerator(y).$ctor2)(this,!0),t=1;continue;case 1:if(e.moveNext()){t=2;continue}t=4;continue;case 2:return n.current=e.Current,t=3,!0;case 3:t=1;continue;case 4:default:return!1}}catch(e){throw System.Exception.create(e)}}));return n}))},GetViewBetween:function(e,t){var n;if(0<(n=this.Comparer)[Bridge.geti(n,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(y)+"$compare","System$Collections$Generic$IComparer$1$compare")](e,t))throw new System.ArgumentException.$ctor1("lowerBound is greater than upperBound");return new(System.Collections.Generic.SortedSet$1.TreeSubSet(y).$ctor1)(this,e,t,!0,!0)},TryGetValue:function(e,t){e=this.FindNode(e);return null!=e?(t.v=e.Item,!0):(t.v=Bridge.getDefaultValue(y),!1)}}}}),Bridge.define("System.Collections.Generic.SortedSetEqualityComparer$1",function(r){return{inherits:[System.Collections.Generic.IEqualityComparer$1(System.Collections.Generic.SortedSet$1(r))],fields:{comparer:null,e_comparer:null},alias:["equals2",["System$Collections$Generic$IEqualityComparer$1$System$Collections$Generic$SortedSet$1$"+Bridge.getTypeAlias(r)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2"],"getHashCode2",["System$Collections$Generic$IEqualityComparer$1$System$Collections$Generic$SortedSet$1$"+Bridge.getTypeAlias(r)+"$getHashCode2","System$Collections$Generic$IEqualityComparer$1$getHashCode2"]],ctors:{ctor:function(){System.Collections.Generic.SortedSetEqualityComparer$1(r).$ctor2.call(this,null,null)},$ctor1:function(e){System.Collections.Generic.SortedSetEqualityComparer$1(r).$ctor2.call(this,e,null)},$ctor3:function(e){System.Collections.Generic.SortedSetEqualityComparer$1(r).$ctor2.call(this,null,e)},$ctor2:function(e,t){this.$initialize(),this.comparer=null==e?new(System.Collections.Generic.Comparer$1(r))(System.Collections.Generic.Comparer$1.$default.fn):e,this.e_comparer=null==t?System.Collections.Generic.EqualityComparer$1(r).def:t}},methods:{equals2:function(e,t){return System.Collections.Generic.SortedSet$1(r).SortedSetEquals(e,t,this.comparer)},equals:function(e){e=Bridge.as(e,System.Collections.Generic.SortedSetEqualityComparer$1(r));return null!=e&&Bridge.referenceEquals(this.comparer,e.comparer)},getHashCode2:function(e){var t,n=0;if(null!=e){t=Bridge.getEnumerator(e);try{for(;t.moveNext();){var i=t.Current;n^=2147483647&this.e_comparer[Bridge.geti(this.e_comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(r)+"$getHashCode2","System$Collections$Generic$IEqualityComparer$1$getHashCode2")](i)}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}}return n},getHashCode:function(){return Bridge.getHashCode(this.comparer)^Bridge.getHashCode(this.e_comparer)}}}}),Bridge.define("System.Collections.Generic.SortedSet$1.ElementCount",function(t){return{$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.SortedSet$1.ElementCount(t))}}},fields:{uniqueCount:0,unfoundCount:0},ctors:{ctor:function(){this.$initialize()}},methods:{getHashCode:function(){return Bridge.addHash([4920463385,this.uniqueCount,this.unfoundCount])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.SortedSet$1.ElementCount(t))&&(Bridge.equals(this.uniqueCount,e.uniqueCount)&&Bridge.equals(this.unfoundCount,e.unfoundCount))},$clone:function(e){e=e||new(System.Collections.Generic.SortedSet$1.ElementCount(t));return e.uniqueCount=this.uniqueCount,e.unfoundCount=this.unfoundCount,e}}}}),Bridge.define("System.Collections.Generic.SortedSet$1.Enumerator",function(n){return{inherits:[System.Collections.Generic.IEnumerator$1(n),System.Collections.IEnumerator],$kind:"nested struct",statics:{fields:{dummyNode:null},ctors:{init:function(){this.dummyNode=new(System.Collections.Generic.SortedSet$1.Node(n).ctor)(Bridge.getDefaultValue(n))}},methods:{getDefaultValue:function(){return new(System.Collections.Generic.SortedSet$1.Enumerator(n))}}},fields:{tree:null,version:0,stack:null,current:null,reverse:!1},props:{Current:{get:function(){return null!=this.current?this.current.Item:Bridge.getDefaultValue(n)}},System$Collections$IEnumerator$Current:{get:function(){return null==this.current&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.current.Item}},NotStartedOrEnded:{get:function(){return null==this.current}}},alias:["moveNext","System$Collections$IEnumerator$moveNext","Dispose","System$IDisposable$Dispose","Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(n)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{$ctor1:function(e){this.$initialize(),this.tree=e,this.tree.VersionCheck(),this.version=this.tree.version,this.stack=new(System.Collections.Generic.Stack$1(System.Collections.Generic.SortedSet$1.Node(n)).$ctor2)(Bridge.Int.mul(2,System.Collections.Generic.SortedSet$1(n).log2(e.Count+1|0))),this.current=null,this.reverse=!1,this.Intialize()},$ctor2:function(e,t){this.$initialize(),this.tree=e,this.tree.VersionCheck(),this.version=this.tree.version,this.stack=new(System.Collections.Generic.Stack$1(System.Collections.Generic.SortedSet$1.Node(n)).$ctor2)(Bridge.Int.mul(2,System.Collections.Generic.SortedSet$1(n).log2(e.Count+1|0))),this.current=null,this.reverse=t,this.Intialize()},ctor:function(){this.$initialize()}},methods:{Intialize:function(){this.current=null;for(var e,t,n=this.tree.root;null!=n;)e=this.reverse?n.Right:n.Left,t=this.reverse?n.Left:n.Right,n=this.tree.IsWithinRange(n.Item)?(this.stack.Push(n),e):null!=e&&this.tree.IsWithinRange(e.Item)?e:t},moveNext:function(){if(this.tree.VersionCheck(),this.version!==this.tree.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),0===this.stack.Count)return this.current=null,!1;this.current=this.stack.Pop();for(var e,t,n=this.reverse?this.current.Left:this.current.Right;null!=n;)e=this.reverse?n.Right:n.Left,t=this.reverse?n.Left:n.Right,n=this.tree.IsWithinRange(n.Item)?(this.stack.Push(n),e):null!=t&&this.tree.IsWithinRange(t.Item)?t:e;return!0},Dispose:function(){},Reset:function(){this.version!==this.tree.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.stack.Clear(),this.Intialize()},System$Collections$IEnumerator$reset:function(){this.Reset()},getHashCode:function(){return Bridge.addHash([3788985113,this.tree,this.version,this.stack,this.current,this.reverse])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.SortedSet$1.Enumerator(n))&&(Bridge.equals(this.tree,e.tree)&&Bridge.equals(this.version,e.version)&&Bridge.equals(this.stack,e.stack)&&Bridge.equals(this.current,e.current)&&Bridge.equals(this.reverse,e.reverse))},$clone:function(e){e=e||new(System.Collections.Generic.SortedSet$1.Enumerator(n));return e.tree=this.tree,e.version=this.version,e.stack=this.stack,e.current=this.current,e.reverse=this.reverse,e}}}}),Bridge.define("System.Collections.Generic.SortedSet$1.Node",function(e){return{$kind:"nested class",fields:{IsRed:!1,Item:Bridge.getDefaultValue(e),Left:null,Right:null},ctors:{ctor:function(e){this.$initialize(),this.Item=e,this.IsRed=!0},$ctor1:function(e,t){this.$initialize(),this.Item=e,this.IsRed=t}}}}),Bridge.define("System.Collections.Generic.SortedSet$1.TreeSubSet",function(a){return{inherits:[System.Collections.Generic.SortedSet$1(a)],$kind:"nested class",fields:{underlying:null,min:Bridge.getDefaultValue(a),max:Bridge.getDefaultValue(a),lBoundActive:!1,uBoundActive:!1},alias:["contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$contains","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$clear"],ctors:{$ctor1:function(e,t,n,i,r){this.$initialize(),System.Collections.Generic.SortedSet$1(a).$ctor1.call(this,e.Comparer),this.underlying=e,this.min=t,this.max=n,this.lBoundActive=i,this.uBoundActive=r,this.root=this.underlying.FindRange$1(this.min,this.max,this.lBoundActive,this.uBoundActive),this.count=0,this.version=-1,this.VersionCheckImpl()},ctor:function(){this.$initialize(),System.Collections.Generic.SortedSet$1(a).ctor.call(this),this.comparer=null}},methods:{AddIfNotPresent:function(e){this.IsWithinRange(e)||System.ThrowHelper.ThrowArgumentOutOfRangeException$1(System.ExceptionArgument.collection);e=this.underlying.AddIfNotPresent(e);return this.VersionCheck(),e},contains:function(e){return this.VersionCheck(),System.Collections.Generic.SortedSet$1(a).prototype.contains.call(this,e)},DoRemove:function(e){if(!this.IsWithinRange(e))return!1;e=this.underlying.remove(e);return this.VersionCheck(),e},clear:function(){if(0!==this.count){var t=new(System.Collections.Generic.List$1(a).ctor);for(this.BreadthFirstTreeWalk(function(e){return t.add(e.Item),!0});0!==t.Count;)this.underlying.remove(t.getItem(t.Count-1|0)),t.removeAt(t.Count-1|0);this.root=null,this.count=0,this.version=this.underlying.version}},IsWithinRange:function(e){var t,n=this.lBoundActive?(t=this.Comparer)[Bridge.geti(t,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(a)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.min,e):-1;return!(0<n)&&!((this.uBoundActive?(t=this.Comparer)[Bridge.geti(t,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(a)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.max,e):1)<0)},InOrderTreeWalk$1:function(e,t){var n,i;if(this.VersionCheck(),null==this.root)return!0;for(var r=new(System.Collections.Generic.Stack$1(System.Collections.Generic.SortedSet$1.Node(a)).$ctor2)(Bridge.Int.mul(2,System.Collections.Generic.SortedSet$1(a).log2(this.count+1|0))),s=this.root;null!=s;)s=this.IsWithinRange(s.Item)?(r.Push(s),t?s.Right:s.Left):this.lBoundActive&&0<(n=this.Comparer)[Bridge.geti(n,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(a)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.min,s.Item)?s.Right:s.Left;for(;0!==r.Count;){if(!e(s=r.Pop()))return!1;for(var o=t?s.Left:s.Right;null!=o;)o=this.IsWithinRange(o.Item)?(r.Push(o),t?o.Right:o.Left):this.lBoundActive&&0<(i=this.Comparer)[Bridge.geti(i,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(a)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.min,o.Item)?o.Right:o.Left}return!0},BreadthFirstTreeWalk:function(e){var t;if(this.VersionCheck(),null==this.root)return!0;var n,i=new(System.Collections.Generic.List$1(System.Collections.Generic.SortedSet$1.Node(a)).ctor);for(i.add(this.root);0!==i.Count;){if(n=i.getItem(0),i.removeAt(0),this.IsWithinRange(n.Item)&&!e(n))return!1;null!=n.Left&&(!this.lBoundActive||(t=this.Comparer)[Bridge.geti(t,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(a)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.min,n.Item)<0)&&i.add(n.Left),null!=n.Right&&(!this.uBoundActive||0<(t=this.Comparer)[Bridge.geti(t,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(a)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.max,n.Item))&&i.add(n.Right)}return!0},FindNode:function(e){return this.IsWithinRange(e)?(this.VersionCheck(),System.Collections.Generic.SortedSet$1(a).prototype.FindNode.call(this,e)):null},InternalIndexOf:function(e){var t,n=-1,i=Bridge.getEnumerator(this);try{for(;i.moveNext();){var r=i.Current,n=n+1|0;if(0===(t=this.Comparer)[Bridge.geti(t,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(a)+"$compare","System$Collections$Generic$IComparer$1$compare")](e,r))return n}}finally{Bridge.is(i,System.IDisposable)&&i.System$IDisposable$Dispose()}return-1},VersionCheck:function(){this.VersionCheckImpl()},VersionCheckImpl:function(){this.version!==this.underlying.version&&(this.root=this.underlying.FindRange$1(this.min,this.max,this.lBoundActive,this.uBoundActive),this.version=this.underlying.version,this.count=0,this.InOrderTreeWalk(Bridge.fn.bind(this,W.$.System.Collections.Generic.SortedSet$1.TreeSubSet.f1)))},GetViewBetween:function(e,t){var n;if(this.lBoundActive&&0<(n=this.Comparer)[Bridge.geti(n,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(a)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.min,e))throw new System.ArgumentOutOfRangeException.$ctor1("lowerValue");if(this.uBoundActive&&(n=this.Comparer)[Bridge.geti(n,"System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(a)+"$compare","System$Collections$Generic$IComparer$1$compare")](this.max,t)<0)throw new System.ArgumentOutOfRangeException.$ctor1("upperValue");return Bridge.cast(this.underlying.GetViewBetween(e,t),System.Collections.Generic.SortedSet$1.TreeSubSet(a))},IntersectWithEnumerable:function(e){var t=new(System.Collections.Generic.List$1(a).$ctor2)(this.Count),n=Bridge.getEnumerator(e,a);try{for(;n.moveNext();){var i=n.Current;this.contains(i)&&(t.add(i),this.remove(i))}}finally{Bridge.is(n,System.IDisposable)&&n.System$IDisposable$Dispose()}this.clear(),this.AddAllElements(t)}}}}),Bridge.ns("System.Collections.Generic.SortedSet$1.TreeSubSet",W.$),Bridge.apply(W.$.System.Collections.Generic.SortedSet$1.TreeSubSet,{f1:function(e){return this.count=this.count+1|0,!0}}),Bridge.define("System.Collections.Generic.LinkedList$1",function(o){return{inherits:[System.Collections.Generic.ICollection$1(o),System.Collections.ICollection,System.Collections.Generic.IReadOnlyCollection$1(o)],statics:{fields:{VersionName:null,CountName:null,ValuesName:null},ctors:{init:function(){this.VersionName="Version",this.CountName="Count",this.ValuesName="Data"}}},fields:{head:null,count:0,version:0},props:{Count:{get:function(){return this.count}},First:{get:function(){return this.head}},Last:{get:function(){return null==this.head?null:this.head.prev}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!1}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return null}}},alias:["Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(o)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$Count","System$Collections$Generic$ICollection$1$IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$IsReadOnly","System$Collections$Generic$ICollection$1$add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$add","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$copyTo","System$Collections$Generic$IEnumerable$1$GetEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(o)+"$GetEnumerator","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$remove"],ctors:{ctor:function(){this.$initialize()},$ctor1:function(e){var t;if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("collection");t=Bridge.getEnumerator(e,o);try{for(;t.moveNext();){var n=t.Current;this.AddLast(n)}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}}},methods:{System$Collections$Generic$ICollection$1$add:function(e){this.AddLast(e)},AddAfter:function(e,t){this.ValidateNode(e);t=new(System.Collections.Generic.LinkedListNode$1(o).$ctor1)(e.list,t);return this.InternalInsertNodeBefore(e.next,t),t},AddAfter$1:function(e,t){this.ValidateNode(e),this.ValidateNewNode(t),this.InternalInsertNodeBefore(e.next,t),t.list=this},AddBefore:function(e,t){this.ValidateNode(e);t=new(System.Collections.Generic.LinkedListNode$1(o).$ctor1)(e.list,t);return this.InternalInsertNodeBefore(e,t),Bridge.referenceEquals(e,this.head)&&(this.head=t),t},AddBefore$1:function(e,t){this.ValidateNode(e),this.ValidateNewNode(t),this.InternalInsertNodeBefore(e,t),t.list=this,Bridge.referenceEquals(e,this.head)&&(this.head=t)},AddFirst:function(e){e=new(System.Collections.Generic.LinkedListNode$1(o).$ctor1)(this,e);return null==this.head?this.InternalInsertNodeToEmptyList(e):(this.InternalInsertNodeBefore(this.head,e),this.head=e),e},AddFirst$1:function(e){this.ValidateNewNode(e),null==this.head?this.InternalInsertNodeToEmptyList(e):(this.InternalInsertNodeBefore(this.head,e),this.head=e),e.list=this},AddLast:function(e){e=new(System.Collections.Generic.LinkedListNode$1(o).$ctor1)(this,e);return null==this.head?this.InternalInsertNodeToEmptyList(e):this.InternalInsertNodeBefore(this.head,e),e},AddLast$1:function(e){this.ValidateNewNode(e),null==this.head?this.InternalInsertNodeToEmptyList(e):this.InternalInsertNodeBefore(this.head,e),e.list=this},clear:function(){for(var e=this.head;null!=e;){var t=e,e=e.Next;t.Invalidate()}this.head=null,this.count=0,this.version=this.version+1|0},contains:function(e){return null!=this.Find(e)},copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(t<0||t>e.length)throw new System.ArgumentOutOfRangeException.$ctor1("index");if((e.length-t|0)<this.Count)throw new System.ArgumentException.ctor;var n=this.head;if(null!=n)for(;e[System.Array.index(Bridge.identity(t,t=t+1|0),e)]=n.item,n=n.next,!Bridge.referenceEquals(n,this.head););},System$Collections$ICollection$copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(1!==System.Array.getRank(e))throw new System.ArgumentException.ctor;if(0!==System.Array.getLower(e,0))throw new System.ArgumentException.ctor;if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if((e.length-t|0)<this.Count)throw new System.ArgumentException.ctor;var n=Bridge.as(e,System.Array.type(o));if(null!=n)this.copyTo(n,t);else{var i=Bridge.getType(e).$elementType||null,n=o;if(!Bridge.Reflection.isAssignableFrom(i,n)&&!Bridge.Reflection.isAssignableFrom(n,i))throw new System.ArgumentException.ctor;var r=Bridge.as(e,System.Array.type(System.Object));if(null==r)throw new System.ArgumentException.ctor;var s=this.head;try{if(null!=s)for(;r[System.Array.index(Bridge.identity(t,t=t+1|0),r)]=s.item,s=s.next,!Bridge.referenceEquals(s,this.head););}catch(e){throw e=System.Exception.create(e),Bridge.is(e,System.ArrayTypeMismatchException)?new System.ArgumentException.ctor:e}}},Find:function(e){var t=this.head,n=System.Collections.Generic.EqualityComparer$1(o).def;if(null!=t)if(null!=e){do{if(n.equals2(t.item,e))return t}while(t=t.next,!Bridge.referenceEquals(t,this.head))}else do{if(null==t.item)return t}while(t=t.next,!Bridge.referenceEquals(t,this.head));return null},FindLast:function(e){if(null==this.head)return null;var t=this.head.prev,n=t,i=System.Collections.Generic.EqualityComparer$1(o).def;if(null!=n)if(null!=e){do{if(i.equals2(n.item,e))return n}while(n=n.prev,!Bridge.referenceEquals(n,t))}else do{if(null==n.item)return n}while(n=n.prev,!Bridge.referenceEquals(n,t));return null},GetEnumerator:function(){return new(System.Collections.Generic.LinkedList$1.Enumerator(o).$ctor1)(this)},System$Collections$Generic$IEnumerable$1$GetEnumerator:function(){return this.GetEnumerator().$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return this.GetEnumerator().$clone()},remove:function(e){e=this.Find(e);return null!=e&&(this.InternalRemoveNode(e),!0)},Remove:function(e){this.ValidateNode(e),this.InternalRemoveNode(e)},RemoveFirst:function(){if(null==this.head)throw new System.InvalidOperationException.ctor;this.InternalRemoveNode(this.head)},RemoveLast:function(){if(null==this.head)throw new System.InvalidOperationException.ctor;this.InternalRemoveNode(this.head.prev)},InternalInsertNodeBefore:function(e,t){t.next=e,t.prev=e.prev,e.prev.next=t,e.prev=t,this.version=this.version+1|0,this.count=this.count+1|0},InternalInsertNodeToEmptyList:function(e){(e.next=e).prev=e,this.head=e,this.version=this.version+1|0,this.count=this.count+1|0},InternalRemoveNode:function(e){Bridge.referenceEquals(e.next,e)?this.head=null:(e.next.prev=e.prev,e.prev.next=e.next,Bridge.referenceEquals(this.head,e)&&(this.head=e.next)),e.Invalidate(),this.count=this.count-1|0,this.version=this.version+1|0},ValidateNewNode:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("node");if(null!=e.list)throw new System.InvalidOperationException.ctor},ValidateNode:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("node");if(!Bridge.referenceEquals(e.list,this))throw new System.InvalidOperationException.ctor}}}}),Bridge.define("System.Collections.Generic.LinkedListNode$1",function(e){return{fields:{list:null,next:null,prev:null,item:Bridge.getDefaultValue(e)},props:{List:{get:function(){return this.list}},Next:{get:function(){return null==this.next||Bridge.referenceEquals(this.next,this.list.head)?null:this.next}},Previous:{get:function(){return null==this.prev||Bridge.referenceEquals(this,this.list.head)?null:this.prev}},Value:{get:function(){return this.item},set:function(e){this.item=e}}},ctors:{ctor:function(e){this.$initialize(),this.item=e},$ctor1:function(e,t){this.$initialize(),this.list=e,this.item=t}},methods:{Invalidate:function(){this.list=null,this.next=null,this.prev=null}}}}),Bridge.define("System.Collections.Generic.LinkedList$1.Enumerator",function(t){return{inherits:[System.Collections.Generic.IEnumerator$1(t),System.Collections.IEnumerator],$kind:"nested struct",statics:{fields:{LinkedListName:null,CurrentValueName:null,VersionName:null,IndexName:null},ctors:{init:function(){this.LinkedListName="LinkedList",this.CurrentValueName="Current",this.VersionName="Version",this.IndexName="Index"}},methods:{getDefaultValue:function(){return new(System.Collections.Generic.LinkedList$1.Enumerator(t))}}},fields:{list:null,node:null,version:0,current:Bridge.getDefaultValue(t),index:0},props:{Current:{get:function(){return this.current}},System$Collections$IEnumerator$Current:{get:function(){return 0!==this.index&&this.index!==(this.list.Count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.current}}},alias:["Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"],"moveNext","System$Collections$IEnumerator$moveNext","Dispose","System$IDisposable$Dispose"],ctors:{$ctor1:function(e){this.$initialize(),this.list=e,this.version=e.version,this.node=e.head,this.current=Bridge.getDefaultValue(t),this.index=0},ctor:function(){this.$initialize()}},methods:{moveNext:function(){if(this.version!==this.list.version)throw new System.InvalidOperationException.ctor;return null==this.node?(this.index=this.list.Count+1|0,!1):(this.index=this.index+1|0,this.current=this.node.item,this.node=this.node.next,Bridge.referenceEquals(this.node,this.list.head)&&(this.node=null),!0)},System$Collections$IEnumerator$reset:function(){if(this.version!==this.list.version)throw new System.InvalidOperationException.ctor;this.current=Bridge.getDefaultValue(t),this.node=this.list.head,this.index=0},Dispose:function(){},getHashCode:function(){return Bridge.addHash([3788985113,this.list,this.node,this.version,this.current,this.index])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.LinkedList$1.Enumerator(t))&&(Bridge.equals(this.list,e.list)&&Bridge.equals(this.node,e.node)&&Bridge.equals(this.version,e.version)&&Bridge.equals(this.current,e.current)&&Bridge.equals(this.index,e.index))},$clone:function(e){e=e||new(System.Collections.Generic.LinkedList$1.Enumerator(t));return e.list=this.list,e.node=this.node,e.version=this.version,e.current=this.current,e.index=this.index,e}}}}),Bridge.define("System.Collections.Generic.TreeRotation",{$kind:"enum",statics:{fields:{LeftRotation:1,RightRotation:2,RightLeftRotation:3,LeftRightRotation:4}}}),Bridge.define("System.Collections.Generic.Dictionary$2",function(c,m){return{inherits:[System.Collections.Generic.IDictionary$2(c,m),System.Collections.IDictionary,System.Collections.Generic.IReadOnlyDictionary$2(c,m)],statics:{fields:{VersionName:null,HashSizeName:null,KeyValuePairsName:null,ComparerName:null},ctors:{init:function(){this.VersionName="Version",this.HashSizeName="HashSize",this.KeyValuePairsName="KeyValuePairs",this.ComparerName="Comparer"}},methods:{IsCompatibleKey:function(e){return null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key),Bridge.is(e,c)}}},fields:{buckets:null,simpleBuckets:null,entries:null,count:0,version:0,freeList:0,freeCount:0,comparer:null,keys:null,values:null,isSimpleKey:!1},props:{Comparer:{get:function(){return this.comparer}},Count:{get:function(){return this.count-this.freeCount|0}},Keys:{get:function(){return null==this.keys&&(this.keys=new(System.Collections.Generic.Dictionary$2.KeyCollection(c,m))(this)),this.keys}},System$Collections$Generic$IDictionary$2$Keys:{get:function(){return null==this.keys&&(this.keys=new(System.Collections.Generic.Dictionary$2.KeyCollection(c,m))(this)),this.keys}},System$Collections$Generic$IReadOnlyDictionary$2$Keys:{get:function(){return null==this.keys&&(this.keys=new(System.Collections.Generic.Dictionary$2.KeyCollection(c,m))(this)),this.keys}},Values:{get:function(){return null==this.values&&(this.values=new(System.Collections.Generic.Dictionary$2.ValueCollection(c,m))(this)),this.values}},System$Collections$Generic$IDictionary$2$Values:{get:function(){return null==this.values&&(this.values=new(System.Collections.Generic.Dictionary$2.ValueCollection(c,m))(this)),this.values}},System$Collections$Generic$IReadOnlyDictionary$2$Values:{get:function(){return null==this.values&&(this.values=new(System.Collections.Generic.Dictionary$2.ValueCollection(c,m))(this)),this.values}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!1}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return null}},System$Collections$IDictionary$IsFixedSize:{get:function(){return!1}},System$Collections$IDictionary$IsReadOnly:{get:function(){return!1}},System$Collections$IDictionary$Keys:{get:function(){return Bridge.cast(this.Keys,System.Collections.ICollection)}},System$Collections$IDictionary$Values:{get:function(){return Bridge.cast(this.Values,System.Collections.ICollection)}}},alias:["Count",["System$Collections$Generic$IReadOnlyCollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$Count","System$Collections$Generic$IDictionary$2$Keys","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$Keys","System$Collections$Generic$IReadOnlyDictionary$2$Keys","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$Keys","System$Collections$Generic$IDictionary$2$Values","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$Values","System$Collections$Generic$IReadOnlyDictionary$2$Values","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$Values","getItem","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$getItem","setItem","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$setItem","getItem","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$getItem","setItem","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$setItem","add","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$add","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$add","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$add","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$contains","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$contains","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$remove","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$remove","clear","System$Collections$IDictionary$clear","clear","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$clear","containsKey","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$containsKey","containsKey","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$containsKey","System$Collections$Generic$IEnumerable$1$System$Collections$Generic$KeyValuePair$2$GetEnumerator","System$Collections$Generic$IEnumerable$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$GetEnumerator","remove","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$remove","tryGetValue","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$tryGetValue","tryGetValue","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$tryGetValue","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$IsReadOnly","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$IsReadOnly","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$copyTo","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(c)+"$"+Bridge.getTypeAlias(m)+"$copyTo"],ctors:{ctor:function(){System.Collections.Generic.Dictionary$2(c,m).$ctor5.call(this,0,null)},$ctor4:function(e){System.Collections.Generic.Dictionary$2(c,m).$ctor5.call(this,e,null)},$ctor3:function(e){System.Collections.Generic.Dictionary$2(c,m).$ctor5.call(this,0,e)},$ctor5:function(e,t){this.$initialize(),e<0&&System.ThrowHelper.ThrowArgumentOutOfRangeException$1(System.ExceptionArgument.capacity),0<e&&this.Initialize(e),this.comparer=t||System.Collections.Generic.EqualityComparer$1(c).def,this.isSimpleKey=(Bridge.referenceEquals(c,System.String)||!0===c.$number&&!Bridge.referenceEquals(c,System.Int64)&&!Bridge.referenceEquals(c,System.UInt64)||Bridge.referenceEquals(c,System.Char))&&Bridge.referenceEquals(this.comparer,System.Collections.Generic.EqualityComparer$1(c).def)},$ctor1:function(e){System.Collections.Generic.Dictionary$2(c,m).$ctor2.call(this,e,null)},$ctor2:function(e,t){var n;System.Collections.Generic.Dictionary$2(c,m).$ctor5.call(this,null!=e?System.Array.getCount(e,System.Collections.Generic.KeyValuePair$2(c,m)):0,t),null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.dictionary),n=Bridge.getEnumerator(e,System.Collections.Generic.KeyValuePair$2(c,m));try{for(;n.moveNext();){var i=n.Current;this.add(i.key,i.value)}}finally{Bridge.is(n,System.IDisposable)&&n.System$IDisposable$Dispose()}}},methods:{getItem:function(e){e=this.FindEntry(e);if(0<=e)return this.entries[System.Array.index(e,this.entries)].value;throw new System.Collections.Generic.KeyNotFoundException.ctor},setItem:function(e,t){this.Insert(e,t,!1)},System$Collections$IDictionary$getItem:function(e){if(System.Collections.Generic.Dictionary$2(c,m).IsCompatibleKey(e)){e=this.FindEntry(Bridge.cast(Bridge.unbox(e,c),c));if(0<=e)return this.entries[System.Array.index(e,this.entries)].value}return null},System$Collections$IDictionary$setItem:function(t,n){null==t&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key),System.ThrowHelper.IfNullAndNullsAreIllegalThenThrow(m,n,System.ExceptionArgument.value);try{var e=Bridge.cast(Bridge.unbox(t,c),c);try{this.setItem(e,Bridge.cast(Bridge.unbox(n,m),m))}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongValueTypeArgumentException(System.Object,n,m)}}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongKeyTypeArgumentException(System.Object,t,c)}},add:function(e,t){this.Insert(e,t,!0)},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$add:function(e){this.add(e.key,e.value)},System$Collections$IDictionary$add:function(t,n){null==t&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key),System.ThrowHelper.IfNullAndNullsAreIllegalThenThrow(m,n,System.ExceptionArgument.value);try{var e=Bridge.cast(Bridge.unbox(t,c),c);try{this.add(e,Bridge.cast(Bridge.unbox(n,m),m))}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongValueTypeArgumentException(System.Object,n,m)}}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongKeyTypeArgumentException(System.Object,t,c)}},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$contains:function(e){var t=this.FindEntry(e.key);return!!(0<=t&&System.Collections.Generic.EqualityComparer$1(m).def.equals2(this.entries[System.Array.index(t,this.entries)].value,e.value))},System$Collections$IDictionary$contains:function(e){return!!System.Collections.Generic.Dictionary$2(c,m).IsCompatibleKey(e)&&this.containsKey(Bridge.cast(Bridge.unbox(e,c),c))},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$remove:function(e){var t=this.FindEntry(e.key);return!!(0<=t&&System.Collections.Generic.EqualityComparer$1(m).def.equals2(this.entries[System.Array.index(t,this.entries)].value,e.value))&&(this.remove(e.key),!0)},remove:function(e){if(null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key),this.isSimpleKey){if(null!=this.simpleBuckets&&this.simpleBuckets.hasOwnProperty(e)){var t=this.simpleBuckets[e];return delete this.simpleBuckets[e],this.entries[System.Array.index(t,this.entries)].hashCode=-1,this.entries[System.Array.index(t,this.entries)].next=this.freeList,this.entries[System.Array.index(t,this.entries)].key=Bridge.getDefaultValue(c),this.entries[System.Array.index(t,this.entries)].value=Bridge.getDefaultValue(m),this.freeList=t,this.freeCount=this.freeCount+1|0,this.version=this.version+1|0,!0}}else if(null!=this.buckets)for(var n=2147483647&this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(c)+"$getHashCode2","System$Collections$Generic$IEqualityComparer$1$getHashCode2")](e),i=n%this.buckets.length,r=-1,s=this.buckets[System.Array.index(i,this.buckets)];0<=s;r=s,s=this.entries[System.Array.index(s,this.entries)].next)if(this.entries[System.Array.index(s,this.entries)].hashCode===n&&this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(c)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2")](this.entries[System.Array.index(s,this.entries)].key,e))return r<0?this.buckets[System.Array.index(i,this.buckets)]=this.entries[System.Array.index(s,this.entries)].next:this.entries[System.Array.index(r,this.entries)].next=this.entries[System.Array.index(s,this.entries)].next,this.entries[System.Array.index(s,this.entries)].hashCode=-1,this.entries[System.Array.index(s,this.entries)].next=this.freeList,this.entries[System.Array.index(s,this.entries)].key=Bridge.getDefaultValue(c),this.entries[System.Array.index(s,this.entries)].value=Bridge.getDefaultValue(m),this.freeList=s,this.freeCount=this.freeCount+1|0,this.version=this.version+1|0,!0;return!1},System$Collections$IDictionary$remove:function(e){System.Collections.Generic.Dictionary$2(c,m).IsCompatibleKey(e)&&this.remove(Bridge.cast(Bridge.unbox(e,c),c))},clear:function(){if(0<this.count){for(var e=0;e<this.buckets.length;e=e+1|0)this.buckets[System.Array.index(e,this.buckets)]=-1;this.isSimpleKey&&(this.simpleBuckets={}),System.Array.fill(this.entries,function(){return Bridge.getDefaultValue(System.Collections.Generic.Dictionary$2.Entry(c,m))},0,this.count),this.freeList=-1,this.count=0,this.freeCount=0,this.version=this.version+1|0}},containsKey:function(e){return 0<=this.FindEntry(e)},ContainsValue:function(e){if(null==e){for(var t=0;t<this.count;t=t+1|0)if(0<=this.entries[System.Array.index(t,this.entries)].hashCode&&null==this.entries[System.Array.index(t,this.entries)].value)return!0}else for(var n=System.Collections.Generic.EqualityComparer$1(m).def,i=0;i<this.count;i=i+1|0)if(0<=this.entries[System.Array.index(i,this.entries)].hashCode&&n.equals2(this.entries[System.Array.index(i,this.entries)].value,e))return!0;return!1},CopyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),(t<0||t>e.length)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum),(e.length-t|0)<this.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);for(var n=this.count,i=this.entries,r=0;r<n;r=r+1|0)0<=i[System.Array.index(r,i)].hashCode&&(e[System.Array.index(Bridge.identity(t,t=t+1|0),e)]=new(System.Collections.Generic.KeyValuePair$2(c,m).$ctor1)(i[System.Array.index(r,i)].key,i[System.Array.index(r,i)].value))},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$copyTo:function(e,t){this.CopyTo(e,t)},System$Collections$ICollection$copyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),1!==System.Array.getRank(e)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_RankMultiDimNotSupported),0!==System.Array.getLower(e,0)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_NonZeroLowerBound),(t<0||t>e.length)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum),(e.length-t|0)<this.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);var n=Bridge.as(e,System.Array.type(System.Collections.Generic.KeyValuePair$2(c,m)));if(null!=n)this.CopyTo(n,t);else if(Bridge.is(e,System.Array.type(System.Collections.DictionaryEntry)))for(var i=Bridge.as(e,System.Array.type(System.Collections.DictionaryEntry)),r=this.entries,s=0;s<this.count;s=s+1|0)0<=r[System.Array.index(s,r)].hashCode&&(i[System.Array.index(Bridge.identity(t,t=t+1|0),i)]=new System.Collections.DictionaryEntry.$ctor1(r[System.Array.index(s,r)].key,r[System.Array.index(s,r)].value));else{var o=Bridge.as(e,System.Array.type(System.Object));null==o&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType);try{for(var a=this.count,u=this.entries,l=0;l<a;l=l+1|0)0<=u[System.Array.index(l,u)].hashCode&&(o[System.Array.index(Bridge.identity(t,t=t+1|0),o)]=new(System.Collections.Generic.KeyValuePair$2(c,m).$ctor1)(u[System.Array.index(l,u)].key,u[System.Array.index(l,u)].value))}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.ArrayTypeMismatchException))throw e;System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType)}}},GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.Enumerator(c,m).$ctor1)(this,System.Collections.Generic.Dictionary$2.Enumerator(c,m).KeyValuePair)},System$Collections$Generic$IEnumerable$1$System$Collections$Generic$KeyValuePair$2$GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.Enumerator(c,m).$ctor1)(this,System.Collections.Generic.Dictionary$2.Enumerator(c,m).KeyValuePair).$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.Enumerator(c,m).$ctor1)(this,System.Collections.Generic.Dictionary$2.Enumerator(c,m).KeyValuePair).$clone()},System$Collections$IDictionary$GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.Enumerator(c,m).$ctor1)(this,System.Collections.Generic.Dictionary$2.Enumerator(c,m).DictEntry).$clone()},FindEntry:function(e){if(null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key),this.isSimpleKey){if(null!=this.simpleBuckets&&this.simpleBuckets.hasOwnProperty(e))return this.simpleBuckets[e]}else if(null!=this.buckets)for(var t=2147483647&this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(c)+"$getHashCode2","System$Collections$Generic$IEqualityComparer$1$getHashCode2")](e),n=this.buckets[System.Array.index(t%this.buckets.length,this.buckets)];0<=n;n=this.entries[System.Array.index(n,this.entries)].next)if(this.entries[System.Array.index(n,this.entries)].hashCode===t&&this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(c)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2")](this.entries[System.Array.index(n,this.entries)].key,e))return n;return-1},Initialize:function(e){e=System.Collections.HashHelpers.GetPrime(e);this.buckets=System.Array.init(e,0,System.Int32);for(var t=0;t<this.buckets.length;t=t+1|0)this.buckets[System.Array.index(t,this.buckets)]=-1;this.entries=System.Array.init(e,function(){return new(System.Collections.Generic.Dictionary$2.Entry(c,m))},System.Collections.Generic.Dictionary$2.Entry(c,m)),this.freeList=-1,this.simpleBuckets={}},Insert:function(e,t,n){if(null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.key),null==this.buckets&&this.Initialize(0),this.isSimpleKey)return this.simpleBuckets.hasOwnProperty(e)?(n&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_AddingDuplicate),this.entries[System.Array.index(this.simpleBuckets[e],this.entries)].value=t):(0<this.freeCount?(s=this.freeList,this.freeList=this.entries[System.Array.index(s,this.entries)].next,this.freeCount=this.freeCount-1|0):(this.count===this.entries.length&&this.Resize(),s=this.count,this.count=this.count+1|0),this.entries[System.Array.index(s,this.entries)].hashCode=1,this.entries[System.Array.index(s,this.entries)].next=-1,this.entries[System.Array.index(s,this.entries)].key=e,this.entries[System.Array.index(s,this.entries)].value=t,this.simpleBuckets[e]=s),void(this.version=this.version+1|0);for(var i,r=2147483647&this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(c)+"$getHashCode2","System$Collections$Generic$IEqualityComparer$1$getHashCode2")](e),s=r%this.buckets.length,o=this.buckets[System.Array.index(s,this.buckets)];0<=o;o=this.entries[System.Array.index(o,this.entries)].next)if(this.entries[System.Array.index(o,this.entries)].hashCode===r&&this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(c)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2")](this.entries[System.Array.index(o,this.entries)].key,e))return n&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_AddingDuplicate),this.entries[System.Array.index(o,this.entries)].value=t,void(this.version=this.version+1|0);0<this.freeCount?(i=this.freeList,this.freeList=this.entries[System.Array.index(i,this.entries)].next,this.freeCount=this.freeCount-1|0):(this.count===this.entries.length&&(this.Resize(),s=r%this.buckets.length),i=this.count,this.count=this.count+1|0),this.entries[System.Array.index(i,this.entries)].hashCode=r,this.entries[System.Array.index(i,this.entries)].next=this.buckets[System.Array.index(s,this.buckets)],this.entries[System.Array.index(i,this.entries)].key=e,this.entries[System.Array.index(i,this.entries)].value=t,this.buckets[System.Array.index(s,this.buckets)]=i,this.version=this.version+1|0},Resize:function(){this.Resize$1(System.Collections.HashHelpers.ExpandPrime(this.count),!1)},Resize$1:function(e,t){for(var n=System.Array.init(e,0,System.Int32),i=0;i<n.length;i=i+1|0)n[System.Array.index(i,n)]=-1;this.isSimpleKey&&(this.simpleBuckets={});var r=System.Array.init(e,function(){return new(System.Collections.Generic.Dictionary$2.Entry(c,m))},System.Collections.Generic.Dictionary$2.Entry(c,m));if(System.Array.copy(this.entries,0,r,0,this.count),t)for(var s=0;s<this.count;s=s+1|0)-1!==r[System.Array.index(s,r)].hashCode&&(r[System.Array.index(s,r)].hashCode=2147483647&this.comparer[Bridge.geti(this.comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(c)+"$getHashCode2","System$Collections$Generic$IEqualityComparer$1$getHashCode2")](r[System.Array.index(s,r)].key));for(var o,a=0;a<this.count;a=a+1|0)0<=r[System.Array.index(a,r)].hashCode&&(this.isSimpleKey?(r[System.Array.index(a,r)].next=-1,this.simpleBuckets[r[System.Array.index(a,r)].key]=a):(o=r[System.Array.index(a,r)].hashCode%e,r[System.Array.index(a,r)].next=n[System.Array.index(o,n)],n[System.Array.index(o,n)]=a));this.buckets=n,this.entries=r},tryGetValue:function(e,t){e=this.FindEntry(e);return 0<=e?(t.v=this.entries[System.Array.index(e,this.entries)].value,!0):(t.v=Bridge.getDefaultValue(m),!1)},GetValueOrDefault:function(e){e=this.FindEntry(e);return 0<=e?this.entries[System.Array.index(e,this.entries)].value:Bridge.getDefaultValue(m)}}}}),Bridge.define("System.Collections.Generic.Dictionary$2.Entry",function(t,n){return{$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.Dictionary$2.Entry(t,n))}}},fields:{hashCode:0,next:0,key:Bridge.getDefaultValue(t),value:Bridge.getDefaultValue(n)},ctors:{ctor:function(){this.$initialize()}},methods:{getHashCode:function(){return Bridge.addHash([1920233150,this.hashCode,this.next,this.key,this.value])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.Dictionary$2.Entry(t,n))&&(Bridge.equals(this.hashCode,e.hashCode)&&Bridge.equals(this.next,e.next)&&Bridge.equals(this.key,e.key)&&Bridge.equals(this.value,e.value))},$clone:function(e){e=e||new(System.Collections.Generic.Dictionary$2.Entry(t,n));return e.hashCode=this.hashCode,e.next=this.next,e.key=this.key,e.value=this.value,e}}}}),Bridge.define("System.Collections.Generic.Dictionary$2.Enumerator",function(n,i){return{inherits:[System.Collections.Generic.IEnumerator$1(System.Collections.Generic.KeyValuePair$2(n,i)),System.Collections.IDictionaryEnumerator],$kind:"nested struct",statics:{fields:{DictEntry:0,KeyValuePair:0},ctors:{init:function(){this.DictEntry=1,this.KeyValuePair=2}},methods:{getDefaultValue:function(){return new(System.Collections.Generic.Dictionary$2.Enumerator(n,i))}}},fields:{dictionary:null,version:0,index:0,current:null,getEnumeratorRetType:0},props:{Current:{get:function(){return this.current}},System$Collections$IEnumerator$Current:{get:function(){return 0!==this.index&&this.index!==(this.dictionary.count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.getEnumeratorRetType===System.Collections.Generic.Dictionary$2.Enumerator(n,i).DictEntry?new System.Collections.DictionaryEntry.$ctor1(this.current.key,this.current.value).$clone():new(System.Collections.Generic.KeyValuePair$2(n,i).$ctor1)(this.current.key,this.current.value)}},System$Collections$IDictionaryEnumerator$Entry:{get:function(){return 0!==this.index&&this.index!==(this.dictionary.count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),new System.Collections.DictionaryEntry.$ctor1(this.current.key,this.current.value)}},System$Collections$IDictionaryEnumerator$Key:{get:function(){return 0!==this.index&&this.index!==(this.dictionary.count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.current.key}},System$Collections$IDictionaryEnumerator$Value:{get:function(){return 0!==this.index&&this.index!==(this.dictionary.count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.current.value}}},alias:["moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(n)+"$"+Bridge.getTypeAlias(i)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"],"Dispose","System$IDisposable$Dispose"],ctors:{init:function(){this.current=new(System.Collections.Generic.KeyValuePair$2(n,i))},$ctor1:function(e,t){this.$initialize(),this.dictionary=e,this.version=e.version,this.index=0,this.getEnumeratorRetType=t,this.current=new(System.Collections.Generic.KeyValuePair$2(n,i).ctor)},ctor:function(){this.$initialize()}},methods:{moveNext:function(){var e;for(this.version!==this.dictionary.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion);this.index>>>0<this.dictionary.count>>>0;){if(0<=(e=this.dictionary.entries)[System.Array.index(this.index,e)].hashCode)return this.current=new(System.Collections.Generic.KeyValuePair$2(n,i).$ctor1)((e=this.dictionary.entries)[System.Array.index(this.index,e)].key,(e=this.dictionary.entries)[System.Array.index(this.index,e)].value),this.index=this.index+1|0,!0;this.index=this.index+1|0}return this.index=this.dictionary.count+1|0,this.current=new(System.Collections.Generic.KeyValuePair$2(n,i).ctor),!1},Dispose:function(){},System$Collections$IEnumerator$reset:function(){this.version!==this.dictionary.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.index=0,this.current=new(System.Collections.Generic.KeyValuePair$2(n,i).ctor)},getHashCode:function(){return Bridge.addHash([3788985113,this.dictionary,this.version,this.index,this.current,this.getEnumeratorRetType])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.Dictionary$2.Enumerator(n,i))&&(Bridge.equals(this.dictionary,e.dictionary)&&Bridge.equals(this.version,e.version)&&Bridge.equals(this.index,e.index)&&Bridge.equals(this.current,e.current)&&Bridge.equals(this.getEnumeratorRetType,e.getEnumeratorRetType))},$clone:function(e){e=e||new(System.Collections.Generic.Dictionary$2.Enumerator(n,i));return e.dictionary=this.dictionary,e.version=this.version,e.index=this.index,e.current=this.current,e.getEnumeratorRetType=this.getEnumeratorRetType,e}}}}),Bridge.define("System.Collections.Generic.Dictionary$2.KeyCollection",function(a,e){return{inherits:[System.Collections.Generic.ICollection$1(a),System.Collections.ICollection,System.Collections.Generic.IReadOnlyCollection$1(a)],$kind:"nested class",fields:{dictionary:null},props:{Count:{get:function(){return this.dictionary.Count}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!0}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return Bridge.cast(this.dictionary,System.Collections.ICollection).System$Collections$ICollection$SyncRoot}}},alias:["copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$copyTo","Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(a)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$Count","System$Collections$Generic$ICollection$1$IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$IsReadOnly","System$Collections$Generic$ICollection$1$add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$add","System$Collections$Generic$ICollection$1$clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$clear","System$Collections$Generic$ICollection$1$contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$contains","System$Collections$Generic$ICollection$1$remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$remove","System$Collections$Generic$IEnumerable$1$GetEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(a)+"$GetEnumerator"],ctors:{ctor:function(e){this.$initialize(),null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.dictionary),this.dictionary=e}},methods:{GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.KeyCollection.Enumerator(a,e).$ctor1)(this.dictionary)},System$Collections$Generic$IEnumerable$1$GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.KeyCollection.Enumerator(a,e).$ctor1)(this.dictionary).$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.KeyCollection.Enumerator(a,e).$ctor1)(this.dictionary).$clone()},copyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),(t<0||t>e.length)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum),(e.length-t|0)<this.dictionary.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);for(var n=this.dictionary.count,i=this.dictionary.entries,r=0;r<n;r=r+1|0)0<=i[System.Array.index(r,i)].hashCode&&(e[System.Array.index(Bridge.identity(t,t=t+1|0),e)]=i[System.Array.index(r,i)].key)},System$Collections$ICollection$copyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),1!==System.Array.getRank(e)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_RankMultiDimNotSupported),0!==System.Array.getLower(e,0)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_NonZeroLowerBound),(t<0||t>e.length)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum),(e.length-t|0)<this.dictionary.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);var n=Bridge.as(e,System.Array.type(a));if(null!=n)this.copyTo(n,t);else{var i=Bridge.as(e,System.Array.type(System.Object));null==i&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType);var r=this.dictionary.count,s=this.dictionary.entries;try{for(var o=0;o<r;o=o+1|0)0<=s[System.Array.index(o,s)].hashCode&&(i[System.Array.index(Bridge.identity(t,t=t+1|0),i)]=s[System.Array.index(o,s)].key)}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.ArrayTypeMismatchException))throw e;System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType)}}},System$Collections$Generic$ICollection$1$add:function(e){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_KeyCollectionSet)},System$Collections$Generic$ICollection$1$clear:function(){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_KeyCollectionSet)},System$Collections$Generic$ICollection$1$contains:function(e){return this.dictionary.containsKey(e)},System$Collections$Generic$ICollection$1$remove:function(e){return System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_KeyCollectionSet),!1}}}}),Bridge.define("System.Collections.Generic.Dictionary$2.KeyCollection.Enumerator",function(t,n){return{inherits:[System.Collections.Generic.IEnumerator$1(t),System.Collections.IEnumerator],$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.Dictionary$2.KeyCollection.Enumerator(t,n))}}},fields:{dictionary:null,index:0,version:0,currentKey:Bridge.getDefaultValue(t)},props:{Current:{get:function(){return this.currentKey}},System$Collections$IEnumerator$Current:{get:function(){return 0!==this.index&&this.index!==(this.dictionary.count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.currentKey}}},alias:["Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{$ctor1:function(e){this.$initialize(),this.dictionary=e,this.version=e.version,this.index=0,this.currentKey=Bridge.getDefaultValue(t)},ctor:function(){this.$initialize()}},methods:{Dispose:function(){},moveNext:function(){var e;for(this.version!==this.dictionary.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion);this.index>>>0<this.dictionary.count>>>0;){if(0<=(e=this.dictionary.entries)[System.Array.index(this.index,e)].hashCode)return this.currentKey=(e=this.dictionary.entries)[System.Array.index(this.index,e)].key,this.index=this.index+1|0,!0;this.index=this.index+1|0}return this.index=this.dictionary.count+1|0,this.currentKey=Bridge.getDefaultValue(t),!1},System$Collections$IEnumerator$reset:function(){this.version!==this.dictionary.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.index=0,this.currentKey=Bridge.getDefaultValue(t)},getHashCode:function(){return Bridge.addHash([3788985113,this.dictionary,this.index,this.version,this.currentKey])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.Dictionary$2.KeyCollection.Enumerator(t,n))&&(Bridge.equals(this.dictionary,e.dictionary)&&Bridge.equals(this.index,e.index)&&Bridge.equals(this.version,e.version)&&Bridge.equals(this.currentKey,e.currentKey))},$clone:function(e){e=e||new(System.Collections.Generic.Dictionary$2.KeyCollection.Enumerator(t,n));return e.dictionary=this.dictionary,e.index=this.index,e.version=this.version,e.currentKey=this.currentKey,e}}}}),Bridge.define("System.Collections.Generic.Dictionary$2.ValueCollection",function(e,a){return{inherits:[System.Collections.Generic.ICollection$1(a),System.Collections.ICollection,System.Collections.Generic.IReadOnlyCollection$1(a)],$kind:"nested class",fields:{dictionary:null},props:{Count:{get:function(){return this.dictionary.Count}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!0}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return Bridge.cast(this.dictionary,System.Collections.ICollection).System$Collections$ICollection$SyncRoot}}},alias:["copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$copyTo","Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(a)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$Count","System$Collections$Generic$ICollection$1$IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$IsReadOnly","System$Collections$Generic$ICollection$1$add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$add","System$Collections$Generic$ICollection$1$remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$remove","System$Collections$Generic$ICollection$1$clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$clear","System$Collections$Generic$ICollection$1$contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$contains","System$Collections$Generic$IEnumerable$1$GetEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(a)+"$GetEnumerator"],ctors:{ctor:function(e){this.$initialize(),null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.dictionary),this.dictionary=e}},methods:{GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.ValueCollection.Enumerator(e,a).$ctor1)(this.dictionary)},System$Collections$Generic$IEnumerable$1$GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.ValueCollection.Enumerator(e,a).$ctor1)(this.dictionary).$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.Dictionary$2.ValueCollection.Enumerator(e,a).$ctor1)(this.dictionary).$clone()},copyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),(t<0||t>e.length)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum),(e.length-t|0)<this.dictionary.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);for(var n=this.dictionary.count,i=this.dictionary.entries,r=0;r<n;r=r+1|0)0<=i[System.Array.index(r,i)].hashCode&&(e[System.Array.index(Bridge.identity(t,t=t+1|0),e)]=i[System.Array.index(r,i)].value)},System$Collections$ICollection$copyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),1!==System.Array.getRank(e)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_RankMultiDimNotSupported),0!==System.Array.getLower(e,0)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_NonZeroLowerBound),(t<0||t>e.length)&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum),(e.length-t|0)<this.dictionary.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);var n=Bridge.as(e,System.Array.type(a));if(null!=n)this.copyTo(n,t);else{var i=Bridge.as(e,System.Array.type(System.Object));null==i&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType);var r=this.dictionary.count,s=this.dictionary.entries;try{for(var o=0;o<r;o=o+1|0)0<=s[System.Array.index(o,s)].hashCode&&(i[System.Array.index(Bridge.identity(t,t=t+1|0),i)]=s[System.Array.index(o,s)].value)}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.ArrayTypeMismatchException))throw e;System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Argument_InvalidArrayType)}}},System$Collections$Generic$ICollection$1$add:function(e){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ValueCollectionSet)},System$Collections$Generic$ICollection$1$remove:function(e){return System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ValueCollectionSet),!1},System$Collections$Generic$ICollection$1$clear:function(){System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ValueCollectionSet)},System$Collections$Generic$ICollection$1$contains:function(e){return this.dictionary.ContainsValue(e)}}}}),Bridge.define("System.Collections.Generic.Dictionary$2.ValueCollection.Enumerator",function(t,n){return{inherits:[System.Collections.Generic.IEnumerator$1(n),System.Collections.IEnumerator],$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.Dictionary$2.ValueCollection.Enumerator(t,n))}}},fields:{dictionary:null,index:0,version:0,currentValue:Bridge.getDefaultValue(n)},props:{Current:{get:function(){return this.currentValue}},System$Collections$IEnumerator$Current:{get:function(){return 0!==this.index&&this.index!==(this.dictionary.count+1|0)||System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen),this.currentValue}}},alias:["Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(n)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{$ctor1:function(e){this.$initialize(),this.dictionary=e,this.version=e.version,this.index=0,this.currentValue=Bridge.getDefaultValue(n)},ctor:function(){this.$initialize()}},methods:{Dispose:function(){},moveNext:function(){var e;for(this.version!==this.dictionary.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion);this.index>>>0<this.dictionary.count>>>0;){if(0<=(e=this.dictionary.entries)[System.Array.index(this.index,e)].hashCode)return this.currentValue=(e=this.dictionary.entries)[System.Array.index(this.index,e)].value,this.index=this.index+1|0,!0;this.index=this.index+1|0}return this.index=this.dictionary.count+1|0,this.currentValue=Bridge.getDefaultValue(n),!1},System$Collections$IEnumerator$reset:function(){this.version!==this.dictionary.version&&System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion),this.index=0,this.currentValue=Bridge.getDefaultValue(n)},getHashCode:function(){return Bridge.addHash([3788985113,this.dictionary,this.index,this.version,this.currentValue])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.Dictionary$2.ValueCollection.Enumerator(t,n))&&(Bridge.equals(this.dictionary,e.dictionary)&&Bridge.equals(this.index,e.index)&&Bridge.equals(this.version,e.version)&&Bridge.equals(this.currentValue,e.currentValue))},$clone:function(e){e=e||new(System.Collections.Generic.Dictionary$2.ValueCollection.Enumerator(t,n));return e.dictionary=this.dictionary,e.index=this.index,e.version=this.version,e.currentValue=this.currentValue,e}}}}),Bridge.define("System.Collections.ObjectModel.ReadOnlyDictionary$2",function(l,c){return{inherits:[System.Collections.Generic.IDictionary$2(l,c),System.Collections.IDictionary,System.Collections.Generic.IReadOnlyDictionary$2(l,c)],statics:{fields:{NotSupported_ReadOnlyCollection:null},ctors:{init:function(){this.NotSupported_ReadOnlyCollection="Collection is read-only."}},methods:{IsCompatibleKey:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("key");return Bridge.is(e,l)}}},fields:{m_dictionary:null,_keys:null,_values:null},props:{Dictionary:{get:function(){return this.m_dictionary}},Keys:{get:function(){return null==this._keys&&(this._keys=new(System.Collections.ObjectModel.ReadOnlyDictionary$2.KeyCollection(l,c))(this.m_dictionary["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$Keys"])),this._keys}},Values:{get:function(){return null==this._values&&(this._values=new(System.Collections.ObjectModel.ReadOnlyDictionary$2.ValueCollection(l,c))(this.m_dictionary["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$Values"])),this._values}},System$Collections$Generic$IDictionary$2$Keys:{get:function(){return this.Keys}},System$Collections$Generic$IDictionary$2$Values:{get:function(){return this.Values}},Count:{get:function(){return System.Array.getCount(this.m_dictionary,System.Collections.Generic.KeyValuePair$2(l,c))}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!0}},System$Collections$IDictionary$IsFixedSize:{get:function(){return!0}},System$Collections$IDictionary$IsReadOnly:{get:function(){return!0}},System$Collections$IDictionary$Keys:{get:function(){return this.Keys}},System$Collections$IDictionary$Values:{get:function(){return this.Values}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return null}},System$Collections$Generic$IReadOnlyDictionary$2$Keys:{get:function(){return this.Keys}},System$Collections$Generic$IReadOnlyDictionary$2$Values:{get:function(){return this.Values}}},alias:["containsKey","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$containsKey","containsKey","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$containsKey","System$Collections$Generic$IDictionary$2$Keys","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$Keys","tryGetValue","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$tryGetValue","tryGetValue","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$tryGetValue","System$Collections$Generic$IDictionary$2$Values","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$Values","getItem","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$getItem","System$Collections$Generic$IDictionary$2$add","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$add","System$Collections$Generic$IDictionary$2$remove","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$remove","System$Collections$Generic$IDictionary$2$getItem","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$getItem","System$Collections$Generic$IDictionary$2$setItem","System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$setItem","Count",["System$Collections$Generic$IReadOnlyCollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$Count","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$contains","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$contains","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$copyTo","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$copyTo","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$IsReadOnly","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$IsReadOnly","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$add","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$add","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$clear","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$clear","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$remove","System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$remove","GetEnumerator",["System$Collections$Generic$IEnumerable$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$GetEnumerator","System$Collections$Generic$IEnumerable$1$GetEnumerator"],"System$Collections$Generic$IReadOnlyDictionary$2$Keys","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$Keys","System$Collections$Generic$IReadOnlyDictionary$2$Values","System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$Values"],ctors:{ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("dictionary");this.m_dictionary=e}},methods:{getItem:function(e){return this.m_dictionary["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$getItem"](e)},System$Collections$Generic$IDictionary$2$getItem:function(e){return this.m_dictionary["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$getItem"](e)},System$Collections$Generic$IDictionary$2$setItem:function(e,t){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},System$Collections$IDictionary$getItem:function(e){return System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).IsCompatibleKey(e)?this.getItem(Bridge.cast(Bridge.unbox(e,l),l)):null},System$Collections$IDictionary$setItem:function(e,t){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},containsKey:function(e){return this.m_dictionary["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$containsKey"](e)},tryGetValue:function(e,t){return this.m_dictionary["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$tryGetValue"](e,t)},System$Collections$Generic$IDictionary$2$add:function(e,t){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$add:function(e){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},System$Collections$IDictionary$add:function(e,t){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},System$Collections$Generic$IDictionary$2$remove:function(e){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$remove:function(e){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},System$Collections$IDictionary$remove:function(e){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$contains:function(e){return System.Array.contains(this.m_dictionary,e,System.Collections.Generic.KeyValuePair$2(l,c))},System$Collections$IDictionary$contains:function(e){return System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).IsCompatibleKey(e)&&this.containsKey(Bridge.cast(Bridge.unbox(e,l),l))},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$copyTo:function(e,t){System.Array.copyTo(this.m_dictionary,e,t,System.Collections.Generic.KeyValuePair$2(l,c))},System$Collections$ICollection$copyTo:function(e,t){var n,i;if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(1!==System.Array.getRank(e))throw new System.ArgumentException.$ctor1("Only single dimensional arrays are supported for the requested action.");if(0!==System.Array.getLower(e,0))throw new System.ArgumentException.$ctor1("The lower bound of target array must be zero.");if(t<0||t>e.length)throw new System.ArgumentOutOfRangeException.$ctor4("index","Non-negative number required.");if((e.length-t|0)<this.Count)throw new System.ArgumentException.$ctor1("Destination array is not long enough to copy all the items in the collection. Check array index and length.");var r=Bridge.as(e,System.Array.type(System.Collections.Generic.KeyValuePair$2(l,c)));if(null!=r)System.Array.copyTo(this.m_dictionary,r,t,System.Collections.Generic.KeyValuePair$2(l,c));else{var s=Bridge.as(e,System.Array.type(System.Collections.DictionaryEntry));if(null!=s){n=Bridge.getEnumerator(this.m_dictionary,System.Collections.Generic.KeyValuePair$2(l,c));try{for(;n.moveNext();){var o=n.Current;s[System.Array.index(Bridge.identity(t,t=t+1|0),s)]=new System.Collections.DictionaryEntry.$ctor1(o.key,o.value)}}finally{Bridge.is(n,System.IDisposable)&&n.System$IDisposable$Dispose()}}else{var a=Bridge.as(e,System.Array.type(System.Object));if(null==a)throw new System.ArgumentException.$ctor1("Target array type is not compatible with the type of items in the collection.");try{i=Bridge.getEnumerator(this.m_dictionary,System.Collections.Generic.KeyValuePair$2(l,c));try{for(;i.moveNext();){var u=i.Current;a[System.Array.index(Bridge.identity(t,t=t+1|0),a)]=new(System.Collections.Generic.KeyValuePair$2(l,c).$ctor1)(u.key,u.value)}}finally{Bridge.is(i,System.IDisposable)&&i.System$IDisposable$Dispose()}}catch(e){throw e=System.Exception.create(e),Bridge.is(e,System.ArrayTypeMismatchException)?new System.ArgumentException.$ctor1("Target array type is not compatible with the type of items in the collection."):e}}}},System$Collections$Generic$ICollection$1$System$Collections$Generic$KeyValuePair$2$clear:function(){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},System$Collections$IDictionary$clear:function(){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(l,c).NotSupported_ReadOnlyCollection)},GetEnumerator:function(){return Bridge.getEnumerator(this.m_dictionary,System.Collections.Generic.KeyValuePair$2(l,c))},System$Collections$IEnumerable$GetEnumerator:function(){return Bridge.getEnumerator(Bridge.cast(this.m_dictionary,System.Collections.IEnumerable))},System$Collections$IDictionary$GetEnumerator:function(){var e=Bridge.as(this.m_dictionary,System.Collections.IDictionary);return null!=e?e.System$Collections$IDictionary$GetEnumerator():new(System.Collections.ObjectModel.ReadOnlyDictionary$2.DictionaryEnumerator(l,c).$ctor1)(this.m_dictionary).$clone()}}}}),Bridge.define("System.Collections.ObjectModel.ReadOnlyDictionary$2.DictionaryEnumerator",function(t,n){return{inherits:[System.Collections.IDictionaryEnumerator],$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.ObjectModel.ReadOnlyDictionary$2.DictionaryEnumerator(t,n))}}},fields:{_dictionary:null,_enumerator:null},props:{Entry:{get:function(){return new System.Collections.DictionaryEntry.$ctor1(this._enumerator[Bridge.geti(this._enumerator,"System$Collections$Generic$IEnumerator$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(n)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")].key,this._enumerator[Bridge.geti(this._enumerator,"System$Collections$Generic$IEnumerator$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(n)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")].value)}},Key:{get:function(){return this._enumerator[Bridge.geti(this._enumerator,"System$Collections$Generic$IEnumerator$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(n)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")].key}},Value:{get:function(){return this._enumerator[Bridge.geti(this._enumerator,"System$Collections$Generic$IEnumerator$1$System$Collections$Generic$KeyValuePair$2$"+Bridge.getTypeAlias(t)+"$"+Bridge.getTypeAlias(n)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")].value}},Current:{get:function(){return this.Entry.$clone()}}},alias:["Entry","System$Collections$IDictionaryEnumerator$Entry","Key","System$Collections$IDictionaryEnumerator$Key","Value","System$Collections$IDictionaryEnumerator$Value","Current","System$Collections$IEnumerator$Current","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"],ctors:{$ctor1:function(e){this.$initialize(),this._dictionary=e,this._enumerator=Bridge.getEnumerator(this._dictionary,System.Collections.Generic.KeyValuePair$2(t,n))},ctor:function(){this.$initialize()}},methods:{moveNext:function(){return this._enumerator.System$Collections$IEnumerator$moveNext()},reset:function(){this._enumerator.System$Collections$IEnumerator$reset()},getHashCode:function(){return Bridge.addHash([9276503029,this._dictionary,this._enumerator])},equals:function(e){return!!Bridge.is(e,System.Collections.ObjectModel.ReadOnlyDictionary$2.DictionaryEnumerator(t,n))&&(Bridge.equals(this._dictionary,e._dictionary)&&Bridge.equals(this._enumerator,e._enumerator))},$clone:function(e){e=e||new(System.Collections.ObjectModel.ReadOnlyDictionary$2.DictionaryEnumerator(t,n));return e._dictionary=this._dictionary,e._enumerator=this._enumerator,e}}}}),Bridge.define("System.Collections.ObjectModel.ReadOnlyDictionary$2.KeyCollection",function(n,t){return{inherits:[System.Collections.Generic.ICollection$1(n),System.Collections.ICollection,System.Collections.Generic.IReadOnlyCollection$1(n)],$kind:"nested class",fields:{_collection:null},props:{Count:{get:function(){return System.Array.getCount(this._collection,n)}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!0}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return null}}},alias:["System$Collections$Generic$ICollection$1$add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$add","System$Collections$Generic$ICollection$1$clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$clear","System$Collections$Generic$ICollection$1$contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$copyTo","Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(n)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$Count","System$Collections$Generic$ICollection$1$IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$IsReadOnly","System$Collections$Generic$ICollection$1$remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$remove","GetEnumerator",["System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(n)+"$GetEnumerator","System$Collections$Generic$IEnumerable$1$GetEnumerator"]],ctors:{ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("collection");this._collection=e}},methods:{System$Collections$Generic$ICollection$1$add:function(e){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(n,t).NotSupported_ReadOnlyCollection)},System$Collections$Generic$ICollection$1$clear:function(){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(n,t).NotSupported_ReadOnlyCollection)},System$Collections$Generic$ICollection$1$contains:function(e){return System.Array.contains(this._collection,e,n)},copyTo:function(e,t){System.Array.copyTo(this._collection,e,t,n)},System$Collections$ICollection$copyTo:function(e,t){System.Collections.ObjectModel.ReadOnlyDictionaryHelpers.CopyToNonGenericICollectionHelper(n,this._collection,e,t)},System$Collections$Generic$ICollection$1$remove:function(e){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(n,t).NotSupported_ReadOnlyCollection)},GetEnumerator:function(){return Bridge.getEnumerator(this._collection,n)},System$Collections$IEnumerable$GetEnumerator:function(){return Bridge.getEnumerator(Bridge.cast(this._collection,System.Collections.IEnumerable))}}}}),Bridge.define("System.Collections.ObjectModel.ReadOnlyDictionary$2.ValueCollection",function(t,n){return{inherits:[System.Collections.Generic.ICollection$1(n),System.Collections.ICollection,System.Collections.Generic.IReadOnlyCollection$1(n)],$kind:"nested class",fields:{_collection:null},props:{Count:{get:function(){return System.Array.getCount(this._collection,n)}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!0}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return null}}},alias:["System$Collections$Generic$ICollection$1$add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$add","System$Collections$Generic$ICollection$1$clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$clear","System$Collections$Generic$ICollection$1$contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$copyTo","Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(n)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$Count","System$Collections$Generic$ICollection$1$IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$IsReadOnly","System$Collections$Generic$ICollection$1$remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(n)+"$remove","GetEnumerator",["System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(n)+"$GetEnumerator","System$Collections$Generic$IEnumerable$1$GetEnumerator"]],ctors:{ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("collection");this._collection=e}},methods:{System$Collections$Generic$ICollection$1$add:function(e){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(t,n).NotSupported_ReadOnlyCollection)},System$Collections$Generic$ICollection$1$clear:function(){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(t,n).NotSupported_ReadOnlyCollection)},System$Collections$Generic$ICollection$1$contains:function(e){return System.Array.contains(this._collection,e,n)},copyTo:function(e,t){System.Array.copyTo(this._collection,e,t,n)},System$Collections$ICollection$copyTo:function(e,t){System.Collections.ObjectModel.ReadOnlyDictionaryHelpers.CopyToNonGenericICollectionHelper(n,this._collection,e,t)},System$Collections$Generic$ICollection$1$remove:function(e){throw new System.NotSupportedException.$ctor1(System.Collections.ObjectModel.ReadOnlyDictionary$2(t,n).NotSupported_ReadOnlyCollection)},GetEnumerator:function(){return Bridge.getEnumerator(this._collection,n)},System$Collections$IEnumerable$GetEnumerator:function(){return Bridge.getEnumerator(Bridge.cast(this._collection,System.Collections.IEnumerable))}}}}),Bridge.define("System.Collections.ObjectModel.ReadOnlyDictionaryHelpers",{statics:{methods:{CopyToNonGenericICollectionHelper:function(e,t,n,i){var r;if(null==n)throw new System.ArgumentNullException.$ctor1("array");if(1!==System.Array.getRank(n))throw new System.ArgumentException.$ctor1("Only single dimensional arrays are supported for the requested action.");if(0!==System.Array.getLower(n,0))throw new System.ArgumentException.$ctor1("The lower bound of target array must be zero.");if(i<0)throw new System.ArgumentOutOfRangeException.$ctor4("index","Index is less than zero.");if((n.length-i|0)<System.Array.getCount(t,e))throw new System.ArgumentException.$ctor1("Destination array is not long enough to copy all the items in the collection. Check array index and length.");var s=Bridge.as(t,System.Collections.ICollection);if(null==s){var o=Bridge.as(n,System.Array.type(e));if(null!=o)System.Array.copyTo(t,o,i,e);else{var a=Bridge.as(n,System.Array.type(System.Object));if(null==a)throw new System.ArgumentException.$ctor1("Target array type is not compatible with the type of items in the collection.");try{r=Bridge.getEnumerator(t,e);try{for(;r.moveNext();){var u=r.Current;a[System.Array.index(Bridge.identity(i,i=i+1|0),a)]=u}}finally{Bridge.is(r,System.IDisposable)&&r.System$IDisposable$Dispose()}}catch(e){throw e=System.Exception.create(e),Bridge.is(e,System.ArrayTypeMismatchException)?new System.ArgumentException.$ctor1("Target array type is not compatible with the type of items in the collection."):e}}}else System.Array.copyTo(s,n,i)}}}}),Bridge.define("System.Collections.Generic.CollectionExtensions",{statics:{methods:{GetValueOrDefault:function(e,t,n,i){return System.Collections.Generic.CollectionExtensions.GetValueOrDefault$1(e,t,n,i,Bridge.getDefaultValue(t))},GetValueOrDefault$1:function(e,t,n,i,r){if(null==n)throw new System.ArgumentNullException.$ctor1("dictionary");var s={};return n["System$Collections$Generic$IReadOnlyDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$tryGetValue"](i,s)?s.v:r},TryAdd:function(e,t,n,i,r){if(null==n)throw new System.ArgumentNullException.$ctor1("dictionary");return!n["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$containsKey"](i)&&(n["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$add"](i,r),!0)},Remove:function(e,t,n,i,r){if(null==n)throw new System.ArgumentNullException.$ctor1("dictionary");return n["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$tryGetValue"](i,r)?(n["System$Collections$Generic$IDictionary$2$"+Bridge.getTypeAlias(e)+"$"+Bridge.getTypeAlias(t)+"$remove"](i),!0):(r.v=Bridge.getDefaultValue(t),!1)}}}}),Bridge.define("System.StringComparer",{inherits:[System.Collections.Generic.IComparer$1(System.String),System.Collections.Generic.IEqualityComparer$1(System.String)],statics:{fields:{_ordinal:null,_ordinalIgnoreCase:null},props:{Ordinal:{get:function(){return System.StringComparer._ordinal}},OrdinalIgnoreCase:{get:function(){return System.StringComparer._ordinalIgnoreCase}}},ctors:{init:function(){this._ordinal=new System.OrdinalComparer(!1),this._ordinalIgnoreCase=new System.OrdinalComparer(!0)}}},methods:{Compare:function(e,t){if(Bridge.referenceEquals(e,t))return 0;if(null==e)return-1;if(null==t)return 1;var n=Bridge.as(e,System.String);if(null!=n){var i=Bridge.as(t,System.String);if(null!=i)return this.compare(n,i)}e=Bridge.as(e,System.IComparable);if(null!=e)return Bridge.compare(e,t);throw new System.ArgumentException.$ctor1("At least one object must implement IComparable.")},Equals:function(e,t){if(Bridge.referenceEquals(e,t))return!0;if(null==e||null==t)return!1;var n=Bridge.as(e,System.String);if(null!=n){var i=Bridge.as(t,System.String);if(null!=i)return this.equals2(n,i)}return Bridge.equals(e,t)},GetHashCode:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("obj");var t=Bridge.as(e,System.String);return null!=t?this.getHashCode2(t):Bridge.getHashCode(e)}}}),Bridge.define("System.OrdinalComparer",{inherits:[System.StringComparer],fields:{_ignoreCase:!1},alias:["compare",["System$Collections$Generic$IComparer$1$System$String$compare","System$Collections$Generic$IComparer$1$compare"],"equals2",["System$Collections$Generic$IEqualityComparer$1$System$String$equals2","System$Collections$Generic$IEqualityComparer$1$equals2"],"getHashCode2",["System$Collections$Generic$IEqualityComparer$1$System$String$getHashCode2","System$Collections$Generic$IEqualityComparer$1$getHashCode2"]],ctors:{ctor:function(e){this.$initialize(),System.StringComparer.ctor.call(this),this._ignoreCase=e}},methods:{compare:function(e,t){return Bridge.referenceEquals(e,t)?0:null==e?-1:null==t?1:this._ignoreCase?System.String.compare(e,t,5):System.String.compare(e,t,!1)},equals2:function(e,t){return!!Bridge.referenceEquals(e,t)||null!=e&&null!=t&&(this._ignoreCase?e.length===t.length&&0===System.String.compare(e,t,5):System.String.equals(e,t))},equals:function(e){e=Bridge.as(e,System.OrdinalComparer);return null!=e&&this._ignoreCase===e._ignoreCase},getHashCode2:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("obj");return this._ignoreCase&&null!=e?Bridge.getHashCode(e.toLowerCase()):Bridge.getHashCode(e)},getHashCode:function(){var e=Bridge.getHashCode("OrdinalComparer");return this._ignoreCase?~e:e}}}),Bridge.define("Bridge.CustomEnumerator",{inherits:[System.Collections.IEnumerator,System.IDisposable],config:{properties:{Current:{get:function(){return this.getCurrent()}},Current$1:{get:function(){return this.getCurrent()}}},alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset","Dispose","System$IDisposable$Dispose","Current","System$Collections$IEnumerator$Current"]},ctor:function(e,t,n,i,r,s){this.$initialize(),this.$moveNext=e,this.$getCurrent=t,this.$Dispose=i,this.$reset=n,this.scope=r,s&&(this["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(s)+"$getCurrent$1"]=this.getCurrent,this.System$Collections$Generic$IEnumerator$1$getCurrent$1=this.getCurrent,Object.defineProperty(this,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(s)+"$Current$1",{get:this.getCurrent,enumerable:!0}),Object.defineProperty(this,"System$Collections$Generic$IEnumerator$1$Current$1",{get:this.getCurrent,enumerable:!0}))},moveNext:function(){try{return this.$moveNext.call(this.scope)}catch(e){throw this.Dispose.call(this.scope),e}},getCurrent:function(){return this.$getCurrent.call(this.scope)},getCurrent$1:function(){return this.$getCurrent.call(this.scope)},reset:function(){this.$reset&&this.$reset.call(this.scope)},Dispose:function(){this.$Dispose&&this.$Dispose.call(this.scope)}}),Bridge.define("Bridge.ArrayEnumerator",{inherits:[System.Collections.IEnumerator,System.IDisposable],statics:{$isArrayEnumerator:!0},config:{properties:{Current:{get:function(){return this.getCurrent()}},Current$1:{get:function(){return this.getCurrent()}}},alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset","Dispose","System$IDisposable$Dispose","Current","System$Collections$IEnumerator$Current"]},ctor:function(e,t){this.$initialize(),this.array=e,this.reset(),t&&(this["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$getCurrent$1"]=this.getCurrent,this.System$Collections$Generic$IEnumerator$1$getCurrent$1=this.getCurrent,Object.defineProperty(this,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$Current$1",{get:this.getCurrent,enumerable:!0}),Object.defineProperty(this,"System$Collections$Generic$IEnumerator$1$Current$1",{get:this.getCurrent,enumerable:!0}))},moveNext:function(){return this.index++,this.index<this.array.length},getCurrent:function(){return this.array[this.index]},getCurrent$1:function(){return this.array[this.index]},reset:function(){this.index=-1},Dispose:Bridge.emptyFn}),Bridge.define("Bridge.ArrayEnumerable",{inherits:[System.Collections.IEnumerable],config:{alias:["GetEnumerator","System$Collections$IEnumerable$GetEnumerator"]},ctor:function(e){this.$initialize(),this.array=e},GetEnumerator:function(){return new Bridge.ArrayEnumerator(this.array)}}),Bridge.define("System.Collections.Generic.EqualityComparer$1",function(e){return{inherits:[System.Collections.Generic.IEqualityComparer$1(e)],statics:{config:{init:function(){this.def=new(System.Collections.Generic.EqualityComparer$1(e))}}},config:{alias:["equals2",["System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(e)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2"],"getHashCode2",["System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(e)+"$getHashCode2","System$Collections$Generic$IEqualityComparer$1$getHashCode2"]]},equals2:function(e,t){if(!Bridge.isDefined(e,!0))return!Bridge.isDefined(t,!0);if(Bridge.isDefined(t,!0)){var n=e&&e.$$name;return Bridge.isFunction(e)&&Bridge.isFunction(t)?Bridge.fn.equals.call(e,t):!n||e&&e.$boxed||t&&t.$boxed?Bridge.equals(e,t):Bridge.isFunction(e.equalsT)?Bridge.equalsT(e,t):Bridge.isFunction(e.equals)?Bridge.equals(e,t):e===t}return!1},getHashCode2:function(e){return Bridge.isDefined(e,!0)?Bridge.getHashCode(e):0}}}),System.Collections.Generic.EqualityComparer$1.$default=new(System.Collections.Generic.EqualityComparer$1(System.Object)),Bridge.define("System.Collections.Generic.Comparer$1",function(t){return{inherits:[System.Collections.Generic.IComparer$1(t)],ctor:function(e){this.$initialize(),this.fn=e,this.compare=e,this["System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(t)+"$compare"]=e,this.System$Collections$Generic$IComparer$1$compare=e}}}),System.Collections.Generic.Comparer$1.$default=new(System.Collections.Generic.Comparer$1(System.Object))(function(e,t){return Bridge.hasValue(e)?Bridge.hasValue(t)?Bridge.compare(e,t):1:Bridge.hasValue(t)?-1:0}),System.Collections.Generic.Comparer$1.get=function(e,t){var n;return(t&&(n=e["System$Collections$Generic$IComparer$1$"+Bridge.getTypeAlias(t)+"$compare"])||(n=e.System$Collections$Generic$IComparer$1$compare)?n:e.compare).bind(e)},System.Collections.Generic.Dictionary$2.getTypeParameters=function(e){var t;if(System.String.startsWith(e.$$name,"System.Collections.Generic.IDictionary"))t=e;else for(var n=Bridge.Reflection.getInterfaces(e),i=0;i<n.length;i++)if(System.String.startsWith(n[i].$$name,"System.Collections.Generic.IDictionary")){t=n[i];break}e=t?Bridge.Reflection.getGenericArguments(t):null;return[e?e[0]:null,e?e[1]:null]},Bridge.define("System.Collections.Generic.List$1",function(o){return{inherits:[System.Collections.Generic.IList$1(o),System.Collections.IList,System.Collections.Generic.IReadOnlyList$1(o)],statics:{fields:{_defaultCapacity:0,_emptyArray:null},ctors:{init:function(){this._defaultCapacity=4,this._emptyArray=System.Array.init(0,function(){return Bridge.getDefaultValue(o)},o)}},methods:{IsCompatibleObject:function(e){return Bridge.is(e,o)||null==e&&null==Bridge.getDefaultValue(o)}}},fields:{_items:null,_size:0,_version:0},props:{Capacity:{get:function(){return this._items.length},set:function(e){if(e<this._size)throw new System.ArgumentOutOfRangeException.$ctor1("value");e!==this._items.length&&(0<e?(e=System.Array.init(e,function(){return Bridge.getDefaultValue(o)},o),0<this._size&&System.Array.copy(this._items,0,e,0,this._size),this._items=e):this._items=System.Collections.Generic.List$1(o)._emptyArray)}},Count:{get:function(){return this._size}},System$Collections$IList$IsFixedSize:{get:function(){return!1}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!1}},System$Collections$IList$IsReadOnly:{get:function(){return!1}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return this}}},alias:["Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(o)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$Count","System$Collections$Generic$ICollection$1$IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$IsReadOnly","getItem",["System$Collections$Generic$IReadOnlyList$1$"+Bridge.getTypeAlias(o)+"$getItem","System$Collections$Generic$IReadOnlyList$1$getItem"],"setItem",["System$Collections$Generic$IReadOnlyList$1$"+Bridge.getTypeAlias(o)+"$setItem","System$Collections$Generic$IReadOnlyList$1$setItem"],"getItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(o)+"$getItem","setItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(o)+"$setItem","add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$add","clear","System$Collections$IList$clear","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$copyTo","System$Collections$Generic$IEnumerable$1$GetEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(o)+"$GetEnumerator","indexOf","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(o)+"$indexOf","insert","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(o)+"$insert","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(o)+"$remove","removeAt","System$Collections$IList$removeAt","removeAt","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(o)+"$removeAt"],ctors:{ctor:function(){this.$initialize(),this._items=System.Collections.Generic.List$1(o)._emptyArray},$ctor2:function(e){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException.$ctor1("capacity");this._items=0===e?System.Collections.Generic.List$1(o)._emptyArray:System.Array.init(e,function(){return Bridge.getDefaultValue(o)},o)},$ctor1:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("collection");var t=Bridge.as(e,System.Collections.Generic.ICollection$1(o));if(null!=t){var n=System.Array.getCount(t,o);0===n?this._items=System.Collections.Generic.List$1(o)._emptyArray:(this._items=System.Array.init(n,function(){return Bridge.getDefaultValue(o)},o),System.Array.copyTo(t,this._items,0,o),this._size=n)}else{this._size=0,this._items=System.Collections.Generic.List$1(o)._emptyArray;var i=Bridge.getEnumerator(e,o);try{for(;i.System$Collections$IEnumerator$moveNext();)this.add(i[Bridge.geti(i,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(o)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")])}finally{Bridge.hasValue(i)&&i.System$IDisposable$Dispose()}}}},methods:{getItem:function(e){if(e>>>0>=this._size>>>0)throw new System.ArgumentOutOfRangeException.ctor;return this._items[System.Array.index(e,this._items)]},setItem:function(e,t){if(e>>>0>=this._size>>>0)throw new System.ArgumentOutOfRangeException.ctor;this._items[System.Array.index(e,this._items)]=t,this._version=this._version+1|0},System$Collections$IList$getItem:function(e){return this.getItem(e)},System$Collections$IList$setItem:function(e,t){if(null==t&&null!=Bridge.getDefaultValue(o))throw new System.ArgumentNullException.$ctor1("value");try{this.setItem(e,Bridge.cast(Bridge.unbox(t,o),o))}catch(e){throw e=System.Exception.create(e),Bridge.is(e,System.InvalidCastException)?new System.ArgumentException.$ctor1("value"):e}},add:function(e){this._size===this._items.length&&this.EnsureCapacity(this._size+1|0),this._items[System.Array.index(Bridge.identity(this._size,this._size=this._size+1|0),this._items)]=e,this._version=this._version+1|0},System$Collections$IList$add:function(e){if(null==e&&null!=Bridge.getDefaultValue(o))throw new System.ArgumentNullException.$ctor1("item");try{this.add(Bridge.cast(Bridge.unbox(e,o),o))}catch(e){throw e=System.Exception.create(e),Bridge.is(e,System.InvalidCastException)?new System.ArgumentException.$ctor1("item"):e}return this.Count-1|0},AddRange:function(e){this.InsertRange(this._size,e)},AsReadOnly:function(){return new(System.Collections.ObjectModel.ReadOnlyCollection$1(o))(this)},BinarySearch$2:function(e,t,n,i){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((this._size-e|0)<t)throw new System.ArgumentException.ctor;return System.Array.binarySearch(this._items,e,t,n,i)},BinarySearch:function(e){return this.BinarySearch$2(0,this.Count,e,null)},BinarySearch$1:function(e,t){return this.BinarySearch$2(0,this.Count,e,t)},clear:function(){0<this._size&&(System.Array.fill(this._items,function(){return Bridge.getDefaultValue(o)},0,this._size),this._size=0),this._version=this._version+1|0},contains:function(e){if(null==e){for(var t=0;t<this._size;t=t+1|0)if(null==this._items[System.Array.index(t,this._items)])return!0;return!1}for(var n=System.Collections.Generic.EqualityComparer$1(o).def,i=0;i<this._size;i=i+1|0)if(n.equals2(this._items[System.Array.index(i,this._items)],e))return!0;return!1},System$Collections$IList$contains:function(e){return!!System.Collections.Generic.List$1(o).IsCompatibleObject(e)&&this.contains(Bridge.cast(Bridge.unbox(e,o),o))},ConvertAll:function(e,t){if(Bridge.staticEquals(t,null))throw new System.ArgumentNullException.$ctor1("converter");for(var n=new(System.Collections.Generic.List$1(e).$ctor2)(this._size),i=0;i<this._size;i=i+1|0)n._items[System.Array.index(i,n._items)]=t(this._items[System.Array.index(i,this._items)]);return n._size=this._size,n},CopyTo:function(e){this.copyTo(e,0)},System$Collections$ICollection$copyTo:function(e,t){if(null!=e&&1!==System.Array.getRank(e))throw new System.ArgumentException.$ctor1("array");System.Array.copy(this._items,0,e,t,this._size)},CopyTo$1:function(e,t,n,i){if((this._size-e|0)<i)throw new System.ArgumentException.ctor;System.Array.copy(this._items,e,t,n,i)},copyTo:function(e,t){System.Array.copy(this._items,0,e,t,this._size)},EnsureCapacity:function(e){var t;this._items.length<e&&(2146435071<(t=0===this._items.length?System.Collections.Generic.List$1(o)._defaultCapacity:Bridge.Int.mul(this._items.length,2))>>>0&&(t=2146435071),t<e&&(t=e),this.Capacity=t)},Exists:function(e){return-1!==this.FindIndex$2(e)},Find:function(e){if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException.$ctor1("match");for(var t=0;t<this._size;t=t+1|0)if(e(this._items[System.Array.index(t,this._items)]))return this._items[System.Array.index(t,this._items)];return Bridge.getDefaultValue(o)},FindAll:function(e){if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException.$ctor1("match");for(var t=new(System.Collections.Generic.List$1(o).ctor),n=0;n<this._size;n=n+1|0)e(this._items[System.Array.index(n,this._items)])&&t.add(this._items[System.Array.index(n,this._items)]);return t},FindIndex$2:function(e){return this.FindIndex(0,this._size,e)},FindIndex$1:function(e,t){return this.FindIndex(e,this._size-e|0,t)},FindIndex:function(e,t,n){if(e>>>0>this._size>>>0)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex");if(t<0||e>(this._size-t|0))throw new System.ArgumentOutOfRangeException.$ctor1("count");if(Bridge.staticEquals(n,null))throw new System.ArgumentNullException.$ctor1("match");for(var i=e+t|0,r=e;r<i;r=r+1|0)if(n(this._items[System.Array.index(r,this._items)]))return r;return-1},FindLast:function(e){if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException.$ctor1("match");for(var t=this._size-1|0;0<=t;t=t-1|0)if(e(this._items[System.Array.index(t,this._items)]))return this._items[System.Array.index(t,this._items)];return Bridge.getDefaultValue(o)},FindLastIndex$2:function(e){return this.FindLastIndex(this._size-1|0,this._size,e)},FindLastIndex$1:function(e,t){return this.FindLastIndex(e,e+1|0,t)},FindLastIndex:function(e,t,n){if(Bridge.staticEquals(n,null))throw new System.ArgumentNullException.$ctor1("match");if(0===this._size){if(-1!==e)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex")}else if(e>>>0>=this._size>>>0)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex");if(t<0||(1+(e-t|0)|0)<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");for(var i=e-t|0,r=e;i<r;r=r-1|0)if(n(this._items[System.Array.index(r,this._items)]))return r;return-1},ForEach:function(e){if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException.$ctor1("match");for(var t=this._version,n=0;n<this._size&&t===this._version;n=n+1|0)e(this._items[System.Array.index(n,this._items)]);if(t!==this._version)throw new System.InvalidOperationException.ctor},GetEnumerator:function(){return new(System.Collections.Generic.List$1.Enumerator(o).$ctor1)(this)},System$Collections$Generic$IEnumerable$1$GetEnumerator:function(){return new(System.Collections.Generic.List$1.Enumerator(o).$ctor1)(this).$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.List$1.Enumerator(o).$ctor1)(this).$clone()},GetRange:function(e,t){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((this._size-e|0)<t)throw new System.ArgumentException.ctor;var n=new(System.Collections.Generic.List$1(o).$ctor2)(t);return System.Array.copy(this._items,e,n._items,0,t),n._size=t,n},indexOf:function(e){return System.Array.indexOfT(this._items,e,0,this._size)},System$Collections$IList$indexOf:function(e){return System.Collections.Generic.List$1(o).IsCompatibleObject(e)?this.indexOf(Bridge.cast(Bridge.unbox(e,o),o)):-1},IndexOf:function(e,t){if(t>this._size)throw new System.ArgumentOutOfRangeException.$ctor1("index");return System.Array.indexOfT(this._items,e,t,this._size-t|0)},IndexOf$1:function(e,t,n){if(t>this._size)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(n<0||t>(this._size-n|0))throw new System.ArgumentOutOfRangeException.$ctor1("count");return System.Array.indexOfT(this._items,e,t,n)},insert:function(e,t){if(e>>>0>this._size>>>0)throw new System.ArgumentOutOfRangeException.$ctor1("index");this._size===this._items.length&&this.EnsureCapacity(this._size+1|0),e<this._size&&System.Array.copy(this._items,e,this._items,e+1|0,this._size-e|0),this._items[System.Array.index(e,this._items)]=t,this._size=this._size+1|0,this._version=this._version+1|0},System$Collections$IList$insert:function(e,t){if(null==t&&null!=Bridge.getDefaultValue(o))throw new System.ArgumentNullException.$ctor1("item");try{this.insert(e,Bridge.cast(Bridge.unbox(t,o),o))}catch(e){throw e=System.Exception.create(e),Bridge.is(e,System.InvalidCastException)?new System.ArgumentException.$ctor1("item"):e}},InsertRange:function(e,t){if(null==t)throw new System.ArgumentNullException.$ctor1("collection");if(e>>>0>this._size>>>0)throw new System.ArgumentOutOfRangeException.$ctor1("index");var n=Bridge.as(t,System.Collections.Generic.ICollection$1(o));if(null!=n){var i,r=System.Array.getCount(n,o);0<r&&(this.EnsureCapacity(this._size+r|0),e<this._size&&System.Array.copy(this._items,e,this._items,e+r|0,this._size-e|0),Bridge.referenceEquals(this,n)?(System.Array.copy(this._items,0,this._items,e,e),System.Array.copy(this._items,e+r|0,this._items,Bridge.Int.mul(e,2),this._size-e|0)):(i=System.Array.init(r,function(){return Bridge.getDefaultValue(o)},o),System.Array.copyTo(n,i,0,o),System.Array.copy(i,0,this._items,e,i.length)),this._size=this._size+r|0)}else{var s=Bridge.getEnumerator(t,o);try{for(;s.System$Collections$IEnumerator$moveNext();)this.insert(Bridge.identity(e,e=e+1|0),s[Bridge.geti(s,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(o)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")])}finally{Bridge.hasValue(s)&&s.System$IDisposable$Dispose()}}this._version=this._version+1|0},LastIndexOf:function(e){return 0===this._size?-1:this.LastIndexOf$2(e,this._size-1|0,this._size)},LastIndexOf$1:function(e,t){if(t>=this._size)throw new System.ArgumentOutOfRangeException.$ctor1("index");return this.LastIndexOf$2(e,t,t+1|0)},LastIndexOf$2:function(e,t,n){if(0!==this.Count&&t<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(0!==this.Count&&n<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if(0===this._size)return-1;if(t>=this._size)throw new System.ArgumentOutOfRangeException.$ctor1("index");if((t+1|0)<n)throw new System.ArgumentOutOfRangeException.$ctor1("count");return System.Array.lastIndexOfT(this._items,e,t,n)},remove:function(e){e=this.indexOf(e);return 0<=e&&(this.removeAt(e),!0)},System$Collections$IList$remove:function(e){System.Collections.Generic.List$1(o).IsCompatibleObject(e)&&this.remove(Bridge.cast(Bridge.unbox(e,o),o))},RemoveAll:function(e){if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException.$ctor1("match");for(var t=0;t<this._size&&!e(this._items[System.Array.index(t,this._items)]);)t=t+1|0;if(t>=this._size)return 0;for(var n=t+1|0;n<this._size;){for(;n<this._size&&e(this._items[System.Array.index(n,this._items)]);)n=n+1|0;n<this._size&&(this._items[System.Array.index(Bridge.identity(t,t=t+1|0),this._items)]=this._items[System.Array.index(Bridge.identity(n,n=n+1|0),this._items)])}System.Array.fill(this._items,function(){return Bridge.getDefaultValue(o)},t,this._size-t|0);var i=this._size-t|0;return this._size=t,this._version=this._version+1|0,i},removeAt:function(e){if(e>>>0>=this._size>>>0)throw new System.ArgumentOutOfRangeException.ctor;this._size=this._size-1|0,e<this._size&&System.Array.copy(this._items,e+1|0,this._items,e,this._size-e|0),this._items[System.Array.index(this._size,this._items)]=Bridge.getDefaultValue(o),this._version=this._version+1|0},RemoveRange:function(e,t){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((this._size-e|0)<t)throw new System.ArgumentException.ctor;0<t&&(this._size,this._size=this._size-t|0,e<this._size&&System.Array.copy(this._items,e+t|0,this._items,e,this._size-e|0),System.Array.fill(this._items,function(){return Bridge.getDefaultValue(o)},this._size,t),this._version=this._version+1|0)},Reverse:function(){this.Reverse$1(0,this.Count)},Reverse$1:function(e,t){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((this._size-e|0)<t)throw new System.ArgumentException.ctor;System.Array.reverse(this._items,e,t),this._version=this._version+1|0},Sort:function(){this.Sort$3(0,this.Count,null)},Sort$1:function(e){this.Sort$3(0,this.Count,e)},Sort$3:function(e,t,n){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((this._size-e|0)<t)throw new System.ArgumentException.ctor;System.Array.sort(this._items,e,t,n),this._version=this._version+1|0},Sort$2:function(e){if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException.$ctor1("comparison");var t;0<this._size&&(this._items.length===this._size?System.Array.sort(this._items,e):(t=System.Array.init(this._size,function(){return Bridge.getDefaultValue(o)},o),System.Array.copy(this._items,0,t,0,this._size),System.Array.sort(t,e),System.Array.copy(t,0,this._items,0,this._size)))},ToArray:function(){var e=System.Array.init(this._size,function(){return Bridge.getDefaultValue(o)},o);return System.Array.copy(this._items,0,e,0,this._size),e},TrimExcess:function(){var e=Bridge.Int.clip32(.9*this._items.length);this._size<e&&(this.Capacity=this._size)},TrueForAll:function(e){if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException.$ctor1("match");for(var t=0;t<this._size;t=t+1|0)if(!e(this._items[System.Array.index(t,this._items)]))return!1;return!0},toJSON:function(){var e=System.Array.init(this._size,function(){return Bridge.getDefaultValue(o)},o);return 0<this._size&&System.Array.copy(this._items,0,e,0,this._size),e}}}}),Bridge.define("System.Collections.Generic.KeyNotFoundException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"The given key was not present in the dictionary."),this.HResult=-2146232969},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146232969},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146232969}}}),System.Collections.Generic.List$1.getElementType=function(e){var t;if(System.String.startsWith(e.$$name,"System.Collections.Generic.IList"))t=e;else for(var n=Bridge.Reflection.getInterfaces(e),i=0;i<n.length;i++)if(System.String.startsWith(n[i].$$name,"System.Collections.Generic.IList")){t=n[i];break}return t?Bridge.Reflection.getGenericArguments(t)[0]:null},Bridge.define("System.CharEnumerator",{inherits:[System.Collections.IEnumerator,System.Collections.Generic.IEnumerator$1(System.Char),System.IDisposable,System.ICloneable],fields:{_str:null,_index:0,_currentElement:0},props:{System$Collections$IEnumerator$Current:{get:function(){return Bridge.box(this.Current,System.Char,String.fromCharCode,System.Char.getHashCode)}},Current:{get:function(){if(-1===this._index)throw new System.InvalidOperationException.$ctor1("Enumeration has not started. Call MoveNext.");if(this._index>=this._str.length)throw new System.InvalidOperationException.$ctor1("Enumeration already finished.");return this._currentElement}}},alias:["clone","System$ICloneable$clone","moveNext","System$Collections$IEnumerator$moveNext","Dispose","System$IDisposable$Dispose","Current",["System$Collections$Generic$IEnumerator$1$System$Char$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"],"reset","System$Collections$IEnumerator$reset"],ctors:{ctor:function(e){this.$initialize(),this._str=e,this._index=-1}},methods:{clone:function(){return Bridge.clone(this)},moveNext:function(){return this._index<(this._str.length-1|0)?(this._index=this._index+1|0,this._currentElement=this._str.charCodeAt(this._index),!0):(this._index=this._str.length,!1)},Dispose:function(){null!=this._str&&(this._index=this._str.length),this._str=null},reset:function(){this._currentElement=0,this._index=-1}}}),Bridge.define("System.Threading.Tasks.Task",{inherits:[System.IDisposable,System.IAsyncResult],config:{alias:["dispose","System$IDisposable$Dispose","AsyncState","System$IAsyncResult$AsyncState","CompletedSynchronously","System$IAsyncResult$CompletedSynchronously","IsCompleted","System$IAsyncResult$IsCompleted"],properties:{IsCompleted:{get:function(){return this.isCompleted()}}}},ctor:function(e,t){this.$initialize(),this.action=e,this.state=t,this.AsyncState=t,this.CompletedSynchronously=!1,this.exception=null,this.status=System.Threading.Tasks.TaskStatus.created,this.callbacks=[],this.result=null},statics:{queue:[],runQueue:function(){var e=System.Threading.Tasks.Task.queue.slice(0);System.Threading.Tasks.Task.queue=[];for(var t=0;t<e.length;t++)e[t]()},schedule:function(e){System.Threading.Tasks.Task.queue.push(e),Bridge.setImmediate(System.Threading.Tasks.Task.runQueue)},delay:function(e,t){var n,i=new System.Threading.Tasks.TaskCompletionSource,r=!1;Bridge.is(t,System.Threading.CancellationToken)&&(n=t,t=void 0),n&&(n.cancelWasRequested=function(){r||(r=!0,clearTimeout(o),i.setCanceled())});var s=e;Bridge.is(e,System.TimeSpan)&&(s=e.getTotalMilliseconds());var o=setTimeout(function(){r||(r=!0,i.setResult(t))},s);return n&&n.getIsCancellationRequested()&&Bridge.setImmediate(n.cancelWasRequested),i.task},fromResult:function(e,t){t=new(System.Threading.Tasks.Task$1(t||System.Object));return t.status=System.Threading.Tasks.TaskStatus.ranToCompletion,t.result=e,t},run:function(t){var n=new System.Threading.Tasks.TaskCompletionSource;return System.Threading.Tasks.Task.schedule(function(){try{var e=t();Bridge.is(e,System.Threading.Tasks.Task)?e.continueWith(function(){e.isFaulted()||e.isCanceled()?n.setException(0<e.exception.innerExceptions.Count?e.exception.innerExceptions.getItem(0):e.exception):n.setResult(e.getAwaitedResult())}):n.setResult(e)}catch(e){n.setException(System.Exception.create(e))}}),n.task},whenAll:function(e){var n,i,t,r=new System.Threading.Tasks.TaskCompletionSource,s=!1,o=[];if(Bridge.is(e,System.Collections.IEnumerable)?e=Bridge.toArray(e):Bridge.isArray(e)||(e=Array.prototype.slice.call(arguments,0)),0===e.length)return r.setResult([]),r.task;for(i=e.length,n=new Array(e.length),t=0;t<e.length;t++)!function(t){e[t].continueWith(function(e){switch(e.status){case System.Threading.Tasks.TaskStatus.ranToCompletion:n[t]=e.getResult();break;case System.Threading.Tasks.TaskStatus.canceled:s=!0;break;case System.Threading.Tasks.TaskStatus.faulted:System.Array.addRange(o,e.exception.innerExceptions);break;default:throw new System.InvalidOperationException.$ctor1("Invalid task status: "+e.status)}0==--i&&(0<o.length?r.setException(o):s?r.setCanceled():r.setResult(n))})}(t);return r.task},whenAny:function(e){if(Bridge.is(e,System.Collections.IEnumerable)?e=Bridge.toArray(e):Bridge.isArray(e)||(e=Array.prototype.slice.call(arguments,0)),!e.length)throw new System.ArgumentException.$ctor1("At least one task is required");for(var t=new System.Threading.Tasks.TaskCompletionSource,n=0;n<e.length;n++)e[n].continueWith(function(e){switch(e.status){case System.Threading.Tasks.TaskStatus.ranToCompletion:t.trySetResult(e);break;case System.Threading.Tasks.TaskStatus.canceled:case System.Threading.Tasks.TaskStatus.faulted:t.trySetException(e.exception.innerExceptions);break;default:throw new System.InvalidOperationException.$ctor1("Invalid task status: "+e.status)}});return t.task},fromCallback:function(e,t){var n=new System.Threading.Tasks.TaskCompletionSource,i=Array.prototype.slice.call(arguments,2),r=function(e){n.setResult(e)};return i.push(r),e[t].apply(e,i),n.task},fromCallbackResult:function(e,t,n){var i=new System.Threading.Tasks.TaskCompletionSource,r=Array.prototype.slice.call(arguments,3);return n(r,function(e){i.setResult(e)}),e[t].apply(e,r),i.task},fromCallbackOptions:function(e,t,n){var i=new System.Threading.Tasks.TaskCompletionSource,r=Array.prototype.slice.call(arguments,3),s=function(e){i.setResult(e)};return r[0]=r[0]||{},r[0][n]=s,e[t].apply(e,r),i.task},fromPromise:function(e,t,n,i){var r,s=new System.Threading.Tasks.TaskCompletionSource;return e.then||(e=e.promise()),"number"==typeof t?(r=t,t=function(){return arguments[0<=r?r:arguments.length+r]}):"function"!=typeof t&&(t=function(){return Array.prototype.slice.call(arguments,0)}),e.then(function(){s.setResult(t?t.apply(null,arguments):Array.prototype.slice.call(arguments,0))},function(){s.setException(n?n.apply(null,arguments):new Bridge.PromiseException(Array.prototype.slice.call(arguments,0)))},i),s.task}},getException:function(){return this.isCanceled()?null:this.exception},waitt:function(e,t){var n=e,i=new System.Threading.Tasks.TaskCompletionSource,r=!1;t&&(t.cancelWasRequested=function(){r||(r=!0,clearTimeout(s),i.setException(new System.OperationCanceledException.$ctor1(t)))}),Bridge.is(e,System.TimeSpan)&&(n=e.getTotalMilliseconds());var s=setTimeout(function(){r=!0,i.setResult(!1)},n);return this.continueWith(function(){clearTimeout(s),r||(r=!0,i.setResult(!0))}),i.task},wait:function(e){var t=this,n=new System.Threading.Tasks.TaskCompletionSource,i=!1;return e&&(e.cancelWasRequested=function(){i||(i=!0,n.setException(new System.OperationCanceledException.$ctor1(e)))}),this.continueWith(function(){i||(i=!0,t.isFaulted()||t.isCanceled()?n.setException(t.exception):n.setResult())}),n.task},continue:function(e){this.isCompleted()?(System.Threading.Tasks.Task.queue.push(e),System.Threading.Tasks.Task.runQueue()):this.callbacks.push(e)},continueWith:function(e,t){var n=new System.Threading.Tasks.TaskCompletionSource,i=this,t=t?function(){n.setResult(e(i))}:function(){try{n.setResult(e(i))}catch(e){n.setException(System.Exception.create(e))}};return this.isCompleted()?(System.Threading.Tasks.Task.queue.push(t),System.Threading.Tasks.Task.runQueue()):this.callbacks.push(t),n.task},start:function(){if(this.status!==System.Threading.Tasks.TaskStatus.created)throw new System.InvalidOperationException.$ctor1("Task was already started.");var t=this;this.status=System.Threading.Tasks.TaskStatus.running,System.Threading.Tasks.Task.schedule(function(){try{var e=t.action(t.state);delete t.action,delete t.state,t.complete(e)}catch(e){t.fail(new System.AggregateException(null,[System.Exception.create(e)]))}})},runCallbacks:function(){for(var e=0;e<this.callbacks.length;e++)this.callbacks[e](this);delete this.callbacks},complete:function(e){return!this.isCompleted()&&(this.result=e,this.status=System.Threading.Tasks.TaskStatus.ranToCompletion,this.runCallbacks(),!0)},fail:function(e){return!this.isCompleted()&&(this.exception=e,this.status=this.exception.hasTaskCanceledException&&this.exception.hasTaskCanceledException()?System.Threading.Tasks.TaskStatus.canceled:System.Threading.Tasks.TaskStatus.faulted,this.runCallbacks(),!0)},cancel:function(e){return!this.isCompleted()&&(this.exception=e||new System.AggregateException(null,[new System.Threading.Tasks.TaskCanceledException.$ctor3(this)]),this.status=System.Threading.Tasks.TaskStatus.canceled,this.runCallbacks(),!0)},isCanceled:function(){return this.status===System.Threading.Tasks.TaskStatus.canceled},isCompleted:function(){return this.status===System.Threading.Tasks.TaskStatus.ranToCompletion||this.status===System.Threading.Tasks.TaskStatus.canceled||this.status===System.Threading.Tasks.TaskStatus.faulted},isFaulted:function(){return this.status===System.Threading.Tasks.TaskStatus.faulted},_getResult:function(e){switch(this.status){case System.Threading.Tasks.TaskStatus.ranToCompletion:return this.result;case System.Threading.Tasks.TaskStatus.canceled:if(this.exception&&this.exception.innerExceptions)throw e?0<this.exception.innerExceptions.Count?this.exception.innerExceptions.getItem(0):null:this.exception;var t=new System.Threading.Tasks.TaskCanceledException.$ctor3(this);throw e?t:new System.AggregateException(null,[t]);case System.Threading.Tasks.TaskStatus.faulted:throw e?0<this.exception.innerExceptions.Count?this.exception.innerExceptions.getItem(0):null:this.exception;default:throw new System.InvalidOperationException.$ctor1("Task is not yet completed.")}},getResult:function(){return this._getResult(!1)},dispose:function(){},getAwaiter:function(){return this},getAwaitedResult:function(){return this._getResult(!0)}}),Bridge.define("System.Threading.Tasks.Task$1",function(e){return{inherits:[System.Threading.Tasks.Task],ctor:function(e,t){this.$initialize(),System.Threading.Tasks.Task.ctor.call(this,e,t)}}}),Bridge.define("System.Threading.Tasks.TaskStatus",{$kind:"enum",$statics:{created:0,waitingForActivation:1,waitingToRun:2,running:3,waitingForChildrenToComplete:4,ranToCompletion:5,canceled:6,faulted:7}}),Bridge.define("System.Threading.Tasks.TaskCompletionSource",{ctor:function(e){this.$initialize(),this.task=new System.Threading.Tasks.Task(null,e),this.task.status=System.Threading.Tasks.TaskStatus.running},setCanceled:function(){if(!this.task.cancel())throw new System.InvalidOperationException.$ctor1("Task was already completed.")},setResult:function(e){if(!this.task.complete(e))throw new System.InvalidOperationException.$ctor1("Task was already completed.")},setException:function(e){if(!this.trySetException(e))throw new System.InvalidOperationException.$ctor1("Task was already completed.")},trySetCanceled:function(){return this.task.cancel()},trySetResult:function(e){return this.task.complete(e)},trySetException:function(e){return Bridge.is(e,System.Exception)&&(e=[e]),(e=new System.AggregateException(null,e)).hasTaskCanceledException()?this.task.cancel(e):this.task.fail(e)}}),Bridge.define("System.Threading.CancellationTokenSource",{inherits:[System.IDisposable],config:{alias:["dispose","System$IDisposable$Dispose"]},ctor:function(e){this.$initialize(),this.timeout="number"==typeof e&&0<=e?setTimeout(Bridge.fn.bind(this,this.cancel),e,-1):null,this.isCancellationRequested=!1,this.token=new System.Threading.CancellationToken(this),this.handlers=[]},cancel:function(t){if(!this.isCancellationRequested){this.isCancellationRequested=!0;var n=[],e=this.handlers;this.clean(),this.token.cancelWasRequested();for(var i=0;i<e.length;i++)try{e[i].f(e[i].s)}catch(e){if(t&&-1!==t)throw e;n.push(e)}if(0<n.length&&-1!==t)throw new System.AggregateException(null,n)}},cancelAfter:function(e){this.isCancellationRequested||(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(Bridge.fn.bind(this,this.cancel),e,-1))},register:function(e,t){if(this.isCancellationRequested)return e(t),new System.Threading.CancellationTokenRegistration;t={f:e,s:t};return this.handlers.push(t),new System.Threading.CancellationTokenRegistration(this,t)},deregister:function(e){e=this.handlers.indexOf(e);0<=e&&this.handlers.splice(e,1)},dispose:function(){this.clean()},clean:function(){if(this.timeout&&clearTimeout(this.timeout),this.timeout=null,this.handlers=[],this.links){for(var e=0;e<this.links.length;e++)this.links[e].dispose();this.links=null}},statics:{createLinked:function(){var e=new System.Threading.CancellationTokenSource;e.links=[];for(var t=Bridge.fn.bind(e,e.cancel),n=0;n<arguments.length;n++)e.links.push(arguments[n].register(t));return e}}}),Bridge.define("System.Threading.CancellationToken",{$kind:"struct",ctor:function(e){this.$initialize(),Bridge.is(e,System.Threading.CancellationTokenSource)||(e=e?System.Threading.CancellationToken.sourceTrue:System.Threading.CancellationToken.sourceFalse),this.source=e},cancelWasRequested:function(){},getCanBeCanceled:function(){return!this.source.uncancellable},getIsCancellationRequested:function(){return this.source.isCancellationRequested},throwIfCancellationRequested:function(){if(this.source.isCancellationRequested)throw new System.OperationCanceledException.$ctor1(this)},register:function(e,t){return this.source.register(e,t)},getHashCode:function(){return Bridge.getHashCode(this.source)},equals:function(e){return e.source===this.source},equalsT:function(e){return e.source===this.source},statics:{sourceTrue:{isCancellationRequested:!0,register:function(e,t){return e(t),new System.Threading.CancellationTokenRegistration}},sourceFalse:{uncancellable:!0,isCancellationRequested:!1,register:function(){return new System.Threading.CancellationTokenRegistration}},getDefaultValue:function(){return new System.Threading.CancellationToken}}}),System.Threading.CancellationToken.none=new System.Threading.CancellationToken,Bridge.define("System.Threading.CancellationTokenRegistration",{inherits:function(){return[System.IDisposable,System.IEquatable$1(System.Threading.CancellationTokenRegistration)]},$kind:"struct",config:{alias:["dispose","System$IDisposable$Dispose"]},ctor:function(e,t){this.$initialize(),this.cts=e,this.o=t},dispose:function(){this.cts&&(this.cts.deregister(this.o),this.cts=this.o=null)},equalsT:function(e){return this===e},equals:function(e){return this===e},statics:{getDefaultValue:function(){return new System.Threading.CancellationTokenRegistration}}}),r={isNull:function(e){return!Bridge.isDefined(e,!0)},isEmpty:function(e){return!(null!=e&&0!==e.length&&!Bridge.is(e,System.Collections.ICollection))&&0===e.getCount()},isNotEmptyOrWhitespace:function(e){return Bridge.isDefined(e,!0)&&!/^$|\s+/.test(e)},isNotNull:function(e){return Bridge.isDefined(e,!0)},isNotEmpty:function(e){return!Bridge.Validation.isEmpty(e)},email:function(e){return/^(")?(?:[^\."])(?:(?:[\.])?(?:[\w\-!#$%&'*+/=?^_`{|}~]))*\1@(\w[\-\w]*\.){1,5}([A-Za-z]){2,6}$/.test(e)},url:function(e){return/(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:\.\d{1,3}){3})(?!(?:\.\d{1,3}){2})(?!\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/.test(e)},alpha:function(e){return/^[a-zA-Z_]+$/.test(e)},alphaNum:function(e){return/^[a-zA-Z_]+$/.test(e)},creditCard:function(e,t){var n,i,r,s,o=!1;if("Visa"===t)n=/^4\d{3}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/;else if("MasterCard"===t)n=/^5[1-5]\d{2}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/;else if("Discover"===t)n=/^6011[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/;else if("AmericanExpress"===t)n=/^3[4,7]\d{13}$/;else if("DinersClub"===t)n=/^(3[0,6,8]\d{12})|(5[45]\d{14})$/;else{if(!e||e.length<13||19<e.length)return!1;n=/[^0-9 \-]+/,o=!0}if(!n.test(e))return!1;for(i=0,r=2-(e=e.split(o?"-":/[- ]/).join("")).length%2;r<=e.length;r+=2)i+=parseInt(e.charAt(r-1));for(r=e.length%2+1;r<e.length;r+=2)i+=(s=2*parseInt(e.charAt(r-1)))<10?s:s-9;return i%10==0}},Bridge.Validation=r,Bridge.define("System.Attribute",{statics:{getCustomAttributes:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("element");if(null==t)throw new System.ArgumentNullException.$ctor1("attributeType");var i=e.at||[];if(!0===e.ov){for(var r,s=Bridge.Reflection.getBaseType(e.td),o=[],a=null;null!=s&&null==a;)a=0==(a=Bridge.Reflection.getMembers(s,31,28,e.n)).length?((r=Bridge.Reflection.getBaseType(s))!=s&&(s=r),null):a[0];null!=a&&(o=System.Attribute.getCustomAttributes(a,t));for(var u=0;u<o.length;u++){var l=o[u],c=Bridge.getType(l),c=Bridge.getMetadata(c);(c&&c.am||!i.some(function(e){return Bridge.is(e,t)}))&&i.push(l)}}return t?i.filter(function(e){return Bridge.is(e,t)}):i},getCustomAttributes$1:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("element");if(null==t)throw new System.ArgumentNullException.$ctor1("attributeType");return e.getCustomAttributes(t||n)},isDefined:function(e,t,n){return 0<System.Attribute.getCustomAttributes(e,t,n).length}}}),Bridge.define("System.SerializableAttribute",{inherits:[System.Attribute],ctors:{ctor:function(){this.$initialize(),System.Attribute.ctor.call(this)}}}),Bridge.define("System.ComponentModel.INotifyPropertyChanged",{$kind:"interface"}),Bridge.define("System.ComponentModel.PropertyChangedEventArgs",{ctor:function(e,t,n){this.$initialize(),this.propertyName=e,this.newValue=t,this.oldValue=n}});var Y={};Y.convert={typeCodes:{Empty:0,Object:1,DBNull:2,Boolean:3,Char:4,SByte:5,Byte:6,Int16:7,UInt16:8,Int32:9,UInt32:10,Int64:11,UInt64:12,Single:13,Double:14,Decimal:15,DateTime:16,String:18},convertTypes:[null,System.Object,null,System.Boolean,System.Char,System.SByte,System.Byte,System.Int16,System.UInt16,System.Int32,System.UInt32,System.Int64,System.UInt64,System.Single,System.Double,System.Decimal,System.DateTime,System.Object,System.String],toBoolean:function(e,t){switch(typeof(e=Bridge.unbox(e,!0))){case"boolean":return e;case"number":return 0!==e;case"string":var n=e.toLowerCase().trim();if("true"===n)return!0;if("false"===n)return!1;throw new System.FormatException.$ctor1("String was not recognized as a valid Boolean.");case"object":if(null==e)return!1;if(e instanceof System.Decimal)return!e.isZero();if(System.Int64.is64Bit(e))return e.ne(0)}var i=Y.internal.suggestTypeCode(e);return Y.internal.throwInvalidCastEx(i,Y.convert.typeCodes.Boolean),Y.convert.convertToType(Y.convert.typeCodes.Boolean,e,t||null)},toChar:function(e,t,n){var i=Y.convert.typeCodes,r=Bridge.is(e,System.Char);(e=Bridge.unbox(e,!0))instanceof System.Decimal&&(e=e.toFloat()),(e instanceof System.Int64||e instanceof System.UInt64)&&(e=e.toNumber());var s=typeof e;if((n=n||Y.internal.suggestTypeCode(e))===i.String&&null==e&&(s="string"),n!==i.Object||r)switch(s){case"boolean":Y.internal.throwInvalidCastEx(i.Boolean,i.Char);case"number":return!Y.internal.isFloatingType(n)&&e%1==0||Y.internal.throwInvalidCastEx(n,i.Char),Y.internal.validateNumberRange(e,i.Char,!0),e;case"string":if(null==e)throw new System.ArgumentNullException.$ctor1("value");if(1!==e.length)throw new System.FormatException.$ctor1("String must be exactly one character long.");return e.charCodeAt(0)}if(n===i.Object||"object"===s){if(null==e)return 0;Bridge.isDate(e)&&Y.internal.throwInvalidCastEx(i.DateTime,i.Char)}return Y.internal.throwInvalidCastEx(n,Y.convert.typeCodes.Char),Y.convert.convertToType(i.Char,e,t||null)},toSByte:function(e,t,n){return Y.internal.toNumber(e,t||null,Y.convert.typeCodes.SByte,n||null)},toByte:function(e,t){return Y.internal.toNumber(e,t||null,Y.convert.typeCodes.Byte)},toInt16:function(e,t){return Y.internal.toNumber(e,t||null,Y.convert.typeCodes.Int16)},toUInt16:function(e,t){return Y.internal.toNumber(e,t||null,Y.convert.typeCodes.UInt16)},toInt32:function(e,t){return Y.internal.toNumber(e,t||null,Y.convert.typeCodes.Int32)},toUInt32:function(e,t){return Y.internal.toNumber(e,t||null,Y.convert.typeCodes.UInt32)},toInt64:function(e,t){t=Y.internal.toNumber(e,t||null,Y.convert.typeCodes.Int64);return new System.Int64(t)},toUInt64:function(e,t){t=Y.internal.toNumber(e,t||null,Y.convert.typeCodes.UInt64);return new System.UInt64(t)},toSingle:function(e,t){return Y.internal.toNumber(e,t||null,Y.convert.typeCodes.Single)},toDouble:function(e,t){return Y.internal.toNumber(e,t||null,Y.convert.typeCodes.Double)},toDecimal:function(e,t){return e instanceof System.Decimal?e:new System.Decimal(Y.internal.toNumber(e,t||null,Y.convert.typeCodes.Decimal))},toDateTime:function(e,t){var n=Y.convert.typeCodes;switch(typeof(e=Bridge.unbox(e,!0))){case"boolean":Y.internal.throwInvalidCastEx(n.Boolean,n.DateTime);case"number":var i=Y.internal.suggestTypeCode(e);Y.internal.throwInvalidCastEx(i,n.DateTime);case"string":return e=System.DateTime.parse(e,t||null);case"object":if(null==e)return Y.internal.getMinValue(n.DateTime);if(Bridge.isDate(e))return e;e instanceof System.Decimal&&Y.internal.throwInvalidCastEx(n.Decimal,n.DateTime),e instanceof System.Int64&&Y.internal.throwInvalidCastEx(n.Int64,n.DateTime),e instanceof System.UInt64&&Y.internal.throwInvalidCastEx(n.UInt64,n.DateTime)}var r=Y.internal.suggestTypeCode(e);return Y.internal.throwInvalidCastEx(r,Y.convert.typeCodes.DateTime),Y.convert.convertToType(n.DateTime,e,t||null)},toString:function(e,t,n){if(e&&e.$boxed)return e.toString();var i=Y.convert.typeCodes;switch(typeof e){case"boolean":return e?"True":"False";case"number":return(n||null)===i.Char?String.fromCharCode(e):isNaN(e)?"NaN":(e%1!=0&&(e=parseFloat(e.toPrecision(15))),e.toString());case"string":return e;case"object":return null==e?"":e.toString!==Object.prototype.toString?e.toString():Bridge.isDate(e)?System.DateTime.format(e,null,t||null):e instanceof System.Decimal?e.isInteger()?e.toFixed(0,4):e.toPrecision(e.precision()):System.Int64.is64Bit(e)?e.toString():e.format?e.format(null,t||null):Bridge.getTypeName(e)}return Y.convert.convertToType(Y.convert.typeCodes.String,e,t||null)},toNumberInBase:function(e,t,n){if(2!==t&&8!==t&&10!==t&&16!==t)throw new System.ArgumentException.$ctor1("Invalid Base.");var i=Y.convert.typeCodes;if(null==e)return n===i.Int64?System.Int64.Zero:n===i.UInt64?System.UInt64.Zero:0;if(0===e.length)throw new System.ArgumentOutOfRangeException.$ctor4("length","Index was out of range. Must be non-negative and less than the size of the collection.");e=e.toLowerCase();var r,s=Y.internal.getMinValue(n),o=Y.internal.getMaxValue(n),a=!1,u=0;if("-"===e[u]){if(10!==t)throw new System.ArgumentException.$ctor1("String cannot contain a minus sign if the base is not 10.");if(0<=s)throw new System.OverflowException.$ctor1("The string was being parsed as an unsigned number and could not have a negative sign.");a=!0,++u}else"+"===e[u]&&++u;if(16===t&&2<=e.length&&"0"===e[u]&&"x"===e[u+1]&&(u+=2),2===t)r=Y.internal.charsToCodes("01");else if(8===t)r=Y.internal.charsToCodes("01234567");else if(10===t)r=Y.internal.charsToCodes("0123456789");else{if(16!==t)throw new System.ArgumentException.$ctor1("Invalid Base.");r=Y.internal.charsToCodes("0123456789abcdef")}for(var l={},c=0;c<r.length;c++)l[r[c]]=c;var m,y,h,d=r[0],f=r[r.length-1];if(n===i.Int64||n===i.UInt64){for(y=u;y<e.length;y++)if(!(d<=(m=e[y].charCodeAt(0))&&m<=f))throw y===u?new System.FormatException.$ctor1("Could not find any recognizable digits."):new System.FormatException.$ctor1("Additional non-parsable characters are at the end of the string.");if((h=n===i.Int64?new System.Int64(Bridge.$Long.fromString(e,!1,t)):new System.UInt64(Bridge.$Long.fromString(e,!0,t))).toString(t)!==System.String.trimStartZeros(e))throw new System.OverflowException.$ctor1("Value was either too large or too small.");return h}for(h=0,i=o-s+1,y=u;y<e.length;y++){if(!(d<=(m=e[y].charCodeAt(0))&&m<=f))throw y===u?new System.FormatException.$ctor1("Could not find any recognizable digits."):new System.FormatException.$ctor1("Additional non-parsable characters are at the end of the string.");if(h*=t,(h+=l[m])>Y.internal.typeRanges.Int64_MaxValue)throw new System.OverflowException.$ctor1("Value was either too large or too small.")}if(a&&(h*=-1),o<h&&10!==t&&s<0&&(h-=i),h<s||o<h)throw new System.OverflowException.$ctor1("Value was either too large or too small.");return h},toStringInBase:function(e,t,n){Y.convert.typeCodes;if(e=Bridge.unbox(e,!0),2!==t&&8!==t&&10!==t&&16!==t)throw new System.ArgumentException.$ctor1("Invalid Base.");var i=Y.internal.getMinValue(n),r=Y.internal.getMaxValue(n),s=System.Int64.is64Bit(e);if(s){if(e.lt(i)||e.gt(r))throw new System.OverflowException.$ctor1("Value was either too large or too small for an unsigned byte.")}else if(e<i||r<e)throw new System.OverflowException.$ctor1("Value was either too large or too small for an unsigned byte.");var o,n=!1;if(s)return 10===t?e.toString():e.value.toUnsigned().toString(t);if(e<0&&(10===t?(n=!0,e*=-1):e=r+1-i+e),2===t)o="01";else if(8===t)o="01234567";else if(10===t)o="0123456789";else{if(16!==t)throw new System.ArgumentException.$ctor1("Invalid Base.");o="0123456789abcdef"}for(var a,u={},l=o.split(""),c=0;c<l.length;c++)a=l[c],u[c]=a;var m,y="";if(0===e||s&&e.eq(0))y="0";else if(s)for(;e.gt(0);)m=e.mod(t),e=e.sub(m).div(t),y+=u[m.toNumber()];else for(;0<e;)e=(e-(m=e%t))/t,y+=u[m];return n&&(y+="-"),y=y.split("").reverse().join("")},toBase64String:function(e,t,n,i){if(null==e)throw new System.ArgumentNullException.$ctor1("inArray");if(t=t||0,i=i||0,(n=null!=n?n:e.length)<0)throw new System.ArgumentOutOfRangeException.$ctor4("length","Index was out of range. Must be non-negative and less than the size of the collection.");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("offset","Value must be positive.");if(i<0||1<i)throw new System.ArgumentException.$ctor1("Illegal enum value.");var r=e.length;if(r-n<t)throw new System.ArgumentOutOfRangeException.$ctor4("offset","Offset and length must refer to a position in the string.");if(0===r)return"";var s=1===i,r=Y.internal.toBase64_CalculateAndValidateOutputLength(n,s),i=[];return i.length=r,Y.internal.convertToBase64Array(i,e,t,n,s),i.join("")},toBase64CharArray:function(e,t,n,i,r,s){if(null==e)throw new System.ArgumentNullException.$ctor1("inArray");if(null==i)throw new System.ArgumentNullException.$ctor1("outArray");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("length","Index was out of range. Must be non-negative and less than the size of the collection.");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("offsetIn","Value must be positive.");if(r<0)throw new System.ArgumentOutOfRangeException.$ctor4("offsetOut","Value must be positive.");if((s=s||0)<0||1<s)throw new System.ArgumentException.$ctor1("Illegal enum value.");var o=e.length;if(o-n<t)throw new System.ArgumentOutOfRangeException.$ctor4("offsetIn","Offset and length must refer to a position in the string.");if(0===o)return 0;o=1===s;if(i.length-Y.internal.toBase64_CalculateAndValidateOutputLength(n,o)<r)throw new System.ArgumentOutOfRangeException.$ctor4("offsetOut","Either offset did not refer to a position in the string, or there is an insufficient length of destination character array.");s=[],o=Y.internal.convertToBase64Array(s,e,t,n,o);return Y.internal.charsToCodes(s,i,r),o},fromBase64String:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("s");e=e.split("");return Y.internal.fromBase64CharPtr(e,0,e.length)},fromBase64CharArray:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("inArray");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("length","Index was out of range. Must be non-negative and less than the size of the collection.");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("offset","Value must be positive.");if(t>e.length-n)throw new System.ArgumentOutOfRangeException.$ctor4("offset","Offset and length must refer to a position in the string.");e=Y.internal.codesToChars(e);return Y.internal.fromBase64CharPtr(e,t,n)},getTypeCode:function(e){return null==e?System.TypeCode.Object:e===System.Double?System.TypeCode.Double:e===System.Single?System.TypeCode.Single:e===System.Decimal?System.TypeCode.Decimal:e===System.Byte?System.TypeCode.Byte:e===System.SByte?System.TypeCode.SByte:e===System.UInt16?System.TypeCode.UInt16:e===System.Int16?System.TypeCode.Int16:e===System.UInt32?System.TypeCode.UInt32:e===System.Int32?System.TypeCode.Int32:e===System.UInt64?System.TypeCode.UInt64:e===System.Int64?System.TypeCode.Int64:e===System.Boolean?System.TypeCode.Boolean:e===System.Char?System.TypeCode.Char:e===System.DateTime?System.TypeCode.DateTime:e===System.String?System.TypeCode.String:System.TypeCode.Object},changeConversionType:function(e,t,n){if(null==t)throw new System.ArgumentNullException.$ctor1("conversionType");if(null==e){if(Bridge.Reflection.isValueType(t))throw new System.InvalidCastException.$ctor1("Null object cannot be converted to a value type.");return null}var i=Y.convert.getTypeCode(Bridge.getType(e)),r=Bridge.as(e,System.IConvertible);if(null==r&&i==System.TypeCode.Object){if(Bridge.referenceEquals(Bridge.getType(e),t))return e;throw new System.InvalidCastException.$ctor1("Cannot convert to IConvertible")}if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Boolean,Y.convert.convertTypes)]))return null==r?Y.convert.toBoolean(e,n):r.System$IConvertible$ToBoolean(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Char,Y.convert.convertTypes)]))return null==r?Y.convert.toChar(e,n,i):r.System$IConvertible$ToChar(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.SByte,Y.convert.convertTypes)]))return null==r?Y.convert.toSByte(e,n,i):r.System$IConvertible$ToSByte(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Byte,Y.convert.convertTypes)]))return null==r?Y.convert.toByte(e,n):r.System$IConvertible$ToByte(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Int16,Y.convert.convertTypes)]))return null==r?Y.convert.toInt16(e,n):r.System$IConvertible$ToInt16(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.UInt16,Y.convert.convertTypes)]))return null==r?Y.convert.toUInt16(e,n):r.System$IConvertible$ToUInt16(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Int32,Y.convert.convertTypes)]))return null==r?Y.convert.toInt32(e,n):r.System$IConvertible$ToInt32(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.UInt32,Y.convert.convertTypes)]))return null==r?Y.convert.toUInt32(e,n):r.System$IConvertible$ToUInt32(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Int64,Y.convert.convertTypes)]))return null==r?Y.convert.toInt64(e,n):r.System$IConvertible$ToInt64(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.UInt64,Y.convert.convertTypes)]))return null==r?Y.convert.toUInt64(e,n):r.System$IConvertible$ToUInt64(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Single,Y.convert.convertTypes)]))return null==r?Y.convert.toSingle(e,n):r.System$IConvertible$ToSingle(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Double,Y.convert.convertTypes)]))return null==r?Y.convert.toDouble(e,n):r.System$IConvertible$ToDouble(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Decimal,Y.convert.convertTypes)]))return null==r?Y.convert.toDecimal(e,n):r.System$IConvertible$ToDecimal(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.DateTime,Y.convert.convertTypes)]))return null==r?Y.convert.toDateTime(e,n):r.System$IConvertible$ToDateTime(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.String,Y.convert.convertTypes)]))return null==r?Y.convert.toString(e,n,i):r.System$IConvertible$ToString(n);if(Bridge.referenceEquals(t,Y.convert.convertTypes[System.Array.index(System.TypeCode.Object,Y.convert.convertTypes)]))return e;if(null==r)throw new System.InvalidCastException.$ctor1("Cannot convert to IConvertible");return r.System$IConvertible$ToType(t,n)},changeType:function(e,t,n){if(Bridge.isFunction(t))return Y.convert.changeConversionType(e,t,n);if(null==e&&(t===System.TypeCode.Empty||t===System.TypeCode.String||t===System.TypeCode.Object))return null;var i=Y.convert.getTypeCode(Bridge.getType(e)),r=Bridge.as(e,System.IConvertible);if(null==r&&i==System.TypeCode.Object)throw new System.InvalidCastException.$ctor1("Cannot convert to IConvertible");switch(t){case System.TypeCode.Boolean:return null==r?Y.convert.toBoolean(e,n):r.System$IConvertible$ToBoolean(provider);case System.TypeCode.Char:return null==r?Y.convert.toChar(e,n,i):r.System$IConvertible$ToChar(provider);case System.TypeCode.SByte:return null==r?Y.convert.toSByte(e,n,i):r.System$IConvertible$ToSByte(provider);case System.TypeCode.Byte:return null==r?Y.convert.toByte(e,n,i):r.System$IConvertible$ToByte(provider);case System.TypeCode.Int16:return null==r?Y.convert.toInt16(e,n):r.System$IConvertible$ToInt16(provider);case System.TypeCode.UInt16:return null==r?Y.convert.toUInt16(e,n):r.System$IConvertible$ToUInt16(provider);case System.TypeCode.Int32:return null==r?Y.convert.toInt32(e,n):r.System$IConvertible$ToInt32(provider);case System.TypeCode.UInt32:return null==r?Y.convert.toUInt32(e,n):r.System$IConvertible$ToUInt32(provider);case System.TypeCode.Int64:return null==r?Y.convert.toInt64(e,n):r.System$IConvertible$ToInt64(provider);case System.TypeCode.UInt64:return null==r?Y.convert.toUInt64(e,n):r.System$IConvertible$ToUInt64(provider);case System.TypeCode.Single:return null==r?Y.convert.toSingle(e,n):r.System$IConvertible$ToSingle(provider);case System.TypeCode.Double:return null==r?Y.convert.toDouble(e,n):r.System$IConvertible$ToDouble(provider);case System.TypeCode.Decimal:return null==r?Y.convert.toDecimal(e,n):r.System$IConvertible$ToDecimal(provider);case System.TypeCode.DateTime:return null==r?Y.convert.toDateTime(e,n):r.System$IConvertible$ToDateTime(provider);case System.TypeCode.String:return null==r?Y.convert.toString(e,n,i):r.System$IConvertible$ToString(provider);case System.TypeCode.Object:return e;case System.TypeCode.DBNull:throw new System.InvalidCastException.$ctor1("Cannot convert DBNull values");case System.TypeCode.Empty:throw new System.InvalidCastException.$ctor1("Cannot convert Empty values");default:throw new System.ArgumentException.$ctor1("Unknown type code")}}},Y.internal={base64Table:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/","="],typeRanges:{Char_MinValue:0,Char_MaxValue:65535,Byte_MinValue:0,Byte_MaxValue:255,SByte_MinValue:-128,SByte_MaxValue:127,Int16_MinValue:-32768,Int16_MaxValue:32767,UInt16_MinValue:0,UInt16_MaxValue:65535,Int32_MinValue:-2147483648,Int32_MaxValue:2147483647,UInt32_MinValue:0,UInt32_MaxValue:4294967295,Int64_MinValue:System.Int64.MinValue,Int64_MaxValue:System.Int64.MaxValue,UInt64_MinValue:System.UInt64.MinValue,UInt64_MaxValue:System.UInt64.MaxValue,Single_MinValue:-340282347e30,Single_MaxValue:340282347e30,Double_MinValue:-17976931348623157e292,Double_MaxValue:17976931348623157e292,Decimal_MinValue:System.Decimal.MinValue,Decimal_MaxValue:System.Decimal.MaxValue},base64LineBreakPosition:76,getTypeCodeName:function(e){var t=Y.convert.typeCodes;if(null==Y.internal.typeCodeNames){var n,i={};for(n in t)t.hasOwnProperty(n)&&(i[t[n]]=n);Y.internal.typeCodeNames=i}e=Y.internal.typeCodeNames[e];if(null==e)throw System.ArgumentOutOfRangeException("typeCode","The specified typeCode is undefined.");return e},suggestTypeCode:function(e){var t=Y.convert.typeCodes;switch(typeof e){case"boolean":return t.Boolean;case"number":return e%1!=0?t.Double:t.Int32;case"string":return t.String;case"object":if(Bridge.isDate(e))return t.DateTime;if(null!=e)return t.Object}return null},getMinValue:function(e){var t=Y.convert.typeCodes;switch(e){case t.Char:return Y.internal.typeRanges.Char_MinValue;case t.SByte:return Y.internal.typeRanges.SByte_MinValue;case t.Byte:return Y.internal.typeRanges.Byte_MinValue;case t.Int16:return Y.internal.typeRanges.Int16_MinValue;case t.UInt16:return Y.internal.typeRanges.UInt16_MinValue;case t.Int32:return Y.internal.typeRanges.Int32_MinValue;case t.UInt32:return Y.internal.typeRanges.UInt32_MinValue;case t.Int64:return Y.internal.typeRanges.Int64_MinValue;case t.UInt64:return Y.internal.typeRanges.UInt64_MinValue;case t.Single:return Y.internal.typeRanges.Single_MinValue;case t.Double:return Y.internal.typeRanges.Double_MinValue;case t.Decimal:return Y.internal.typeRanges.Decimal_MinValue;case t.DateTime:return System.DateTime.getMinValue();default:return null}},getMaxValue:function(e){var t=Y.convert.typeCodes;switch(e){case t.Char:return Y.internal.typeRanges.Char_MaxValue;case t.SByte:return Y.internal.typeRanges.SByte_MaxValue;case t.Byte:return Y.internal.typeRanges.Byte_MaxValue;case t.Int16:return Y.internal.typeRanges.Int16_MaxValue;case t.UInt16:return Y.internal.typeRanges.UInt16_MaxValue;case t.Int32:return Y.internal.typeRanges.Int32_MaxValue;case t.UInt32:return Y.internal.typeRanges.UInt32_MaxValue;case t.Int64:return Y.internal.typeRanges.Int64_MaxValue;case t.UInt64:return Y.internal.typeRanges.UInt64_MaxValue;case t.Single:return Y.internal.typeRanges.Single_MaxValue;case t.Double:return Y.internal.typeRanges.Double_MaxValue;case t.Decimal:return Y.internal.typeRanges.Decimal_MaxValue;case t.DateTime:return System.DateTime.getMaxValue();default:throw new System.ArgumentOutOfRangeException.$ctor4("typeCode","The specified typeCode is undefined.")}},isFloatingType:function(e){var t=Y.convert.typeCodes;return e===t.Single||e===t.Double||e===t.Decimal},toNumber:function(e,t,n,i){e=Bridge.unbox(e,!0);var r,s=Y.convert.typeCodes,o=typeof e,a=Y.internal.isFloatingType(n);switch(i===s.String&&(o="string"),(System.Int64.is64Bit(e)||e instanceof System.Decimal)&&(o="number"),o){case"boolean":return e?1:0;case"number":return n===s.Decimal?(Y.internal.validateNumberRange(e,n,!0),new System.Decimal(e,t)):n===s.Int64?(Y.internal.validateNumberRange(e,n,!0),new System.Int64(e)):n===s.UInt64?(Y.internal.validateNumberRange(e,n,!0),new System.UInt64(e)):(System.Int64.is64Bit(e)?e=e.toNumber():e instanceof System.Decimal&&(e=e.toFloat()),a||e%1==0||(e=Y.internal.roundToInt(e,n)),a&&(r=Y.internal.getMinValue(n),Y.internal.getMaxValue(n)<e?e=1/0:e<r&&(e=-1/0)),Y.internal.validateNumberRange(e,n,!1),e);case"string":if(null==e){if(null!=t)throw new System.ArgumentNullException.$ctor3("String","Value cannot be null.");return 0}if(a){var u=(t||System.Globalization.CultureInfo.getCurrentCulture()).getFormat(System.Globalization.NumberFormatInfo).numberDecimalSeparator;if(n===s.Decimal){if(!new RegExp("^[+-]?(\\d+|\\d+.|\\d*\\"+u+"\\d+)$").test(e)&&!/^[+-]?[0-9]+$/.test(e))throw new System.FormatException.$ctor1("Input string was not in a correct format.");e=new System.Decimal(e,t)}else{if(!new RegExp("^[-+]?[0-9]*\\"+u+"?[0-9]+([eE][-+]?[0-9]+)?$").test(e))throw new System.FormatException.$ctor1("Input string was not in a correct format.");e=Bridge.Int.parseFloat(e,t)}}else{if(!/^[+-]?[0-9]+$/.test(e))throw new System.FormatException.$ctor1("Input string was not in a correct format.");u=e;n===s.Int64?(e=new System.Int64(e),System.String.trimStartZeros(u)!==e.toString()&&this.throwOverflow(Y.internal.getTypeCodeName(n))):n===s.UInt64?(e=new System.UInt64(e),System.String.trimStartZeros(u)!==e.toString()&&this.throwOverflow(Y.internal.getTypeCodeName(n))):e=parseInt(e,10)}if(isNaN(e))throw new System.FormatException.$ctor1("Input string was not in a correct format.");return Y.internal.validateNumberRange(e,n,!0),e;case"object":if(null==e)return 0;Bridge.isDate(e)&&Y.internal.throwInvalidCastEx(Y.convert.typeCodes.DateTime,n)}return i=i||Y.internal.suggestTypeCode(e),Y.internal.throwInvalidCastEx(i,n),Y.convert.convertToType(n,e,t)},validateNumberRange:function(e,t,n){var i=Y.convert.typeCodes,r=Y.internal.getMinValue(t),s=Y.internal.getMaxValue(t),o=Y.internal.getTypeCodeName(t);(t!==i.Single&&t!==i.Double||n||e!==1/0&&e!==-1/0)&&(t===i.Decimal||t===i.Int64||t===i.UInt64?t===i.Decimal?(System.Int64.is64Bit(e)||(r.gt(e)||s.lt(e))&&this.throwOverflow(o),e=new System.Decimal(e)):t===i.Int64?(e instanceof System.UInt64?e.gt(System.Int64.MaxValue)&&this.throwOverflow(o):e instanceof System.Decimal?(e.gt(new System.Decimal(s))||e.lt(new System.Decimal(r)))&&this.throwOverflow(o):e instanceof System.Int64||(r.toNumber()>e||s.toNumber()<e)&&this.throwOverflow(o),e=new System.Int64(e)):t===i.UInt64&&(e instanceof System.Int64?e.isNegative()&&this.throwOverflow(o):e instanceof System.Decimal?(e.gt(new System.Decimal(s))||e.lt(new System.Decimal(r)))&&this.throwOverflow(o):e instanceof System.UInt64||(r.toNumber()>e||s.toNumber()<e)&&this.throwOverflow(o),e=new System.UInt64(e)):(e<r||s<e)&&this.throwOverflow(o))},throwOverflow:function(e){throw new System.OverflowException.$ctor1("Value was either too large or too small for '"+e+"'.")},roundToInt:function(e,t){if(e%1==0)return e;var n=0<=e?Math.floor(e):-1*Math.floor(-e),i=e-n,r=Y.internal.getMinValue(t),s=Y.internal.getMaxValue(t);if(0<=e){if(e<s+.5)return(.5<i||.5==i&&0!=(1&n))&&++n,n}else if(r-.5<=e)return(i<-.5||-.5==i&&0!=(1&n))&&--n,n;t=Y.internal.getTypeCodeName(t);throw new System.OverflowException.$ctor1("Value was either too large or too small for an '"+t+"'.")},toBase64_CalculateAndValidateOutputLength:function(e,t){var n=Y.internal.base64LineBreakPosition,i=4*~~(e/3);if(0===(i+=e%3!=0?4:0))return 0;if(t&&(t=~~(i/n),i%n==0&&--t,i+=2*t),2147483647<i)throw new System.OutOfMemoryException;return i},convertToBase64Array:function(e,t,n,i,r){for(var s=Y.internal.base64Table,o=Y.internal.base64LineBreakPosition,a=i%3,u=n+(i-a),l=0,c=0,m=n;m<u;m+=3)r&&(l===o&&(e[c++]="\r",e[c++]="\n",l=0),l+=4),e[c]=s[(252&t[m])>>2],e[c+1]=s[(3&t[m])<<4|(240&t[m+1])>>4],e[c+2]=s[(15&t[m+1])<<2|(192&t[m+2])>>6],e[c+3]=s[63&t[m+2]],c+=4;switch(m=u,r&&0!=a&&l===Y.internal.base64LineBreakPosition&&(e[c++]="\r",e[c++]="\n"),a){case 2:e[c]=s[(252&t[m])>>2],e[c+1]=s[(3&t[m])<<4|(240&t[m+1])>>4],e[c+2]=s[(15&t[m+1])<<2],e[c+3]=s[64],c+=4;break;case 1:e[c]=s[(252&t[m])>>2],e[c+1]=s[(3&t[m])<<4],e[c+2]=s[64],e[c+3]=s[64],c+=4}return c},fromBase64CharPtr:function(e,t,n){if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("inputLength","Index was out of range. Must be non-negative and less than the size of the collection.");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("offset","Value must be positive.");for(;0<n;){var i=e[t+n-1];if(" "!==i&&"\n"!==i&&"\r"!==i&&"\t"!==i)break;n--}var r=Y.internal.fromBase64_ComputeResultLength(e,t,n);if(r<0)throw new System.InvalidOperationException.$ctor1("Contract voilation: 0 <= resultLength.");var s=[];return s.length=r,Y.internal.fromBase64_Decode(e,t,n,s,0,r),s},fromBase64_Decode:function(e,t,n,i,r,s){for(var o,a=r,u="A".charCodeAt(0),l="a".charCodeAt(0),c="0".charCodeAt(0),m="=".charCodeAt(0),y="+".charCodeAt(0),h="/".charCodeAt(0),d=" ".charCodeAt(0),f="\t".charCodeAt(0),g="\n".charCodeAt(0),S="\r".charCodeAt(0),p="Z".charCodeAt(0)-"A".charCodeAt(0),$="9".charCodeAt(0)-"0".charCodeAt(0),C=t+n,I=r+s,E=255,x=!1,A=!1;;){if(C<=t){x=!0;break}if(o=e[t].charCodeAt(0),t++,o-u>>>0<=p)o-=u;else if(o-l>>>0<=p)o-=l-26;else if(o-c>>>0<=$)o-=c-52;else switch(o){case y:o=62;break;case h:o=63;break;case S:case g:case d:case f:continue;case m:A=!0;break;default:throw new System.FormatException.$ctor1("The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.")}if(A)break;if(0!=(2147483648&(E=E<<6|o))){if(I-r<3)return-1;i[r]=255&E>>16,i[r+1]=255&E>>8,i[r+2]=255&E,r+=3,E=255}}if(!x&&!A)throw new System.InvalidOperationException.$ctor1("Contract violation: should never get here.");if(A){if(o!==m)throw new System.InvalidOperationException.$ctor1("Contract violation: currCode == intEq.");if(t===C){if(0==(2147483648&(E<<=6)))throw new System.FormatException.$ctor1("Invalid length for a Base-64 char array or string.");if(I-r<2)return-1;i[r]=255&E>>16,i[r+1]=255&E>>8,r+=2,E=255}else{for(;t<C-1;){var B=e[t];if(" "!==B&&"\n"!==B&&"\r"!==B&&"\t"!==B)break;t++}if(t!==C-1||"="!==e[t])throw new System.FormatException.$ctor1("The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.");if(0==(2147483648&(E<<=12)))throw new System.FormatException.$ctor1("Invalid length for a Base-64 char array or string.");if(I-r<1)return-1;i[r]=255&E>>16,r++,E=255}}if(255!==E)throw new System.FormatException.$ctor1("Invalid length for a Base-64 char array or string.");return r-a},fromBase64_ComputeResultLength:function(e,t,n){if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("inputLength","Index was out of range. Must be non-negative and less than the size of the collection.");for(var i=t+n,r=n,s=0;t<i;){var o=e[t];t++,o<=" "?r--:"="===o&&(r--,s++)}if(r<0)throw new System.InvalidOperationException.$ctor1("Contract violation: 0 <= usefulInputLength.");if(s<0)throw new System.InvalidOperationException.$ctor1("Contract violation: 0 <= padding.");if(0!==s)if(1===s)s=2;else{if(2!==s)throw new System.FormatException.$ctor1("The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.");s=1}return 3*~~(r/4)+s},charsToCodes:function(e,t,n){if(null==e)return null;n=n||0,null==t&&((t=[]).length=e.length);for(var i=0;i<e.length;i++)t[i+n]=e[i].charCodeAt(0);return t},codesToChars:function(e,t){if(null==e)return null;t=t||[];for(var n=0;n<e.length;n++){var i=e[n];t[n]=String.fromCharCode(i)}return t},throwInvalidCastEx:function(e,t){e=Y.internal.getTypeCodeName(e),t=Y.internal.getTypeCodeName(t);throw new System.InvalidCastException.$ctor1("Invalid cast from '"+e+"' to '"+t+"'.")}},System.Convert=Y.convert,Bridge.define("System.Net.WebSockets.ClientWebSocket",{inherits:[System.IDisposable],ctor:function(){this.$initialize(),this.messageBuffer=[],this.state="none",this.options=new System.Net.WebSockets.ClientWebSocketOptions,this.disposed=!1,this.closeStatus=null,this.closeStatusDescription=null},getCloseStatus:function(){return this.closeStatus},getState:function(){return this.state},getCloseStatusDescription:function(){return this.closeStatusDescription},getSubProtocol:function(){return this.socket?this.socket.protocol:null},onCloseHandler:function(e){var t=1e3==e.code?"Status code: "+e.code+". Normal closure, meaning that the purpose for which the connection was established has been fulfilled.":1001==e.code?"Status code: "+e.code+'. An endpoint is "going away", such as a server going down or a browser having navigated away from a page.':1002==e.code?"Status code: "+e.code+". An endpoint is terminating the connection due to a protocol error":1003==e.code?"Status code: "+e.code+". An endpoint is terminating the connection because it has received a type of data it cannot accept (e.g., an endpoint that understands only text data MAY send this if it receives a binary message).":1004==e.code?"Status code: "+e.code+". Reserved. The specific meaning might be defined in the future.":1005==e.code?"Status code: "+e.code+". No status code was actually present.":1006==e.code?"Status code: "+e.code+". The connection was closed abnormally, e.g., without sending or receiving a Close control frame":1007==e.code?"Status code: "+e.code+". An endpoint is terminating the connection because it has received data within a message that was not consistent with the type of the message (e.g., non-UTF-8 [http://tools.ietf.org/html/rfc3629] data within a text message).":1008==e.code?"Status code: "+e.code+'. An endpoint is terminating the connection because it has received a message that "violates its policy". This reason is given either if there is no other sutible reason, or if there is a need to hide specific details about the policy.':1009==e.code?"Status code: "+e.code+". An endpoint is terminating the connection because it has received a message that is too big for it to process.":1010==e.code?"Status code: "+e.code+". An endpoint (client) is terminating the connection because it has expected the server to negotiate one or more extension, but the server didn't return them in the response message of the WebSocket handshake. <br /> Specifically, the extensions that are needed are: "+e.reason:1011==e.code?"Status code: "+e.code+". A server is terminating the connection because it encountered an unexpected condition that prevented it from fulfilling the request.":1015==e.code?"Status code: "+e.code+". The connection was closed due to a failure to perform a TLS handshake (e.g., the server certificate can't be verified).":"Unknown reason";return{code:e.code,reason:t}},connectAsync:function(e,t){if("none"!==this.state)throw new System.InvalidOperationException.$ctor1("Socket is not in initial state");this.options.setToReadOnly(),this.state="connecting";var n=new System.Threading.Tasks.TaskCompletionSource,s=this;try{this.socket=new WebSocket(e.getAbsoluteUri(),this.options.requestedSubProtocols),this.socket.onerror=function(e){setTimeout(function(){s.closeInfo&&!s.closeInfo.success&&(e.message=s.closeInfo.reason),n.setException(System.Exception.create(e))},10)},this.socket.binaryType="arraybuffer",this.socket.onopen=function(){s.state="open",n.setResult(null)},this.socket.onmessage=function(e){var t=e.data,n={bytes:[]};if("string"==typeof t){for(r=0;r<t.length;++r)n.bytes.push(t.charCodeAt(r));return n.messageType="text",void s.messageBuffer.push(n)}if(t instanceof ArrayBuffer){for(var i=new Uint8Array(t),r=0;r<i.length;r++)n.bytes.push(i[r]);return n.messageType="binary",void s.messageBuffer.push(n)}throw new System.ArgumentException.$ctor1("Invalid message type.")},this.socket.onclose=function(e){s.state="closed",s.closeStatus=e.code,s.closeStatusDescription=e.reason,s.closeInfo=s.onCloseHandler(e)}}catch(e){n.setException(System.Exception.create(e))}return n.task},sendAsync:function(e,t,n,i){this.throwIfNotConnected();var r=new System.Threading.Tasks.TaskCompletionSource;try{if("close"===t)this.socket.close();else{for(var s=e.getArray(),o=e.getCount(),a=e.getOffset(),u=new Uint8Array(o),l=0;l<o;l++)u[l]=s[l+a];"text"===t&&(u=String.fromCharCode.apply(null,u)),this.socket.send(u)}r.setResult(null)}catch(e){r.setException(System.Exception.create(e))}return r.task},receiveAsync:function(s,o){this.throwIfNotConnected();var a=new System.Threading.Tasks.TaskCompletionSource,u=this,l=Bridge.fn.bind(this,function(){try{if(o.getIsCancellationRequested())return void a.setException(new System.Threading.Tasks.TaskCanceledException("Receive has been cancelled.",a.task));if(0===u.messageBuffer.length)return void System.Threading.Tasks.Task.delay(0).continueWith(l);for(var e,t=u.messageBuffer[0],n=s.getArray(),i=t.bytes.length<=n.length?(u.messageBuffer.shift(),e=t.bytes,!0):(e=t.bytes.slice(0,n.length),t.bytes=t.bytes.slice(n.length,t.bytes.length),!1),r=0;r<e.length;r++)n[r]=e[r];a.setResult(new System.Net.WebSockets.WebSocketReceiveResult(e.length,t.messageType,i))}catch(e){a.setException(System.Exception.create(e))}},arguments);return l(),a.task},closeAsync:function(e,t,n){if(this.throwIfNotConnected(),"open"!==this.state)throw new System.InvalidOperationException.$ctor1("Socket is not in connected state");var i=new System.Threading.Tasks.TaskCompletionSource,r=this,s=function(){"closed"!==r.state?n.getIsCancellationRequested()?i.setException(new System.Threading.Tasks.TaskCanceledException("Closing has been cancelled.",i.task)):System.Threading.Tasks.Task.delay(0).continueWith(s):i.setResult(null)};try{this.state="closesent",this.socket.close(e,t)}catch(e){i.setException(System.Exception.create(e))}return s(),i.task},closeOutputAsync:function(e,t,n){if(this.throwIfNotConnected(),"open"!==this.state)throw new System.InvalidOperationException.$ctor1("Socket is not in connected state");var i=new System.Threading.Tasks.TaskCompletionSource;try{this.state="closesent",this.socket.close(e,t),i.setResult(null)}catch(e){i.setException(System.Exception.create(e))}return i.task},abort:function(){this.Dispose()},Dispose:function(){this.disposed||(this.disposed=!0,this.messageBuffer=[],"open"===state&&(this.state="closesent",this.socket.close()))},throwIfNotConnected:function(){if(this.disposed)throw new System.InvalidOperationException.$ctor1("Socket is disposed.");if(1!==this.socket.readyState)throw new System.InvalidOperationException.$ctor1("Socket is not connected.")}}),Bridge.define("System.Net.WebSockets.ClientWebSocketOptions",{ctor:function(){this.$initialize(),this.isReadOnly=!1,this.requestedSubProtocols=[]},setToReadOnly:function(){if(this.isReadOnly)throw new System.InvalidOperationException.$ctor1("Options are already readonly.");this.isReadOnly=!0},addSubProtocol:function(e){if(this.isReadOnly)throw new System.InvalidOperationException.$ctor1("Socket already started.");if(-1<this.requestedSubProtocols.indexOf(e))throw new System.ArgumentException.$ctor1("Socket cannot have duplicate sub-protocols.","subProtocol");this.requestedSubProtocols.push(e)}}),Bridge.define("System.Net.WebSockets.WebSocketReceiveResult",{ctor:function(e,t,n,i,r){this.$initialize(),this.count=e,this.messageType=t,this.endOfMessage=n,this.closeStatus=i,this.closeStatusDescription=r},getCount:function(){return this.count},getMessageType:function(){return this.messageType},getEndOfMessage:function(){return this.endOfMessage},getCloseStatus:function(){return this.closeStatus},getCloseStatusDescription:function(){return this.closeStatusDescription}}),Bridge.assembly("System",{},function(e,t){Bridge.define("System.Uri",{statics:{methods:{equals:function(e,t){return e==t||null!=e&&null!=t&&t.equals(e)},notEquals:function(e,t){return!System.Uri.equals(e,t)}}},ctor:function(e){this.$initialize(),this.absoluteUri=e},getAbsoluteUri:function(){return this.absoluteUri},toJSON:function(){return this.absoluteUri},toString:function(){return this.absoluteUri},equals:function(e){return!(null==e||!Bridge.is(e,System.Uri))&&this.absoluteUri===e.absoluteUri}})},!0),Bridge.define("Bridge.GeneratorEnumerable",{inherits:[System.Collections.IEnumerable],config:{alias:["GetEnumerator","System$Collections$IEnumerable$GetEnumerator"]},ctor:function(e){this.$initialize(),this.GetEnumerator=e,this.System$Collections$IEnumerable$GetEnumerator=e}}),Bridge.define("Bridge.GeneratorEnumerable$1",function(t){return{inherits:[System.Collections.Generic.IEnumerable$1(t)],config:{alias:["GetEnumerator",["System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(t)+"$GetEnumerator","System$Collections$Generic$IEnumerable$1$GetEnumerator"]]},ctor:function(e){this.$initialize(),this.GetEnumerator=e,this["System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(t)+"$GetEnumerator"]=e,this.System$Collections$Generic$IEnumerable$1$GetEnumerator=e}}}),Bridge.define("Bridge.GeneratorEnumerator",{inherits:[System.Collections.IEnumerator],current:null,config:{properties:{Current:{get:function(){return this.getCurrent()}}},alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset","Current","System$Collections$IEnumerator$Current"]},ctor:function(e){this.$initialize(),this.moveNext=e,this.System$Collections$IEnumerator$moveNext=e},getCurrent:function(){return this.current},getCurrent$1:function(){return this.current},reset:function(){throw new System.NotSupportedException}}),Bridge.define("Bridge.GeneratorEnumerator$1",function(e){return{inherits:[System.Collections.Generic.IEnumerator$1(e),System.IDisposable],current:null,config:{properties:{Current:{get:function(){return this.getCurrent()}},Current$1:{get:function(){return this.getCurrent()}}},alias:["getCurrent",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(e)+"$getCurrent$1","System$Collections$Generic$IEnumerator$1$getCurrent$1"],"Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(e)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"],"Current","System$Collections$IEnumerator$Current","Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"]},ctor:function(e,t){this.$initialize(),this.moveNext=e,this.System$Collections$IEnumerator$moveNext=e,this.final=t},getCurrent:function(){return this.current},getCurrent$1:function(){return this.current},System$Collections$IEnumerator$getCurrent:function(){return this.current},Dispose:function(){this.final&&this.final()},reset:function(){throw new System.NotSupportedException}}}),function(c){function m(e,t,n){var i=new S,r=a;this.getCurrent=i.getCurrent,this.reset=function(){throw new Error("Reset is not supported")},this.moveNext=function(){try{switch(r){case a:r=u,e();case u:return!!t.apply(i)||(this.Dispose(),!1);case l:return!1}}catch(e){throw this.Dispose(),e}},this.Dispose=function(){if(r==u)try{n()}finally{r=l}},this.System$IDisposable$Dispose=this.Dispose,this.getCurrent$1=this.getCurrent,this.System$Collections$IEnumerator$getCurrent=this.getCurrent,this.System$Collections$IEnumerator$moveNext=this.moveNext,this.System$Collections$IEnumerator$reset=this.reset,Object.defineProperties(this,{Current$1:{get:this.getCurrent,enumerable:!0},Current:{get:this.getCurrent,enumerable:!0},System$Collections$IEnumerator$Current:{get:this.getCurrent,enumerable:!0}})}var y={Identity:function(e){return e},True:function(){return!0},Blank:function(){}},t=typeof!0,r="number",h="string",s=typeof{},i=typeof c,o="function",d={"":y.Identity},f={createLambda:function(e){if(null==e)return y.Identity;if(typeof e!==h)return e;if(null!=(l=d[e]))return l;if(-1===e.indexOf("=>")){for(var t=new RegExp("[$]+","g"),n=0;null!=(i=t.exec(e));){var i=i[0].length;n<i&&(n=i)}for(var r=[],s=1;s<=n;s++){for(var o="",a=0;a<s;a++)o+="$";r.push(o)}var u=Array.prototype.join.call(r,","),l=new Function(u,"return "+e);return d[e]=l}u=e.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/);return l=new Function(u[1],"return "+u[2]),d[e]=l},isIEnumerable:function(e){if(typeof Enumerator!==i)try{return new Enumerator(e),!0}catch(e){}return!1},defineProperty:null!=Object.defineProperties?function(e,t,n){Object.defineProperty(e,t,{enumerable:!1,configurable:!0,writable:!0,value:n})}:function(e,t,n){e[t]=n},compare:function(e,t){return e===t?0:t<e?1:-1},Dispose:function(e){null!=e&&e.Dispose()}},a=0,u=1,l=2;function g(e){this.GetEnumerator=e}m.$$inherits=[],Bridge.Class.addExtend(m,[System.IDisposable,System.Collections.IEnumerator]);var S=function(){var t=null;this.getCurrent=function(){return t},this.yieldReturn=function(e){return t=e,!0},this.yieldBreak=function(){return!1}};g.$$inherits=[],Bridge.Class.addExtend(g,[System.Collections.IEnumerable]),(g.Utils={}).createLambda=function(e){return f.createLambda(e)},g.Utils.createEnumerable=function(e){return new g(e)},g.Utils.createEnumerator=function(e,t,n){return new m(e,t,n)},g.Utils.extendTo=function(e){var t,n,i=e.prototype;for(n in e===Array?(t=E.prototype,f.defineProperty(i,"getSource",function(){return this})):(t=g.prototype,f.defineProperty(i,"GetEnumerator",function(){return g.from(this).GetEnumerator()})),t){var r=t[n];i[n]!=r&&(null!=i[n]&&i[n+="ByLinq"]==r||r instanceof Function&&f.defineProperty(i,n,r))}},g.choice=function(){var e=arguments;return new g(function(){return new m(function(){e=e[0]instanceof Array?e[0]:null!=e[0].GetEnumerator?e[0].ToArray():e},function(){return this.yieldReturn(e[Math.floor(Math.random()*e.length)])},y.Blank)})},g.cycle=function(){var t=arguments;return new g(function(){var e=0;return new m(function(){t=t[0]instanceof Array?t[0]:null!=t[0].GetEnumerator?t[0].ToArray():t},function(){return e>=t.length&&(e=0),this.yieldReturn(t[e++])},y.Blank)})};var e=new g(function(){return new m(y.Blank,function(){return!1},y.Blank)});g.empty=function(){return e},g.from=function(i,e){if(null==i)return null;if(i instanceof g)return i;if(typeof i==r||typeof i==t)return g.repeat(i,1);if(typeof i==h)return new g(function(){var e=0;return new m(y.Blank,function(){return e<i.length&&this.yieldReturn(i.charCodeAt(e++))},y.Blank)});var n=Bridge.as(i,System.Collections.IEnumerable);if(n)return new g(function(){var t;return new m(function(){t=Bridge.getEnumerator(n,e)},function(){return!!t.moveNext()&&this.yieldReturn(t.Current)},function(){var e=Bridge.as(t,System.IDisposable);e&&e.Dispose()})});if(typeof i!=o){if(typeof i.length==r)return new E(i);if(!(i instanceof Object)&&f.isIEnumerable(i))return new g(function(){var e,t=!0;return new m(function(){e=new Enumerator(i)},function(){return t?t=!1:e.moveNext(),!e.atEnd()&&this.yieldReturn(e.item())},y.Blank)});if(typeof Windows===s&&typeof i.first===o)return new g(function(){var e,t=!0;return new m(function(){e=i.first()},function(){return t?t=!1:e.moveNext(),e.hasCurrent?this.yieldReturn(e.current):this.yieldBreak()},y.Blank)})}return new g(function(){var n=[],e=0;return new m(function(){for(var e in i){var t=i[e];t instanceof Function||!Object.prototype.hasOwnProperty.call(i,e)||n.push({key:e,value:t})}},function(){return e<n.length&&this.yieldReturn(n[e++])},y.Blank)})},g.make=function(e){return g.repeat(e,1)},g.matches=function(n,e,i){return null==i&&(i=""),e instanceof RegExp&&(i+=e.ignoreCase?"i":"",i+=e.multiline?"m":"",e=e.source),-1===i.indexOf("g")&&(i+="g"),new g(function(){var t;return new m(function(){t=new RegExp(e,i)},function(){var e=t.exec(n);return!!e&&this.yieldReturn(e)},y.Blank)})},g.range=function(n,i,r){return null==r&&(r=1),new g(function(){var e,t=0;return new m(function(){e=n-r},function(){return t++<i?this.yieldReturn(e+=r):this.yieldBreak()},y.Blank)})},g.rangeDown=function(n,i,r){return null==r&&(r=1),new g(function(){var e,t=0;return new m(function(){e=n+r},function(){return t++<i?this.yieldReturn(e-=r):this.yieldBreak()},y.Blank)})},g.rangeTo=function(e,n,i){return null==i&&(i=1),new g(e<n?function(){var t;return new m(function(){t=e-i},function(){var e=t+=i;return e<=n?this.yieldReturn(e):this.yieldBreak()},y.Blank)}:function(){var t;return new m(function(){t=e+i},function(){var e=t-=i;return n<=e?this.yieldReturn(e):this.yieldBreak()},y.Blank)})},g.repeat=function(e,t){return null!=t?g.repeat(e).take(t):new g(function(){return new m(y.Blank,function(){return this.yieldReturn(e)},y.Blank)})},g.repeatWithFinalize=function(t,n){return t=f.createLambda(t),n=f.createLambda(n),new g(function(){var e;return new m(function(){e=t()},function(){return this.yieldReturn(e)},function(){null!=e&&(n(e),e=null)})})},g.generate=function(e,t){return null!=t?g.generate(e).take(t):(e=f.createLambda(e),new g(function(){return new m(y.Blank,function(){return this.yieldReturn(e())},y.Blank)}))},g.toInfinity=function(t,n){return null==t&&(t=0),null==n&&(n=1),new g(function(){var e;return new m(function(){e=t-n},function(){return this.yieldReturn(e+=n)},y.Blank)})},g.toNegativeInfinity=function(t,n){return null==t&&(t=0),null==n&&(n=1),new g(function(){var e;return new m(function(){e=t+n},function(){return this.yieldReturn(e-=n)},y.Blank)})},g.unfold=function(n,i){return i=f.createLambda(i),new g(function(){var e,t=!0;return new m(y.Blank,function(){return e=t?(t=!1,n):i(e),this.yieldReturn(e)},y.Blank)})},g.defer=function(t){return new g(function(){var e;return new m(function(){e=g.from(t()).GetEnumerator()},function(){return e.moveNext()?this.yieldReturn(e.Current):this.yieldBreak()},function(){f.Dispose(e)})})},g.prototype.traverseBreadthFirst=function(r,s){var e=this;return r=f.createLambda(r),s=f.createLambda(s),new g(function(){var t,n=0,i=[];return new m(function(){t=e.GetEnumerator()},function(){for(;;){if(t.moveNext())return i.push(t.Current),this.yieldReturn(s(t.Current,n));var e=g.from(i).selectMany(function(e){return r(e)});if(!e.any())return!1;n++,i=[],f.Dispose(t),t=e.GetEnumerator()}},function(){f.Dispose(t)})})},g.prototype.traverseDepthFirst=function(i,r){var e=this;return i=f.createLambda(i),r=f.createLambda(r),new g(function(){var t,n=[];return new m(function(){t=e.GetEnumerator()},function(){for(;;){if(t.moveNext()){var e=r(t.Current,n.length);return n.push(t),t=g.from(i(t.Current)).GetEnumerator(),this.yieldReturn(e)}if(n.length<=0)return!1;f.Dispose(t),t=n.pop()}},function(){try{f.Dispose(t)}finally{g.from(n).forEach(function(e){e.Dispose()})}})})},g.prototype.flatten=function(){var n=this;return new g(function(){var e,t=null;return new m(function(){e=n.GetEnumerator()},function(){for(;;){if(null!=t){if(t.moveNext())return this.yieldReturn(t.Current);t=null}if(e.moveNext()){if(e.Current instanceof Array){f.Dispose(t),t=g.from(e.Current).selectMany(y.Identity).flatten().GetEnumerator();continue}return this.yieldReturn(e.Current)}return!1}},function(){try{f.Dispose(e)}finally{f.Dispose(t)}})})},g.prototype.pairwise=function(n){var e=this;return n=f.createLambda(n),new g(function(){var t;return new m(function(){(t=e.GetEnumerator()).moveNext()},function(){var e=t.Current;return!!t.moveNext()&&this.yieldReturn(n(e,t.Current))},function(){f.Dispose(t)})})},g.prototype.scan=function(i,r){var s=null==r?(r=f.createLambda(i),!1):(r=f.createLambda(r),!0),o=this;return new g(function(){var e,t,n=!0;return new m(function(){e=o.GetEnumerator()},function(){if(n){if(n=!1,s)return this.yieldReturn(t=i);if(e.moveNext())return this.yieldReturn(t=e.Current)}return!!e.moveNext()&&this.yieldReturn(t=r(t,e.Current))},function(){f.Dispose(e)})})},g.prototype.select=function(n){if((n=f.createLambda(n)).length<=1)return new A(this,null,n);var i=this;return new g(function(){var e,t=0;return new m(function(){e=i.GetEnumerator()},function(){return!!e.moveNext()&&this.yieldReturn(n(e.Current,t++))},function(){f.Dispose(e)})})},g.prototype.selectMany=function(r,s){var e=this;return r=f.createLambda(r),null==s&&(s=function(e,t){return t}),s=f.createLambda(s),new g(function(){var t,n=c,i=0;return new m(function(){t=e.GetEnumerator()},function(){if(n===c&&!t.moveNext())return!1;do{var e;if(null==n&&(e=r(t.Current,i++),n=g.from(e).GetEnumerator()),n.moveNext())return this.yieldReturn(s(t.Current,n.Current))}while(f.Dispose(n),n=null,t.moveNext());return!1},function(){try{f.Dispose(t)}finally{f.Dispose(n)}})})},g.prototype.where=function(n){if((n=f.createLambda(n)).length<=1)return new x(this,n);var i=this;return new g(function(){var e,t=0;return new m(function(){e=i.GetEnumerator()},function(){for(;e.moveNext();)if(n(e.Current,t++))return this.yieldReturn(e.Current);return!1},function(){f.Dispose(e)})})},g.prototype.choose=function(i){i=f.createLambda(i);var e=this;return new g(function(){var t,n=0;return new m(function(){t=e.GetEnumerator()},function(){for(;t.moveNext();){var e=i(t.Current,n++);if(null!=e)return this.yieldReturn(e)}return this.yieldBreak()},function(){f.Dispose(t)})})},g.prototype.ofType=function(n){var e=this;return new g(function(){var t;return new m(function(){t=Bridge.getEnumerator(e)},function(){for(;t.moveNext();){var e=Bridge.as(t.Current,n);if(Bridge.hasValue(e))return this.yieldReturn(e)}return!1},function(){f.Dispose(t)})})},g.prototype.zip=function(){var i=arguments,r=f.createLambda(arguments[arguments.length-1]),s=this;if(2!=arguments.length)return new g(function(){var t,n=0;return new m(function(){var e=g.make(s).concat(g.from(i).takeExceptLast().select(g.from)).select(function(e){return e.GetEnumerator()}).ToArray();t=g.from(e)},function(){if(t.all(function(e){return e.moveNext()})){var e=t.select(function(e){return e.Current}).ToArray();return e.push(n++),this.yieldReturn(r.apply(null,e))}return this.yieldBreak()},function(){g.from(t).forEach(f.Dispose)})});var o=arguments[0];if(null==o)throw new System.ArgumentNullException;return new g(function(){var e,t,n=0;return new m(function(){e=s.GetEnumerator(),t=g.from(o).GetEnumerator()},function(){return!(!e.moveNext()||!t.moveNext())&&this.yieldReturn(r(e.Current,t.Current,n++))},function(){try{f.Dispose(e)}finally{f.Dispose(t)}})})},g.prototype.merge=function(){var e=arguments,i=this;return new g(function(){var t,n=-1;return new m(function(){t=g.make(i).concat(g.from(e).select(g.from)).select(function(e){return e.GetEnumerator()}).ToArray()},function(){for(;0<t.length;){n=n>=t.length-1?0:n+1;var e=t[n];if(e.moveNext())return this.yieldReturn(e.Current);e.Dispose(),t.splice(n--,1)}return this.yieldBreak()},function(){g.from(t).forEach(f.Dispose)})})},g.prototype.join=function(e,s,o,a,u){if(s=f.createLambda(s),o=f.createLambda(o),a=f.createLambda(a),null==e)throw new System.ArgumentNullException;var l=this;return new g(function(){var t,n,i=null,r=0;return new m(function(){t=l.GetEnumerator(),n=g.from(e).toLookup(o,y.Identity,u)},function(){for(;;){if(null!=i){var e=i[r++];if(e!==c)return this.yieldReturn(a(t.Current,e));e=null,r=0}if(!t.moveNext())return!1;e=s(t.Current);i=n.get(e).ToArray()}},function(){f.Dispose(t)})})},g.prototype.groupJoin=function(e,i,r,s,o){i=f.createLambda(i),r=f.createLambda(r),s=f.createLambda(s);var a=this;if(null==e)throw new System.ArgumentNullException;return new g(function(){var t=a.GetEnumerator(),n=null;return new m(function(){t=a.GetEnumerator(),n=g.from(e).toLookup(r,y.Identity,o)},function(){if(t.moveNext()){var e=n.get(i(t.Current));return this.yieldReturn(s(t.Current,e))}return!1},function(){f.Dispose(t)})})},g.prototype.all=function(t){t=f.createLambda(t);var n=!0;return this.forEach(function(e){if(!t(e))return n=!1}),n},g.prototype.any=function(e){e=f.createLambda(e);var t=this.GetEnumerator();try{if(0==arguments.length)return t.moveNext();for(;t.moveNext();)if(e(t.Current))return!0;return!1}finally{f.Dispose(t)}},g.prototype.isEmpty=function(){return!this.any()},g.prototype.concat=function(){var n=this;if(1==arguments.length){var i=arguments[0];if(null==i)throw new System.ArgumentNullException;return new g(function(){var e,t;return new m(function(){e=n.GetEnumerator()},function(){if(null==t){if(e.moveNext())return this.yieldReturn(e.Current);t=g.from(i).GetEnumerator()}return!!t.moveNext()&&this.yieldReturn(t.Current)},function(){try{f.Dispose(e)}finally{f.Dispose(t)}})})}var e=arguments;return new g(function(){var t;return new m(function(){t=g.make(n).concat(g.from(e).select(g.from)).select(function(e){return e.GetEnumerator()}).ToArray()},function(){for(;0<t.length;){var e=t[0];if(e.moveNext())return this.yieldReturn(e.Current);e.Dispose(),t.splice(0,1)}return this.yieldBreak()},function(){g.from(t).forEach(f.Dispose)})})},g.prototype.insert=function(r,s){var o=this;return new g(function(){var e,t,n=0,i=!1;return new m(function(){e=o.GetEnumerator(),t=g.from(s).GetEnumerator()},function(){return n==r&&t.moveNext()?(i=!0,this.yieldReturn(t.Current)):e.moveNext()?(n++,this.yieldReturn(e.Current)):!(i||!t.moveNext())&&this.yieldReturn(t.Current)},function(){try{f.Dispose(e)}finally{f.Dispose(t)}})})},g.prototype.alternate=function(e){var s=this;return new g(function(){var t,n,i,r;return new m(function(){i=e instanceof Array||null!=e.GetEnumerator?g.from(g.from(e).ToArray()):g.make(e),(n=s.GetEnumerator()).moveNext()&&(t=n.Current)},function(){for(;;){if(null!=r){if(r.moveNext())return this.yieldReturn(r.Current);r=null}if(null!=t||!n.moveNext()){if(null==t)return this.yieldBreak();var e=t;return t=null,this.yieldReturn(e)}t=n.Current,r=i.GetEnumerator()}},function(){try{f.Dispose(n)}finally{f.Dispose(r)}})})},g.prototype.contains=function(e,t){t=t||System.Collections.Generic.EqualityComparer$1.$default;var n=this.GetEnumerator();try{for(;n.moveNext();)if(t.equals2(n.Current,e))return!0;return!1}finally{f.Dispose(n)}},g.prototype.defaultIfEmpty=function(n){var i=this;return n===c&&(n=null),new g(function(){var e,t=!0;return new m(function(){e=i.GetEnumerator()},function(){return e.moveNext()?(t=!1,this.yieldReturn(e.Current)):!!t&&(t=!1,this.yieldReturn(n))},function(){f.Dispose(e)})})},g.prototype.distinct=function(e){return this.except(g.empty(),e)},g.prototype.distinctUntilChanged=function(r){r=f.createLambda(r);var e=this;return new g(function(){var t,n,i;return new m(function(){t=e.GetEnumerator()},function(){for(;t.moveNext();){var e=r(t.Current);if(i)return i=!1,n=e,this.yieldReturn(t.Current);if(n!==e)return n=e,this.yieldReturn(t.Current)}return this.yieldBreak()},function(){f.Dispose(t)})})},g.prototype.except=function(e,r){var s=this;if(null==e)throw new System.ArgumentNullException;return new g(function(){var t,n,i=!1;return new m(function(){t=s.GetEnumerator(),n=new(System.Collections.Generic.Dictionary$2(System.Object,System.Object).$ctor3)(r),g.from(e).forEach(function(e){null==e?i=!0:n.containsKey(e)||n.add(e)})},function(){for(;t.moveNext();){var e=t.Current;if(null==e){if(!i)return i=!0,this.yieldReturn(e)}else if(!n.containsKey(e))return n.add(e),this.yieldReturn(e)}return!1},function(){f.Dispose(t)})})},g.prototype.intersect=function(e,o){var a=this;if(null==e)throw new System.ArgumentNullException;return new g(function(){var t,n,i,r=!1,s=!1;return new m(function(){t=a.GetEnumerator(),n=new(System.Collections.Generic.Dictionary$2(System.Object,System.Object).$ctor3)(o),g.from(e).forEach(function(e){null==e?r=!0:n.containsKey(e)||n.add(e)}),i=new(System.Collections.Generic.Dictionary$2(System.Object,System.Object).$ctor3)(o)},function(){for(;t.moveNext();){var e=t.Current;if(null==e){if(!s&&r)return s=!0,this.yieldReturn(e)}else if(!i.containsKey(e)&&n.containsKey(e))return i.add(e),this.yieldReturn(e)}return!1},function(){f.Dispose(t)})})},g.prototype.sequenceEqual=function(e,t){if(t=t||System.Collections.Generic.EqualityComparer$1.$default,null==e)throw new System.ArgumentNullException;var n=this.GetEnumerator();try{var i=g.from(e).GetEnumerator();try{for(;n.moveNext();)if(!i.moveNext()||!t.equals2(n.Current,i.Current))return!1;return i.moveNext()?!1:!0}finally{f.Dispose(i)}}finally{f.Dispose(n)}},g.prototype.union=function(s,e){var o=this;if(null==s)throw new System.ArgumentNullException;return new g(function(){var t,n,i,r=!1;return new m(function(){t=o.GetEnumerator(),i=new(System.Collections.Generic.Dictionary$2(System.Object,System.Object).$ctor3)(e)},function(){var e;if(n===c){for(;t.moveNext();)if(null==(e=t.Current)){if(!r)return r=!0,this.yieldReturn(e)}else if(!i.containsKey(e))return i.add(e),this.yieldReturn(e);n=g.from(s).GetEnumerator()}for(;n.moveNext();)if(null==(e=n.Current)){if(!r)return r=!0,this.yieldReturn(e)}else if(!i.containsKey(e))return i.add(e),this.yieldReturn(e);return!1},function(){try{f.Dispose(t)}finally{f.Dispose(n)}})})},g.prototype.orderBy=function(e,t){return new $(this,e,t,!1)},g.prototype.orderByDescending=function(e,t){return new $(this,e,t,!0)},g.prototype.reverse=function(){var n=this;return new g(function(){var e,t;return new m(function(){e=n.ToArray(),t=e.length},function(){return 0<t&&this.yieldReturn(e[--t])},y.Blank)})},g.prototype.shuffle=function(){var e=this;return new g(function(){var t;return new m(function(){t=e.ToArray()},function(){if(0<t.length){var e=Math.floor(Math.random()*t.length);return this.yieldReturn(t.splice(e,1)[0])}return!1},y.Blank)})},g.prototype.weightedSample=function(n){n=f.createLambda(n);var e=this;return new g(function(){var r,s=0;return new m(function(){r=e.choose(function(e){var t=n(e);return t<=0?null:{value:e,bound:s+=t}}).ToArray()},function(){if(0<r.length){for(var e=Math.floor(Math.random()*s)+1,t=-1,n=r.length;1<n-t;){var i=Math.floor((t+n)/2);r[i].bound>=e?n=i:t=i}return this.yieldReturn(r[n].value)}return this.yieldBreak()},y.Blank)})},g.prototype.groupBy=function(t,n,i,r){var s=this;return t=f.createLambda(t),n=f.createLambda(n),null!=i&&(i=f.createLambda(i)),new g(function(){var e;return new m(function(){e=s.toLookup(t,n,r).toEnumerable().GetEnumerator()},function(){return!!e.moveNext()&&(null==i?this.yieldReturn(e.Current):this.yieldReturn(i(e.Current.key(),e.Current)))},function(){f.Dispose(e)})})},g.prototype.partitionBy=function(s,o,a,u){var l,e=this;return s=f.createLambda(s),o=f.createLambda(o),u=u||System.Collections.Generic.EqualityComparer$1.$default,a=null==a?(l=!1,function(e,t){return new B(e,t)}):(l=!0,f.createLambda(a)),new g(function(){var n,i,r=[];return new m(function(){(n=e.GetEnumerator()).moveNext()&&(i=s(n.Current),r.push(o(n.Current)))},function(){for(var e;1==(e=n.moveNext())&&u.equals2(i,s(n.Current));)r.push(o(n.Current));if(0<r.length){var t=a(i,l?g.from(r):r);return r=e?(i=s(n.Current),[o(n.Current)]):[],this.yieldReturn(t)}return!1},function(){f.Dispose(n)})})},g.prototype.buffer=function(i){var e=this;return new g(function(){var n;return new m(function(){n=e.GetEnumerator()},function(){for(var e=[],t=0;n.moveNext();)if(e.push(n.Current),++t>=i)return this.yieldReturn(e);return 0<e.length&&this.yieldReturn(e)},function(){f.Dispose(n)})})},g.prototype.aggregate=function(e,t,n){return(n=f.createLambda(n))(this.scan(e,t,n).last())},g.prototype.average=function(t,e){!t||e||Bridge.isFunction(t)||(e=t,t=null),t=f.createLambda(t);var n=e||0,i=0;if(this.forEach(function(e){(e=t(e))instanceof System.Decimal||System.Int64.is64Bit(e)?n=e.add(n):n instanceof System.Decimal||System.Int64.is64Bit(n)?n=n.add(e):n+=e,++i}),0===i)throw new System.InvalidOperationException.$ctor1("Sequence contains no elements");return n instanceof System.Decimal||System.Int64.is64Bit(n)?n.div(i):n/i},g.prototype.nullableAverage=function(e,t){return this.any(Bridge.isNull)?null:this.average(e,t)},g.prototype.count=function(n){n=null==n?y.True:f.createLambda(n);var i=0;return this.forEach(function(e,t){n(e,t)&&++i}),i},g.prototype.max=function(e){return null==e&&(e=y.Identity),this.select(e).aggregate(function(e,t){return 1===Bridge.compare(e,t,!0)?e:t})},g.prototype.nullableMax=function(e){return this.any(Bridge.isNull)?null:this.max(e)},g.prototype.min=function(e){return null==e&&(e=y.Identity),this.select(e).aggregate(function(e,t){return-1===Bridge.compare(e,t,!0)?e:t})},g.prototype.nullableMin=function(e){return this.any(Bridge.isNull)?null:this.min(e)},g.prototype.maxBy=function(n){return n=f.createLambda(n),this.aggregate(function(e,t){return 1===Bridge.compare(n(e),n(t),!0)?e:t})},g.prototype.minBy=function(n){return n=f.createLambda(n),this.aggregate(function(e,t){return-1===Bridge.compare(n(e),n(t),!0)?e:t})},g.prototype.sum=function(e,t){!e||t||Bridge.isFunction(e)||(t=e,e=null),null==e&&(e=y.Identity);e=this.select(e).aggregate(0,function(e,t){return e instanceof System.Decimal||System.Int64.is64Bit(e)?e.add(t):t instanceof System.Decimal||System.Int64.is64Bit(t)?t.add(e):e+t});return 0===e&&t?t:e},g.prototype.nullableSum=function(e,t){return this.any(Bridge.isNull)?null:this.sum(e,t)},g.prototype.elementAt=function(n){var i,r=!1;if(this.forEach(function(e,t){if(t==n)return i=e,!(r=!0)}),!r)throw new Error("index is less than 0 or greater than or equal to the number of elements in source.");return i},g.prototype.elementAtOrDefault=function(n,e){var i;e===c&&(e=null);var r=!1;return this.forEach(function(e,t){if(t==n)return i=e,!(r=!0)}),r?i:e},g.prototype.first=function(e){if(null!=e)return this.where(e).first();var t,n=!1;if(this.forEach(function(e){return t=e,!(n=!0)}),!n)throw new Error("first:No element satisfies the condition.");return t},g.prototype.firstOrDefault=function(e,t){if(t===c&&(t=null),null!=e)return this.where(e).firstOrDefault(null,t);var n,i=!1;return this.forEach(function(e){return n=e,!(i=!0)}),i?n:t},g.prototype.last=function(e){if(null!=e)return this.where(e).last();var t,n=!1;if(this.forEach(function(e){n=!0,t=e}),!n)throw new Error("last:No element satisfies the condition.");return t},g.prototype.lastOrDefault=function(e,t){if(t===c&&(t=null),null!=e)return this.where(e).lastOrDefault(null,t);var n,i=!1;return this.forEach(function(e){i=!0,n=e}),i?n:t},g.prototype.single=function(e){if(null!=e)return this.where(e).single();var t,n=!1;if(this.forEach(function(e){if(n)throw new Error("single:sequence contains more than one element.");n=!0,t=e}),!n)throw new Error("single:No element satisfies the condition.");return t},g.prototype.singleOrDefault=function(e,t){if(t===c&&(t=null),null!=e)return this.where(e).singleOrDefault(null,t);var n,i=!1;return this.forEach(function(e){if(i)throw new Error("single:sequence contains more than one element.");i=!0,n=e}),i?n:t},g.prototype.skip=function(n){var i=this;return new g(function(){var e,t=0;return new m(function(){for(e=i.GetEnumerator();t++<n&&e.moveNext(););},function(){return!!e.moveNext()&&this.yieldReturn(e.Current)},function(){f.Dispose(e)})})},g.prototype.skipWhile=function(i){i=f.createLambda(i);var r=this;return new g(function(){var e,t=0,n=!1;return new m(function(){e=r.GetEnumerator()},function(){for(;!n;){if(!e.moveNext())return!1;if(!i(e.Current,t++))return n=!0,this.yieldReturn(e.Current)}return!!e.moveNext()&&this.yieldReturn(e.Current)},function(){f.Dispose(e)})})},g.prototype.take=function(n){var i=this;return new g(function(){var e,t=0;return new m(function(){e=i.GetEnumerator()},function(){return!!(t++<n&&e.moveNext())&&this.yieldReturn(e.Current)},function(){f.Dispose(e)})})},g.prototype.takeWhile=function(n){n=f.createLambda(n);var i=this;return new g(function(){var e,t=0;return new m(function(){e=i.GetEnumerator()},function(){return!(!e.moveNext()||!n(e.Current,t++))&&this.yieldReturn(e.Current)},function(){f.Dispose(e)})})},g.prototype.takeExceptLast=function(n){null==n&&(n=1);var i=this;return new g(function(){if(n<=0)return i.GetEnumerator();var e,t=[];return new m(function(){e=i.GetEnumerator()},function(){for(;e.moveNext();){if(t.length==n)return t.push(e.Current),this.yieldReturn(t.shift());t.push(e.Current)}return!1},function(){f.Dispose(e)})})},g.prototype.takeFromLast=function(i){if(i<=0||null==i)return g.empty();var r=this;return new g(function(){var e,t,n=[];return new m(function(){e=r.GetEnumerator()},function(){if(null==t){for(;e.moveNext();)n.length==i&&n.shift(),n.push(e.Current);t=g.from(n).GetEnumerator()}return!!t.moveNext()&&this.yieldReturn(t.Current)},function(){f.Dispose(t)})})},g.prototype.indexOf=function(n,i){var r=null;return typeof n===o?this.forEach(function(e,t){if(n(e,t))return r=t,!1}):(i=i||System.Collections.Generic.EqualityComparer$1.$default,this.forEach(function(e,t){if(i.equals2(e,n))return r=t,!1})),null!==r?r:-1},g.prototype.lastIndexOf=function(n,i){var r=-1;return typeof n===o?this.forEach(function(e,t){n(e,t)&&(r=t)}):(i=i||System.Collections.Generic.EqualityComparer$1.$default,this.forEach(function(e,t){i.equals2(e,n)&&(r=t)})),r},g.prototype.asEnumerable=function(){return g.from(this)},g.prototype.ToArray=function(e){var t=System.Array.init([],e||System.Object);return this.forEach(function(e){t.push(e)}),t},g.prototype.toList=function(e){var t=[];return this.forEach(function(e){t.push(e)}),new(System.Collections.Generic.List$1(e||System.Object).$ctor1)(t)},g.prototype.toLookup=function(i,r,e){i=f.createLambda(i),r=f.createLambda(r);var s,o=new(System.Collections.Generic.Dictionary$2(System.Object,System.Object).$ctor3)(e),a=[];return this.forEach(function(e){var t=i(e),n=r(e),e={v:null};null==t?(s||(s=[],a.push(t)),s.push(n)):o.tryGetValue(t,e)?e.v.push(n):(a.push(t),o.add(t,[n]))}),new n(o,a,s)},g.prototype.toObject=function(t,n){t=f.createLambda(t),n=f.createLambda(n);var i={};return this.forEach(function(e){i[t(e)]=n(e)}),i},g.prototype.toDictionary=function(t,n,e,i,r){t=f.createLambda(t),n=f.createLambda(n);var s=new(System.Collections.Generic.Dictionary$2(e,i).$ctor3)(r);return this.forEach(function(e){s.add(t(e),n(e))}),s},g.prototype.toJSONString=function(e,t){if(typeof JSON===i||null==JSON.stringify)throw new Error("toJSONString can't find JSON.stringify. This works native JSON support Browser or include json2.js");return JSON.stringify(this.ToArray(),e,t)},g.prototype.toJoinedString=function(e,t){return null==e&&(e=""),null==t&&(t=y.Identity),this.select(t).ToArray().join(e)},g.prototype.doAction=function(n){var i=this;return n=f.createLambda(n),new g(function(){var e,t=0;return new m(function(){e=i.GetEnumerator()},function(){return!!e.moveNext()&&(n(e.Current,t++),this.yieldReturn(e.Current))},function(){f.Dispose(e)})})},g.prototype.forEach=function(e){e=f.createLambda(e);var t=0,n=this.GetEnumerator();try{for(;n.moveNext()&&!1!==e(n.Current,t++););}finally{f.Dispose(n)}},g.prototype.write=function(t,n){null==t&&(t=""),n=f.createLambda(n);var i=!0;this.forEach(function(e){i?i=!1:document.write(t),document.write(n(e))})},g.prototype.writeLine=function(t){t=f.createLambda(t),this.forEach(function(e){document.writeln(t(e)+"<br />")})},g.prototype.force=function(){var e=this.GetEnumerator();try{for(;e.moveNext(););}finally{f.Dispose(e)}},g.prototype.letBind=function(t){t=f.createLambda(t);var n=this;return new g(function(){var e;return new m(function(){e=g.from(t(n)).GetEnumerator()},function(){return!!e.moveNext()&&this.yieldReturn(e.Current)},function(){f.Dispose(e)})})},g.prototype.share=function(){var e,t=this,n=!1;return new I(function(){return new m(function(){null==e&&(e=t.GetEnumerator())},function(){if(n)throw new Error("enumerator is disposed");return!!e.moveNext()&&this.yieldReturn(e.Current)},y.Blank)},function(){n=!0,f.Dispose(e)})},g.prototype.memoize=function(){var t,n,i=this,r=!1;return new I(function(){var e=-1;return new m(function(){null==n&&(n=i.GetEnumerator(),t=[])},function(){if(r)throw new Error("enumerator is disposed");return e++,t.length<=e?!!n.moveNext()&&this.yieldReturn(t[e]=n.Current):this.yieldReturn(t[e])},y.Blank)},function(){r=!0,f.Dispose(n),t=null})},g.prototype.catchError=function(t){t=f.createLambda(t);var n=this;return new g(function(){var e;return new m(function(){e=n.GetEnumerator()},function(){try{return!!e.moveNext()&&this.yieldReturn(e.Current)}catch(e){return t(e),!1}},function(){f.Dispose(e)})})},g.prototype.finallyAction=function(t){t=f.createLambda(t);var n=this;return new g(function(){var e;return new m(function(){e=n.GetEnumerator()},function(){return!!e.moveNext()&&this.yieldReturn(e.Current)},function(){try{f.Dispose(e)}finally{t()}})})},g.prototype.log=function(t){return t=f.createLambda(t),this.doAction(function(e){typeof console!==i&&console.log(t(e))})},g.prototype.trace=function(t,n){return null==t&&(t="Trace"),n=f.createLambda(n),this.doAction(function(e){typeof console!==i&&console.log(t,n(e))})};var p={compare:function(e,t){if(!Bridge.hasValue(e))return Bridge.hasValue(t)?-1:0;if(!Bridge.hasValue(t))return 1;if("string"==typeof e&&"string"==typeof t){var n=System.String.compare(e,t,!0);if(0!==n)return n}return Bridge.compare(e,t)}},$=function(e,t,n,i,r){this.source=e,this.keySelector=f.createLambda(t),this.comparer=n||p,this.descending=i,this.parent=r};$.prototype=new g,$.prototype.constructor=$,Bridge.definei("System.Linq.IOrderedEnumerable$1"),$.$$inherits=[],Bridge.Class.addExtend($,[System.Collections.IEnumerable,System.Linq.IOrderedEnumerable$1]),$.prototype.createOrderedEnumerable=function(e,t,n){return new $(this.source,e,t,n,this)},$.prototype.thenBy=function(e,t){return this.createOrderedEnumerable(e,t,!1)},$.prototype.thenByDescending=function(e,t){return this.createOrderedEnumerable(e,t,!0)},$.prototype.GetEnumerator=function(){var i,r,e=this,t=0;return new m(function(){i=[],r=[],e.source.forEach(function(e,t){i.push(e),r.push(t)});var n=C.create(e,null);n.GenerateKeys(i),r.sort(function(e,t){return n.compare(e,t)})},function(){return t<r.length&&this.yieldReturn(i[r[t++]])},y.Blank)};var C=function(e,t,n,i){this.keySelector=e,this.comparer=t,this.descending=n,this.child=i,this.keys=null};C.create=function(e,t){t=new C(e.keySelector,e.comparer,e.descending,t);return null!=e.parent?C.create(e.parent,t):t},C.prototype.GenerateKeys=function(e){for(var t=e.length,n=this.keySelector,i=new Array(t),r=0;r<t;r++)i[r]=n(e[r]);this.keys=i,null!=this.child&&this.child.GenerateKeys(e)},C.prototype.compare=function(e,t){var n=this.comparer.compare(this.keys[e],this.keys[t]);return 0==n?(null!=this.child?this.child:f).compare(e,t):this.descending?-n:n};var I=function(e,t){this.Dispose=t,g.call(this,e)};I.prototype=new g;var E=function(e){this.getSource=function(){return e}};E.prototype=new g,E.prototype.any=function(e){return null==e?0<this.getSource().length:g.prototype.any.apply(this,arguments)},E.prototype.count=function(e){return null==e?this.getSource().length:g.prototype.count.apply(this,arguments)},E.prototype.elementAt=function(e){var t=this.getSource();return 0<=e&&e<t.length?t[e]:g.prototype.elementAt.apply(this,arguments)},E.prototype.elementAtOrDefault=function(e,t){t===c&&(t=null);var n=this.getSource();return 0<=e&&e<n.length?n[e]:t},E.prototype.first=function(e){var t=this.getSource();return null==e&&0<t.length?t[0]:g.prototype.first.apply(this,arguments)},E.prototype.firstOrDefault=function(e,t){if(t===c&&(t=null),null!=e)return g.prototype.firstOrDefault.apply(this,arguments);e=this.getSource();return 0<e.length?e[0]:t},E.prototype.last=function(e){var t=this.getSource();return null==e&&0<t.length?t[t.length-1]:g.prototype.last.apply(this,arguments)},E.prototype.lastOrDefault=function(e,t){if(t===c&&(t=null),null!=e)return g.prototype.lastOrDefault.apply(this,arguments);e=this.getSource();return 0<e.length?e[e.length-1]:t},E.prototype.skip=function(t){var n=this.getSource();return new g(function(){var e;return new m(function(){e=t<0?0:t},function(){return e<n.length&&this.yieldReturn(n[e++])},y.Blank)})},E.prototype.takeExceptLast=function(e){return null==e&&(e=1),this.take(this.getSource().length-e)},E.prototype.takeFromLast=function(e){return this.skip(this.getSource().length-e)},E.prototype.reverse=function(){var t=this.getSource();return new g(function(){var e;return new m(function(){e=t.length},function(){return 0<e&&this.yieldReturn(t[--e])},y.Blank)})},E.prototype.sequenceEqual=function(e,t){return(!(e instanceof E||e instanceof Array)||null!=t||g.from(e).count()==this.count())&&g.prototype.sequenceEqual.apply(this,arguments)},E.prototype.toJoinedString=function(e,t){var n=this.getSource();return null==t&&n instanceof Array?(null==e&&(e=""),n.join(e)):g.prototype.toJoinedString.apply(this,arguments)},E.prototype.GetEnumerator=function(){return new Bridge.ArrayEnumerator(this.getSource())};var x=function(e,t){this.prevSource=e,this.prevPredicate=t};x.prototype=new g,x.prototype.where=function(t){if((t=f.createLambda(t)).length<=1){var n=this.prevPredicate;return new x(this.prevSource,function(e){return n(e)&&t(e)})}return g.prototype.where.call(this,t)},x.prototype.select=function(e){return(e=f.createLambda(e)).length<=1?new A(this.prevSource,this.prevPredicate,e):g.prototype.select.call(this,e)},x.prototype.GetEnumerator=function(){var e,t=this.prevPredicate,n=this.prevSource;return new m(function(){e=n.GetEnumerator()},function(){for(;e.moveNext();)if(t(e.Current))return this.yieldReturn(e.Current);return!1},function(){f.Dispose(e)})};var A=function(e,t,n){this.prevSource=e,this.prevPredicate=t,this.prevSelector=n};A.prototype=new g,A.prototype.where=function(e){return(e=f.createLambda(e)).length<=1?new x(this,e):g.prototype.where.call(this,e)},A.prototype.select=function(t){if((t=f.createLambda(t)).length<=1){var n=this.prevSelector;return new A(this.prevSource,this.prevPredicate,function(e){return t(n(e))})}return g.prototype.select.call(this,t)},A.prototype.GetEnumerator=function(){var e,t=this.prevPredicate,n=this.prevSelector,i=this.prevSource;return new m(function(){e=i.GetEnumerator()},function(){for(;e.moveNext();)if(null==t||t(e.Current))return this.yieldReturn(n(e.Current));return!1},function(){f.Dispose(e)})};var n=function(n,e,i){this.count=function(){return n.Count},this.get=function(e){if(null==e)return g.from(i||[]);var t={v:null},e=n.tryGetValue(e,t);return g.from(e?t.v:[])},this.contains=function(e){return null==e?!!i:n.containsKey(e)},this.toEnumerable=function(){return g.from(e).select(function(e){return new B(e,null==e?i:n.getItem(e))})},this.GetEnumerator=function(){return this.toEnumerable().GetEnumerator()}};Bridge.definei("System.Linq.ILookup$2"),n.$$inherits=[],Bridge.Class.addExtend(n,[System.Collections.IEnumerable,System.Linq.ILookup$2]);var B=function(e,t){this.key=function(){return e},E.call(this,t)};B.prototype=new E,Bridge.definei("System.Linq.IGrouping$2"),(B.prototype.constructor=B).$$inherits=[],Bridge.Class.addExtend(B,[System.Collections.IEnumerable,System.Linq.IGrouping$2]),Bridge.Linq={},Bridge.Linq.Enumerable=g,System.Linq=System.Linq||{},System.Linq.Enumerable=g,System.Linq.Grouping$2=B,System.Linq.Lookup$2=n,System.Linq.OrderedEnumerable$1=$}(void Bridge.global),Bridge.define("System.Runtime.Serialization.CollectionDataContractAttribute",{inherits:[System.Attribute],fields:{_name:null,_ns:null,_itemName:null,_keyName:null,_valueName:null,_isReference:!1,_isNameSetExplicitly:!1,_isNamespaceSetExplicitly:!1,_isReferenceSetExplicitly:!1,_isItemNameSetExplicitly:!1,_isKeyNameSetExplicitly:!1,_isValueNameSetExplicitly:!1},props:{Namespace:{get:function(){return this._ns},set:function(e){this._ns=e,this._isNamespaceSetExplicitly=!0}},IsNamespaceSetExplicitly:{get:function(){return this._isNamespaceSetExplicitly}},Name:{get:function(){return this._name},set:function(e){this._name=e,this._isNameSetExplicitly=!0}},IsNameSetExplicitly:{get:function(){return this._isNameSetExplicitly}},ItemName:{get:function(){return this._itemName},set:function(e){this._itemName=e,this._isItemNameSetExplicitly=!0}},IsItemNameSetExplicitly:{get:function(){return this._isItemNameSetExplicitly}},KeyName:{get:function(){return this._keyName},set:function(e){this._keyName=e,this._isKeyNameSetExplicitly=!0}},IsReference:{get:function(){return this._isReference},set:function(e){this._isReference=e,this._isReferenceSetExplicitly=!0}},IsReferenceSetExplicitly:{get:function(){return this._isReferenceSetExplicitly}},IsKeyNameSetExplicitly:{get:function(){return this._isKeyNameSetExplicitly}},ValueName:{get:function(){return this._valueName},set:function(e){this._valueName=e,this._isValueNameSetExplicitly=!0}},IsValueNameSetExplicitly:{get:function(){return this._isValueNameSetExplicitly}}},ctors:{ctor:function(){this.$initialize(),System.Attribute.ctor.call(this)}}}),Bridge.define("System.Runtime.Serialization.ContractNamespaceAttribute",{inherits:[System.Attribute],fields:{_clrNamespace:null,_contractNamespace:null},props:{ClrNamespace:{get:function(){return this._clrNamespace},set:function(e){this._clrNamespace=e}},ContractNamespace:{get:function(){return this._contractNamespace}}},ctors:{ctor:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._contractNamespace=e}}}),Bridge.define("System.Runtime.Serialization.DataContractAttribute",{inherits:[System.Attribute],fields:{_name:null,_ns:null,_isNameSetExplicitly:!1,_isNamespaceSetExplicitly:!1,_isReference:!1,_isReferenceSetExplicitly:!1},props:{IsReference:{get:function(){return this._isReference},set:function(e){this._isReference=e,this._isReferenceSetExplicitly=!0}},IsReferenceSetExplicitly:{get:function(){return this._isReferenceSetExplicitly}},Namespace:{get:function(){return this._ns},set:function(e){this._ns=e,this._isNamespaceSetExplicitly=!0}},IsNamespaceSetExplicitly:{get:function(){return this._isNamespaceSetExplicitly}},Name:{get:function(){return this._name},set:function(e){this._name=e,this._isNameSetExplicitly=!0}},IsNameSetExplicitly:{get:function(){return this._isNameSetExplicitly}}},ctors:{ctor:function(){this.$initialize(),System.Attribute.ctor.call(this)}}}),Bridge.define("System.Runtime.Serialization.DataMemberAttribute",{inherits:[System.Attribute],fields:{_name:null,_isNameSetExplicitly:!1,_order:0,_isRequired:!1,_emitDefaultValue:!1},props:{Name:{get:function(){return this._name},set:function(e){this._name=e,this._isNameSetExplicitly=!0}},IsNameSetExplicitly:{get:function(){return this._isNameSetExplicitly}},Order:{get:function(){return this._order},set:function(e){if(e<0)throw new System.Runtime.Serialization.InvalidDataContractException.$ctor1("Property 'Order' in DataMemberAttribute attribute cannot be a negative number.");this._order=e}},IsRequired:{get:function(){return this._isRequired},set:function(e){this._isRequired=e}},EmitDefaultValue:{get:function(){return this._emitDefaultValue},set:function(e){this._emitDefaultValue=e}}},ctors:{init:function(){this._order=-1,this._emitDefaultValue=!0},ctor:function(){this.$initialize(),System.Attribute.ctor.call(this)}}}),Bridge.define("System.Runtime.Serialization.EnumMemberAttribute",{inherits:[System.Attribute],fields:{_value:null,_isValueSetExplicitly:!1},props:{Value:{get:function(){return this._value},set:function(e){this._value=e,this._isValueSetExplicitly=!0}},IsValueSetExplicitly:{get:function(){return this._isValueSetExplicitly}}},ctors:{ctor:function(){this.$initialize(),System.Attribute.ctor.call(this)}}}),Bridge.define("System.Runtime.Serialization.IDeserializationCallback",{$kind:"interface"}),Bridge.define("System.Runtime.Serialization.IFormatterConverter",{$kind:"interface"}),Bridge.define("System.Runtime.Serialization.IgnoreDataMemberAttribute",{inherits:[System.Attribute],ctors:{ctor:function(){this.$initialize(),System.Attribute.ctor.call(this)}}}),Bridge.define("System.Runtime.Serialization.InvalidDataContractException",{inherits:[System.Exception],ctors:{ctor:function(){this.$initialize(),System.Exception.ctor.call(this)},$ctor1:function(e){this.$initialize(),System.Exception.ctor.call(this,e)},$ctor2:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e,t)}}}),Bridge.define("System.Runtime.Serialization.IObjectReference",{$kind:"interface"}),Bridge.define("System.Runtime.Serialization.ISafeSerializationData",{$kind:"interface"}),Bridge.define("System.Runtime.Serialization.ISerializable",{$kind:"interface"}),Bridge.define("System.Runtime.Serialization.ISerializationSurrogateProvider",{$kind:"interface"}),Bridge.define("System.Runtime.Serialization.KnownTypeAttribute",{inherits:[System.Attribute],fields:{_methodName:null,_type:null},props:{MethodName:{get:function(){return this._methodName}},Type:{get:function(){return this._type}}},ctors:{ctor:function(){this.$initialize(),System.Attribute.ctor.call(this)},$ctor2:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._type=e},$ctor1:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._methodName=e}}}),Bridge.define("System.Runtime.Serialization.SerializationEntry",{$kind:"struct",statics:{methods:{getDefaultValue:function(){return new System.Runtime.Serialization.SerializationEntry}}},fields:{_name:null,_value:null,_type:null},props:{Value:{get:function(){return this._value}},Name:{get:function(){return this._name}},ObjectType:{get:function(){return this._type}}},ctors:{$ctor1:function(e,t,n){this.$initialize(),this._name=e,this._value=t,this._type=n},ctor:function(){this.$initialize()}},methods:{getHashCode:function(){return Bridge.addHash([7645431029,this._name,this._value,this._type])},equals:function(e){return!!Bridge.is(e,System.Runtime.Serialization.SerializationEntry)&&(Bridge.equals(this._name,e._name)&&Bridge.equals(this._value,e._value)&&Bridge.equals(this._type,e._type))},$clone:function(e){e=e||new System.Runtime.Serialization.SerializationEntry;return e._name=this._name,e._value=this._value,e._type=this._type,e}}}),Bridge.define("System.Runtime.Serialization.SerializationException",{inherits:[System.SystemException],statics:{fields:{s_nullMessage:null},ctors:{init:function(){this.s_nullMessage="Serialization error."}}},ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,System.Runtime.Serialization.SerializationException.s_nullMessage),this.HResult=-2146233076},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233076},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233076}}}),Bridge.define("System.Runtime.Serialization.SerializationInfoEnumerator",{inherits:[System.Collections.IEnumerator],fields:{_members:null,_data:null,_types:null,_numItems:0,_currItem:0,_current:!1},props:{System$Collections$IEnumerator$Current:{get:function(){return this.Current.$clone()}},Current:{get:function(){if(!1===this._current)throw new System.InvalidOperationException.$ctor1("Enumeration has either not started or has already finished.");return new System.Runtime.Serialization.SerializationEntry.$ctor1(this._members[System.Array.index(this._currItem,this._members)],this._data[System.Array.index(this._currItem,this._data)],this._types[System.Array.index(this._currItem,this._types)])}},Name:{get:function(){if(!1===this._current)throw new System.InvalidOperationException.$ctor1("Enumeration has either not started or has already finished.");return this._members[System.Array.index(this._currItem,this._members)]}},Value:{get:function(){if(!1===this._current)throw new System.InvalidOperationException.$ctor1("Enumeration has either not started or has already finished.");return this._data[System.Array.index(this._currItem,this._data)]}},ObjectType:{get:function(){if(!1===this._current)throw new System.InvalidOperationException.$ctor1("Enumeration has either not started or has already finished.");return this._types[System.Array.index(this._currItem,this._types)]}}},alias:["moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset"],ctors:{ctor:function(e,t,n,i){this.$initialize(),this._members=e,this._data=t,this._types=n,this._numItems=i-1|0,this._currItem=-1,this._current=!1}},methods:{moveNext:function(){return this._currItem<this._numItems?(this._currItem=this._currItem+1|0,this._current=!0):this._current=!1,this._current},reset:function(){this._currItem=-1,this._current=!1}}}),Bridge.define("System.Runtime.Serialization.StreamingContext",{$kind:"struct",statics:{methods:{getDefaultValue:function(){return new System.Runtime.Serialization.StreamingContext}}},fields:{_additionalContext:null,_state:0},props:{State:{get:function(){return this._state}},Context:{get:function(){return this._additionalContext}}},ctors:{$ctor1:function(e){System.Runtime.Serialization.StreamingContext.$ctor2.call(this,e,null)},$ctor2:function(e,t){this.$initialize(),this._state=e,this._additionalContext=t},ctor:function(){this.$initialize()}},methods:{equals:function(e){if(!Bridge.is(e,System.Runtime.Serialization.StreamingContext))return!1;e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.Runtime.Serialization.StreamingContext),System.Runtime.Serialization.StreamingContext));return Bridge.referenceEquals(e._additionalContext,this._additionalContext)&&e._state===this._state},getHashCode:function(){return this._state},$clone:function(e){e=e||new System.Runtime.Serialization.StreamingContext;return e._additionalContext=this._additionalContext,e._state=this._state,e}}}),Bridge.define("System.Runtime.Serialization.StreamingContextStates",{$kind:"enum",statics:{fields:{CrossProcess:1,CrossMachine:2,File:4,Persistence:8,Remoting:16,Other:32,Clone:64,CrossAppDomain:128,All:255}},$flags:!0}),Bridge.define("System.Runtime.Serialization.OnSerializingAttribute",{inherits:[System.Attribute]}),Bridge.define("System.Runtime.Serialization.OnSerializedAttribute",{inherits:[System.Attribute]}),Bridge.define("System.Runtime.Serialization.OnDeserializingAttribute",{inherits:[System.Attribute]}),Bridge.define("System.Runtime.Serialization.OnDeserializedAttribute",{inherits:[System.Attribute]}),Bridge.define("System.Security.SecurityException",{inherits:[System.SystemException],statics:{fields:{DemandedName:null,GrantedSetName:null,RefusedSetName:null,DeniedName:null,PermitOnlyName:null,UrlName:null},ctors:{init:function(){this.DemandedName="Demanded",this.GrantedSetName="GrantedSet",this.RefusedSetName="RefusedSet",this.DeniedName="Denied",this.PermitOnlyName="PermitOnly",this.UrlName="Url"}}},props:{Demanded:null,DenySetInstance:null,GrantedSet:null,Method:null,PermissionState:null,PermissionType:null,PermitOnlySetInstance:null,RefusedSet:null,Url:null},ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Security error."),this.HResult=-2146233078},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233078},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233078},$ctor3:function(e,t){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233078,this.PermissionType=t},$ctor4:function(e,t,n){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233078,this.PermissionType=t,this.PermissionState=n}},methods:{toString:function(){return Bridge.toString(this)}}}),Bridge.define("System.UnauthorizedAccessException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Attempted to perform an unauthorized operation."),this.HResult=-2147024891},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2147024891},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2147024891}}}),Bridge.define("System.UnhandledExceptionEventArgs",{fields:{_exception:null,_isTerminating:!1},props:{ExceptionObject:{get:function(){return this._exception}},IsTerminating:{get:function(){return this._isTerminating}}},ctors:{ctor:function(e,t){this.$initialize(),System.Object.call(this),this._exception=e,this._isTerminating=t}}}),Bridge.define("System.Text.RegularExpressions.Regex",{statics:{_cacheSize:15,_defaultMatchTimeout:System.TimeSpan.fromMilliseconds(-1),getCacheSize:function(){return System.Text.RegularExpressions.Regex._cacheSize},setCacheSize:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("value");System.Text.RegularExpressions.Regex._cacheSize=e},escape:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("str");return System.Text.RegularExpressions.RegexParser.escape(e)},unescape:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("str");return System.Text.RegularExpressions.RegexParser.unescape(e)},isMatch:function(e,t,n,i){var r=System.Text.RegularExpressions;return Bridge.isDefined(n)||(n=r.RegexOptions.None),Bridge.isDefined(i)||(i=r.Regex._defaultMatchTimeout),new System.Text.RegularExpressions.Regex.ctor(t,n,i,!0).isMatch(e)},match:function(e,t,n,i){var r=System.Text.RegularExpressions;return Bridge.isDefined(n)||(n=r.RegexOptions.None),Bridge.isDefined(i)||(i=r.Regex._defaultMatchTimeout),new System.Text.RegularExpressions.Regex.ctor(t,n,i,!0).match(e)},matches:function(e,t,n,i){var r=System.Text.RegularExpressions;return Bridge.isDefined(n)||(n=r.RegexOptions.None),Bridge.isDefined(i)||(i=r.Regex._defaultMatchTimeout),new System.Text.RegularExpressions.Regex.ctor(t,n,i,!0).matches(e)},replace:function(e,t,n,i,r){var s=System.Text.RegularExpressions;return Bridge.isDefined(i)||(i=s.RegexOptions.None),Bridge.isDefined(r)||(r=s.Regex._defaultMatchTimeout),new System.Text.RegularExpressions.Regex.ctor(t,i,r,!0).replace(e,n)},split:function(e,t,n,i){var r=System.Text.RegularExpressions;return Bridge.isDefined(n)||(n=r.RegexOptions.None),Bridge.isDefined(i)||(i=r.Regex._defaultMatchTimeout),new System.Text.RegularExpressions.Regex.ctor(t,n,i,!0).split(e)}},_pattern:"",_matchTimeout:System.TimeSpan.fromMilliseconds(-1),_runner:null,_caps:null,_capsize:0,_capnames:null,_capslist:null,config:{init:function(){this._options=System.Text.RegularExpressions.RegexOptions.None}},ctor:function(e,t,n,i){this.$initialize(),Bridge.isDefined(t)||(t=System.Text.RegularExpressions.RegexOptions.None),Bridge.isDefined(n)||(n=System.TimeSpan.fromMilliseconds(-1)),Bridge.isDefined(i)||(i=!1);var r=System.Text.RegularExpressions;if(null==e)throw new System.ArgumentNullException.$ctor1("pattern");if(t<r.RegexOptions.None||t>>10!=0)throw new System.ArgumentOutOfRangeException.$ctor1("options");if(0!=(t&r.RegexOptions.ECMAScript)&&0!=(t&~(r.RegexOptions.ECMAScript|r.RegexOptions.IgnoreCase|r.RegexOptions.Multiline|r.RegexOptions.CultureInvariant)))throw new System.ArgumentOutOfRangeException.$ctor1("options");i=System.Text.RegularExpressions.RegexOptions.IgnoreCase|System.Text.RegularExpressions.RegexOptions.Multiline|System.Text.RegularExpressions.RegexOptions.Singleline|System.Text.RegularExpressions.RegexOptions.IgnorePatternWhitespace|System.Text.RegularExpressions.RegexOptions.ExplicitCapture;if((t|i)!=i)throw new System.NotSupportedException.$ctor1("Specified Regex options are not supported.");this._validateMatchTimeout(n),this._pattern=e,this._options=t,this._matchTimeout=n,this._runner=new r.RegexRunner(this);r=this._runner.parsePattern();this._capnames=r.sparseSettings.sparseSlotNameMap,this._capslist=r.sparseSettings.sparseSlotNameMap.keys,this._capsize=this._capslist.length},getMatchTimeout:function(){return this._matchTimeout},getOptions:function(){return this._options},getRightToLeft:function(){return 0!=(this._options&System.Text.RegularExpressions.RegexOptions.RightToLeft)},isMatch:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("input");return Bridge.isDefined(t)||(t=this.getRightToLeft()?e.length:0),null==this._runner.run(!0,-1,e,0,e.length,t)},match:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("input");var i=e.length,r=0;return 3===arguments.length?(r=t,i=n,t=this.getRightToLeft()?r+i:r):Bridge.isDefined(t)||(t=this.getRightToLeft()?i:0),this._runner.run(!1,-1,e,r,i,t)},matches:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("input");return Bridge.isDefined(t)||(t=this.getRightToLeft()?e.length:0),new System.Text.RegularExpressions.MatchCollection(this,e,0,e.length,t)},getGroupNames:function(){if(null!=this._capslist)return this._capslist.slice();for(var e=System.Globalization.CultureInfo.invariantCulture,t=[],n=this._capsize,i=0;i<n;i++)t[i]=System.Convert.toString(i,e,System.Convert.typeCodes.Int32);return t},getGroupNumbers:function(){var e,t,n,i,r=this._caps;if(null==r)for(e=[],n=this._capsize,i=0;i<n;i++)e.push(i);else for(t in e=[],r)r.hasOwnProperty(t)&&(e[r[t]]=t);return e},groupNameFromNumber:function(e){if(null==this._capslist){if(0<=e&&e<this._capsize){var t=System.Globalization.CultureInfo.invariantCulture;return System.Convert.toString(e,t,System.Convert.typeCodes.Int32)}return""}if(null==this._caps)return 0<=e&&e<this._capslist.length?this._capslist[e]:"";e=this._caps[e];return null==e?"":parseInt(e)},groupNumberFromName:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("name");if(null!=this._capnames){var t=this._capnames[e];return null==t?-1:parseInt(t)}for(var n,i=0,r=0;r<e.Length;r++){if("9"<(n=e[r])||n<"0")return-1;i*=10,i+=n-"0"}return 0<=i&&i<this._capsize?i:-1},replace:function(e,t,n,i){if(null==e)throw new System.ArgumentNullException.$ctor1("input");if(Bridge.isDefined(n)||(n=-1),Bridge.isDefined(i)||(i=this.getRightToLeft()?e.length:0),null==t)throw new System.ArgumentNullException.$ctor1("evaluator");return Bridge.isFunction(t)?System.Text.RegularExpressions.RegexReplacement.replace(t,this,e,n,i):System.Text.RegularExpressions.RegexParser.parseReplacement(t,this._caps,this._capsize,this._capnames,this._options).replace(this,e,n,i)},split:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("input");return Bridge.isDefined(t)||(t=0),Bridge.isDefined(n)||(n=this.getRightToLeft()?e.length:0),System.Text.RegularExpressions.RegexReplacement.split(this,e,t,n)},_validateMatchTimeout:function(e){e=e.getTotalMilliseconds();if(-1!==e&&!(0<e&&e<=2147483646))throw new System.ArgumentOutOfRangeException.$ctor1("matchTimeout")}}),Bridge.define("System.Text.RegularExpressions.Capture",{_text:"",_index:0,_length:0,ctor:function(e,t,n){this.$initialize(),this._text=e,this._index=t,this._length=n},getIndex:function(){return this._index},getLength:function(){return this._length},getValue:function(){return this._text.substr(this._index,this._length)},toString:function(){return this.getValue()},_getOriginalString:function(){return this._text},_getLeftSubstring:function(){return this._text.slice(0,_index)},_getRightSubstring:function(){return this._text.slice(this._index+this._length,this._text.length)}}),Bridge.define("System.Text.RegularExpressions.CaptureCollection",{inherits:function(){return[System.Collections.ICollection]},config:{properties:{Count:{get:function(){return this._capcount}}},alias:["GetEnumerator","System$Collections$IEnumerable$GetEnumerator","getCount","System$Collections$ICollection$getCount","Count","System$Collections$ICollection$Count","copyTo","System$Collections$ICollection$copyTo"]},_group:null,_capcount:0,_captures:null,ctor:function(e){this.$initialize(),this._group=e,this._capcount=e._capcount},getSyncRoot:function(){return this._group},getIsSynchronized:function(){return!1},getIsReadOnly:function(){return!0},getCount:function(){return this._capcount},get:function(e){if(e===this._capcount-1&&0<=e)return this._group;if(e>=this._capcount||e<0)throw new System.ArgumentOutOfRangeException.$ctor1("i");return this._ensureCapturesInited(),this._captures[e]},copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(e.length<t+this._capcount)throw new System.IndexOutOfRangeException;for(var n,i=t,r=0;r<this._capcount;i++,r++)n=this.get(r),System.Array.set(e,n,[i])},GetEnumerator:function(){return new System.Text.RegularExpressions.CaptureEnumerator(this)},_ensureCapturesInited:function(){if(null==this._captures){var e,t=[];for(t.length=this._capcount,e=0;e<this._capcount-1;e++){var n=this._group._caps[2*e],i=this._group._caps[2*e+1];t[e]=new System.Text.RegularExpressions.Capture(this._group._text,n,i)}0<this._capcount&&(t[this._capcount-1]=this._group),this._captures=t}}}),Bridge.define("System.Text.RegularExpressions.CaptureEnumerator",{inherits:function(){return[System.Collections.IEnumerator]},config:{properties:{Current:{get:function(){return this.getCurrent()}}},alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset","Current","System$Collections$IEnumerator$Current"]},_captureColl:null,_curindex:0,ctor:function(e){this.$initialize(),this._curindex=-1,this._captureColl=e},moveNext:function(){var e=this._captureColl.getCount();return!(this._curindex>=e)&&(this._curindex++,this._curindex<e)},getCurrent:function(){return this.getCapture()},getCapture:function(){if(this._curindex<0||this._curindex>=this._captureColl.getCount())throw new System.InvalidOperationException.$ctor1("Enumeration has either not started or has already finished.");return this._captureColl.get(this._curindex)},reset:function(){this._curindex=-1}}),Bridge.define("System.Text.RegularExpressions.Group",{inherits:function(){return[System.Text.RegularExpressions.Capture]},statics:{config:{init:function(){var e=new System.Text.RegularExpressions.Group("",[],0);this.getEmpty=function(){return e}}},synchronized:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("group");var t=e.getCaptures();return 0<t.getCount()&&t.get(0),e}},_caps:null,_capcount:0,_capColl:null,ctor:function(e,t,n){this.$initialize();var i=System.Text.RegularExpressions,r=0===n?0:t[2*(n-1)],s=0===n?0:t[2*n-1];i.Capture.ctor.call(this,e,r,s),this._caps=t,this._capcount=n},getSuccess:function(){return 0!==this._capcount},getCaptures:function(){return null==this._capColl&&(this._capColl=new System.Text.RegularExpressions.CaptureCollection(this)),this._capColl}}),Bridge.define("System.Text.RegularExpressions.GroupCollection",{inherits:function(){return[System.Collections.ICollection]},config:{properties:{Count:{get:function(){return this._match._matchcount.length}}},alias:["GetEnumerator","System$Collections$IEnumerable$GetEnumerator","getCount","System$Collections$ICollection$getCount","Count","System$Collections$ICollection$Count","copyTo","System$Collections$ICollection$copyTo"]},_match:null,_captureMap:null,_groups:null,ctor:function(e,t){this.$initialize(),this._match=e,this._captureMap=t},getSyncRoot:function(){return this._match},getIsSynchronized:function(){return!1},getIsReadOnly:function(){return!0},getCount:function(){return this._match._matchcount.length},get:function(e){return this._getGroup(e)},getByName:function(e){if(null==this._match._regex)return System.Text.RegularExpressions.Group.getEmpty();e=this._match._regex.groupNumberFromName(e);return this._getGroup(e)},copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");var n,i,r,s=this.getCount();if(e.length<t+s)throw new System.IndexOutOfRangeException;for(i=t,r=0;r<s;i++,r++)n=this._getGroup(r),System.Array.set(e,n,[i])},GetEnumerator:function(){return new System.Text.RegularExpressions.GroupEnumerator(this)},_getGroup:function(e){var t;return null!=this._captureMap?null==(t=this._captureMap[e])?System.Text.RegularExpressions.Group.getEmpty():this._getGroupImpl(t):e>=this._match._matchcount.length||e<0?System.Text.RegularExpressions.Group.getEmpty():this._getGroupImpl(e)},_getGroupImpl:function(e){return 0===e?this._match:(this._ensureGroupsInited(),this._groups[e])},_ensureGroupsInited:function(){if(null==this._groups){var e,t,n,i,r=[];for(r.length=this._match._matchcount.length,0<r.length&&(r[0]=this._match),i=0;i<r.length-1;i++)e=this._match._text,t=this._match._matches[i+1],n=this._match._matchcount[i+1],r[i+1]=new System.Text.RegularExpressions.Group(e,t,n);this._groups=r}}}),Bridge.define("System.Text.RegularExpressions.GroupEnumerator",{inherits:function(){return[System.Collections.IEnumerator]},config:{properties:{Current:{get:function(){return this.getCurrent()}}},alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset","Current","System$Collections$IEnumerator$Current"]},_groupColl:null,_curindex:0,ctor:function(e){this.$initialize(),this._curindex=-1,this._groupColl=e},moveNext:function(){var e=this._groupColl.getCount();return!(this._curindex>=e)&&(this._curindex++,this._curindex<e)},getCurrent:function(){return this.getCapture()},getCapture:function(){if(this._curindex<0||this._curindex>=this._groupColl.getCount())throw new System.InvalidOperationException.$ctor1("Enumeration has either not started or has already finished.");return this._groupColl.get(this._curindex)},reset:function(){this._curindex=-1}}),Bridge.define("System.Text.RegularExpressions.Match",{inherits:function(){return[System.Text.RegularExpressions.Group]},statics:{config:{init:function(){var e=new System.Text.RegularExpressions.Match(null,1,"",0,0,0);this.getEmpty=function(){return e}}},synchronized:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("match");for(var t,n=e.getGroups(),i=n.getCount(),r=0;r<i;r++)t=n.get(r),System.Text.RegularExpressions.Group.synchronized(t);return e}},_regex:null,_matchcount:null,_matches:null,_textbeg:0,_textend:0,_textstart:0,_groupColl:null,_textpos:0,ctor:function(e,t,n,i,r,s){this.$initialize();var o,a=[0,0];for(System.Text.RegularExpressions.Group.ctor.call(this,n,a,0),this._regex=e,this._matchcount=[],this._matchcount.length=t,o=0;o<t;o++)this._matchcount[o]=0;this._matches=[],this._matches.length=t,this._matches[0]=a,this._textbeg=i,this._textend=i+r,this._textstart=s},getGroups:function(){return null==this._groupColl&&(this._groupColl=new System.Text.RegularExpressions.GroupCollection(this,null)),this._groupColl},nextMatch:function(){return null==this._regex?this:this._regex._runner.run(!1,this._length,this._text,this._textbeg,this._textend-this._textbeg,this._textpos)},result:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("replacement");if(null==this._regex)throw new System.NotSupportedException.$ctor1("Result cannot be called on a failed Match.");return System.Text.RegularExpressions.RegexParser.parseReplacement(e,this._regex._caps,this._regex._capsize,this._regex._capnames,this._regex._options).replacement(this)},_isMatched:function(e){return e<this._matchcount.length&&0<this._matchcount[e]&&-2!==this._matches[e][2*this._matchcount[e]-1]},_addMatch:function(e,t,n){null==this._matches[e]&&(this._matches[e]=new Array(2));var i=this._matchcount[e];if(2*i+2>this._matches[e].length){for(var r=this._matches[e],s=new Array(8*i),o=0;o<2*i;o++)s[o]=r[o];this._matches[e]=s}this._matches[e][2*i]=t,this._matches[e][2*i+1]=n,this._matchcount[e]=i+1},_tidy:function(e){var t=this._matches[0];this._index=t[0],this._length=t[1],this._textpos=e,this._capcount=this._matchcount[0]},_groupToStringImpl:function(e){var t=this._matchcount[e];if(0===t)return"";var n=this._matches[e],e=n[2*(t-1)],t=n[2*t-1];return this._text.slice(e,e+t)},_lastGroupToStringImpl:function(){return this._groupToStringImpl(this._matchcount.length-1)}}),Bridge.define("System.Text.RegularExpressions.MatchSparse",{inherits:function(){return[System.Text.RegularExpressions.Match]},_caps:null,ctor:function(e,t,n,i,r,s,o){this.$initialize(),System.Text.RegularExpressions.Match.ctor.call(this,e,n,i,r,s,o),this._caps=t},getGroups:function(){return null==this._groupColl&&(this._groupColl=new System.Text.RegularExpressions.GroupCollection(this,this._caps)),this._groupColl}}),Bridge.define("System.Text.RegularExpressions.MatchCollection",{inherits:function(){return[System.Collections.ICollection]},config:{properties:{Count:{get:function(){return this.getCount()}}},alias:["GetEnumerator","System$Collections$IEnumerable$GetEnumerator","getCount","System$Collections$ICollection$getCount","Count","System$Collections$ICollection$Count","copyTo","System$Collections$ICollection$copyTo"]},_regex:null,_input:null,_beginning:0,_length:0,_startat:0,_prevlen:0,_matches:null,_done:!1,ctor:function(e,t,n,i,r){if(this.$initialize(),r<0||r>t.Length)throw new System.ArgumentOutOfRangeException.$ctor1("startat");this._regex=e,this._input=t,this._beginning=n,this._length=i,this._startat=r,this._prevlen=-1,this._matches=[]},getCount:function(){return this._done||this._getMatch(2147483647),this._matches.length},getSyncRoot:function(){return this},getIsSynchronized:function(){return!1},getIsReadOnly:function(){return!0},get:function(e){e=this._getMatch(e);if(null==e)throw new System.ArgumentOutOfRangeException.$ctor1("i");return e},copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");var n,i,r,s=this.getCount();if(e.length<t+s)throw new System.IndexOutOfRangeException;for(i=t,r=0;r<s;i++,r++)n=this._getMatch(r),System.Array.set(e,n,[i])},GetEnumerator:function(){return new System.Text.RegularExpressions.MatchEnumerator(this)},_getMatch:function(e){if(e<0)return null;if(this._matches.length>e)return this._matches[e];if(this._done)return null;var t;do{if(!(t=this._regex._runner.run(!1,this._prevLen,this._input,this._beginning,this._length,this._startat)).getSuccess())return this._done=!0,null}while(this._matches.push(t),this._prevLen=t._length,this._startat=t._textpos,this._matches.length<=e);return t}}),Bridge.define("System.Text.RegularExpressions.MatchEnumerator",{inherits:function(){return[System.Collections.IEnumerator]},config:{properties:{Current:{get:function(){return this.getCurrent()}}},alias:["getCurrent","System$Collections$IEnumerator$getCurrent","moveNext","System$Collections$IEnumerator$moveNext","reset","System$Collections$IEnumerator$reset","Current","System$Collections$IEnumerator$Current"]},_matchcoll:null,_match:null,_curindex:0,_done:!1,ctor:function(e){this.$initialize(),this._matchcoll=e},moveNext:function(){return!this._done&&(this._match=this._matchcoll._getMatch(this._curindex),this._curindex++,null!=this._match||!(this._done=!0))},getCurrent:function(){if(null==this._match)throw new System.InvalidOperationException.$ctor1("Enumeration has either not started or has already finished.");return this._match},reset:function(){this._curindex=0,this._done=!1,this._match=null}}),Bridge.define("System.Text.RegularExpressions.RegexOptions",{statics:{None:0,IgnoreCase:1,Multiline:2,ExplicitCapture:4,Compiled:8,Singleline:16,IgnorePatternWhitespace:32,RightToLeft:64,ECMAScript:256,CultureInvariant:512},$kind:"enum",$flags:!0}),Bridge.define("System.Text.RegularExpressions.RegexRunner",{statics:{},_runregex:null,_netEngine:null,_runtext:"",_runtextpos:0,_runtextbeg:0,_runtextend:0,_runtextstart:0,_quick:!1,_prevlen:0,ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("regex");var t=(this._runregex=e).getOptions(),n=System.Text.RegularExpressions.RegexOptions,i=(t&n.IgnoreCase)===n.IgnoreCase,r=(t&n.Multiline)===n.Multiline,s=(t&n.Singleline)===n.Singleline,o=(t&n.IgnorePatternWhitespace)===n.IgnorePatternWhitespace,t=(t&n.ExplicitCapture)===n.ExplicitCapture,n=e._matchTimeout.getTotalMilliseconds();this._netEngine=new System.Text.RegularExpressions.RegexEngine(e._pattern,i,r,s,o,t,n)},run:function(e,t,n,i,r,s){if(s<0||s>n.Length)throw new System.ArgumentOutOfRangeException.$ctor4("start","Start index cannot be less than 0 or greater than input length.");if(r<0||r>n.Length)throw new ArgumentOutOfRangeException("length","Length cannot be less than 0 or exceed input length.");var o;if(this._runtext=n,this._runtextbeg=i,this._runtextend=i+r,this._runtextstart=s,this._quick=e,this._prevlen=t,t=this._runregex.getRightToLeft()?(o=this._runtextbeg,-1):(o=this._runtextend,1),0===this._prevlen){if(this._runtextstart===o)return System.Text.RegularExpressions.Match.getEmpty();this._runtextstart+=t}t=this._netEngine.match(this._runtext,this._runtextstart);return this._convertNetEngineResults(t)},parsePattern:function(){return this._netEngine.parsePattern()},_convertNetEngineResults:function(e){if(e.success&&this._quick)return null;if(!e.success)return System.Text.RegularExpressions.Match.getEmpty();for(var t,n,i,r,s=this.parsePattern(),o=s.sparseSettings.isSparse?new System.Text.RegularExpressions.MatchSparse(this._runregex,s.sparseSettings.sparseSlotMap,e.groups.length,this._runtext,0,this._runtext.length,this._runtextstart):new System.Text.RegularExpressions.Match(this._runregex,e.groups.length,this._runtext,0,this._runtext.length,this._runtextstart),a=0;a<e.groups.length;a++)for(i=0,null!=(t=e.groups[a]).descriptor&&(i=this._runregex.groupNumberFromName(t.descriptor.name)),r=0;r<t.captures.length;r++)n=t.captures[r],o._addMatch(i,n.capIndex,n.capLength);s=e.capIndex+e.capLength;return o._tidy(s),o}}),Bridge.define("System.Text.RegularExpressions.RegexParser",{statics:{_Q:5,_S:4,_Z:3,_X:2,_E:1,_category:[0,0,0,0,0,0,0,0,0,2,2,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,3,4,0,0,0,4,4,5,5,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,4,0,0,0],escape:function(e){for(var t,n,i,r=0;r<e.length;r++)if(System.Text.RegularExpressions.RegexParser._isMetachar(e[r])){t="",n=e[r],t+=e.slice(0,r);do{switch(t+="\\",n){case"\n":n="n";break;case"\r":n="r";break;case"\t":n="t";break;case"\f":n="f"}for(t+=n,i=++r;r<e.length&&(n=e[r],!System.Text.RegularExpressions.RegexParser._isMetachar(n));)r++}while(t+=e.slice(i,r),r<e.length);return t}return e},unescape:function(e){for(var t,n,i,r=System.Globalization.CultureInfo.invariantCulture,s=0;s<e.length;s++)if("\\"===e[s]){t="",(i=new System.Text.RegularExpressions.RegexParser(r))._setPattern(e),t+=e.slice(0,s);do{for(s++,i._textto(s),s<e.length&&(t+=i._scanCharEscape()),n=s=i._textpos();s<e.length&&"\\"!==e[s];)s++}while(t+=e.slice(n,s),s<e.length);return t}return e},parseReplacement:function(e,t,n,i,r){var s=System.Globalization.CultureInfo.getCurrentCulture(),s=new System.Text.RegularExpressions.RegexParser(s);s._options=r,s._noteCaptures(t,n,i),s._setPattern(e);s=s._scanReplacement();return new System.Text.RegularExpressions.RegexReplacement(e,s,t)},_isMetachar:function(e){e=e.charCodeAt(0);return e<="|".charCodeAt(0)&&System.Text.RegularExpressions.RegexParser._category[e]>=System.Text.RegularExpressions.RegexParser._E}},_caps:null,_capsize:0,_capnames:null,_pattern:"",_currentPos:0,_concatenation:null,_culture:null,config:{init:function(){this._options=System.Text.RegularExpressions.RegexOptions.None}},ctor:function(e){this.$initialize(),this._culture=e,this._caps={}},_noteCaptures:function(e,t,n){this._caps=e,this._capsize=t,this._capnames=n},_setPattern:function(e){null==e&&(e=""),this._pattern=e||"",this._currentPos=0},_scanReplacement:function(){var e,t;for(this._concatenation=new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Concatenate,this._options);0!==(e=this._charsRight());){for(t=this._textpos();0<e&&"$"!==this._rightChar();)this._moveRight(),e--;this._addConcatenate(t,this._textpos()-t),0<e&&"$"===this._moveRightGetChar()&&(t=this._scanDollar(),this._concatenation.addChild(t))}return this._concatenation},_addConcatenate:function(e,t){var n;0!==t&&(n=1<t?(t=this._pattern.slice(e,e+t),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Multi,this._options,t)):(n=this._pattern[e],new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,n)),this._concatenation.addChild(n))},_useOptionE:function(){return 0!=(this._options&System.Text.RegularExpressions.RegexOptions.ECMAScript)},_makeException:function(e){return new System.ArgumentException("Incorrect pattern. "+e)},_scanDollar:function(){if(0===this._charsRight())return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,"$");var e,t,n,i=this._rightChar(),r=this._textpos(),s=r;if("{"===i&&1<this._charsRight()?(e=!0,this._moveRight(),i=this._rightChar()):e=!1,"0"<=i&&i<="9"){if(!e&&this._useOptionE()){t=-1;var o=i-"0";for(this._moveRight(),this._isCaptureSlot(o)&&(t=o,s=this._textpos());0<this._charsRight()&&"0"<=(i=this._rightChar())&&i<="9";){if(n=i-"0",214748364<o||214748364===o&&7<n)throw this._makeException("Capture group is out of range.");o=10*o+n,this._moveRight(),this._isCaptureSlot(o)&&(t=o,s=this._textpos())}if(this._textto(s),0<=t)return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,t)}else if(t=this._scanDecimal(),(!e||0<this._charsRight()&&"}"===this._moveRightGetChar())&&this._isCaptureSlot(t))return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,t)}else if(e&&this._isWordChar(i)){var a=this._scanCapname();if(0<this._charsRight()&&"}"===this._moveRightGetChar()&&this._isCaptureName(a)){a=this._captureSlotFromName(a);return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,a)}}else if(!e){switch(t=1,i){case"$":return this._moveRight(),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,"$");case"&":t=0;break;case"`":t=System.Text.RegularExpressions.RegexReplacement.LeftPortion;break;case"'":t=System.Text.RegularExpressions.RegexReplacement.RightPortion;break;case"+":t=System.Text.RegularExpressions.RegexReplacement.LastGroup;break;case"_":t=System.Text.RegularExpressions.RegexReplacement.WholeString}if(1!==t)return this._moveRight(),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Ref,this._options,t)}return this._textto(r),new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.One,this._options,"$")},_scanDecimal:function(){for(var e,t,n=0;0<this._charsRight()&&!((e=this._rightChar())<"0"||"9"<e);){if(t=e-"0",this._moveRight(),214748364<n||214748364===n&&7<t)throw this._makeException("Capture group is out of range.");n*=10,n+=t}return n},_scanOctal:function(){var e,t,n=3;for(n>this._charsRight()&&(n=this._charsRight()),t=0;0<n&&(e=this._rightChar()-"0")<=7&&(this._moveRight(),t*=8,t+=e,!(this._useOptionE()&&32<=t));--n);return t&=255,String.fromCharCode(t)},_scanHex:function(e){var t,n=0;if(this._charsRight()>=e)for(;0<e&&0<=(t=this._hexDigit(this._moveRightGetChar()));--e)n*=16,n+=t;if(0<e)throw this._makeException("Insufficient hexadecimal digits.");return n},_hexDigit:function(e){var t=e.charCodeAt(0);return(e=t-"0".charCodeAt(0))<=9?e:(e=t-"a".charCodeAt(0))<=5||(e=t-"A".charCodeAt(0))<=5?e+10:-1},_scanControl:function(){if(this._charsRight()<=0)throw this._makeException("Missing control character.");var e=this._moveRightGetChar().charCodeAt(0);if(e>="a".charCodeAt(0)&&e<="z".charCodeAt(0)&&(e-="a".charCodeAt(0)-"A".charCodeAt(0)),(e-="@".charCodeAt(0))<" ".charCodeAt(0))return String.fromCharCode(e);throw this._makeException("Unrecognized control character.")},_scanCapname:function(){for(var e=this._textpos();0<this._charsRight();)if(!this._isWordChar(this._moveRightGetChar())){this._moveLeft();break}return _pattern.slice(e,this._textpos())},_scanCharEscape:function(){var e=this._moveRightGetChar();if("0"<=e&&e<="7")return this._moveLeft(),this._scanOctal();switch(e){case"x":return this._scanHex(2);case"u":return this._scanHex(4);case"a":return"";case"b":return"\b";case"e":return"";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";case"c":return this._scanControl();default:if("8"===e||"9"===e||"_"===e||!this._useOptionE()&&this._isWordChar(e))throw this._makeException("Unrecognized escape sequence \\"+e+".");return e}},_captureSlotFromName:function(e){return this._capnames[e]},_isCaptureSlot:function(e){return null!=this._caps?null!=this._caps[e]:0<=e&&e<this._capsize},_isCaptureName:function(e){return null!=this._capnames&&null!=_capnames[e]},_isWordChar:function(e){return System.Char.isLetter(e.charCodeAt(0))},_charsRight:function(){return this._pattern.length-this._currentPos},_rightChar:function(){return this._pattern[this._currentPos]},_moveRightGetChar:function(){return this._pattern[this._currentPos++]},_moveRight:function(){this._currentPos++},_textpos:function(){return this._currentPos},_textto:function(e){this._currentPos=e},_moveLeft:function(){this._currentPos--}}),Bridge.define("System.Text.RegularExpressions.RegexNode",{statics:{One:9,Multi:12,Ref:13,Empty:23,Concatenate:25},_type:0,_str:null,_children:null,_next:null,_m:0,config:{init:function(){this._options=System.Text.RegularExpressions.RegexOptions.None}},ctor:function(e,t,n){this.$initialize(),this._type=e,this._options=t,e===System.Text.RegularExpressions.RegexNode.Ref?this._m=n:this._str=n||null},addChild:function(e){null==this._children&&(this._children=[]);e=e._reduce();this._children.push(e),e._next=this},childCount:function(){return null==this._children?0:this._children.length},child:function(e){return this._children[e]},_reduce:function(){var e=this._type===System.Text.RegularExpressions.RegexNode.Concatenate?this._reduceConcatenation():this;return e},_reduceConcatenation:function(){var e,t,n,i,r,s,o=!1,a=0;if(null==this._children)return new System.Text.RegularExpressions.RegexNode(System.Text.RegularExpressions.RegexNode.Empty,this._options);for(r=i=0;i<this._children.length;i++,r++)if(t=this._children[i],r<i&&(this._children[r]=t),t._type===System.Text.RegularExpressions.RegexNode.Concatenate&&t._isRightToLeft()){for(s=0;s<t._children.length;s++)t._children[s]._next=this;this._children.splice.apply(this._children,[i+1,0].concat(t._children)),r--}else t._type===System.Text.RegularExpressions.RegexNode.Multi||t._type===System.Text.RegularExpressions.RegexNode.One?(e=t._options&(System.Text.RegularExpressions.RegexOptions.RightToLeft|System.Text.RegularExpressions.RegexOptions.IgnoreCase),o&&a===e?((n=this._children[--r])._type===System.Text.RegularExpressions.RegexNode.One&&(n._type=System.Text.RegularExpressions.RegexNode.Multi,n._str=n._str),0==(e&System.Text.RegularExpressions.RegexOptions.RightToLeft)?n._str+=t._str:n._str=t._str+n._str):(o=!0,a=e)):t._type===System.Text.RegularExpressions.RegexNode.Empty?r--:o=!1;return r<i&&this._children.splice(r,i-r),this._stripEnation(System.Text.RegularExpressions.RegexNode.Empty)},_stripEnation:function(e){switch(this.childCount()){case 0:return new Y.RegexNode(e,this._options);case 1:return this.child(0);default:return this}},_isRightToLeft:function(){return 0<(this._options&System.Text.RegularExpressions.RegexOptions.RightToLeft)}}),Bridge.define("System.Text.RegularExpressions.RegexReplacement",{statics:{replace:function(e,t,n,i,r){if(null==e)throw new System.ArgumentNullException.$ctor1("evaluator");if(i<-1)throw new System.ArgumentOutOfRangeException.$ctor4("count","Count cannot be less than -1.");if(r<0||r>n.length)throw new System.ArgumentOutOfRangeException.$ctor4("startat","Start index cannot be less than 0 or greater than input length.");if(0===i)return n;var s=t.match(n,r);if(s.getSuccess()){var o,a,u="";if(t.getRightToLeft()){for(var l,c=[],m=n.length;(o=s.getIndex())+(a=s.getLength())!==m&&c.push(n.slice(o+a,m)),m=o,c.push(e(s)),0!=--i&&(s=s.nextMatch()).getSuccess(););for(u=new StringBuilder,0<m&&(u+=u.slice(0,m)),l=c.length-1;0<=l;l--)u+=c[l]}else{for(m=0;o=s.getIndex(),a=s.getLength(),o!==m&&(u+=n.slice(m,o)),m=o+a,u+=e(s),0!=--i&&(s=s.nextMatch()).getSuccess(););m<n.length&&(u+=n.slice(m,n.length))}return u}return n},split:function(e,t,n,i){if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","Count can't be less than 0.");if(i<0||i>t.length)throw new System.ArgumentOutOfRangeException.$ctor4("startat","Start index cannot be less than 0 or greater than input length.");var r=[];if(1===n)return r.push(t),r;--n;var s,o,a,u,l,c,m=e.match(t,i);if(m.getSuccess())if(e.getRightToLeft()){for(o=t.length;;){for(a=m.getIndex(),u=m.getLength(),c=(l=m.getGroups()).getCount(),r.push(t.slice(a+u,o)),o=a,s=1;s<c;s++)m._isMatched(s)&&r.push(l.get(s).toString());if(0===--n)break;if(!(m=m.nextMatch()).getSuccess())break}r.push(t.slice(0,o)),r.reverse()}else{for(o=0;;){for(a=m.getIndex(),u=m.getLength(),c=(l=m.getGroups()).getCount(),r.push(t.slice(o,a)),o=a+u,s=1;s<c;s++)m._isMatched(s)&&r.push(l.get(s).toString());if(0===--n)break;if(!(m=m.nextMatch()).getSuccess())break}r.push(t.slice(o,t.length))}else r.push(t);return r},Specials:4,LeftPortion:-1,RightPortion:-2,LastGroup:-3,WholeString:-4},_rep:"",_strings:[],_rules:[],ctor:function(e,t,n){if(this.$initialize(),this._rep=e,t._type!==System.Text.RegularExpressions.RegexNode.Concatenate)throw new System.ArgumentException.$ctor1("Replacement error.");for(var i,r,s="",o=[],a=[],u=0;u<t.childCount();u++)switch((r=t.child(u))._type){case System.Text.RegularExpressions.RegexNode.Multi:case System.Text.RegularExpressions.RegexNode.One:s+=r._str;break;case System.Text.RegularExpressions.RegexNode.Ref:0<s.length&&(a.push(o.length),o.push(s),s=""),i=r._m,null!=n&&0<=i&&(i=n[i]),a.push(-System.Text.RegularExpressions.RegexReplacement.Specials-1-i);break;default:throw new System.ArgumentException.$ctor1("Replacement error.")}0<s.length&&(a.push(o.length),o.push(s)),this._strings=o,this._rules=a},getPattern:function(){return _rep},replacement:function(e){return this._replacementImpl("",e)},replace:function(e,t,n,i){if(n<-1)throw new System.ArgumentOutOfRangeException.$ctor4("count","Count cannot be less than -1.");if(i<0||i>t.length)throw new System.ArgumentOutOfRangeException.$ctor4("startat","Start index cannot be less than 0 or greater than input length.");if(0===n)return t;var r=e.match(t,i);if(r.getSuccess()){var s,o,a="";if(e.getRightToLeft()){for(var u,l=[],c=t.length;(s=r.getIndex())+(o=r.getLength())!==c&&l.push(t.slice(s+o,c)),c=s,this._replacementImplRTL(l,r),0!=--n&&(r=r.nextMatch()).getSuccess(););for(0<c&&(a+=a.slice(0,c)),u=l.length-1;0<=u;u--)a+=l[u]}else{for(c=0;s=r.getIndex(),o=r.getLength(),s!==c&&(a+=t.slice(c,s)),c=s+o,a=this._replacementImpl(a,r),0!=--n&&(r=r.nextMatch()).getSuccess(););c<t.length&&(a+=t.slice(c,t.length))}return a}return t},_replacementImpl:function(e,t){for(var n,i=System.Text.RegularExpressions.RegexReplacement.Specials,r=0;r<this._rules.length;r++)if(0<=(n=this._rules[r]))e+=this._strings[n];else if(n<-i)e+=t._groupToStringImpl(-i-1-n);else switch(-i-1-n){case System.Text.RegularExpressions.RegexReplacement.LeftPortion:e+=t._getLeftSubstring();break;case System.Text.RegularExpressions.RegexReplacement.RightPortion:e+=t._getRightSubstring();break;case System.Text.RegularExpressions.RegexReplacement.LastGroup:e+=t._lastGroupToStringImpl();break;case System.Text.RegularExpressions.RegexReplacement.WholeString:e+=t._getOriginalString()}return e},_replacementImplRTL:function(e,t){for(var n,i=System.Text.RegularExpressions.RegexReplacement.Specials,r=_rules.length-1;0<=r;r--)if(0<=(n=this._rules[r]))e.push(this._strings[n]);else if(n<-i)e.push(t._groupToStringImpl(-i-1-n));else switch(-i-1-n){case System.Text.RegularExpressions.RegexReplacement.LeftPortion:e.push(t._getLeftSubstring());break;case System.Text.RegularExpressions.RegexReplacement.RightPortion:e.push(t._getRightSubstring());break;case System.Text.RegularExpressions.RegexReplacement.LastGroup:e.push(t._lastGroupToStringImpl());break;case System.Text.RegularExpressions.RegexReplacement.WholeString:e.push(t._getOriginalString())}}}),Bridge.define("System.Text.RegularExpressions.RegexEngine",{_pattern:"",_patternInfo:null,_text:"",_textStart:0,_timeoutMs:-1,_timeoutTime:-1,_settings:null,_branchType:{base:0,offset:1,lazy:2,greedy:3,or:4},_branchResultKind:{ok:1,endPass:2,nextPass:3,nextBranch:4},ctor:function(e,t,n,i,r,s,o){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("pattern");this._pattern=e,this._timeoutMs=o,this._settings={ignoreCase:t,multiline:n,singleline:i,ignoreWhitespace:r,explicitCapture:s}},match:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("text");if(null!=t&&(t<0||t>e.length))throw new System.ArgumentOutOfRangeException.$ctor4("textStart","Start index cannot be less than 0 or greater than input length.");this._text=e,this._textStart=t,this._timeoutTime=0<this._timeoutMs?(new Date).getTime()+System.Convert.toInt32(this._timeoutMs+.5):-1;e=this.parsePattern();return e.shouldFail?this._getEmptyMatch():(this._checkTimeout(),this._scanAndTransformResult(t,e.tokens,!1,null))},parsePattern:function(){var e;return null==this._patternInfo&&(e=System.Text.RegularExpressions.RegexEngineParser.parsePattern(this._pattern,this._cloneSettings(this._settings)),this._patternInfo=e),this._patternInfo},_scanAndTransformResult:function(e,t,n,i){i=this._scan(e,this._text.length,t,n,i);return this._collectScanResults(i,e)},_scan:function(e,t,n,i,r){var s=this._branchResultKind,o=[];o.grCaptureCache={};var a;if(0===n.length){var u=new System.Text.RegularExpressions.RegexEngineState;return u.capIndex=e,u.txtIndex=e,u.capLength=0,u}u=i?this._branchType.base:this._branchType.offset,i=this._patternInfo.isContiguous?e:t,i=new System.Text.RegularExpressions.RegexEngineBranch(u,e,e,i);for(i.pushPass(0,n,this._cloneSettings(this._settings)),i.started=!0,i.state.txtIndex=e,o.push(i);o.length;){if(a=o[o.length-1],this._scanBranch(t,o,a)===s.ok&&(null==r||a.state.capLength===r))return a.state;this._advanceToNextBranch(o,a),this._checkTimeout()}return null},_scanBranch:function(e,t,n){var i,r,s=this._branchResultKind;if(n.mustFail)return n.mustFail=!1,s.nextBranch;for(;n.hasPass();){if(null==(i=n.peekPass()).tokens||0===i.tokens.length)r=s.endPass;else{if(this._addAlternationBranches(t,n,i)===s.nextBranch)return s.nextBranch;r=this._scanPass(e,t,n,i)}switch(r){case s.nextBranch:return r;case s.nextPass:continue;case s.endPass:case s.ok:n.popPass();break;default:throw new System.InvalidOperationException.$ctor1("Unexpected branch result.")}}return s.ok},_scanPass:function(e,t,n,i){for(var r,s,o,a=this._branchResultKind,u=i.tokens.length;i.index<u;)if(r=i.tokens[i.index],null==(s=i.probe)){if(this._addBranchBeforeProbing(t,n,i,r))return a.nextBranch;switch(o=this._scanToken(e,t,n,i,r)){case a.nextBranch:case a.nextPass:case a.endPass:return o;case a.ok:i.index++;break;default:throw new System.InvalidOperationException.$ctor1("Unexpected branch-pass result.")}}else if(s.value<s.min||s.forced){if((o=this._scanToken(e,t,n,i,r))!==a.ok)return o;s.value+=1,s.forced=!1}else this._addBranchAfterProbing(t,n,i,s),s.forced||(i.probe=null,i.index++);return a.ok},_addAlternationBranches:function(e,t,n){var i,r,s,o,a=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,u=this._branchType,l=n.tokens.length,c=this._branchResultKind;if(!n.alternationHandled&&!n.tokens.noAlternation){for(i=[-1],o=0;o<l;o++)n.tokens[o].type===a.alternation&&i.push(o);if(1<i.length){for(o=0;o<i.length;o++)(r=new System.Text.RegularExpressions.RegexEngineBranch(u.or,o,0,i.length,t.state)).isNotFailing=!0,(s=r.peekPass()).alternationHandled=!0,s.index=i[o]+1,e.splice(e.length-o,0,r);return e[e.length-i.length].isNotFailing=!1,t.mustFail=!0,n.alternationHandled=!0,c.nextBranch}n.tokens.noAlternation=!0}return c.ok},_addBranchBeforeProbing:function(e,t,n,i){i=this._tryGetTokenProbe(i);if(null==i)return!1;n=(n.probe=i).isLazy?this._branchType.lazy:this._branchType.greedy,t=new System.Text.RegularExpressions.RegexEngineBranch(n,i.value,i.min,i.max,t.state);return e.push(t),!0},_addBranchAfterProbing:function(e,t,n,i){var r,s;i.isLazy?i.value+1<=i.max&&(r=(s=t.clone()).peekPass().probe,s.value+=1,r.forced=!0,e.splice(e.length-1,0,s),t.isNotFailing=!0):i.value+1<=i.max&&((s=t.clone()).started=!0,s.peekPass().probe=null,s.peekPass().index++,e.splice(e.length-1,0,s),i.forced=!0,t.value+=1,t.isNotFailing=!0)},_tryGetTokenProbe:function(e){var t=e.qtoken;if(null==t)return null;var n,i,e=System.Text.RegularExpressions.RegexEngineParser.tokenTypes;if(t.type===e.quantifier)switch(t.value){case"*":case"*?":n=0,i=2147483647;break;case"+":case"+?":n=1,i=2147483647;break;case"?":case"??":n=0,i=1;break;default:throw new System.InvalidOperationException.$ctor1("Unexpected quantifier value.")}else if(t.type===e.quantifierN)n=t.data.n,i=t.data.n;else{if(t.type!==e.quantifierNM)return null;n=t.data.n,i=null!=t.data.m?t.data.m:2147483647}return new System.Text.RegularExpressions.RegexEngineProbe(n,i,0,t.data.isLazy)},_advanceToNextBranch:function(e,t){if(0!==e.length){var n=e[e.length-1];if(n.started){if(t!==n)throw new System.InvalidOperationException.$ctor1("Current branch is supposed to be the last one.");1===e.length&&t.type===this._branchType.offset?(t.value++,t.state.txtIndex=t.value,t.mustFail=!1,t.state.capIndex=null,t.state.capLength=0,t.state.groups.length=0,t.state.passes.length=1,t.state.passes[0].clearState(this._cloneSettings(this._settings)),t.value>t.max&&e.pop()):(e.pop(),t.isNotFailing||(n=e[e.length-1],this._advanceToNextBranch(e,n)))}else n.started=!0}},_collectScanResults:function(e,t){var n,i,r,s,o,a,u=this._patternInfo.groups,l=this._text,c={},m={},y=this._getEmptyMatch();if(null!=e){for(n=e.groups,this._fillMatch(y,e.capIndex,e.capLength,t),a=0;a<n.length;a++)(r=u[(i=n[a]).rawIndex-1]).constructs.skipCapture||(s={capIndex:i.capIndex,capLength:i.capLength,value:l.slice(i.capIndex,i.capIndex+i.capLength)},null==(o=m[r.name])?(o={capIndex:0,capLength:0,value:"",success:!1,captures:[s]},m[r.name]=o):o.captures.push(s));for(a=0;a<u.length;a++)(r=u[a]).constructs.skipCapture||!0!==c[r.name]&&(null==(o=m[r.name])?o={capIndex:0,capLength:0,value:"",success:!1,captures:[]}:0<o.captures.length&&(s=o.captures[o.captures.length-1],o.capIndex=s.capIndex,o.capLength=s.capLength,o.value=s.value,o.success=!0),c[r.name]=!0,o.descriptor=r,y.groups.push(o))}return y},_scanToken:function(e,t,n,i,r){var s=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,o=this._branchResultKind;switch(r.type){case s.group:case s.groupImnsx:case s.alternationGroup:return this._scanGroupToken(e,t,n,i,r);case s.groupImnsxMisc:return this._scanGroupImnsxToken(r.group.constructs,i.settings);case s.charGroup:return this._scanCharGroupToken(t,n,i,r,!1);case s.charNegativeGroup:return this._scanCharNegativeGroupToken(t,n,i,r,!1);case s.escChar:case s.escCharOctal:case s.escCharHex:case s.escCharUnicode:case s.escCharCtrl:return this._scanLiteral(e,t,n,i,r.data.ch);case s.escCharOther:case s.escCharClass:return this._scanEscapeToken(t,n,i,r);case s.escCharClassCategory:throw new System.NotSupportedException.$ctor1("Unicode Category constructions are not supported.");case s.escCharClassBlock:throw new System.NotSupportedException.$ctor1("Unicode Named block constructions are not supported.");case s.escCharClassDot:return this._scanDotToken(e,t,n,i);case s.escBackrefNumber:return this._scanBackrefNumberToken(e,t,n,i,r);case s.escBackrefName:return this._scanBackrefNameToken(e,t,n,i,r);case s.anchor:case s.escAnchor:return this._scanAnchorToken(e,t,n,i,r);case s.groupConstruct:case s.groupConstructName:case s.groupConstructImnsx:case s.groupConstructImnsxMisc:return o.ok;case s.alternationGroupCondition:case s.alternationGroupRefNameCondition:case s.alternationGroupRefNumberCondition:return this._scanAlternationConditionToken(e,t,n,i,r);case s.alternation:return o.endPass;case s.commentInline:case s.commentXMode:return o.ok;default:return this._scanLiteral(e,t,n,i,r.value)}},_scanGroupToken:function(e,t,n,i,r){var s=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,o=this._branchResultKind,a=n.state.txtIndex;if(i.onHold){if(r.type===s.group){var u=r.group.rawIndex,l=i.onHoldTextIndex,c=a-l,m=t.grCaptureCache[u];null==m&&(m={},t.grCaptureCache[u]=m);u=l.toString()+"_"+c.toString();if(null!=m[u])return o.nextBranch;m[u]=!0,r.group.constructs.emptyCapture||(r.group.isBalancing?n.state.logCaptureGroupBalancing(r.group,l):n.state.logCaptureGroup(r.group,l,c))}return i.onHold=!1,i.onHoldTextIndex=-1,o.ok}if(r.type===s.group||r.type===s.groupImnsx){s=r.group.constructs;if(this._scanGroupImnsxToken(s,i.settings),s.isPositiveLookahead||s.isNegativeLookahead||s.isPositiveLookbehind||s.isNegativeLookbehind)return this._scanLook(n,a,e,r);if(s.isNonbacktracking)return this._scanNonBacktracking(n,a,e,r)}return i.onHoldTextIndex=a,i.onHold=!0,n.pushPass(0,r.children,this._cloneSettings(i.settings)),o.nextPass},_scanGroupImnsxToken:function(e,t){var n=this._branchResultKind;return null!=e.isIgnoreCase&&(t.ignoreCase=e.isIgnoreCase),null!=e.isMultiline&&(t.multiline=e.isMultiline),null!=e.isSingleLine&&(t.singleline=e.isSingleLine),null!=e.isIgnoreWhitespace&&(t.ignoreWhitespace=e.isIgnoreWhitespace),null!=e.isExplicitCapture&&(t.explicitCapture=e.isExplicitCapture),n.ok},_scanAlternationConditionToken:function(e,t,n,i,r){var s=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,o=this._branchResultKind,a=r.children,u=n.state.txtIndex,l=o.nextBranch;return r.type===s.alternationGroupRefNameCondition||r.type===s.alternationGroupRefNumberCondition?l=null!=n.state.resolveBackref(r.data.packedSlotId)?o.ok:o.nextBranch:(a=this._scan(u,e,a,!0,null),this._combineScanResults(n,a)&&(l=o.ok)),l===o.nextBranch&&i.tokens.noAlternation&&(l=o.endPass),l},_scanLook:function(e,t,n,i){var r=i.group.constructs,s=this._branchResultKind,o=i.children,a=r.isPositiveLookahead||r.isNegativeLookahead,i=r.isPositiveLookbehind||r.isNegativeLookbehind;return a||i?(o=o.slice(1,o.length),(r.isPositiveLookahead||r.isPositiveLookbehind)===(a?this._scanLookAhead(e,t,n,o):this._scanLookBehind(e,t,n,o))?s.ok:s.nextBranch):null},_scanLookAhead:function(e,t,n,i){i=this._scan(t,n,i,!0,null);return this._combineScanResults(e,i)},_scanLookBehind:function(e,t,n,i){for(var r,s=t;0<=s;){if(r=t-s,r=this._scan(s,n,i,!0,r),this._combineScanResults(e,r))return!0;--s}return!1},_scanNonBacktracking:function(e,t,n,i){var r=this._branchResultKind,i=(i=i.children).slice(1,i.length),i=this._scan(t,n,i,!0,null);return i?(e.state.logCapture(i.capLength),r.ok):r.nextBranch},_scanLiteral:function(e,t,n,i,r){var s,o=this._branchResultKind,a=n.state.txtIndex;if(a+r.length>e)return o.nextBranch;if(i.settings.ignoreCase){for(s=0;s<r.length;s++)if(this._text[a+s].toLowerCase()!==r[s].toLowerCase())return o.nextBranch}else for(s=0;s<r.length;s++)if(this._text[a+s]!==r[s])return o.nextBranch;return n.state.logCapture(r.length),o.ok},_scanWithJsRegex:function(e,t,n,i,r){var s=this._branchResultKind,o=t.state.txtIndex,a=this._text[o];null==a&&(a="");o=n.settings.ignoreCase?"i":"",n=i.rgx;return null==n&&(null==r&&(r=i.value),n=new RegExp(r,o),i.rgx=n),n.test(a)?(t.state.logCapture(a.length),s.ok):s.nextBranch},_scanWithJsRegex2:function(e,t){var n=this._branchResultKind,e=this._text[e];return null==e&&(e=""),new RegExp(t,"").test(e)?n.ok:n.nextBranch},_scanCharGroupToken:function(e,t,n,i,r){var s,o,a=System.Text.RegularExpressions.RegexEngineParser.tokenTypes,u=this._branchResultKind,l=t.state.txtIndex,c=this._text[l];if(null==c)return u.nextBranch;var m,y,h,d=c.charCodeAt(0),f=i.data.ranges;if(null!=i.data.substractToken){if(i.data.substractToken.type===a.charGroup)h=this._scanCharGroupToken(e,t,n,i.data.substractToken,!0);else{if(i.data.substractToken.type!==a.charNegativeGroup)throw new System.InvalidOperationException.$ctor1("Unexpected substuct group token.");h=this._scanCharNegativeGroupToken(e,t,n,i.data.substractToken,!0)}if(h===u.ok)return i.type===a.charGroup?u.nextBranch:u.ok}if(null!=f.charClassToken&&this._scanWithJsRegex(e,t,n,f.charClassToken)===u.ok)return u.ok;for(o=0;o<2;o++){for(s=0;s<f.length&&!((m=f[s]).n>d);s++)if(d<=m.m)return r||t.state.logCapture(1),u.ok;null==y&&n.settings.ignoreCase&&(y=c.toUpperCase(),d=(c=c===y?c.toLowerCase():y).charCodeAt(0))}return u.nextBranch},_scanCharNegativeGroupToken:function(e,t,n,i,r){var s=this._branchResultKind,o=t.state.txtIndex;return null==this._text[o]||this._scanCharGroupToken(e,t,n,i,!0)===s.ok?s.nextBranch:(r||t.state.logCapture(1),s.ok)},_scanEscapeToken:function(e,t,n,i){return this._scanWithJsRegex(e,t,n,i)},_scanDotToken:function(e,t,n,i){var r=this._branchResultKind,s=n.state.txtIndex;if(i.settings.singleline){if(s<e)return n.state.logCapture(1),r.ok}else if(s<e&&"\n"!==this._text[s])return n.state.logCapture(1),r.ok;return r.nextBranch},_scanBackrefNumberToken:function(e,t,n,i,r){var s=this._branchResultKind,r=n.state.resolveBackref(r.data.slotId);if(null==r)return s.nextBranch;r=this._text.slice(r.capIndex,r.capIndex+r.capLength);return this._scanLiteral(e,t,n,i,r)},_scanBackrefNameToken:function(e,t,n,i,r){var s=this._branchResultKind,r=n.state.resolveBackref(r.data.slotId);if(null==r)return s.nextBranch;r=this._text.slice(r.capIndex,r.capIndex+r.capLength);return this._scanLiteral(e,t,n,i,r)},_scanAnchorToken:function(e,t,n,i,r){var s=this._branchResultKind,n=n.state.txtIndex;if("\\b"===r.value||"\\B"===r.value){if((0<n&&this._scanWithJsRegex2(n-1,"\\w")===s.ok)==(this._scanWithJsRegex2(n,"\\w")===s.ok)==("\\B"===r.value))return s.ok}else if("^"===r.value){if(0===n)return s.ok;if(i.settings.multiline&&"\n"===this._text[n-1])return s.ok}else if("$"===r.value){if(n===e)return s.ok;if(i.settings.multiline&&"\n"===this._text[n])return s.ok}else if("\\A"===r.value){if(0===n)return s.ok}else if("\\z"===r.value){if(n===e)return s.ok}else if("\\Z"===r.value){if(n===e)return s.ok;if(n===e-1&&"\n"===this._text[n])return s.ok}else if("\\G"===r.value)return s.ok;return s.nextBranch},_cloneSettings:function(e){return{ignoreCase:e.ignoreCase,multiline:e.multiline,singleline:e.singleline,ignoreWhitespace:e.ignoreWhitespace,explicitCapture:e.explicitCapture}},_combineScanResults:function(e,t){if(null==t)return!1;for(var n=e.state.groups,i=t.groups,r=i.length,s=0;s<r;++s)n.push(i[s]);return!0},_getEmptyMatch:function(){return{capIndex:0,capLength:0,success:!1,value:"",groups:[],captures:[]}},_fillMatch:function(e,t,n,i){null==t&&(t=i),e.capIndex=t,e.capLength=n,e.success=!0,e.value=this._text.slice(t,t+n),e.groups.push({capIndex:t,capLength:n,value:e.value,success:!0,captures:[{capIndex:t,capLength:n,value:e.value}]}),e.captures.push(e.groups[0].captures[0])},_checkTimeout:function(){if(!(this._timeoutTime<0)&&(new Date).getTime()>=this._timeoutTime)throw new System.RegexMatchTimeoutException(this._text,this._pattern,System.TimeSpan.fromMilliseconds(this._timeoutMs))}}),Bridge.define("System.Text.RegularExpressions.RegexEngineBranch",{type:0,value:0,min:0,max:0,isStarted:!1,isNotFailing:!1,state:null,ctor:function(e,t,n,i,r){this.$initialize(),this.type=e,this.value=t,this.min=n,this.max=i,this.state=null!=r?r.clone():new System.Text.RegularExpressions.RegexEngineState},pushPass:function(e,t,n){n=new System.Text.RegularExpressions.RegexEnginePass(e,t,n);this.state.passes.push(n)},peekPass:function(){return this.state.passes[this.state.passes.length-1]},popPass:function(){return this.state.passes.pop()},hasPass:function(){return 0<this.state.passes.length},clone:function(){var e=new System.Text.RegularExpressions.RegexEngineBranch(this.type,this.value,this.min,this.max,this.state);return e.isNotFailing=this.isNotFailing,e}}),Bridge.define("System.Text.RegularExpressions.RegexEngineState",{txtIndex:0,capIndex:null,capLength:0,passes:null,groups:null,ctor:function(){this.$initialize(),this.passes=[],this.groups=[]},logCapture:function(e){null==this.capIndex&&(this.capIndex=this.txtIndex),this.txtIndex+=e,this.capLength+=e},logCaptureGroup:function(e,t,n){this.groups.push({rawIndex:e.rawIndex,slotId:e.packedSlotId,capIndex:t,capLength:n})},logCaptureGroupBalancing:function(e,t){for(var n,i,r,s=e.balancingSlotId,o=this.groups,a=o.length-1;0<=a;){if(o[a].slotId===s){n=o[a],i=a;break}--a}return null!=n&&null!=i&&(o.splice(i,1),null!=e.constructs.name1&&(t=t-(r=n.capIndex+n.capLength),this.logCaptureGroup(e,r,t)),!0)},resolveBackref:function(e){for(var t=this.groups,n=t.length-1;0<=n;){if(t[n].slotId===e)return t[n];--n}return null},clone:function(){var e=new System.Text.RegularExpressions.RegexEngineState;e.txtIndex=this.txtIndex,e.capIndex=this.capIndex,e.capLength=this.capLength;for(var t,n=e.passes,i=this.passes,r=i.length,s=0;s<r;s++)t=i[s].clone(),n.push(t);var o=e.groups,a=this.groups,r=a.length;for(s=0;s<r;s++)t=a[s],o.push(t);return e}}),Bridge.define("System.Text.RegularExpressions.RegexEnginePass",{index:0,tokens:null,probe:null,onHold:!1,onHoldTextIndex:-1,alternationHandled:!1,settings:null,ctor:function(e,t,n){this.$initialize(),this.index=e,this.tokens=t,this.settings=n},clearState:function(e){this.index=0,this.probe=null,this.onHold=!1,this.onHoldTextIndex=-1,this.alternationHandled=!1,this.settings=e},clone:function(){var e=new System.Text.RegularExpressions.RegexEnginePass(this.index,this.tokens,this.settings);return e.onHold=this.onHold,e.onHoldTextIndex=this.onHoldTextIndex,e.alternationHandled=this.alternationHandled,e.probe=null!=this.probe?this.probe.clone():null,e}}),Bridge.define("System.Text.RegularExpressions.RegexEngineProbe",{min:0,max:0,value:0,isLazy:!1,forced:!1,ctor:function(e,t,n,i){this.$initialize(),this.min=e,this.max=t,this.value=n,this.isLazy=i,this.forced=!1},clone:function(){var e=new System.Text.RegularExpressions.RegexEngineProbe(this.min,this.max,this.value,this.isLazy);return e.forced=this.forced,e}}),Bridge.define("System.Text.RegularExpressions.RegexEngineParser",{statics:{_hexSymbols:"0123456789abcdefABCDEF",_octSymbols:"01234567",_decSymbols:"0123456789",_escapedChars:"abtrvfnexcu",_escapedCharClasses:"pPwWsSdD",_escapedAnchors:"AZzGbB",_escapedSpecialSymbols:" .,$^{}[]()|*+-=?\\|/\"':;~!@#%&",_whiteSpaceChars:" \r\n\t\v\f \ufeff",_unicodeCategories:["Lu","Ll","Lt","Lm","Lo","L","Mn","Mc","Me","M","Nd","Nl","No","N","Pc","Pd","Ps","Pe","Pi","Pf","Po","P","Sm","Sc","Sk","So","S","Zs","Zl","Zp","Z","Cc","Cf","Cs","Co","Cn","C"],_namedCharBlocks:["IsBasicLatin","IsLatin-1Supplement","IsLatinExtended-A","IsLatinExtended-B","IsIPAExtensions","IsSpacingModifierLetters","IsCombiningDiacriticalMarks","IsGreek","IsGreekandCoptic","IsCyrillic","IsCyrillicSupplement","IsArmenian","IsHebrew","IsArabic","IsSyriac","IsThaana","IsDevanagari","IsBengali","IsGurmukhi","IsGujarati","IsOriya","IsTamil","IsTelugu","IsKannada","IsMalayalam","IsSinhala","IsThai","IsLao","IsTibetan","IsMyanmar","IsGeorgian","IsHangulJamo","IsEthiopic","IsCherokee","IsUnifiedCanadianAboriginalSyllabics","IsOgham","IsRunic","IsTagalog","IsHanunoo","IsBuhid","IsTagbanwa","IsKhmer","IsMongolian","IsLimbu","IsTaiLe","IsKhmerSymbols","IsPhoneticExtensions","IsLatinExtendedAdditional","IsGreekExtended","IsGeneralPunctuation","IsSuperscriptsandSubscripts","IsCurrencySymbols","IsCombiningDiacriticalMarksforSymbols","IsCombiningMarksforSymbols","IsLetterlikeSymbols","IsNumberForms","IsArrows","IsMathematicalOperators","IsMiscellaneousTechnical","IsControlPictures","IsOpticalCharacterRecognition","IsEnclosedAlphanumerics","IsBoxDrawing","IsBlockElements","IsGeometricShapes","IsMiscellaneousSymbols","IsDingbats","IsMiscellaneousMathematicalSymbols-A","IsSupplementalArrows-A","IsBraillePatterns","IsSupplementalArrows-B","IsMiscellaneousMathematicalSymbols-B","IsSupplementalMathematicalOperators","IsMiscellaneousSymbolsandArrows","IsCJKRadicalsSupplement","IsKangxiRadicals","IsIdeographicDescriptionCharacters","IsCJKSymbolsandPunctuation","IsHiragana","IsKatakana","IsBopomofo","IsHangulCompatibilityJamo","IsKanbun","IsBopomofoExtended","IsKatakanaPhoneticExtensions","IsEnclosedCJKLettersandMonths","IsCJKCompatibility","IsCJKUnifiedIdeographsExtensionA","IsYijingHexagramSymbols","IsCJKUnifiedIdeographs","IsYiSyllables","IsYiRadicals","IsHangulSyllables","IsHighSurrogates","IsHighPrivateUseSurrogates","IsLowSurrogates","IsPrivateUse or IsPrivateUseArea","IsCJKCompatibilityIdeographs","IsAlphabeticPresentationForms","IsArabicPresentationForms-A","IsVariationSelectors","IsCombiningHalfMarks","IsCJKCompatibilityForms","IsSmallFormVariants","IsArabicPresentationForms-B","IsHalfwidthandFullwidthForms","IsSpecials"],_controlChars:["@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_"],tokenTypes:{literal:0,escChar:110,escCharOctal:111,escCharHex:112,escCharCtrl:113,escCharUnicode:114,escCharOther:115,escCharClass:120,escCharClassCategory:121,escCharClassBlock:122,escCharClassDot:123,escAnchor:130,escBackrefNumber:140,escBackrefName:141,charGroup:200,charNegativeGroup:201,charInterval:202,anchor:300,group:400,groupImnsx:401,groupImnsxMisc:402,groupConstruct:403,groupConstructName:404,groupConstructImnsx:405,groupConstructImnsxMisc:406,quantifier:500,quantifierN:501,quantifierNM:502,alternation:600,alternationGroup:601,alternationGroupCondition:602,alternationGroupRefNumberCondition:603,alternationGroupRefNameCondition:604,commentInline:700,commentXMode:701},parsePattern:function(e,t){var n=System.Text.RegularExpressions.RegexEngineParser,i=n._parsePatternImpl(e,t,0,e.length),r=[];n._fillGroupDescriptors(i,r);var s=n._getGroupSparseInfo(r);return n._fillBalancingGroupInfo(r,s),n._preTransformBackrefTokens(e,i,s),n._transformRawTokens(t,i,s,[],[],0),n._updateGroupDescriptors(i),{groups:r,sparseSettings:s,isContiguous:t.isContiguous||!1,shouldFail:t.shouldFail||!1,tokens:i}},_transformRawTokens:function(e,t,n,i,r,s){for(var o,a,u,l,c,m,y,h=System.Text.RegularExpressions.RegexEngineParser,d=h.tokenTypes,f=0;f<t.length;f++){if(a=t[f],f<t.length-1)switch((y=t[f+1]).type){case d.quantifier:case d.quantifierN:case d.quantifierNM:a.qtoken=y,t.splice(f+1,1),--f}if(a.type===d.escBackrefNumber){if(m=a.data.number,null==(l=n.getPackedSlotIdBySlotNumber(m)))throw new System.ArgumentException.$ctor1("Reference to undefined group number "+m.toString()+".");if(i.indexOf(l)<0){e.shouldFail=!0;continue}a.data.slotId=l}else if(a.type===d.escBackrefName){if(u=a.data.name,null==(l=n.getPackedSlotIdBySlotName(u))){if(h._matchChars(u,0,u.length,h._decSymbols).matchLength!==u.length)throw new System.ArgumentException.$ctor1("Reference to undefined group name '"+u+"'.");u="\\"+u,h._updatePatternToken(a,d.escBackrefNumber,a.index,u.length,u),--f;continue}if(i.indexOf(l)<0){e.shouldFail=!0;continue}a.data.slotId=l}else if(a.type===d.anchor||a.type===d.escAnchor){if("\\G"===a.value){0===s&&0===f?e.isContiguous=!0:e.shouldFail=!0,t.splice(f,1),--f;continue}}else{if(a.type===d.commentInline||a.type===d.commentXMode){t.splice(f,1),--f;continue}if(a.type===d.literal){if(0<f&&!a.qtoken&&(o=t[f-1]).type===d.literal&&!o.qtoken){o.value+=a.value,o.length+=a.length,t.splice(f,1),--f;continue}}else if(a.type===d.alternationGroupCondition&&null!=a.data)if(null!=a.data.number){if(null==(l=n.getPackedSlotIdBySlotNumber(a.data.number)))throw new System.ArgumentException.$ctor1("Reference to undefined group number "+u+".");a.data.packedSlotId=l,h._updatePatternToken(a,d.alternationGroupRefNumberCondition,a.index,a.length,a.value)}else null!=(l=n.getPackedSlotIdBySlotName(a.data.name))?(a.data.packedSlotId=l,h._updatePatternToken(a,d.alternationGroupRefNameCondition,a.index,a.length,a.value)):delete a.data}a.children&&a.children.length&&(c=(c=a.type===d.group?[a.group.rawIndex]:[]).concat(r),m=a.localSettings||e,h._transformRawTokens(m,a.children,n,i,c,s+1),e.shouldFail=e.shouldFail||m.shouldFail,e.isContiguous=e.isContiguous||m.isContiguous),a.type===d.group&&i.push(a.group.packedSlotId)}},_fillGroupDescriptors:function(e,t){var n;System.Text.RegularExpressions.RegexEngineParser._fillGroupStructure(t,e,null);for(var i=1,r=0;r<t.length;r++)null!=(n=t[r]).constructs.name1?(n.name=n.constructs.name1,n.hasName=!0):(n.hasName=!1,n.name=i.toString(),++i)},_fillGroupStructure:function(e,t,n){for(var i,r,s,o,a=System.Text.RegularExpressions.RegexEngineParser,u=a.tokenTypes,l=0;l<t.length;l++)o=(i=t[l]).children&&i.children.length,i.type!==u.group&&i.type!==u.groupImnsx&&i.type!==u.groupImnsxMisc||(r={rawIndex:e.length+1,number:-1,parentGroup:null,innerGroups:[],name:null,hasName:!1,constructs:null,quantifier:null,exprIndex:-1,exprLength:0,expr:null,exprFull:null},i.group=r,i.type===u.group&&(e.push(r),null!=n&&(i.group.parentGroup=n).innerGroups.push(r)),s=o?i.children[0]:null,r.constructs=a._fillGroupConstructs(s),r=r.constructs,i.isNonCapturingExplicit&&(delete i.isNonCapturingExplicit,r.isNonCapturingExplicit=!0),i.isEmptyCapturing&&(delete i.isEmptyCapturing,r.emptyCapture=!0),r.skipCapture=r.isNonCapturing||r.isNonCapturingExplicit||r.isNonbacktracking||r.isPositiveLookahead||r.isNegativeLookahead||r.isPositiveLookbehind||r.isNegativeLookbehind||null==r.name1&&null!=r.name2),o&&a._fillGroupStructure(e,i.children,i.group)},_getGroupSparseInfo:function(e){for(var t,n,i,r,s,o=System.Text.RegularExpressions.RegexEngineParser,a={},u=[],l={},c={0:0,lastSlot:0},m={0:0,keys:["0"]},y=0;y<e.length;y++)(s=e[y]).constructs.skipCapture||(s.constructs.isNumberName1?(i=parseInt(s.constructs.name1),u.push(i),a[i]?a[i].push(s):a[i]=[s]):l[r=s.constructs.name1]?l[r].push(s):l[r]=[s]);u.sort(function(e,t){return e-t});for(var h=!1,d=0;d<2;d++){for(y=0;y<e.length;y++)(s=e[y]).constructs.skipCapture||!0===s.constructs.emptyCapture===h&&(i=m.keys.length,s.hasName||(n=[s],null!=(t=a[i])&&(n=n.concat(t),a[i]=null),o._addSparseSlotForSameNamedGroups(n,i,c,m)));h=!0}for(y=0;y<e.length;y++)if(s=e[y],!s.constructs.skipCapture&&s.hasName&&!s.constructs.isNumberName1){for(t=a[i=m.keys.length];null!=t;)o._addSparseSlotForSameNamedGroups(t,i,c,m),a[i]=null,t=a[i=m.keys.length];if(!s.constructs.isNumberName1)for(t=a[i=m.keys.length];null!=t;)o._addSparseSlotForSameNamedGroups(t,i,c,m),a[i]=null,t=a[i=m.keys.length];null!=(t=l[r=s.constructs.name1])&&(o._addSparseSlotForSameNamedGroups(t,i,c,m),l[r]=null)}for(y=0;y<u.length;y++)null!=(t=a[i=u[y]])&&(o._addSparseSlotForSameNamedGroups(t,i,c,m),a[i]=null);return{isSparse:c.isSparse||!1,sparseSlotMap:c,sparseSlotNameMap:m,getPackedSlotIdBySlotNumber:function(e){return this.sparseSlotMap[e]},getPackedSlotIdBySlotName:function(e){return this.sparseSlotNameMap[e]}}},_addSparseSlot:function(e,t,n,i){var r=i.keys.length;e.packedSlotId=r,n[t]=r,i[e.name]=r,i.keys.push(e.name),!n.isSparse&&1<t-n.lastSlot&&(n.isSparse=!0),n.lastSlot=t},_addSparseSlotForSameNamedGroups:function(e,t,n,i){var r;System.Text.RegularExpressions.RegexEngineParser._addSparseSlot(e[0],t,n,i);var s=e[0].sparseSlotId,o=e[0].packedSlotId;if(1<e.length)for(r=1;r<e.length;r++)e[r].sparseSlotId=s,e[r].packedSlotId=o},_fillGroupConstructs:function(e){var t=System.Text.RegularExpressions.RegexEngineParser,n=t.tokenTypes,i={name1:null,name2:null,isNumberName1:!1,isNumberName2:!1,isNonCapturing:!1,isNonCapturingExplicit:!1,isIgnoreCase:null,isMultiline:null,isExplicitCapture:null,isSingleLine:null,isIgnoreWhitespace:null,isPositiveLookahead:!1,isNegativeLookahead:!1,isPositiveLookbehind:!1,isNegativeLookbehind:!1,isNonbacktracking:!1};if(null==e)return i;if(e.type===n.groupConstruct)switch(e.value){case"?:":i.isNonCapturing=!0;break;case"?=":i.isPositiveLookahead=!0;break;case"?!":i.isNegativeLookahead=!0;break;case"?>":i.isNonbacktracking=!0;break;case"?<=":i.isPositiveLookbehind=!0;break;case"?<!":i.isNegativeLookbehind=!0;break;default:throw new System.ArgumentException.$ctor1("Unrecognized grouping construct.")}else if(e.type===n.groupConstructName){var r,s=e.value.slice(2,e.length-1).split("-");if(0===s.length||2<s.length)throw new System.ArgumentException.$ctor1("Invalid group name.");s[0].length&&(i.name1=s[0],r=t._validateGroupName(s[0]),i.isNumberName1=r.isNumberName),2===s.length&&(i.name2=s[1],s=t._validateGroupName(s[1]),i.isNumberName2=s.isNumberName)}else if(e.type===n.groupConstructImnsx||e.type===n.groupConstructImnsxMisc)for(var o,n=e.type===n.groupConstructImnsx?1:0,a=e.length-1-n,u=!0,l=1;l<=a;l++)"-"===(o=e.value[l])?u=!1:"i"===o?i.isIgnoreCase=u:"m"===o?i.isMultiline=u:"n"===o?i.isExplicitCapture=u:"s"===o?i.isSingleLine=u:"x"===o&&(i.isIgnoreWhitespace=u);return i},_validateGroupName:function(e){if(!e||!e.length)throw new System.ArgumentException.$ctor1("Invalid group name: Group names must begin with a word character.");var t="0"<=e[0]&&e[0]<="9";if(t){var n=System.Text.RegularExpressions.RegexEngineParser;if(n._matchChars(e,0,e.length,n._decSymbols).matchLength!==e.length)throw new System.ArgumentException.$ctor1("Invalid group name: Group names must begin with a word character.")}return{isNumberName:t}},_fillBalancingGroupInfo:function(e,t){for(var n,i=0;i<e.length;i++)if(n=e[i],null!=n.constructs.name2&&(n.isBalancing=!0,n.balancingSlotId=t.getPackedSlotIdBySlotName(n.constructs.name2),null==n.balancingSlotId))throw new System.ArgumentException.$ctor1("Reference to undefined group name '"+n.constructs.name2+"'.")},_preTransformBackrefTokens:function(e,t,n){for(var i,r,s,o=System.Text.RegularExpressions.RegexEngineParser,a=o.tokenTypes,u=0;u<t.length;u++){if((s=t[u]).type===a.escBackrefNumber){if(1<=(r=s.data.number)&&null!=n.getPackedSlotIdBySlotNumber(r))continue;if(r<=9)throw new System.ArgumentException.$ctor1("Reference to undefined group number "+r.toString()+".");if(null==(i=o._parseOctalCharToken(s.value,0,s.length)))throw new System.ArgumentException.$ctor1("Unrecognized escape sequence "+s.value.slice(0,2)+".");r=s.length-i.length,o._modifyPatternToken(s,e,a.escCharOctal,null,i.length),s.data=i.data,0<r&&(r=o._createPatternToken(e,a.literal,s.index+s.length,r),t.splice(u+1,0,r))}s.children&&s.children.length&&o._preTransformBackrefTokens(e,s.children,n)}},_updateGroupDescriptors:function(e,t){for(var n,i,r,s=System.Text.RegularExpressions.RegexEngineParser,o=s.tokenTypes,a=t||0,u=0;u<e.length;u++)(n=e[u]).index=a,n.children&&(r=n.childrenPostfix.length,s._updateGroupDescriptors(n.children,a+r),i=s._constructPattern(n.children),n.value=n.childrenPrefix+i+n.childrenPostfix,n.length=n.value.length),n.type===o.group&&n.group&&((r=n.group).exprIndex=n.index,r.exprLength=n.length,u+1<e.length&&((i=e[u+1]).type!==o.quantifier&&i.type!==o.quantifierN&&i.type!==o.quantifierNM||(r.quantifier=i.value)),r.expr=n.value,r.exprFull=r.expr+(null!=r.quantifier?r.quantifier:"")),a+=n.length},_constructPattern:function(e){for(var t="",n=0;n<e.length;n++)t+=e[n].value;return t},_parsePatternImpl:function(e,t,n,i){if(null==e)throw new System.ArgumentNullException.$ctor1("pattern");if(n<0||n>e.length)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex");if(i<n||i>e.length)throw new System.ArgumentOutOfRangeException.$ctor1("endIndex");for(var r,s=System.Text.RegularExpressions.RegexEngineParser,o=s.tokenTypes,a=[],u=n;u<i;)r=e[u],t.ignoreWhitespace&&0<=s._whiteSpaceChars.indexOf(r)?++u:(null==(r="."===r?s._parseDotToken(e,u,i):"\\"===r?s._parseEscapeToken(e,u,i):"["===r?s._parseCharRangeToken(e,u,i):"^"===r||"$"===r?s._parseAnchorToken(e,u):"("===r?s._parseGroupToken(e,t,u,i):"|"===r?s._parseAlternationToken(e,u):"#"===r&&t.ignoreWhitespace?s._parseXModeCommentToken(e,u,i):s._parseQuantifierToken(e,u,i))&&(r=s._createPatternToken(e,o.literal,u,1)),null!=r&&(a.push(r),u+=r.length));return a},_parseEscapeToken:function(e,t,n){var i=System.Text.RegularExpressions.RegexEngineParser,r=i.tokenTypes,s=e[t];if("\\"!==s)return null;if(n<=t+1)throw new System.ArgumentException.$ctor1("Illegal \\ at end of pattern.");if("1"<=(s=e[t+1])&&s<="9"){var o=i._matchChars(e,t+1,n,i._decSymbols,3),a=i._createPatternToken(e,r.escBackrefNumber,t,1+o.matchLength);return a.data={number:parseInt(o.match,10)},a}if(0<=i._escapedAnchors.indexOf(s))return i._createPatternToken(e,r.escAnchor,t,2);a=i._parseEscapedChar(e,t,n);if(null!=a)return a;if("k"===s){if(t+2<n){a=e[t+2];if("'"===a||"<"===a){a="<"===a?">":"'",a=i._matchUntil(e,t+3,n,a);if(1===a.unmatchLength&&0<a.matchLength){var u=i._createPatternToken(e,r.escBackrefName,t,3+a.matchLength+1);return u.data={name:a.match},u}}}throw new System.ArgumentException.$ctor1("Malformed \\k<...> named back reference.")}u=s.charCodeAt(0);if(0<=u&&u<48||57<u&&u<65||90<u&&u<95||96===u||122<u&&u<128){t=i._createPatternToken(e,r.escChar,t,2);return t.data={n:u,ch:s},t}throw new System.ArgumentException.$ctor1("Unrecognized escape sequence \\"+s+".")},_parseOctalCharToken:function(e,t,n){var i=System.Text.RegularExpressions.RegexEngineParser,r=i.tokenTypes,s=e[t];if("\\"===s&&t+1<n&&"0"<=(s=e[t+1])&&s<="7"){s=i._matchChars(e,t+1,n,i._octSymbols,3),n=parseInt(s.match,8),s=i._createPatternToken(e,r.escCharOctal,t,1+s.matchLength);return s.data={n:n,ch:String.fromCharCode(n)},s}return null},_parseEscapedChar:function(e,t,n){var i,r=System.Text.RegularExpressions.RegexEngineParser,s=r.tokenTypes,o=e[t];if("\\"!==o||n<=t+1)return null;if(o=e[t+1],0<=r._escapedChars.indexOf(o)){if("x"===o){var a=r._matchChars(e,t+2,n,r._hexSymbols,2);if(2!==a.matchLength)throw new System.ArgumentException.$ctor1("Insufficient hexadecimal digits.");var u=parseInt(a.match,16);return(a=r._createPatternToken(e,s.escCharHex,t,4)).data={n:u,ch:String.fromCharCode(u)},a}if("c"===o){if(n<=t+2)throw new System.ArgumentException.$ctor1("Missing control character.");u=(u=e[t+2]).toUpperCase(),u=this._controlChars.indexOf(u);if(0<=u)return(a=r._createPatternToken(e,s.escCharCtrl,t,3)).data={n:u,ch:String.fromCharCode(u)},a;throw new System.ArgumentException.$ctor1("Unrecognized control character.")}if("u"===o){var l=r._matchChars(e,t+2,n,r._hexSymbols,4);if(4!==l.matchLength)throw new System.ArgumentException.$ctor1("Insufficient hexadecimal digits.");l=parseInt(l.match,16);return(a=r._createPatternToken(e,s.escCharUnicode,t,6)).data={n:l,ch:String.fromCharCode(l)},a}switch(a=r._createPatternToken(e,s.escChar,t,2),o){case"a":i=7;break;case"b":i=8;break;case"t":i=9;break;case"r":i=13;break;case"v":i=11;break;case"f":i=12;break;case"n":i=10;break;case"e":i=27;break;default:throw new System.ArgumentException.$ctor1("Unexpected escaped char: '"+o+"'.")}return a.data={n:i,ch:String.fromCharCode(i)},a}if("0"<=o&&o<="7")return r._parseOctalCharToken(e,t,n);if(0<=r._escapedCharClasses.indexOf(o)){if("p"!==o&&"P"!==o)return r._createPatternToken(e,s.escCharClass,t,2);l=r._matchUntil(e,t+2,n,"}");if(l.matchLength<2||"{"!==l.match[0]||1!==l.unmatchLength)throw new System.ArgumentException.$ctor1("Incomplete p{X} character escape.");n=l.match.slice(1);if(0<=r._unicodeCategories.indexOf(n))return r._createPatternToken(e,s.escCharClassCategory,t,2+l.matchLength+1);if(0<=r._namedCharBlocks.indexOf(n))return r._createPatternToken(e,s.escCharClassBlock,t,2+l.matchLength+1);throw new System.ArgumentException.$ctor1("Unknown property '"+n+"'.")}return 0<=r._escapedSpecialSymbols.indexOf(o)?((a=r._createPatternToken(e,s.escCharOther,t,2)).data={n:o.charCodeAt(0),ch:o},a):null},_parseCharRangeToken:function(e,t,n){var i,r,s,o,a=System.Text.RegularExpressions.RegexEngineParser,u=a.tokenTypes,l=[],c=!1,m=!1,y=e[t];if("["!==y)return null;var h,d=t+1,f=-1;d<n&&"^"===e[d]&&(c=!0,d++);for(var g=d;d<n;){if(o=m,"-"===(y=e[d])&&d+1<n&&"["===e[d+1])(r=a._parseCharRangeToken(e,d+1,n)).childrenPrefix="-"+r.childrenPrefix,r.length++,h=(s=r).length,m=!0;else if("\\"===y){if(null==(s=a._parseEscapedChar(e,d,n)))throw new System.ArgumentException.$ctor1("Unrecognized escape sequence \\"+y+".");h=s.length}else{if("]"===y&&g<d){f=d;break}s=a._createPatternToken(e,u.literal,d,1),h=1}if(o)throw new System.ArgumentException.$ctor1("A subtraction must be the last element in a character class.");1<l.length&&null!=(i=a._parseCharIntervalToken(e,l[l.length-2],l[l.length-1],s))&&(l.pop(),l.pop(),s=i),null!=s&&(l.push(s),d+=h)}if(f<0||l.length<1)throw new System.ArgumentException.$ctor1("Unterminated [] set.");c=c?a._createPatternToken(e,u.charNegativeGroup,t,1+f-t,l,"[^","]"):a._createPatternToken(e,u.charGroup,t,1+f-t,l,"[","]");t=a._tidyCharRange(l);return c.data={ranges:t},null!=r&&(c.data.substractToken=r),c},_parseCharIntervalToken:function(e,t,n,i){var r,s,o,a,u=System.Text.RegularExpressions.RegexEngineParser,l=u.tokenTypes;if(n.type!==l.literal||"-"!==n.value)return null;if(t.type!==l.literal&&t.type!==l.escChar&&t.type!==l.escCharOctal&&t.type!==l.escCharHex&&t.type!==l.escCharCtrl&&t.type!==l.escCharUnicode&&t.type!==l.escCharOther)return null;if(i.type!==l.literal&&i.type!==l.escChar&&i.type!==l.escCharOctal&&i.type!==l.escCharHex&&i.type!==l.escCharCtrl&&i.type!==l.escCharUnicode&&i.type!==l.escCharOther)return null;if(s=t.type===l.literal?(r=t.value.charCodeAt(0),t.value):(r=t.data.n,t.data.ch),a=i.type===l.literal?(o=i.value.charCodeAt(0),i.value):(o=i.data.n,i.data.ch),o<r)throw new System.NotSupportedException.$ctor1("[x-y] range in reverse order.");var c=t.index,m=t.length+n.length+i.length,i=u._createPatternToken(e,l.charInterval,c,m,[t,n,i],"","");return i.data={startN:r,startCh:s,endN:o,endCh:a},i},_tidyCharRange:function(e){for(var t,n,i,r,s,o,a,u,l=System.Text.RegularExpressions.RegexEngineParser,c=l.tokenTypes,m=[],y=[],h=0;h<e.length;h++){if((r=e[h]).type===c.literal)i=n=r.value.charCodeAt(0);else if(r.type===c.charInterval)n=r.data.startN,i=r.data.endN;else{if(r.type!==c.literal&&r.type!==c.escChar&&r.type!==c.escCharOctal&&r.type!==c.escCharHex&&r.type!==c.escCharCtrl&&r.type!==c.escCharUnicode&&r.type!==c.escCharOther){if(r.type===c.charGroup||r.type===c.charNegativeGroup)continue;y.push(r);continue}i=n=r.data.n}if(0!==m.length){for(t=0;t<m.length&&!(m[t].n>n);t++);m.splice(t,0,{n:n,m:i})}else m.push({n:n,m:i})}for(h=0;h<m.length;h++){for(s=m[h],a=0,t=h+1;t<m.length&&!((o=m[t]).n>1+s.m);t++)a++,o.m>s.m&&(s.m=o.m);0<a&&m.splice(h+1,a)}return 0<y.length&&(u="["+l._constructPattern(y)+"]",m.charClassToken=l._createPatternToken(u,c.charGroup,0,u.length,e,"[","]")),m},_parseDotToken:function(e,t){var n=System.Text.RegularExpressions.RegexEngineParser,i=n.tokenTypes;return"."!==e[t]?null:n._createPatternToken(e,i.escCharClassDot,t,1)},_parseAnchorToken:function(e,t){var n=System.Text.RegularExpressions.RegexEngineParser,i=n.tokenTypes,r=e[t];return"^"!==r&&"$"!==r?null:n._createPatternToken(e,i.anchor,t,1)},_updateSettingsFromConstructs:function(e,t){null!=t.isIgnoreWhitespace&&(e.ignoreWhitespace=t.isIgnoreWhitespace),null!=t.isExplicitCapture&&(e.explicitCapture=t.isExplicitCapture)},_parseGroupToken:function(e,t,n,i){var r=System.Text.RegularExpressions.RegexEngineParser,s=r.tokenTypes,o={ignoreWhitespace:t.ignoreWhitespace,explicitCapture:t.explicitCapture},a=e[n];if("("!==a)return null;var u=1,l=!1,c=n+1,m=-1,y=!1,h=!1,d=!1,f=!1,g=!1,S=null,p=r._parseGroupConstructToken(e,o,n+1,i);null!=p&&(S=this._fillGroupConstructs(p),c+=p.length,p.type===s.commentInline?y=!0:p.type===s.alternationGroupCondition?h=!0:p.type===s.groupConstructImnsx?(this._updateSettingsFromConstructs(o,S),f=!0):p.type===s.groupConstructImnsxMisc&&(this._updateSettingsFromConstructs(t,S),d=!0)),!o.explicitCapture||null!=S&&null!=S.name1||(g=!0);for(var $=c;$<i;){if("\\"===(a=e[$]))$++;else if("["===a)l=!0;else if("]"===a&&l)l=!1;else if(!l)if("("!==a||y){if(")"===a&&0===--u){m=$;break}}else++u;++$}S=null;if(y){if(m<0)throw new System.ArgumentException.$ctor1("Unterminated (?#...) comment.");S=r._createPatternToken(e,s.commentInline,n,1+m-n)}else{if(m<0)throw new System.ArgumentException.$ctor1("Not enough )'s.");var C=r._parsePatternImpl(e,o,c,m);if(null!=p&&C.splice(0,0,p),h){for(var I,E=C.length,x=0,A=0;A<E;A++)if(I=C[A],I.type===s.alternation&&1<++x)throw new System.ArgumentException.$ctor1("Too many | in (?()|).");if(0===x)throw new System.NotSupportedException.$ctor1("Alternation group without | is not supported.");S=r._createPatternToken(e,s.alternationGroup,n,1+m-n,C,"(",")")}else{h=s.group;d?h=s.groupImnsxMisc:f&&(h=s.groupImnsx);n=r._createPatternToken(e,h,n,1+m-n,C,"(",")");n.localSettings=o,S=n}}return g&&(S.isNonCapturingExplicit=!0),S},_parseGroupConstructToken:function(e,t,n,i){var r=System.Text.RegularExpressions.RegexEngineParser,s=r.tokenTypes,o=e[n];if("?"!==o||i<=n+1)return null;if(":"===(o=e[n+1])||"="===o||"!"===o||">"===o)return r._createPatternToken(e,s.groupConstruct,n,2);if("#"===o)return r._createPatternToken(e,s.commentInline,n,2);if("("===o)return r._parseAlternationGroupConditionToken(e,t,n,i);if("<"===o&&n+2<i){t=e[n+2];if("="===t||"!"===t)return r._createPatternToken(e,s.groupConstruct,n,3)}if("<"===o||"'"===o){var o="<"===o?">":o,a=r._matchUntil(e,n+2,i,o);if(1!==a.unmatchLength||0===a.matchLength)throw new System.ArgumentException.$ctor1("Unrecognized grouping construct.");o=a.match.slice(0,1);if(0<="`~@#$%^&*()+{}[]|\\/|'\";:,.?".indexOf(o))throw new System.ArgumentException.$ctor1("Invalid group name: Group names must begin with a word character.");return r._createPatternToken(e,s.groupConstructName,n,2+a.matchLength+1)}a=r._matchChars(e,n+1,i,"imnsx-");if(0<a.matchLength&&(":"===a.unmatchCh||")"===a.unmatchCh)){i=":"===a.unmatchCh?s.groupConstructImnsx:s.groupConstructImnsxMisc,s=":"===a.unmatchCh?1:0;return r._createPatternToken(e,i,n,1+a.matchLength+s)}throw new System.ArgumentException.$ctor1("Unrecognized grouping construct.")},_parseQuantifierToken:function(e,t,n){var i=System.Text.RegularExpressions.RegexEngineParser,r=i.tokenTypes,s=null,o=e[t];if("*"===o||"+"===o||"?"===o)(s=i._createPatternToken(e,r.quantifier,t,1)).data={val:o};else if("{"===o){var a=i._matchChars(e,t+1,n,i._decSymbols);if(0!==a.matchLength)if("}"===a.unmatchCh)(s=i._createPatternToken(e,r.quantifierN,t,1+a.matchLength+1)).data={n:parseInt(a.match,10)};else if(","===a.unmatchCh){o=i._matchChars(e,a.unmatchIndex+1,n,i._decSymbols);if("}"===o.unmatchCh&&(s=i._createPatternToken(e,r.quantifierNM,t,1+a.matchLength+1+o.matchLength+1),s.data={n:parseInt(a.match,10),m:null},0!==o.matchLength&&(s.data.m=parseInt(o.match,10),s.data.n>s.data.m)))throw new System.ArgumentException.$ctor1("Illegal {x,y} with x > y.")}}return null==s||(t=t+s.length)<n&&"?"===e[t]&&(this._modifyPatternToken(s,e,s.type,s.index,s.length+1),s.data.isLazy=!0),s},_parseAlternationToken:function(e,t){var n=System.Text.RegularExpressions.RegexEngineParser,i=n.tokenTypes;return"|"!==e[t]?null:n._createPatternToken(e,i.alternation,t,1)},_parseAlternationGroupConditionToken:function(e,t,n,i){var r,s=System.Text.RegularExpressions.RegexEngineParser,o=s.tokenTypes,a=null;if("?"!==e[n]||i<=n+1||"("!==e[n+1])return null;n=s._parseGroupToken(e,t,n+1,i);if(null==n)return null;if(n.type===o.commentInline)throw new System.ArgumentException.$ctor1("Alternation conditions cannot be comments.");i=n.children;if(i&&i.length){if((r=i[0]).type===o.groupConstructName)throw new System.ArgumentException.$ctor1("Alternation conditions do not capture and cannot be named.");if(r.type!==o.groupConstruct&&r.type!==o.groupConstructImnsx||null!=(u=s._findFirstGroupWithoutConstructs(i))&&(u.isEmptyCapturing=!0),r.type===o.literal){var u=n.value.slice(1,n.value.length-1);if("0"<=u[0]&&u[0]<="9"){if(s._matchChars(u,0,u.length,s._decSymbols).matchLength!==u.length)throw new System.ArgumentException.$ctor1("Malformed Alternation group number: "+u+".");a={number:parseInt(u,10)}}else a={name:u}}}i.length&&(i[0].type===o.groupConstruct||i[0].type===o.groupConstructImnsx)||(r=s._createPatternToken("?:",o.groupConstruct,0,2),i.splice(0,0,r));n=s._createPatternToken(e,o.alternationGroupCondition,n.index-1,1+n.length,[n],"?","");return null!=a&&(n.data=a),n},_findFirstGroupWithoutConstructs:function(e){for(var t,n=System.Text.RegularExpressions.RegexEngineParser,i=n.tokenTypes,r=null,s=0;s<e.length;++s)if((t=e[s]).type===i.group&&t.children&&t.children.length){if(t.children[0].type!==i.groupConstruct&&t.children[0].type!==i.groupConstructImnsx){r=t;break}if(t.children&&t.children.length&&null!=(r=n._findFirstGroupWithoutConstructs(t.children)))break}return r},_parseXModeCommentToken:function(e,t,n){var i=System.Text.RegularExpressions.RegexEngineParser,r=i.tokenTypes,s=e[t];if("#"!==s)return null;for(var o=t+1;o<n&&(s=e[o],++o,"\n"!==s););return i._createPatternToken(e,r.commentXMode,t,o-t)},_createLiteralToken:function(e){var t=System.Text.RegularExpressions.RegexEngineParser;return t._createPatternToken(e,t.tokenTypes.literal,0,e.length)},_createPositiveLookaheadToken:function(e,t){e="(?="+e+")";return System.Text.RegularExpressions.RegexEngineParser._parseGroupToken(e,t,0,e.length)},_createPatternToken:function(e,t,n,i,r,s,o){i={type:t,index:n,length:i,value:e.slice(n,n+i)};return null!=r&&0<r.length&&(i.children=r,i.childrenPrefix=s,i.childrenPostfix=o),i},_modifyPatternToken:function(e,t,n,i,r){null!=n&&(e.type=n),null==i&&null==r||(null!=i&&(e.index=i),null!=r&&(e.length=r),e.value=t.slice(e.index,e.index+e.length))},_updatePatternToken:function(e,t,n,i,r){e.type=t,e.index=n,e.length=i,e.value=r},_matchChars:function(e,t,n,i,r){var s,o={match:"",matchIndex:-1,matchLength:0,unmatchCh:"",unmatchIndex:-1,unmatchLength:0},a=t;for(null!=r&&0<=r&&(n=t+r);a<n;){if(s=e[a],i.indexOf(s)<0){o.unmatchCh=s,o.unmatchIndex=a,o.unmatchLength=1;break}a++}return t<a&&(o.match=e.slice(t,a),o.matchIndex=t,o.matchLength=a-t),o},_matchUntil:function(e,t,n,i,r){var s,o={match:"",matchIndex:-1,matchLength:0,unmatchCh:"",unmatchIndex:-1,unmatchLength:0},a=t;for(null!=r&&0<=r&&(n=t+r);a<n;){if(s=e[a],0<=i.indexOf(s)){o.unmatchCh=s,o.unmatchIndex=a,o.unmatchLength=1;break}a++}return t<a&&(o.match=e.slice(t,a),o.matchIndex=t,o.matchLength=a-t),o}}}),Bridge.define("System.BitConverter",{statics:{fields:{isLittleEndian:!1,arg_ArrayPlusOffTooSmall:null},ctors:{init:function(){this.isLittleEndian=System.BitConverter.getIsLittleEndian(),this.arg_ArrayPlusOffTooSmall="Destination array is not long enough to copy all the items in the collection. Check array index and length."}},methods:{getBytes:function(e){return e?System.Array.init([1],System.Byte):System.Array.init([0],System.Byte)},getBytes$1:function(e){return System.BitConverter.getBytes$3(Bridge.Int.sxs(65535&e))},getBytes$3:function(e){var t=System.BitConverter.view(2);return t.setInt16(0,e),System.BitConverter.getViewBytes(t)},getBytes$4:function(e){var t=System.BitConverter.view(4);return t.setInt32(0,e),System.BitConverter.getViewBytes(t)},getBytes$5:function(e){e=System.BitConverter.getView(e);return System.BitConverter.getViewBytes(e)},getBytes$7:function(e){var t=System.BitConverter.view(2);return t.setUint16(0,e),System.BitConverter.getViewBytes(t)},getBytes$8:function(e){var t=System.BitConverter.view(4);return t.setUint32(0,e),System.BitConverter.getViewBytes(t)},getBytes$9:function(e){e=System.BitConverter.getView(System.Int64.clip64(e));return System.BitConverter.getViewBytes(e)},getBytes$6:function(e){var t=System.BitConverter.view(4);return t.setFloat32(0,e),System.BitConverter.getViewBytes(t)},getBytes$2:function(e){if(isNaN(e))return System.BitConverter.isLittleEndian?System.Array.init([0,0,0,0,0,0,248,255],System.Byte):System.Array.init([255,248,0,0,0,0,0,0],System.Byte);var t=System.BitConverter.view(8);return t.setFloat64(0,e),System.BitConverter.getViewBytes(t)},toChar:function(e,t){return 65535&System.BitConverter.toInt16(e,t)},toInt16:function(e,t){System.BitConverter.checkArguments(e,t,2);var n=System.BitConverter.view(2);return System.BitConverter.setViewBytes(n,e,-1,t),n.getInt16(0)},toInt32:function(e,t){System.BitConverter.checkArguments(e,t,4);var n=System.BitConverter.view(4);return System.BitConverter.setViewBytes(n,e,-1,t),n.getInt32(0)},toInt64:function(e,t){System.BitConverter.checkArguments(e,t,8);var n=System.BitConverter.toInt32(e,t),t=System.BitConverter.toInt32(e,t+4|0);return System.BitConverter.isLittleEndian?System.Int64([n,t]):System.Int64([t,n])},toUInt16:function(e,t){return 65535&System.BitConverter.toInt16(e,t)},toUInt32:function(e,t){return System.BitConverter.toInt32(e,t)>>>0},toUInt64:function(e,t){t=System.BitConverter.toInt64(e,t);return System.UInt64([t.value.low,t.value.high])},toSingle:function(e,t){System.BitConverter.checkArguments(e,t,4);var n=System.BitConverter.view(4);return System.BitConverter.setViewBytes(n,e,-1,t),n.getFloat32(0)},toDouble:function(e,t){System.BitConverter.checkArguments(e,t,8);var n=System.BitConverter.view(8);return System.BitConverter.setViewBytes(n,e,-1,t),n.getFloat64(0)},toString$2:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("value");if(t<0||t>=e.length&&0<t)throw new System.ArgumentOutOfRangeException.$ctor1("startIndex");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("length");if(t>(e.length-n|0))throw new System.ArgumentException.$ctor1(System.BitConverter.arg_ArrayPlusOffTooSmall);if(0===n)return"";if(715827882<n)throw new System.ArgumentOutOfRangeException.$ctor4("length",Bridge.toString(715827882));for(var i=Bridge.Int.mul(n,3),r=System.Array.init(i,0,System.Char),s=0,o=t,s=0;s<i;s=s+3|0){var a=e[System.Array.index(Bridge.identity(o,o=o+1|0),e)];r[System.Array.index(s,r)]=System.BitConverter.getHexValue(0|Bridge.Int.div(a,16)),r[System.Array.index(s+1|0,r)]=System.BitConverter.getHexValue(a%16),r[System.Array.index(s+2|0,r)]=45}return System.String.fromCharArray(r,0,r.length-1|0)},toString:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("value");return System.BitConverter.toString$2(e,0,e.length)},toString$1:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("value");return System.BitConverter.toString$2(e,t,e.length-t|0)},toBoolean:function(e,t){return System.BitConverter.checkArguments(e,t,1),0!==e[System.Array.index(t,e)]},doubleToInt64Bits:function(e){var t=System.BitConverter.view(8);return t.setFloat64(0,e),System.Int64([t.getInt32(4),t.getInt32(0)])},int64BitsToDouble:function(e){return System.BitConverter.getView(e).getFloat64(0)},getHexValue:function(e){return e<10?65535&(e+48|0):65535&(65+(e-10|0)|0)},getViewBytes:function(e,t,n){void 0===t&&(t=-1),void 0===n&&(n=0),-1===t&&(t=e.byteLength);var i=System.Array.init(t,0,System.Byte);if(System.BitConverter.isLittleEndian)for(var r=t-1|0;0<=r;r=r-1|0)i[System.Array.index(r,i)]=e.getUint8(Bridge.identity(n,n=n+1|0));else for(var s=0;s<t;s=s+1|0)i[System.Array.index(s,i)]=e.getUint8(Bridge.identity(n,n=n+1|0));return i},setViewBytes:function(e,t,n,i){if(void 0===n&&(n=-1),void 0===i&&(i=0),-1===n&&(n=e.byteLength),System.BitConverter.isLittleEndian)for(var r=n-1|0;0<=r;r=r-1|0)e.setUint8(r,t[System.Array.index(Bridge.identity(i,i=i+1|0),t)]);else for(var s=0;s<n;s=s+1|0)e.setUint8(s,t[System.Array.index(Bridge.identity(i,i=i+1|0),t)])},view:function(e){e=new ArrayBuffer(e);return new DataView(e)},getView:function(e){var t=System.BitConverter.view(8);return t.setInt32(4,e.value.low),t.setInt32(0,e.value.high),t},getIsLittleEndian:function(){var e=System.BitConverter.view(2);return e.setUint8(0,170),e.setUint8(1,187),43707===e.getUint16(0)},checkArguments:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("null");if(System.Int64(t>>>0).gte(System.Int64(e.length)))throw new System.ArgumentOutOfRangeException.$ctor1("startIndex");if(t>(e.length-n|0))throw new System.ArgumentException.$ctor1(System.BitConverter.arg_ArrayPlusOffTooSmall)}}}}),Bridge.define("System.Collections.BitArray",{inherits:[System.Collections.ICollection,System.ICloneable],statics:{fields:{BitsPerInt32:0,BytesPerInt32:0,BitsPerByte:0,_ShrinkThreshold:0},ctors:{init:function(){this.BitsPerInt32=32,this.BytesPerInt32=4,this.BitsPerByte=8,this._ShrinkThreshold=256}},methods:{GetArrayLength:function(e,t){return 0<e?1+(0|Bridge.Int.div(e-1|0,t))|0:0}}},fields:{m_array:null,m_length:0,_version:0},props:{Length:{get:function(){return this.m_length},set:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor4("value","Non-negative number required.");var t,n,i=System.Collections.BitArray.GetArrayLength(e,System.Collections.BitArray.BitsPerInt32);(i>this.m_array.length||(i+System.Collections.BitArray._ShrinkThreshold|0)<this.m_array.length)&&(n=System.Array.init(i,0,System.Int32),System.Array.copy(this.m_array,0,n,0,i>this.m_array.length?this.m_array.length:i),this.m_array=n),e>this.m_length&&(t=System.Collections.BitArray.GetArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32)-1|0,0<(n=this.m_length%32)&&(this.m_array[System.Array.index(t,this.m_array)]=this.m_array[System.Array.index(t,this.m_array)]&((1<<n)-1|0)),System.Array.fill(this.m_array,0,1+t|0,(i-t|0)-1|0)),this.m_length=e,this._version=this._version+1|0}},Count:{get:function(){return this.m_length}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return this}},IsReadOnly:{get:function(){return!1}}},alias:["copyTo","System$Collections$ICollection$copyTo","Count","System$Collections$ICollection$Count","clone","System$ICloneable$clone","GetEnumerator","System$Collections$IEnumerable$GetEnumerator"],ctors:{$ctor3:function(e){System.Collections.BitArray.$ctor4.call(this,e,!1)},$ctor4:function(e,t){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException.$ctor4("length","Index is less than zero.");this.m_array=System.Array.init(System.Collections.BitArray.GetArrayLength(e,System.Collections.BitArray.BitsPerInt32),0,System.Int32),this.m_length=e;for(var n=t?-1:0,i=0;i<this.m_array.length;i=i+1|0)this.m_array[System.Array.index(i,this.m_array)]=n;this._version=0},$ctor1:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("bytes");if(268435455<e.length)throw new System.ArgumentException.$ctor3(System.String.format("The input array length must not exceed Int32.MaxValue / {0}. Otherwise BitArray.Length would exceed Int32.MaxValue.",[Bridge.box(System.Collections.BitArray.BitsPerByte,System.Int32)]),"bytes");this.m_array=System.Array.init(System.Collections.BitArray.GetArrayLength(e.length,System.Collections.BitArray.BytesPerInt32),0,System.Int32),this.m_length=Bridge.Int.mul(e.length,System.Collections.BitArray.BitsPerByte);for(var t=0,n=0;4<=(e.length-n|0);)this.m_array[System.Array.index(Bridge.identity(t,t=t+1|0),this.m_array)]=255&e[System.Array.index(n,e)]|(255&e[System.Array.index(n+1|0,e)])<<8|(255&e[System.Array.index(n+2|0,e)])<<16|(255&e[System.Array.index(n+3|0,e)])<<24,n=n+4|0;var i=e.length-n|0;3===i&&(this.m_array[System.Array.index(t,this.m_array)]=(255&e[System.Array.index(n+2|0,e)])<<16,i=2),2===i&&(this.m_array[System.Array.index(t,this.m_array)]=this.m_array[System.Array.index(t,this.m_array)]|(255&e[System.Array.index(n+1|0,e)])<<8,i=1),1===i&&(this.m_array[System.Array.index(t,this.m_array)]=this.m_array[System.Array.index(t,this.m_array)]|255&e[System.Array.index(n,e)]),this._version=0},ctor:function(e){var t;if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("values");this.m_array=System.Array.init(System.Collections.BitArray.GetArrayLength(e.length,System.Collections.BitArray.BitsPerInt32),0,System.Int32),this.m_length=e.length;for(var n=0;n<e.length;n=n+1|0)e[System.Array.index(n,e)]&&(this.m_array[System.Array.index(t=0|Bridge.Int.div(n,32),this.m_array)]=this.m_array[System.Array.index(t,this.m_array)]|1<<n%32);this._version=0},$ctor5:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("values");if(67108863<e.length)throw new System.ArgumentException.$ctor3(System.String.format("The input array length must not exceed Int32.MaxValue / {0}. Otherwise BitArray.Length would exceed Int32.MaxValue.",[Bridge.box(System.Collections.BitArray.BitsPerInt32,System.Int32)]),"values");this.m_array=System.Array.init(e.length,0,System.Int32),this.m_length=Bridge.Int.mul(e.length,System.Collections.BitArray.BitsPerInt32),System.Array.copy(e,0,this.m_array,0,e.length),this._version=0},$ctor2:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("bits");var t=System.Collections.BitArray.GetArrayLength(e.m_length,System.Collections.BitArray.BitsPerInt32);this.m_array=System.Array.init(t,0,System.Int32),this.m_length=e.m_length,System.Array.copy(e.m_array,0,this.m_array,0,t),this._version=e._version}},methods:{getItem:function(e){return this.Get(e)},setItem:function(e,t){this.Set(e,t)},copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(1!==System.Array.getRank(e))throw new System.ArgumentException.$ctor1("Only single dimensional arrays are supported for the requested action.");if(Bridge.is(e,System.Array.type(System.Int32)))System.Array.copy(this.m_array,0,e,t,System.Collections.BitArray.GetArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32));else if(Bridge.is(e,System.Array.type(System.Byte))){var n=System.Collections.BitArray.GetArrayLength(this.m_length,System.Collections.BitArray.BitsPerByte);if((e.length-t|0)<n)throw new System.ArgumentException.$ctor1("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");for(var i=Bridge.cast(e,System.Array.type(System.Byte)),r=0;r<n;r=r+1|0)i[System.Array.index(t+r|0,i)]=this.m_array[System.Array.index(0|Bridge.Int.div(r,4),this.m_array)]>>Bridge.Int.mul(r%4,8)&255}else{if(!Bridge.is(e,System.Array.type(System.Boolean)))throw new System.ArgumentException.$ctor1("Only supported array types for CopyTo on BitArrays are Boolean[], Int32[] and Byte[].");if((e.length-t|0)<this.m_length)throw new System.ArgumentException.$ctor1("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");for(var s=Bridge.cast(e,System.Array.type(System.Boolean)),o=0;o<this.m_length;o=o+1|0)s[System.Array.index(t+o|0,s)]=0!=(this.m_array[System.Array.index(0|Bridge.Int.div(o,32),this.m_array)]>>o%32&1)}},Get:function(e){if(e<0||e>=this.Length)throw new System.ArgumentOutOfRangeException.$ctor4("index","Index was out of range. Must be non-negative and less than the size of the collection.");return 0!=(this.m_array[System.Array.index(0|Bridge.Int.div(e,32),this.m_array)]&1<<e%32)},Set:function(e,t){var n;if(e<0||e>=this.Length)throw new System.ArgumentOutOfRangeException.$ctor4("index","Index was out of range. Must be non-negative and less than the size of the collection.");t?this.m_array[System.Array.index(n=0|Bridge.Int.div(e,32),this.m_array)]=this.m_array[System.Array.index(n,this.m_array)]|1<<e%32:this.m_array[System.Array.index(n=0|Bridge.Int.div(e,32),this.m_array)]=this.m_array[System.Array.index(n,this.m_array)]&~(1<<e%32),this._version=this._version+1|0},SetAll:function(e){for(var t=e?-1:0,n=System.Collections.BitArray.GetArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),i=0;i<n;i=i+1|0)this.m_array[System.Array.index(i,this.m_array)]=t;this._version=this._version+1|0},And:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("value");if(this.Length!==e.Length)throw new System.ArgumentException.$ctor1("Array lengths must be the same.");for(var t=System.Collections.BitArray.GetArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),n=0;n<t;n=n+1|0)this.m_array[System.Array.index(n,this.m_array)]=this.m_array[System.Array.index(n,this.m_array)]&e.m_array[System.Array.index(n,e.m_array)];return this._version=this._version+1|0,this},Or:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("value");if(this.Length!==e.Length)throw new System.ArgumentException.$ctor1("Array lengths must be the same.");for(var t=System.Collections.BitArray.GetArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),n=0;n<t;n=n+1|0)this.m_array[System.Array.index(n,this.m_array)]=this.m_array[System.Array.index(n,this.m_array)]|e.m_array[System.Array.index(n,e.m_array)];return this._version=this._version+1|0,this},Xor:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("value");if(this.Length!==e.Length)throw new System.ArgumentException.$ctor1("Array lengths must be the same.");for(var t=System.Collections.BitArray.GetArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),n=0;n<t;n=n+1|0)this.m_array[System.Array.index(n,this.m_array)]=this.m_array[System.Array.index(n,this.m_array)]^e.m_array[System.Array.index(n,e.m_array)];return this._version=this._version+1|0,this},Not:function(){for(var e=System.Collections.BitArray.GetArrayLength(this.m_length,System.Collections.BitArray.BitsPerInt32),t=0;t<e;t=t+1|0)this.m_array[System.Array.index(t,this.m_array)]=~this.m_array[System.Array.index(t,this.m_array)];return this._version=this._version+1|0,this},clone:function(){var e=new System.Collections.BitArray.$ctor5(this.m_array);return e._version=this._version,e.m_length=this.m_length,e},GetEnumerator:function(){return new System.Collections.BitArray.BitArrayEnumeratorSimple(this)}}}),Bridge.define("System.Collections.BitArray.BitArrayEnumeratorSimple",{inherits:[System.Collections.IEnumerator],$kind:"nested class",fields:{bitarray:null,index:0,version:0,currentElement:!1},props:{Current:{get:function(){if(-1===this.index)throw new System.InvalidOperationException.$ctor1("Enumeration has not started. Call MoveNext.");if(this.index>=this.bitarray.Count)throw new System.InvalidOperationException.$ctor1("Enumeration already finished.");return Bridge.box(this.currentElement,System.Boolean,System.Boolean.toString)}}},alias:["moveNext","System$Collections$IEnumerator$moveNext","Current","System$Collections$IEnumerator$Current","reset","System$Collections$IEnumerator$reset"],ctors:{ctor:function(e){this.$initialize(),this.bitarray=e,this.index=-1,this.version=e._version}},methods:{moveNext:function(){if(this.version!==this.bitarray._version)throw new System.InvalidOperationException.$ctor1("Collection was modified; enumeration operation may not execute.");return this.index<(this.bitarray.Count-1|0)?(this.index=this.index+1|0,this.currentElement=this.bitarray.Get(this.index),!0):(this.index=this.bitarray.Count,!1)},reset:function(){if(this.version!==this.bitarray._version)throw new System.InvalidOperationException.$ctor1("Collection was modified; enumeration operation may not execute.");this.index=-1}}}),Bridge.define("System.Collections.Generic.BitHelper",{statics:{fields:{MarkedBitFlag:0,IntSize:0},ctors:{init:function(){this.MarkedBitFlag=1,this.IntSize=32}},methods:{ToIntArrayLength:function(e){return 0<e?1+(0|Bridge.Int.div(e-1|0,System.Collections.Generic.BitHelper.IntSize))|0:0}}},fields:{_length:0,_array:null},ctors:{ctor:function(e,t){this.$initialize(),this._array=e,this._length=t}},methods:{MarkBit:function(e){var t=0|Bridge.Int.div(e,System.Collections.Generic.BitHelper.IntSize);t<this._length&&0<=t&&(e=System.Collections.Generic.BitHelper.MarkedBitFlag<<e%System.Collections.Generic.BitHelper.IntSize,this._array[System.Array.index(t,this._array)]=this._array[System.Array.index(t,this._array)]|e)},IsMarked:function(e){var t=0|Bridge.Int.div(e,System.Collections.Generic.BitHelper.IntSize);if(t<this._length&&0<=t){e=System.Collections.Generic.BitHelper.MarkedBitFlag<<e%System.Collections.Generic.BitHelper.IntSize;return 0!=(this._array[System.Array.index(t,this._array)]&e)}return!1}}}),Bridge.define("System.Collections.Generic.DictionaryKeyCollectionDebugView$2",function(t,e){return{fields:{_collection:null},props:{Items:{get:function(){var e=System.Array.init(System.Array.getCount(this._collection,t),function(){return Bridge.getDefaultValue(t)},t);return System.Array.copyTo(this._collection,e,0,t),e}}},ctors:{ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("collection");this._collection=e}}}}),Bridge.define("System.Collections.Generic.DictionaryValueCollectionDebugView$2",function(e,t){return{fields:{_collection:null},props:{Items:{get:function(){var e=System.Array.init(System.Array.getCount(this._collection,t),function(){return Bridge.getDefaultValue(t)},t);return System.Array.copyTo(this._collection,e,0,t),e}}},ctors:{ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("collection");this._collection=e}}}}),Bridge.define("Bridge.Collections.EnumerableHelpers",{statics:{methods:{ToArray:function(e,t){var n={},t={v:Bridge.Collections.EnumerableHelpers.ToArray$1(e,t,n)};return System.Array.resize(t,n.v,function(){return Bridge.getDefaultValue(e)},e),t.v},ToArray$1:function(e,t,n){var i=Bridge.getEnumerator(t,e);try{if(i.System$Collections$IEnumerator$moveNext()){var r={v:System.Array.init(4,function(){return Bridge.getDefaultValue(e)},e)};r.v[System.Array.index(0,r.v)]=i[Bridge.geti(i,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(e)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")];for(var s,o,a=1;i.System$Collections$IEnumerator$moveNext();)a===r.v.length&&((s=2146435071)<(o=a<<1)>>>0&&(o=s<=a?a+1|0:s),System.Array.resize(r,o,function(){return Bridge.getDefaultValue(e)},e)),r.v[System.Array.index(Bridge.identity(a,a=a+1|0),r.v)]=i[Bridge.geti(i,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(e)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")];return n.v=a,r.v}}finally{Bridge.hasValue(i)&&i.System$IDisposable$Dispose()}return n.v=0,System.Array.init(0,function(){return Bridge.getDefaultValue(e)},e)}}}}),Bridge.define("System.Collections.Generic.HashSet$1",function(y){return{inherits:[System.Collections.Generic.ICollection$1(y),System.Collections.Generic.ISet$1(y),System.Collections.Generic.IReadOnlyCollection$1(y)],statics:{fields:{Lower31BitMask:0,ShrinkThreshold:0},ctors:{init:function(){this.Lower31BitMask=2147483647,this.ShrinkThreshold=3}},methods:{HashSetEquals:function(e,t,n){var i,r;if(null==e)return null==t;if(null==t)return!1;if(System.Collections.Generic.HashSet$1(y).AreEqualityComparersEqual(e,t)){if(e.Count!==t.Count)return!1;i=Bridge.getEnumerator(t);try{for(;i.moveNext();){var s=i.Current;if(!e.contains(s))return!1}}finally{Bridge.is(i,System.IDisposable)&&i.System$IDisposable$Dispose()}return!0}r=Bridge.getEnumerator(t);try{for(;r.moveNext();){var o=r.Current,a=!1,u=Bridge.getEnumerator(e);try{for(;u.moveNext();){var l=u.Current;if(n[Bridge.geti(n,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(y)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2")](o,l)){a=!0;break}}}finally{Bridge.is(u,System.IDisposable)&&u.System$IDisposable$Dispose()}if(!a)return!1}}finally{Bridge.is(r,System.IDisposable)&&r.System$IDisposable$Dispose()}return!0},AreEqualityComparersEqual:function(e,t){return Bridge.equals(e.Comparer,t.Comparer)}}},fields:{_buckets:null,_slots:null,_count:0,_lastIndex:0,_freeList:0,_comparer:null,_version:0},props:{Count:{get:function(){return this._count}},IsReadOnly:{get:function(){return!1}},Comparer:{get:function(){return this._comparer}}},alias:["System$Collections$Generic$ICollection$1$add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$add","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$clear","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$copyTo","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$remove","Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(y)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$Count","IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(y)+"$IsReadOnly","System$Collections$Generic$IEnumerable$1$GetEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(y)+"$GetEnumerator","add","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$add","unionWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$unionWith","intersectWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$intersectWith","exceptWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$exceptWith","symmetricExceptWith","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$symmetricExceptWith","isSubsetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$isSubsetOf","isProperSubsetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$isProperSubsetOf","isSupersetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$isSupersetOf","isProperSupersetOf","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$isProperSupersetOf","overlaps","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$overlaps","setEquals","System$Collections$Generic$ISet$1$"+Bridge.getTypeAlias(y)+"$setEquals"],ctors:{ctor:function(){System.Collections.Generic.HashSet$1(y).$ctor3.call(this,System.Collections.Generic.EqualityComparer$1(y).def)},$ctor3:function(e){this.$initialize(),null==e&&(e=System.Collections.Generic.EqualityComparer$1(y).def),this._comparer=e,this._lastIndex=0,this._count=0,this._freeList=-1,this._version=0},$ctor1:function(e){System.Collections.Generic.HashSet$1(y).$ctor2.call(this,e,System.Collections.Generic.EqualityComparer$1(y).def)},$ctor2:function(e,t){if(System.Collections.Generic.HashSet$1(y).$ctor3.call(this,t),null==e)throw new System.ArgumentNullException.$ctor1("collection");var n=0,t=Bridge.as(e,System.Collections.Generic.ICollection$1(y));null!=t&&(n=System.Array.getCount(t,y)),this.Initialize(n),this.unionWith(e),(0===this._count&&this._slots.length>System.Collections.HashHelpers.GetMinPrime()||0<this._count&&(0|Bridge.Int.div(this._slots.length,this._count))>System.Collections.Generic.HashSet$1(y).ShrinkThreshold)&&this.TrimExcess()}},methods:{System$Collections$Generic$ICollection$1$add:function(e){this.AddIfNotPresent(e)},add:function(e){return this.AddIfNotPresent(e)},clear:function(){if(0<this._lastIndex){for(var e=0;e<this._lastIndex;e=e+1|0)this._slots[System.Array.index(e,this._slots)]=new(System.Collections.Generic.HashSet$1.Slot(y));for(var t=0;t<this._buckets.length;t=t+1|0)this._buckets[System.Array.index(t,this._buckets)]=0;this._lastIndex=0,this._count=0,this._freeList=-1}this._version=this._version+1|0},ArrayClear:function(e,t,n){},contains:function(e){if(null!=this._buckets)for(var t=this.InternalGetHashCode(e),n=this._buckets[System.Array.index(t%this._buckets.length,this._buckets)]-1|0;0<=n;n=this._slots[System.Array.index(n,this._slots)].next)if(this._slots[System.Array.index(n,this._slots)].hashCode===t&&this._comparer[Bridge.geti(this._comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(y)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2")](this._slots[System.Array.index(n,this._slots)].value,e))return!0;return!1},copyTo:function(e,t){this.CopyTo$1(e,t,this._count)},CopyTo:function(e){this.CopyTo$1(e,0,this._count)},CopyTo$1:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("arrayIndex");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if(t>e.length||n>(e.length-t|0))throw new System.ArgumentException.$ctor1("Destination array is not long enough to copy all the items in the collection. Check array index and length.");for(var i=0,r=0;r<this._lastIndex&&i<n;r=r+1|0)0<=this._slots[System.Array.index(r,this._slots)].hashCode&&(e[System.Array.index(t+i|0,e)]=this._slots[System.Array.index(r,this._slots)].value,i=i+1|0)},remove:function(e){if(null!=this._buckets)for(var t=this.InternalGetHashCode(e),n=t%this._buckets.length,i=-1,r=this._buckets[System.Array.index(n,this._buckets)]-1|0;0<=r;i=r,r=this._slots[System.Array.index(r,this._slots)].next)if(this._slots[System.Array.index(r,this._slots)].hashCode===t&&this._comparer[Bridge.geti(this._comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(y)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2")](this._slots[System.Array.index(r,this._slots)].value,e))return i<0?this._buckets[System.Array.index(n,this._buckets)]=this._slots[System.Array.index(r,this._slots)].next+1|0:this._slots[System.Array.index(i,this._slots)].next=this._slots[System.Array.index(r,this._slots)].next,this._slots[System.Array.index(r,this._slots)].hashCode=-1,this._slots[System.Array.index(r,this._slots)].value=Bridge.getDefaultValue(y),this._slots[System.Array.index(r,this._slots)].next=this._freeList,this._count=this._count-1|0,this._version=this._version+1|0,0===this._count?(this._lastIndex=0,this._freeList=-1):this._freeList=r,!0;return!1},GetEnumerator:function(){return new(System.Collections.Generic.HashSet$1.Enumerator(y).$ctor1)(this)},System$Collections$Generic$IEnumerable$1$GetEnumerator:function(){return new(System.Collections.Generic.HashSet$1.Enumerator(y).$ctor1)(this).$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.HashSet$1.Enumerator(y).$ctor1)(this).$clone()},unionWith:function(e){var t;if(null==e)throw new System.ArgumentNullException.$ctor1("other");t=Bridge.getEnumerator(e,y);try{for(;t.moveNext();){var n=t.Current;this.AddIfNotPresent(n)}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}},intersectWith:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0!==this._count){var t=Bridge.as(e,System.Collections.Generic.ICollection$1(y));if(null!=t){if(0===System.Array.getCount(t,y))return void this.clear();t=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=t&&System.Collections.Generic.HashSet$1(y).AreEqualityComparersEqual(this,t))return void this.IntersectWithHashSetWithSameEC(t)}this.IntersectWithEnumerable(e)}},exceptWith:function(e){var t;if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0!==this._count)if(Bridge.referenceEquals(e,this))this.clear();else{t=Bridge.getEnumerator(e,y);try{for(;t.moveNext();){var n=t.Current;this.remove(n)}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}}},symmetricExceptWith:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");var t;0!==this._count?Bridge.referenceEquals(e,this)?this.clear():null!=(t=Bridge.as(e,System.Collections.Generic.HashSet$1(y)))&&System.Collections.Generic.HashSet$1(y).AreEqualityComparersEqual(this,t)?this.SymmetricExceptWithUniqueHashSet(t):this.SymmetricExceptWithEnumerable(e):this.unionWith(e)},isSubsetOf:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0===this._count)return!0;var t=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=t&&System.Collections.Generic.HashSet$1(y).AreEqualityComparersEqual(this,t))return!(this._count>t.Count)&&this.IsSubsetOfHashSetWithSameEC(t);e=this.CheckUniqueAndUnfoundElements(e,!1);return e.uniqueCount===this._count&&0<=e.unfoundCount},isProperSubsetOf:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");var t=Bridge.as(e,System.Collections.Generic.ICollection$1(y));if(null!=t){if(0===this._count)return 0<System.Array.getCount(t,y);t=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=t&&System.Collections.Generic.HashSet$1(y).AreEqualityComparersEqual(this,t))return!(this._count>=t.Count)&&this.IsSubsetOfHashSetWithSameEC(t)}e=this.CheckUniqueAndUnfoundElements(e,!1);return e.uniqueCount===this._count&&0<e.unfoundCount},isSupersetOf:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");var t=Bridge.as(e,System.Collections.Generic.ICollection$1(y));if(null!=t){if(0===System.Array.getCount(t,y))return!0;t=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=t&&System.Collections.Generic.HashSet$1(y).AreEqualityComparersEqual(this,t)&&t.Count>this._count)return!1}return this.ContainsAllElements(e)},isProperSupersetOf:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0===this._count)return!1;var t=Bridge.as(e,System.Collections.Generic.ICollection$1(y));if(null!=t){if(0===System.Array.getCount(t,y))return!0;t=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=t&&System.Collections.Generic.HashSet$1(y).AreEqualityComparersEqual(this,t))return!(t.Count>=this._count)&&this.ContainsAllElements(t)}e=this.CheckUniqueAndUnfoundElements(e,!0);return e.uniqueCount<this._count&&0===e.unfoundCount},overlaps:function(e){var t;if(null==e)throw new System.ArgumentNullException.$ctor1("other");if(0===this._count)return!1;t=Bridge.getEnumerator(e,y);try{for(;t.moveNext();){var n=t.Current;if(this.contains(n))return!0}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}return!1},setEquals:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("other");var t=Bridge.as(e,System.Collections.Generic.HashSet$1(y));if(null!=t&&System.Collections.Generic.HashSet$1(y).AreEqualityComparersEqual(this,t))return this._count===t.Count&&this.ContainsAllElements(t);t=Bridge.as(e,System.Collections.Generic.ICollection$1(y));if(null!=t&&0===this._count&&0<System.Array.getCount(t,y))return!1;e=this.CheckUniqueAndUnfoundElements(e,!0);return e.uniqueCount===this._count&&0===e.unfoundCount},RemoveWhere:function(e){if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException.$ctor1("match");for(var t,n=0,i=0;i<this._lastIndex;i=i+1|0)0<=this._slots[System.Array.index(i,this._slots)].hashCode&&(e(t=this._slots[System.Array.index(i,this._slots)].value)&&this.remove(t)&&(n=n+1|0));return n},TrimExcess:function(){if(0===this._count)this._buckets=null,this._slots=null,this._version=this._version+1|0;else{for(var e,t=System.Collections.HashHelpers.GetPrime(this._count),n=System.Array.init(t,function(){return new(System.Collections.Generic.HashSet$1.Slot(y))},System.Collections.Generic.HashSet$1.Slot(y)),i=System.Array.init(t,0,System.Int32),r=0,s=0;s<this._lastIndex;s=s+1|0)0<=this._slots[System.Array.index(s,this._slots)].hashCode&&(n[System.Array.index(r,n)]=this._slots[System.Array.index(s,this._slots)].$clone(),e=n[System.Array.index(r,n)].hashCode%t,n[System.Array.index(r,n)].next=i[System.Array.index(e,i)]-1|0,i[System.Array.index(e,i)]=r+1|0,r=r+1|0);this._lastIndex=r,this._slots=n,this._buckets=i,this._freeList=-1}},Initialize:function(e){e=System.Collections.HashHelpers.GetPrime(e);this._buckets=System.Array.init(e,0,System.Int32),this._slots=System.Array.init(e,function(){return new(System.Collections.Generic.HashSet$1.Slot(y))},System.Collections.Generic.HashSet$1.Slot(y))},IncreaseCapacity:function(){var e=System.Collections.HashHelpers.ExpandPrime(this._count);if(e<=this._count)throw new System.ArgumentException.$ctor1("HashSet capacity is too big.");this.SetCapacity(e,!1)},SetCapacity:function(e,t){var n=System.Array.init(e,function(){return new(System.Collections.Generic.HashSet$1.Slot(y))},System.Collections.Generic.HashSet$1.Slot(y));if(null!=this._slots)for(var i=0;i<this._lastIndex;i=i+1|0)n[System.Array.index(i,n)]=this._slots[System.Array.index(i,this._slots)].$clone();if(t)for(var r=0;r<this._lastIndex;r=r+1|0)-1!==n[System.Array.index(r,n)].hashCode&&(n[System.Array.index(r,n)].hashCode=this.InternalGetHashCode(n[System.Array.index(r,n)].value));for(var s=System.Array.init(e,0,System.Int32),o=0;o<this._lastIndex;o=o+1|0){var a=n[System.Array.index(o,n)].hashCode%e;n[System.Array.index(o,n)].next=s[System.Array.index(a,s)]-1|0,s[System.Array.index(a,s)]=o+1|0}this._slots=n,this._buckets=s},AddIfNotPresent:function(e){null==this._buckets&&this.Initialize(0);for(var t,n=this.InternalGetHashCode(e),i=n%this._buckets.length,r=this._buckets[System.Array.index(i,this._buckets)]-1|0;0<=r;r=this._slots[System.Array.index(r,this._slots)].next)if(this._slots[System.Array.index(r,this._slots)].hashCode===n&&this._comparer[Bridge.geti(this._comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(y)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2")](this._slots[System.Array.index(r,this._slots)].value,e))return!1;return 0<=this._freeList?(t=this._freeList,this._freeList=this._slots[System.Array.index(t,this._slots)].next):(this._lastIndex===this._slots.length&&(this.IncreaseCapacity(),i=n%this._buckets.length),t=this._lastIndex,this._lastIndex=this._lastIndex+1|0),this._slots[System.Array.index(t,this._slots)].hashCode=n,this._slots[System.Array.index(t,this._slots)].value=e,this._slots[System.Array.index(t,this._slots)].next=this._buckets[System.Array.index(i,this._buckets)]-1|0,this._buckets[System.Array.index(i,this._buckets)]=t+1|0,this._count=this._count+1|0,this._version=this._version+1|0,!0},ContainsAllElements:function(e){var t=Bridge.getEnumerator(e,y);try{for(;t.moveNext();){var n=t.Current;if(!this.contains(n))return!1}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}return!0},IsSubsetOfHashSetWithSameEC:function(e){var t=Bridge.getEnumerator(this);try{for(;t.moveNext();){var n=t.Current;if(!e.contains(n))return!1}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}return!0},IntersectWithHashSetWithSameEC:function(e){for(var t,n=0;n<this._lastIndex;n=n+1|0)0<=this._slots[System.Array.index(n,this._slots)].hashCode&&(t=this._slots[System.Array.index(n,this._slots)].value,e.contains(t)||this.remove(t))},IntersectWithEnumerable:function(e){var t=this._lastIndex,n=System.Collections.Generic.BitHelper.ToIntArrayLength(t),i=System.Array.init(n,0,System.Int32),r=new System.Collections.Generic.BitHelper(i,n),s=Bridge.getEnumerator(e,y);try{for(;s.moveNext();){var o=s.Current,o=this.InternalIndexOf(o);0<=o&&r.MarkBit(o)}}finally{Bridge.is(s,System.IDisposable)&&s.System$IDisposable$Dispose()}for(var a=0;a<t;a=a+1|0)0<=this._slots[System.Array.index(a,this._slots)].hashCode&&!r.IsMarked(a)&&this.remove(this._slots[System.Array.index(a,this._slots)].value)},InternalIndexOf:function(e){for(var t=this.InternalGetHashCode(e),n=this._buckets[System.Array.index(t%this._buckets.length,this._buckets)]-1|0;0<=n;n=this._slots[System.Array.index(n,this._slots)].next)if(this._slots[System.Array.index(n,this._slots)].hashCode===t&&this._comparer[Bridge.geti(this._comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(y)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2")](this._slots[System.Array.index(n,this._slots)].value,e))return n;return-1},SymmetricExceptWithUniqueHashSet:function(e){var t=Bridge.getEnumerator(e);try{for(;t.moveNext();){var n=t.Current;this.remove(n)||this.AddIfNotPresent(n)}}finally{Bridge.is(t,System.IDisposable)&&t.System$IDisposable$Dispose()}},SymmetricExceptWithEnumerable:function(e){var t=this._lastIndex,n=System.Collections.Generic.BitHelper.ToIntArrayLength(t),i=System.Array.init(n,0,System.Int32),r=new System.Collections.Generic.BitHelper(i,n),i=System.Array.init(n,0,System.Int32),s=new System.Collections.Generic.BitHelper(i,n),o=Bridge.getEnumerator(e,y);try{for(;o.moveNext();){var a=o.Current,u={v:0};this.AddOrGetLocation(a,u)?s.MarkBit(u.v):u.v<t&&!s.IsMarked(u.v)&&r.MarkBit(u.v)}}finally{Bridge.is(o,System.IDisposable)&&o.System$IDisposable$Dispose()}for(var l=0;l<t;l=l+1|0)r.IsMarked(l)&&this.remove(this._slots[System.Array.index(l,this._slots)].value)},AddOrGetLocation:function(e,t){for(var n,i=this.InternalGetHashCode(e),r=i%this._buckets.length,s=this._buckets[System.Array.index(r,this._buckets)]-1|0;0<=s;s=this._slots[System.Array.index(s,this._slots)].next)if(this._slots[System.Array.index(s,this._slots)].hashCode===i&&this._comparer[Bridge.geti(this._comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(y)+"$equals2","System$Collections$Generic$IEqualityComparer$1$equals2")](this._slots[System.Array.index(s,this._slots)].value,e))return t.v=s,!1;return 0<=this._freeList?(n=this._freeList,this._freeList=this._slots[System.Array.index(n,this._slots)].next):(this._lastIndex===this._slots.length&&(this.IncreaseCapacity(),r=i%this._buckets.length),n=this._lastIndex,this._lastIndex=this._lastIndex+1|0),this._slots[System.Array.index(n,this._slots)].hashCode=i,this._slots[System.Array.index(n,this._slots)].value=e,this._slots[System.Array.index(n,this._slots)].next=this._buckets[System.Array.index(r,this._buckets)]-1|0,this._buckets[System.Array.index(r,this._buckets)]=n+1|0,this._count=this._count+1|0,this._version=this._version+1|0,t.v=n,!0},CheckUniqueAndUnfoundElements:function(e,t){var n=new(System.Collections.Generic.HashSet$1.ElementCount(y));if(0===this._count){var i=0,r=Bridge.getEnumerator(e,y);try{for(;r.moveNext();){r.Current;i=i+1|0;break}}finally{Bridge.is(r,System.IDisposable)&&r.System$IDisposable$Dispose()}return n.uniqueCount=0,n.unfoundCount=i,n.$clone()}var s=this._lastIndex,o=System.Collections.Generic.BitHelper.ToIntArrayLength(s),s=System.Array.init(o,0,System.Int32),a=new System.Collections.Generic.BitHelper(s,o),u=0,l=0,c=Bridge.getEnumerator(e,y);try{for(;c.moveNext();){var m=c.Current,m=this.InternalIndexOf(m);if(0<=m)a.IsMarked(m)||(a.MarkBit(m),l=l+1|0);else if(u=u+1|0,t)break}}finally{Bridge.is(c,System.IDisposable)&&c.System$IDisposable$Dispose()}return n.uniqueCount=l,n.unfoundCount=u,n.$clone()},ToArray:function(){var e=System.Array.init(this.Count,function(){return Bridge.getDefaultValue(y)},y);return this.CopyTo(e),e},InternalGetHashCode:function(e){return null==e?0:this._comparer[Bridge.geti(this._comparer,"System$Collections$Generic$IEqualityComparer$1$"+Bridge.getTypeAlias(y)+"$getHashCode2","System$Collections$Generic$IEqualityComparer$1$getHashCode2")](e)&System.Collections.Generic.HashSet$1(y).Lower31BitMask}}}}),Bridge.define("System.Collections.Generic.HashSet$1.ElementCount",function(t){return{$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.HashSet$1.ElementCount(t))}}},fields:{uniqueCount:0,unfoundCount:0},ctors:{ctor:function(){this.$initialize()}},methods:{getHashCode:function(){return Bridge.addHash([4920463385,this.uniqueCount,this.unfoundCount])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.HashSet$1.ElementCount(t))&&(Bridge.equals(this.uniqueCount,e.uniqueCount)&&Bridge.equals(this.unfoundCount,e.unfoundCount))},$clone:function(e){e=e||new(System.Collections.Generic.HashSet$1.ElementCount(t));return e.uniqueCount=this.uniqueCount,e.unfoundCount=this.unfoundCount,e}}}}),Bridge.define("System.Collections.Generic.HashSet$1.Enumerator",function(t){return{inherits:[System.Collections.Generic.IEnumerator$1(t)],$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.HashSet$1.Enumerator(t))}}},fields:{_set:null,_index:0,_version:0,_current:Bridge.getDefaultValue(t)},props:{Current:{get:function(){return this._current}},System$Collections$IEnumerator$Current:{get:function(){if(0===this._index||this._index===(this._set._lastIndex+1|0))throw new System.InvalidOperationException.$ctor1("Enumeration has either not started or has already finished.");return this.Current}}},alias:["Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{$ctor1:function(e){this.$initialize(),this._set=e,this._index=0,this._version=e._version,this._current=Bridge.getDefaultValue(t)},ctor:function(){this.$initialize()}},methods:{Dispose:function(){},moveNext:function(){var e;if(this._version!==this._set._version)throw new System.InvalidOperationException.$ctor1("Collection was modified; enumeration operation may not execute.");for(;this._index<this._set._lastIndex;){if(0<=(e=this._set._slots)[System.Array.index(this._index,e)].hashCode)return this._current=(e=this._set._slots)[System.Array.index(this._index,e)].value,this._index=this._index+1|0,!0;this._index=this._index+1|0}return this._index=this._set._lastIndex+1|0,this._current=Bridge.getDefaultValue(t),!1},System$Collections$IEnumerator$reset:function(){if(this._version!==this._set._version)throw new System.InvalidOperationException.$ctor1("Collection was modified; enumeration operation may not execute.");this._index=0,this._current=Bridge.getDefaultValue(t)},getHashCode:function(){return Bridge.addHash([3788985113,this._set,this._index,this._version,this._current])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.HashSet$1.Enumerator(t))&&(Bridge.equals(this._set,e._set)&&Bridge.equals(this._index,e._index)&&Bridge.equals(this._version,e._version)&&Bridge.equals(this._current,e._current))},$clone:function(e){e=e||new(System.Collections.Generic.HashSet$1.Enumerator(t));return e._set=this._set,e._index=this._index,e._version=this._version,e._current=this._current,e}}}}),Bridge.define("System.Collections.Generic.HashSet$1.Slot",function(t){return{$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.HashSet$1.Slot(t))}}},fields:{hashCode:0,value:Bridge.getDefaultValue(t),next:0},ctors:{ctor:function(){this.$initialize()}},methods:{getHashCode:function(){return Bridge.addHash([1953459283,this.hashCode,this.value,this.next])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.HashSet$1.Slot(t))&&(Bridge.equals(this.hashCode,e.hashCode)&&Bridge.equals(this.value,e.value)&&Bridge.equals(this.next,e.next))},$clone:function(e){e=e||new(System.Collections.Generic.HashSet$1.Slot(t));return e.hashCode=this.hashCode,e.value=this.value,e.next=this.next,e}}}}),Bridge.define("System.Collections.Generic.List$1.Enumerator",function(t){return{inherits:[System.Collections.Generic.IEnumerator$1(t),System.Collections.IEnumerator],$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.List$1.Enumerator(t))}}},fields:{list:null,index:0,version:0,current:Bridge.getDefaultValue(t)},props:{Current:{get:function(){return this.current}},System$Collections$IEnumerator$Current:{get:function(){if(0===this.index||this.index===(this.list._size+1|0))throw new System.InvalidOperationException.ctor;return this.Current}}},alias:["Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{$ctor1:function(e){this.$initialize(),this.list=e,this.index=0,this.version=e._version,this.current=Bridge.getDefaultValue(t)},ctor:function(){this.$initialize()}},methods:{Dispose:function(){},moveNext:function(){var e=this.list;return this.version===e._version&&this.index>>>0<e._size>>>0?(this.current=e._items[System.Array.index(this.index,e._items)],this.index=this.index+1|0,!0):this.MoveNextRare()},MoveNextRare:function(){if(this.version!==this.list._version)throw new System.InvalidOperationException.ctor;return this.index=this.list._size+1|0,this.current=Bridge.getDefaultValue(t),!1},System$Collections$IEnumerator$reset:function(){if(this.version!==this.list._version)throw new System.InvalidOperationException.ctor;this.index=0,this.current=Bridge.getDefaultValue(t)},getHashCode:function(){return Bridge.addHash([3788985113,this.list,this.index,this.version,this.current])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.List$1.Enumerator(t))&&(Bridge.equals(this.list,e.list)&&Bridge.equals(this.index,e.index)&&Bridge.equals(this.version,e.version)&&Bridge.equals(this.current,e.current))},$clone:function(e){e=e||new(System.Collections.Generic.List$1.Enumerator(t));return e.list=this.list,e.index=this.index,e.version=this.version,e.current=this.current,e}}}}),Bridge.define("System.Collections.Generic.Queue$1",function(r){return{inherits:[System.Collections.Generic.IEnumerable$1(r),System.Collections.ICollection,System.Collections.Generic.IReadOnlyCollection$1(r)],statics:{fields:{MinimumGrow:0,GrowFactor:0,DefaultCapacity:0},ctors:{init:function(){this.MinimumGrow=4,this.GrowFactor=200,this.DefaultCapacity=4}}},fields:{_array:null,_head:0,_tail:0,_size:0,_version:0},props:{Count:{get:function(){return this._size}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return this}},IsReadOnly:{get:function(){return!1}}},alias:["Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(r)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","copyTo","System$Collections$ICollection$copyTo","System$Collections$Generic$IEnumerable$1$GetEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(r)+"$GetEnumerator"],ctors:{ctor:function(){this.$initialize(),this._array=System.Array.init(0,function(){return Bridge.getDefaultValue(r)},r)},$ctor2:function(e){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException.$ctor4("capacity","Non-negative number required.");this._array=System.Array.init(e,function(){return Bridge.getDefaultValue(r)},r)},$ctor1:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("collection");this._array=System.Array.init(System.Collections.Generic.Queue$1(r).DefaultCapacity,function(){return Bridge.getDefaultValue(r)},r);var t=Bridge.getEnumerator(e,r);try{for(;t.System$Collections$IEnumerator$moveNext();)this.Enqueue(t[Bridge.geti(t,"System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(r)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1")])}finally{Bridge.hasValue(t)&&t.System$IDisposable$Dispose()}}},methods:{copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(1!==System.Array.getRank(e))throw new System.ArgumentException.$ctor1("Only single dimensional arrays are supported for the requested action.");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if((e.length-t|0)<this._size)throw new System.ArgumentException.$ctor1("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");var n,i=this._size;0!==i&&(n=(this._array.length-this._head|0)<i?this._array.length-this._head|0:i,System.Array.copy(this._array,this._head,e,t,n),0<(i=i-n|0)&&System.Array.copy(this._array,0,e,(t+this._array.length|0)-this._head|0,i))},CopyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(t<0||t>e.length)throw new System.ArgumentOutOfRangeException.$ctor4("arrayIndex","Index was out of range. Must be non-negative and less than the size of the collection.");var n=e.length;if((n-t|0)<this._size)throw new System.ArgumentException.$ctor1("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");var i=(n-t|0)<this._size?n-t|0:this._size;0!==i&&(n=(this._array.length-this._head|0)<i?this._array.length-this._head|0:i,System.Array.copy(this._array,this._head,e,t,n),0<(i=i-n|0)&&System.Array.copy(this._array,0,e,(t+this._array.length|0)-this._head|0,i))},Clear:function(){this._head<this._tail?System.Array.fill(this._array,function(){return Bridge.getDefaultValue(r)},this._head,this._size):(System.Array.fill(this._array,function(){return Bridge.getDefaultValue(r)},this._head,this._array.length-this._head|0),System.Array.fill(this._array,function(){return Bridge.getDefaultValue(r)},0,this._tail)),this._head=0,this._tail=0,this._size=0,this._version=this._version+1|0},Enqueue:function(e){var t;this._size===this._array.length&&((t=0|Bridge.Int.div(Bridge.Int.mul(this._array.length,System.Collections.Generic.Queue$1(r).GrowFactor),100))<(this._array.length+System.Collections.Generic.Queue$1(r).MinimumGrow|0)&&(t=this._array.length+System.Collections.Generic.Queue$1(r).MinimumGrow|0),this.SetCapacity(t)),this._array[System.Array.index(this._tail,this._array)]=e,this._tail=this.MoveNext(this._tail),this._size=this._size+1|0,this._version=this._version+1|0},GetEnumerator:function(){return new(System.Collections.Generic.Queue$1.Enumerator(r).$ctor1)(this)},System$Collections$Generic$IEnumerable$1$GetEnumerator:function(){return new(System.Collections.Generic.Queue$1.Enumerator(r).$ctor1)(this).$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.Queue$1.Enumerator(r).$ctor1)(this).$clone()},Dequeue:function(){if(0===this._size)throw new System.InvalidOperationException.$ctor1("Queue empty.");var e=this._array[System.Array.index(this._head,this._array)];return this._array[System.Array.index(this._head,this._array)]=Bridge.getDefaultValue(r),this._head=this.MoveNext(this._head),this._size=this._size-1|0,this._version=this._version+1|0,e},Peek:function(){if(0===this._size)throw new System.InvalidOperationException.$ctor1("Queue empty.");return this._array[System.Array.index(this._head,this._array)]},Contains:function(e){for(var t=this._head,n=this._size,i=System.Collections.Generic.EqualityComparer$1(r).def;0<Bridge.identity(n,n=n-1|0);){if(null==e){if(null==this._array[System.Array.index(t,this._array)])return!0}else if(null!=this._array[System.Array.index(t,this._array)]&&i.equals2(this._array[System.Array.index(t,this._array)],e))return!0;t=this.MoveNext(t)}return!1},GetElement:function(e){return this._array[System.Array.index((this._head+e|0)%this._array.length,this._array)]},ToArray:function(){var e=System.Array.init(this._size,function(){return Bridge.getDefaultValue(r)},r);return 0===this._size||(this._head<this._tail?System.Array.copy(this._array,this._head,e,0,this._size):(System.Array.copy(this._array,this._head,e,0,this._array.length-this._head|0),System.Array.copy(this._array,0,e,this._array.length-this._head|0,this._tail))),e},SetCapacity:function(e){var t=System.Array.init(e,function(){return Bridge.getDefaultValue(r)},r);0<this._size&&(this._head<this._tail?System.Array.copy(this._array,this._head,t,0,this._size):(System.Array.copy(this._array,this._head,t,0,this._array.length-this._head|0),System.Array.copy(this._array,0,t,this._array.length-this._head|0,this._tail))),this._array=t,this._head=0,this._tail=this._size===e?0:this._size,this._version=this._version+1|0},MoveNext:function(e){e=e+1|0;return e===this._array.length?0:e},TrimExcess:function(){var e=Bridge.Int.clip32(.9*this._array.length);this._size<e&&this.SetCapacity(this._size)}}}}),Bridge.define("System.Collections.Generic.ICollectionDebugView$1",function(t){return{fields:{_collection:null},props:{Items:{get:function(){var e=System.Array.init(System.Array.getCount(this._collection,t),function(){return Bridge.getDefaultValue(t)},t);return System.Array.copyTo(this._collection,e,0,t),e}}},ctors:{ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("collection");this._collection=e}}}}),Bridge.define("System.Collections.Generic.IDictionaryDebugView$2",function(t,n){return{fields:{_dict:null},props:{Items:{get:function(){var e=System.Array.init(System.Array.getCount(this._dict,System.Collections.Generic.KeyValuePair$2(t,n)),function(){return new(System.Collections.Generic.KeyValuePair$2(t,n))},System.Collections.Generic.KeyValuePair$2(t,n));return System.Array.copyTo(this._dict,e,0,System.Collections.Generic.KeyValuePair$2(t,n)),e}}},ctors:{ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("dictionary");this._dict=e}}}}),Bridge.define("System.Collections.Generic.Queue$1.Enumerator",function(t){return{inherits:[System.Collections.Generic.IEnumerator$1(t),System.Collections.IEnumerator],$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.Queue$1.Enumerator(t))}}},fields:{_q:null,_index:0,_version:0,_currentElement:Bridge.getDefaultValue(t)},props:{Current:{get:function(){if(this._index<0)throw-1===this._index?new System.InvalidOperationException.$ctor1("Enumeration has not started. Call MoveNext."):new System.InvalidOperationException.$ctor1("Enumeration already finished.");return this._currentElement}},System$Collections$IEnumerator$Current:{get:function(){return this.Current}}},alias:["Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{$ctor1:function(e){this.$initialize(),this._q=e,this._version=this._q._version,this._index=-1,this._currentElement=Bridge.getDefaultValue(t)},ctor:function(){this.$initialize()}},methods:{Dispose:function(){this._index=-2,this._currentElement=Bridge.getDefaultValue(t)},moveNext:function(){if(this._version!==this._q._version)throw new System.InvalidOperationException.$ctor1("Collection was modified; enumeration operation may not execute.");return-2!==this._index&&(this._index=this._index+1|0,this._index===this._q._size?(this._index=-2,this._currentElement=Bridge.getDefaultValue(t),!1):(this._currentElement=this._q.GetElement(this._index),!0))},System$Collections$IEnumerator$reset:function(){if(this._version!==this._q._version)throw new System.InvalidOperationException.$ctor1("Collection was modified; enumeration operation may not execute.");this._index=-1,this._currentElement=Bridge.getDefaultValue(t)},getHashCode:function(){return Bridge.addHash([3788985113,this._q,this._index,this._version,this._currentElement])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.Queue$1.Enumerator(t))&&(Bridge.equals(this._q,e._q)&&Bridge.equals(this._index,e._index)&&Bridge.equals(this._version,e._version)&&Bridge.equals(this._currentElement,e._currentElement))},$clone:function(e){e=e||new(System.Collections.Generic.Queue$1.Enumerator(t));return e._q=this._q,e._index=this._index,e._version=this._version,e._currentElement=this._currentElement,e}}}}),Bridge.define("System.Collections.Generic.Stack$1",function(i){return{inherits:[System.Collections.Generic.IEnumerable$1(i),System.Collections.ICollection,System.Collections.Generic.IReadOnlyCollection$1(i)],statics:{fields:{DefaultCapacity:0},ctors:{init:function(){this.DefaultCapacity=4}}},fields:{_array:null,_size:0,_version:0},props:{Count:{get:function(){return this._size}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return this}},IsReadOnly:{get:function(){return!1}}},alias:["Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(i)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","copyTo","System$Collections$ICollection$copyTo","System$Collections$Generic$IEnumerable$1$GetEnumerator","System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(i)+"$GetEnumerator"],ctors:{ctor:function(){this.$initialize(),this._array=System.Array.init(0,function(){return Bridge.getDefaultValue(i)},i)},$ctor2:function(e){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException.$ctor4("capacity","Non-negative number required.");this._array=System.Array.init(e,function(){return Bridge.getDefaultValue(i)},i)},$ctor1:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("collection");var t={};this._array=Bridge.Collections.EnumerableHelpers.ToArray$1(i,e,t),this._size=t.v}},methods:{Clear:function(){System.Array.fill(this._array,function(){return Bridge.getDefaultValue(i)},0,this._size),this._size=0,this._version=this._version+1|0},Contains:function(e){for(var t=this._size,n=System.Collections.Generic.EqualityComparer$1(i).def;0<Bridge.identity(t,t=t-1|0);)if(null==e){if(null==this._array[System.Array.index(t,this._array)])return!0}else if(null!=this._array[System.Array.index(t,this._array)]&&n.equals2(this._array[System.Array.index(t,this._array)],e))return!0;return!1},CopyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(t<0||t>e.length)throw new System.ArgumentOutOfRangeException.$ctor4("arrayIndex","Non-negative number required.");if((e.length-t|0)<this._size)throw new System.ArgumentException.$ctor1("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");if(Bridge.referenceEquals(e,this._array))System.Array.copy(this._array,0,e,t,this._size),System.Array.reverse(e,t,this._size);else for(var n=0,i=t+this._size|0,r=0;r<this._size;r=r+1|0)e[System.Array.index(i=i-1|0,e)]=this._array[System.Array.index(Bridge.identity(n,n=n+1|0),this._array)]},copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(1!==System.Array.getRank(e))throw new System.ArgumentException.$ctor1("Only single dimensional arrays are supported for the requested action.");if(0!==System.Array.getLower(e,0))throw new System.ArgumentException.$ctor1("The lower bound of target array must be zero.");if(t<0||t>e.length)throw new System.ArgumentOutOfRangeException.$ctor4("arrayIndex","Non-negative number required.");if((e.length-t|0)<this._size)throw new System.ArgumentException.$ctor1("Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.");try{System.Array.copy(this._array,0,e,t,this._size),System.Array.reverse(e,t,this._size)}catch(e){throw e=System.Exception.create(e),new System.ArgumentException.$ctor1("Target array type is not compatible with the type of items in the collection.")}},GetEnumerator:function(){return new(System.Collections.Generic.Stack$1.Enumerator(i).$ctor1)(this)},System$Collections$Generic$IEnumerable$1$GetEnumerator:function(){return new(System.Collections.Generic.Stack$1.Enumerator(i).$ctor1)(this).$clone()},System$Collections$IEnumerable$GetEnumerator:function(){return new(System.Collections.Generic.Stack$1.Enumerator(i).$ctor1)(this).$clone()},TrimExcess:function(){var e=Bridge.Int.clip32(.9*this._array.length);this._size<e&&(e={v:this._array},System.Array.resize(e,this._size,function(){return Bridge.getDefaultValue(i)},i),this._array=e.v,this._version=this._version+1|0)},Peek:function(){if(0===this._size)throw new System.InvalidOperationException.$ctor1("Stack empty.");return this._array[System.Array.index(this._size-1|0,this._array)]},Pop:function(){if(0===this._size)throw new System.InvalidOperationException.$ctor1("Stack empty.");this._version=this._version+1|0;var e=this._array[System.Array.index(this._size=this._size-1|0,this._array)];return this._array[System.Array.index(this._size,this._array)]=Bridge.getDefaultValue(i),e},Push:function(e){var t;this._size===this._array.length&&(t={v:this._array},System.Array.resize(t,0===this._array.length?System.Collections.Generic.Stack$1(i).DefaultCapacity:Bridge.Int.mul(2,this._array.length),function(){return Bridge.getDefaultValue(i)},i),this._array=t.v),this._array[System.Array.index(Bridge.identity(this._size,this._size=this._size+1|0),this._array)]=e,this._version=this._version+1|0},ToArray:function(){for(var e=System.Array.init(this._size,function(){return Bridge.getDefaultValue(i)},i),t=0;t<this._size;)e[System.Array.index(t,e)]=this._array[System.Array.index((this._size-t|0)-1|0,this._array)],t=t+1|0;return e}}}}),Bridge.define("System.Collections.Generic.Stack$1.Enumerator",function(n){return{inherits:[System.Collections.Generic.IEnumerator$1(n),System.Collections.IEnumerator],$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new(System.Collections.Generic.Stack$1.Enumerator(n))}}},fields:{_stack:null,_index:0,_version:0,_currentElement:Bridge.getDefaultValue(n)},props:{Current:{get:function(){if(-2===this._index)throw new System.InvalidOperationException.$ctor1("Enumeration has not started. Call MoveNext.");if(-1===this._index)throw new System.InvalidOperationException.$ctor1("Enumeration already finished.");return this._currentElement}},System$Collections$IEnumerator$Current:{get:function(){if(-2===this._index)throw new System.InvalidOperationException.$ctor1("Enumeration has not started. Call MoveNext.");if(-1===this._index)throw new System.InvalidOperationException.$ctor1("Enumeration already finished.");return this._currentElement}}},alias:["Dispose","System$IDisposable$Dispose","moveNext","System$Collections$IEnumerator$moveNext","Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(n)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"]],ctors:{$ctor1:function(e){this.$initialize(),this._stack=e,this._version=this._stack._version,this._index=-2,this._currentElement=Bridge.getDefaultValue(n)},ctor:function(){this.$initialize()}},methods:{Dispose:function(){this._index=-1},moveNext:function(){var e,t;if(this._version!==this._stack._version)throw new System.InvalidOperationException.$ctor1("Collection was modified; enumeration operation may not execute.");return-2===this._index?(this._index=this._stack._size-1|0,(t=0<=this._index)&&(this._currentElement=(e=this._stack._array)[System.Array.index(this._index,e)]),t):-1!==this._index&&(t=0<=(this._index=this._index-1|0),this._currentElement=t?(e=this._stack._array)[System.Array.index(this._index,e)]:Bridge.getDefaultValue(n),t)},System$Collections$IEnumerator$reset:function(){if(this._version!==this._stack._version)throw new System.InvalidOperationException.$ctor1("Collection was modified; enumeration operation may not execute.");this._index=-2,this._currentElement=Bridge.getDefaultValue(n)},getHashCode:function(){return Bridge.addHash([3788985113,this._stack,this._index,this._version,this._currentElement])},equals:function(e){return!!Bridge.is(e,System.Collections.Generic.Stack$1.Enumerator(n))&&(Bridge.equals(this._stack,e._stack)&&Bridge.equals(this._index,e._index)&&Bridge.equals(this._version,e._version)&&Bridge.equals(this._currentElement,e._currentElement))},$clone:function(e){e=e||new(System.Collections.Generic.Stack$1.Enumerator(n));return e._stack=this._stack,e._index=this._index,e._version=this._version,e._currentElement=this._currentElement,e}}}}),Bridge.define("System.Collections.HashHelpers",{statics:{fields:{HashPrime:0,MaxPrimeArrayLength:0,RandomSeed:0,primes:null},ctors:{init:function(){this.HashPrime=101,this.MaxPrimeArrayLength=2146435069,this.RandomSeed=System.Guid.NewGuid().getHashCode(),this.primes=System.Array.init([3,7,11,17,23,29,37,47,59,71,89,107,131,163,197,239,293,353,431,521,631,761,919,1103,1327,1597,1931,2333,2801,3371,4049,4861,5839,7013,8419,10103,12143,14591,17519,21023,25229,30293,36353,43627,52361,62851,75431,90523,108631,130363,156437,187751,225307,270371,324449,389357,467237,560689,672827,807403,968897,1162687,1395263,1674319,2009191,2411033,2893249,3471899,4166287,4999559,5999471,7199369],System.Int32)}},methods:{Combine:function(e,t){return((0|(e>>>0<<5>>>0|e>>>0>>>27)>>>0)+e|0)^t},IsPrime:function(e){if(0==(1&e))return 2===e;for(var t=Bridge.Int.clip32(Math.sqrt(e)),n=3;n<=t;n=n+2|0)if(e%n==0)return!1;return!0},GetPrime:function(e){if(e<0)throw new System.ArgumentException.$ctor1("Hashtable's capacity overflowed and went negative. Check load factor, capacity and the current size of the table.");for(var t=0;t<System.Collections.HashHelpers.primes.length;t=t+1|0){var n=System.Collections.HashHelpers.primes[System.Array.index(t,System.Collections.HashHelpers.primes)];if(e<=n)return n}for(var i=1|e;i<2147483647;i=i+2|0)if(System.Collections.HashHelpers.IsPrime(i)&&(i-1|0)%System.Collections.HashHelpers.HashPrime!=0)return i;return e},GetMinPrime:function(){return System.Collections.HashHelpers.primes[System.Array.index(0,System.Collections.HashHelpers.primes)]},ExpandPrime:function(e){var t=Bridge.Int.mul(2,e);return t>>>0>System.Collections.HashHelpers.MaxPrimeArrayLength&&System.Collections.HashHelpers.MaxPrimeArrayLength>e?System.Collections.HashHelpers.MaxPrimeArrayLength:System.Collections.HashHelpers.GetPrime(t)}}}}),Bridge.define("System.Collections.ObjectModel.Collection$1",function(a){return{inherits:[System.Collections.Generic.IList$1(a),System.Collections.IList,System.Collections.Generic.IReadOnlyList$1(a)],statics:{methods:{IsCompatibleObject:function(e){return Bridge.is(e,a)||null==e&&null==Bridge.getDefaultValue(a)}}},fields:{items:null,_syncRoot:null},props:{Count:{get:function(){return System.Array.getCount(this.items,a)}},Items:{get:function(){return this.items}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return System.Array.getIsReadOnly(this.items,a)}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){if(null==this._syncRoot){var e=Bridge.as(this.items,System.Collections.ICollection);if(null==e)throw System.NotImplemented.ByDesign;this._syncRoot=e.System$Collections$ICollection$SyncRoot}return this._syncRoot}},System$Collections$IList$IsReadOnly:{get:function(){return System.Array.getIsReadOnly(this.items,a)}},System$Collections$IList$IsFixedSize:{get:function(){var e=Bridge.as(this.items,System.Collections.IList);return null!=e?System.Array.isFixedSize(e):System.Array.getIsReadOnly(this.items,a)}}},alias:["Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(a)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$Count","getItem",["System$Collections$Generic$IReadOnlyList$1$"+Bridge.getTypeAlias(a)+"$getItem","System$Collections$Generic$IReadOnlyList$1$getItem"],"setItem",["System$Collections$Generic$IReadOnlyList$1$"+Bridge.getTypeAlias(a)+"$setItem","System$Collections$Generic$IReadOnlyList$1$setItem"],"getItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$getItem","setItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$setItem","add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$add","clear","System$Collections$IList$clear","clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$clear","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$copyTo","contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$contains","GetEnumerator",["System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(a)+"$GetEnumerator","System$Collections$Generic$IEnumerable$1$GetEnumerator"],"indexOf","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$indexOf","insert","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$insert","remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$remove","removeAt","System$Collections$IList$removeAt","removeAt","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$removeAt","System$Collections$Generic$ICollection$1$IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$IsReadOnly"],ctors:{ctor:function(){this.$initialize(),this.items=new(System.Collections.Generic.List$1(a).ctor)},$ctor1:function(e){this.$initialize(),null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.list),this.items=e}},methods:{getItem:function(e){return System.Array.getItem(this.items,e,a)},setItem:function(e,t){System.Array.getIsReadOnly(this.items,a)&&System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ReadOnlyCollection),(e<0||e>=System.Array.getCount(this.items,a))&&System.ThrowHelper.ThrowArgumentOutOfRange_IndexException(),this.SetItem(e,t)},System$Collections$IList$getItem:function(e){return System.Array.getItem(this.items,e,a)},System$Collections$IList$setItem:function(e,t){System.ThrowHelper.IfNullAndNullsAreIllegalThenThrow(a,t,System.ExceptionArgument.value);try{this.setItem(e,Bridge.cast(Bridge.unbox(t,a),a))}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongValueTypeArgumentException(System.Object,t,a)}},add:function(e){System.Array.getIsReadOnly(this.items,a)&&System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ReadOnlyCollection);var t=System.Array.getCount(this.items,a);this.InsertItem(t,e)},System$Collections$IList$add:function(t){System.Array.getIsReadOnly(this.items,a)&&System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ReadOnlyCollection),System.ThrowHelper.IfNullAndNullsAreIllegalThenThrow(a,t,System.ExceptionArgument.value);try{this.add(Bridge.cast(Bridge.unbox(t,a),a))}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongValueTypeArgumentException(System.Object,t,a)}return this.Count-1|0},clear:function(){System.Array.getIsReadOnly(this.items,a)&&System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ReadOnlyCollection),this.ClearItems()},copyTo:function(e,t){System.Array.copyTo(this.items,e,t,a)},System$Collections$ICollection$copyTo:function(e,t){null==e&&System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.array),1!==System.Array.getRank(e)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_RankMultiDimNotSupported),0!==System.Array.getLower(e,0)&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_NonZeroLowerBound),t<0&&System.ThrowHelper.ThrowIndexArgumentOutOfRange_NeedNonNegNumException(),(e.length-t|0)<this.Count&&System.ThrowHelper.ThrowArgumentException(System.ExceptionResource.Arg_ArrayPlusOffTooSmall);var n=Bridge.as(e,System.Array.type(a));if(null!=n)System.Array.copyTo(this.items,n,t,a);else{var i=Bridge.getType(e).$elementType||null,n=a;Bridge.Reflection.isAssignableFrom(i,n)||Bridge.Reflection.isAssignableFrom(n,i)||System.ThrowHelper.ThrowArgumentException_Argument_InvalidArrayType();var r=Bridge.as(e,System.Array.type(System.Object));null==r&&System.ThrowHelper.ThrowArgumentException_Argument_InvalidArrayType();var s=System.Array.getCount(this.items,a);try{for(var o=0;o<s;o=o+1|0)r[System.Array.index(Bridge.identity(t,t=t+1|0),r)]=System.Array.getItem(this.items,o,a)}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.ArrayTypeMismatchException))throw e;System.ThrowHelper.ThrowArgumentException_Argument_InvalidArrayType()}}},contains:function(e){return System.Array.contains(this.items,e,a)},System$Collections$IList$contains:function(e){return!!System.Collections.ObjectModel.Collection$1(a).IsCompatibleObject(e)&&this.contains(Bridge.cast(Bridge.unbox(e,a),a))},GetEnumerator:function(){return Bridge.getEnumerator(this.items,a)},System$Collections$IEnumerable$GetEnumerator:function(){return Bridge.getEnumerator(Bridge.cast(this.items,System.Collections.IEnumerable))},indexOf:function(e){return System.Array.indexOf(this.items,e,0,null,a)},System$Collections$IList$indexOf:function(e){return System.Collections.ObjectModel.Collection$1(a).IsCompatibleObject(e)?this.indexOf(Bridge.cast(Bridge.unbox(e,a),a)):-1},insert:function(e,t){System.Array.getIsReadOnly(this.items,a)&&System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ReadOnlyCollection),(e<0||e>System.Array.getCount(this.items,a))&&System.ThrowHelper.ThrowArgumentOutOfRangeException$2(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_ListInsert),this.InsertItem(e,t)},System$Collections$IList$insert:function(e,t){System.Array.getIsReadOnly(this.items,a)&&System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ReadOnlyCollection),System.ThrowHelper.IfNullAndNullsAreIllegalThenThrow(a,t,System.ExceptionArgument.value);try{this.insert(e,Bridge.cast(Bridge.unbox(t,a),a))}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.InvalidCastException))throw e;System.ThrowHelper.ThrowWrongValueTypeArgumentException(System.Object,t,a)}},remove:function(e){System.Array.getIsReadOnly(this.items,a)&&System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ReadOnlyCollection);e=System.Array.indexOf(this.items,e,0,null,a);return!(e<0)&&(this.RemoveItem(e),!0)},System$Collections$IList$remove:function(e){System.Array.getIsReadOnly(this.items,a)&&System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ReadOnlyCollection),System.Collections.ObjectModel.Collection$1(a).IsCompatibleObject(e)&&this.remove(Bridge.cast(Bridge.unbox(e,a),a))},removeAt:function(e){System.Array.getIsReadOnly(this.items,a)&&System.ThrowHelper.ThrowNotSupportedException$1(System.ExceptionResource.NotSupported_ReadOnlyCollection),(e<0||e>=System.Array.getCount(this.items,a))&&System.ThrowHelper.ThrowArgumentOutOfRange_IndexException(),this.RemoveItem(e)},ClearItems:function(){System.Array.clear(this.items,a)},InsertItem:function(e,t){System.Array.insert(this.items,e,t,a)},RemoveItem:function(e){System.Array.removeAt(this.items,e,a)},SetItem:function(e,t){System.Array.setItem(this.items,e,t,a)}}}}),Bridge.define("System.Collections.ObjectModel.ReadOnlyCollection$1",function(a){return{inherits:[System.Collections.Generic.IList$1(a),System.Collections.IList,System.Collections.Generic.IReadOnlyList$1(a)],statics:{methods:{IsCompatibleObject:function(e){return Bridge.is(e,a)||null==e&&null==Bridge.getDefaultValue(a)}}},fields:{list:null},props:{Count:{get:function(){return System.Array.getCount(this.list,a)}},System$Collections$ICollection$IsSynchronized:{get:function(){return!1}},System$Collections$ICollection$SyncRoot:{get:function(){return this}},Items:{get:function(){return this.list}},System$Collections$IList$IsFixedSize:{get:function(){return!0}},System$Collections$Generic$ICollection$1$IsReadOnly:{get:function(){return!0}},System$Collections$IList$IsReadOnly:{get:function(){return!0}}},alias:["Count",["System$Collections$Generic$IReadOnlyCollection$1$"+Bridge.getTypeAlias(a)+"$Count","System$Collections$Generic$IReadOnlyCollection$1$Count"],"Count","System$Collections$ICollection$Count","Count","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$Count","getItem",["System$Collections$Generic$IReadOnlyList$1$"+Bridge.getTypeAlias(a)+"$getItem","System$Collections$Generic$IReadOnlyList$1$getItem"],"contains","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$contains","copyTo","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$copyTo","GetEnumerator",["System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(a)+"$GetEnumerator","System$Collections$Generic$IEnumerable$1$GetEnumerator"],"indexOf","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$indexOf","System$Collections$Generic$ICollection$1$IsReadOnly","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$IsReadOnly","System$Collections$Generic$IList$1$getItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$getItem","System$Collections$Generic$IList$1$setItem","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$setItem","System$Collections$Generic$ICollection$1$add","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$add","System$Collections$Generic$ICollection$1$clear","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$clear","System$Collections$Generic$IList$1$insert","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$insert","System$Collections$Generic$ICollection$1$remove","System$Collections$Generic$ICollection$1$"+Bridge.getTypeAlias(a)+"$remove","System$Collections$Generic$IList$1$removeAt","System$Collections$Generic$IList$1$"+Bridge.getTypeAlias(a)+"$removeAt"],ctors:{ctor:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("list");this.list=e}},methods:{getItem:function(e){return System.Array.getItem(this.list,e,a)},System$Collections$Generic$IList$1$getItem:function(e){return System.Array.getItem(this.list,e,a)},System$Collections$Generic$IList$1$setItem:function(e,t){throw new System.NotSupportedException.ctor},System$Collections$IList$getItem:function(e){return System.Array.getItem(this.list,e,a)},System$Collections$IList$setItem:function(e,t){throw new System.NotSupportedException.ctor},contains:function(e){return System.Array.contains(this.list,e,a)},System$Collections$IList$contains:function(e){return!!System.Collections.ObjectModel.ReadOnlyCollection$1(a).IsCompatibleObject(e)&&this.contains(Bridge.cast(Bridge.unbox(e,a),a))},copyTo:function(e,t){System.Array.copyTo(this.list,e,t,a)},System$Collections$ICollection$copyTo:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(1!==System.Array.getRank(e))throw new System.ArgumentException.$ctor1("array");if(0!==System.Array.getLower(e,0))throw new System.ArgumentException.$ctor1("array");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if((e.length-t|0)<this.Count)throw new System.ArgumentException.ctor;var n=Bridge.as(e,System.Array.type(a));if(null!=n)System.Array.copyTo(this.list,n,t,a);else{var i=Bridge.getType(e).$elementType||null,n=a;if(!Bridge.Reflection.isAssignableFrom(i,n)&&!Bridge.Reflection.isAssignableFrom(n,i))throw new System.ArgumentException.ctor;var r=Bridge.as(e,System.Array.type(System.Object));if(null==r)throw new System.ArgumentException.ctor;for(var s=System.Array.getCount(this.list,a),o=0;o<s;o=o+1|0)r[System.Array.index(Bridge.identity(t,t=t+1|0),r)]=System.Array.getItem(this.list,o,a)}},GetEnumerator:function(){return Bridge.getEnumerator(this.list,a)},System$Collections$IEnumerable$GetEnumerator:function(){return Bridge.getEnumerator(Bridge.cast(this.list,System.Collections.IEnumerable))},indexOf:function(e){return System.Array.indexOf(this.list,e,0,null,a)},System$Collections$IList$indexOf:function(e){return System.Collections.ObjectModel.ReadOnlyCollection$1(a).IsCompatibleObject(e)?this.indexOf(Bridge.cast(Bridge.unbox(e,a),a)):-1},System$Collections$Generic$ICollection$1$add:function(e){throw new System.NotSupportedException.ctor},System$Collections$IList$add:function(e){throw new System.NotSupportedException.ctor},System$Collections$Generic$ICollection$1$clear:function(){throw new System.NotSupportedException.ctor},System$Collections$IList$clear:function(){throw new System.NotSupportedException.ctor},System$Collections$Generic$IList$1$insert:function(e,t){throw new System.NotSupportedException.ctor},System$Collections$IList$insert:function(e,t){throw new System.NotSupportedException.ctor},System$Collections$Generic$ICollection$1$remove:function(e){throw new System.NotSupportedException.ctor},System$Collections$IList$remove:function(e){throw new System.NotSupportedException.ctor},System$Collections$Generic$IList$1$removeAt:function(e){throw new System.NotSupportedException.ctor},System$Collections$IList$removeAt:function(e){throw new System.NotSupportedException.ctor}}}}),Bridge.define("System.ComponentModel.BrowsableAttribute",{inherits:[System.Attribute],statics:{fields:{yes:null,no:null,default:null},ctors:{init:function(){this.yes=new System.ComponentModel.BrowsableAttribute(!0),this.no=new System.ComponentModel.BrowsableAttribute(!1),this.default=System.ComponentModel.BrowsableAttribute.yes}}},fields:{browsable:!1},props:{Browsable:{get:function(){return this.browsable}}},ctors:{init:function(){this.browsable=!0},ctor:function(e){this.$initialize(),System.Attribute.ctor.call(this),this.browsable=e}},methods:{equals:function(e){if(Bridge.referenceEquals(e,this))return!0;e=Bridge.as(e,System.ComponentModel.BrowsableAttribute);return null!=e&&e.Browsable===this.browsable},getHashCode:function(){return Bridge.getHashCode(this.browsable)}}}),Bridge.define("System.ComponentModel.DefaultValueAttribute",{inherits:[System.Attribute],fields:{_value:null},props:{Value:{get:function(){return this._value}}},ctors:{$ctor11:function(e,t){this.$initialize(),System.Attribute.ctor.call(this);try{if(!(e.prototype instanceof System.Enum))throw Bridge.referenceEquals(e,System.TimeSpan),System.NotImplemented.ByDesign;this._value=System.Enum.parse(e,t,!0)}catch(e){e=System.Exception.create(e)}},$ctor2:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.Char,String.fromCharCode,System.Char.getHashCode)},$ctor1:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.Byte)},$ctor4:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.Int16)},$ctor5:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.Int32)},$ctor6:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=e},$ctor9:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.Single,System.Single.format,System.Single.getHashCode)},$ctor3:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.Double,System.Double.format,System.Double.getHashCode)},ctor:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.Boolean,System.Boolean.toString)},$ctor10:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=e},$ctor7:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=e},$ctor8:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.SByte)},$ctor12:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.UInt16)},$ctor13:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=Bridge.box(e,System.UInt32)},$ctor14:function(e){this.$initialize(),System.Attribute.ctor.call(this),this._value=e}},methods:{equals:function(e){if(Bridge.referenceEquals(e,this))return!0;e=Bridge.as(e,System.ComponentModel.DefaultValueAttribute);return null!=e&&(null!=this.Value?Bridge.equals(this.Value,e.Value):null==e.Value)},getHashCode:function(){return Bridge.getHashCode(this)},setValue:function(e){this._value=e}}}),Bridge.define("System.Console",{statics:{methods:{Write:function(e){var t=Bridge.global.console;t&&t.log&&t.log(Bridge.isDefined(Bridge.unbox(e))?Bridge.unbox(e):"")},WriteLine:function(e){var t=Bridge.global.console;t&&t.log&&t.log(Bridge.isDefined(Bridge.unbox(e))?Bridge.unbox(e):"")},TransformChars:function(e,t,n,i){if(1!==t){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("index","less than zero");if(i<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","less than zero");if((n+i|0)>e.length)throw new System.ArgumentException.$ctor1("index plus count specify a position that is not within buffer.")}var r="";if(null!=e){1===t&&(n=0,i=e.length);for(var s=n;s<(n+i|0);s=s+1|0)r=(r||"")+String.fromCharCode(e[System.Array.index(s,e)])}return r},Clear:function(){var e=Bridge.global.console;e&&e.clear&&e.clear()}}}}),Bridge.define("System.TokenType",{$kind:"enum",statics:{fields:{NumberToken:1,YearNumberToken:2,Am:3,Pm:4,MonthToken:5,EndOfString:6,DayOfWeekToken:7,TimeZoneToken:8,EraToken:9,DateWordToken:10,UnknownToken:11,HebrewNumber:12,JapaneseEraToken:13,TEraToken:14,IgnorableSymbol:15,SEP_Unk:256,SEP_End:512,SEP_Space:768,SEP_Am:1024,SEP_Pm:1280,SEP_Date:1536,SEP_Time:1792,SEP_YearSuff:2048,SEP_MonthSuff:2304,SEP_DaySuff:2560,SEP_HourSuff:2816,SEP_MinuteSuff:3072,SEP_SecondSuff:3328,SEP_LocalTimeMark:3584,SEP_DateOrOffset:3840,RegularTokenMask:255,SeparatorTokenMask:65280}}}),Bridge.define("System.UnitySerializationHolder",{inherits:[System.Runtime.Serialization.ISerializable,System.Runtime.Serialization.IObjectReference],statics:{fields:{NullUnity:0},ctors:{init:function(){this.NullUnity=2}}},alias:["GetRealObject","System$Runtime$Serialization$IObjectReference$GetRealObject"],methods:{GetRealObject:function(e){throw System.NotImplemented.ByDesign}}}),Bridge.define("System.DateTimeKind",{$kind:"enum",statics:{fields:{Unspecified:0,Utc:1,Local:2}}}),Bridge.define("System.DateTimeOffset",{inherits:function(){return[System.IComparable,System.IFormattable,System.Runtime.Serialization.ISerializable,System.Runtime.Serialization.IDeserializationCallback,System.IComparable$1(System.DateTimeOffset),System.IEquatable$1(System.DateTimeOffset)]},$kind:"struct",statics:{fields:{MaxOffset:System.Int64(0),MinOffset:System.Int64(0),UnixEpochTicks:System.Int64(0),UnixEpochSeconds:System.Int64(0),UnixEpochMilliseconds:System.Int64(0),MinValue:null,MaxValue:null},props:{Now:{get:function(){return new System.DateTimeOffset.$ctor1(System.DateTime.getNow())}},UtcNow:{get:function(){return new System.DateTimeOffset.$ctor1(System.DateTime.getUtcNow())}}},ctors:{init:function(){this.MinValue=new System.DateTimeOffset,this.MaxValue=new System.DateTimeOffset,this.MaxOffset=System.Int64([1488826368,117]),this.MinOffset=System.Int64([-1488826368,-118]),this.UnixEpochTicks=System.Int64([-139100160,144670709]),this.UnixEpochSeconds=System.Int64([2006054656,14]),this.UnixEpochMilliseconds=System.Int64([304928768,14467]),this.MinValue=new System.DateTimeOffset.$ctor5(System.DateTime.getMinTicks(),System.TimeSpan.zero),this.MaxValue=new System.DateTimeOffset.$ctor5(System.DateTime.getMaxTicks(),System.TimeSpan.zero)}},methods:{Compare:function(e,t){return Bridge.compare(e.UtcDateTime,t.UtcDateTime)},Equals:function(e,t){return Bridge.equalsT(e.UtcDateTime,t.UtcDateTime)},FromFileTime:function(e){return new System.DateTimeOffset.$ctor1(System.DateTime.FromFileTime(e))},FromUnixTimeSeconds:function(e){var t=System.Int64([-2006054656,-15]),n=System.Int64([-769665,58]);if(e.lt(t)||e.gt(n))throw new System.ArgumentOutOfRangeException.$ctor4("seconds",System.String.format(System.Environment.GetResourceString("ArgumentOutOfRange_Range"),t,n));e=e.mul(System.Int64(1e7)).add(System.DateTimeOffset.UnixEpochTicks);return new System.DateTimeOffset.$ctor5(e,System.TimeSpan.zero)},FromUnixTimeMilliseconds:function(e){var t=System.Int64([-304928768,-14468]),n=System.Int64([-769664001,58999]);if(e.lt(t)||e.gt(n))throw new System.ArgumentOutOfRangeException.$ctor4("milliseconds",System.String.format(System.Environment.GetResourceString("ArgumentOutOfRange_Range"),t,n));e=e.mul(System.Int64(1e4)).add(System.DateTimeOffset.UnixEpochTicks);return new System.DateTimeOffset.$ctor5(e,System.TimeSpan.zero)},Parse:function(e){var t={},e=System.DateTimeParse.Parse$1(e,System.Globalization.DateTimeFormatInfo.currentInfo,0,t);return new System.DateTimeOffset.$ctor5(System.DateTime.getTicks(e),t.v)},Parse$1:function(e,t){return System.DateTimeOffset.Parse$2(e,t,0)},Parse$2:function(e,t,n){throw System.NotImplemented.ByDesign},ParseExact:function(e,t,n){return System.DateTimeOffset.ParseExact$1(e,t,n,0)},ParseExact$1:function(e,t,n,i){throw System.NotImplemented.ByDesign},TryParse:function(e,t){var n={},i={},e=System.DateTimeParse.TryParse$1(e,System.Globalization.DateTimeFormatInfo.currentInfo,0,i,n);return t.v=new System.DateTimeOffset.$ctor5(System.DateTime.getTicks(i.v),n.v),e},ValidateOffset:function(e){var t=e.getTicks();if(t.mod(System.Int64(6e8)).ne(System.Int64(0)))throw new System.ArgumentException.$ctor3(System.Environment.GetResourceString("Argument_OffsetPrecision"),"offset");if(t.lt(System.DateTimeOffset.MinOffset)||t.gt(System.DateTimeOffset.MaxOffset))throw new System.ArgumentOutOfRangeException.$ctor4("offset",System.Environment.GetResourceString("Argument_OffsetOutOfRange"));return System.Int64.clip16(e.getTicks().div(System.Int64(6e8)))},ValidateDate:function(e,t){t=System.DateTime.getTicks(e).sub(t.getTicks());if(t.lt(System.DateTime.getMinTicks())||t.gt(System.DateTime.getMaxTicks()))throw new System.ArgumentOutOfRangeException.$ctor4("offset",System.Environment.GetResourceString("Argument_UTCOutOfRange"));return System.DateTime.create$2(t,0)},op_Implicit:function(e){return new System.DateTimeOffset.$ctor1(e)},op_Addition:function(e,t){return new System.DateTimeOffset.$ctor2(System.DateTime.adddt(e.ClockDateTime,t),e.Offset)},op_Subtraction:function(e,t){return new System.DateTimeOffset.$ctor2(System.DateTime.subdt(e.ClockDateTime,t),e.Offset)},op_Subtraction$1:function(e,t){return System.DateTime.subdd(e.UtcDateTime,t.UtcDateTime)},op_Equality:function(e,t){return Bridge.equals(e.UtcDateTime,t.UtcDateTime)},op_Inequality:function(e,t){return!Bridge.equals(e.UtcDateTime,t.UtcDateTime)},op_LessThan:function(e,t){return System.DateTime.lt(e.UtcDateTime,t.UtcDateTime)},op_LessThanOrEqual:function(e,t){return System.DateTime.lte(e.UtcDateTime,t.UtcDateTime)},op_GreaterThan:function(e,t){return System.DateTime.gt(e.UtcDateTime,t.UtcDateTime)},op_GreaterThanOrEqual:function(e,t){return System.DateTime.gte(e.UtcDateTime,t.UtcDateTime)},getDefaultValue:function(){return new System.DateTimeOffset}}},fields:{m_dateTime:null,m_offsetMinutes:0},props:{DateTime:{get:function(){return this.ClockDateTime}},UtcDateTime:{get:function(){return System.DateTime.specifyKind(this.m_dateTime,1)}},LocalDateTime:{get:function(){return System.DateTime.toLocalTime(this.UtcDateTime)}},ClockDateTime:{get:function(){return System.DateTime.create$2(System.DateTime.getTicks(System.DateTime.adddt(this.m_dateTime,this.Offset)),0)}},Date:{get:function(){return System.DateTime.getDate(this.ClockDateTime)}},Day:{get:function(){return System.DateTime.getDay(this.ClockDateTime)}},DayOfWeek:{get:function(){return System.DateTime.getDayOfWeek(this.ClockDateTime)}},DayOfYear:{get:function(){return System.DateTime.getDayOfYear(this.ClockDateTime)}},Hour:{get:function(){return System.DateTime.getHour(this.ClockDateTime)}},Millisecond:{get:function(){return System.DateTime.getMillisecond(this.ClockDateTime)}},Minute:{get:function(){return System.DateTime.getMinute(this.ClockDateTime)}},Month:{get:function(){return System.DateTime.getMonth(this.ClockDateTime)}},Offset:{get:function(){return new System.TimeSpan(0,this.m_offsetMinutes,0)}},Second:{get:function(){return System.DateTime.getSecond(this.ClockDateTime)}},Ticks:{get:function(){return System.DateTime.getTicks(this.ClockDateTime)}},UtcTicks:{get:function(){return System.DateTime.getTicks(this.UtcDateTime)}},TimeOfDay:{get:function(){return System.DateTime.getTimeOfDay(this.ClockDateTime)}},Year:{get:function(){return System.DateTime.getYear(this.ClockDateTime)}}},alias:["compareTo",["System$IComparable$1$System$DateTimeOffset$compareTo","System$IComparable$1$compareTo"],"equalsT","System$IEquatable$1$System$DateTimeOffset$equalsT","format","System$IFormattable$format"],ctors:{init:function(){this.m_dateTime=System.DateTime.getDefaultValue()},$ctor5:function(e,t){this.$initialize(),this.m_offsetMinutes=System.DateTimeOffset.ValidateOffset(t);e=System.DateTime.create$2(e);this.m_dateTime=System.DateTimeOffset.ValidateDate(e,t)},$ctor1:function(e){var t;this.$initialize(),t=new System.TimeSpan(System.Int64(0)),this.m_offsetMinutes=System.DateTimeOffset.ValidateOffset(t),this.m_dateTime=System.DateTimeOffset.ValidateDate(e,t)},$ctor2:function(e,t){this.$initialize(),this.m_offsetMinutes=System.DateTimeOffset.ValidateOffset(t),this.m_dateTime=System.DateTimeOffset.ValidateDate(e,t)},$ctor4:function(e,t,n,i,r,s,o){this.$initialize(),this.m_offsetMinutes=System.DateTimeOffset.ValidateOffset(o),this.m_dateTime=System.DateTimeOffset.ValidateDate(System.DateTime.create(e,t,n,i,r,s),o)},$ctor3:function(e,t,n,i,r,s,o,a){this.$initialize(),this.m_offsetMinutes=System.DateTimeOffset.ValidateOffset(a),this.m_dateTime=System.DateTimeOffset.ValidateDate(System.DateTime.create(e,t,n,i,r,s,o),a)},ctor:function(){this.$initialize()}},methods:{ToOffset:function(e){return new System.DateTimeOffset.$ctor5(System.DateTime.getTicks(System.DateTime.adddt(this.m_dateTime,e)),e)},Add:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.add(this.ClockDateTime,e),this.Offset)},AddDays:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.addDays(this.ClockDateTime,e),this.Offset)},AddHours:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.addHours(this.ClockDateTime,e),this.Offset)},AddMilliseconds:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.addMilliseconds(this.ClockDateTime,e),this.Offset)},AddMinutes:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.addMinutes(this.ClockDateTime,e),this.Offset)},AddMonths:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.addMonths(this.ClockDateTime,e),this.Offset)},AddSeconds:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.addSeconds(this.ClockDateTime,e),this.Offset)},AddTicks:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.addTicks(this.ClockDateTime,e),this.Offset)},AddYears:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.addYears(this.ClockDateTime,e),this.Offset)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.DateTimeOffset))throw new System.ArgumentException.$ctor1(System.Environment.GetResourceString("Arg_MustBeDateTimeOffset"));var t=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.DateTimeOffset),System.DateTimeOffset)).UtcDateTime,e=this.UtcDateTime;return System.DateTime.gt(e,t)?1:System.DateTime.lt(e,t)?-1:0},compareTo:function(e){var t=e.UtcDateTime,e=this.UtcDateTime;return System.DateTime.gt(e,t)?1:System.DateTime.lt(e,t)?-1:0},equals:function(e){return!!Bridge.is(e,System.DateTimeOffset)&&Bridge.equalsT(this.UtcDateTime,System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.DateTimeOffset),System.DateTimeOffset)).UtcDateTime)},equalsT:function(e){return Bridge.equalsT(this.UtcDateTime,e.UtcDateTime)},EqualsExact:function(e){return Bridge.equals(this.ClockDateTime,e.ClockDateTime)&&System.TimeSpan.eq(this.Offset,e.Offset)&&System.DateTime.getKind(this.ClockDateTime)===System.DateTime.getKind(e.ClockDateTime)},System$Runtime$Serialization$IDeserializationCallback$OnDeserialization:function(e){try{this.m_offsetMinutes=System.DateTimeOffset.ValidateOffset(this.Offset),this.m_dateTime=System.DateTimeOffset.ValidateDate(this.ClockDateTime,this.Offset)}catch(e){var t;throw e=System.Exception.create(e),Bridge.is(e,System.ArgumentException)?(t=e,new System.Runtime.Serialization.SerializationException.$ctor2(System.Environment.GetResourceString("Serialization_InvalidData"),t)):e}},getHashCode:function(){return Bridge.getHashCode(this.UtcDateTime)},Subtract$1:function(e){return System.DateTime.subdd(this.UtcDateTime,e.UtcDateTime)},Subtract:function(e){return new System.DateTimeOffset.$ctor2(System.DateTime.subtract(this.ClockDateTime,e),this.Offset)},ToFileTime:function(){return System.DateTime.ToFileTime(this.UtcDateTime)},ToUnixTimeSeconds:function(){return System.DateTime.getTicks(this.UtcDateTime).div(System.Int64(1e7)).sub(System.DateTimeOffset.UnixEpochSeconds)},ToUnixTimeMilliseconds:function(){return System.DateTime.getTicks(this.UtcDateTime).div(System.Int64(1e4)).sub(System.DateTimeOffset.UnixEpochMilliseconds)},ToLocalTime:function(){return this.ToLocalTime$1(!1)},ToLocalTime$1:function(e){return new System.DateTimeOffset.$ctor1(System.DateTime.toLocalTime(this.UtcDateTime,e))},toString:function(){return System.DateTime.format(System.DateTime.specifyKind(this.ClockDateTime,2))},ToString$1:function(e){return System.DateTime.format(System.DateTime.specifyKind(this.ClockDateTime,2),e)},ToString:function(e){return System.DateTime.format(System.DateTime.specifyKind(this.ClockDateTime,2),null,e)},format:function(e,t){return System.DateTime.format(System.DateTime.specifyKind(this.ClockDateTime,2),e,t)},ToUniversalTime:function(){return new System.DateTimeOffset.$ctor1(this.UtcDateTime)},$clone:function(e){e=e||new System.DateTimeOffset;return e.m_dateTime=this.m_dateTime,e.m_offsetMinutes=this.m_offsetMinutes,e}}}),Bridge.define("System.DateTimeParse",{statics:{methods:{TryParseExact:function(e,t,n,i,r){return System.DateTime.tryParseExact(e,t,null,r)},Parse:function(e,t,n){return System.DateTime.parse(e,t)},Parse$1:function(e,t,n,i){throw System.NotImplemented.ByDesign},TryParse:function(e,t,n,i){return System.DateTime.tryParse(e,null,i)},TryParse$1:function(e,t,n,i,r){throw System.NotImplemented.ByDesign}}}}),Bridge.define("System.DateTimeResult",{$kind:"struct",statics:{methods:{getDefaultValue:function(){return new System.DateTimeResult}}},fields:{Year:0,Month:0,Day:0,Hour:0,Minute:0,Second:0,fraction:0,era:0,flags:0,timeZoneOffset:null,calendar:null,parsedDate:null,failure:0,failureMessageID:null,failureMessageFormatArgument:null,failureArgumentName:null},ctors:{init:function(){this.timeZoneOffset=new System.TimeSpan,this.parsedDate=System.DateTime.getDefaultValue()},ctor:function(){this.$initialize()}},methods:{Init:function(){this.Year=-1,this.Month=-1,this.Day=-1,this.fraction=-1,this.era=-1},SetDate:function(e,t,n){this.Year=e,this.Month=t,this.Day=n},SetFailure:function(e,t,n){this.failure=e,this.failureMessageID=t,this.failureMessageFormatArgument=n},SetFailure$1:function(e,t,n,i){this.failure=e,this.failureMessageID=t,this.failureMessageFormatArgument=n,this.failureArgumentName=i},getHashCode:function(){return Bridge.addHash([5374321750,this.Year,this.Month,this.Day,this.Hour,this.Minute,this.Second,this.fraction,this.era,this.flags,this.timeZoneOffset,this.calendar,this.parsedDate,this.failure,this.failureMessageID,this.failureMessageFormatArgument,this.failureArgumentName])},equals:function(e){return!!Bridge.is(e,System.DateTimeResult)&&(Bridge.equals(this.Year,e.Year)&&Bridge.equals(this.Month,e.Month)&&Bridge.equals(this.Day,e.Day)&&Bridge.equals(this.Hour,e.Hour)&&Bridge.equals(this.Minute,e.Minute)&&Bridge.equals(this.Second,e.Second)&&Bridge.equals(this.fraction,e.fraction)&&Bridge.equals(this.era,e.era)&&Bridge.equals(this.flags,e.flags)&&Bridge.equals(this.timeZoneOffset,e.timeZoneOffset)&&Bridge.equals(this.calendar,e.calendar)&&Bridge.equals(this.parsedDate,e.parsedDate)&&Bridge.equals(this.failure,e.failure)&&Bridge.equals(this.failureMessageID,e.failureMessageID)&&Bridge.equals(this.failureMessageFormatArgument,e.failureMessageFormatArgument)&&Bridge.equals(this.failureArgumentName,e.failureArgumentName))},$clone:function(e){e=e||new System.DateTimeResult;return e.Year=this.Year,e.Month=this.Month,e.Day=this.Day,e.Hour=this.Hour,e.Minute=this.Minute,e.Second=this.Second,e.fraction=this.fraction,e.era=this.era,e.flags=this.flags,e.timeZoneOffset=this.timeZoneOffset,e.calendar=this.calendar,e.parsedDate=this.parsedDate,e.failure=this.failure,e.failureMessageID=this.failureMessageID,e.failureMessageFormatArgument=this.failureMessageFormatArgument,e.failureArgumentName=this.failureArgumentName,e}}}),Bridge.define("System.DayOfWeek",{$kind:"enum",statics:{fields:{Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6}}}),Bridge.define("System.DBNull",{inherits:[System.Runtime.Serialization.ISerializable,System.IConvertible],statics:{fields:{Value:null},ctors:{init:function(){this.Value=new System.DBNull}}},alias:["ToString","System$IConvertible$ToString","GetTypeCode","System$IConvertible$GetTypeCode"],ctors:{ctor:function(){this.$initialize()}},methods:{toString:function(){return""},ToString:function(e){return""},GetTypeCode:function(){return System.TypeCode.DBNull},System$IConvertible$ToBoolean:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToChar:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToSByte:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToByte:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToInt16:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToUInt16:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToInt32:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToUInt32:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToInt64:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToUInt64:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToSingle:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToDouble:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToDecimal:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToDateTime:function(e){throw new System.InvalidCastException.$ctor1("Object cannot be cast from DBNull to other types.")},System$IConvertible$ToType:function(e,t){return System.Convert.defaultToType(Bridge.cast(this,System.IConvertible),e,t)}}}),Bridge.define("System.Empty",{statics:{fields:{Value:null},ctors:{init:function(){this.Value=new System.Empty}}},ctors:{ctor:function(){this.$initialize()}},methods:{toString:function(){return""}}}),Bridge.define("System.ApplicationException",{inherits:[System.Exception],ctors:{ctor:function(){this.$initialize(),System.Exception.ctor.call(this,"Error in the application."),this.HResult=-2146232832},$ctor1:function(e){this.$initialize(),System.Exception.ctor.call(this,e),this.HResult=-2146232832},$ctor2:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e,t),this.HResult=-2146232832}}}),Bridge.define("System.ArgumentException",{inherits:[System.SystemException],fields:{_paramName:null},props:{Message:{get:function(){var e=Bridge.ensureBaseProperty(this,"Message").$System$Exception$Message;return System.String.isNullOrEmpty(this._paramName)?e:(e||"")+"\n"+(System.SR.Format("Parameter name: {0}",this._paramName)||"")}},ParamName:{get:function(){return this._paramName}}},ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Value does not fall within the expected range."),this.HResult=-2147024809},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2147024809},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2147024809},$ctor4:function(e,t,n){this.$initialize(),System.SystemException.$ctor2.call(this,e,n),this._paramName=t,this.HResult=-2147024809},$ctor3:function(e,t){this.$initialize(),System.SystemException.$ctor1.call(this,e),this._paramName=t,this.HResult=-2147024809}}}),Bridge.define("System.ArgumentNullException",{inherits:[System.ArgumentException],ctors:{ctor:function(){this.$initialize(),System.ArgumentException.$ctor1.call(this,"Value cannot be null."),this.HResult=-2147467261},$ctor1:function(e){this.$initialize(),System.ArgumentException.$ctor3.call(this,"Value cannot be null.",e),this.HResult=-2147467261},$ctor2:function(e,t){this.$initialize(),System.ArgumentException.$ctor2.call(this,e,t),this.HResult=-2147467261},$ctor3:function(e,t){this.$initialize(),System.ArgumentException.$ctor3.call(this,t,e),this.HResult=-2147467261}}}),Bridge.define("System.ArgumentOutOfRangeException",{inherits:[System.ArgumentException],fields:{_actualValue:null},props:{Message:{get:function(){var e=Bridge.ensureBaseProperty(this,"Message").$System$ArgumentException$Message;if(null==this._actualValue)return e;var t=System.SR.Format("Actual value was {0}.",Bridge.toString(this._actualValue));return null==e?t:(e||"")+"\n"+(t||"")}},ActualValue:{get:function(){return this._actualValue}}},ctors:{ctor:function(){this.$initialize(),System.ArgumentException.$ctor1.call(this,"Specified argument was out of the range of valid values."),this.HResult=-2146233086},$ctor1:function(e){this.$initialize(),System.ArgumentException.$ctor3.call(this,"Specified argument was out of the range of valid values.",e),this.HResult=-2146233086},$ctor4:function(e,t){this.$initialize(),System.ArgumentException.$ctor3.call(this,t,e),this.HResult=-2146233086},$ctor2:function(e,t){this.$initialize(),System.ArgumentException.$ctor2.call(this,e,t),this.HResult=-2146233086},$ctor3:function(e,t,n){this.$initialize(),System.ArgumentException.$ctor3.call(this,n,e),this._actualValue=t,this.HResult=-2146233086}}}),Bridge.define("System.ArithmeticException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Overflow or underflow in the arithmetic operation."),this.HResult=-2147024362},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2147024362},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2147024362}}}),Bridge.define("System.Base64FormattingOptions",{$kind:"enum",statics:{fields:{None:0,InsertLineBreaks:1}},$flags:!0}),Bridge.define("System.DivideByZeroException",{inherits:[System.ArithmeticException],ctors:{ctor:function(){this.$initialize(),System.ArithmeticException.$ctor1.call(this,"Attempted to divide by zero."),this.HResult=-2147352558},$ctor1:function(e){this.$initialize(),System.ArithmeticException.$ctor1.call(this,e),this.HResult=-2147352558},$ctor2:function(e,t){this.$initialize(),System.ArithmeticException.$ctor2.call(this,e,t),this.HResult=-2147352558}}}),Bridge.define("System.ExceptionArgument",{$kind:"enum",statics:{fields:{obj:0,dictionary:1,array:2,info:3,key:4,collection:5,list:6,match:7,converter:8,capacity:9,index:10,startIndex:11,value:12,count:13,arrayIndex:14,$name:15,item:16,options:17,view:18,sourceBytesToCopy:19,action:20,comparison:21,offset:22,newSize:23,elementType:24,$length:25,length1:26,length2:27,length3:28,lengths:29,len:30,lowerBounds:31,sourceArray:32,destinationArray:33,sourceIndex:34,destinationIndex:35,indices:36,index1:37,index2:38,index3:39,other:40,comparer:41,endIndex:42,keys:43,creationOptions:44,timeout:45,tasks:46,scheduler:47,continuationFunction:48,millisecondsTimeout:49,millisecondsDelay:50,function:51,exceptions:52,exception:53,cancellationToken:54,delay:55,asyncResult:56,endMethod:57,endFunction:58,beginMethod:59,continuationOptions:60,continuationAction:61,concurrencyLevel:62,text:63,callBack:64,type:65,stateMachine:66,pHandle:67,values:68,task:69,s:70,keyValuePair:71,input:72,ownedMemory:73,pointer:74,start:75,format:76,culture:77,comparable:78,source:79,state:80}}}),Bridge.define("System.ExceptionResource",{$kind:"enum",statics:{fields:{Argument_ImplementIComparable:0,Argument_InvalidType:1,Argument_InvalidArgumentForComparison:2,Argument_InvalidRegistryKeyPermissionCheck:3,ArgumentOutOfRange_NeedNonNegNum:4,Arg_ArrayPlusOffTooSmall:5,Arg_NonZeroLowerBound:6,Arg_RankMultiDimNotSupported:7,Arg_RegKeyDelHive:8,Arg_RegKeyStrLenBug:9,Arg_RegSetStrArrNull:10,Arg_RegSetMismatchedKind:11,Arg_RegSubKeyAbsent:12,Arg_RegSubKeyValueAbsent:13,Argument_AddingDuplicate:14,Serialization_InvalidOnDeser:15,Serialization_MissingKeys:16,Serialization_NullKey:17,Argument_InvalidArrayType:18,NotSupported_KeyCollectionSet:19,NotSupported_ValueCollectionSet:20,ArgumentOutOfRange_SmallCapacity:21,ArgumentOutOfRange_Index:22,Argument_InvalidOffLen:23,Argument_ItemNotExist:24,ArgumentOutOfRange_Count:25,ArgumentOutOfRange_InvalidThreshold:26,ArgumentOutOfRange_ListInsert:27,NotSupported_ReadOnlyCollection:28,InvalidOperation_CannotRemoveFromStackOrQueue:29,InvalidOperation_EmptyQueue:30,InvalidOperation_EnumOpCantHappen:31,InvalidOperation_EnumFailedVersion:32,InvalidOperation_EmptyStack:33,ArgumentOutOfRange_BiggerThanCollection:34,InvalidOperation_EnumNotStarted:35,InvalidOperation_EnumEnded:36,NotSupported_SortedListNestedWrite:37,InvalidOperation_NoValue:38,InvalidOperation_RegRemoveSubKey:39,Security_RegistryPermission:40,UnauthorizedAccess_RegistryNoWrite:41,ObjectDisposed_RegKeyClosed:42,NotSupported_InComparableType:43,Argument_InvalidRegistryOptionsCheck:44,Argument_InvalidRegistryViewCheck:45,InvalidOperation_NullArray:46,Arg_MustBeType:47,Arg_NeedAtLeast1Rank:48,ArgumentOutOfRange_HugeArrayNotSupported:49,Arg_RanksAndBounds:50,Arg_RankIndices:51,Arg_Need1DArray:52,Arg_Need2DArray:53,Arg_Need3DArray:54,NotSupported_FixedSizeCollection:55,ArgumentException_OtherNotArrayOfCorrectLength:56,Rank_MultiDimNotSupported:57,InvalidOperation_IComparerFailed:58,ArgumentOutOfRange_EndIndexStartIndex:59,Arg_LowerBoundsMustMatch:60,Arg_BogusIComparer:61,Task_WaitMulti_NullTask:62,Task_ThrowIfDisposed:63,Task_Start_TaskCompleted:64,Task_Start_Promise:65,Task_Start_ContinuationTask:66,Task_Start_AlreadyStarted:67,Task_RunSynchronously_TaskCompleted:68,Task_RunSynchronously_Continuation:69,Task_RunSynchronously_Promise:70,Task_RunSynchronously_AlreadyStarted:71,Task_MultiTaskContinuation_NullTask:72,Task_MultiTaskContinuation_EmptyTaskList:73,Task_Dispose_NotCompleted:74,Task_Delay_InvalidMillisecondsDelay:75,Task_Delay_InvalidDelay:76,Task_ctor_LRandSR:77,Task_ContinueWith_NotOnAnything:78,Task_ContinueWith_ESandLR:79,TaskT_TransitionToFinal_AlreadyCompleted:80,TaskCompletionSourceT_TrySetException_NullException:81,TaskCompletionSourceT_TrySetException_NoExceptions:82,MemoryDisposed:83,Memory_OutstandingReferences:84,InvalidOperation_WrongAsyncResultOrEndCalledMultiple:85,ConcurrentDictionary_ConcurrencyLevelMustBePositive:86,ConcurrentDictionary_CapacityMustNotBeNegative:87,ConcurrentDictionary_TypeOfValueIncorrect:88,ConcurrentDictionary_TypeOfKeyIncorrect:89,ConcurrentDictionary_KeyAlreadyExisted:90,ConcurrentDictionary_ItemKeyIsNull:91,ConcurrentDictionary_IndexIsNegative:92,ConcurrentDictionary_ArrayNotLargeEnough:93,ConcurrentDictionary_ArrayIncorrectType:94,ConcurrentCollection_SyncRoot_NotSupported:95,ArgumentOutOfRange_Enum:96,InvalidOperation_HandleIsNotInitialized:97,AsyncMethodBuilder_InstanceNotInitialized:98,ArgumentNull_SafeHandle:99}}}),Bridge.define("System.FormatException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"One of the identified items was in an invalid format."),this.HResult=-2146233033},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233033},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233033}}}),Bridge.define("System.FormattableString",{inherits:[System.IFormattable],statics:{methods:{Invariant:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("formattable");return e.ToString(System.Globalization.CultureInfo.invariantCulture)}}},methods:{System$IFormattable$format:function(e,t){return this.ToString(t)},toString:function(){return this.ToString(System.Globalization.CultureInfo.getCurrentCulture())}}}),Bridge.define("System.Runtime.CompilerServices.FormattableStringFactory.ConcreteFormattableString",{inherits:[System.FormattableString],$kind:"nested class",fields:{_format:null,_arguments:null},props:{Format:{get:function(){return this._format}},ArgumentCount:{get:function(){return this._arguments.length}}},ctors:{ctor:function(e,t){this.$initialize(),System.FormattableString.ctor.call(this),this._format=e,this._arguments=t}},methods:{GetArguments:function(){return this._arguments},GetArgument:function(e){return this._arguments[System.Array.index(e,this._arguments)]},ToString:function(e){return System.String.formatProvider.apply(System.String,[e,this._format].concat(this._arguments))}}}),Bridge.define("System.Runtime.CompilerServices.FormattableStringFactory",{statics:{methods:{Create:function(e,t){if(void 0===t&&(t=[]),null==e)throw new System.ArgumentNullException.$ctor1("format");if(null==t)throw new System.ArgumentNullException.$ctor1("arguments");return new System.Runtime.CompilerServices.FormattableStringFactory.ConcreteFormattableString(e,t)}}}}),Bridge.define("System.Guid",{inherits:function(){return[System.IEquatable$1(System.Guid),System.IComparable$1(System.Guid),System.IFormattable]},$kind:"struct",statics:{fields:{error1:null,Valid:null,Split:null,NonFormat:null,Replace:null,Rnd:null,Empty:null},ctors:{init:function(){this.Empty=new System.Guid,this.error1="Byte array for GUID must be exactly {0} bytes long",this.Valid=new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","i"),this.Split=new RegExp("^(.{8})(.{4})(.{4})(.{4})(.{12})$"),this.NonFormat=new RegExp("^[{(]?([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})[)}]?$","i"),this.Replace=new RegExp("-","g"),this.Rnd=new System.Random.ctor}},methods:{Parse:function(e){return System.Guid.ParseExact(e,null)},ParseExact:function(e,t){var n=new System.Guid.ctor;return n.ParseInternal(e,t,!0),n},TryParse:function(e,t){return System.Guid.TryParseExact(e,null,t)},TryParseExact:function(e,t,n){return n.v=new System.Guid.ctor,n.v.ParseInternal(e,t,!1)},NewGuid:function(){var e=System.Array.init(16,0,System.Byte);return System.Guid.Rnd.NextBytes(e),e[System.Array.index(7,e)]=255&(15&e[System.Array.index(7,e)]|64),e[System.Array.index(8,e)]=255&(191&e[System.Array.index(8,e)]|128),new System.Guid.$ctor1(e)},ToHex$1:function(e,t){var n=e.toString(16);t=t-n.length|0;for(var i=0;i<t;i=i+1|0)n="0"+(n||"");return n},ToHex:function(e){e=e.toString(16);return 1===e.length&&(e="0"+(e||"")),e},op_Equality:function(e,t){return Bridge.referenceEquals(e,null)?Bridge.referenceEquals(t,null):e.equalsT(t)},op_Inequality:function(e,t){return!System.Guid.op_Equality(e,t)},getDefaultValue:function(){return new System.Guid}}},fields:{_a:0,_b:0,_c:0,_d:0,_e:0,_f:0,_g:0,_h:0,_i:0,_j:0,_k:0},alias:["equalsT","System$IEquatable$1$System$Guid$equalsT","compareTo",["System$IComparable$1$System$Guid$compareTo","System$IComparable$1$compareTo"],"format","System$IFormattable$format"],ctors:{$ctor4:function(e){this.$initialize(),(new System.Guid.ctor).$clone(this),this.ParseInternal(e,null,!0)},$ctor1:function(e){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("b");if(16!==e.length)throw new System.ArgumentException.$ctor1(System.String.format(System.Guid.error1,[Bridge.box(16,System.Int32)]));this._a=e[System.Array.index(3,e)]<<24|e[System.Array.index(2,e)]<<16|e[System.Array.index(1,e)]<<8|e[System.Array.index(0,e)],this._b=Bridge.Int.sxs(65535&(e[System.Array.index(5,e)]<<8|e[System.Array.index(4,e)])),this._c=Bridge.Int.sxs(65535&(e[System.Array.index(7,e)]<<8|e[System.Array.index(6,e)])),this._d=e[System.Array.index(8,e)],this._e=e[System.Array.index(9,e)],this._f=e[System.Array.index(10,e)],this._g=e[System.Array.index(11,e)],this._h=e[System.Array.index(12,e)],this._i=e[System.Array.index(13,e)],this._j=e[System.Array.index(14,e)],this._k=e[System.Array.index(15,e)]},$ctor5:function(e,t,n,i,r,s,o,a,u,l,c){this.$initialize(),this._a=0|e,this._b=Bridge.Int.sxs(65535&t),this._c=Bridge.Int.sxs(65535&n),this._d=i,this._e=r,this._f=s,this._g=o,this._h=a,this._i=u,this._j=l,this._k=c},$ctor3:function(e,t,n,i){if(this.$initialize(),null==i)throw new System.ArgumentNullException.$ctor1("d");if(8!==i.length)throw new System.ArgumentException.$ctor1(System.String.format(System.Guid.error1,[Bridge.box(8,System.Int32)]));this._a=e,this._b=t,this._c=n,this._d=i[System.Array.index(0,i)],this._e=i[System.Array.index(1,i)],this._f=i[System.Array.index(2,i)],this._g=i[System.Array.index(3,i)],this._h=i[System.Array.index(4,i)],this._i=i[System.Array.index(5,i)],this._j=i[System.Array.index(6,i)],this._k=i[System.Array.index(7,i)]},$ctor2:function(e,t,n,i,r,s,o,a,u,l,c){this.$initialize(),this._a=e,this._b=t,this._c=n,this._d=i,this._e=r,this._f=s,this._g=o,this._h=a,this._i=u,this._j=l,this._k=c},ctor:function(){this.$initialize()}},methods:{getHashCode:function(){return this._a^(this._b<<16|65535&this._c)^(this._f<<24|this._k)},equals:function(e){return!!Bridge.is(e,System.Guid)&&this.equalsT(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.Guid),System.Guid)))},equalsT:function(e){return this._a===e._a&&this._b===e._b&&this._c===e._c&&this._d===e._d&&this._e===e._e&&this._f===e._f&&this._g===e._g&&this._h===e._h&&this._i===e._i&&this._j===e._j&&this._k===e._k},compareTo:function(e){return System.String.compare(this.toString(),e.toString())},toString:function(){return this.Format(null)},ToString:function(e){return this.Format(e)},format:function(e,t){return this.Format(e)},ToByteArray:function(){var e=System.Array.init(16,0,System.Byte);return e[System.Array.index(0,e)]=255&this._a,e[System.Array.index(1,e)]=this._a>>8&255,e[System.Array.index(2,e)]=this._a>>16&255,e[System.Array.index(3,e)]=this._a>>24&255,e[System.Array.index(4,e)]=255&this._b,e[System.Array.index(5,e)]=this._b>>8&255,e[System.Array.index(6,e)]=255&this._c,e[System.Array.index(7,e)]=this._c>>8&255,e[System.Array.index(8,e)]=this._d,e[System.Array.index(9,e)]=this._e,e[System.Array.index(10,e)]=this._f,e[System.Array.index(11,e)]=this._g,e[System.Array.index(12,e)]=this._h,e[System.Array.index(13,e)]=this._i,e[System.Array.index(14,e)]=this._j,e[System.Array.index(15,e)]=this._k,e},ParseInternal:function(e,t,n){var i=null;if(System.String.isNullOrEmpty(e)){if(n)throw new System.ArgumentNullException.$ctor1("input");return!1}if(System.String.isNullOrEmpty(t)){var r=System.Guid.NonFormat.exec(e);if(null!=r){for(var s=new(System.Collections.Generic.List$1(System.String).ctor),o=1;o<=r.length;o=o+1|0)null!=r[o]&&s.add(r[o]);i=s.ToArray().join("-").toLowerCase()}}else{t=t.toUpperCase();var a=!1;if(Bridge.referenceEquals(t,"N")){var u=System.Guid.Split.exec(e);if(null!=u){for(var l=new(System.Collections.Generic.List$1(System.String).ctor),c=1;c<=u.length;c=c+1|0)null!=u[c]&&l.add(u[c]);a=!0,e=l.ToArray().join("-")}}else Bridge.referenceEquals(t,"B")||Bridge.referenceEquals(t,"P")?(t=Bridge.referenceEquals(t,"B")?System.Array.init([123,125],System.Char):System.Array.init([40,41],System.Char),e.charCodeAt(0)===t[System.Array.index(0,t)]&&e.charCodeAt(e.length-1|0)===t[System.Array.index(1,t)]&&(a=!0,e=e.substr(1,e.length-2|0))):a=!0;a&&System.Guid.Valid.test(e)&&(i=e.toLowerCase())}if(null!=i)return this.FromString(i),!0;if(n)throw new System.FormatException.$ctor1("input is not in a recognized format");return!1},Format:function(e){for(var t=((t=(System.Guid.ToHex$1(this._a>>>0,8)||"")+(System.Guid.ToHex$1(65535&this._b,4)||"")+(System.Guid.ToHex$1(65535&this._c,4)||""))||"")+(System.Array.init([this._d,this._e,this._f,this._g,this._h,this._i,this._j,this._k],System.Byte).map(System.Guid.ToHex).join("")||""),n=/^(.{8})(.{4})(.{4})(.{4})(.{12})$/.exec(t),i=System.Array.init(0,null,System.String),r=1;r<n.length;r=r+1|0)null!=n[System.Array.index(r,n)]&&i.push(n[System.Array.index(r,n)]);switch(t=i.join("-"),e){case"n":case"N":return t.replace(System.Guid.Replace,"");case"b":case"B":return String.fromCharCode(123)+(t||"")+String.fromCharCode(125);case"p":case"P":return String.fromCharCode(40)+(t||"")+String.fromCharCode(41);default:return t}},FromString:function(e){if(!System.String.isNullOrEmpty(e)){e=e.replace(System.Guid.Replace,"");var t=System.Array.init(8,0,System.Byte);this._a=0|System.UInt32.parse(e.substr(0,8),16),this._b=Bridge.Int.sxs(65535&System.UInt16.parse(e.substr(8,4),16)),this._c=Bridge.Int.sxs(65535&System.UInt16.parse(e.substr(12,4),16));for(var n=8;n<16;n=n+1|0)t[System.Array.index(n-8|0,t)]=System.Byte.parse(e.substr(Bridge.Int.mul(n,2),2),16);this._d=t[System.Array.index(0,t)],this._e=t[System.Array.index(1,t)],this._f=t[System.Array.index(2,t)],this._g=t[System.Array.index(3,t)],this._h=t[System.Array.index(4,t)],this._i=t[System.Array.index(5,t)],this._j=t[System.Array.index(6,t)],this._k=t[System.Array.index(7,t)]}},toJSON:function(){return this.toString()},$clone:function(e){return this}}}),Bridge.define("System.ITupleInternal",{$kind:"interface"}),Bridge.define("System.Tuple"),Bridge.define("System.Tuple$1",function(e){return{}}),Bridge.define("System.Tuple$2",function(e,t){return{}}),Bridge.define("System.Tuple$3",function(e,t,n){return{}}),Bridge.define("System.Tuple$4",function(e,t,n,i){return{}}),Bridge.define("System.Tuple$5",function(e,t,n,i,r){return{}}),Bridge.define("System.Tuple$6",function(e,t,n,i,r,s){return{}}),Bridge.define("System.Tuple$7",function(e,t,n,i,r,s,o){return{}}),Bridge.define("System.Tuple$8",function(e,t,n,i,r,s,o,a){return{}}),Bridge.define("System.ValueTuple",{inherits:function(){return[System.IEquatable$1(System.ValueTuple),System.Collections.IStructuralEquatable,System.Collections.IStructuralComparable,System.IComparable,System.IComparable$1(System.ValueTuple)]},$kind:"struct",statics:{methods:{Create:function(){return new System.ValueTuple},Create$1:function(e,t){return new(System.ValueTuple$1(e).$ctor1)(t)},Create$2:function(e,t,n,i){return new(System.ValueTuple$2(e,t).$ctor1)(n,i)},Create$3:function(e,t,n,i,r,s){return new(System.ValueTuple$3(e,t,n).$ctor1)(i,r,s)},Create$4:function(e,t,n,i,r,s,o,a){return new(System.ValueTuple$4(e,t,n,i).$ctor1)(r,s,o,a)},Create$5:function(e,t,n,i,r,s,o,a,u,l){return new(System.ValueTuple$5(e,t,n,i,r).$ctor1)(s,o,a,u,l)},Create$6:function(e,t,n,i,r,s,o,a,u,l,c,m){return new(System.ValueTuple$6(e,t,n,i,r,s).$ctor1)(o,a,u,l,c,m)},Create$7:function(e,t,n,i,r,s,o,a,u,l,c,m,y,h){return new(System.ValueTuple$7(e,t,n,i,r,s,o).$ctor1)(a,u,l,c,m,y,h)},Create$8:function(e,t,n,i,r,s,o,a,u,l,c,m,y,h,d,f){return new(System.ValueTuple$8(e,t,n,i,r,s,o,System.ValueTuple$1(a)).$ctor1)(u,l,c,m,y,h,d,System.ValueTuple.Create$1(a,f))},CombineHashCodes:function(e,t){return System.Collections.HashHelpers.Combine(System.Collections.HashHelpers.Combine(System.Collections.HashHelpers.RandomSeed,e),t)},CombineHashCodes$1:function(e,t,n){return System.Collections.HashHelpers.Combine(System.ValueTuple.CombineHashCodes(e,t),n)},CombineHashCodes$2:function(e,t,n,i){return System.Collections.HashHelpers.Combine(System.ValueTuple.CombineHashCodes$1(e,t,n),i)},CombineHashCodes$3:function(e,t,n,i,r){return System.Collections.HashHelpers.Combine(System.ValueTuple.CombineHashCodes$2(e,t,n,i),r)},CombineHashCodes$4:function(e,t,n,i,r,s){return System.Collections.HashHelpers.Combine(System.ValueTuple.CombineHashCodes$3(e,t,n,i,r),s)},CombineHashCodes$5:function(e,t,n,i,r,s,o){return System.Collections.HashHelpers.Combine(System.ValueTuple.CombineHashCodes$4(e,t,n,i,r,s),o)},CombineHashCodes$6:function(e,t,n,i,r,s,o,a){return System.Collections.HashHelpers.Combine(System.ValueTuple.CombineHashCodes$5(e,t,n,i,r,s,o),a)},getDefaultValue:function(){return new System.ValueTuple}}},alias:["equalsT","System$IEquatable$1$System$ValueTuple$equalsT","compareTo",["System$IComparable$1$System$ValueTuple$compareTo","System$IComparable$1$compareTo"]],ctors:{ctor:function(){this.$initialize()}},methods:{equals:function(e){return Bridge.is(e,System.ValueTuple)},equalsT:function(e){return!0},System$Collections$IStructuralEquatable$Equals:function(e,t){return Bridge.is(e,System.ValueTuple)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");return 0},compareTo:function(e){return 0},System$Collections$IStructuralComparable$CompareTo:function(e,t){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");return 0},getHashCode:function(){return 0},System$Collections$IStructuralEquatable$GetHashCode:function(e){return 0},toString:function(){return"()"},$clone:function(e){return this}}}),Bridge.define("System.ValueTuple$1",function(n){return{inherits:function(){return[System.IEquatable$1(System.ValueTuple$1(n)),System.Collections.IStructuralEquatable,System.Collections.IStructuralComparable,System.IComparable,System.IComparable$1(System.ValueTuple$1(n)),System.ITupleInternal]},$kind:"struct",statics:{fields:{s_t1Comparer:null},ctors:{init:function(){this.s_t1Comparer=System.Collections.Generic.EqualityComparer$1(n).def}},methods:{getDefaultValue:function(){return new(System.ValueTuple$1(n))}}},fields:{Item1:Bridge.getDefaultValue(n)},props:{System$ITupleInternal$Size:{get:function(){return 1}}},alias:["equalsT","System$IEquatable$1$System$ValueTuple$1$"+Bridge.getTypeAlias(n)+"$equalsT","compareTo",["System$IComparable$1$System$ValueTuple$1$"+Bridge.getTypeAlias(n)+"$compareTo","System$IComparable$1$compareTo"]],ctors:{$ctor1:function(e){this.$initialize(),this.Item1=e},ctor:function(){this.$initialize()}},methods:{equals:function(e){return Bridge.is(e,System.ValueTuple$1(n))&&this.equalsT(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$1(n)),System.ValueTuple$1(n))))},equalsT:function(e){return System.ValueTuple$1(n).s_t1Comparer.equals2(this.Item1,e.Item1)},System$Collections$IStructuralEquatable$Equals:function(e,t){if(null==e||!Bridge.is(e,System.ValueTuple$1(n)))return!1;e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$1(n)),System.ValueTuple$1(n)));return t.System$Collections$IEqualityComparer$equals(this.Item1,e.Item1)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$1(n)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$1(n)),System.ValueTuple$1(n)));return new(System.Collections.Generic.Comparer$1(n))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item1,e.Item1)},compareTo:function(e){return new(System.Collections.Generic.Comparer$1(n))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item1,e.Item1)},System$Collections$IStructuralComparable$CompareTo:function(e,t){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$1(n)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$1(n)),System.ValueTuple$1(n)));return t.System$Collections$IComparer$compare(this.Item1,e.Item1)},getHashCode:function(){return System.ValueTuple$1(n).s_t1Comparer.getHashCode2(this.Item1)},System$Collections$IStructuralEquatable$GetHashCode:function(e){return e.System$Collections$IEqualityComparer$getHashCode(this.Item1)},System$ITupleInternal$GetHashCode:function(e){return e.System$Collections$IEqualityComparer$getHashCode(this.Item1)},toString:function(){return"("+((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+")"},System$ITupleInternal$ToStringEnd:function(){return((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+")"},$clone:function(e){e=e||new(System.ValueTuple$1(n));return e.Item1=this.Item1,e}}}}),Bridge.define("System.ValueTuple$2",function(i,r){return{inherits:function(){return[System.IEquatable$1(System.ValueTuple$2(i,r)),System.Collections.IStructuralEquatable,System.Collections.IStructuralComparable,System.IComparable,System.IComparable$1(System.ValueTuple$2(i,r)),System.ITupleInternal]},$kind:"struct",statics:{fields:{s_t1Comparer:null,s_t2Comparer:null},ctors:{init:function(){this.s_t1Comparer=System.Collections.Generic.EqualityComparer$1(i).def,this.s_t2Comparer=System.Collections.Generic.EqualityComparer$1(r).def}},methods:{getDefaultValue:function(){return new(System.ValueTuple$2(i,r))}}},fields:{Item1:Bridge.getDefaultValue(i),Item2:Bridge.getDefaultValue(r)},props:{System$ITupleInternal$Size:{get:function(){return 2}}},alias:["equalsT","System$IEquatable$1$System$ValueTuple$2$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$equalsT","compareTo",["System$IComparable$1$System$ValueTuple$2$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$compareTo","System$IComparable$1$compareTo"]],ctors:{$ctor1:function(e,t){this.$initialize(),this.Item1=e,this.Item2=t},ctor:function(){this.$initialize()}},methods:{equals:function(e){return Bridge.is(e,System.ValueTuple$2(i,r))&&this.equalsT(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$2(i,r)),System.ValueTuple$2(i,r))))},equalsT:function(e){return System.ValueTuple$2(i,r).s_t1Comparer.equals2(this.Item1,e.Item1)&&System.ValueTuple$2(i,r).s_t2Comparer.equals2(this.Item2,e.Item2)},System$Collections$IStructuralEquatable$Equals:function(e,t){if(null==e||!Bridge.is(e,System.ValueTuple$2(i,r)))return!1;e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$2(i,r)),System.ValueTuple$2(i,r)));return t.System$Collections$IEqualityComparer$equals(this.Item1,e.Item1)&&t.System$Collections$IEqualityComparer$equals(this.Item2,e.Item2)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$2(i,r)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");return this.compareTo(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$2(i,r)),System.ValueTuple$2(i,r))))},compareTo:function(e){var t=new(System.Collections.Generic.Comparer$1(i))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item1,e.Item1);return 0!==t?t:new(System.Collections.Generic.Comparer$1(r))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item2,e.Item2)},System$Collections$IStructuralComparable$CompareTo:function(e,t){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$2(i,r)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");var n=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$2(i,r)),System.ValueTuple$2(i,r))),e=t.System$Collections$IComparer$compare(this.Item1,n.Item1);return 0!==e?e:t.System$Collections$IComparer$compare(this.Item2,n.Item2)},getHashCode:function(){return System.ValueTuple.CombineHashCodes(System.ValueTuple$2(i,r).s_t1Comparer.getHashCode2(this.Item1),System.ValueTuple$2(i,r).s_t2Comparer.getHashCode2(this.Item2))},System$Collections$IStructuralEquatable$GetHashCode:function(e){return this.GetHashCodeCore(e)},System$ITupleInternal$GetHashCode:function(e){return this.GetHashCodeCore(e)},GetHashCodeCore:function(e){return System.ValueTuple.CombineHashCodes(e.System$Collections$IEqualityComparer$getHashCode(this.Item1),e.System$Collections$IEqualityComparer$getHashCode(this.Item2))},toString:function(){return"("+((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+")"},System$ITupleInternal$ToStringEnd:function(){return((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+")"},$clone:function(e){e=e||new(System.ValueTuple$2(i,r));return e.Item1=this.Item1,e.Item2=this.Item2,e}}}}),Bridge.define("System.ValueTuple$3",function(i,r,s){return{inherits:function(){return[System.IEquatable$1(System.ValueTuple$3(i,r,s)),System.Collections.IStructuralEquatable,System.Collections.IStructuralComparable,System.IComparable,System.IComparable$1(System.ValueTuple$3(i,r,s)),System.ITupleInternal]},$kind:"struct",statics:{fields:{s_t1Comparer:null,s_t2Comparer:null,s_t3Comparer:null},ctors:{init:function(){this.s_t1Comparer=System.Collections.Generic.EqualityComparer$1(i).def,this.s_t2Comparer=System.Collections.Generic.EqualityComparer$1(r).def,this.s_t3Comparer=System.Collections.Generic.EqualityComparer$1(s).def}},methods:{getDefaultValue:function(){return new(System.ValueTuple$3(i,r,s))}}},fields:{Item1:Bridge.getDefaultValue(i),Item2:Bridge.getDefaultValue(r),Item3:Bridge.getDefaultValue(s)},props:{System$ITupleInternal$Size:{get:function(){return 3}}},alias:["equalsT","System$IEquatable$1$System$ValueTuple$3$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$equalsT","compareTo",["System$IComparable$1$System$ValueTuple$3$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$compareTo","System$IComparable$1$compareTo"]],ctors:{$ctor1:function(e,t,n){this.$initialize(),this.Item1=e,this.Item2=t,this.Item3=n},ctor:function(){this.$initialize()}},methods:{equals:function(e){return Bridge.is(e,System.ValueTuple$3(i,r,s))&&this.equalsT(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$3(i,r,s)),System.ValueTuple$3(i,r,s))))},equalsT:function(e){return System.ValueTuple$3(i,r,s).s_t1Comparer.equals2(this.Item1,e.Item1)&&System.ValueTuple$3(i,r,s).s_t2Comparer.equals2(this.Item2,e.Item2)&&System.ValueTuple$3(i,r,s).s_t3Comparer.equals2(this.Item3,e.Item3)},System$Collections$IStructuralEquatable$Equals:function(e,t){if(null==e||!Bridge.is(e,System.ValueTuple$3(i,r,s)))return!1;e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$3(i,r,s)),System.ValueTuple$3(i,r,s)));return t.System$Collections$IEqualityComparer$equals(this.Item1,e.Item1)&&t.System$Collections$IEqualityComparer$equals(this.Item2,e.Item2)&&t.System$Collections$IEqualityComparer$equals(this.Item3,e.Item3)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$3(i,r,s)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");return this.compareTo(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$3(i,r,s)),System.ValueTuple$3(i,r,s))))},compareTo:function(e){var t=new(System.Collections.Generic.Comparer$1(i))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item1,e.Item1);return 0!==t||0!==(t=new(System.Collections.Generic.Comparer$1(r))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item2,e.Item2))?t:new(System.Collections.Generic.Comparer$1(s))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item3,e.Item3)},System$Collections$IStructuralComparable$CompareTo:function(e,t){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$3(i,r,s)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");var n=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$3(i,r,s)),System.ValueTuple$3(i,r,s))),e=t.System$Collections$IComparer$compare(this.Item1,n.Item1);return 0!==e||0!==(e=t.System$Collections$IComparer$compare(this.Item2,n.Item2))?e:t.System$Collections$IComparer$compare(this.Item3,n.Item3)},getHashCode:function(){return System.ValueTuple.CombineHashCodes$1(System.ValueTuple$3(i,r,s).s_t1Comparer.getHashCode2(this.Item1),System.ValueTuple$3(i,r,s).s_t2Comparer.getHashCode2(this.Item2),System.ValueTuple$3(i,r,s).s_t3Comparer.getHashCode2(this.Item3))},System$Collections$IStructuralEquatable$GetHashCode:function(e){return this.GetHashCodeCore(e)},System$ITupleInternal$GetHashCode:function(e){return this.GetHashCodeCore(e)},GetHashCodeCore:function(e){return System.ValueTuple.CombineHashCodes$1(e.System$Collections$IEqualityComparer$getHashCode(this.Item1),e.System$Collections$IEqualityComparer$getHashCode(this.Item2),e.System$Collections$IEqualityComparer$getHashCode(this.Item3))},toString:function(){return"("+((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+")"},System$ITupleInternal$ToStringEnd:function(){return((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+")"},$clone:function(e){e=e||new(System.ValueTuple$3(i,r,s));return e.Item1=this.Item1,e.Item2=this.Item2,e.Item3=this.Item3,e}}}}),Bridge.define("System.ValueTuple$4",function(i,r,s,o){return{inherits:function(){return[System.IEquatable$1(System.ValueTuple$4(i,r,s,o)),System.Collections.IStructuralEquatable,System.Collections.IStructuralComparable,System.IComparable,System.IComparable$1(System.ValueTuple$4(i,r,s,o)),System.ITupleInternal]},$kind:"struct",statics:{fields:{s_t1Comparer:null,s_t2Comparer:null,s_t3Comparer:null,s_t4Comparer:null},ctors:{init:function(){this.s_t1Comparer=System.Collections.Generic.EqualityComparer$1(i).def,this.s_t2Comparer=System.Collections.Generic.EqualityComparer$1(r).def,this.s_t3Comparer=System.Collections.Generic.EqualityComparer$1(s).def,this.s_t4Comparer=System.Collections.Generic.EqualityComparer$1(o).def}},methods:{getDefaultValue:function(){return new(System.ValueTuple$4(i,r,s,o))}}},fields:{Item1:Bridge.getDefaultValue(i),Item2:Bridge.getDefaultValue(r),Item3:Bridge.getDefaultValue(s),Item4:Bridge.getDefaultValue(o)},props:{System$ITupleInternal$Size:{get:function(){return 4}}},alias:["equalsT","System$IEquatable$1$System$ValueTuple$4$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$equalsT","compareTo",["System$IComparable$1$System$ValueTuple$4$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$compareTo","System$IComparable$1$compareTo"]],ctors:{$ctor1:function(e,t,n,i){this.$initialize(),this.Item1=e,this.Item2=t,this.Item3=n,this.Item4=i},ctor:function(){this.$initialize()}},methods:{equals:function(e){return Bridge.is(e,System.ValueTuple$4(i,r,s,o))&&this.equalsT(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$4(i,r,s,o)),System.ValueTuple$4(i,r,s,o))))},equalsT:function(e){return System.ValueTuple$4(i,r,s,o).s_t1Comparer.equals2(this.Item1,e.Item1)&&System.ValueTuple$4(i,r,s,o).s_t2Comparer.equals2(this.Item2,e.Item2)&&System.ValueTuple$4(i,r,s,o).s_t3Comparer.equals2(this.Item3,e.Item3)&&System.ValueTuple$4(i,r,s,o).s_t4Comparer.equals2(this.Item4,e.Item4)},System$Collections$IStructuralEquatable$Equals:function(e,t){if(null==e||!Bridge.is(e,System.ValueTuple$4(i,r,s,o)))return!1;e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$4(i,r,s,o)),System.ValueTuple$4(i,r,s,o)));return t.System$Collections$IEqualityComparer$equals(this.Item1,e.Item1)&&t.System$Collections$IEqualityComparer$equals(this.Item2,e.Item2)&&t.System$Collections$IEqualityComparer$equals(this.Item3,e.Item3)&&t.System$Collections$IEqualityComparer$equals(this.Item4,e.Item4)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$4(i,r,s,o)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");return this.compareTo(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$4(i,r,s,o)),System.ValueTuple$4(i,r,s,o))))},compareTo:function(e){var t=new(System.Collections.Generic.Comparer$1(i))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item1,e.Item1);return 0!==t||0!==(t=new(System.Collections.Generic.Comparer$1(r))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item2,e.Item2))||0!==(t=new(System.Collections.Generic.Comparer$1(s))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item3,e.Item3))?t:new(System.Collections.Generic.Comparer$1(o))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item4,e.Item4)},System$Collections$IStructuralComparable$CompareTo:function(e,t){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$4(i,r,s,o)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");var n=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$4(i,r,s,o)),System.ValueTuple$4(i,r,s,o))),e=t.System$Collections$IComparer$compare(this.Item1,n.Item1);return 0!==e||0!==(e=t.System$Collections$IComparer$compare(this.Item2,n.Item2))||0!==(e=t.System$Collections$IComparer$compare(this.Item3,n.Item3))?e:t.System$Collections$IComparer$compare(this.Item4,n.Item4)},getHashCode:function(){return System.ValueTuple.CombineHashCodes$2(System.ValueTuple$4(i,r,s,o).s_t1Comparer.getHashCode2(this.Item1),System.ValueTuple$4(i,r,s,o).s_t2Comparer.getHashCode2(this.Item2),System.ValueTuple$4(i,r,s,o).s_t3Comparer.getHashCode2(this.Item3),System.ValueTuple$4(i,r,s,o).s_t4Comparer.getHashCode2(this.Item4))},System$Collections$IStructuralEquatable$GetHashCode:function(e){return this.GetHashCodeCore(e)},System$ITupleInternal$GetHashCode:function(e){return this.GetHashCodeCore(e)},GetHashCodeCore:function(e){return System.ValueTuple.CombineHashCodes$2(e.System$Collections$IEqualityComparer$getHashCode(this.Item1),e.System$Collections$IEqualityComparer$getHashCode(this.Item2),e.System$Collections$IEqualityComparer$getHashCode(this.Item3),e.System$Collections$IEqualityComparer$getHashCode(this.Item4))},toString:function(){return"("+((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+")"},System$ITupleInternal$ToStringEnd:function(){return((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+")"},$clone:function(e){e=e||new(System.ValueTuple$4(i,r,s,o));return e.Item1=this.Item1,e.Item2=this.Item2,e.Item3=this.Item3,e.Item4=this.Item4,e}}}}),Bridge.define("System.ValueTuple$5",function(i,r,s,o,a){return{inherits:function(){return[System.IEquatable$1(System.ValueTuple$5(i,r,s,o,a)),System.Collections.IStructuralEquatable,System.Collections.IStructuralComparable,System.IComparable,System.IComparable$1(System.ValueTuple$5(i,r,s,o,a)),System.ITupleInternal]},$kind:"struct",statics:{fields:{s_t1Comparer:null,s_t2Comparer:null,s_t3Comparer:null,s_t4Comparer:null,s_t5Comparer:null},ctors:{init:function(){this.s_t1Comparer=System.Collections.Generic.EqualityComparer$1(i).def,this.s_t2Comparer=System.Collections.Generic.EqualityComparer$1(r).def,this.s_t3Comparer=System.Collections.Generic.EqualityComparer$1(s).def,this.s_t4Comparer=System.Collections.Generic.EqualityComparer$1(o).def,this.s_t5Comparer=System.Collections.Generic.EqualityComparer$1(a).def}},methods:{getDefaultValue:function(){return new(System.ValueTuple$5(i,r,s,o,a))}}},fields:{Item1:Bridge.getDefaultValue(i),Item2:Bridge.getDefaultValue(r),Item3:Bridge.getDefaultValue(s),Item4:Bridge.getDefaultValue(o),Item5:Bridge.getDefaultValue(a)},props:{System$ITupleInternal$Size:{get:function(){return 5}}},alias:["equalsT","System$IEquatable$1$System$ValueTuple$5$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$equalsT","compareTo",["System$IComparable$1$System$ValueTuple$5$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$compareTo","System$IComparable$1$compareTo"]],ctors:{$ctor1:function(e,t,n,i,r){this.$initialize(),this.Item1=e,this.Item2=t,this.Item3=n,this.Item4=i,this.Item5=r},ctor:function(){this.$initialize()}},methods:{equals:function(e){return Bridge.is(e,System.ValueTuple$5(i,r,s,o,a))&&this.equalsT(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$5(i,r,s,o,a)),System.ValueTuple$5(i,r,s,o,a))))},equalsT:function(e){return System.ValueTuple$5(i,r,s,o,a).s_t1Comparer.equals2(this.Item1,e.Item1)&&System.ValueTuple$5(i,r,s,o,a).s_t2Comparer.equals2(this.Item2,e.Item2)&&System.ValueTuple$5(i,r,s,o,a).s_t3Comparer.equals2(this.Item3,e.Item3)&&System.ValueTuple$5(i,r,s,o,a).s_t4Comparer.equals2(this.Item4,e.Item4)&&System.ValueTuple$5(i,r,s,o,a).s_t5Comparer.equals2(this.Item5,e.Item5)},System$Collections$IStructuralEquatable$Equals:function(e,t){if(null==e||!Bridge.is(e,System.ValueTuple$5(i,r,s,o,a)))return!1;e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$5(i,r,s,o,a)),System.ValueTuple$5(i,r,s,o,a)));return t.System$Collections$IEqualityComparer$equals(this.Item1,e.Item1)&&t.System$Collections$IEqualityComparer$equals(this.Item2,e.Item2)&&t.System$Collections$IEqualityComparer$equals(this.Item3,e.Item3)&&t.System$Collections$IEqualityComparer$equals(this.Item4,e.Item4)&&t.System$Collections$IEqualityComparer$equals(this.Item5,e.Item5)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$5(i,r,s,o,a)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");return this.compareTo(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$5(i,r,s,o,a)),System.ValueTuple$5(i,r,s,o,a))))},compareTo:function(e){var t=new(System.Collections.Generic.Comparer$1(i))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item1,e.Item1);return 0!==t||0!==(t=new(System.Collections.Generic.Comparer$1(r))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item2,e.Item2))||0!==(t=new(System.Collections.Generic.Comparer$1(s))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item3,e.Item3))||0!==(t=new(System.Collections.Generic.Comparer$1(o))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item4,e.Item4))?t:new(System.Collections.Generic.Comparer$1(a))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item5,e.Item5)},System$Collections$IStructuralComparable$CompareTo:function(e,t){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$5(i,r,s,o,a)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");var n=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$5(i,r,s,o,a)),System.ValueTuple$5(i,r,s,o,a))),e=t.System$Collections$IComparer$compare(this.Item1,n.Item1);return 0!==e||0!==(e=t.System$Collections$IComparer$compare(this.Item2,n.Item2))||0!==(e=t.System$Collections$IComparer$compare(this.Item3,n.Item3))||0!==(e=t.System$Collections$IComparer$compare(this.Item4,n.Item4))?e:t.System$Collections$IComparer$compare(this.Item5,n.Item5)},getHashCode:function(){return System.ValueTuple.CombineHashCodes$3(System.ValueTuple$5(i,r,s,o,a).s_t1Comparer.getHashCode2(this.Item1),System.ValueTuple$5(i,r,s,o,a).s_t2Comparer.getHashCode2(this.Item2),System.ValueTuple$5(i,r,s,o,a).s_t3Comparer.getHashCode2(this.Item3),System.ValueTuple$5(i,r,s,o,a).s_t4Comparer.getHashCode2(this.Item4),System.ValueTuple$5(i,r,s,o,a).s_t5Comparer.getHashCode2(this.Item5))},System$Collections$IStructuralEquatable$GetHashCode:function(e){return this.GetHashCodeCore(e)},System$ITupleInternal$GetHashCode:function(e){return this.GetHashCodeCore(e)},GetHashCodeCore:function(e){return System.ValueTuple.CombineHashCodes$3(e.System$Collections$IEqualityComparer$getHashCode(this.Item1),e.System$Collections$IEqualityComparer$getHashCode(this.Item2),e.System$Collections$IEqualityComparer$getHashCode(this.Item3),e.System$Collections$IEqualityComparer$getHashCode(this.Item4),e.System$Collections$IEqualityComparer$getHashCode(this.Item5))},toString:function(){return"("+((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+")"},System$ITupleInternal$ToStringEnd:function(){return((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+")"},$clone:function(e){e=e||new(System.ValueTuple$5(i,r,s,o,a));return e.Item1=this.Item1,e.Item2=this.Item2,e.Item3=this.Item3,e.Item4=this.Item4,e.Item5=this.Item5,e}}}}),Bridge.define("System.ValueTuple$6",function(i,r,s,o,a,u){return{inherits:function(){return[System.IEquatable$1(System.ValueTuple$6(i,r,s,o,a,u)),System.Collections.IStructuralEquatable,System.Collections.IStructuralComparable,System.IComparable,System.IComparable$1(System.ValueTuple$6(i,r,s,o,a,u)),System.ITupleInternal]},$kind:"struct",statics:{fields:{s_t1Comparer:null,s_t2Comparer:null,s_t3Comparer:null,s_t4Comparer:null,s_t5Comparer:null,s_t6Comparer:null},ctors:{init:function(){this.s_t1Comparer=System.Collections.Generic.EqualityComparer$1(i).def,this.s_t2Comparer=System.Collections.Generic.EqualityComparer$1(r).def,this.s_t3Comparer=System.Collections.Generic.EqualityComparer$1(s).def,this.s_t4Comparer=System.Collections.Generic.EqualityComparer$1(o).def,this.s_t5Comparer=System.Collections.Generic.EqualityComparer$1(a).def,this.s_t6Comparer=System.Collections.Generic.EqualityComparer$1(u).def}},methods:{getDefaultValue:function(){return new(System.ValueTuple$6(i,r,s,o,a,u))}}},fields:{Item1:Bridge.getDefaultValue(i),Item2:Bridge.getDefaultValue(r),Item3:Bridge.getDefaultValue(s),Item4:Bridge.getDefaultValue(o),Item5:Bridge.getDefaultValue(a),Item6:Bridge.getDefaultValue(u)},props:{System$ITupleInternal$Size:{get:function(){return 6}}},alias:["equalsT","System$IEquatable$1$System$ValueTuple$6$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$"+Bridge.getTypeAlias(u)+"$equalsT","compareTo",["System$IComparable$1$System$ValueTuple$6$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$"+Bridge.getTypeAlias(u)+"$compareTo","System$IComparable$1$compareTo"]],ctors:{$ctor1:function(e,t,n,i,r,s){this.$initialize(),this.Item1=e,this.Item2=t,this.Item3=n,this.Item4=i,this.Item5=r,this.Item6=s},ctor:function(){this.$initialize()}},methods:{equals:function(e){return Bridge.is(e,System.ValueTuple$6(i,r,s,o,a,u))&&this.equalsT(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$6(i,r,s,o,a,u)),System.ValueTuple$6(i,r,s,o,a,u))))},equalsT:function(e){return System.ValueTuple$6(i,r,s,o,a,u).s_t1Comparer.equals2(this.Item1,e.Item1)&&System.ValueTuple$6(i,r,s,o,a,u).s_t2Comparer.equals2(this.Item2,e.Item2)&&System.ValueTuple$6(i,r,s,o,a,u).s_t3Comparer.equals2(this.Item3,e.Item3)&&System.ValueTuple$6(i,r,s,o,a,u).s_t4Comparer.equals2(this.Item4,e.Item4)&&System.ValueTuple$6(i,r,s,o,a,u).s_t5Comparer.equals2(this.Item5,e.Item5)&&System.ValueTuple$6(i,r,s,o,a,u).s_t6Comparer.equals2(this.Item6,e.Item6)},System$Collections$IStructuralEquatable$Equals:function(e,t){if(null==e||!Bridge.is(e,System.ValueTuple$6(i,r,s,o,a,u)))return!1;e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$6(i,r,s,o,a,u)),System.ValueTuple$6(i,r,s,o,a,u)));return t.System$Collections$IEqualityComparer$equals(this.Item1,e.Item1)&&t.System$Collections$IEqualityComparer$equals(this.Item2,e.Item2)&&t.System$Collections$IEqualityComparer$equals(this.Item3,e.Item3)&&t.System$Collections$IEqualityComparer$equals(this.Item4,e.Item4)&&t.System$Collections$IEqualityComparer$equals(this.Item5,e.Item5)&&t.System$Collections$IEqualityComparer$equals(this.Item6,e.Item6)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$6(i,r,s,o,a,u)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");return this.compareTo(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$6(i,r,s,o,a,u)),System.ValueTuple$6(i,r,s,o,a,u))))},compareTo:function(e){var t=new(System.Collections.Generic.Comparer$1(i))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item1,e.Item1);return 0!==t||0!==(t=new(System.Collections.Generic.Comparer$1(r))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item2,e.Item2))||0!==(t=new(System.Collections.Generic.Comparer$1(s))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item3,e.Item3))||0!==(t=new(System.Collections.Generic.Comparer$1(o))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item4,e.Item4))||0!==(t=new(System.Collections.Generic.Comparer$1(a))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item5,e.Item5))?t:new(System.Collections.Generic.Comparer$1(u))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item6,e.Item6)},System$Collections$IStructuralComparable$CompareTo:function(e,t){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$6(i,r,s,o,a,u)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");var n=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$6(i,r,s,o,a,u)),System.ValueTuple$6(i,r,s,o,a,u))),e=t.System$Collections$IComparer$compare(this.Item1,n.Item1);return 0!==e||0!==(e=t.System$Collections$IComparer$compare(this.Item2,n.Item2))||0!==(e=t.System$Collections$IComparer$compare(this.Item3,n.Item3))||0!==(e=t.System$Collections$IComparer$compare(this.Item4,n.Item4))||0!==(e=t.System$Collections$IComparer$compare(this.Item5,n.Item5))?e:t.System$Collections$IComparer$compare(this.Item6,n.Item6)},getHashCode:function(){return System.ValueTuple.CombineHashCodes$4(System.ValueTuple$6(i,r,s,o,a,u).s_t1Comparer.getHashCode2(this.Item1),System.ValueTuple$6(i,r,s,o,a,u).s_t2Comparer.getHashCode2(this.Item2),System.ValueTuple$6(i,r,s,o,a,u).s_t3Comparer.getHashCode2(this.Item3),System.ValueTuple$6(i,r,s,o,a,u).s_t4Comparer.getHashCode2(this.Item4),System.ValueTuple$6(i,r,s,o,a,u).s_t5Comparer.getHashCode2(this.Item5),System.ValueTuple$6(i,r,s,o,a,u).s_t6Comparer.getHashCode2(this.Item6))},System$Collections$IStructuralEquatable$GetHashCode:function(e){return this.GetHashCodeCore(e)},System$ITupleInternal$GetHashCode:function(e){return this.GetHashCodeCore(e)},GetHashCodeCore:function(e){return System.ValueTuple.CombineHashCodes$4(e.System$Collections$IEqualityComparer$getHashCode(this.Item1),e.System$Collections$IEqualityComparer$getHashCode(this.Item2),e.System$Collections$IEqualityComparer$getHashCode(this.Item3),e.System$Collections$IEqualityComparer$getHashCode(this.Item4),e.System$Collections$IEqualityComparer$getHashCode(this.Item5),e.System$Collections$IEqualityComparer$getHashCode(this.Item6))},toString:function(){return"("+((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+", "+((null!=this.Item6?Bridge.toString(this.Item6):null)||"")+")"},System$ITupleInternal$ToStringEnd:function(){return((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+", "+((null!=this.Item6?Bridge.toString(this.Item6):null)||"")+")"},$clone:function(e){e=e||new(System.ValueTuple$6(i,r,s,o,a,u));return e.Item1=this.Item1,e.Item2=this.Item2,e.Item3=this.Item3,e.Item4=this.Item4,e.Item5=this.Item5,e.Item6=this.Item6,e}}}}),Bridge.define("System.ValueTuple$7",function(i,r,s,o,a,u,l){return{inherits:function(){return[System.IEquatable$1(System.ValueTuple$7(i,r,s,o,a,u,l)),System.Collections.IStructuralEquatable,System.Collections.IStructuralComparable,System.IComparable,System.IComparable$1(System.ValueTuple$7(i,r,s,o,a,u,l)),System.ITupleInternal]},$kind:"struct",statics:{fields:{s_t1Comparer:null,s_t2Comparer:null,s_t3Comparer:null,s_t4Comparer:null,s_t5Comparer:null,s_t6Comparer:null,s_t7Comparer:null},ctors:{init:function(){this.s_t1Comparer=System.Collections.Generic.EqualityComparer$1(i).def,this.s_t2Comparer=System.Collections.Generic.EqualityComparer$1(r).def,this.s_t3Comparer=System.Collections.Generic.EqualityComparer$1(s).def,this.s_t4Comparer=System.Collections.Generic.EqualityComparer$1(o).def,this.s_t5Comparer=System.Collections.Generic.EqualityComparer$1(a).def,this.s_t6Comparer=System.Collections.Generic.EqualityComparer$1(u).def,this.s_t7Comparer=System.Collections.Generic.EqualityComparer$1(l).def}},methods:{getDefaultValue:function(){return new(System.ValueTuple$7(i,r,s,o,a,u,l))}}},fields:{Item1:Bridge.getDefaultValue(i),Item2:Bridge.getDefaultValue(r),Item3:Bridge.getDefaultValue(s),Item4:Bridge.getDefaultValue(o),Item5:Bridge.getDefaultValue(a),Item6:Bridge.getDefaultValue(u),Item7:Bridge.getDefaultValue(l)},props:{System$ITupleInternal$Size:{get:function(){return 7}}},alias:["equalsT","System$IEquatable$1$System$ValueTuple$7$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$"+Bridge.getTypeAlias(u)+"$"+Bridge.getTypeAlias(l)+"$equalsT","compareTo",["System$IComparable$1$System$ValueTuple$7$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$"+Bridge.getTypeAlias(u)+"$"+Bridge.getTypeAlias(l)+"$compareTo","System$IComparable$1$compareTo"]],ctors:{$ctor1:function(e,t,n,i,r,s,o){this.$initialize(),this.Item1=e,this.Item2=t,this.Item3=n,this.Item4=i,this.Item5=r,this.Item6=s,this.Item7=o},ctor:function(){this.$initialize()}},methods:{equals:function(e){return Bridge.is(e,System.ValueTuple$7(i,r,s,o,a,u,l))&&this.equalsT(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$7(i,r,s,o,a,u,l)),System.ValueTuple$7(i,r,s,o,a,u,l))))},equalsT:function(e){return System.ValueTuple$7(i,r,s,o,a,u,l).s_t1Comparer.equals2(this.Item1,e.Item1)&&System.ValueTuple$7(i,r,s,o,a,u,l).s_t2Comparer.equals2(this.Item2,e.Item2)&&System.ValueTuple$7(i,r,s,o,a,u,l).s_t3Comparer.equals2(this.Item3,e.Item3)&&System.ValueTuple$7(i,r,s,o,a,u,l).s_t4Comparer.equals2(this.Item4,e.Item4)&&System.ValueTuple$7(i,r,s,o,a,u,l).s_t5Comparer.equals2(this.Item5,e.Item5)&&System.ValueTuple$7(i,r,s,o,a,u,l).s_t6Comparer.equals2(this.Item6,e.Item6)&&System.ValueTuple$7(i,r,s,o,a,u,l).s_t7Comparer.equals2(this.Item7,e.Item7)},System$Collections$IStructuralEquatable$Equals:function(e,t){if(null==e||!Bridge.is(e,System.ValueTuple$7(i,r,s,o,a,u,l)))return!1;e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$7(i,r,s,o,a,u,l)),System.ValueTuple$7(i,r,s,o,a,u,l)));return t.System$Collections$IEqualityComparer$equals(this.Item1,e.Item1)&&t.System$Collections$IEqualityComparer$equals(this.Item2,e.Item2)&&t.System$Collections$IEqualityComparer$equals(this.Item3,e.Item3)&&t.System$Collections$IEqualityComparer$equals(this.Item4,e.Item4)&&t.System$Collections$IEqualityComparer$equals(this.Item5,e.Item5)&&t.System$Collections$IEqualityComparer$equals(this.Item6,e.Item6)&&t.System$Collections$IEqualityComparer$equals(this.Item7,e.Item7)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$7(i,r,s,o,a,u,l)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");return this.compareTo(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$7(i,r,s,o,a,u,l)),System.ValueTuple$7(i,r,s,o,a,u,l))))},compareTo:function(e){var t=new(System.Collections.Generic.Comparer$1(i))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item1,e.Item1);return 0!==t||0!==(t=new(System.Collections.Generic.Comparer$1(r))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item2,e.Item2))||0!==(t=new(System.Collections.Generic.Comparer$1(s))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item3,e.Item3))||0!==(t=new(System.Collections.Generic.Comparer$1(o))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item4,e.Item4))||0!==(t=new(System.Collections.Generic.Comparer$1(a))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item5,e.Item5))||0!==(t=new(System.Collections.Generic.Comparer$1(u))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item6,e.Item6))?t:new(System.Collections.Generic.Comparer$1(l))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item7,e.Item7)},System$Collections$IStructuralComparable$CompareTo:function(e,t){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$7(i,r,s,o,a,u,l)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");var n=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$7(i,r,s,o,a,u,l)),System.ValueTuple$7(i,r,s,o,a,u,l))),e=t.System$Collections$IComparer$compare(this.Item1,n.Item1);return 0!==e||0!==(e=t.System$Collections$IComparer$compare(this.Item2,n.Item2))||0!==(e=t.System$Collections$IComparer$compare(this.Item3,n.Item3))||0!==(e=t.System$Collections$IComparer$compare(this.Item4,n.Item4))||0!==(e=t.System$Collections$IComparer$compare(this.Item5,n.Item5))||0!==(e=t.System$Collections$IComparer$compare(this.Item6,n.Item6))?e:t.System$Collections$IComparer$compare(this.Item7,n.Item7)},getHashCode:function(){return System.ValueTuple.CombineHashCodes$5(System.ValueTuple$7(i,r,s,o,a,u,l).s_t1Comparer.getHashCode2(this.Item1),System.ValueTuple$7(i,r,s,o,a,u,l).s_t2Comparer.getHashCode2(this.Item2),System.ValueTuple$7(i,r,s,o,a,u,l).s_t3Comparer.getHashCode2(this.Item3),System.ValueTuple$7(i,r,s,o,a,u,l).s_t4Comparer.getHashCode2(this.Item4),System.ValueTuple$7(i,r,s,o,a,u,l).s_t5Comparer.getHashCode2(this.Item5),System.ValueTuple$7(i,r,s,o,a,u,l).s_t6Comparer.getHashCode2(this.Item6),System.ValueTuple$7(i,r,s,o,a,u,l).s_t7Comparer.getHashCode2(this.Item7))},System$Collections$IStructuralEquatable$GetHashCode:function(e){return this.GetHashCodeCore(e)},System$ITupleInternal$GetHashCode:function(e){return this.GetHashCodeCore(e)},GetHashCodeCore:function(e){return System.ValueTuple.CombineHashCodes$5(e.System$Collections$IEqualityComparer$getHashCode(this.Item1),e.System$Collections$IEqualityComparer$getHashCode(this.Item2),e.System$Collections$IEqualityComparer$getHashCode(this.Item3),e.System$Collections$IEqualityComparer$getHashCode(this.Item4),e.System$Collections$IEqualityComparer$getHashCode(this.Item5),e.System$Collections$IEqualityComparer$getHashCode(this.Item6),e.System$Collections$IEqualityComparer$getHashCode(this.Item7))},toString:function(){return"("+((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+", "+((null!=this.Item6?Bridge.toString(this.Item6):null)||"")+", "+((null!=this.Item7?Bridge.toString(this.Item7):null)||"")+")"},System$ITupleInternal$ToStringEnd:function(){return((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+", "+((null!=this.Item6?Bridge.toString(this.Item6):null)||"")+", "+((null!=this.Item7?Bridge.toString(this.Item7):null)||"")+")"},$clone:function(e){e=e||new(System.ValueTuple$7(i,r,s,o,a,u,l));return e.Item1=this.Item1,e.Item2=this.Item2,e.Item3=this.Item3,e.Item4=this.Item4,e.Item5=this.Item5,e.Item6=this.Item6,e.Item7=this.Item7,e}}}}),Bridge.define("System.ValueTuple$8",function(i,r,s,o,a,u,l,c){return{inherits:function(){return[System.IEquatable$1(System.ValueTuple$8(i,r,s,o,a,u,l,c)),System.Collections.IStructuralEquatable,System.Collections.IStructuralComparable,System.IComparable,System.IComparable$1(System.ValueTuple$8(i,r,s,o,a,u,l,c)),System.ITupleInternal]},$kind:"struct",statics:{fields:{s_t1Comparer:null,s_t2Comparer:null,s_t3Comparer:null,s_t4Comparer:null,s_t5Comparer:null,s_t6Comparer:null,s_t7Comparer:null,s_tRestComparer:null},ctors:{init:function(){this.s_t1Comparer=System.Collections.Generic.EqualityComparer$1(i).def,this.s_t2Comparer=System.Collections.Generic.EqualityComparer$1(r).def,this.s_t3Comparer=System.Collections.Generic.EqualityComparer$1(s).def,this.s_t4Comparer=System.Collections.Generic.EqualityComparer$1(o).def,this.s_t5Comparer=System.Collections.Generic.EqualityComparer$1(a).def,this.s_t6Comparer=System.Collections.Generic.EqualityComparer$1(u).def,this.s_t7Comparer=System.Collections.Generic.EqualityComparer$1(l).def,this.s_tRestComparer=System.Collections.Generic.EqualityComparer$1(c).def}},methods:{getDefaultValue:function(){return new(System.ValueTuple$8(i,r,s,o,a,u,l,c))}}},fields:{Item1:Bridge.getDefaultValue(i),Item2:Bridge.getDefaultValue(r),Item3:Bridge.getDefaultValue(s),Item4:Bridge.getDefaultValue(o),Item5:Bridge.getDefaultValue(a),Item6:Bridge.getDefaultValue(u),Item7:Bridge.getDefaultValue(l),Rest:Bridge.getDefaultValue(c)},props:{System$ITupleInternal$Size:{get:function(){var e=Bridge.as(this.Rest,System.ITupleInternal);return null==e?8:7+e.System$ITupleInternal$Size|0}}},alias:["equalsT","System$IEquatable$1$System$ValueTuple$8$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$"+Bridge.getTypeAlias(u)+"$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$equalsT","compareTo",["System$IComparable$1$System$ValueTuple$8$"+Bridge.getTypeAlias(i)+"$"+Bridge.getTypeAlias(r)+"$"+Bridge.getTypeAlias(s)+"$"+Bridge.getTypeAlias(o)+"$"+Bridge.getTypeAlias(a)+"$"+Bridge.getTypeAlias(u)+"$"+Bridge.getTypeAlias(l)+"$"+Bridge.getTypeAlias(c)+"$compareTo","System$IComparable$1$compareTo"]],ctors:{$ctor1:function(e,t,n,i,r,s,o,a){if(this.$initialize(),!Bridge.is(a,System.ITupleInternal))throw new System.ArgumentException.$ctor1(System.SR.ArgumentException_ValueTupleLastArgumentNotAValueTuple);this.Item1=e,this.Item2=t,this.Item3=n,this.Item4=i,this.Item5=r,this.Item6=s,this.Item7=o,this.Rest=a},ctor:function(){this.$initialize()}},methods:{equals:function(e){return Bridge.is(e,System.ValueTuple$8(i,r,s,o,a,u,l,c))&&this.equalsT(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$8(i,r,s,o,a,u,l,c)),System.ValueTuple$8(i,r,s,o,a,u,l,c))))},equalsT:function(e){return System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t1Comparer.equals2(this.Item1,e.Item1)&&System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t2Comparer.equals2(this.Item2,e.Item2)&&System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t3Comparer.equals2(this.Item3,e.Item3)&&System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t4Comparer.equals2(this.Item4,e.Item4)&&System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t5Comparer.equals2(this.Item5,e.Item5)&&System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t6Comparer.equals2(this.Item6,e.Item6)&&System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t7Comparer.equals2(this.Item7,e.Item7)&&System.ValueTuple$8(i,r,s,o,a,u,l,c).s_tRestComparer.equals2(this.Rest,e.Rest)},System$Collections$IStructuralEquatable$Equals:function(e,t){if(null==e||!Bridge.is(e,System.ValueTuple$8(i,r,s,o,a,u,l,c)))return!1;e=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$8(i,r,s,o,a,u,l,c)),System.ValueTuple$8(i,r,s,o,a,u,l,c)));return t.System$Collections$IEqualityComparer$equals(this.Item1,e.Item1)&&t.System$Collections$IEqualityComparer$equals(this.Item2,e.Item2)&&t.System$Collections$IEqualityComparer$equals(this.Item3,e.Item3)&&t.System$Collections$IEqualityComparer$equals(this.Item4,e.Item4)&&t.System$Collections$IEqualityComparer$equals(this.Item5,e.Item5)&&t.System$Collections$IEqualityComparer$equals(this.Item6,e.Item6)&&t.System$Collections$IEqualityComparer$equals(this.Item7,e.Item7)&&t.System$Collections$IEqualityComparer$equals(this.Rest,e.Rest)},System$IComparable$compareTo:function(e){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$8(i,r,s,o,a,u,l,c)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");return this.compareTo(System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$8(i,r,s,o,a,u,l,c)),System.ValueTuple$8(i,r,s,o,a,u,l,c))))},compareTo:function(e){var t=new(System.Collections.Generic.Comparer$1(i))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item1,e.Item1);return 0!==t||0!==(t=new(System.Collections.Generic.Comparer$1(r))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item2,e.Item2))||0!==(t=new(System.Collections.Generic.Comparer$1(s))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item3,e.Item3))||0!==(t=new(System.Collections.Generic.Comparer$1(o))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item4,e.Item4))||0!==(t=new(System.Collections.Generic.Comparer$1(a))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item5,e.Item5))||0!==(t=new(System.Collections.Generic.Comparer$1(u))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item6,e.Item6))||0!==(t=new(System.Collections.Generic.Comparer$1(l))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Item7,e.Item7))?t:new(System.Collections.Generic.Comparer$1(c))(System.Collections.Generic.Comparer$1.$default.fn).compare(this.Rest,e.Rest)},System$Collections$IStructuralComparable$CompareTo:function(e,t){if(null==e)return 1;if(!Bridge.is(e,System.ValueTuple$8(i,r,s,o,a,u,l,c)))throw new System.ArgumentException.$ctor3(System.SR.ArgumentException_ValueTupleIncorrectType,"other");var n=System.Nullable.getValue(Bridge.cast(Bridge.unbox(e,System.ValueTuple$8(i,r,s,o,a,u,l,c)),System.ValueTuple$8(i,r,s,o,a,u,l,c))),e=t.System$Collections$IComparer$compare(this.Item1,n.Item1);return 0!==e||0!==(e=t.System$Collections$IComparer$compare(this.Item2,n.Item2))||0!==(e=t.System$Collections$IComparer$compare(this.Item3,n.Item3))||0!==(e=t.System$Collections$IComparer$compare(this.Item4,n.Item4))||0!==(e=t.System$Collections$IComparer$compare(this.Item5,n.Item5))||0!==(e=t.System$Collections$IComparer$compare(this.Item6,n.Item6))||0!==(e=t.System$Collections$IComparer$compare(this.Item7,n.Item7))?e:t.System$Collections$IComparer$compare(this.Rest,n.Rest)},getHashCode:function(){var e=Bridge.as(this.Rest,System.ITupleInternal);if(null==e)return System.ValueTuple.CombineHashCodes$5(System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t1Comparer.getHashCode2(this.Item1),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t2Comparer.getHashCode2(this.Item2),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t3Comparer.getHashCode2(this.Item3),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t4Comparer.getHashCode2(this.Item4),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t5Comparer.getHashCode2(this.Item5),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t6Comparer.getHashCode2(this.Item6),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t7Comparer.getHashCode2(this.Item7));var t=e.System$ITupleInternal$Size;if(8<=t)return Bridge.getHashCode(e);switch(8-t|0){case 1:return System.ValueTuple.CombineHashCodes(System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t7Comparer.getHashCode2(this.Item7),Bridge.getHashCode(e));case 2:return System.ValueTuple.CombineHashCodes$1(System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t6Comparer.getHashCode2(this.Item6),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t7Comparer.getHashCode2(this.Item7),Bridge.getHashCode(e));case 3:return System.ValueTuple.CombineHashCodes$2(System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t5Comparer.getHashCode2(this.Item5),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t6Comparer.getHashCode2(this.Item6),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t7Comparer.getHashCode2(this.Item7),Bridge.getHashCode(e));case 4:return System.ValueTuple.CombineHashCodes$3(System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t4Comparer.getHashCode2(this.Item4),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t5Comparer.getHashCode2(this.Item5),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t6Comparer.getHashCode2(this.Item6),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t7Comparer.getHashCode2(this.Item7),Bridge.getHashCode(e));case 5:return System.ValueTuple.CombineHashCodes$4(System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t3Comparer.getHashCode2(this.Item3),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t4Comparer.getHashCode2(this.Item4),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t5Comparer.getHashCode2(this.Item5),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t6Comparer.getHashCode2(this.Item6),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t7Comparer.getHashCode2(this.Item7),Bridge.getHashCode(e));case 6:return System.ValueTuple.CombineHashCodes$5(System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t2Comparer.getHashCode2(this.Item2),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t3Comparer.getHashCode2(this.Item3),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t4Comparer.getHashCode2(this.Item4),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t5Comparer.getHashCode2(this.Item5),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t6Comparer.getHashCode2(this.Item6),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t7Comparer.getHashCode2(this.Item7),Bridge.getHashCode(e));case 7:case 8:return System.ValueTuple.CombineHashCodes$6(System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t1Comparer.getHashCode2(this.Item1),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t2Comparer.getHashCode2(this.Item2),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t3Comparer.getHashCode2(this.Item3),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t4Comparer.getHashCode2(this.Item4),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t5Comparer.getHashCode2(this.Item5),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t6Comparer.getHashCode2(this.Item6),System.ValueTuple$8(i,r,s,o,a,u,l,c).s_t7Comparer.getHashCode2(this.Item7),Bridge.getHashCode(e))}return-1},System$Collections$IStructuralEquatable$GetHashCode:function(e){return this.GetHashCodeCore(e)},System$ITupleInternal$GetHashCode:function(e){return this.GetHashCodeCore(e)},GetHashCodeCore:function(e){var t=Bridge.as(this.Rest,System.ITupleInternal);if(null==t)return System.ValueTuple.CombineHashCodes$5(e.System$Collections$IEqualityComparer$getHashCode(this.Item1),e.System$Collections$IEqualityComparer$getHashCode(this.Item2),e.System$Collections$IEqualityComparer$getHashCode(this.Item3),e.System$Collections$IEqualityComparer$getHashCode(this.Item4),e.System$Collections$IEqualityComparer$getHashCode(this.Item5),e.System$Collections$IEqualityComparer$getHashCode(this.Item6),e.System$Collections$IEqualityComparer$getHashCode(this.Item7));var n=t.System$ITupleInternal$Size;if(8<=n)return t.System$ITupleInternal$GetHashCode(e);switch(8-n|0){case 1:return System.ValueTuple.CombineHashCodes(e.System$Collections$IEqualityComparer$getHashCode(this.Item7),t.System$ITupleInternal$GetHashCode(e));case 2:return System.ValueTuple.CombineHashCodes$1(e.System$Collections$IEqualityComparer$getHashCode(this.Item6),e.System$Collections$IEqualityComparer$getHashCode(this.Item7),t.System$ITupleInternal$GetHashCode(e));case 3:return System.ValueTuple.CombineHashCodes$2(e.System$Collections$IEqualityComparer$getHashCode(this.Item5),e.System$Collections$IEqualityComparer$getHashCode(this.Item6),e.System$Collections$IEqualityComparer$getHashCode(this.Item7),t.System$ITupleInternal$GetHashCode(e));case 4:return System.ValueTuple.CombineHashCodes$3(e.System$Collections$IEqualityComparer$getHashCode(this.Item4),e.System$Collections$IEqualityComparer$getHashCode(this.Item5),e.System$Collections$IEqualityComparer$getHashCode(this.Item6),e.System$Collections$IEqualityComparer$getHashCode(this.Item7),t.System$ITupleInternal$GetHashCode(e));case 5:return System.ValueTuple.CombineHashCodes$4(e.System$Collections$IEqualityComparer$getHashCode(this.Item3),e.System$Collections$IEqualityComparer$getHashCode(this.Item4),e.System$Collections$IEqualityComparer$getHashCode(this.Item5),e.System$Collections$IEqualityComparer$getHashCode(this.Item6),e.System$Collections$IEqualityComparer$getHashCode(this.Item7),t.System$ITupleInternal$GetHashCode(e));case 6:return System.ValueTuple.CombineHashCodes$5(e.System$Collections$IEqualityComparer$getHashCode(this.Item2),e.System$Collections$IEqualityComparer$getHashCode(this.Item3),e.System$Collections$IEqualityComparer$getHashCode(this.Item4),e.System$Collections$IEqualityComparer$getHashCode(this.Item5),e.System$Collections$IEqualityComparer$getHashCode(this.Item6),e.System$Collections$IEqualityComparer$getHashCode(this.Item7),t.System$ITupleInternal$GetHashCode(e));case 7:case 8:return System.ValueTuple.CombineHashCodes$6(e.System$Collections$IEqualityComparer$getHashCode(this.Item1),e.System$Collections$IEqualityComparer$getHashCode(this.Item2),e.System$Collections$IEqualityComparer$getHashCode(this.Item3),e.System$Collections$IEqualityComparer$getHashCode(this.Item4),e.System$Collections$IEqualityComparer$getHashCode(this.Item5),e.System$Collections$IEqualityComparer$getHashCode(this.Item6),e.System$Collections$IEqualityComparer$getHashCode(this.Item7),t.System$ITupleInternal$GetHashCode(e))}return-1},toString:function(){var e=Bridge.as(this.Rest,System.ITupleInternal);return null==e?"("+((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+", "+((null!=this.Item6?Bridge.toString(this.Item6):null)||"")+", "+((null!=this.Item7?Bridge.toString(this.Item7):null)||"")+", "+(Bridge.toString(this.Rest)||"")+")":"("+((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+", "+((null!=this.Item6?Bridge.toString(this.Item6):null)||"")+", "+((null!=this.Item7?Bridge.toString(this.Item7):null)||"")+", "+(e.System$ITupleInternal$ToStringEnd()||"")},System$ITupleInternal$ToStringEnd:function(){var e=Bridge.as(this.Rest,System.ITupleInternal);return null==e?((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+", "+((null!=this.Item6?Bridge.toString(this.Item6):null)||"")+", "+((null!=this.Item7?Bridge.toString(this.Item7):null)||"")+", "+(Bridge.toString(this.Rest)||"")+")":((null!=this.Item1?Bridge.toString(this.Item1):null)||"")+", "+((null!=this.Item2?Bridge.toString(this.Item2):null)||"")+", "+((null!=this.Item3?Bridge.toString(this.Item3):null)||"")+", "+((null!=this.Item4?Bridge.toString(this.Item4):null)||"")+", "+((null!=this.Item5?Bridge.toString(this.Item5):null)||"")+", "+((null!=this.Item6?Bridge.toString(this.Item6):null)||"")+", "+((null!=this.Item7?Bridge.toString(this.Item7):null)||"")+", "+(e.System$ITupleInternal$ToStringEnd()||"")},$clone:function(e){e=e||new(System.ValueTuple$8(i,r,s,o,a,u,l,c));return e.Item1=this.Item1,e.Item2=this.Item2,e.Item3=this.Item3,e.Item4=this.Item4,e.Item5=this.Item5,e.Item6=this.Item6,e.Item7=this.Item7,e.Rest=this.Rest,e}}}}),Bridge.define("System.IndexOutOfRangeException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Index was outside the bounds of the array."),this.HResult=-2146233080},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233080},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233080}}}),Bridge.define("System.InvalidCastException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Specified cast is not valid."),this.HResult=-2147467262},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2147467262},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2147467262},$ctor3:function(e,t){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=t}}}),Bridge.define("System.InvalidOperationException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Operation is not valid due to the current state of the object."),this.HResult=-2146233079},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233079},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233079}}}),Bridge.define("System.ObjectDisposedException",{inherits:[System.InvalidOperationException],fields:{_objectName:null},props:{Message:{get:function(){var e=this.ObjectName;if(null==e||0===e.length)return Bridge.ensureBaseProperty(this,"Message").$System$Exception$Message;e=System.SR.Format("Object name: '{0}'.",e);return(Bridge.ensureBaseProperty(this,"Message").$System$Exception$Message||"")+"\n"+(e||"")}},ObjectName:{get:function(){return null==this._objectName?"":this._objectName}}},ctors:{ctor:function(){System.ObjectDisposedException.$ctor3.call(this,null,"Cannot access a disposed object.")},$ctor1:function(e){System.ObjectDisposedException.$ctor3.call(this,e,"Cannot access a disposed object.")},$ctor3:function(e,t){this.$initialize(),System.InvalidOperationException.$ctor1.call(this,t),this.HResult=-2146232798,this._objectName=e},$ctor2:function(e,t){this.$initialize(),System.InvalidOperationException.$ctor2.call(this,e,t),this.HResult=-2146232798}}}),Bridge.define("System.InvalidProgramException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Common Language Runtime detected an invalid program."),this.HResult=-2146233030},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233030},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233030}}}),Bridge.define("System.MissingMethodException",{inherits:[System.Exception],ctors:{ctor:function(){this.$initialize(),System.Exception.ctor.call(this,"Attempted to access a missing method.")},$ctor1:function(e){this.$initialize(),System.Exception.ctor.call(this,e)},$ctor2:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e,t)},$ctor3:function(e,t){this.$initialize(),System.Exception.ctor.call(this,(e||"")+"."+(t||"")+" Due to: Attempted to access a missing member.")}}}),Bridge.define("System.Globalization.Calendar",{inherits:[System.ICloneable],statics:{fields:{TicksPerMillisecond:System.Int64(0),TicksPerSecond:System.Int64(0),TicksPerMinute:System.Int64(0),TicksPerHour:System.Int64(0),TicksPerDay:System.Int64(0),MillisPerSecond:0,MillisPerMinute:0,MillisPerHour:0,MillisPerDay:0,DaysPerYear:0,DaysPer4Years:0,DaysPer100Years:0,DaysPer400Years:0,DaysTo10000:0,MaxMillis:System.Int64(0),CurrentEra:0},ctors:{init:function(){this.TicksPerMillisecond=System.Int64(1e4),this.TicksPerSecond=System.Int64(1e7),this.TicksPerMinute=System.Int64(6e8),this.TicksPerHour=System.Int64([1640261632,8]),this.TicksPerDay=System.Int64([711573504,201]),this.MillisPerSecond=1e3,this.MillisPerMinute=6e4,this.MillisPerHour=36e5,this.MillisPerDay=864e5,this.DaysPerYear=365,this.DaysPer4Years=1461,this.DaysPer100Years=36524,this.DaysPer400Years=146097,this.DaysTo10000=3652059,this.MaxMillis=System.Int64([-464735232,73466]),this.CurrentEra=0}},methods:{ReadOnly:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("calendar");if(e.IsReadOnly)return e;e=Bridge.cast(Bridge.clone(e),System.Globalization.Calendar);return e.SetReadOnlyState(!0),e},CheckAddResult:function(e,t,n){if(e.lt(System.DateTime.getTicks(t))||e.gt(System.DateTime.getTicks(n)))throw new System.ArgumentException.$ctor1(System.String.formatProvider(System.Globalization.CultureInfo.invariantCulture,System.SR.Format$1("The result is out of the supported range for this calendar. The result should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive.",Bridge.box(t,System.DateTime,System.DateTime.format),Bridge.box(n,System.DateTime,System.DateTime.format)),null))},GetSystemTwoDigitYearSetting:function(e,t){var n=2029;return n<0&&(n=t),n}}},fields:{_isReadOnly:!1,twoDigitYearMax:0},props:{MinSupportedDateTime:{get:function(){return System.DateTime.getMinValue()}},MaxSupportedDateTime:{get:function(){return System.DateTime.getMaxValue()}},AlgorithmType:{get:function(){return 0}},ID:{get:function(){return 0}},BaseCalendarID:{get:function(){return this.ID}},IsReadOnly:{get:function(){return this._isReadOnly}},CurrentEraValue:{get:function(){throw System.NotImplemented.ByDesign}},DaysInYearBeforeMinSupportedYear:{get:function(){return 365}},TwoDigitYearMax:{get:function(){return this.twoDigitYearMax},set:function(e){this.VerifyWritable(),this.twoDigitYearMax=e}}},alias:["clone","System$ICloneable$clone"],ctors:{init:function(){this._isReadOnly=!1,this.twoDigitYearMax=-1},ctor:function(){this.$initialize()}},methods:{clone:function(){var e=Bridge.clone(this);return Bridge.cast(e,System.Globalization.Calendar).SetReadOnlyState(!1),e},VerifyWritable:function(){if(this._isReadOnly)throw new System.InvalidOperationException.$ctor1("Instance is read-only.")},SetReadOnlyState:function(e){this._isReadOnly=e},Add:function(e,t,n){t=t*n+(0<=t?.5:-.5);if(!(-3155378976e5<t&&t<3155378976e5))throw new System.ArgumentOutOfRangeException.$ctor4("value","Value to add was out of range.");t=Bridge.Int.clip64(t),t=System.DateTime.getTicks(e).add(t.mul(System.Globalization.Calendar.TicksPerMillisecond));return System.Globalization.Calendar.CheckAddResult(t,this.MinSupportedDateTime,this.MaxSupportedDateTime),System.DateTime.create$2(t)},AddMilliseconds:function(e,t){return this.Add(e,t,1)},AddDays:function(e,t){return this.Add(e,t,System.Globalization.Calendar.MillisPerDay)},AddHours:function(e,t){return this.Add(e,t,System.Globalization.Calendar.MillisPerHour)},AddMinutes:function(e,t){return this.Add(e,t,System.Globalization.Calendar.MillisPerMinute)},AddSeconds:function(e,t){return this.Add(e,t,System.Globalization.Calendar.MillisPerSecond)},AddWeeks:function(e,t){return this.AddDays(e,Bridge.Int.mul(t,7))},GetDaysInMonth:function(e,t){return this.GetDaysInMonth$1(e,t,System.Globalization.Calendar.CurrentEra)},GetDaysInYear:function(e){return this.GetDaysInYear$1(e,System.Globalization.Calendar.CurrentEra)},GetHour:function(e){return System.Int64.clip32(System.DateTime.getTicks(e).div(System.Globalization.Calendar.TicksPerHour).mod(System.Int64(24)))},GetMilliseconds:function(e){return System.Int64.toNumber(System.DateTime.getTicks(e).div(System.Globalization.Calendar.TicksPerMillisecond).mod(System.Int64(1e3)))},GetMinute:function(e){return System.Int64.clip32(System.DateTime.getTicks(e).div(System.Globalization.Calendar.TicksPerMinute).mod(System.Int64(60)))},GetMonthsInYear:function(e){return this.GetMonthsInYear$1(e,System.Globalization.Calendar.CurrentEra)},GetSecond:function(e){return System.Int64.clip32(System.DateTime.getTicks(e).div(System.Globalization.Calendar.TicksPerSecond).mod(System.Int64(60)))},GetFirstDayWeekOfYear:function(e,t){var n=this.GetDayOfYear(e)-1|0,t=(14+((this.GetDayOfWeek(e)-n%7|0)-t|0)|0)%7;return 1+(0|Bridge.Int.div(n+t|0,7))|0},GetWeekOfYearFullDays:function(e,t,n){var i=this.GetDayOfYear(e)-1|0,r=(14+(t-(this.GetDayOfWeek(e)-i%7|0)|0)|0)%7;return 0!==r&&n<=r&&(r=r-7|0),0<=(r=i-r|0)?1+(0|Bridge.Int.div(r,7))|0:System.DateTime.lte(e,System.DateTime.addDays(this.MinSupportedDateTime,i))?this.GetWeekOfYearOfMinSupportedDateTime(t,n):this.GetWeekOfYearFullDays(System.DateTime.addDays(e,0|-(1+i|0)),t,n)},GetWeekOfYearOfMinSupportedDateTime:function(e,t){var n=this.GetDayOfYear(this.MinSupportedDateTime)-1|0,i=this.GetDayOfWeek(this.MinSupportedDateTime)-n%7|0,n=((e+7|0)-i|0)%7;if(0==n||t<=n)return 1;n=this.DaysInYearBeforeMinSupportedYear-1|0,i=(14+(e-((i-1|0)-n%7|0)|0)|0)%7,n=n-i|0;return t<=i&&(n=n+7|0),1+(0|Bridge.Int.div(n,7))|0},GetWeekOfYear:function(e,t,n){if(n<0||6<n)throw new System.ArgumentOutOfRangeException.$ctor4("firstDayOfWeek",System.SR.Format$1("Valid values are between {0} and {1}, inclusive.",Bridge.box(System.DayOfWeek.Sunday,System.DayOfWeek,System.Enum.toStringFn(System.DayOfWeek)),Bridge.box(System.DayOfWeek.Saturday,System.DayOfWeek,System.Enum.toStringFn(System.DayOfWeek))));switch(t){case 0:return this.GetFirstDayWeekOfYear(e,n);case 1:return this.GetWeekOfYearFullDays(e,n,7);case 2:return this.GetWeekOfYearFullDays(e,n,4)}throw new System.ArgumentOutOfRangeException.$ctor4("rule",System.SR.Format$1("Valid values are between {0} and {1}, inclusive.",Bridge.box(0,System.Globalization.CalendarWeekRule,System.Enum.toStringFn(System.Globalization.CalendarWeekRule)),Bridge.box(2,System.Globalization.CalendarWeekRule,System.Enum.toStringFn(System.Globalization.CalendarWeekRule))))},IsLeapDay:function(e,t,n){return this.IsLeapDay$1(e,t,n,System.Globalization.Calendar.CurrentEra)},IsLeapMonth:function(e,t){return this.IsLeapMonth$1(e,t,System.Globalization.Calendar.CurrentEra)},GetLeapMonth:function(e){return this.GetLeapMonth$1(e,System.Globalization.Calendar.CurrentEra)},GetLeapMonth$1:function(e,t){if(!this.IsLeapYear$1(e,t))return 0;for(var n=this.GetMonthsInYear$1(e,t),i=1;i<=n;i=i+1|0)if(this.IsLeapMonth$1(e,i,t))return i;return 0},IsLeapYear:function(e){return this.IsLeapYear$1(e,System.Globalization.Calendar.CurrentEra)},ToDateTime:function(e,t,n,i,r,s,o){return this.ToDateTime$1(e,t,n,i,r,s,o,System.Globalization.Calendar.CurrentEra)},TryToDateTime:function(e,t,n,i,r,s,o,a,u){u.v=System.DateTime.getMinValue();try{return u.v=this.ToDateTime$1(e,t,n,i,r,s,o,a),!0}catch(e){if(e=System.Exception.create(e),Bridge.is(e,System.ArgumentException))return!1;throw e}},IsValidYear:function(e,t){return e>=this.GetYear(this.MinSupportedDateTime)&&e<=this.GetYear(this.MaxSupportedDateTime)},IsValidMonth:function(e,t,n){return this.IsValidYear(e,n)&&1<=t&&t<=this.GetMonthsInYear$1(e,n)},IsValidDay:function(e,t,n,i){return this.IsValidMonth(e,t,i)&&1<=n&&n<=this.GetDaysInMonth$1(e,t,i)},ToFourDigitYear:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor4("year","Non-negative number required.");return e<100?Bridge.Int.mul((0|Bridge.Int.div(this.TwoDigitYearMax,100))-(e>this.TwoDigitYearMax%100?1:0)|0,100)+e|0:e}}}),Bridge.define("System.Globalization.CalendarAlgorithmType",{$kind:"enum",statics:{fields:{Unknown:0,SolarCalendar:1,LunarCalendar:2,LunisolarCalendar:3}}}),Bridge.define("System.Globalization.CalendarId",{$kind:"enum",statics:{fields:{UNINITIALIZED_VALUE:0,GREGORIAN:1,GREGORIAN_US:2,JAPAN:3,TAIWAN:4,KOREA:5,HIJRI:6,THAI:7,HEBREW:8,GREGORIAN_ME_FRENCH:9,GREGORIAN_ARABIC:10,GREGORIAN_XLIT_ENGLISH:11,GREGORIAN_XLIT_FRENCH:12,JULIAN:13,JAPANESELUNISOLAR:14,CHINESELUNISOLAR:15,SAKA:16,LUNAR_ETO_CHN:17,LUNAR_ETO_KOR:18,LUNAR_ETO_ROKUYOU:19,KOREANLUNISOLAR:20,TAIWANLUNISOLAR:21,PERSIAN:22,UMALQURA:23,LAST_CALENDAR:23}},$utype:System.UInt16}),Bridge.define("System.Globalization.CalendarWeekRule",{$kind:"enum",statics:{fields:{FirstDay:0,FirstFullWeek:1,FirstFourDayWeek:2}}}),Bridge.define("System.Globalization.CultureNotFoundException",{inherits:[System.ArgumentException],statics:{props:{DefaultMessage:{get:function(){return"Culture is not supported."}}}},fields:{_invalidCultureName:null,_invalidCultureId:null},props:{InvalidCultureId:{get:function(){return this._invalidCultureId}},InvalidCultureName:{get:function(){return this._invalidCultureName}},FormatedInvalidCultureId:{get:function(){return null!=this.InvalidCultureId?System.String.formatProvider(System.Globalization.CultureInfo.invariantCulture,"{0} (0x{0:x4})",[Bridge.box(System.Nullable.getValue(this.InvalidCultureId),System.Int32)]):this.InvalidCultureName}},Message:{get:function(){var e=Bridge.ensureBaseProperty(this,"Message").$System$ArgumentException$Message;if(null==this._invalidCultureId&&null==this._invalidCultureName)return e;var t=System.SR.Format("{0} is an invalid culture identifier.",this.FormatedInvalidCultureId);return null==e?t:(e||"")+"\n"+(t||"")}}},ctors:{ctor:function(){this.$initialize(),System.ArgumentException.$ctor1.call(this,System.Globalization.CultureNotFoundException.DefaultMessage)},$ctor1:function(e){this.$initialize(),System.ArgumentException.$ctor1.call(this,e)},$ctor5:function(e,t){this.$initialize(),System.ArgumentException.$ctor3.call(this,t,e)},$ctor2:function(e,t){this.$initialize(),System.ArgumentException.$ctor2.call(this,e,t)},$ctor7:function(e,t,n){this.$initialize(),System.ArgumentException.$ctor3.call(this,n,e),this._invalidCultureName=t},$ctor6:function(e,t,n){this.$initialize(),System.ArgumentException.$ctor2.call(this,e,n),this._invalidCultureName=t},$ctor3:function(e,t,n){this.$initialize(),System.ArgumentException.$ctor2.call(this,e,n),this._invalidCultureId=t},$ctor4:function(e,t,n){this.$initialize(),System.ArgumentException.$ctor3.call(this,n,e),this._invalidCultureId=t}}}),Bridge.define("System.Globalization.DateTimeFormatInfoScanner",{statics:{fields:{MonthPostfixChar:0,IgnorableSymbolChar:0,CJKYearSuff:null,CJKMonthSuff:null,CJKDaySuff:null,KoreanYearSuff:null,KoreanMonthSuff:null,KoreanDaySuff:null,KoreanHourSuff:null,KoreanMinuteSuff:null,KoreanSecondSuff:null,CJKHourSuff:null,ChineseHourSuff:null,CJKMinuteSuff:null,CJKSecondSuff:null,s_knownWords:null},props:{KnownWords:{get:function(){var e;return null==System.Globalization.DateTimeFormatInfoScanner.s_knownWords&&((e=new(System.Collections.Generic.Dictionary$2(System.String,System.String).ctor)).add("/",""),e.add("-",""),e.add(".",""),e.add(System.Globalization.DateTimeFormatInfoScanner.CJKYearSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.CJKMonthSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.CJKDaySuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.KoreanYearSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.KoreanMonthSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.KoreanDaySuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.KoreanHourSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.KoreanMinuteSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.KoreanSecondSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.CJKHourSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.ChineseHourSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.CJKMinuteSuff,""),e.add(System.Globalization.DateTimeFormatInfoScanner.CJKSecondSuff,""),System.Globalization.DateTimeFormatInfoScanner.s_knownWords=e),System.Globalization.DateTimeFormatInfoScanner.s_knownWords}}},ctors:{init:function(){this.MonthPostfixChar=57344,this.IgnorableSymbolChar=57345,this.CJKYearSuff="年",this.CJKMonthSuff="月",this.CJKDaySuff="日",this.KoreanYearSuff="년",this.KoreanMonthSuff="월",this.KoreanDaySuff="일",this.KoreanHourSuff="시",this.KoreanMinuteSuff="분",this.KoreanSecondSuff="초",this.CJKHourSuff="時",this.ChineseHourSuff="时",this.CJKMinuteSuff="分",this.CJKSecondSuff="秒"}},methods:{SkipWhiteSpacesAndNonLetter:function(e,t){for(;t<e.length;){var n=e.charCodeAt(t);if(92===n){if(!((t=t+1|0)<e.length))break;if(39===(n=e.charCodeAt(t)))continue}if(System.Char.isLetter(n)||39===n||46===n)break;t=t+1|0}return t},ScanRepeatChar:function(e,t,n,i){for(i.v=1;(n=n+1|0)<e.length&&e.charCodeAt(n)===t;)i.v=i.v+1|0;return n},GetFormatFlagGenitiveMonth:function(e,t,n,i){return System.Globalization.DateTimeFormatInfoScanner.EqualStringArrays(e,t)&&System.Globalization.DateTimeFormatInfoScanner.EqualStringArrays(n,i)?0:1},GetFormatFlagUseSpaceInMonthNames:function(e,t,n,i){var r=0;return r|=System.Globalization.DateTimeFormatInfoScanner.ArrayElementsBeginWithDigit(e)||System.Globalization.DateTimeFormatInfoScanner.ArrayElementsBeginWithDigit(t)||System.Globalization.DateTimeFormatInfoScanner.ArrayElementsBeginWithDigit(n)||System.Globalization.DateTimeFormatInfoScanner.ArrayElementsBeginWithDigit(i)?32:0,r|=System.Globalization.DateTimeFormatInfoScanner.ArrayElementsHaveSpace(e)||System.Globalization.DateTimeFormatInfoScanner.ArrayElementsHaveSpace(t)||System.Globalization.DateTimeFormatInfoScanner.ArrayElementsHaveSpace(n)||System.Globalization.DateTimeFormatInfoScanner.ArrayElementsHaveSpace(i)?4:0},GetFormatFlagUseSpaceInDayNames:function(e,t){return System.Globalization.DateTimeFormatInfoScanner.ArrayElementsHaveSpace(e)||System.Globalization.DateTimeFormatInfoScanner.ArrayElementsHaveSpace(t)?16:0},GetFormatFlagUseHebrewCalendar:function(e){return 8===e?10:0},EqualStringArrays:function(e,t){if(Bridge.referenceEquals(e,t))return!0;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n=n+1|0)if(!System.String.equals(e[System.Array.index(n,e)],t[System.Array.index(n,t)]))return!1;return!0},ArrayElementsHaveSpace:function(e){for(var t=0;t<e.length;t=t+1|0)for(var n=0;n<e[System.Array.index(t,e)].length;n=n+1|0)if(System.Char.isWhiteSpace(String.fromCharCode(e[System.Array.index(t,e)].charCodeAt(n))))return!0;return!1},ArrayElementsBeginWithDigit:function(e){for(var t=0;t<e.length;t=t+1|0)if(0<e[System.Array.index(t,e)].length&&48<=e[System.Array.index(t,e)].charCodeAt(0)&&e[System.Array.index(t,e)].charCodeAt(0)<=57){for(var n=1;n<e[System.Array.index(t,e)].length&&48<=e[System.Array.index(t,e)].charCodeAt(n)&&e[System.Array.index(t,e)].charCodeAt(n)<=57;)n=n+1|0;if(n===e[System.Array.index(t,e)].length)return!1;if(n===(e[System.Array.index(t,e)].length-1|0))switch(e[System.Array.index(t,e)].charCodeAt(n)){case 26376:case 50900:return!1}return n===(e[System.Array.index(t,e)].length-4|0)&&39===e[System.Array.index(t,e)].charCodeAt(n)&&32===e[System.Array.index(t,e)].charCodeAt(n+1|0)&&26376===e[System.Array.index(t,e)].charCodeAt(n+2|0)&&39===e[System.Array.index(t,e)].charCodeAt(n+3|0)?!1:!0}return!1}}},fields:{m_dateWords:null,_ymdFlags:0},ctors:{init:function(){this.m_dateWords=new(System.Collections.Generic.List$1(System.String).ctor),this._ymdFlags=System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern.None}},methods:{AddDateWordOrPostfix:function(e,t){0<t.length&&(System.String.equals(t,".")?this.AddIgnorableSymbols("."):!1===System.Globalization.DateTimeFormatInfoScanner.KnownWords.tryGetValue(t,{})&&(null==this.m_dateWords&&(this.m_dateWords=new(System.Collections.Generic.List$1(System.String).ctor)),Bridge.referenceEquals(e,"MMMM")?(e=String.fromCharCode(System.Globalization.DateTimeFormatInfoScanner.MonthPostfixChar)+(t||""),this.m_dateWords.contains(e)||this.m_dateWords.add(e)):(this.m_dateWords.contains(t)||this.m_dateWords.add(t),46===t.charCodeAt(t.length-1|0)&&(t=t.substr(0,t.length-1|0),this.m_dateWords.contains(t)||this.m_dateWords.add(t)))))},AddDateWords:function(e,t,n){var i=System.Globalization.DateTimeFormatInfoScanner.SkipWhiteSpacesAndNonLetter(e,t);i!==t&&null!=n&&(n=null),t=i;for(var r=new System.Text.StringBuilder;t<e.length;){var s=e.charCodeAt(t);if(39===s){this.AddDateWordOrPostfix(n,r.toString()),t=t+1|0;break}92===s?(t=t+1|0)<e.length&&(r.append(String.fromCharCode(e.charCodeAt(t))),t=t+1|0):t=(System.Char.isWhiteSpace(String.fromCharCode(s))?(this.AddDateWordOrPostfix(n,r.toString()),null!=n&&(n=null),r.setLength(0)):r.append(String.fromCharCode(s)),t+1|0)}return t},AddIgnorableSymbols:function(e){null==this.m_dateWords&&(this.m_dateWords=new(System.Collections.Generic.List$1(System.String).ctor));e=String.fromCharCode(System.Globalization.DateTimeFormatInfoScanner.IgnorableSymbolChar)+(e||"");this.m_dateWords.contains(e)||this.m_dateWords.add(e)},ScanDateWord:function(e){this._ymdFlags=System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern.None;for(var t=0;t<e.length;){var n=e.charCodeAt(t),i={};switch(n){case 39:t=this.AddDateWords(e,t+1|0,null);break;case 77:t=System.Globalization.DateTimeFormatInfoScanner.ScanRepeatChar(e,77,t,i),4<=i.v&&t<e.length&&39===e.charCodeAt(t)&&(t=this.AddDateWords(e,t+1|0,"MMMM")),this._ymdFlags|=System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern.FoundMonthPatternFlag;break;case 121:t=System.Globalization.DateTimeFormatInfoScanner.ScanRepeatChar(e,121,t,i),this._ymdFlags|=System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern.FoundYearPatternFlag;break;case 100:t=System.Globalization.DateTimeFormatInfoScanner.ScanRepeatChar(e,100,t,i),i.v<=2&&(this._ymdFlags|=System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern.FoundDayPatternFlag);break;case 92:t=t+2|0;break;case 46:this._ymdFlags===System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern.FoundYMDPatternFlag&&(this.AddIgnorableSymbols("."),this._ymdFlags=System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern.None),t=t+1|0;break;default:this._ymdFlags!==System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern.FoundYMDPatternFlag||System.Char.isWhiteSpace(String.fromCharCode(n))||(this._ymdFlags=System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern.None),t=t+1|0}}},GetDateWordsOfDTFI:function(e){for(var t=e.getAllDateTimePatterns(68),n=0;n<t.length;n=n+1|0)this.ScanDateWord(t[System.Array.index(n,t)]);for(t=e.getAllDateTimePatterns(100),n=0;n<t.length;n=n+1|0)this.ScanDateWord(t[System.Array.index(n,t)]);for(t=e.getAllDateTimePatterns(121),n=0;n<t.length;n=n+1|0)this.ScanDateWord(t[System.Array.index(n,t)]);for(this.ScanDateWord(e.monthDayPattern),t=e.getAllDateTimePatterns(84),n=0;n<t.length;n=n+1|0)this.ScanDateWord(t[System.Array.index(n,t)]);for(t=e.getAllDateTimePatterns(116),n=0;n<t.length;n=n+1|0)this.ScanDateWord(t[System.Array.index(n,t)]);var i=null;if(null!=this.m_dateWords&&0<this.m_dateWords.Count)for(i=System.Array.init(this.m_dateWords.Count,null,System.String),n=0;n<this.m_dateWords.Count;n=n+1|0)i[System.Array.index(n,i)]=this.m_dateWords.getItem(n);return i}}}),Bridge.define("System.Globalization.DateTimeStyles",{$kind:"enum",statics:{fields:{None:0,AllowLeadingWhite:1,AllowTrailingWhite:2,AllowInnerWhite:4,AllowWhiteSpaces:7,NoCurrentDateDefault:8,AdjustToUniversal:16,AssumeLocal:32,AssumeUniversal:64,RoundtripKind:128}},$flags:!0}),Bridge.define("System.Globalization.FORMATFLAGS",{$kind:"enum",statics:{fields:{None:0,UseGenitiveMonth:1,UseLeapYearMonth:2,UseSpacesInMonthNames:4,UseHebrewParsing:8,UseSpacesInDayNames:16,UseDigitPrefixInTokens:32}}}),Bridge.define("System.Globalization.GlobalizationMode",{statics:{props:{Invariant:!1},ctors:{init:function(){this.Invariant=System.Globalization.GlobalizationMode.GetGlobalizationInvariantMode()}},methods:{GetInvariantSwitchValue:function(){return!0},GetGlobalizationInvariantMode:function(){return System.Globalization.GlobalizationMode.GetInvariantSwitchValue()}}}}),Bridge.define("System.Globalization.DateTimeFormatInfoScanner.FoundDatePattern",{$kind:"nested enum",statics:{fields:{None:0,FoundYearPatternFlag:1,FoundMonthPatternFlag:2,FoundDayPatternFlag:4,FoundYMDPatternFlag:7}}}),Bridge.define("System.NotImplemented",{statics:{props:{ByDesign:{get:function(){return new System.NotImplementedException.ctor}}},methods:{ByDesignWithMessage:function(e){return new System.NotImplementedException.$ctor1(e)}}}}),Bridge.define("System.NotImplementedException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"The method or operation is not implemented."),this.HResult=-2147467263},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2147467263},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2147467263}}}),Bridge.define("System.NotSupportedException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Specified method is not supported."),this.HResult=-2146233067},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233067},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233067}}}),Bridge.define("System.NullReferenceException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Object reference not set to an instance of an object."),this.HResult=-2147467261},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2147467261},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2147467261}}}),Bridge.define("System.OperationCanceledException",{inherits:[System.SystemException],fields:{_cancellationToken:null},props:{CancellationToken:{get:function(){return this._cancellationToken},set:function(e){this._cancellationToken=e}}},ctors:{init:function(){this._cancellationToken=new System.Threading.CancellationToken},ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"The operation was canceled."),this.HResult=-2146233029},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233029},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233029},$ctor5:function(e){System.OperationCanceledException.ctor.call(this),this.CancellationToken=e},$ctor4:function(e,t){System.OperationCanceledException.$ctor1.call(this,e),this.CancellationToken=t},$ctor3:function(e,t,n){System.OperationCanceledException.$ctor2.call(this,e,t),this.CancellationToken=n}}}),Bridge.define("System.OverflowException",{inherits:[System.ArithmeticException],ctors:{ctor:function(){this.$initialize(),System.ArithmeticException.$ctor1.call(this,"Arithmetic operation resulted in an overflow."),this.HResult=-2146233066},$ctor1:function(e){this.$initialize(),System.ArithmeticException.$ctor1.call(this,e),this.HResult=-2146233066},$ctor2:function(e,t){this.$initialize(),System.ArithmeticException.$ctor2.call(this,e,t),this.HResult=-2146233066}}}),Bridge.define("System.ParseFailureKind",{$kind:"enum",statics:{fields:{None:0,ArgumentNull:1,Format:2,FormatWithParameter:3,FormatBadDateTimeCalendar:4}}}),Bridge.define("System.ParseFlags",{$kind:"enum",statics:{fields:{HaveYear:1,HaveMonth:2,HaveDay:4,HaveHour:8,HaveMinute:16,HaveSecond:32,HaveTime:64,HaveDate:128,TimeZoneUsed:256,TimeZoneUtc:512,ParsedMonthName:1024,CaptureOffset:2048,YearDefault:4096,Rfc1123Pattern:8192,UtcSortPattern:16384}},$flags:!0}),Bridge.define("System.Text.StringBuilderCache",{statics:{fields:{MAX_BUILDER_SIZE:0,DEFAULT_CAPACITY:0,t_cachedInstance:null},ctors:{init:function(){this.MAX_BUILDER_SIZE=260,this.DEFAULT_CAPACITY=16}},methods:{Acquire:function(e){if(void 0===e&&(e=16),e<=System.Text.StringBuilderCache.MAX_BUILDER_SIZE){var t=System.Text.StringBuilderCache.t_cachedInstance;if(null!=t&&e<=t.getCapacity())return System.Text.StringBuilderCache.t_cachedInstance=null,t.clear(),t}return new System.Text.StringBuilder("",e)},Release:function(e){e.getCapacity()<=System.Text.StringBuilderCache.MAX_BUILDER_SIZE&&(System.Text.StringBuilderCache.t_cachedInstance=e)},GetStringAndRelease:function(e){var t=e.toString();return System.Text.StringBuilderCache.Release(e),t}}}}),Bridge.define("System.IO.BinaryReader",{inherits:[System.IDisposable],statics:{fields:{MaxCharBytesSize:0},ctors:{init:function(){this.MaxCharBytesSize=128}}},fields:{m_stream:null,m_buffer:null,m_encoding:null,m_charBytes:null,m_singleChar:null,m_charBuffer:null,m_maxCharsSize:0,m_2BytesPerChar:!1,m_isMemoryStream:!1,m_leaveOpen:!1,lastCharsRead:0},props:{BaseStream:{get:function(){return this.m_stream}}},alias:["Dispose","System$IDisposable$Dispose"],ctors:{init:function(){this.lastCharsRead=0},ctor:function(e){System.IO.BinaryReader.$ctor2.call(this,e,new System.Text.UTF8Encoding.ctor,!1)},$ctor1:function(e,t){System.IO.BinaryReader.$ctor2.call(this,e,t,!1)},$ctor2:function(e,t,n){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("input");if(null==t)throw new System.ArgumentNullException.$ctor1("encoding");if(!e.CanRead)throw new System.ArgumentException.$ctor1("Argument_StreamNotReadable");this.m_stream=e,this.m_encoding=t,this.m_maxCharsSize=t.GetMaxCharCount(System.IO.BinaryReader.MaxCharBytesSize);e=t.GetMaxByteCount(1);e<23&&(e=23),this.m_buffer=System.Array.init(e,0,System.Byte),this.m_2BytesPerChar=Bridge.is(t,System.Text.UnicodeEncoding),this.m_isMemoryStream=Bridge.referenceEquals(Bridge.getType(this.m_stream),System.IO.MemoryStream),this.m_leaveOpen=n}},methods:{Close:function(){this.Dispose$1(!0)},Dispose$1:function(e){e&&(e=this.m_stream,(this.m_stream=null)==e||this.m_leaveOpen||e.Close()),this.m_stream=null,this.m_buffer=null,this.m_encoding=null,this.m_charBytes=null,this.m_singleChar=null,this.m_charBuffer=null},Dispose:function(){this.Dispose$1(!0)},PeekChar:function(){if(null==this.m_stream&&System.IO.__Error.FileNotOpen(),!this.m_stream.CanSeek)return-1;var e=this.m_stream.Position,t=this.Read();return this.m_stream.Position=e,t},Read:function(){return null==this.m_stream&&System.IO.__Error.FileNotOpen(),this.InternalReadOneChar()},Read$2:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor3("buffer","ArgumentNull_Buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("index","ArgumentOutOfRange_NeedNonNegNum");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","ArgumentOutOfRange_NeedNonNegNum");if((e.length-t|0)<n)throw new System.ArgumentException.$ctor1("Argument_InvalidOffLen");return null==this.m_stream&&System.IO.__Error.FileNotOpen(),this.InternalReadChars(e,t,n)},Read$1:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor3("buffer","ArgumentNull_Buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("index","ArgumentOutOfRange_NeedNonNegNum");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","ArgumentOutOfRange_NeedNonNegNum");if((e.length-t|0)<n)throw new System.ArgumentException.$ctor1("Argument_InvalidOffLen");return null==this.m_stream&&System.IO.__Error.FileNotOpen(),this.m_stream.Read(e,t,n)},ReadBoolean:function(){return this.FillBuffer(1),0!==this.m_buffer[System.Array.index(0,this.m_buffer)]},ReadByte:function(){null==this.m_stream&&System.IO.__Error.FileNotOpen();var e=this.m_stream.ReadByte();return-1===e&&System.IO.__Error.EndOfFile(),255&e},ReadSByte:function(){return this.FillBuffer(1),Bridge.Int.sxb(255&this.m_buffer[System.Array.index(0,this.m_buffer)])},ReadChar:function(){var e=this.Read();return-1===e&&System.IO.__Error.EndOfFile(),65535&e},ReadInt16:function(){return this.FillBuffer(2),Bridge.Int.sxs(65535&(this.m_buffer[System.Array.index(0,this.m_buffer)]|this.m_buffer[System.Array.index(1,this.m_buffer)]<<8))},ReadUInt16:function(){return this.FillBuffer(2),65535&(this.m_buffer[System.Array.index(0,this.m_buffer)]|this.m_buffer[System.Array.index(1,this.m_buffer)]<<8)},ReadInt32:function(){return this.m_isMemoryStream?(null==this.m_stream&&System.IO.__Error.FileNotOpen(),Bridge.as(this.m_stream,System.IO.MemoryStream).InternalReadInt32()):(this.FillBuffer(4),this.m_buffer[System.Array.index(0,this.m_buffer)]|this.m_buffer[System.Array.index(1,this.m_buffer)]<<8|this.m_buffer[System.Array.index(2,this.m_buffer)]<<16|this.m_buffer[System.Array.index(3,this.m_buffer)]<<24)},ReadUInt32:function(){return this.FillBuffer(4),(this.m_buffer[System.Array.index(0,this.m_buffer)]|this.m_buffer[System.Array.index(1,this.m_buffer)]<<8|this.m_buffer[System.Array.index(2,this.m_buffer)]<<16|this.m_buffer[System.Array.index(3,this.m_buffer)]<<24)>>>0},ReadInt64:function(){this.FillBuffer(8);var e=(this.m_buffer[System.Array.index(0,this.m_buffer)]|this.m_buffer[System.Array.index(1,this.m_buffer)]<<8|this.m_buffer[System.Array.index(2,this.m_buffer)]<<16|this.m_buffer[System.Array.index(3,this.m_buffer)]<<24)>>>0,t=(this.m_buffer[System.Array.index(4,this.m_buffer)]|this.m_buffer[System.Array.index(5,this.m_buffer)]<<8|this.m_buffer[System.Array.index(6,this.m_buffer)]<<16|this.m_buffer[System.Array.index(7,this.m_buffer)]<<24)>>>0;return System.Int64.clip64(System.UInt64(t)).shl(32).or(System.Int64(e))},ReadUInt64:function(){this.FillBuffer(8);var e=(this.m_buffer[System.Array.index(0,this.m_buffer)]|this.m_buffer[System.Array.index(1,this.m_buffer)]<<8|this.m_buffer[System.Array.index(2,this.m_buffer)]<<16|this.m_buffer[System.Array.index(3,this.m_buffer)]<<24)>>>0,t=(this.m_buffer[System.Array.index(4,this.m_buffer)]|this.m_buffer[System.Array.index(5,this.m_buffer)]<<8|this.m_buffer[System.Array.index(6,this.m_buffer)]<<16|this.m_buffer[System.Array.index(7,this.m_buffer)]<<24)>>>0;return System.UInt64(t).shl(32).or(System.UInt64(e))},ReadSingle:function(){this.FillBuffer(4);var e=(this.m_buffer[System.Array.index(0,this.m_buffer)]|this.m_buffer[System.Array.index(1,this.m_buffer)]<<8|this.m_buffer[System.Array.index(2,this.m_buffer)]<<16|this.m_buffer[System.Array.index(3,this.m_buffer)]<<24)>>>0;return System.BitConverter.toSingle(System.BitConverter.getBytes$8(e),0)},ReadDouble:function(){this.FillBuffer(8);var e=(this.m_buffer[System.Array.index(0,this.m_buffer)]|this.m_buffer[System.Array.index(1,this.m_buffer)]<<8|this.m_buffer[System.Array.index(2,this.m_buffer)]<<16|this.m_buffer[System.Array.index(3,this.m_buffer)]<<24)>>>0,t=(this.m_buffer[System.Array.index(4,this.m_buffer)]|this.m_buffer[System.Array.index(5,this.m_buffer)]<<8|this.m_buffer[System.Array.index(6,this.m_buffer)]<<16|this.m_buffer[System.Array.index(7,this.m_buffer)]<<24)>>>0,e=System.UInt64(t).shl(32).or(System.UInt64(e));return System.BitConverter.toDouble(System.BitConverter.getBytes$9(e),0)},ReadDecimal:function(){this.FillBuffer(23);try{return System.Decimal.fromBytes(this.m_buffer)}catch(e){throw e=System.Exception.create(e),Bridge.is(e,System.ArgumentException)?new System.IO.IOException.$ctor2("Arg_DecBitCtor",e):e}},ReadString:function(){null==this.m_stream&&System.IO.__Error.FileNotOpen();var e,t,n=0,i=this.Read7BitEncodedInt();if(i<0)throw new System.IO.IOException.$ctor1("IO.IO_InvalidStringLen_Len");if(0===i)return"";null==this.m_charBytes&&(this.m_charBytes=System.Array.init(System.IO.BinaryReader.MaxCharBytesSize,0,System.Byte)),null==this.m_charBuffer&&(this.m_charBuffer=System.Array.init(this.m_maxCharsSize,0,System.Char));var r=null;do{if(e=(i-n|0)>System.IO.BinaryReader.MaxCharBytesSize?System.IO.BinaryReader.MaxCharBytesSize:i-n|0,0===(e=this.m_stream.Read(this.m_charBytes,0,e))&&System.IO.__Error.EndOfFile(),t=this.m_encoding.GetChars$2(this.m_charBytes,0,e,this.m_charBuffer,0),0===n&&e===i)return System.String.fromCharArray(this.m_charBuffer,0,t);null==r&&(r=new System.Text.StringBuilder("",i));for(var s=0;s<t;s=s+1|0)r.append(String.fromCharCode(this.m_charBuffer[System.Array.index(s,this.m_charBuffer)]))}while((n=n+e|0)<i);return r.toString()},InternalReadChars:function(e,t,n){var i=n;if(null==this.m_charBytes&&(this.m_charBytes=System.Array.init(System.IO.BinaryReader.MaxCharBytesSize,0,System.Byte)),t<0||i<0||(t+i|0)>e.length)throw new System.ArgumentOutOfRangeException.$ctor1("charsRemaining");for(;0<i;){var r=this.InternalReadOneChar(!0);if(-1===r)break;e[System.Array.index(t,e)]=65535&r,2===this.lastCharsRead&&(e[System.Array.index(t=t+1|0,e)]=this.m_singleChar[System.Array.index(1,this.m_singleChar)],i=i-1|0),i=i-1|0,t=t+1|0}return n-i|0},InternalReadOneChar:function(e){void 0===e&&(e=!1);var t=0,n=0,i=System.Int64(0);this.m_stream.CanSeek&&(i=this.m_stream.Position),null==this.m_charBytes&&(this.m_charBytes=System.Array.init(System.IO.BinaryReader.MaxCharBytesSize,0,System.Byte)),null==this.m_singleChar&&(this.m_singleChar=System.Array.init(2,0,System.Char));for(var r=!1,s=0;0===t;){if(n=this.m_2BytesPerChar?2:1,Bridge.is(this.m_encoding,System.Text.UTF32Encoding)&&(n=4),r){var o=this.m_stream.ReadByte();this.m_charBytes[System.Array.index(s=s+1|0,this.m_charBytes)]=255&o,-1===o&&(n=0),2===n&&(o=this.m_stream.ReadByte(),this.m_charBytes[System.Array.index(s=s+1|0,this.m_charBytes)]=255&o,-1===o&&(n=1))}else{o=this.m_stream.ReadByte();if(this.m_charBytes[System.Array.index(0,this.m_charBytes)]=255&o,s=0,-1===o&&(n=0),2===n)o=this.m_stream.ReadByte(),this.m_charBytes[System.Array.index(1,this.m_charBytes)]=255&o,-1===o&&(n=1),s=1;else if(4===n){if(o=this.m_stream.ReadByte(),this.m_charBytes[System.Array.index(1,this.m_charBytes)]=255&o,-1===o)return-1;if(o=this.m_stream.ReadByte(),this.m_charBytes[System.Array.index(2,this.m_charBytes)]=255&o,-1===o)return-1;if(o=this.m_stream.ReadByte(),this.m_charBytes[System.Array.index(3,this.m_charBytes)]=255&o,-1===o)return-1;s=3}}if(0===n)return-1;r=!1;try{if(t=this.m_encoding.GetChars$2(this.m_charBytes,0,s+1|0,this.m_singleChar,0),!e&&2===t)throw new System.ArgumentException.ctor}catch(e){throw e=System.Exception.create(e),this.m_stream.CanSeek&&this.m_stream.Seek(i.sub(this.m_stream.Position),1),e}this.m_encoding._hasError&&(r=!(t=0))}return 0===(this.lastCharsRead=t)?-1:this.m_singleChar[System.Array.index(0,this.m_singleChar)]},ReadChars:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","ArgumentOutOfRange_NeedNonNegNum");if(null==this.m_stream&&System.IO.__Error.FileNotOpen(),0===e)return System.Array.init(0,0,System.Char);var t=System.Array.init(e,0,System.Char),n=this.InternalReadChars(t,0,e);return n!==e&&(e=System.Array.init(n,0,System.Char),System.Array.copy(t,0,e,0,Bridge.Int.mul(2,n)),t=e),t},ReadBytes:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","ArgumentOutOfRange_NeedNonNegNum");if(null==this.m_stream&&System.IO.__Error.FileNotOpen(),0===e)return System.Array.init(0,0,System.Byte);var t,n=System.Array.init(e,0,System.Byte),i=0;do{var r=this.m_stream.Read(n,i,e)}while(0!==r&&(i=i+r|0,0<(e=e-r|0)));return i!==n.length&&(t=System.Array.init(i,0,System.Byte),System.Array.copy(n,0,t,0,i),n=t),n},FillBuffer:function(e){if(null!=this.m_buffer&&(e<0||e>this.m_buffer.length))throw new System.ArgumentOutOfRangeException.$ctor4("numBytes","ArgumentOutOfRange_BinaryReaderFillBuffer");var t=0,n=0;if(null==this.m_stream&&System.IO.__Error.FileNotOpen(),1===e)return-1===(n=this.m_stream.ReadByte())&&System.IO.__Error.EndOfFile(),void(this.m_buffer[System.Array.index(0,this.m_buffer)]=255&n);for(;0===(n=this.m_stream.Read(this.m_buffer,t,e-t|0))&&System.IO.__Error.EndOfFile(),t=t+n|0,t<e;);},Read7BitEncodedInt:function(){var e,t=0,n=0;do{if(35===n)throw new System.FormatException.$ctor1("Format_Bad7BitInt32")}while(t|=(127&(e=this.ReadByte()))<<n,n=n+7|0,0!=(128&e));return t}}}),Bridge.define("System.IO.BinaryWriter",{inherits:[System.IDisposable],statics:{fields:{LargeByteBufferSize:0,Null:null},ctors:{init:function(){this.LargeByteBufferSize=256,this.Null=new System.IO.BinaryWriter.ctor}}},fields:{OutStream:null,_buffer:null,_encoding:null,_leaveOpen:!1,_tmpOneCharBuffer:null},props:{BaseStream:{get:function(){return this.Flush(),this.OutStream}}},alias:["Dispose","System$IDisposable$Dispose"],ctors:{ctor:function(){this.$initialize(),this.OutStream=System.IO.Stream.Null,this._buffer=System.Array.init(16,0,System.Byte),this._encoding=new System.Text.UTF8Encoding.$ctor2(!1,!0)},$ctor1:function(e){System.IO.BinaryWriter.$ctor3.call(this,e,new System.Text.UTF8Encoding.$ctor2(!1,!0),!1)},$ctor2:function(e,t){System.IO.BinaryWriter.$ctor3.call(this,e,t,!1)},$ctor3:function(e,t,n){if(this.$initialize(),null==e)throw new System.ArgumentNullException.$ctor1("output");if(null==t)throw new System.ArgumentNullException.$ctor1("encoding");if(!e.CanWrite)throw new System.ArgumentException.$ctor1("Argument_StreamNotWritable");this.OutStream=e,this._buffer=System.Array.init(16,0,System.Byte),this._encoding=t,this._leaveOpen=n}},methods:{Close:function(){this.Dispose$1(!0)},Dispose$1:function(e){e&&(this._leaveOpen?this.OutStream.Flush():this.OutStream.Close())},Dispose:function(){this.Dispose$1(!0)},Flush:function(){this.OutStream.Flush()},Seek:function(e,t){return this.OutStream.Seek(System.Int64(e),t)},Write:function(e){this._buffer[System.Array.index(0,this._buffer)]=255&(e?1:0),this.OutStream.Write(this._buffer,0,1)},Write$1:function(e){this.OutStream.WriteByte(e)},Write$12:function(e){this.OutStream.WriteByte(255&e)},Write$2:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");this.OutStream.Write(e,0,e.length)},Write$3:function(e,t,n){this.OutStream.Write(e,t,n)},Write$4:function(e){if(System.Char.isSurrogate(e))throw new System.ArgumentException.$ctor1("Arg_SurrogatesNotAllowedAsSingleChar");var t=this._encoding.GetBytes$3(System.Array.init([e],System.Char),0,1,this._buffer,0);this.OutStream.Write(this._buffer,0,t)},Write$5:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("chars");e=this._encoding.GetBytes$1(e,0,e.length);this.OutStream.Write(e,0,e.length)},Write$6:function(e,t,n){n=this._encoding.GetBytes$1(e,t,n);this.OutStream.Write(n,0,n.length)},Write$8:function(e){e=System.Int64.clipu64(System.BitConverter.doubleToInt64Bits(e));this._buffer[System.Array.index(0,this._buffer)]=System.Int64.clipu8(e),this._buffer[System.Array.index(1,this._buffer)]=System.Int64.clipu8(e.shru(8)),this._buffer[System.Array.index(2,this._buffer)]=System.Int64.clipu8(e.shru(16)),this._buffer[System.Array.index(3,this._buffer)]=System.Int64.clipu8(e.shru(24)),this._buffer[System.Array.index(4,this._buffer)]=System.Int64.clipu8(e.shru(32)),this._buffer[System.Array.index(5,this._buffer)]=System.Int64.clipu8(e.shru(40)),this._buffer[System.Array.index(6,this._buffer)]=System.Int64.clipu8(e.shru(48)),this._buffer[System.Array.index(7,this._buffer)]=System.Int64.clipu8(e.shru(56)),this.OutStream.Write(this._buffer,0,8)},Write$7:function(e){e=e.getBytes();this.OutStream.Write(e,0,23)},Write$9:function(e){this._buffer[System.Array.index(0,this._buffer)]=255&e,this._buffer[System.Array.index(1,this._buffer)]=e>>8&255,this.OutStream.Write(this._buffer,0,2)},Write$15:function(e){this._buffer[System.Array.index(0,this._buffer)]=255&e,this._buffer[System.Array.index(1,this._buffer)]=e>>8&255,this.OutStream.Write(this._buffer,0,2)},Write$10:function(e){this._buffer[System.Array.index(0,this._buffer)]=255&e,this._buffer[System.Array.index(1,this._buffer)]=e>>8&255,this._buffer[System.Array.index(2,this._buffer)]=e>>16&255,this._buffer[System.Array.index(3,this._buffer)]=e>>24&255,this.OutStream.Write(this._buffer,0,4)},Write$16:function(e){this._buffer[System.Array.index(0,this._buffer)]=255&e,this._buffer[System.Array.index(1,this._buffer)]=e>>>8&255,this._buffer[System.Array.index(2,this._buffer)]=e>>>16&255,this._buffer[System.Array.index(3,this._buffer)]=e>>>24&255,this.OutStream.Write(this._buffer,0,4)},Write$11:function(e){this._buffer[System.Array.index(0,this._buffer)]=System.Int64.clipu8(e),this._buffer[System.Array.index(1,this._buffer)]=System.Int64.clipu8(e.shr(8)),this._buffer[System.Array.index(2,this._buffer)]=System.Int64.clipu8(e.shr(16)),this._buffer[System.Array.index(3,this._buffer)]=System.Int64.clipu8(e.shr(24)),this._buffer[System.Array.index(4,this._buffer)]=System.Int64.clipu8(e.shr(32)),this._buffer[System.Array.index(5,this._buffer)]=System.Int64.clipu8(e.shr(40)),this._buffer[System.Array.index(6,this._buffer)]=System.Int64.clipu8(e.shr(48)),this._buffer[System.Array.index(7,this._buffer)]=System.Int64.clipu8(e.shr(56)),this.OutStream.Write(this._buffer,0,8)},Write$17:function(e){this._buffer[System.Array.index(0,this._buffer)]=System.Int64.clipu8(e),this._buffer[System.Array.index(1,this._buffer)]=System.Int64.clipu8(e.shru(8)),this._buffer[System.Array.index(2,this._buffer)]=System.Int64.clipu8(e.shru(16)),this._buffer[System.Array.index(3,this._buffer)]=System.Int64.clipu8(e.shru(24)),this._buffer[System.Array.index(4,this._buffer)]=System.Int64.clipu8(e.shru(32)),this._buffer[System.Array.index(5,this._buffer)]=System.Int64.clipu8(e.shru(40)),this._buffer[System.Array.index(6,this._buffer)]=System.Int64.clipu8(e.shru(48)),this._buffer[System.Array.index(7,this._buffer)]=System.Int64.clipu8(e.shru(56)),this.OutStream.Write(this._buffer,0,8)},Write$13:function(e){e=System.BitConverter.toUInt32(System.BitConverter.getBytes$6(e),0);this._buffer[System.Array.index(0,this._buffer)]=255&e,this._buffer[System.Array.index(1,this._buffer)]=e>>>8&255,this._buffer[System.Array.index(2,this._buffer)]=e>>>16&255,this._buffer[System.Array.index(3,this._buffer)]=e>>>24&255,this.OutStream.Write(this._buffer,0,4)},Write$14:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("value");var t=this._encoding.GetBytes$2(e),e=t.length;this.Write7BitEncodedInt(e),this.OutStream.Write(t,0,e)},Write7BitEncodedInt:function(e){for(var t=e>>>0;128<=t;)this.Write$1((128|t)>>>0&255),t>>>=7;this.Write$1(255&t)}}}),Bridge.define("System.IO.Stream",{inherits:[System.IDisposable],statics:{fields:{_DefaultCopyBufferSize:0,Null:null},ctors:{init:function(){this._DefaultCopyBufferSize=81920,this.Null=new System.IO.Stream.NullStream}},methods:{Synchronized:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("stream");return e},BlockingEndRead:function(e){return System.IO.Stream.SynchronousAsyncResult.EndRead(e)},BlockingEndWrite:function(e){System.IO.Stream.SynchronousAsyncResult.EndWrite(e)}}},props:{CanTimeout:{get:function(){return!1}},ReadTimeout:{get:function(){throw new System.InvalidOperationException.ctor},set:function(e){throw new System.InvalidOperationException.ctor}},WriteTimeout:{get:function(){throw new System.InvalidOperationException.ctor},set:function(e){throw new System.InvalidOperationException.ctor}}},alias:["Dispose","System$IDisposable$Dispose"],methods:{CopyTo:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("destination");if(!this.CanRead&&!this.CanWrite)throw new System.Exception;if(!e.CanRead&&!e.CanWrite)throw new System.Exception("destination");if(!this.CanRead)throw new System.NotSupportedException.ctor;if(!e.CanWrite)throw new System.NotSupportedException.ctor;this.InternalCopyTo(e,System.IO.Stream._DefaultCopyBufferSize)},CopyTo$1:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("destination");if(t<=0)throw new System.ArgumentOutOfRangeException.$ctor1("bufferSize");if(!this.CanRead&&!this.CanWrite)throw new System.Exception;if(!e.CanRead&&!e.CanWrite)throw new System.Exception("destination");if(!this.CanRead)throw new System.NotSupportedException.ctor;if(!e.CanWrite)throw new System.NotSupportedException.ctor;this.InternalCopyTo(e,t)},InternalCopyTo:function(e,t){for(var n,i=System.Array.init(t,0,System.Byte);0!==(n=this.Read(i,0,i.length));)e.Write(i,0,n)},Close:function(){this.Dispose$1(!0)},Dispose:function(){this.Close()},Dispose$1:function(e){},BeginRead:function(e,t,n,i,r){return this.BeginReadInternal(e,t,n,i,r,!1)},BeginReadInternal:function(e,t,n,i,r,s){return this.CanRead||System.IO.__Error.ReadNotSupported(),this.BlockingBeginRead(e,t,n,i,r)},EndRead:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("asyncResult");return System.IO.Stream.BlockingEndRead(e)},BeginWrite:function(e,t,n,i,r){return this.BeginWriteInternal(e,t,n,i,r,!1)},BeginWriteInternal:function(e,t,n,i,r,s){return this.CanWrite||System.IO.__Error.WriteNotSupported(),this.BlockingBeginWrite(e,t,n,i,r)},EndWrite:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("asyncResult");System.IO.Stream.BlockingEndWrite(e)},ReadByte:function(){var e=System.Array.init(1,0,System.Byte);return 0===this.Read(e,0,1)?-1:e[System.Array.index(0,e)]},WriteByte:function(e){var t=System.Array.init(1,0,System.Byte);t[System.Array.index(0,t)]=e,this.Write(t,0,1)},BlockingBeginRead:function(e,t,n,i,r){try{var s=this.Read(e,t,n),o=new System.IO.Stream.SynchronousAsyncResult.$ctor1(s,r)}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.IO.IOException))throw e;o=new System.IO.Stream.SynchronousAsyncResult.ctor(e,r,!1)}return Bridge.staticEquals(i,null)||i(o),o},BlockingBeginWrite:function(e,t,n,i,r){var s;try{this.Write(e,t,n),s=new System.IO.Stream.SynchronousAsyncResult.$ctor2(r)}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.IO.IOException))throw e;s=new System.IO.Stream.SynchronousAsyncResult.ctor(e,r,!0)}return Bridge.staticEquals(i,null)||i(s),s}}}),Bridge.define("System.IO.BufferedStream",{inherits:[System.IO.Stream],statics:{fields:{_DefaultBufferSize:0,MaxShadowBufferSize:0},ctors:{init:function(){this._DefaultBufferSize=4096,this.MaxShadowBufferSize=81920}}},fields:{_stream:null,_buffer:null,_bufferSize:0,_readPos:0,_readLen:0,_writePos:0},props:{UnderlyingStream:{get:function(){return this._stream}},BufferSize:{get:function(){return this._bufferSize}},CanRead:{get:function(){return null!=this._stream&&this._stream.CanRead}},CanWrite:{get:function(){return null!=this._stream&&this._stream.CanWrite}},CanSeek:{get:function(){return null!=this._stream&&this._stream.CanSeek}},Length:{get:function(){return this.EnsureNotClosed(),0<this._writePos&&this.FlushWrite(),this._stream.Length}},Position:{get:function(){return this.EnsureNotClosed(),this.EnsureCanSeek(),this._stream.Position.add(System.Int64((this._readPos-this._readLen|0)+this._writePos|0))},set:function(e){if(e.lt(System.Int64(0)))throw new System.ArgumentOutOfRangeException.$ctor1("value");this.EnsureNotClosed(),this.EnsureCanSeek(),0<this._writePos&&this.FlushWrite(),this._readPos=0,this._readLen=0,this._stream.Seek(e,0)}}},ctors:{ctor:function(){this.$initialize(),System.IO.Stream.ctor.call(this)},$ctor1:function(e){System.IO.BufferedStream.$ctor2.call(this,e,System.IO.BufferedStream._DefaultBufferSize)},$ctor2:function(e,t){if(this.$initialize(),System.IO.Stream.ctor.call(this),null==e)throw new System.ArgumentNullException.$ctor1("stream");if(t<=0)throw new System.ArgumentOutOfRangeException.$ctor1("bufferSize");this._stream=e,this._bufferSize=t,this._stream.CanRead||this._stream.CanWrite||System.IO.__Error.StreamIsClosed()}},methods:{EnsureNotClosed:function(){null==this._stream&&System.IO.__Error.StreamIsClosed()},EnsureCanSeek:function(){this._stream.CanSeek||System.IO.__Error.SeekNotSupported()},EnsureCanRead:function(){this._stream.CanRead||System.IO.__Error.ReadNotSupported()},EnsureCanWrite:function(){this._stream.CanWrite||System.IO.__Error.WriteNotSupported()},EnsureShadowBufferAllocated:function(){var e;this._buffer.length!==this._bufferSize||this._bufferSize>=System.IO.BufferedStream.MaxShadowBufferSize||(e=System.Array.init(Math.min(this._bufferSize+this._bufferSize|0,System.IO.BufferedStream.MaxShadowBufferSize),0,System.Byte),System.Array.copy(this._buffer,0,e,0,this._writePos),this._buffer=e)},EnsureBufferAllocated:function(){null==this._buffer&&(this._buffer=System.Array.init(this._bufferSize,0,System.Byte))},Dispose$1:function(e){try{if(e&&null!=this._stream)try{this.Flush()}finally{this._stream.Close()}}finally{this._stream=null,this._buffer=null,System.IO.Stream.prototype.Dispose$1.call(this,e)}},Flush:function(){if(this.EnsureNotClosed(),0<this._writePos)this.FlushWrite();else{if(this._readPos<this._readLen)return this._stream.CanSeek?(this.FlushRead(),void((this._stream.CanWrite||Bridge.is(this._stream,System.IO.BufferedStream))&&this._stream.Flush())):void 0;(this._stream.CanWrite||Bridge.is(this._stream,System.IO.BufferedStream))&&this._stream.Flush(),this._writePos=this._readPos=this._readLen=0}},FlushRead:function(){0!=(this._readPos-this._readLen|0)&&this._stream.Seek(System.Int64(this._readPos-this._readLen),1),this._readPos=0,this._readLen=0},ClearReadBufferBeforeWrite:function(){if(this._readPos!==this._readLen){if(!this._stream.CanSeek)throw new System.NotSupportedException.ctor;this.FlushRead()}else this._readPos=this._readLen=0},FlushWrite:function(){this._stream.Write(this._buffer,0,this._writePos),this._writePos=0,this._stream.Flush()},ReadFromBuffer:function(e,t,n){var i=this._readLen-this._readPos|0;return 0===i?0:(n<i&&(i=n),System.Array.copy(this._buffer,this._readPos,e,t,i),this._readPos=this._readPos+i|0,i)},ReadFromBuffer$1:function(e,t,n,i){try{return i.v=null,this.ReadFromBuffer(e,t,n)}catch(e){return e=System.Exception.create(e),i.v=e,0}},Read:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("array");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("offset");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((e.length-t|0)<n)throw new System.ArgumentException.ctor;this.EnsureNotClosed(),this.EnsureCanRead();var i=this.ReadFromBuffer(e,t,n);if(i===n)return i;var r=i;return 0<i&&(n=n-i|0,t=t+i|0),(this._readPos=this._readLen=0)<this._writePos&&this.FlushWrite(),n>=this._bufferSize?this._stream.Read(e,t,n)+r|0:(this.EnsureBufferAllocated(),this._readLen=this._stream.Read(this._buffer,0,this._bufferSize),(i=this.ReadFromBuffer(e,t,n))+r|0)},ReadByte:function(){return this.EnsureNotClosed(),this.EnsureCanRead(),this._readPos===this._readLen&&(0<this._writePos&&this.FlushWrite(),this.EnsureBufferAllocated(),this._readLen=this._stream.Read(this._buffer,0,this._bufferSize),this._readPos=0),this._readPos===this._readLen?-1:this._buffer[System.Array.index(Bridge.identity(this._readPos,this._readPos=this._readPos+1|0),this._buffer)]},WriteToBuffer:function(e,t,n){var i=Math.min(this._bufferSize-this._writePos|0,n.v);i<=0||(this.EnsureBufferAllocated(),System.Array.copy(e,t.v,this._buffer,this._writePos,i),this._writePos=this._writePos+i|0,n.v=n.v-i|0,t.v=t.v+i|0)},WriteToBuffer$1:function(e,t,n,i){try{i.v=null,this.WriteToBuffer(e,t,n)}catch(e){e=System.Exception.create(e),i.v=e}},Write:function(e,t,n){if(t={v:t},n={v:n},null==e)throw new System.ArgumentNullException.$ctor1("array");if(t.v<0)throw new System.ArgumentOutOfRangeException.$ctor1("offset");if(n.v<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((e.length-t.v|0)<n.v)throw new System.ArgumentException.ctor;var i;if(this.EnsureNotClosed(),this.EnsureCanWrite(),0===this._writePos&&this.ClearReadBufferBeforeWrite(),i=Bridge.Int.check(this._writePos+n.v,System.Int32),Bridge.Int.check(i+n.v,System.Int32)<Bridge.Int.check(this._bufferSize+this._bufferSize,System.Int32))this.WriteToBuffer(e,t,n),this._writePos<this._bufferSize||(this._stream.Write(this._buffer,0,this._writePos),this._writePos=0,this.WriteToBuffer(e,t,n));else{if(0<this._writePos){if(i<=(this._bufferSize+this._bufferSize|0)&&i<=System.IO.BufferedStream.MaxShadowBufferSize)return this.EnsureShadowBufferAllocated(),System.Array.copy(e,t.v,this._buffer,this._writePos,n.v),this._stream.Write(this._buffer,0,i),void(this._writePos=0);this._stream.Write(this._buffer,0,this._writePos),this._writePos=0}this._stream.Write(e,t.v,n.v)}},WriteByte:function(e){this.EnsureNotClosed(),0===this._writePos&&(this.EnsureCanWrite(),this.ClearReadBufferBeforeWrite(),this.EnsureBufferAllocated()),this._writePos>=(this._bufferSize-1|0)&&this.FlushWrite(),this._buffer[System.Array.index(Bridge.identity(this._writePos,this._writePos=this._writePos+1|0),this._buffer)]=e},Seek:function(e,t){if(this.EnsureNotClosed(),this.EnsureCanSeek(),0<this._writePos)return this.FlushWrite(),this._stream.Seek(e,t);0<(this._readLen-this._readPos|0)&&1===t&&(e=e.sub(System.Int64(this._readLen-this._readPos|0)));var n=this.Position,t=this._stream.Seek(e,t);return this._readPos=System.Int64.clip32(t.sub(n.sub(System.Int64(this._readPos)))),0<=this._readPos&&this._readPos<this._readLen?this._stream.Seek(System.Int64(this._readLen-this._readPos),1):this._readPos=this._readLen=0,t},SetLength:function(e){if(e.lt(System.Int64(0)))throw new System.ArgumentOutOfRangeException.$ctor1("value");this.EnsureNotClosed(),this.EnsureCanSeek(),this.EnsureCanWrite(),this.Flush(),this._stream.SetLength(e)}}}),Bridge.define("System.IO.IOException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"I/O error occurred."),this.HResult=-2146232800},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146232800},$ctor3:function(e,t){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=t},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146232800}}}),Bridge.define("System.IO.EndOfStreamException",{inherits:[System.IO.IOException],ctors:{ctor:function(){this.$initialize(),System.IO.IOException.$ctor1.call(this,"Arg_EndOfStreamException")},$ctor1:function(e){this.$initialize(),System.IO.IOException.$ctor1.call(this,e)},$ctor2:function(e,t){this.$initialize(),System.IO.IOException.$ctor2.call(this,e,t)}}}),Bridge.define("System.IO.File",{statics:{methods:{OpenText:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("path");return new System.IO.StreamReader.$ctor7(e)},OpenRead:function(e){return new System.IO.FileStream.$ctor1(e,3)},ReadAllText:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("path");if(0===e.length)throw new System.ArgumentException.$ctor1("Argument_EmptyPath");return System.IO.File.InternalReadAllText(e,System.Text.Encoding.UTF8,!0)},ReadAllText$1:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("path");if(null==t)throw new System.ArgumentNullException.$ctor1("encoding");if(0===e.length)throw new System.ArgumentException.$ctor1("Argument_EmptyPath");return System.IO.File.InternalReadAllText(e,t,!0)},InternalReadAllText:function(e,t,n){var i=new System.IO.StreamReader.$ctor12(e,t,!0,System.IO.StreamReader.DefaultBufferSize,n);try{return i.ReadToEnd()}finally{Bridge.hasValue(i)&&i.System$IDisposable$Dispose()}},ReadAllBytes:function(e){return System.IO.File.InternalReadAllBytes(e,!0)},InternalReadAllBytes:function(e,t){var n=new System.IO.FileStream.$ctor1(e,3);try{var i=0,r=n.Length;if(r.gt(System.Int64(2147483647)))throw new System.IO.IOException.$ctor1("IO.IO_FileTooLong2GB");for(var s=System.Int64.clip32(r),o=System.Array.init(s,0,System.Byte);0<s;){var a=n.Read(o,i,s);0===a&&System.IO.__Error.EndOfFile(),i=i+a|0,s=s-a|0}}finally{Bridge.hasValue(n)&&n.System$IDisposable$Dispose()}return o},ReadAllLines:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("path");if(0===e.length)throw new System.ArgumentException.$ctor1("Argument_EmptyPath");return System.IO.File.InternalReadAllLines(e,System.Text.Encoding.UTF8)},ReadAllLines$1:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("path");if(null==t)throw new System.ArgumentNullException.$ctor1("encoding");if(0===e.length)throw new System.ArgumentException.$ctor1("Argument_EmptyPath");return System.IO.File.InternalReadAllLines(e,t)},InternalReadAllLines:function(e,t){var n,i=new(System.Collections.Generic.List$1(System.String).ctor),r=new System.IO.StreamReader.$ctor9(e,t);try{for(;null!=(n=r.ReadLine());)i.add(n)}finally{Bridge.hasValue(r)&&r.System$IDisposable$Dispose()}return i.ToArray()},ReadLines:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("path");if(0===e.length)throw new System.ArgumentException.$ctor3("Argument_EmptyPath","path");return System.IO.ReadLinesIterator.CreateIterator(e,System.Text.Encoding.UTF8)},ReadLines$1:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("path");if(null==t)throw new System.ArgumentNullException.$ctor1("encoding");if(0===e.length)throw new System.ArgumentException.$ctor3("Argument_EmptyPath","path");return System.IO.ReadLinesIterator.CreateIterator(e,t)}}}}),Bridge.define("System.IO.FileMode",{$kind:"enum",statics:{fields:{CreateNew:1,Create:2,Open:3,OpenOrCreate:4,Truncate:5,Append:6}}}),Bridge.define("System.IO.FileOptions",{$kind:"enum",statics:{fields:{None:0,WriteThrough:-2147483648,Asynchronous:1073741824,RandomAccess:268435456,DeleteOnClose:67108864,SequentialScan:134217728,Encrypted:16384}},$flags:!0}),Bridge.define("System.IO.FileShare",{$kind:"enum",statics:{fields:{None:0,Read:1,Write:2,ReadWrite:3,Delete:4,Inheritable:16}},$flags:!0}),Bridge.define("System.IO.FileStream",{inherits:[System.IO.Stream],statics:{methods:{FromFile:function(e){var t=new System.Threading.Tasks.TaskCompletionSource,n=new FileReader;return n.onload=function(){t.setResult(new System.IO.FileStream.ctor(n.result,e.name))},n.onerror=function(e){t.setException(new System.SystemException.$ctor1(Bridge.unbox(e).target.error.As()))},n.readAsArrayBuffer(e),t.task},ReadBytes:function(e){if(Bridge.isNode){var t=require("fs");return Bridge.cast(t.readFileSync(e),ArrayBuffer)}t=new XMLHttpRequest;if(t.open("GET",e,!1),t.overrideMimeType("text/plain; charset=x-user-defined"),t.send(null),200!==t.status)throw new System.IO.IOException.$ctor1(System.String.concat("Status of request to "+(e||"")+" returned status: ",t.status));var t=t.responseText,i=new Uint8Array(t.length);return System.String.toCharArray(t,0,t.length).forEach(function(e,t,n){e&=255;return i[t]=e}),i.buffer},ReadBytesAsync:function(t){var n,r=new System.Threading.Tasks.TaskCompletionSource;return Bridge.isNode?require("fs").readFile(t,Bridge.fn.$build([function(e,t){if(null!=e)throw new System.IO.IOException.ctor;r.setResult(t)}])):((n=new XMLHttpRequest).open("GET",t,!0),n.overrideMimeType("text/plain; charset=binary-data"),n.send(null),n.onreadystatechange=function(){if(4===n.readyState){if(200!==n.status)throw new System.IO.IOException.$ctor1(System.String.concat("Status of request to "+(t||"")+" returned status: ",n.status));var e=n.responseText,i=new Uint8Array(e.length);System.String.toCharArray(e,0,e.length).forEach(function(e,t,n){e&=255;return i[t]=e}),r.setResult(i.buffer)}}),r.task}}},fields:{name:null,_buffer:null},props:{CanRead:{get:function(){return!0}},CanWrite:{get:function(){return!1}},CanSeek:{get:function(){return!1}},IsAsync:{get:function(){return!1}},Name:{get:function(){return this.name}},Length:{get:function(){return System.Int64(this.GetInternalBuffer().byteLength)}},Position:System.Int64(0)},ctors:{$ctor1:function(e,t){this.$initialize(),System.IO.Stream.ctor.call(this),this.name=e},ctor:function(e,t){this.$initialize(),System.IO.Stream.ctor.call(this),this._buffer=e,this.name=t}},methods:{Flush:function(){},Seek:function(e,t){throw new System.NotImplementedException.ctor},SetLength:function(e){throw new System.NotImplementedException.ctor},Write:function(e,t,n){throw new System.NotImplementedException.ctor},GetInternalBuffer:function(){return null==this._buffer&&(this._buffer=System.IO.FileStream.ReadBytes(this.name)),this._buffer},EnsureBufferAsync:function(){var e,t,n,i=0,r=new System.Threading.Tasks.TaskCompletionSource,s=Bridge.fn.bind(this,function(){try{for(;;)switch(i=System.Array.min([0,1,2,3],i)){case 0:if(null==this._buffer){i=1;continue}i=3;continue;case 1:if(e=System.IO.FileStream.ReadBytesAsync(this.name),i=2,e.isCompleted())continue;return void e.continue(s);case 2:t=e.getAwaitedResult(),this._buffer=t,i=3;continue;case 3:default:return void r.setResult(null)}}catch(e){n=System.Exception.create(e),r.setException(n)}},arguments);return s(),r.task},Read:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("offset");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((e.length-t|0)<n)throw new System.ArgumentException.ctor;var i=this.Length.sub(this.Position);if(i.gt(System.Int64(n))&&(i=System.Int64(n)),i.lte(System.Int64(0)))return 0;var r=new Uint8Array(this.GetInternalBuffer());if(i.gt(System.Int64(8)))for(var s=0;System.Int64(s).lt(i);s=s+1|0)e[System.Array.index(s+t|0,e)]=r[this.Position.add(System.Int64(s))];else for(var o=i;;){var a=o.sub(System.Int64(1)),o=a;if(a.lt(System.Int64(0)))break;e[System.Array.index(System.Int64.toNumber(System.Int64(t).add(o)),e)]=r[this.Position.add(o)]}return this.Position=this.Position.add(i),System.Int64.clip32(i)}}}),Bridge.define("System.IO.Iterator$1",function(t){return{inherits:[System.Collections.Generic.IEnumerable$1(t),System.Collections.Generic.IEnumerator$1(t)],fields:{state:0,current:Bridge.getDefaultValue(t)},props:{Current:{get:function(){return this.current}},System$Collections$IEnumerator$Current:{get:function(){return this.Current}}},alias:["Current",["System$Collections$Generic$IEnumerator$1$"+Bridge.getTypeAlias(t)+"$Current$1","System$Collections$Generic$IEnumerator$1$Current$1"],"Dispose","System$IDisposable$Dispose","GetEnumerator",["System$Collections$Generic$IEnumerable$1$"+Bridge.getTypeAlias(t)+"$GetEnumerator","System$Collections$Generic$IEnumerable$1$GetEnumerator"]],ctors:{ctor:function(){this.$initialize()}},methods:{Dispose:function(){this.Dispose$1(!0)},Dispose$1:function(e){this.current=Bridge.getDefaultValue(t),this.state=-1},GetEnumerator:function(){if(0===this.state)return this.state=1,this;var e=this.Clone();return e.state=1,e},System$Collections$IEnumerable$GetEnumerator:function(){return this.GetEnumerator()},System$Collections$IEnumerator$reset:function(){throw new System.NotSupportedException.ctor}}}}),Bridge.define("System.IO.MemoryStream",{inherits:[System.IO.Stream],statics:{fields:{MemStreamMaxLength:0},ctors:{init:function(){this.MemStreamMaxLength=2147483647}}},fields:{_buffer:null,_origin:0,_position:0,_length:0,_capacity:0,_expandable:!1,_writable:!1,_exposable:!1,_isOpen:!1},props:{CanRead:{get:function(){return this._isOpen}},CanSeek:{get:function(){return this._isOpen}},CanWrite:{get:function(){return this._writable}},Capacity:{get:function(){return this._isOpen||System.IO.__Error.StreamIsClosed(),this._capacity-this._origin|0},set:function(e){if(System.Int64(e).lt(this.Length))throw new System.ArgumentOutOfRangeException.$ctor4("value","ArgumentOutOfRange_SmallCapacity");var t;this._isOpen||System.IO.__Error.StreamIsClosed(),this._expandable||e===this.Capacity||System.IO.__Error.MemoryStreamNotExpandable(),this._expandable&&e!==this._capacity&&(0<e?(t=System.Array.init(e,0,System.Byte),0<this._length&&System.Array.copy(this._buffer,0,t,0,this._length),this._buffer=t):this._buffer=null,this._capacity=e)}},Length:{get:function(){return this._isOpen||System.IO.__Error.StreamIsClosed(),System.Int64(this._length-this._origin)}},Position:{get:function(){return this._isOpen||System.IO.__Error.StreamIsClosed(),System.Int64(this._position-this._origin)},set:function(e){if(e.lt(System.Int64(0)))throw new System.ArgumentOutOfRangeException.$ctor4("value","ArgumentOutOfRange_NeedNonNegNum");if(this._isOpen||System.IO.__Error.StreamIsClosed(),e.gt(System.Int64(System.IO.MemoryStream.MemStreamMaxLength)))throw new System.ArgumentOutOfRangeException.$ctor4("value","ArgumentOutOfRange_StreamLength");this._position=this._origin+System.Int64.clip32(e)|0}}},ctors:{ctor:function(){System.IO.MemoryStream.$ctor6.call(this,0)},$ctor6:function(e){if(this.$initialize(),System.IO.Stream.ctor.call(this),e<0)throw new System.ArgumentOutOfRangeException.$ctor4("capacity","ArgumentOutOfRange_NegativeCapacity");this._buffer=System.Array.init(e,0,System.Byte),this._capacity=e,this._expandable=!0,this._writable=!0,this._exposable=!0,this._origin=0,this._isOpen=!0},$ctor1:function(e){System.IO.MemoryStream.$ctor2.call(this,e,!0)},$ctor2:function(e,t){if(this.$initialize(),System.IO.Stream.ctor.call(this),null==e)throw new System.ArgumentNullException.$ctor3("buffer","ArgumentNull_Buffer");this._buffer=e,this._length=this._capacity=e.length,this._writable=t,this._exposable=!1,this._origin=0,this._isOpen=!0},$ctor3:function(e,t,n){System.IO.MemoryStream.$ctor5.call(this,e,t,n,!0,!1)},$ctor4:function(e,t,n,i){System.IO.MemoryStream.$ctor5.call(this,e,t,n,i,!1)},$ctor5:function(e,t,n,i,r){if(this.$initialize(),System.IO.Stream.ctor.call(this),null==e)throw new System.ArgumentNullException.$ctor3("buffer","ArgumentNull_Buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("index","ArgumentOutOfRange_NeedNonNegNum");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","ArgumentOutOfRange_NeedNonNegNum");if((e.length-t|0)<n)throw new System.ArgumentException.$ctor1("Argument_InvalidOffLen");this._buffer=e,this._origin=this._position=t,this._length=this._capacity=t+n|0,this._writable=i,this._exposable=r,this._expandable=!1,this._isOpen=!0}},methods:{EnsureWriteable:function(){this.CanWrite||System.IO.__Error.WriteNotSupported()},Dispose$1:function(e){try{e&&(this._isOpen=!1,this._writable=!1,this._expandable=!1)}finally{System.IO.Stream.prototype.Dispose$1.call(this,e)}},EnsureCapacity:function(e){if(e<0)throw new System.IO.IOException.$ctor1("IO.IO_StreamTooLong");if(e>this._capacity){var t=e;return t<256&&(t=256),t<Bridge.Int.mul(this._capacity,2)&&(t=Bridge.Int.mul(this._capacity,2)),2147483591<Bridge.Int.mul(this._capacity,2)>>>0&&(t=2147483591<e?e:2147483591),this.Capacity=t,!0}return!1},Flush:function(){},GetBuffer:function(){if(!this._exposable)throw new System.Exception("UnauthorizedAccess_MemStreamBuffer");return this._buffer},TryGetBuffer:function(e){return this._exposable?(e.v=new System.ArraySegment(this._buffer,this._origin,this._length-this._origin|0),!0):(e.v=Bridge.getDefaultValue(System.ArraySegment),!1)},InternalGetBuffer:function(){return this._buffer},InternalGetPosition:function(){return this._isOpen||System.IO.__Error.StreamIsClosed(),this._position},InternalReadInt32:function(){this._isOpen||System.IO.__Error.StreamIsClosed();var e=this._position=this._position+4|0;return e>this._length&&(this._position=this._length,System.IO.__Error.EndOfFile()),this._buffer[System.Array.index(e-4|0,this._buffer)]|this._buffer[System.Array.index(e-3|0,this._buffer)]<<8|this._buffer[System.Array.index(e-2|0,this._buffer)]<<16|this._buffer[System.Array.index(e-1|0,this._buffer)]<<24},InternalEmulateRead:function(e){this._isOpen||System.IO.__Error.StreamIsClosed();var t=this._length-this._position|0;return e<t&&(t=e),t<0&&(t=0),this._position=this._position+t|0,t},Read:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor3("buffer","ArgumentNull_Buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("offset","ArgumentOutOfRange_NeedNonNegNum");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","ArgumentOutOfRange_NeedNonNegNum");if((e.length-t|0)<n)throw new System.ArgumentException.$ctor1("Argument_InvalidOffLen");this._isOpen||System.IO.__Error.StreamIsClosed();var i=this._length-this._position|0;if(n<i&&(i=n),i<=0)return 0;if(i<=8)for(var r=i;0<=(r=r-1|0);)e[System.Array.index(t+r|0,e)]=this._buffer[System.Array.index(this._position+r|0,this._buffer)];else System.Array.copy(this._buffer,this._position,e,t,i);return this._position=this._position+i|0,i},ReadByte:function(){return this._isOpen||System.IO.__Error.StreamIsClosed(),this._position>=this._length?-1:this._buffer[System.Array.index(Bridge.identity(this._position,this._position=this._position+1|0),this._buffer)]},Seek:function(e,t){if(this._isOpen||System.IO.__Error.StreamIsClosed(),e.gt(System.Int64(System.IO.MemoryStream.MemStreamMaxLength)))throw new System.ArgumentOutOfRangeException.$ctor4("offset","ArgumentOutOfRange_StreamLength");switch(t){case 0:var n=this._origin+System.Int64.clip32(e)|0;if(e.lt(System.Int64(0))||n<this._origin)throw new System.IO.IOException.$ctor1("IO.IO_SeekBeforeBegin");this._position=n;break;case 1:var i=this._position+System.Int64.clip32(e)|0;if(System.Int64(this._position).add(e).lt(System.Int64(this._origin))||i<this._origin)throw new System.IO.IOException.$ctor1("IO.IO_SeekBeforeBegin");this._position=i;break;case 2:i=this._length+System.Int64.clip32(e)|0;if(System.Int64(this._length).add(e).lt(System.Int64(this._origin))||i<this._origin)throw new System.IO.IOException.$ctor1("IO.IO_SeekBeforeBegin");this._position=i;break;default:throw new System.ArgumentException.$ctor1("Argument_InvalidSeekOrigin")}return System.Int64(this._position)},SetLength:function(e){if(e.lt(System.Int64(0))||e.gt(System.Int64(2147483647)))throw new System.ArgumentOutOfRangeException.$ctor4("value","ArgumentOutOfRange_StreamLength");if(this.EnsureWriteable(),e.gt(System.Int64(2147483647-this._origin|0)))throw new System.ArgumentOutOfRangeException.$ctor4("value","ArgumentOutOfRange_StreamLength");e=this._origin+System.Int64.clip32(e)|0;!this.EnsureCapacity(e)&&e>this._length&&System.Array.fill(this._buffer,0,this._length,e-this._length|0),this._length=e,this._position>e&&(this._position=e)},ToArray:function(){var e=System.Array.init(this._length-this._origin|0,0,System.Byte);return System.Array.copy(this._buffer,this._origin,e,0,this._length-this._origin|0),e},Write:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor3("buffer","ArgumentNull_Buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("offset","ArgumentOutOfRange_NeedNonNegNum");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","ArgumentOutOfRange_NeedNonNegNum");if((e.length-t|0)<n)throw new System.ArgumentException.$ctor1("Argument_InvalidOffLen");this._isOpen||System.IO.__Error.StreamIsClosed(),this.EnsureWriteable();var i,r=this._position+n|0;if(r<0)throw new System.IO.IOException.$ctor1("IO.IO_StreamTooLong");if(r>this._length&&(i=this._position>this._length,r>this._capacity&&this.EnsureCapacity(r)&&(i=!1),i&&System.Array.fill(this._buffer,0,this._length,r-this._length|0),this._length=r),n<=8&&!Bridge.referenceEquals(e,this._buffer))for(var s=n;0<=(s=s-1|0);)this._buffer[System.Array.index(this._position+s|0,this._buffer)]=e[System.Array.index(t+s|0,e)];else System.Array.copy(e,t,this._buffer,this._position,n);this._position=r},WriteByte:function(e){var t,n;this._isOpen||System.IO.__Error.StreamIsClosed(),this.EnsureWriteable(),this._position>=this._length&&(t=this._position+1|0,n=this._position>this._length,t>=this._capacity&&this.EnsureCapacity(t)&&(n=!1),n&&System.Array.fill(this._buffer,0,this._length,this._position-this._length|0),this._length=t),this._buffer[System.Array.index(Bridge.identity(this._position,this._position=this._position+1|0),this._buffer)]=e},WriteTo:function(e){if(null==e)throw new System.ArgumentNullException.$ctor3("stream","ArgumentNull_Stream");this._isOpen||System.IO.__Error.StreamIsClosed(),e.Write(this._buffer,this._origin,this._length-this._origin|0)}}}),Bridge.define("System.IO.ReadLinesIterator",{inherits:[System.IO.Iterator$1(System.String)],statics:{methods:{CreateIterator:function(e,t){return System.IO.ReadLinesIterator.CreateIterator$1(e,t,null)},CreateIterator$1:function(e,t,n){return new System.IO.ReadLinesIterator(e,t,n||new System.IO.StreamReader.$ctor9(e,t))}}},fields:{_path:null,_encoding:null,_reader:null},alias:["moveNext","System$Collections$IEnumerator$moveNext"],ctors:{ctor:function(e,t,n){this.$initialize(),System.IO.Iterator$1(System.String).ctor.call(this),this._path=e,this._encoding=t,this._reader=n}},methods:{moveNext:function(){if(null!=this._reader){if(this.current=this._reader.ReadLine(),null!=this.current)return!0;this.Dispose()}return!1},Clone:function(){return System.IO.ReadLinesIterator.CreateIterator$1(this._path,this._encoding,this._reader)},Dispose$1:function(e){try{e&&null!=this._reader&&this._reader.Dispose()}finally{this._reader=null,System.IO.Iterator$1(System.String).prototype.Dispose$1.call(this,e)}}}}),Bridge.define("System.IO.SeekOrigin",{$kind:"enum",statics:{fields:{Begin:0,Current:1,End:2}}}),Bridge.define("System.IO.Stream.NullStream",{inherits:[System.IO.Stream],$kind:"nested class",props:{CanRead:{get:function(){return!0}},CanWrite:{get:function(){return!0}},CanSeek:{get:function(){return!0}},Length:{get:function(){return System.Int64(0)}},Position:{get:function(){return System.Int64(0)},set:function(e){}}},ctors:{ctor:function(){this.$initialize(),System.IO.Stream.ctor.call(this)}},methods:{Dispose$1:function(e){},Flush:function(){},BeginRead:function(e,t,n,i,r){return this.CanRead||System.IO.__Error.ReadNotSupported(),this.BlockingBeginRead(e,t,n,i,r)},EndRead:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("asyncResult");return System.IO.Stream.BlockingEndRead(e)},BeginWrite:function(e,t,n,i,r){return this.CanWrite||System.IO.__Error.WriteNotSupported(),this.BlockingBeginWrite(e,t,n,i,r)},EndWrite:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("asyncResult");System.IO.Stream.BlockingEndWrite(e)},Read:function(e,t,n){return 0},ReadByte:function(){return-1},Write:function(e,t,n){},WriteByte:function(e){},Seek:function(e,t){return System.Int64(0)},SetLength:function(e){}}}),Bridge.define("System.IO.Stream.SynchronousAsyncResult",{inherits:[System.IAsyncResult],$kind:"nested class",statics:{methods:{EndRead:function(e){e=Bridge.as(e,System.IO.Stream.SynchronousAsyncResult);return null!=e&&!e._isWrite||System.IO.__Error.WrongAsyncResult(),e._endXxxCalled&&System.IO.__Error.EndReadCalledTwice(),e._endXxxCalled=!0,e.ThrowIfError(),e._bytesRead},EndWrite:function(e){e=Bridge.as(e,System.IO.Stream.SynchronousAsyncResult);null!=e&&e._isWrite||System.IO.__Error.WrongAsyncResult(),e._endXxxCalled&&System.IO.__Error.EndWriteCalledTwice(),e._endXxxCalled=!0,e.ThrowIfError()}}},fields:{_stateObject:null,_isWrite:!1,_exceptionInfo:null,_endXxxCalled:!1,_bytesRead:0},props:{IsCompleted:{get:function(){return!0}},AsyncState:{get:function(){return this._stateObject}},CompletedSynchronously:{get:function(){return!0}}},alias:["IsCompleted","System$IAsyncResult$IsCompleted","AsyncState","System$IAsyncResult$AsyncState","CompletedSynchronously","System$IAsyncResult$CompletedSynchronously"],ctors:{$ctor1:function(e,t){this.$initialize(),this._bytesRead=e,this._stateObject=t},$ctor2:function(e){this.$initialize(),this._stateObject=e,this._isWrite=!0},ctor:function(e,t,n){this.$initialize(),this._exceptionInfo=e,this._stateObject=t,this._isWrite=n}},methods:{ThrowIfError:function(){if(null!=this._exceptionInfo)throw this._exceptionInfo}}}),Bridge.define("System.IO.TextReader",{inherits:[System.IDisposable],statics:{fields:{Null:null},ctors:{init:function(){this.Null=new System.IO.TextReader.NullTextReader}},methods:{Synchronized:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("reader");return e}}},alias:["Dispose","System$IDisposable$Dispose"],ctors:{ctor:function(){this.$initialize()}},methods:{Close:function(){this.Dispose$1(!0)},Dispose:function(){this.Dispose$1(!0)},Dispose$1:function(e){},Peek:function(){return-1},Read:function(){return-1},Read$1:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((e.length-t|0)<n)throw new System.ArgumentException.ctor;var i=0;do{var r=this.Read()}while(-1!==r&&(e[System.Array.index(t+Bridge.identity(i,i=i+1|0)|0,e)]=65535&r,i<n));return i},ReadToEndAsync:function(){return System.Threading.Tasks.Task.fromResult(this.ReadToEnd(),System.String)},ReadToEnd:function(){for(var e,t=System.Array.init(4096,0,System.Char),n=new System.Text.StringBuilder("",4096);0!==(e=this.Read$1(t,0,t.length));)n.append(System.String.fromCharArray(t,0,e));return n.toString()},ReadBlock:function(e,t,n){for(var i,r=0;r=r+(i=this.Read$1(e,t+r|0,n-r|0))|0,0<i&&r<n;);return r},ReadLine:function(){for(var e=new System.Text.StringBuilder;;){var t=this.Read();if(-1===t)break;if(13===t||10===t)return 13===t&&10===this.Peek()&&this.Read(),e.toString();e.append(String.fromCharCode(65535&t))}return 0<e.getLength()?e.toString():null}}}),Bridge.define("System.IO.StreamReader",{inherits:[System.IO.TextReader],statics:{fields:{DefaultFileStreamBufferSize:0,MinBufferSize:0,Null:null},props:{DefaultBufferSize:{get:function(){return 1024}}},ctors:{init:function(){this.DefaultFileStreamBufferSize=4096,this.MinBufferSize=128,this.Null=new System.IO.StreamReader.NullStreamReader}}},fields:{stream:null,encoding:null,byteBuffer:null,charBuffer:null,charPos:0,charLen:0,byteLen:0,bytePos:0,_maxCharsPerBuffer:0,_detectEncoding:!1,_isBlocked:!1,_closable:!1},props:{CurrentEncoding:{get:function(){return this.encoding}},BaseStream:{get:function(){return this.stream}},LeaveOpen:{get:function(){return!this._closable}},EndOfStream:{get:function(){return null==this.stream&&System.IO.__Error.ReaderClosed(),!(this.charPos<this.charLen)&&0===this.ReadBuffer()}}},ctors:{ctor:function(){this.$initialize(),System.IO.TextReader.ctor.call(this)},$ctor1:function(e){System.IO.StreamReader.$ctor2.call(this,e,!0)},$ctor2:function(e,t){System.IO.StreamReader.$ctor6.call(this,e,System.Text.Encoding.UTF8,t,System.IO.StreamReader.DefaultBufferSize,!1)},$ctor3:function(e,t){System.IO.StreamReader.$ctor6.call(this,e,t,!0,System.IO.StreamReader.DefaultBufferSize,!1)},$ctor4:function(e,t,n){System.IO.StreamReader.$ctor6.call(this,e,t,n,System.IO.StreamReader.DefaultBufferSize,!1)},$ctor5:function(e,t,n,i){System.IO.StreamReader.$ctor6.call(this,e,t,n,i,!1)},$ctor6:function(e,t,n,i,r){if(this.$initialize(),System.IO.TextReader.ctor.call(this),null==e||null==t)throw new System.ArgumentNullException.$ctor1(null==e?"stream":"encoding");if(!e.CanRead)throw new System.ArgumentException.ctor;if(i<=0)throw new System.ArgumentOutOfRangeException.$ctor1("bufferSize");this.Init$1(e,t,n,i,r)},$ctor7:function(e){System.IO.StreamReader.$ctor8.call(this,e,!0)},$ctor8:function(e,t){System.IO.StreamReader.$ctor11.call(this,e,System.Text.Encoding.UTF8,t,System.IO.StreamReader.DefaultBufferSize)},$ctor9:function(e,t){System.IO.StreamReader.$ctor11.call(this,e,t,!0,System.IO.StreamReader.DefaultBufferSize)},$ctor10:function(e,t,n){System.IO.StreamReader.$ctor11.call(this,e,t,n,System.IO.StreamReader.DefaultBufferSize)},$ctor11:function(e,t,n,i){System.IO.StreamReader.$ctor12.call(this,e,t,n,i,!0)},$ctor12:function(e,t,n,i,r){if(this.$initialize(),System.IO.TextReader.ctor.call(this),null==e||null==t)throw new System.ArgumentNullException.$ctor1(null==e?"path":"encoding");if(0===e.length)throw new System.ArgumentException.ctor;if(i<=0)throw new System.ArgumentOutOfRangeException.$ctor1("bufferSize");e=new System.IO.FileStream.$ctor1(e,3);this.Init$1(e,t,n,i,!1)}},methods:{Init$1:function(e,t,n,i,r){this.stream=e,this.encoding=t,i<System.IO.StreamReader.MinBufferSize&&(i=System.IO.StreamReader.MinBufferSize),this.byteBuffer=System.Array.init(i,0,System.Byte),this._maxCharsPerBuffer=t.GetMaxCharCount(i),this.charBuffer=System.Array.init(this._maxCharsPerBuffer,0,System.Char),this.byteLen=0,this.bytePos=0,this._detectEncoding=n,this._isBlocked=!1,this._closable=!r},Init:function(e){this.stream=e,this._closable=!0},Close:function(){this.Dispose$1(!0)},Dispose$1:function(e){try{!this.LeaveOpen&&e&&null!=this.stream&&this.stream.Close()}finally{this.LeaveOpen||null==this.stream||(this.stream=null,this.encoding=null,this.byteBuffer=null,this.charBuffer=null,this.charPos=0,this.charLen=0,System.IO.TextReader.prototype.Dispose$1.call(this,e))}},DiscardBufferedData:function(){this.byteLen=0,this.charLen=0,this.charPos=0,this._isBlocked=!1},Peek:function(){return null==this.stream&&System.IO.__Error.ReaderClosed(),this.charPos!==this.charLen||!this._isBlocked&&0!==this.ReadBuffer()?this.charBuffer[System.Array.index(this.charPos,this.charBuffer)]:-1},Read:function(){if(null==this.stream&&System.IO.__Error.ReaderClosed(),this.charPos===this.charLen&&0===this.ReadBuffer())return-1;var e=this.charBuffer[System.Array.index(this.charPos,this.charBuffer)];return this.charPos=this.charPos+1|0,e},Read$1:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");if(t<0||n<0)throw new System.ArgumentOutOfRangeException.$ctor1(t<0?"index":"count");if((e.length-t|0)<n)throw new System.ArgumentException.ctor;null==this.stream&&System.IO.__Error.ReaderClosed();for(var i=0,r={v:!1};0<n;){var s=this.charLen-this.charPos|0;if(0===s&&(s=this.ReadBuffer$1(e,t+i|0,n,r)),0===s)break;if(n<s&&(s=n),r.v||(System.Array.copy(this.charBuffer,this.charPos,e,t+i|0,s),this.charPos=this.charPos+s|0),i=i+s|0,n=n-s|0,this._isBlocked)break}return i},ReadToEndAsync:function(){var e,t,n,i,r=0,s=new System.Threading.Tasks.TaskCompletionSource,o=Bridge.fn.bind(this,function(){try{for(;;)switch(r=System.Array.min([0,1,2,3,4],r)){case 0:if(Bridge.is(this.stream,System.IO.FileStream)){r=1;continue}r=3;continue;case 1:if(e=this.stream.EnsureBufferAsync(),r=2,e.isCompleted())continue;return void e.continue(o);case 2:e.getAwaitedResult(),r=3;continue;case 3:if(t=System.IO.TextReader.prototype.ReadToEndAsync.call(this),r=4,t.isCompleted())continue;return void t.continue(o);case 4:return n=t.getAwaitedResult(),void s.setResult(n);default:return void s.setResult(null)}}catch(e){i=System.Exception.create(e),s.setException(i)}},arguments);return o(),s.task},ReadToEnd:function(){null==this.stream&&System.IO.__Error.ReaderClosed();for(var e=new System.Text.StringBuilder("",this.charLen-this.charPos|0);e.append(System.String.fromCharArray(this.charBuffer,this.charPos,this.charLen-this.charPos|0)),this.charPos=this.charLen,this.ReadBuffer(),0<this.charLen;);return e.toString()},ReadBlock:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");if(t<0||n<0)throw new System.ArgumentOutOfRangeException.$ctor1(t<0?"index":"count");if((e.length-t|0)<n)throw new System.ArgumentException.ctor;return null==this.stream&&System.IO.__Error.ReaderClosed(),System.IO.TextReader.prototype.ReadBlock.call(this,e,t,n)},CompressBuffer:function(e){System.Array.copy(this.byteBuffer,e,this.byteBuffer,0,this.byteLen-e|0),this.byteLen=this.byteLen-e|0},DetectEncoding:function(){var e;this.byteLen<2||(e=this._detectEncoding=!1,254===this.byteBuffer[System.Array.index(0,this.byteBuffer)]&&255===this.byteBuffer[System.Array.index(1,this.byteBuffer)]?(this.encoding=new System.Text.UnicodeEncoding.$ctor1(!0,!0),this.CompressBuffer(2),e=!0):255===this.byteBuffer[System.Array.index(0,this.byteBuffer)]&&254===this.byteBuffer[System.Array.index(1,this.byteBuffer)]?e=(this.byteLen<4||0!==this.byteBuffer[System.Array.index(2,this.byteBuffer)]||0!==this.byteBuffer[System.Array.index(3,this.byteBuffer)]?(this.encoding=new System.Text.UnicodeEncoding.$ctor1(!1,!0),this.CompressBuffer(2)):(this.encoding=new System.Text.UTF32Encoding.$ctor1(!1,!0),this.CompressBuffer(4)),!0):3<=this.byteLen&&239===this.byteBuffer[System.Array.index(0,this.byteBuffer)]&&187===this.byteBuffer[System.Array.index(1,this.byteBuffer)]&&191===this.byteBuffer[System.Array.index(2,this.byteBuffer)]?(this.encoding=System.Text.Encoding.UTF8,this.CompressBuffer(3),e=!0):4<=this.byteLen&&0===this.byteBuffer[System.Array.index(0,this.byteBuffer)]&&0===this.byteBuffer[System.Array.index(1,this.byteBuffer)]&&254===this.byteBuffer[System.Array.index(2,this.byteBuffer)]&&255===this.byteBuffer[System.Array.index(3,this.byteBuffer)]?(this.encoding=new System.Text.UTF32Encoding.$ctor1(!0,!0),this.CompressBuffer(4),e=!0):2===this.byteLen&&(this._detectEncoding=!0),e&&(this._maxCharsPerBuffer=this.encoding.GetMaxCharCount(this.byteBuffer.length),this.charBuffer=System.Array.init(this._maxCharsPerBuffer,0,System.Char)))},IsPreamble:function(){return!1},ReadBuffer:function(){this.charLen=0,this.charPos=0,this.byteLen=0;do{if(this.byteLen=this.stream.Read(this.byteBuffer,0,this.byteBuffer.length),0===this.byteLen)return this.charLen}while(this._isBlocked=this.byteLen<this.byteBuffer.length,this.IsPreamble()||(this._detectEncoding&&2<=this.byteLen&&this.DetectEncoding(),this.charLen=this.charLen+this.encoding.GetChars$2(this.byteBuffer,0,this.byteLen,this.charBuffer,this.charLen)|0),0===this.charLen);return this.charLen},ReadBuffer$1:function(e,t,n,i){this.charLen=0,this.charPos=0;var r=this.byteLen=0;for(i.v=n>=this._maxCharsPerBuffer;this.byteLen=this.stream.Read(this.byteBuffer,0,this.byteBuffer.length),0!==this.byteLen&&(this._isBlocked=this.byteLen<this.byteBuffer.length,this.IsPreamble()||(this._detectEncoding&&2<=this.byteLen&&(this.DetectEncoding(),i.v=n>=this._maxCharsPerBuffer),this.charPos=0,i.v?(r=r+this.encoding.GetChars$2(this.byteBuffer,0,this.byteLen,e,t+r|0)|0,this.charLen=0):(r=this.encoding.GetChars$2(this.byteBuffer,0,this.byteLen,this.charBuffer,r),this.charLen=this.charLen+r|0)),0===r););return this._isBlocked=!!(this._isBlocked&r<n),r},ReadLine:function(){if(null==this.stream&&System.IO.__Error.ReaderClosed(),this.charPos===this.charLen&&0===this.ReadBuffer())return null;var e=null;do{var t=this.charPos;do{var n=this.charBuffer[System.Array.index(t,this.charBuffer)];if(13===n||10===n){var i=null!=e?(e.append(System.String.fromCharArray(this.charBuffer,this.charPos,t-this.charPos|0)),e.toString()):System.String.fromCharArray(this.charBuffer,this.charPos,t-this.charPos|0);return this.charPos=t+1|0,13===n&&(this.charPos<this.charLen||0<this.ReadBuffer())&&10===this.charBuffer[System.Array.index(this.charPos,this.charBuffer)]&&(this.charPos=this.charPos+1|0),i}}while((t=t+1|0)<this.charLen)}while(t=this.charLen-this.charPos|0,null==e&&(e=new System.Text.StringBuilder("",t+80|0)),e.append(System.String.fromCharArray(this.charBuffer,this.charPos,t)),0<this.ReadBuffer());return e.toString()}}}),Bridge.define("System.IO.StreamReader.NullStreamReader",{inherits:[System.IO.StreamReader],$kind:"nested class",props:{BaseStream:{get:function(){return System.IO.Stream.Null}},CurrentEncoding:{get:function(){return System.Text.Encoding.Unicode}}},ctors:{ctor:function(){this.$initialize(),System.IO.StreamReader.ctor.call(this),this.Init(System.IO.Stream.Null)}},methods:{Dispose$1:function(e){},Peek:function(){return-1},Read:function(){return-1},Read$1:function(e,t,n){return 0},ReadLine:function(){return null},ReadToEnd:function(){return""},ReadBuffer:function(){return 0}}}),Bridge.define("System.IO.TextWriter",{inherits:[System.IDisposable],statics:{fields:{InitialNewLine:null,Null:null},ctors:{init:function(){this.InitialNewLine="\r\n",this.Null=new System.IO.TextWriter.NullTextWriter}},methods:{Synchronized:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("writer");return e}}},fields:{CoreNewLine:null,InternalFormatProvider:null},props:{FormatProvider:{get:function(){return null==this.InternalFormatProvider?System.Globalization.CultureInfo.getCurrentCulture():this.InternalFormatProvider}},NewLine:{get:function(){return System.String.fromCharArray(this.CoreNewLine)},set:function(e){null==e&&(e=System.IO.TextWriter.InitialNewLine),this.CoreNewLine=System.String.toCharArray(e,0,e.length)}}},alias:["Dispose","System$IDisposable$Dispose"],ctors:{init:function(){this.CoreNewLine=System.Array.init([13,10],System.Char)},ctor:function(){this.$initialize(),this.InternalFormatProvider=null},$ctor1:function(e){this.$initialize(),this.InternalFormatProvider=e}},methods:{Close:function(){this.Dispose$1(!0)},Dispose$1:function(e){},Dispose:function(){this.Dispose$1(!0)},Flush:function(){},Write$1:function(e){},Write$2:function(e){null!=e&&this.Write$3(e,0,e.length)},Write$3:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((e.length-t|0)<n)throw new System.ArgumentException.ctor;for(var i=0;i<n;i=i+1|0)this.Write$1(e[System.Array.index(t+i|0,e)])},Write:function(e){this.Write$10(e?System.Boolean.trueString:System.Boolean.falseString)},Write$6:function(e){this.Write$10(System.Int32.format(e,"G",this.FormatProvider))},Write$15:function(e){this.Write$10(System.UInt32.format(e,"G",this.FormatProvider))},Write$7:function(e){this.Write$10(e.format("G",this.FormatProvider))},Write$16:function(e){this.Write$10(e.format("G",this.FormatProvider))},Write$9:function(e){this.Write$10(System.Single.format(e,"G",this.FormatProvider))},Write$5:function(e){this.Write$10(System.Double.format(e,"G",this.FormatProvider))},Write$4:function(e){this.Write$10(Bridge.Int.format(e,"G",this.FormatProvider))},Write$10:function(e){null!=e&&this.Write$2(System.String.toCharArray(e,0,e.length))},Write$8:function(e){var t;null!=e&&(null!=(t=Bridge.as(e,System.IFormattable))?this.Write$10(Bridge.format(t,null,this.FormatProvider)):this.Write$10(Bridge.toString(e)))},Write$11:function(e,t){this.Write$10(System.String.formatProvider(this.FormatProvider,e,[t]))},Write$12:function(e,t,n){this.Write$10(System.String.formatProvider(this.FormatProvider,e,t,n))},Write$13:function(e,t,n,i){this.Write$10(System.String.formatProvider(this.FormatProvider,e,t,n,i))},Write$14:function(e,t){void 0===t&&(t=[]),this.Write$10(System.String.formatProvider.apply(System.String,[this.FormatProvider,e].concat(t)))},WriteLine:function(){this.Write$2(this.CoreNewLine)},WriteLine$2:function(e){this.Write$1(e),this.WriteLine()},WriteLine$3:function(e){this.Write$2(e),this.WriteLine()},WriteLine$4:function(e,t,n){this.Write$3(e,t,n),this.WriteLine()},WriteLine$1:function(e){this.Write(e),this.WriteLine()},WriteLine$7:function(e){this.Write$6(e),this.WriteLine()},WriteLine$16:function(e){this.Write$15(e),this.WriteLine()},WriteLine$8:function(e){this.Write$7(e),this.WriteLine()},WriteLine$17:function(e){this.Write$16(e),this.WriteLine()},WriteLine$10:function(e){this.Write$9(e),this.WriteLine()},WriteLine$6:function(e){this.Write$5(e),this.WriteLine()},WriteLine$5:function(e){this.Write$4(e),this.WriteLine()},WriteLine$11:function(e){var t,n,i;null==e?this.WriteLine():(t=e.length,n=this.CoreNewLine.length,i=System.Array.init(t+n|0,0,System.Char),System.String.copyTo(e,0,i,0,t),2===n?(i[System.Array.index(t,i)]=this.CoreNewLine[System.Array.index(0,this.CoreNewLine)],i[System.Array.index(t+1|0,i)]=this.CoreNewLine[System.Array.index(1,this.CoreNewLine)]):1===n?i[System.Array.index(t,i)]=this.CoreNewLine[System.Array.index(0,this.CoreNewLine)]:System.Array.copy(this.CoreNewLine,0,i,Bridge.Int.mul(t,2),Bridge.Int.mul(n,2)),this.Write$3(i,0,t+n|0))},WriteLine$9:function(e){var t;null==e?this.WriteLine():null!=(t=Bridge.as(e,System.IFormattable))?this.WriteLine$11(Bridge.format(t,null,this.FormatProvider)):this.WriteLine$11(Bridge.toString(e))},WriteLine$12:function(e,t){this.WriteLine$11(System.String.formatProvider(this.FormatProvider,e,[t]))},WriteLine$13:function(e,t,n){this.WriteLine$11(System.String.formatProvider(this.FormatProvider,e,t,n))},WriteLine$14:function(e,t,n,i){this.WriteLine$11(System.String.formatProvider(this.FormatProvider,e,t,n,i))},WriteLine$15:function(e,t){void 0===t&&(t=[]),this.WriteLine$11(System.String.formatProvider.apply(System.String,[this.FormatProvider,e].concat(t)))}}}),Bridge.define("System.IO.StreamWriter",{inherits:[System.IO.TextWriter],statics:{fields:{DefaultBufferSize:0,DefaultFileStreamBufferSize:0,MinBufferSize:0,Null:null,_UTF8NoBOM:null},props:{UTF8NoBOM:{get:function(){var e;return null==System.IO.StreamWriter._UTF8NoBOM&&(e=new System.Text.UTF8Encoding.$ctor2(!1,!0),System.IO.StreamWriter._UTF8NoBOM=e),System.IO.StreamWriter._UTF8NoBOM}}},ctors:{init:function(){this.DefaultBufferSize=1024,this.DefaultFileStreamBufferSize=4096,this.MinBufferSize=128,this.Null=new System.IO.StreamWriter.$ctor4(System.IO.Stream.Null,new System.Text.UTF8Encoding.$ctor2(!1,!0),System.IO.StreamWriter.MinBufferSize,!0)}}},fields:{stream:null,encoding:null,byteBuffer:null,charBuffer:null,charPos:0,charLen:0,autoFlush:!1,haveWrittenPreamble:!1,closable:!1},props:{AutoFlush:{get:function(){return this.autoFlush},set:function(e){(this.autoFlush=e)&&this.Flush$1(!0,!1)}},BaseStream:{get:function(){return this.stream}},LeaveOpen:{get:function(){return!this.closable}},HaveWrittenPreamble:{set:function(e){this.haveWrittenPreamble=e}},Encoding:{get:function(){return this.encoding}}},ctors:{ctor:function(){this.$initialize(),System.IO.TextWriter.$ctor1.call(this,null)},$ctor1:function(e){System.IO.StreamWriter.$ctor4.call(this,e,System.IO.StreamWriter.UTF8NoBOM,System.IO.StreamWriter.DefaultBufferSize,!1)},$ctor2:function(e,t){System.IO.StreamWriter.$ctor4.call(this,e,t,System.IO.StreamWriter.DefaultBufferSize,!1)},$ctor3:function(e,t,n){System.IO.StreamWriter.$ctor4.call(this,e,t,n,!1)},$ctor4:function(e,t,n,i){if(this.$initialize(),System.IO.TextWriter.$ctor1.call(this,null),null==e||null==t)throw new System.ArgumentNullException.$ctor1(null==e?"stream":"encoding");if(!e.CanWrite)throw new System.ArgumentException.$ctor1("Argument_StreamNotWritable");if(n<=0)throw new System.ArgumentOutOfRangeException.$ctor4("bufferSize","ArgumentOutOfRange_NeedPosNum");this.Init(e,t,n,i)},$ctor5:function(e){System.IO.StreamWriter.$ctor8.call(this,e,!1,System.IO.StreamWriter.UTF8NoBOM,System.IO.StreamWriter.DefaultBufferSize)},$ctor6:function(e,t){System.IO.StreamWriter.$ctor8.call(this,e,t,System.IO.StreamWriter.UTF8NoBOM,System.IO.StreamWriter.DefaultBufferSize)},$ctor7:function(e,t,n){System.IO.StreamWriter.$ctor8.call(this,e,t,n,System.IO.StreamWriter.DefaultBufferSize)},$ctor8:function(e,t,n,i){System.IO.StreamWriter.$ctor9.call(this,e,t,n,i,!0)},$ctor9:function(e,t,n,i,r){throw this.$initialize(),System.IO.TextWriter.$ctor1.call(this,null),new System.NotSupportedException.ctor}},methods:{Init:function(e,t,n,i){this.stream=e,this.encoding=t,n<System.IO.StreamWriter.MinBufferSize&&(n=System.IO.StreamWriter.MinBufferSize),this.charBuffer=System.Array.init(n,0,System.Char),this.byteBuffer=System.Array.init(this.encoding.GetMaxByteCount(n),0,System.Byte),this.charLen=n,this.stream.CanSeek&&this.stream.Position.gt(System.Int64(0))&&(this.haveWrittenPreamble=!0),this.closable=!i},Close:function(){this.Dispose$1(!0)},Dispose$1:function(e){try{null!=this.stream&&e&&this.Flush$1(!0,!0)}finally{if(!this.LeaveOpen&&null!=this.stream)try{e&&this.stream.Close()}finally{this.stream=null,this.byteBuffer=null,this.charBuffer=null,this.encoding=null,this.charLen=0,System.IO.TextWriter.prototype.Dispose$1.call(this,e)}}},Flush:function(){this.Flush$1(!0,!0)},Flush$1:function(e,t){null==this.stream&&System.IO.__Error.WriterClosed(),(0!==this.charPos||e||t)&&(t=this.encoding.GetBytes$3(this.charBuffer,0,this.charPos,this.byteBuffer,0),(this.charPos=0)<t&&this.stream.Write(this.byteBuffer,0,t),e&&this.stream.Flush())},Write$1:function(e){this.charPos===this.charLen&&this.Flush$1(!1,!1),this.charBuffer[System.Array.index(this.charPos,this.charBuffer)]=e,this.charPos=this.charPos+1|0,this.autoFlush&&this.Flush$1(!0,!1)},Write$2:function(e){if(null!=e){for(var t=0,n=e.length;0<n;){this.charPos===this.charLen&&this.Flush$1(!1,!1);var i=this.charLen-this.charPos|0;n<i&&(i=n),System.Array.copy(e,t,this.charBuffer,this.charPos,i),this.charPos=this.charPos+i|0,t=t+i|0,n=n-i|0}this.autoFlush&&this.Flush$1(!0,!1)}},Write$3:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor3("buffer","ArgumentNull_Buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("index","ArgumentOutOfRange_NeedNonNegNum");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("count","ArgumentOutOfRange_NeedNonNegNum");if((e.length-t|0)<n)throw new System.ArgumentException.$ctor1("Argument_InvalidOffLen");for(;0<n;){this.charPos===this.charLen&&this.Flush$1(!1,!1);var i=this.charLen-this.charPos|0;n<i&&(i=n),System.Array.copy(e,t,this.charBuffer,this.charPos,i),this.charPos=this.charPos+i|0,t=t+i|0,n=n-i|0}this.autoFlush&&this.Flush$1(!0,!1)},Write$10:function(e){if(null!=e){for(var t=e.length,n=0;0<t;){this.charPos===this.charLen&&this.Flush$1(!1,!1);var i=this.charLen-this.charPos|0;t<i&&(i=t),System.String.copyTo(e,n,this.charBuffer,this.charPos,i),this.charPos=this.charPos+i|0,n=n+i|0,t=t-i|0}this.autoFlush&&this.Flush$1(!0,!1)}}}}),Bridge.define("System.IO.StringReader",{inherits:[System.IO.TextReader],fields:{_s:null,_pos:0,_length:0},ctors:{ctor:function(e){if(this.$initialize(),System.IO.TextReader.ctor.call(this),null==e)throw new System.ArgumentNullException.$ctor1("s");this._s=e,this._length=null==e?0:e.length}},methods:{Close:function(){this.Dispose$1(!0)},Dispose$1:function(e){this._s=null,this._pos=0,this._length=0,System.IO.TextReader.prototype.Dispose$1.call(this,e)},Peek:function(){return null==this._s&&System.IO.__Error.ReaderClosed(),this._pos===this._length?-1:this._s.charCodeAt(this._pos)},Read:function(){return null==this._s&&System.IO.__Error.ReaderClosed(),this._pos===this._length?-1:this._s.charCodeAt(Bridge.identity(this._pos,this._pos=this._pos+1|0))},Read$1:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((e.length-t|0)<n)throw new System.ArgumentException.ctor;null==this._s&&System.IO.__Error.ReaderClosed();var i=this._length-this._pos|0;return 0<i&&(n<i&&(i=n),System.String.copyTo(this._s,this._pos,e,t,i),this._pos=this._pos+i|0),i},ReadToEnd:function(){var e;return null==this._s&&System.IO.__Error.ReaderClosed(),e=0===this._pos?this._s:this._s.substr(this._pos,this._length-this._pos|0),this._pos=this._length,e},ReadLine:function(){null==this._s&&System.IO.__Error.ReaderClosed();for(var e=this._pos;e<this._length;){var t=this._s.charCodeAt(e);if(13===t||10===t){var n=this._s.substr(this._pos,e-this._pos|0);return this._pos=e+1|0,13===t&&this._pos<this._length&&10===this._s.charCodeAt(this._pos)&&(this._pos=this._pos+1|0),n}e=e+1|0}if(e>this._pos){var i=this._s.substr(this._pos,e-this._pos|0);return this._pos=e,i}return null}}}),Bridge.define("System.IO.StringWriter",{inherits:[System.IO.TextWriter],statics:{fields:{m_encoding:null}},fields:{_sb:null,_isOpen:!1},props:{Encoding:{get:function(){return null==System.IO.StringWriter.m_encoding&&(System.IO.StringWriter.m_encoding=new System.Text.UnicodeEncoding.$ctor1(!1,!1)),System.IO.StringWriter.m_encoding}}},ctors:{ctor:function(){System.IO.StringWriter.$ctor3.call(this,new System.Text.StringBuilder,System.Globalization.CultureInfo.getCurrentCulture())},$ctor1:function(e){System.IO.StringWriter.$ctor3.call(this,new System.Text.StringBuilder,e)},$ctor2:function(e){System.IO.StringWriter.$ctor3.call(this,e,System.Globalization.CultureInfo.getCurrentCulture())},$ctor3:function(e,t){if(this.$initialize(),System.IO.TextWriter.$ctor1.call(this,t),null==e)throw new System.ArgumentNullException.$ctor1("sb");this._sb=e,this._isOpen=!0}},methods:{Close:function(){this.Dispose$1(!0)},Dispose$1:function(e){this._isOpen=!1,System.IO.TextWriter.prototype.Dispose$1.call(this,e)},GetStringBuilder:function(){return this._sb},Write$1:function(e){this._isOpen||System.IO.__Error.WriterClosed(),this._sb.append(String.fromCharCode(e))},Write$3:function(e,t,n){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor1("index");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor1("count");if((e.length-t|0)<n)throw new System.ArgumentException.ctor;this._isOpen||System.IO.__Error.WriterClosed(),this._sb.append(System.String.fromCharArray(e,t,n))},Write$10:function(e){this._isOpen||System.IO.__Error.WriterClosed(),null!=e&&this._sb.append(e)},toString:function(){return this._sb.toString()}}}),Bridge.define("System.IO.TextReader.NullTextReader",{inherits:[System.IO.TextReader],$kind:"nested class",ctors:{ctor:function(){this.$initialize(),System.IO.TextReader.ctor.call(this)}},methods:{Read$1:function(e,t,n){return 0},ReadLine:function(){return null}}}),Bridge.define("System.IO.TextWriter.NullTextWriter",{inherits:[System.IO.TextWriter],$kind:"nested class",props:{Encoding:{get:function(){return System.Text.Encoding.Default}}},ctors:{ctor:function(){this.$initialize(),System.IO.TextWriter.$ctor1.call(this,System.Globalization.CultureInfo.invariantCulture)}},methods:{Write$3:function(e,t,n){},Write$10:function(e){},WriteLine:function(){},WriteLine$11:function(e){},WriteLine$9:function(e){}}}),Bridge.define("System.IO.__Error",{statics:{methods:{EndOfFile:function(){throw new System.IO.EndOfStreamException.$ctor1("IO.EOF_ReadBeyondEOF")},FileNotOpen:function(){throw new System.Exception("ObjectDisposed_FileClosed")},StreamIsClosed:function(){throw new System.Exception("ObjectDisposed_StreamClosed")},MemoryStreamNotExpandable:function(){throw new System.NotSupportedException.$ctor1("NotSupported_MemStreamNotExpandable")},ReaderClosed:function(){throw new System.Exception("ObjectDisposed_ReaderClosed")},ReadNotSupported:function(){throw new System.NotSupportedException.$ctor1("NotSupported_UnreadableStream")},SeekNotSupported:function(){throw new System.NotSupportedException.$ctor1("NotSupported_UnseekableStream")},WrongAsyncResult:function(){throw new System.ArgumentException.$ctor1("Arg_WrongAsyncResult")},EndReadCalledTwice:function(){throw new System.ArgumentException.$ctor1("InvalidOperation_EndReadCalledMultiple")},EndWriteCalledTwice:function(){throw new System.ArgumentException.$ctor1("InvalidOperation_EndWriteCalledMultiple")},WriteNotSupported:function(){throw new System.NotSupportedException.$ctor1("NotSupported_UnwritableStream")},WriterClosed:function(){throw new System.Exception("ObjectDisposed_WriterClosed")}}}}),Bridge.define("System.Reflection.AmbiguousMatchException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Ambiguous match found."),this.HResult=-2147475171},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2147475171},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2147475171}}}),Bridge.define("System.Reflection.Binder",{ctors:{ctor:function(){this.$initialize()}}}),Bridge.define("System.Reflection.BindingFlags",{$kind:"enum",statics:{fields:{Default:0,IgnoreCase:1,DeclaredOnly:2,Instance:4,Static:8,Public:16,NonPublic:32,FlattenHierarchy:64,InvokeMethod:256,CreateInstance:512,GetField:1024,SetField:2048,GetProperty:4096,SetProperty:8192,PutDispProperty:16384,PutRefDispProperty:32768,ExactBinding:65536,SuppressChangeType:131072,OptionalParamBinding:262144,IgnoreReturn:16777216,DoNotWrapExceptions:33554432}},$flags:!0}),Bridge.define("System.Reflection.CallingConventions",{$kind:"enum",statics:{fields:{Standard:1,VarArgs:2,Any:3,HasThis:32,ExplicitThis:64}},$flags:!0}),Bridge.define("System.Reflection.ICustomAttributeProvider",{$kind:"interface"}),Bridge.define("System.Reflection.InvalidFilterCriteriaException",{inherits:[System.ApplicationException],ctors:{ctor:function(){System.Reflection.InvalidFilterCriteriaException.$ctor1.call(this,"Specified filter criteria was invalid.")},$ctor1:function(e){System.Reflection.InvalidFilterCriteriaException.$ctor2.call(this,e,null)},$ctor2:function(e,t){this.$initialize(),System.ApplicationException.$ctor2.call(this,e,t),this.HResult=-2146232831}}}),Bridge.define("System.Reflection.IReflect",{$kind:"interface"}),Bridge.define("System.Reflection.MemberTypes",{$kind:"enum",statics:{fields:{Constructor:1,Event:2,Field:4,Method:8,Property:16,TypeInfo:32,Custom:64,NestedType:128,All:191}},$flags:!0}),Bridge.define("System.Reflection.Module",{inherits:[System.Reflection.ICustomAttributeProvider,System.Runtime.Serialization.ISerializable],statics:{fields:{DefaultLookup:0,FilterTypeName:null,FilterTypeNameIgnoreCase:null},ctors:{init:function(){this.DefaultLookup=28,this.FilterTypeName=System.Reflection.Module.FilterTypeNameImpl,this.FilterTypeNameIgnoreCase=System.Reflection.Module.FilterTypeNameIgnoreCaseImpl}},methods:{FilterTypeNameImpl:function(e,t){if(null==t||!Bridge.is(t,System.String))throw new System.Reflection.InvalidFilterCriteriaException.$ctor1("A String must be provided for the filter criteria.");t=Bridge.cast(t,System.String);return 0<t.length&&42===t.charCodeAt(t.length-1|0)?(t=t.substr(0,t.length-1|0),System.String.startsWith(Bridge.Reflection.getTypeName(e),t,4)):System.String.equals(Bridge.Reflection.getTypeName(e),t)},FilterTypeNameIgnoreCaseImpl:function(e,t){if(null==t||!Bridge.is(t,System.String))throw new System.Reflection.InvalidFilterCriteriaException.$ctor1("A String must be provided for the filter criteria.");var n=Bridge.cast(t,System.String);if(0<n.length&&42===n.charCodeAt(n.length-1|0)){n=n.substr(0,n.length-1|0);var i=Bridge.Reflection.getTypeName(e);return i.length>=n.length&&0===(t=n.length,System.String.compare(i.substr(0,t),n.substr(0,t),5))}return 0===System.String.compare(n,Bridge.Reflection.getTypeName(e),5)},op_Equality:function(e,t){return!!Bridge.referenceEquals(e,t)||null!=e&&null!=t&&e.equals(t)},op_Inequality:function(e,t){return!System.Reflection.Module.op_Equality(e,t)}}},props:{Assembly:{get:function(){throw System.NotImplemented.ByDesign}},FullyQualifiedName:{get:function(){throw System.NotImplemented.ByDesign}},Name:{get:function(){throw System.NotImplemented.ByDesign}},MDStreamVersion:{get:function(){throw System.NotImplemented.ByDesign}},ModuleVersionId:{get:function(){throw System.NotImplemented.ByDesign}},ScopeName:{get:function(){throw System.NotImplemented.ByDesign}},MetadataToken:{get:function(){throw System.NotImplemented.ByDesign}}},alias:["IsDefined","System$Reflection$ICustomAttributeProvider$IsDefined","GetCustomAttributes","System$Reflection$ICustomAttributeProvider$GetCustomAttributes","GetCustomAttributes$1","System$Reflection$ICustomAttributeProvider$GetCustomAttributes$1"],ctors:{ctor:function(){this.$initialize()}},methods:{IsResource:function(){throw System.NotImplemented.ByDesign},IsDefined:function(e,t){throw System.NotImplemented.ByDesign},GetCustomAttributes:function(e){throw System.NotImplemented.ByDesign},GetCustomAttributes$1:function(e,t){throw System.NotImplemented.ByDesign},GetMethod:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("name");return this.GetMethodImpl(e,System.Reflection.Module.DefaultLookup,null,3,null,null)},GetMethod$2:function(e,t){return this.GetMethod$1(e,System.Reflection.Module.DefaultLookup,null,3,t,null)},GetMethod$1:function(e,t,n,i,r,s){if(null==e)throw new System.ArgumentNullException.$ctor1("name");if(null==r)throw new System.ArgumentNullException.$ctor1("types");for(var o=0;o<r.length;o=o+1|0)if(null==r[System.Array.index(o,r)])throw new System.ArgumentNullException.$ctor1("types");return this.GetMethodImpl(e,t,n,i,r,s)},GetMethodImpl:function(e,t,n,i,r,s){throw System.NotImplemented.ByDesign},GetMethods:function(){return this.GetMethods$1(System.Reflection.Module.DefaultLookup)},GetMethods$1:function(e){throw System.NotImplemented.ByDesign},GetField:function(e){return this.GetField$1(e,System.Reflection.Module.DefaultLookup)},GetField$1:function(e,t){throw System.NotImplemented.ByDesign},GetFields:function(){return this.GetFields$1(System.Reflection.Module.DefaultLookup)},GetFields$1:function(e){throw System.NotImplemented.ByDesign},GetTypes:function(){throw System.NotImplemented.ByDesign},GetType:function(e){return this.GetType$2(e,!1,!1)},GetType$1:function(e,t){return this.GetType$2(e,!1,t)},GetType$2:function(e,t,n){throw System.NotImplemented.ByDesign},FindTypes:function(e,t){for(var n=this.GetTypes(),i=0,r=0;r<n.length;r=r+1|0)Bridge.staticEquals(e,null)||e(n[System.Array.index(r,n)],t)?i=i+1|0:n[System.Array.index(r,n)]=null;if(i===n.length)return n;for(var s=System.Array.init(i,null,System.Type),i=0,o=0;o<n.length;o=o+1|0)null!=n[System.Array.index(o,n)]&&(s[System.Array.index(Bridge.identity(i,i=i+1|0),s)]=n[System.Array.index(o,n)]);return s},ResolveField:function(e){return this.ResolveField$1(e,null,null)},ResolveField$1:function(e,t,n){throw System.NotImplemented.ByDesign},ResolveMember:function(e){return this.ResolveMember$1(e,null,null)},ResolveMember$1:function(e,t,n){throw System.NotImplemented.ByDesign},ResolveMethod:function(e){return this.ResolveMethod$1(e,null,null)},ResolveMethod$1:function(e,t,n){throw System.NotImplemented.ByDesign},ResolveSignature:function(e){throw System.NotImplemented.ByDesign},ResolveString:function(e){throw System.NotImplemented.ByDesign},ResolveType:function(e){return this.ResolveType$1(e,null,null)},ResolveType$1:function(e,t,n){throw System.NotImplemented.ByDesign},equals:function(e){return Bridge.equals(this,e)},getHashCode:function(){return Bridge.getHashCode(this)},toString:function(){return this.ScopeName}}}),Bridge.define("System.Reflection.ParameterModifier",{$kind:"struct",statics:{methods:{getDefaultValue:function(){return new System.Reflection.ParameterModifier}}},fields:{_byRef:null},ctors:{$ctor1:function(e){if(this.$initialize(),e<=0)throw new System.ArgumentException.$ctor1("Must specify one or more parameters.");this._byRef=System.Array.init(e,!1,System.Boolean)},ctor:function(){this.$initialize()}},methods:{getItem:function(e){return this._byRef[System.Array.index(e,this._byRef)]},setItem:function(e,t){this._byRef[System.Array.index(e,this._byRef)]=t},getHashCode:function(){return Bridge.addHash([6723435274,this._byRef])},equals:function(e){return!!Bridge.is(e,System.Reflection.ParameterModifier)&&Bridge.equals(this._byRef,e._byRef)},$clone:function(e){e=e||new System.Reflection.ParameterModifier;return e._byRef=this._byRef,e}}}),Bridge.define("System.Reflection.TypeAttributes",{$kind:"enum",statics:{fields:{VisibilityMask:7,NotPublic:0,Public:1,NestedPublic:2,NestedPrivate:3,NestedFamily:4,NestedAssembly:5,NestedFamANDAssem:6,NestedFamORAssem:7,LayoutMask:24,AutoLayout:0,SequentialLayout:8,ExplicitLayout:16,ClassSemanticsMask:32,Class:0,Interface:32,Abstract:128,Sealed:256,SpecialName:1024,Import:4096,Serializable:8192,WindowsRuntime:16384,StringFormatMask:196608,AnsiClass:0,UnicodeClass:65536,AutoClass:131072,CustomFormatClass:196608,CustomFormatMask:12582912,BeforeFieldInit:1048576,RTSpecialName:2048,HasSecurity:262144,ReservedMask:264192}},$flags:!0}),Bridge.define("System.Random",{statics:{fields:{MBIG:0,MSEED:0,MZ:0},ctors:{init:function(){this.MBIG=2147483647,this.MSEED=161803398,this.MZ=0}}},fields:{inext:0,inextp:0,SeedArray:null},ctors:{init:function(){this.SeedArray=System.Array.init(56,0,System.Int32)},ctor:function(){System.Random.$ctor1.call(this,System.Int64.clip32(System.DateTime.getTicks(System.DateTime.getNow())))},$ctor1:function(e){var t,n;this.$initialize();var i=-2147483648===e?2147483647:Math.abs(e),r=System.Random.MSEED-i|0;this.SeedArray[System.Array.index(55,this.SeedArray)]=r;for(var s=n=1;s<55;s=s+1|0)t=Bridge.Int.mul(21,s)%55,(n=r-(this.SeedArray[System.Array.index(t,this.SeedArray)]=n)|0)<0&&(n=n+System.Random.MBIG|0),r=this.SeedArray[System.Array.index(t,this.SeedArray)];for(var o=1;o<5;o=o+1|0)for(var a=1;a<56;a=a+1|0)this.SeedArray[System.Array.index(a,this.SeedArray)]=this.SeedArray[System.Array.index(a,this.SeedArray)]-this.SeedArray[System.Array.index(1+(a+30|0)%55|0,this.SeedArray)]|0,this.SeedArray[System.Array.index(a,this.SeedArray)]<0&&(this.SeedArray[System.Array.index(a,this.SeedArray)]=this.SeedArray[System.Array.index(a,this.SeedArray)]+System.Random.MBIG|0);this.inext=0,this.inextp=21,e=1}},methods:{Sample:function(){return 4.656612875245797e-10*this.InternalSample()},InternalSample:function(){var e,t=this.inext,n=this.inextp;return 56<=(t=t+1|0)&&(t=1),56<=(n=n+1|0)&&(n=1),(e=this.SeedArray[System.Array.index(t,this.SeedArray)]-this.SeedArray[System.Array.index(n,this.SeedArray)]|0)===System.Random.MBIG&&(e=e-1|0),e<0&&(e=e+System.Random.MBIG|0),this.SeedArray[System.Array.index(t,this.SeedArray)]=e,this.inext=t,this.inextp=n,e},Next:function(){return this.InternalSample()},Next$2:function(e,t){if(t<e)throw new System.ArgumentOutOfRangeException.$ctor4("minValue","'minValue' cannot be greater than maxValue.");t=System.Int64(t).sub(System.Int64(e));return t.lte(System.Int64(2147483647))?Bridge.Int.clip32(this.Sample()*System.Int64.toNumber(t))+e|0:System.Int64.clip32(Bridge.Int.clip64(this.GetSampleForLargeRange()*System.Int64.toNumber(t)).add(System.Int64(e)))},Next$1:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor4("maxValue","'maxValue' must be greater than zero.");return Bridge.Int.clip32(this.Sample()*e)},GetSampleForLargeRange:function(){var e=this.InternalSample();this.InternalSample()%2==0&&(e=0|-e);return e+=2147483646,e/=4294967293},NextDouble:function(){return this.Sample()},NextBytes:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("buffer");for(var t=0;t<e.length;t=t+1|0)e[System.Array.index(t,e)]=this.InternalSample()%256&255}}}),Bridge.define("System.RankException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"Attempted to operate on an array with the incorrect number of dimensions."),this.HResult=-2146233065},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233065},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233065}}}),Bridge.define("System.SR",{statics:{fields:{ArgumentException_ValueTupleIncorrectType:null,ArgumentException_ValueTupleLastArgumentNotAValueTuple:null,_lock:null},props:{ResourceManager:null},ctors:{init:function(){this.ArgumentException_ValueTupleIncorrectType="Argument must be of type {0}.",this.ArgumentException_ValueTupleLastArgumentNotAValueTuple="The last element of an eight element ValueTuple must be a ValueTuple.",this._lock={}}},methods:{UsingResourceKeys:function(){return!1},GetResourceString:function(e){return System.SR.GetResourceString$1(e,"")},GetResourceString$1:function(e,t){var n=null;try{n=System.SR.InternalGetResourceString(e)}catch(e){if(e=System.Exception.create(e),!Bridge.is(e,System.Resources.MissingManifestResourceException))throw e}return null!=t&&System.String.equals(e,n,4)?t:n},InternalGetResourceString:function(e){return null==e||e.length,e},Format$3:function(e,t){return void 0===t&&(t=[]),null!=t?System.SR.UsingResourceKeys()?(e||"")+(t.join(", ")||""):System.String.format.apply(System.String,[e].concat(t)):e},Format:function(e,t){return System.SR.UsingResourceKeys()?[e,t].join(", "):System.String.format(e,[t])},Format$1:function(e,t,n){return System.SR.UsingResourceKeys()?[e,t,n].join(", "):System.String.format(e,t,n)},Format$2:function(e,t,n,i){return System.SR.UsingResourceKeys()?[e,t,n,i].join(", "):System.String.format(e,t,n,i)}}}}),Bridge.define("System.StringComparison",{$kind:"enum",statics:{fields:{CurrentCulture:0,CurrentCultureIgnoreCase:1,InvariantCulture:2,InvariantCultureIgnoreCase:3,Ordinal:4,OrdinalIgnoreCase:5}}}),Bridge.define("System.AggregateException",{inherits:[System.Exception],ctor:function(e,t){this.$initialize(),this.innerExceptions=new(System.Collections.ObjectModel.ReadOnlyCollection$1(System.Exception))(Bridge.hasValue(t)?Bridge.toArray(t):[]),System.Exception.ctor.call(this,e||"One or more errors occurred.",0<this.innerExceptions.Count?this.innerExceptions.getItem(0):null)},handle:function(e){if(!Bridge.hasValue(e))throw new System.ArgumentNullException.$ctor1("predicate");for(var t=this.innerExceptions.Count,n=[],i=0;i<t;i++)e(this.innerExceptions.get(i))||n.push(this.innerExceptions.getItem(i));if(0<n.length)throw new System.AggregateException(this.Message,n)},getBaseException:function(){for(var e=this,t=this;null!=t&&1===t.innerExceptions.Count;)e=e.InnerException,t=Bridge.as(e,System.AggregateException);return e},hasTaskCanceledException:function(){for(var e=0;e<this.innerExceptions.Count;e++){var t=this.innerExceptions.getItem(e);if(Bridge.is(t,System.Threading.Tasks.TaskCanceledException)||Bridge.is(t,System.AggregateException)&&t.hasTaskCanceledException())return!0}return!1},flatten:function(){var e=new(System.Collections.Generic.List$1(System.Exception)),t=new(System.Collections.Generic.List$1(System.AggregateException));t.add(this);for(var n=0;t.Count>n;)for(var i=t.getItem(n++).innerExceptions,r=i.Count,s=0;s<r;s++){var o,a=i.getItem(s);Bridge.hasValue(a)&&(o=Bridge.as(a,System.AggregateException),Bridge.hasValue(o)?t.add(o):e.add(a))}return new System.AggregateException(this.Message,e)}}),Bridge.define("Bridge.PromiseException",{inherits:[System.Exception],ctor:function(e,t,n){this.$initialize(),this.arguments=System.Array.clone(e),null==t&&(t="Promise exception: [",t+=this.arguments.map(function(e){return null==e?"null":e.toString()}).join(", "),t+="]"),System.Exception.ctor.call(this,t,n)},getArguments:function(){return this.arguments}}),Bridge.define("System.ThrowHelper",{statics:{methods:{ThrowArrayTypeMismatchException:function(){throw new System.ArrayTypeMismatchException.ctor},ThrowInvalidTypeWithPointersNotSupported:function(e){throw new System.ArgumentException.$ctor1(System.SR.Format("Cannot use type '{0}'. Only value types without pointers or references are supported.",e))},ThrowIndexOutOfRangeException:function(){throw new System.IndexOutOfRangeException.ctor},ThrowArgumentOutOfRangeException:function(){throw new System.ArgumentOutOfRangeException.ctor},ThrowArgumentOutOfRangeException$1:function(e){throw new System.ArgumentOutOfRangeException.$ctor1(System.ThrowHelper.GetArgumentName(e))},ThrowArgumentOutOfRangeException$2:function(e,t){throw System.ThrowHelper.GetArgumentOutOfRangeException(e,t)},ThrowArgumentOutOfRangeException$3:function(e,t,n){throw System.ThrowHelper.GetArgumentOutOfRangeException$1(e,t,n)},ThrowArgumentException_DestinationTooShort:function(){throw new System.ArgumentException.$ctor1("Destination is too short.")},ThrowArgumentException_OverlapAlignmentMismatch:function(){throw new System.ArgumentException.$ctor1("Overlapping spans have mismatching alignment.")},ThrowArgumentOutOfRange_IndexException:function(){throw System.ThrowHelper.GetArgumentOutOfRangeException(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_Index)},ThrowIndexArgumentOutOfRange_NeedNonNegNumException:function(){throw System.ThrowHelper.GetArgumentOutOfRangeException(System.ExceptionArgument.index,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum)},ThrowLengthArgumentOutOfRange_ArgumentOutOfRange_NeedNonNegNum:function(){throw System.ThrowHelper.GetArgumentOutOfRangeException(System.ExceptionArgument.$length,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum)},ThrowStartIndexArgumentOutOfRange_ArgumentOutOfRange_Index:function(){throw System.ThrowHelper.GetArgumentOutOfRangeException(System.ExceptionArgument.startIndex,System.ExceptionResource.ArgumentOutOfRange_Index)},ThrowCountArgumentOutOfRange_ArgumentOutOfRange_Count:function(){throw System.ThrowHelper.GetArgumentOutOfRangeException(System.ExceptionArgument.count,System.ExceptionResource.ArgumentOutOfRange_Count)},ThrowWrongKeyTypeArgumentException:function(e,t,n){throw System.ThrowHelper.GetWrongKeyTypeArgumentException(t,n)},ThrowWrongValueTypeArgumentException:function(e,t,n){throw System.ThrowHelper.GetWrongValueTypeArgumentException(t,n)},GetAddingDuplicateWithKeyArgumentException:function(e){return new System.ArgumentException.$ctor1(System.SR.Format("An item with the same key has already been added. Key: {0}",e))},ThrowAddingDuplicateWithKeyArgumentException:function(e,t){throw System.ThrowHelper.GetAddingDuplicateWithKeyArgumentException(t)},ThrowKeyNotFoundException:function(e,t){throw System.ThrowHelper.GetKeyNotFoundException(t)},ThrowArgumentException:function(e){throw System.ThrowHelper.GetArgumentException(e)},ThrowArgumentException$1:function(e,t){throw System.ThrowHelper.GetArgumentException$1(e,t)},GetArgumentNullException:function(e){return new System.ArgumentNullException.$ctor1(System.ThrowHelper.GetArgumentName(e))},ThrowArgumentNullException:function(e){throw System.ThrowHelper.GetArgumentNullException(e)},ThrowArgumentNullException$2:function(e){throw new System.ArgumentNullException.$ctor1(System.ThrowHelper.GetResourceString(e))},ThrowArgumentNullException$1:function(e,t){throw new System.ArgumentNullException.$ctor3(System.ThrowHelper.GetArgumentName(e),System.ThrowHelper.GetResourceString(t))},ThrowInvalidOperationException:function(e){throw System.ThrowHelper.GetInvalidOperationException(e)},ThrowInvalidOperationException$1:function(e,t){throw new System.InvalidOperationException.$ctor2(System.ThrowHelper.GetResourceString(e),t)},ThrowInvalidOperationException_OutstandingReferences:function(){System.ThrowHelper.ThrowInvalidOperationException(System.ExceptionResource.Memory_OutstandingReferences)},ThrowSerializationException:function(e){throw new System.Runtime.Serialization.SerializationException.$ctor1(System.ThrowHelper.GetResourceString(e))},ThrowSecurityException:function(e){throw new System.Security.SecurityException.$ctor1(System.ThrowHelper.GetResourceString(e))},ThrowRankException:function(e){throw new System.RankException.$ctor1(System.ThrowHelper.GetResourceString(e))},ThrowNotSupportedException$1:function(e){throw new System.NotSupportedException.$ctor1(System.ThrowHelper.GetResourceString(e))},ThrowNotSupportedException:function(){throw new System.NotSupportedException.ctor},ThrowUnauthorizedAccessException:function(e){throw new System.UnauthorizedAccessException.$ctor1(System.ThrowHelper.GetResourceString(e))},ThrowObjectDisposedException$1:function(e,t){throw new System.ObjectDisposedException.$ctor3(e,System.ThrowHelper.GetResourceString(t))},ThrowObjectDisposedException:function(e){throw new System.ObjectDisposedException.$ctor3(null,System.ThrowHelper.GetResourceString(e))},ThrowObjectDisposedException_MemoryDisposed:function(){throw new System.ObjectDisposedException.$ctor3("OwnedMemory<T>",System.ThrowHelper.GetResourceString(System.ExceptionResource.MemoryDisposed))},ThrowAggregateException:function(e){throw new System.AggregateException(null,e)},ThrowOutOfMemoryException:function(){throw new System.OutOfMemoryException.ctor},ThrowArgumentException_Argument_InvalidArrayType:function(){throw System.ThrowHelper.GetArgumentException(System.ExceptionResource.Argument_InvalidArrayType)},ThrowInvalidOperationException_InvalidOperation_EnumNotStarted:function(){throw System.ThrowHelper.GetInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumNotStarted)},ThrowInvalidOperationException_InvalidOperation_EnumEnded:function(){throw System.ThrowHelper.GetInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumEnded)},ThrowInvalidOperationException_EnumCurrent:function(e){throw System.ThrowHelper.GetInvalidOperationException_EnumCurrent(e)},ThrowInvalidOperationException_InvalidOperation_EnumFailedVersion:function(){throw System.ThrowHelper.GetInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumFailedVersion)},ThrowInvalidOperationException_InvalidOperation_EnumOpCantHappen:function(){throw System.ThrowHelper.GetInvalidOperationException(System.ExceptionResource.InvalidOperation_EnumOpCantHappen)},ThrowInvalidOperationException_InvalidOperation_NoValue:function(){throw System.ThrowHelper.GetInvalidOperationException(System.ExceptionResource.InvalidOperation_NoValue)},ThrowArraySegmentCtorValidationFailedExceptions:function(e,t,n){throw System.ThrowHelper.GetArraySegmentCtorValidationFailedException(e,t,n)},GetArraySegmentCtorValidationFailedException:function(e,t,n){return null==e?System.ThrowHelper.GetArgumentNullException(System.ExceptionArgument.array):t<0?System.ThrowHelper.GetArgumentOutOfRangeException(System.ExceptionArgument.offset,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum):n<0?System.ThrowHelper.GetArgumentOutOfRangeException(System.ExceptionArgument.count,System.ExceptionResource.ArgumentOutOfRange_NeedNonNegNum):System.ThrowHelper.GetArgumentException(System.ExceptionResource.Argument_InvalidOffLen)},GetArgumentException:function(e){return new System.ArgumentException.$ctor1(System.ThrowHelper.GetResourceString(e))},GetArgumentException$1:function(e,t){return new System.ArgumentException.$ctor3(System.ThrowHelper.GetResourceString(e),System.ThrowHelper.GetArgumentName(t))},GetInvalidOperationException:function(e){return new System.InvalidOperationException.$ctor1(System.ThrowHelper.GetResourceString(e))},GetWrongKeyTypeArgumentException:function(e,t){return new System.ArgumentException.$ctor3(System.SR.Format$1('The value "{0}" is not of type "{1}" and cannot be used in this generic collection.',e,t),"key")},GetWrongValueTypeArgumentException:function(e,t){return new System.ArgumentException.$ctor3(System.SR.Format$1('The value "{0}" is not of type "{1}" and cannot be used in this generic collection.',e,t),"value")},GetKeyNotFoundException:function(e){return new System.Collections.Generic.KeyNotFoundException.$ctor1(System.SR.Format("The given key '{0}' was not present in the dictionary.",Bridge.toString(e)))},GetArgumentOutOfRangeException:function(e,t){return new System.ArgumentOutOfRangeException.$ctor4(System.ThrowHelper.GetArgumentName(e),System.ThrowHelper.GetResourceString(t))},GetArgumentOutOfRangeException$1:function(e,t,n){return new System.ArgumentOutOfRangeException.$ctor4((System.ThrowHelper.GetArgumentName(e)||"")+"["+(Bridge.toString(t)||"")+"]",System.ThrowHelper.GetResourceString(n))},GetInvalidOperationException_EnumCurrent:function(e){return System.ThrowHelper.GetInvalidOperationException(e<0?System.ExceptionResource.InvalidOperation_EnumNotStarted:System.ExceptionResource.InvalidOperation_EnumEnded)},IfNullAndNullsAreIllegalThenThrow:function(e,t,n){null!=Bridge.getDefaultValue(e)&&null==t&&System.ThrowHelper.ThrowArgumentNullException(n)},GetArgumentName:function(e){return System.Enum.toString(System.ExceptionArgument,e)},GetResourceString:function(e){return System.SR.GetResourceString(System.Enum.toString(System.ExceptionResource,e))},ThrowNotSupportedExceptionIfNonNumericType:function(e){if(!(Bridge.referenceEquals(e,System.Byte)||Bridge.referenceEquals(e,System.SByte)||Bridge.referenceEquals(e,System.Int16)||Bridge.referenceEquals(e,System.UInt16)||Bridge.referenceEquals(e,System.Int32)||Bridge.referenceEquals(e,System.UInt32)||Bridge.referenceEquals(e,System.Int64)||Bridge.referenceEquals(e,System.UInt64)||Bridge.referenceEquals(e,System.Single)||Bridge.referenceEquals(e,System.Double)))throw new System.NotSupportedException.$ctor1("Specified type is not supported")}}}}),Bridge.define("System.TimeoutException",{inherits:[System.SystemException],ctors:{ctor:function(){this.$initialize(),System.SystemException.$ctor1.call(this,"The operation has timed out."),this.HResult=-2146233083},$ctor1:function(e){this.$initialize(),System.SystemException.$ctor1.call(this,e),this.HResult=-2146233083},$ctor2:function(e,t){this.$initialize(),System.SystemException.$ctor2.call(this,e,t),this.HResult=-2146233083}}}),Bridge.define("System.RegexMatchTimeoutException",{inherits:[System.TimeoutException],_regexInput:"",_regexPattern:"",_matchTimeout:null,config:{init:function(){this._matchTimeout=System.TimeSpan.fromTicks(-1)}},ctor:function(e,t,n){this.$initialize(),3==arguments.length&&(this._regexInput=e,this._regexPattern=t,this._matchTimeout=n,e="The RegEx engine has timed out while trying to match a pattern to an input string. This can occur for many reasons, including very large inputs or excessive backtracking caused by nested quantifiers, back-references and other factors.",t=null),System.TimeoutException.ctor.call(this,e,t)},getPattern:function(){return this._regexPattern},getInput:function(){return this._regexInput},getMatchTimeout:function(){return this._matchTimeout}}),Bridge.define("System.Text.Encoding",{statics:{fields:{_encodings:null},props:{Default:null,Unicode:null,ASCII:null,BigEndianUnicode:null,UTF7:null,UTF8:null,UTF32:null},ctors:{init:function(){this.Default=new System.Text.UnicodeEncoding.$ctor1(!1,!0),this.Unicode=new System.Text.UnicodeEncoding.$ctor1(!1,!0),this.ASCII=new System.Text.ASCIIEncoding,this.BigEndianUnicode=new System.Text.UnicodeEncoding.$ctor1(!0,!0),this.UTF7=new System.Text.UTF7Encoding.ctor,this.UTF8=new System.Text.UTF8Encoding.ctor,this.UTF32=new System.Text.UTF32Encoding.$ctor1(!1,!0)}},methods:{Convert:function(e,t,n){return System.Text.Encoding.Convert$1(e,t,n,0,n.length)},Convert$1:function(e,t,n,i,r){if(null==e||null==t)throw new System.ArgumentNullException.$ctor1(null==e?"srcEncoding":"dstEncoding");if(null==n)throw new System.ArgumentNullException.$ctor1("bytes");return t.GetBytes(e.GetChars$1(n,i,r))},GetEncoding:function(e){switch(e){case 1200:return System.Text.Encoding.Unicode;case 20127:return System.Text.Encoding.ASCII;case 1201:return System.Text.Encoding.BigEndianUnicode;case 65e3:return System.Text.Encoding.UTF7;case 65001:return System.Text.Encoding.UTF8;case 12e3:return System.Text.Encoding.UTF32}throw new System.NotSupportedException.ctor},GetEncoding$1:function(e){switch(e){case"utf-16":return System.Text.Encoding.Unicode;case"us-ascii":return System.Text.Encoding.ASCII;case"utf-16BE":return System.Text.Encoding.BigEndianUnicode;case"utf-7":return System.Text.Encoding.UTF7;case"utf-8":return System.Text.Encoding.UTF8;case"utf-32":return System.Text.Encoding.UTF32}throw new System.NotSupportedException.ctor},GetEncodings:function(){if(null!=System.Text.Encoding._encodings)return System.Text.Encoding._encodings;System.Text.Encoding._encodings=System.Array.init(6,null,System.Text.EncodingInfo);var e=System.Text.Encoding._encodings;return e[System.Array.index(0,e)]=new System.Text.EncodingInfo(20127,"us-ascii","US-ASCII"),e[System.Array.index(1,e)]=new System.Text.EncodingInfo(1200,"utf-16","Unicode"),e[System.Array.index(2,e)]=new System.Text.EncodingInfo(1201,"utf-16BE","Unicode (Big-Endian)"),e[System.Array.index(3,e)]=new System.Text.EncodingInfo(65e3,"utf-7","Unicode (UTF-7)"),e[System.Array.index(4,e)]=new System.Text.EncodingInfo(65001,"utf-8","Unicode (UTF-8)"),e[System.Array.index(5,e)]=new System.Text.EncodingInfo(1200,"utf-32","Unicode (UTF-32)"),e}}},fields:{_hasError:!1,fallbackCharacter:0},props:{CodePage:{get:function(){return 0}},EncodingName:{get:function(){return null}}},ctors:{init:function(){this.fallbackCharacter=63}},methods:{Encode$1:function(e,t,n){return this.Encode$3(System.String.fromCharArray(e,t,n),null,0,{})},Encode$5:function(e,t,n,i,r){var s={};return this.Encode$3(e.substr(t,n),i,r,s),s.v},Encode$4:function(e,t,n,i,r){var s={};return this.Encode$3(System.String.fromCharArray(e,t,n),i,r,s),s.v},Encode:function(e){return this.Encode$3(System.String.fromCharArray(e),null,0,{})},Encode$2:function(e){return this.Encode$3(e,null,0,{})},Decode$1:function(e,t,n){return this.Decode$2(e,t,n,null,0)},Decode:function(e){return this.Decode$2(e,0,e.length,null,0)},GetByteCount:function(e){return this.GetByteCount$1(e,0,e.length)},GetByteCount$2:function(e){return this.Encode$2(e).length},GetByteCount$1:function(e,t,n){return this.Encode$1(e,t,n).length},GetBytes:function(e){return this.GetBytes$1(e,0,e.length)},GetBytes$1:function(e,t,n){return this.Encode$2(System.String.fromCharArray(e,t,n))},GetBytes$3:function(e,t,n,i,r){return this.Encode$4(e,t,n,i,r)},GetBytes$2:function(e){return this.Encode$2(e)},GetBytes$4:function(e,t,n,i,r){return this.Encode$5(e,t,n,i,r)},GetCharCount:function(e){return this.Decode(e).length},GetCharCount$1:function(e,t,n){return this.Decode$1(e,t,n).length},GetChars:function(e){e=this.Decode(e);return System.String.toCharArray(e,0,e.length)},GetChars$1:function(e,t,n){n=this.Decode$1(e,t,n);return System.String.toCharArray(n,0,n.length)},GetChars$2:function(e,t,n,i,r){var n=this.Decode$1(e,t,n),s=System.String.toCharArray(n,0,n.length);if(i.length<(s.length+r|0))throw new System.ArgumentException.$ctor3(null,"chars");for(var o=0;o<s.length;o=o+1|0)i[System.Array.index(r+o|0,i)]=s[System.Array.index(o,s)];return s.length},GetString:function(e){return this.Decode(e)},GetString$1:function(e,t,n){return this.Decode$1(e,t,n)}}}),Bridge.define("System.Text.ASCIIEncoding",{inherits:[System.Text.Encoding],props:{CodePage:{get:function(){return 20127}},EncodingName:{get:function(){return"US-ASCII"}}},methods:{Encode$3:function(e,t,n,i){var r=null!=t;r||(t=System.Array.init(0,0,System.Byte));for(var s=0,o=0;o<e.length;o=o+1|0){var a=e.charCodeAt(o),a=255&(a<=127?a:this.fallbackCharacter);if(r){if((o+n|0)>=t.length)throw new System.ArgumentException.$ctor1("bytes");t[System.Array.index(o+n|0,t)]=a}else t.push(a);s=s+1|0}return i.v=s,r?null:t},Decode$2:function(e,t,n,i,r){for(var s=t,o="",a=s+n|0;s<a;s=s+1|0)var u=e[System.Array.index(s,e)],o=127<u?(o||"")+String.fromCharCode(this.fallbackCharacter):(o||"")+(String.fromCharCode(u)||"");return o},GetMaxByteCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("charCount");e=System.Int64(e).add(System.Int64(1));if(e.gt(System.Int64(2147483647)))throw new System.ArgumentOutOfRangeException.$ctor1("charCount");return System.Int64.clip32(e)},GetMaxCharCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("byteCount");e=System.Int64(e);if(e.gt(System.Int64(2147483647)))throw new System.ArgumentOutOfRangeException.$ctor1("byteCount");return System.Int64.clip32(e)}}}),Bridge.define("System.Text.EncodingInfo",{props:{CodePage:0,Name:null,DisplayName:null},ctors:{ctor:function(e,t,n){this.$initialize(),this.CodePage=e,this.Name=t,this.DisplayName=null!=n?n:t}},methods:{GetEncoding:function(){return System.Text.Encoding.GetEncoding(this.CodePage)},getHashCode:function(){return this.CodePage},equals:function(e){e=Bridge.as(e,System.Text.EncodingInfo);return System.Nullable.eq(this.CodePage,null!=e?e.CodePage:null)}}}),Bridge.define("System.Text.UnicodeEncoding",{inherits:[System.Text.Encoding],fields:{bigEndian:!1,byteOrderMark:!1,throwOnInvalid:!1},props:{CodePage:{get:function(){return this.bigEndian?1201:1200}},EncodingName:{get:function(){return this.bigEndian?"Unicode (Big-Endian)":"Unicode"}}},ctors:{ctor:function(){System.Text.UnicodeEncoding.$ctor1.call(this,!1,!0)},$ctor1:function(e,t){System.Text.UnicodeEncoding.$ctor2.call(this,e,t,!1)},$ctor2:function(e,t,n){this.$initialize(),System.Text.Encoding.ctor.call(this),this.bigEndian=e,this.byteOrderMark=t,this.throwOnInvalid=n,this.fallbackCharacter=65533}},methods:{Encode$3:function(e,t,n,i){function r(e){if(o){if(n>=t.length)throw new System.ArgumentException.$ctor1("bytes");t[System.Array.index(Bridge.identity(n,n=n+1|0),t)]=e}else t.push(e);a=a+1|0}function s(e,t){r(e),r(t)}var o=null!=t,a=0,u=0,l=this.fallbackCharacter,c=W.$.System.Text.UnicodeEncoding.f1,m=Bridge.fn.bind(this,function(){if(this.throwOnInvalid)throw new System.Exception("Invalid character in UTF16 text");s(255&l,l>>8&255)});o||(t=System.Array.init(0,0,System.Byte)),this.bigEndian&&(l=c(l));for(var y=0;y<e.length;y=y+1|0){var h,d=e.charCodeAt(y);if(0!==u){if(56320<=d&&d<=57343){this.bigEndian&&(u=c(u),d=c(d)),s(255&u,u>>8&255),s(255&d,d>>8&255),u=0;continue}m(),u=0}55296<=d&&d<=56319?u=d:56320<=d&&d<=57343?(m(),u=0):d<65536?(this.bigEndian&&(d=c(d)),s(255&d,d>>8&255)):d<=1114111?(h=65535&(1023&(d-=65536)|56320),d=65535&(d>>10&1023|55296),this.bigEndian&&(d=c(d),h=c(h)),s(255&d,d>>8&255),s(255&h,h>>8&255)):m()}return 0!==u&&m(),i.v=a,o?null:t},Decode$2:function(t,e,n,i,r){var s=e,o="",a=s+n|0;this._hasError=!1;for(var u=Bridge.fn.bind(this,function(){if(this.throwOnInvalid)throw new System.Exception("Invalid character in UTF16 text");o=(o||"")+String.fromCharCode(this.fallbackCharacter)}),l=W.$.System.Text.UnicodeEncoding.f2,c=Bridge.fn.bind(this,function(){if(a<(s+2|0))return s=s+2|0,null;var e=65535&(t[System.Array.index(Bridge.identity(s,s=s+1|0),t)]<<8|t[System.Array.index(Bridge.identity(s,s=s+1|0),t)]);return this.bigEndian||(e=l(e)),e});s<a;){var m,y,h=c();System.Nullable.hasValue(h)?System.Nullable.lt(h,55296)||System.Nullable.gt(h,57343)?o=(o||"")+(System.String.fromCharCode(System.Nullable.getValue(h))||""):System.Nullable.gte(h,55296)&&System.Nullable.lte(h,56319)?(m=a<=s,y=c(),m?(u(),this._hasError=!0):System.Nullable.hasValue(y)?System.Nullable.gte(y,56320)&&System.Nullable.lte(y,57343)?(h=System.Nullable.band(h,1023),y=System.Nullable.band(y,1023),y=Bridge.Int.clip32(System.Nullable.add(System.Nullable.bor(System.Nullable.sl(h,10),y),65536)),o=(o||"")+(System.String.fromCharCode(System.Nullable.getValue(y))||"")):(u(),s=s-2|0):(u(),u())):u():(u(),this._hasError=!0)}return o},GetMaxByteCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("charCount");e=System.Int64(e).add(System.Int64(1));if((e=e.shl(1)).gt(System.Int64(2147483647)))throw new System.ArgumentOutOfRangeException.$ctor1("charCount");return System.Int64.clip32(e)},GetMaxCharCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("byteCount");e=System.Int64(e>>1).add(System.Int64(1&e)).add(System.Int64(1));if(e.gt(System.Int64(2147483647)))throw new System.ArgumentOutOfRangeException.$ctor1("byteCount");return System.Int64.clip32(e)}}}),Bridge.ns("System.Text.UnicodeEncoding",W.$),Bridge.apply(W.$.System.Text.UnicodeEncoding,{f1:function(e){return 65535&((255&e)<<8|e>>8&255)},f2:function(e){return 65535&((255&e)<<8|e>>8&255)}}),Bridge.define("System.Text.UTF32Encoding",{inherits:[System.Text.Encoding],fields:{bigEndian:!1,byteOrderMark:!1,throwOnInvalid:!1},props:{CodePage:{get:function(){return this.bigEndian?1201:1200}},EncodingName:{get:function(){return this.bigEndian?"Unicode (UTF-32 Big-Endian)":"Unicode (UTF-32)"}}},ctors:{ctor:function(){System.Text.UTF32Encoding.$ctor2.call(this,!1,!0,!1)},$ctor1:function(e,t){System.Text.UTF32Encoding.$ctor2.call(this,e,t,!1)},$ctor2:function(e,t,n){this.$initialize(),System.Text.Encoding.ctor.call(this),this.bigEndian=e,this.byteOrderMark=t,this.throwOnInvalid=n,this.fallbackCharacter=65533}},methods:{ToCodePoints:function(e){for(var t=0,n=System.Array.init(0,0,System.Char),i=Bridge.fn.bind(this,function(){if(this.throwOnInvalid)throw new System.Exception("Invalid character in UTF32 text");n.push(this.fallbackCharacter)}),r=0;r<e.length;r=r+1|0){var s,o=e.charCodeAt(r);0!==t?(56320<=o&&o<=57343?(s=o,s=(Bridge.Int.mul(t-55296|0,1024)+65536|0)+(s-56320|0)|0,n.push(s)):(i(),r=r-1|0),t=0):55296<=o&&o<=56319?t=o:56320<=o&&o<=57343?i():n.push(o)}return 0!==t&&i(),n},Encode$3:function(e,t,n,i){function r(e){if(s){if(n>=t.length)throw new System.ArgumentException.$ctor1("bytes");t[System.Array.index(Bridge.identity(n,n=n+1|0),t)]=e}else t.push(e);o=o+1|0}var s=null!=t,o=0,a=Bridge.fn.bind(this,function(e){var t=System.Array.init(4,0,System.Byte);t[System.Array.index(0,t)]=(255&e)>>>0,t[System.Array.index(1,t)]=(65280&e)>>>0>>>8,t[System.Array.index(2,t)]=(16711680&e)>>>0>>>16,t[System.Array.index(3,t)]=(4278190080&e)>>>0>>>24,this.bigEndian&&t.reverse(),r(t[System.Array.index(0,t)]),r(t[System.Array.index(1,t)]),r(t[System.Array.index(2,t)]),r(t[System.Array.index(3,t)])});s||(t=System.Array.init(0,0,System.Byte));for(var u=this.ToCodePoints(e),l=0;l<u.length;l=l+1|0)a(u[System.Array.index(l,u)]);return i.v=o,s?null:t},Decode$2:function(s,e,t,n,i){var o=e,r="",a=o+t|0;this._hasError=!1;for(var u=Bridge.fn.bind(this,function(){if(this.throwOnInvalid)throw new System.Exception("Invalid character in UTF32 text");r=(r||"")+(String.fromCharCode(this.fallbackCharacter)||"")}),l=Bridge.fn.bind(this,function(){if(a<(o+4|0))return o=o+4|0,null;var e,t=s[System.Array.index(Bridge.identity(o,o=o+1|0),s)],n=s[System.Array.index(Bridge.identity(o,o=o+1|0),s)],i=s[System.Array.index(Bridge.identity(o,o=o+1|0),s)],r=s[System.Array.index(Bridge.identity(o,o=o+1|0),s)];return this.bigEndian&&(e=n,n=i,i=e,e=t,t=r,r=e),r<<24|i<<16|n<<8|t});o<a;){var c=l();null!=c?System.Nullable.lt(c,65536)||System.Nullable.gt(c,1114111)?System.Nullable.lt(c,0)||System.Nullable.gt(c,1114111)||System.Nullable.gte(c,55296)&&System.Nullable.lte(c,57343)?u():r=(r||"")+(String.fromCharCode(c)||""):r=((r=(r||"")+(String.fromCharCode(Bridge.Int.clipu32(System.Nullable.add(Bridge.Int.clipu32(Bridge.Int.div(Bridge.Int.clipu32(System.Nullable.sub(c,65536)),1024)),55296)))||""))||"")+(String.fromCharCode(Bridge.Int.clipu32(System.Nullable.add(System.Nullable.mod(c,1024),56320)))||""):(u(),this._hasError=!0)}return r},GetMaxByteCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("charCount");e=System.Int64(e).add(System.Int64(1));if((e=e.mul(System.Int64(4))).gt(System.Int64(2147483647)))throw new System.ArgumentOutOfRangeException.$ctor1("charCount");return System.Int64.clip32(e)},GetMaxCharCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("byteCount");e=2+(0|Bridge.Int.div(e,2))|0;if(2147483647<e)throw new System.ArgumentOutOfRangeException.$ctor1("byteCount");return e}}}),Bridge.define("System.Text.UTF7Encoding",{inherits:[System.Text.Encoding],statics:{methods:{Escape:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}}},fields:{allowOptionals:!1},props:{CodePage:{get:function(){return 65e3}},EncodingName:{get:function(){return"Unicode (UTF-7)"}}},ctors:{ctor:function(){System.Text.UTF7Encoding.$ctor1.call(this,!1)},$ctor1:function(e){this.$initialize(),System.Text.Encoding.ctor.call(this),this.allowOptionals=e,this.fallbackCharacter=65533}},methods:{Encode$3:function(e,t,n,i){var r="A-Za-z0-9"+(System.Text.UTF7Encoding.Escape("'(),-./:?")||""),s=W.$.System.Text.UTF7Encoding.f1,o=System.Text.UTF7Encoding.Escape('!"#$%&*;<=>@[]^_`{|}'),a=System.Text.UTF7Encoding.Escape(" \r\n\t");e=e.replace(new RegExp("[^"+a+r+(this.allowOptionals?o:"")+"]+","g"),function(e){return"+"+("+"===e?"":s(e))+"-"});var u=System.String.toCharArray(e,0,e.length);if(null==t)return i.v=u.length,u;var l=0;if(u.length>(t.length-n|0))throw new System.ArgumentException.$ctor1("bytes");for(var c=0;c<u.length;c=c+1|0)t[System.Array.index(c+n|0,t)]=u[System.Array.index(c,u)],l=l+1|0;return i.v=l,null},Decode$2:function(e,t,n,i,r){var s=W.$.System.Text.UTF7Encoding.f2;return System.String.fromCharArray(e,t,n).replace(/\+([A-Za-z0-9\/]*)-?/gi,function(e,t){return""===t?"+-"==e?"+":"":function(e){for(var t=s(e),n=System.Array.init(0,0,System.Char),i=0;i<t.length;)n.push(65535&(t[System.Array.index(Bridge.identity(i,i=i+1|0),t)]<<8|t[System.Array.index(Bridge.identity(i,i=i+1|0),t)]));return System.String.fromCharArray(n)}(t)})},GetMaxByteCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("charCount");e=System.Int64(e).mul(System.Int64(3)).add(System.Int64(2));if(e.gt(System.Int64(2147483647)))throw new System.ArgumentOutOfRangeException.$ctor1("charCount");return System.Int64.clip32(e)},GetMaxCharCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("byteCount");return 0===e&&(e=1),0|e}}}),Bridge.ns("System.Text.UTF7Encoding",W.$),Bridge.apply(W.$.System.Text.UTF7Encoding,{f1:function(e){for(var t=System.Array.init(Bridge.Int.mul(e.length,2),0,System.Byte),n=0,i=0;i<e.length;i=i+1|0){var r=e.charCodeAt(i);t[System.Array.index(Bridge.identity(n,n=n+1|0),t)]=r>>8,t[System.Array.index(Bridge.identity(n,n=n+1|0),t)]=255&r}return System.Convert.toBase64String(t,null,null,null).replace(/=+$/,"")},f2:function(e){try{if("undefined"==typeof window)throw new System.Exception;var t=window.atob(e),n=t.length,i=System.Array.init(n,0,System.Char);if(1===n&&0===t.charCodeAt(0))return System.Array.init(0,0,System.Char);for(var r=0;r<n;r=r+1|0)i[System.Array.index(r,i)]=t.charCodeAt(r);return i}catch(e){return e=System.Exception.create(e),System.Array.init(0,0,System.Char)}}}),Bridge.define("System.Text.UTF8Encoding",{inherits:[System.Text.Encoding],fields:{encoderShouldEmitUTF8Identifier:!1,throwOnInvalid:!1},props:{CodePage:{get:function(){return 65001}},EncodingName:{get:function(){return"Unicode (UTF-8)"}}},ctors:{ctor:function(){System.Text.UTF8Encoding.$ctor1.call(this,!1)},$ctor1:function(e){System.Text.UTF8Encoding.$ctor2.call(this,e,!1)},$ctor2:function(e,t){this.$initialize(),System.Text.Encoding.ctor.call(this),this.encoderShouldEmitUTF8Identifier=e,this.throwOnInvalid=t,this.fallbackCharacter=65533}},methods:{Encode$3:function(e,r,s,t){function n(e){for(var t=e.length,n=0;n<t;n=n+1|0){var i=e[System.Array.index(n,e)];if(o){if(s>=r.length)throw new System.ArgumentException.$ctor1("bytes");r[System.Array.index(Bridge.identity(s,s=s+1|0),r)]=i}else r.push(i);a=a+1|0}}var o=null!=r,a=0,i=Bridge.fn.bind(this,W.$.System.Text.UTF8Encoding.f1);o||(r=System.Array.init(0,0,System.Byte));for(var u=0;u<e.length;u=u+1|0){var l,c=e.charCodeAt(u);55296<=c&&c<=56319?56320<=(l=e.charCodeAt(u+1|0))&&l<=57343||(c=i()):56320<=c&&c<=57343&&(c=i()),c<128?n(System.Array.init([c],System.Byte)):c<2048?n(System.Array.init([192|c>>6,128|63&c],System.Byte)):c<55296||57344<=c?n(System.Array.init([224|c>>12,128|c>>6&63,128|63&c],System.Byte)):(u=u+1|0,c=65536+((1023&c)<<10|1023&e.charCodeAt(u))|0,n(System.Array.init([240|c>>18,128|c>>12&63,128|c>>6&63,128|63&c],System.Byte)))}return t.v=a,o?null:r},Decode$2:function(e,t,n,i,r){for(var s=t,o="",a=0,u=this._hasError=!1,l=s+n|0;s<l;s=s+1|0){var c=0,m=0,y=!1,h=e[System.Array.index(s,e)];for(h<=127?c=h:0==(64&h)?y=!0:192==(224&h)?(c=31&h,m=1):224==(240&h)?(c=15&h,m=2):240==(248&h)?(c=7&h,m=3):y=248==(252&h)?(c=3&h,m=4,!0):252==(254&h)?(c=3&h,m=5,!0):(c=h,!1);0<m;){if(l<=(s=s+1|0)){y=!0;break}var d=e[System.Array.index(s,e)],m=m-1|0;if(128!=(192&d)){s=s-1|0,y=!0;break}c=c<<6|63&d}h=null,u=!1;if(y||(a=0<a&&!(56320<=c&&c<=57343)?(y=!0,0):55296<=c&&c<=56319?65535&c:(56320<=c&&c<=57343?u=y=!0:h=System.String.fromCharCode(c),0)),y){if(this.throwOnInvalid)throw new System.Exception("Invalid character in UTF8 text");o=(o||"")+String.fromCharCode(this.fallbackCharacter),this._hasError=!0}else 0===a&&(o=(o||"")+(h||""))}if(0<a||u){if(this.throwOnInvalid)throw new System.Exception("Invalid character in UTF8 text");o=0<o.length&&o.charCodeAt(o.length-1|0)===this.fallbackCharacter?(o||"")+String.fromCharCode(this.fallbackCharacter):(o||"")+(this.fallbackCharacter+this.fallbackCharacter|0),this._hasError=!0}return o},GetMaxByteCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("charCount");e=System.Int64(e).add(System.Int64(1));if((e=e.mul(System.Int64(3))).gt(System.Int64(2147483647)))throw new System.ArgumentOutOfRangeException.$ctor1("charCount");return System.Int64.clip32(e)},GetMaxCharCount:function(e){if(e<0)throw new System.ArgumentOutOfRangeException.$ctor1("byteCount");e=System.Int64(e).add(System.Int64(1));if(e.gt(System.Int64(2147483647)))throw new System.ArgumentOutOfRangeException.$ctor1("byteCount");return System.Int64.clip32(e)}}}),Bridge.ns("System.Text.UTF8Encoding",W.$),Bridge.apply(W.$.System.Text.UTF8Encoding,{f1:function(){if(this.throwOnInvalid)throw new System.Exception("Invalid character in UTF8 text");return this.fallbackCharacter}}),Bridge.define("System.Threading.Timer",{inherits:[System.IDisposable],statics:{fields:{MAX_SUPPORTED_TIMEOUT:0,EXC_LESS:null,EXC_MORE:null,EXC_DISPOSED:null},ctors:{init:function(){this.MAX_SUPPORTED_TIMEOUT=4294967294,this.EXC_LESS="Number must be either non-negative and less than or equal to Int32.MaxValue or -1.",this.EXC_MORE="Time-out interval must be less than 2^32-2.",this.EXC_DISPOSED="The timer has been already disposed."}}},fields:{dueTime:System.Int64(0),period:System.Int64(0),timerCallback:null,state:null,id:null,disposed:!1},alias:["Dispose","System$IDisposable$Dispose"],ctors:{$ctor1:function(e,t,n,i){this.$initialize(),this.TimerSetup(e,t,System.Int64(n),System.Int64(i))},$ctor3:function(e,t,n,i){this.$initialize();n=Bridge.Int.clip64(n.getTotalMilliseconds()),i=Bridge.Int.clip64(i.getTotalMilliseconds());this.TimerSetup(e,t,n,i)},$ctor4:function(e,t,n,i){this.$initialize(),this.TimerSetup(e,t,System.Int64(n),System.Int64(i))},$ctor2:function(e,t,n,i){this.$initialize(),this.TimerSetup(e,t,n,i)},ctor:function(e){this.$initialize();this.TimerSetup(e,this,System.Int64(-1),System.Int64(-1))}},methods:{TimerSetup:function(e,t,n,i){if(this.disposed)throw new System.InvalidOperationException.$ctor1(System.Threading.Timer.EXC_DISPOSED);if(Bridge.staticEquals(e,null))throw new System.ArgumentNullException.$ctor1("TimerCallback");if(n.lt(System.Int64(-1)))throw new System.ArgumentOutOfRangeException.$ctor4("dueTime",System.Threading.Timer.EXC_LESS);if(i.lt(System.Int64(-1)))throw new System.ArgumentOutOfRangeException.$ctor4("period",System.Threading.Timer.EXC_LESS);if(n.gt(System.Int64(System.Threading.Timer.MAX_SUPPORTED_TIMEOUT)))throw new System.ArgumentOutOfRangeException.$ctor4("dueTime",System.Threading.Timer.EXC_MORE);if(i.gt(System.Int64(System.Threading.Timer.MAX_SUPPORTED_TIMEOUT)))throw new System.ArgumentOutOfRangeException.$ctor4("period",System.Threading.Timer.EXC_MORE);return this.dueTime=n,this.period=i,this.state=t,this.timerCallback=e,this.RunTimer(this.dueTime)},HandleCallback:function(){var e;this.disposed||Bridge.staticEquals(this.timerCallback,null)||(e=this.id,this.timerCallback(this.state),System.Nullable.eq(this.id,e)&&this.RunTimer(this.period,!1))},RunTimer:function(e,t){if(void 0===t&&(t=!0),t&&this.disposed)throw new System.InvalidOperationException.$ctor1(System.Threading.Timer.EXC_DISPOSED);if(!e.ne(System.Int64(-1))||this.disposed)return!1;e=e.toNumber();return this.id=Bridge.global.setTimeout(Bridge.fn.cacheBind(this,this.HandleCallback),e),!0},Change:function(e,t){return this.ChangeTimer(System.Int64(e),System.Int64(t))},Change$2:function(e,t){return this.ChangeTimer(Bridge.Int.clip64(e.getTotalMilliseconds()),Bridge.Int.clip64(t.getTotalMilliseconds()))},Change$3:function(e,t){return this.ChangeTimer(System.Int64(e),System.Int64(t))},Change$1:function(e,t){return this.ChangeTimer(e,t)},ChangeTimer:function(e,t){return this.ClearTimeout(),this.TimerSetup(this.timerCallback,this.state,e,t)},ClearTimeout:function(){System.Nullable.hasValue(this.id)&&(Bridge.global.clearTimeout(System.Nullable.getValue(this.id)),this.id=null)},Dispose:function(){this.ClearTimeout(),this.disposed=!0}}}),Bridge.define("System.Threading.Tasks.TaskCanceledException",{inherits:[System.OperationCanceledException],fields:{_canceledTask:null},props:{Task:{get:function(){return this._canceledTask}}},ctors:{ctor:function(){this.$initialize(),System.OperationCanceledException.$ctor1.call(this,"A task was canceled.")},$ctor1:function(e){this.$initialize(),System.OperationCanceledException.$ctor1.call(this,e)},$ctor2:function(e,t){this.$initialize(),System.OperationCanceledException.$ctor2.call(this,e,t)},$ctor3:function(e){this.$initialize(),System.OperationCanceledException.$ctor4.call(this,"A task was canceled.",new System.Threading.CancellationToken),this._canceledTask=e}}}),Bridge.define("System.Threading.Tasks.TaskSchedulerException",{inherits:[System.Exception],ctors:{ctor:function(){this.$initialize(),System.Exception.ctor.call(this,"An exception was thrown by a TaskScheduler.")},$ctor2:function(e){this.$initialize(),System.Exception.ctor.call(this,e)},$ctor1:function(e){this.$initialize(),System.Exception.ctor.call(this,"An exception was thrown by a TaskScheduler.",e)},$ctor3:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e,t)}}}),Bridge.define("System.Version",{inherits:function(){return[System.ICloneable,System.IComparable$1(System.Version),System.IEquatable$1(System.Version)]},statics:{fields:{ZERO_CHAR_VALUE:0,separatorsArray:0},ctors:{init:function(){this.ZERO_CHAR_VALUE=48,this.separatorsArray=46}},methods:{appendPositiveNumber:function(e,t){for(var n,i=t.getLength();n=e%10,e=0|Bridge.Int.div(e,10),t.insert(i,String.fromCharCode(65535&(System.Version.ZERO_CHAR_VALUE+n|0))),0<e;);},parse:function(e){if(null==e)throw new System.ArgumentNullException.$ctor1("input");var t={v:new System.Version.VersionResult};if(t.v.init("input",!0),!System.Version.tryParseVersion(e,t))throw t.v.getVersionParseException();return t.v.m_parsedVersion},tryParse:function(e,t){var n={v:new System.Version.VersionResult};n.v.init("input",!1);e=System.Version.tryParseVersion(e,n);return t.v=n.v.m_parsedVersion,e},tryParseVersion:function(e,t){var n={},i={},r={},s={};if(null==e)return t.v.setFailure(System.Version.ParseFailureKind.ArgumentNullException),!1;var o=System.String.split(e,[System.Version.separatorsArray].map(function(e){return String.fromCharCode(e)})),e=o.length;if(e<2||4<e)return t.v.setFailure(System.Version.ParseFailureKind.ArgumentException),!1;if(!System.Version.tryParseComponent(o[System.Array.index(0,o)],"version",t,n))return!1;if(!System.Version.tryParseComponent(o[System.Array.index(1,o)],"version",t,i))return!1;if(0<(e=e-2|0)){if(!System.Version.tryParseComponent(o[System.Array.index(2,o)],"build",t,r))return!1;if(0<(e=e-1|0)){if(!System.Version.tryParseComponent(o[System.Array.index(3,o)],"revision",t,s))return!1;t.v.m_parsedVersion=new System.Version.$ctor3(n.v,i.v,r.v,s.v)}else t.v.m_parsedVersion=new System.Version.$ctor2(n.v,i.v,r.v)}else t.v.m_parsedVersion=new System.Version.$ctor1(n.v,i.v);return!0},tryParseComponent:function(e,t,n,i){return System.Int32.tryParse(e,i)?!(i.v<0)||(n.v.setFailure$1(System.Version.ParseFailureKind.ArgumentOutOfRangeException,t),!1):(n.v.setFailure$1(System.Version.ParseFailureKind.FormatException,e),!1)},op_Equality:function(e,t){return Bridge.referenceEquals(e,null)?Bridge.referenceEquals(t,null):e.equalsT(t)},op_Inequality:function(e,t){return!System.Version.op_Equality(e,t)},op_LessThan:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("v1");return e.compareTo(t)<0},op_LessThanOrEqual:function(e,t){if(null==e)throw new System.ArgumentNullException.$ctor1("v1");return e.compareTo(t)<=0},op_GreaterThan:function(e,t){return System.Version.op_LessThan(t,e)},op_GreaterThanOrEqual:function(e,t){return System.Version.op_LessThanOrEqual(t,e)}}},fields:{_Major:0,_Minor:0,_Build:0,_Revision:0},props:{Major:{get:function(){return this._Major}},Minor:{get:function(){return this._Minor}},Build:{get:function(){return this._Build}},Revision:{get:function(){return this._Revision}},MajorRevision:{get:function(){return Bridge.Int.sxs(this._Revision>>16&65535)}},MinorRevision:{get:function(){return Bridge.Int.sxs(65535&this._Revision)}}},alias:["clone","System$ICloneable$clone","compareTo",["System$IComparable$1$System$Version$compareTo","System$IComparable$1$compareTo"],"equalsT","System$IEquatable$1$System$Version$equalsT"],ctors:{init:function(){this._Build=-1,this._Revision=-1},$ctor3:function(e,t,n,i){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException.$ctor4("major","Cannot be < 0");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("minor","Cannot be < 0");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("build","Cannot be < 0");if(i<0)throw new System.ArgumentOutOfRangeException.$ctor4("revision","Cannot be < 0");this._Major=e,this._Minor=t,this._Build=n,this._Revision=i},$ctor2:function(e,t,n){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException.$ctor4("major","Cannot be < 0");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("minor","Cannot be < 0");if(n<0)throw new System.ArgumentOutOfRangeException.$ctor4("build","Cannot be < 0");this._Major=e,this._Minor=t,this._Build=n},$ctor1:function(e,t){if(this.$initialize(),e<0)throw new System.ArgumentOutOfRangeException.$ctor4("major","Cannot be < 0");if(t<0)throw new System.ArgumentOutOfRangeException.$ctor4("minor","Cannot be < 0");this._Major=e,this._Minor=t},$ctor4:function(e){this.$initialize();e=System.Version.parse(e);this._Major=e.Major,this._Minor=e.Minor,this._Build=e.Build,this._Revision=e.Revision},ctor:function(){this.$initialize(),this._Major=0,this._Minor=0}},methods:{clone:function(){var e=new System.Version.ctor;return e._Major=this._Major,e._Minor=this._Minor,e._Build=this._Build,e._Revision=this._Revision,e},compareTo$1:function(e){if(null==e)return 1;e=Bridge.as(e,System.Version);if(System.Version.op_Equality(e,null))throw new System.ArgumentException.$ctor1("version should be of System.Version type");return this._Major!==e._Major?this._Major>e._Major?1:-1:this._Minor!==e._Minor?this._Minor>e._Minor?1:-1:this._Build!==e._Build?this._Build>e._Build?1:-1:this._Revision!==e._Revision?this._Revision>e._Revision?1:-1:0},compareTo:function(e){return System.Version.op_Equality(e,null)?1:this._Major!==e._Major?this._Major>e._Major?1:-1:this._Minor!==e._Minor?this._Minor>e._Minor?1:-1:this._Build!==e._Build?this._Build>e._Build?1:-1:this._Revision!==e._Revision?this._Revision>e._Revision?1:-1:0},equals:function(e){return this.equalsT(Bridge.as(e,System.Version))},equalsT:function(e){return!System.Version.op_Equality(e,null)&&(this._Major===e._Major&&this._Minor===e._Minor&&this._Build===e._Build&&this._Revision===e._Revision)},getHashCode:function(){var e=0,e=0|(15&this._Major)<<28;return e|=(255&this._Minor)<<20,e|=(255&this._Build)<<12,e|=4095&this._Revision},toString:function(){return-1===this._Build?this.toString$1(2):-1===this._Revision?this.toString$1(3):this.toString$1(4)},toString$1:function(e){var t;switch(e){case 0:return"";case 1:return Bridge.toString(this._Major);case 2:return t=new System.Text.StringBuilder,System.Version.appendPositiveNumber(this._Major,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Minor,t),t.toString();default:if(-1===this._Build)throw new System.ArgumentException.$ctor3("Build should be > 0 if fieldCount > 2","fieldCount");if(3===e)return t=new System.Text.StringBuilder,System.Version.appendPositiveNumber(this._Major,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Minor,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Build,t),t.toString();if(-1===this._Revision)throw new System.ArgumentException.$ctor3("Revision should be > 0 if fieldCount > 3","fieldCount");if(4===e)return t=new System.Text.StringBuilder,System.Version.appendPositiveNumber(this._Major,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Minor,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Build,t),t.append(String.fromCharCode(46)),System.Version.appendPositiveNumber(this._Revision,t),t.toString();throw new System.ArgumentException.$ctor3("Should be < 5","fieldCount")}}}}),Bridge.define("System.Version.ParseFailureKind",{$kind:"nested enum",statics:{fields:{ArgumentNullException:0,ArgumentException:1,ArgumentOutOfRangeException:2,FormatException:3}}}),Bridge.define("System.Version.VersionResult",{$kind:"nested struct",statics:{methods:{getDefaultValue:function(){return new System.Version.VersionResult}}},fields:{m_parsedVersion:null,m_failure:0,m_exceptionArgument:null,m_argumentName:null,m_canThrow:!1},ctors:{ctor:function(){this.$initialize()}},methods:{init:function(e,t){this.m_canThrow=t,this.m_argumentName=e},setFailure:function(e){this.setFailure$1(e,"")},setFailure$1:function(e,t){if(this.m_failure=e,this.m_exceptionArgument=t,this.m_canThrow)throw this.getVersionParseException()},getVersionParseException:function(){switch(this.m_failure){case System.Version.ParseFailureKind.ArgumentNullException:return new System.ArgumentNullException.$ctor1(this.m_argumentName);case System.Version.ParseFailureKind.ArgumentException:return new System.ArgumentException.$ctor1("VersionString");case System.Version.ParseFailureKind.ArgumentOutOfRangeException:return new System.ArgumentOutOfRangeException.$ctor4(this.m_exceptionArgument,"Cannot be < 0");case System.Version.ParseFailureKind.FormatException:try{System.Int32.parse(this.m_exceptionArgument)}catch(e){if(e=System.Exception.create(e),Bridge.is(e,System.FormatException))return e;if(Bridge.is(e,System.OverflowException))return e;throw e}return new System.FormatException.$ctor1("InvalidString");default:return new System.ArgumentException.$ctor1("VersionString")}},getHashCode:function(){return Bridge.addHash([5139482776,this.m_parsedVersion,this.m_failure,this.m_exceptionArgument,this.m_argumentName,this.m_canThrow])},equals:function(e){return!!Bridge.is(e,System.Version.VersionResult)&&(Bridge.equals(this.m_parsedVersion,e.m_parsedVersion)&&Bridge.equals(this.m_failure,e.m_failure)&&Bridge.equals(this.m_exceptionArgument,e.m_exceptionArgument)&&Bridge.equals(this.m_argumentName,e.m_argumentName)&&Bridge.equals(this.m_canThrow,e.m_canThrow))},$clone:function(e){e=e||new System.Version.VersionResult;return e.m_parsedVersion=this.m_parsedVersion,e.m_failure=this.m_failure,e.m_exceptionArgument=this.m_exceptionArgument,e.m_argumentName=this.m_argumentName,e.m_canThrow=this.m_canThrow,e}}}),"function"==typeof define&&define.amd?define("bridge",[],function(){return Bridge}):"undefined"!=typeof module&&module.exports&&(module.exports=Bridge)}(this),Bridge.assembly("Newtonsoft.Json",function($asm,globals){"use strict";Bridge.define("Newtonsoft.Json.DefaultValueHandling",{$kind:"enum",statics:{fields:{Include:0,Ignore:1,Populate:2,IgnoreAndPopulate:3}},$flags:!0}),Bridge.define("Newtonsoft.Json.Formatting",{$kind:"enum",statics:{fields:{None:0,Indented:1}}}),Bridge.define("Newtonsoft.Json.JsonConstructorAttribute",{inherits:[System.Attribute]}),Bridge.define("Newtonsoft.Json.JsonException",{inherits:[System.Exception],ctors:{ctor:function(){this.$initialize(),System.Exception.ctor.call(this)},$ctor1:function(e){this.$initialize(),System.Exception.ctor.call(this,e)},$ctor2:function(e,t){this.$initialize(),System.Exception.ctor.call(this,e,t)}}}),Bridge.define("Newtonsoft.Json.JsonIgnoreAttribute",{inherits:[System.Attribute]}),Bridge.define("Newtonsoft.Json.JsonPropertyAttribute",{inherits:[System.Attribute],fields:{_nullValueHandling:null,_defaultValueHandling:null,_objectCreationHandling:null,_typeNameHandling:null,_required:null,_order:null},props:{NullValueHandling:{get:function(){var e=this._nullValueHandling;return null!=e?e:0},set:function(e){this._nullValueHandling=e}},DefaultValueHandling:{get:function(){var e=this._defaultValueHandling;return null!=e?e:0},set:function(e){this._defaultValueHandling=e}},ObjectCreationHandling:{get:function(){var e=this._objectCreationHandling;return null!=e?e:0},set:function(e){this._objectCreationHandling=e}},TypeNameHandling:{get:function(){var e=this._typeNameHandling;return null!=e?e:0},set:function(e){this._typeNameHandling=e}},Required:{get:function(){var e=this._required;return null!=e?e:Newtonsoft.Json.Required.Default},set:function(e){this._required=e}},Order:{get:function(){var e=this._order;return null!=e?e:Bridge.getDefaultValue(System.Int32)},set:function(e){this._order=e}},PropertyName:null},ctors:{ctor:function(){this.$initialize(),System.Attribute.ctor.call(this)},$ctor1:function(e){this.$initialize(),System.Attribute.ctor.call(this),this.PropertyName=e}}}),Bridge.define("Newtonsoft.Json.JsonSerializerSettings",{statics:{fields:{DefaultNullValueHandling:0,DefaultTypeNameHandling:0},ctors:{init:function(){this.DefaultNullValueHandling=Newtonsoft.Json.NullValueHandling.Include,this.DefaultTypeNameHandling=Newtonsoft.Json.TypeNameHandling.None}}},fields:{_defaultValueHandling:null,_typeNameHandling:null,_nullValueHandling:null,_objectCreationHandling:null},props:{NullValueHandling:{get:function(){var e=this._nullValueHandling;return null!=e?e:Newtonsoft.Json.JsonSerializerSettings.DefaultNullValueHandling},set:function(e){this._nullValueHandling=e}},ObjectCreationHandling:{get:function(){var e=this._objectCreationHandling;return null!=e?e:0},set:function(e){this._objectCreationHandling=e}},DefaultValueHandling:{get:function(){var e=this._defaultValueHandling;return null!=e?e:0},set:function(e){this._defaultValueHandling=e}},TypeNameHandling:{get:function(){var e=this._typeNameHandling;return null!=e?e:Newtonsoft.Json.JsonSerializerSettings.DefaultTypeNameHandling},set:function(e){this._typeNameHandling=e}},ContractResolver:null,SerializationBinder:null}}),Bridge.define("Newtonsoft.Json.NullValueHandling",{$kind:"enum",statics:{fields:{Include:0,Ignore:1}}}),Bridge.define("Newtonsoft.Json.ObjectCreationHandling",{$kind:"enum",statics:{fields:{Auto:0,Reuse:1,Replace:2}}}),Bridge.define("Newtonsoft.Json.Required",{$kind:"enum",statics:{fields:{Default:0,AllowNull:1,Always:2,DisallowNull:3}}}),Bridge.define("Newtonsoft.Json.Serialization.IContractResolver",{$kind:"interface"}),Bridge.define("Newtonsoft.Json.Serialization.ISerializationBinder",{$kind:"interface"}),Bridge.define("Newtonsoft.Json.TypeNameHandling",{$kind:"enum",statics:{fields:{None:0,Objects:1,Arrays:2,All:3,Auto:4}},$flags:!0}),Bridge.define("Newtonsoft.Json.Utils.AssemblyVersion",{statics:{fields:{version:null,compiler:null},ctors:{init:function(){this.version="1.17.0",this.compiler="17.10.0"}}}}),Bridge.define("Newtonsoft.Json.JsonSerializationException",{inherits:[Newtonsoft.Json.JsonException],ctors:{ctor:function(){this.$initialize(),Newtonsoft.Json.JsonException.ctor.call(this)},$ctor1:function(e){this.$initialize(),Newtonsoft.Json.JsonException.$ctor1.call(this,e)},$ctor2:function(e,t){this.$initialize(),Newtonsoft.Json.JsonException.$ctor2.call(this,e,t)}}}),Bridge.define("Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver",{inherits:[Newtonsoft.Json.Serialization.IContractResolver]}),Bridge.define("Newtonsoft.Json.JsonConvert",{statics:{methods:{stringify:function(e,t,n){return t===Newtonsoft.Json.Formatting.Indented?JSON.stringify(e,null,"  "):JSON.stringify(e)},parse:function(value){try{return JSON.parse(value)}catch(e){if(e instanceof SyntaxError)try{return eval("("+value+")")}catch(e){throw new Newtonsoft.Json.JsonException(e.message)}throw new Newtonsoft.Json.JsonException(e.message)}},getEnumerableElementType:function(e){var t;if(System.String.startsWith(e.$$name,"System.Collections.Generic.IEnumerable"))t=e;else for(var n=Bridge.Reflection.getInterfaces(e),i=0;i<n.length;i++)if(System.String.startsWith(n[i].$$name,"System.Collections.Generic.IEnumerable")){t=n[i];break}return t?Bridge.Reflection.getGenericArguments(t)[0]:null},validateReflectable:function(e){do{var t=e===System.Object||e===Object||e.$literal||"anonymous"===e.$kind,n=!Bridge.getMetadata(e);if(!t&&n)throw Bridge.$jsonGuard&&delete Bridge.$jsonGuard,new System.InvalidOperationException(Bridge.getTypeName(e)+" is not reflectable and cannot be serialized.")}while(e=t?null:Bridge.Reflection.getBaseType(e),!t&&null!=e)},defaultGuard:function(){Bridge.$jsonGuard&&Bridge.$jsonGuard.pop()},getValue:function(e,t){for(var n in t=t.toLowerCase(),e)if(n.toLowerCase()==t)return e[n]},getCacheByType:function(e){for(var t=0;t<Newtonsoft.Json.$cache.length;t++){var n=Newtonsoft.Json.$cache[t];if(n.type===e)return n}var i={type:e};return Newtonsoft.Json.$cache.push(i),i},getMembers:function(e,t){var n=Newtonsoft.Json.JsonConvert.getCacheByType(e);if(n[t])return n[t];var e=Bridge.Reflection.getMembers(e,t,52),i=!1,e=e.map(function(e){var t=System.Attribute.getCustomAttributes(e,Newtonsoft.Json.JsonPropertyAttribute),n=System.Attribute.getCustomAttributes(e,System.ComponentModel.DefaultValueAttribute);return{member:e,attr:t&&0<t.length?t[0]:null,defaultValue:n&&0<n.length?n[0].Value:Bridge.getDefaultValue(e.rt)}}).filter(function(e){return!i&&e.attr&&e.attr.Order&&(i=!0),(e.attr||2===e.member.a)&&0===System.Attribute.getCustomAttributes(e.member,Newtonsoft.Json.JsonIgnoreAttribute).length});return i&&e.sort(function(e,t){return(e.attr&&e.attr.Order||0)-(t.attr&&t.attr.Order||0)}),n[t]=e},preRawProcess:function(e,t,n,i){var r=e.attr,i=r&&null!=r._defaultValueHandling?r._defaultValueHandling:i.DefaultValueHandling,r=r&&r.Required;if(void 0!==n||i!==Newtonsoft.Json.DefaultValueHandling.Populate&&i!==Newtonsoft.Json.DefaultValueHandling.IgnoreAndPopulate||(n=e.defaultValue),(r===Newtonsoft.Json.Required.AllowNull||r===Newtonsoft.Json.Required.Always)&&void 0===n)throw new Newtonsoft.Json.JsonSerializationException("Required property '"+e.member.n+"' not found in JSON.");if(r===Newtonsoft.Json.Required.Always&&null===n)throw new Newtonsoft.Json.JsonSerializationException("Required property '"+e.member.n+"' expects a value but got null.");if(r===Newtonsoft.Json.Required.DisallowNull&&null===n)throw new Newtonsoft.Json.JsonSerializationException("Property '"+e.member.n+"' expects a value but got null.");return{value:n}},preProcess:function(e,t,n,i){var r=e.attr,s=r&&null!=r._defaultValueHandling?r._defaultValueHandling:i.DefaultValueHandling,i=r&&null!=r._nullValueHandling?r._nullValueHandling:i.NullValueHandling;if(null==n&&i===Newtonsoft.Json.NullValueHandling.Ignore)return!1;i=Bridge.unbox(n,!0),e=e.defaultValue;return(null==i||null==e&&!(null==i&&null==e)||!Bridge.equals(i,e)||s!==Newtonsoft.Json.DefaultValueHandling.Ignore&&s!==Newtonsoft.Json.DefaultValueHandling.IgnoreAndPopulate)&&{value:n}},PopulateObject:function(e,t,n,i){n=n||{};var r=Bridge.getType(t),s="string"==typeof e?Newtonsoft.Json.JsonConvert.parse(e):e;if(r.$nullable&&(r=r.$nullableType),null!=s&&"object"==typeof s)if(Bridge.isArray(null,r)){if(void 0!==s.length)for(var o=0;o<s.length;o++)t.push(Newtonsoft.Json.JsonConvert.DeserializeObject(s[o],r.$elementType,n,!0))}else if(Bridge.Reflection.isAssignableFrom(System.Collections.IDictionary,r)){var a,u=System.Collections.Generic.Dictionary$2.getTypeParameters(r),l=u[0]||System.Object,c=u[1]||System.Object;if(Bridge.is(s,System.Collections.IDictionary)){a=System.Linq.Enumerable.from(s.getKeys()).ToArray();for(o=0;o<a.length;o++){var m=a[o];t.setItem(Newtonsoft.Json.JsonConvert.DeserializeObject(m,l,n,!0),Newtonsoft.Json.JsonConvert.DeserializeObject(s.get(m),c,n,!0),!1)}}else for(var y in s)s.hasOwnProperty(y)&&t.setItem(Newtonsoft.Json.JsonConvert.DeserializeObject(y,l,n,!0),Newtonsoft.Json.JsonConvert.DeserializeObject(s[y],c,n,!0),!1)}else if(Bridge.Reflection.isAssignableFrom(System.Collections.IList,r)||Bridge.Reflection.isAssignableFrom(System.Collections.ICollection,r)){var h=System.Collections.Generic.List$1.getElementType(r)||System.Object;Bridge.isArray(s)||(s=s.ToArray?s.ToArray():Bridge.Collections.EnumerableHelpers.ToArray(h,s));for(o=0;o<s.length;o++)t.add(Newtonsoft.Json.JsonConvert.DeserializeObject(s[o],h,n,!0))}else{var d,f,g=n&&Bridge.is(n.ContractResolver,Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver),S=Newtonsoft.Json.JsonConvert.getMembers(r,4),p=Newtonsoft.Json.JsonConvert.getMembers(r,16);for(o=0;o<S.length;o++){var $=(d=S[o]).member;void 0===(e=s[f=d.attr&&d.attr.PropertyName||(g?$.n.charAt(0).toLowerCase()+$.n.substr(1):$.n)])&&(e=Newtonsoft.Json.JsonConvert.getValue(s,f)),void 0===(C=(i||s)[f])&&(C=Newtonsoft.Json.JsonConvert.getValue(i||s,f)),void 0!==(C=(A=Newtonsoft.Json.JsonConvert.preRawProcess(d,i||s,C,n)).value)&&(I=null===e||!1===e||!0===e||"number"==typeof e||"string"==typeof e,E=Bridge.unbox(Bridge.Reflection.fieldAccess($,t)),x=Newtonsoft.Json.JsonConvert.DeserializeObject(e,$.rt,n,!0),!1!==(A=Newtonsoft.Json.JsonConvert.preProcess(d,t,E,n))&&(E=A.value,I||null==E?Bridge.Reflection.fieldAccess($,t,x):Newtonsoft.Json.JsonConvert.PopulateObject(x,E,n,e)))}for(o=0;o<p.length;o++){var C,I,E,x,A,B=(d=p[o]).member;void 0===(e=s[f=d.attr&&d.attr.PropertyName||(g?B.n.charAt(0).toLowerCase()+B.n.substr(1):B.n)])&&(e=Newtonsoft.Json.JsonConvert.getValue(s,f)),void 0===(C=(i||s)[f])&&(C=Newtonsoft.Json.JsonConvert.getValue(i||s,f)),void 0!==(C=(A=Newtonsoft.Json.JsonConvert.preRawProcess(d,i||s,C,n)).value)&&(I=null===e||!1===e||!0===e||"number"==typeof e||"string"==typeof e,E=Bridge.unbox(Bridge.Reflection.midel(B.g,t)()),x=Newtonsoft.Json.JsonConvert.DeserializeObject(e,B.rt,n,!0),!1!==(A=Newtonsoft.Json.JsonConvert.preProcess(d,t,E,n))&&(E=A.value,I||null==E?B.s?Bridge.Reflection.midel(B.s,t)(x):"anonymous"===type.$kind&&(t[B.n]=x):Newtonsoft.Json.JsonConvert.PopulateObject(x,E,n,e)))}}},BindToName:function(e,t){if(e&&e.SerializationBinder&&e.SerializationBinder.Newtonsoft$Json$Serialization$ISerializationBinder$BindToName){var n={},i={};return e.SerializationBinder.Newtonsoft$Json$Serialization$ISerializationBinder$BindToName(t,n,i),i.v+(n.v?", "+n.v:"")}return Bridge.Reflection.getTypeQName(t)},BindToType:function(e,t,n){var i;if(!(i=e&&e.SerializationBinder&&e.SerializationBinder.Newtonsoft$Json$Serialization$ISerializationBinder$BindToType?(i=Newtonsoft.Json.JsonConvert.SplitFullyQualifiedTypeName(t),e.SerializationBinder.Newtonsoft$Json$Serialization$ISerializationBinder$BindToType(i.assemblyName,i.typeName)):Bridge.Reflection.getType(t)))throw new Newtonsoft.Json.JsonSerializationException("Type specified in JSON '"+t+"' was not resolved.");if(n&&!Bridge.Reflection.isAssignableFrom(n,i))throw new Newtonsoft.Json.JsonSerializationException("Type specified in JSON '"+Bridge.Reflection.getTypeQName(i)+"' is not compatible with '"+Bridge.Reflection.getTypeQName(n)+"'.");return i},SplitFullyQualifiedTypeName:function(e){var t,n=Newtonsoft.Json.JsonConvert.GetAssemblyDelimiterIndex(e),e=null!=n?(t=Newtonsoft.Json.JsonConvert.Trim(e,0,System.Nullable.getValueOrDefault(n,0)),Newtonsoft.Json.JsonConvert.Trim(e,System.Nullable.getValueOrDefault(n,0)+1|0,(e.length-System.Nullable.getValueOrDefault(n,0)|0)-1|0)):(t=e,null);return{typeName:t,assemblyName:e}},GetAssemblyDelimiterIndex:function(e){for(var t=0,n=0;n<e.length;n=n+1|0)switch(e.charCodeAt(n)){case 91:t=t+1|0;break;case 93:t=t-1|0;break;case 44:if(0===t)return n}return null},Trim:function(e,t,n){var i=(t+n|0)-1|0;if(i>=e.length)throw new System.ArgumentOutOfRangeException.$ctor1("length");for(;t<i&&System.Char.isWhiteSpace(String.fromCharCode(e.charCodeAt(t)));t=t+1|0);for(;t<=i&&System.Char.isWhiteSpace(String.fromCharCode(e.charCodeAt(i)));i=i-1|0);return e.substr(t,1+(i-t|0)|0)},SerializeObject:function(e,t,n,i,r,s){if(Bridge.is(t,Newtonsoft.Json.JsonSerializerSettings)&&(n=t,t=0),null==e)return n&&n.NullValueHandling===Newtonsoft.Json.NullValueHandling.Ignore?void 0:i?null:Newtonsoft.Json.JsonConvert.stringify(null,t,n);var o=Bridge.getType(e);if(r&&o&&("interface"!==r.$kind&&!Bridge.Reflection.isAssignableFrom(r,o)||(r=null)),r&&r.$nullable&&(r=r.$nullableType),r&&r===System.Char)return String.fromCharCode(e);var a=r||o;if("function"==typeof e){var u=Bridge.getTypeName(e);return i?u:Newtonsoft.Json.JsonConvert.stringify(u,t,n)}if("object"==typeof e){var l=Newtonsoft.Json.JsonConvert.defaultGuard;if(Bridge.$jsonGuard||(Bridge.$jsonGuard=[],l=function(){delete Bridge.$jsonGuard}),-1<Bridge.$jsonGuard.indexOf(e))return;a===System.Globalization.CultureInfo||a===System.Guid||a===System.Uri||a===System.Int64||a===System.UInt64||a===System.Decimal||a===System.DateTime||a===System.DateTimeOffset||a===System.Char||Bridge.Reflection.isEnum(a)?l():Bridge.$jsonGuard.push(e);u=!1;if(e&&e.$boxed&&(e=Bridge.unbox(e,!0),u=!0),a===System.Globalization.CultureInfo)return i?e.name:Newtonsoft.Json.JsonConvert.stringify(e.name,t,n);if(a===System.Guid)return i?Bridge.toString(e):Newtonsoft.Json.JsonConvert.stringify(Bridge.toString(e),t,n);if(a===System.Uri)return i?e.getAbsoluteUri():Newtonsoft.Json.JsonConvert.stringify(e.getAbsoluteUri(),t,n);if(a===System.Int64||a===System.UInt64||a===System.Decimal)return i?e.toJSON():e.toString();if(a===System.DateTime){var c=System.DateTime.format(e,"yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK");return i?c:Newtonsoft.Json.JsonConvert.stringify(c,t,n)}if(a===System.TimeSpan){c=Bridge.toString(e);return i?c:Newtonsoft.Json.JsonConvert.stringify(c,t,n)}if(a===System.DateTimeOffset){c=e.ToString$1("yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK");return i?c:Newtonsoft.Json.JsonConvert.stringify(c,t,n)}if(Bridge.isArray(null,a)){if(a.$elementType===System.Byte){l();var m=System.Convert.toBase64String(e);return i?m:Newtonsoft.Json.JsonConvert.stringify(m,t,n)}for(C=[],N=0;N<e.length;N++)C.push(Newtonsoft.Json.JsonConvert.SerializeObject(e[N],t,n,!0,a.$elementType));e=C,n&&n._typeNameHandling&&(2==(E=n._typeNameHandling)||3==E||4==E&&r&&r!==o)&&(e={$type:Newtonsoft.Json.JsonConvert.BindToName(n,a),$values:C})}else{if(Bridge.Reflection.isEnum(a))return s?System.Enum.getName(a,e):i?e:Newtonsoft.Json.JsonConvert.stringify(e,t,n);if(a===System.Char)return i?String.fromCharCode(e):Newtonsoft.Json.JsonConvert.stringify(String.fromCharCode(e),t,n);if(Bridge.Reflection.isAssignableFrom(System.Collections.IDictionary,a)){var m=System.Collections.Generic.Dictionary$2.getTypeParameters(a),y=m[0],h=m[1],d={},f=Bridge.getEnumerator(e);for(n&&n._typeNameHandling&&(1==(E=n._typeNameHandling)||3==E||4==E&&r&&r!==o)&&(d.$type=Newtonsoft.Json.JsonConvert.BindToName(n,a));f.moveNext();){var g=f.Current,S=Newtonsoft.Json.JsonConvert.SerializeObject(g.key,t,n,!0,y,!0);"object"==typeof S&&(S=Bridge.toString(g.key)),d[S]=Newtonsoft.Json.JsonConvert.SerializeObject(g.value,t,n,!0,h)}e=d}else if(Bridge.Reflection.isAssignableFrom(System.Collections.IEnumerable,a)){for(var p=Newtonsoft.Json.JsonConvert.getEnumerableElementType(a),$=Bridge.getEnumerator(e,p),C=[];$.moveNext();){var I=$.Current;C.push(Newtonsoft.Json.JsonConvert.SerializeObject(I,t,n,!0,p))}e=C,n&&n._typeNameHandling&&(2==(E=n._typeNameHandling)||3==E||4==E&&r&&r!==o)&&(e={$type:Newtonsoft.Json.JsonConvert.BindToName(n,a),$values:C})}else if(!u){var E,x={},u=!Bridge.getMetadata(a);if(Newtonsoft.Json.JsonConvert.validateReflectable(a),n&&n._typeNameHandling&&(1==(E=n._typeNameHandling)||3==E||4==E&&r&&r!==o)&&(x.$type=Newtonsoft.Json.JsonConvert.BindToName(n,a)),u)if(e.toJSON)x=e.toJSON();else for(var A in e)e.hasOwnProperty(A)&&(x[A]=Newtonsoft.Json.JsonConvert.SerializeObject(e[A],t,n,!0));else{var B=Newtonsoft.Json.JsonConvert.getMembers(a,4),w=n&&Bridge.is(n.ContractResolver,Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver),v=Bridge.Reflection.getMembers(a,8,54);if(0<v.length)for(var _=0;_<v.length;_++)System.Attribute.isDefined(v[_],System.Runtime.Serialization.OnSerializingAttribute,!1)&&Bridge.Reflection.midel(v[_],e)(null);for(N=0;N<B.length;N++){var T=(O=B[N]).member,b=O.attr&&O.attr.PropertyName||(w?T.n.charAt(0).toLowerCase()+T.n.substr(1):T.n),R=Bridge.Reflection.fieldAccess(T,e);!1!==(G=Newtonsoft.Json.JsonConvert.preProcess(O,e,R,n||{}))&&(O.attr&&(F=O.attr._typeNameHandling),null!=F&&(P=(n=n||{})._typeNameHandling,n._typeNameHandling=F),x[b]=Newtonsoft.Json.JsonConvert.SerializeObject(G.value,t,n,!0,T.rt),null!=F&&(n._typeNameHandling=P))}for(var D=Newtonsoft.Json.JsonConvert.getMembers(a,16),N=0;N<D.length;N++){var O,k,G,F,P,L=(O=D[N]).member;L.g&&(k=O.attr&&O.attr.PropertyName||(w?L.n.charAt(0).toLowerCase()+L.n.substr(1):L.n),R=Bridge.Reflection.midel(L.g,e)(),!1!==(G=Newtonsoft.Json.JsonConvert.preProcess(O,e,R,n||{}))&&(O.attr&&(F=O.attr._typeNameHandling),null!=F&&(P=(n=n||{})._typeNameHandling,n._typeNameHandling=F),x[k]=Newtonsoft.Json.JsonConvert.SerializeObject(G.value,t,n,!0,L.rt),null!=F&&(n._typeNameHandling=P)))}if(0<v.length)for(_=0;_<v.length;_++)if(System.Attribute.isDefined(v[_],System.Runtime.Serialization.OnSerializedAttribute,!1)){Bridge.Reflection.midel(v[_],e)(null);break}}e=x}}l()}else if(Bridge.Reflection.isEnum(a))return s?System.Enum.getName(a,e):i?e:Newtonsoft.Json.JsonConvert.stringify(e,t,n);return i?e:Newtonsoft.Json.JsonConvert.stringify(e,t,n)},getInstanceBuilder:function(y,e,h){var t=Bridge.isArray(e),n=t&&Bridge.Reflection.isAssignableFrom(System.Collections.IEnumerable,y),d=!1;if(n||"object"==typeof e&&!t){var i=Bridge.Reflection.getMembers(y,1,54),r=[],s=!1,f=null;if(y===System.Version)i=[Bridge.Reflection.getMembers(y,1,284,null,[System.Int32,System.Int32,System.Int32,System.Int32])],f=i[0];else if(0<i.length){i=i.filter(function(e){return!e.isSynthetic});for(var o=0;o<i.length;o++){var a=i[o],u=0<System.Attribute.getCustomAttributes(a,Newtonsoft.Json.JsonConstructorAttribute).length;if(0===(a.pi||[]).length&&(s=!0),u){if(null!=f)throw new Newtonsoft.Json.JsonException("Multiple constructors with the JsonConstructorAttribute.");f=a}2===a.a&&r.push(a)}}if(!s&&!f&&"struct"===y.$kind){var l=!0;if(0<r.length){l=!1;for(var g=(f=r[0]).pi||[],c=Newtonsoft.Json.JsonConvert.getMembers(y,4),m=Newtonsoft.Json.JsonConvert.getMembers(y,16),S=0;S<g.length;S++){for(var p=g[S],$=p.sn||p.n,C=0;C<m.length;C++){var I=(E=m[S]).member;if($===(x=E.attr&&E.attr.PropertyName||I.n)||$.toLowerCase()===x.toLowerCase()&&E.s){l=!0;break}}if(!l)for(C=0;C<c.length;C++){var E,x,A=(E=c[S]).member;if($===(x=E.attr&&E.attr.PropertyName||A.n)||$.toLowerCase()===x.toLowerCase()&&!E.ro){l=!0;break}}if(l)break}}l&&(f={td:y})}if(!s&&0<i.length){if(1!==r.length&&null==f)throw new Newtonsoft.Json.JsonSerializationException("Unable to find a constructor to use for type "+Bridge.getTypeName(y)+". A class should either have a default constructor or one constructor with arguments.");null==f&&(f=r[0]);g=f.pi||[];return n?function(e){var t=[];if(Bridge.Reflection.isAssignableFrom(System.Collections.IEnumerable,g[0].pt)){var n,i=[],r=Bridge.Reflection.getGenericArguments(g[0].pt)[0]||Bridge.Reflection.getGenericArguments(y)[0]||System.Object;if(h&&h._typeNameHandling&&0<e.length&&e[0]){var s=!0,o=e[0].$type;if(o)for(var a=1;a<e.length;a++){var u=e[a]?e[a].$type:null;if(!u||u!==o){s=!1;break}}else s=!1;n=s?Newtonsoft.Json.JsonConvert.getInstanceBuilder(r,e[0],h):null}else n=null;for(a=0;a<e.length;a++){var l,c=e[a],m=n&&!n.default;m&&(l=n(c),i[a]=l.value,l=l.names),i[a]=Newtonsoft.Json.JsonConvert.DeserializeObject(c,r,h,!0,m?i[a]:void 0,l)}t.push(i),d=!0}t=Bridge.Reflection.invokeCI(f,t);return d?{$list:!0,names:[],value:t}:{names:[],value:t}}:function(e){for(var t=[],n=[],i=Object.getOwnPropertyNames(e),r=0;r<g.length;r++){for(var s=g[r],o=s.sn||s.n,a=null,u=0;u<i.length;u++)if(o===i[u]){a=i[u];break}if(!a){o=o.toLowerCase();for(u=0;u<i.length;u++)if(o===i[u].toLowerCase()){a=i[u];break}}(o=a)?(t[r]=Newtonsoft.Json.JsonConvert.DeserializeObject(e[o],s.pt,h,!0),n.push(o)):t[r]=Bridge.getDefaultValue(s.pt)}return{names:n,value:Bridge.Reflection.invokeCI(f,t)}}}}n=function(){return{names:[],value:Bridge.createInstance(y),default:!0}};return n.default=!0,n},createInstance:function(e,t,n){return this.getInstanceBuilder(e,t,n)(t)},needReuse:function(e,t,n,i){return!(e!==Newtonsoft.Json.ObjectCreationHandling.Reuse&&(e!==Newtonsoft.Json.ObjectCreationHandling.Auto||null==t)||!i||"struct"===n.$kind||"enum"===n.$kind||n===System.String||n===System.Boolean||n===System.Int64||n===System.UInt64||n===System.Int32||n===System.UInt32||n===System.Int16||n===System.UInt16||n===System.Byte||n===System.SByte||n===System.Single||n===System.Double||n===System.Decimal)},tryToGetCastOperator:function(e,t){if(null===e)return null;var n;if("boolean"==typeof e||"string"==typeof e)n=[Bridge.getType(e)];else{if("number"!=typeof e)return null;n=[System.Double,System.Int64]}for(var i=0;i<n.length;i++){var r=n[i],s=Bridge.Reflection.getMembers(t,8,284,"op_Explicit",[r]);if(s)return function(e){return Bridge.Reflection.midel(s,null)(e)};var o=Bridge.Reflection.getMembers(t,8,284,"op_Implicit",[r]);if(o)return function(e){return Bridge.Reflection.midel(o,null)(e)}}return null},DeserializeObject:function(e,t,n,i,r,s){n=n||{},"interface"===t.$kind&&(System.Collections.IDictionary===t?t=System.Collections.Generic.Dictionary$2(System.Object,System.Object):Bridge.Reflection.isGenericType(t)&&Bridge.Reflection.isAssignableFrom(System.Collections.Generic.IDictionary$2,Bridge.Reflection.getGenericTypeDefinition(t))?(u=System.Collections.Generic.Dictionary$2.getTypeParameters(t),t=System.Collections.Generic.Dictionary$2(u[0]||System.Object,u[1]||System.Object)):t===System.Collections.IList||t===System.Collections.ICollection?t=System.Collections.Generic.List$1(System.Object):Bridge.Reflection.isGenericType(t)&&(Bridge.Reflection.isAssignableFrom(System.Collections.Generic.IList$1,Bridge.Reflection.getGenericTypeDefinition(t))||Bridge.Reflection.isAssignableFrom(System.Collections.Generic.ICollection$1,Bridge.Reflection.getGenericTypeDefinition(t)))&&(t=System.Collections.Generic.List$1(System.Collections.Generic.List$1.getElementType(t)||System.Object))),i||"string"!=typeof e||("object"==typeof(l=Newtonsoft.Json.JsonConvert.parse(e))||Bridge.isArray(l)||t===System.Array.type(System.Byte,1)||t===Function||t==System.Type||t===System.Guid||t===System.Globalization.CultureInfo||t===System.Uri||t===System.DateTime||t===System.DateTimeOffset||t===System.Char||Bridge.Reflection.isEnum(t))&&(e=l);var o=t===Object||t===System.Object,a=Bridge.isObject(e);if(o&&a&&e&&e.$type&&(t=Newtonsoft.Json.JsonConvert.BindToType(n,e.$type,t),o=!1),o&&a||t.$literal&&!Bridge.getMetadata(t))return Bridge.merge(o?{}:r||Bridge.createInstance(t),e);var u=Bridge.getDefaultValue(t);if(t.$nullable&&(t=t.$nullableType),null===e)return u;if(!1===e)return t===System.Boolean?!1:t===System.String?"false":(c=Newtonsoft.Json.JsonConvert.tryToGetCastOperator(e,t))?c(e):o?Bridge.box(e,System.Boolean,System.Boolean.toString):u;else{if(!0===e){if(t===System.Boolean)return!0;if(t===System.Int64)return System.Int64(1);if(t===System.UInt64)return System.UInt64(1);if(t===System.Decimal)return System.Decimal(1);if(t===String.String)return"true";if(t===System.DateTime)return System.DateTime.create$2(1,0);if(t===System.DateTimeOffset)return System.DateTimeOffset.MinValue.$clone();if(Bridge.Reflection.isEnum(t))return Bridge.unbox(System.Enum.parse(t,1));if("number"==typeof u)return u+1;if(c=Newtonsoft.Json.JsonConvert.tryToGetCastOperator(e,t))return c(e);if(o)return Bridge.box(e,System.Boolean,System.Boolean.toString);throw new System.ArgumentException(System.String.format("Could not cast or convert from {0} to {1}",Bridge.getTypeName(e),Bridge.getTypeName(t)))}if("number"==typeof e){if(t.$number&&!t.$is(e)&&!(t===System.Decimal&&t.tryParse(e,null,{})||System.Int64.is64BitType(t)&&t.tryParse(e.toString(),{})))throw new Newtonsoft.Json.JsonException(System.String.format("Input string '{0}' is not a valid {1}",e,Bridge.getTypeName(t)));if(t===System.Boolean)return 0!==e;if(Bridge.Reflection.isEnum(t))return Bridge.unbox(System.Enum.parse(t,e));if(t===System.SByte)return 0|e;if(t===System.Byte)return e>>>0;if(t===System.Int16)return 0|e;if(t===System.UInt16)return e>>>0;if(t===System.Int32)return 0|e;if(t===System.UInt32)return e>>>0;if(t===System.Int64)return System.Int64(e);if(t===System.UInt64)return System.UInt64(e);if(t===System.Single)return e;if(t===System.Double)return e;if(t===System.Decimal)return System.Decimal(e);if(t===System.Char)return 0|e;if(t===System.String)return e.toString();if(t===System.DateTime)return System.DateTime.create$2(0|e,0);if(t===System.TimeSpan)return System.TimeSpan.fromTicks(e);if(t===System.DateTimeOffset)return new System.DateTimeOffset.$ctor5(System.Int64(0|e),(new System.DateTimeOffset.ctor).Offset);if(c=Newtonsoft.Json.JsonConvert.tryToGetCastOperator(e,t))return c(e);if(o)return Bridge.box(e,Bridge.getType(e));throw new System.ArgumentException(System.String.format("Could not cast or convert from {0} to {1}",Bridge.getTypeName(e),Bridge.getTypeName(t)))}if("string"==typeof e){var l=t===System.Decimal,a=l||System.Int64.is64BitType(t);if(a&&(l?!t.tryParse(e,null,{}):!t.tryParse(e,{})))throw new Newtonsoft.Json.JsonException(System.String.format("Input string '{0}' is not a valid {1}",e,Bridge.getTypeName(t)));var c,l=t==System.Double||t==System.Single;if(!a&&t.$number&&(l?!t.tryParse(e,null,{}):!t.tryParse(e,{})))throw new Newtonsoft.Json.JsonException(System.String.format("Could not convert {0} to {1}: {2}",Bridge.getTypeName(e),Bridge.getTypeName(t),e));if(t===Function||t==System.Type)return Bridge.Reflection.getType(e);if(t===System.Globalization.CultureInfo)return new System.Globalization.CultureInfo(e);if(t===System.Uri)return new System.Uri(e);if(t===System.Guid)return System.Guid.Parse(e);if(t===System.Boolean){l={v:!1};return!System.String.isNullOrWhiteSpace(e)&&System.Boolean.tryParse(e,l)?l.v:!1}if(t===System.SByte)return 0|e;if(t===System.Byte)return e>>>0;if(t===System.Int16)return 0|e;if(t===System.UInt16)return e>>>0;if(t===System.Int32)return 0|e;if(t===System.UInt32)return e>>>0;if(t===System.Int64)return System.Int64(e);if(t===System.UInt64)return System.UInt64(e);if(t===System.Single)return parseFloat(e);if(t===System.Double)return parseFloat(e);if(t!==System.Decimal){if(t===System.Char)return 0===e.length?0:e.charCodeAt(0);if(t===System.String)return i?e:JSON.parse(e);if(t===System.TimeSpan)return System.TimeSpan.parse('"'==e[0]?JSON.parse(e):e);if(t===System.DateTime){var m="yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFF"+((y=System.String.endsWith(e,"Z"))?"'Z'":"K");return h=null!=(h=System.DateTime.parseExact(e,m,null,!0,!0))?h:System.DateTime.parse(e,void 0,!0),y&&1!==h.kind&&(h=System.DateTime.specifyKind(h,1)),h}if(t===System.DateTimeOffset){var y,h,m="yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFF"+((y=System.String.endsWith(e,"Z"))?"'Z'":"K");return h=null!=(h=System.DateTime.parseExact(e,m,null,!0,!0))?h:System.DateTime.parse(e,void 0,!0),y&&1!==h.kind&&(h=System.DateTime.specifyKind(h,1)),new System.DateTimeOffset.$ctor1(h)}if(Bridge.Reflection.isEnum(t))return Bridge.unbox(System.Enum.parse(t,e));if(t===System.Array.type(System.Byte,1))return System.Convert.fromBase64String(e);if(c=Newtonsoft.Json.JsonConvert.tryToGetCastOperator(e,t))return c(e);if(o)return e;throw new System.ArgumentException(System.String.format("Could not cast or convert from {0} to {1}",Bridge.getTypeName(e),Bridge.getTypeName(t)))}try{return System.Decimal(e)}catch(e){return System.Decimal(0)}}else if("object"==typeof e){if(null!==u&&"struct"!==t.$kind)return u;if(Bridge.isArray(null,t)){if(null!=(p=e.$type)&&(t=Newtonsoft.Json.JsonConvert.BindToType(n,p,t),e=e.$values),void 0===e.length)return[];var d=new Array;System.Array.type(t.$elementType,t.$rank||1,d);for(var f=0;f<e.length;f++)d[f]=Newtonsoft.Json.JsonConvert.DeserializeObject(e[f],t.$elementType,n,!0);return d}if(Bridge.Reflection.isAssignableFrom(System.Collections.IList,t)){null!=(p=e.$type)&&(t=Newtonsoft.Json.JsonConvert.BindToType(n,p,t),e=e.$values);var g=System.Collections.Generic.List$1.getElementType(t)||System.Object,S=r?{value:r}:Newtonsoft.Json.JsonConvert.createInstance(t,e,n);if(S&&S.$list)return S.value;if(S=S.value,void 0===e.length)return S;for(f=0;f<e.length;f++)S.add(Newtonsoft.Json.JsonConvert.DeserializeObject(e[f],g,n,!0));return S}if(Bridge.Reflection.isAssignableFrom(System.Collections.IDictionary,t)){var p,u=System.Collections.Generic.Dictionary$2.getTypeParameters(t),$=u[0]||System.Object,C=u[1]||System.Object,I=!1;null!=(p=e.$type)&&(t=Newtonsoft.Json.JsonConvert.BindToType(n,p,t),I=!0);var E,x=r?{value:r}:Newtonsoft.Json.JsonConvert.createInstance(t,e,n);if(x&&x.$list)return x.value;for(E in B=x.names||[],x=x.value,e)!e.hasOwnProperty(E)||I&&"$type"===E||B.indexOf(E)<0&&x.add(Newtonsoft.Json.JsonConvert.DeserializeObject(E,$,n,!0),Newtonsoft.Json.JsonConvert.DeserializeObject(e[E],C,n,!0));return x}if(null!=(p=e.$type)&&(t=Newtonsoft.Json.JsonConvert.BindToType(n,p,t)),!Bridge.getMetadata(t))return Bridge.merge(o?{}:r||Bridge.createInstance(t),e);var A,B,w=r?{value:r,names:s,default:!0}:Newtonsoft.Json.JsonConvert.createInstance(t,e,n);B=w.names||[],A=w.default,w=w.value;var v=Bridge.Reflection.getMembers(t,8,54);if(0<v.length)for(var _=0;_<v.length;_++)System.Attribute.isDefined(v[_],System.Runtime.Serialization.OnDeserializingAttribute,!1)&&Bridge.Reflection.midel(v[_],w)(null);var T,b=n&&Bridge.is(n.ContractResolver,Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver),R=Newtonsoft.Json.JsonConvert.getMembers(t,4);for(f=0;f<R.length;f++){var D,N,O=(T=R[f]).member,k=T.attr&&T.attr.PropertyName||(b?O.n.charAt(0).toLowerCase()+O.n.substr(1):O.n);-1<B.indexOf(k)||(void 0===(N=e[k])&&(N=Newtonsoft.Json.JsonConvert.getValue(e,k)),void 0!==(N=(F=Newtonsoft.Json.JsonConvert.preRawProcess(T,e,N,n)).value)&&(P=Bridge.Reflection.fieldAccess(O,w),L=Newtonsoft.Json.ObjectCreationHandling.Auto,D=void 0,T.attr&&null!=T.attr._objectCreationHandling?L=T.attr._objectCreationHandling:null!=n._objectCreationHandling&&(L=n._objectCreationHandling),Newtonsoft.Json.JsonConvert.needReuse(L,P,O.rt,A)&&(D=Bridge.unbox(P,!0)),T.attr&&(V=T.attr._typeNameHandling),null!=V&&(M=n._typeNameHandling,n._typeNameHandling=V),z=Newtonsoft.Json.JsonConvert.DeserializeObject(N,O.rt,n,!0,D),null!=V&&(n._typeNameHandling=M),!1!==(F=Newtonsoft.Json.JsonConvert.preProcess(T,w,z,n))&&void 0===D&&Bridge.Reflection.fieldAccess(O,w,F.value)))}var G=Newtonsoft.Json.JsonConvert.getMembers(t,16);for(f=0;f<G.length;f++){var F,P,L,V,M,z,q=(T=G[f]).member;k=T.attr&&T.attr.PropertyName||(b?q.n.charAt(0).toLowerCase()+q.n.substr(1):q.n),-1<B.indexOf(k)||(void 0===(N=e[k])&&(N=Newtonsoft.Json.JsonConvert.getValue(e,k)),void 0!==(N=(F=Newtonsoft.Json.JsonConvert.preRawProcess(T,e,N,n)).value)&&(D=void 0,q.g&&(P=Bridge.Reflection.midel(q.g,w)(),L=Newtonsoft.Json.ObjectCreationHandling.Auto,T.attr&&null!=T.attr._objectCreationHandling?L=T.attr._objectCreationHandling:null!=n._objectCreationHandling&&(L=n._objectCreationHandling),Newtonsoft.Json.JsonConvert.needReuse(L,P,q.rt,A)&&(D=Bridge.unbox(P,!0))),T.attr&&(V=T.attr._typeNameHandling),null!=V&&(M=n._typeNameHandling,n._typeNameHandling=V),z=Newtonsoft.Json.JsonConvert.DeserializeObject(N,q.rt,n,!0,D),null!=V&&(n._typeNameHandling=M),!1!==(F=Newtonsoft.Json.JsonConvert.preProcess(T,w,z,n))&&void 0===D&&(q.s?Bridge.Reflection.midel(q.s,w)(F.value):"anonymous"===t.$kind&&(w[q.n]=F.value))))}if(0<v.length)for(_=0;_<v.length;_++)System.Attribute.isDefined(v[_],System.Runtime.Serialization.OnDeserializedAttribute,!1)&&Bridge.Reflection.midel(v[_],w)(null);return w}}}}}}),Newtonsoft.Json.$cache=[]}),Bridge.assembly("client.lightstreamer",function(e,t){"use strict";Bridge.define("Client.Common.Command.CommonCommands",{statics:{fields:{MESSAGE_DATA:0,JACKPOT_DATA:0,SETTING_JACKPOT:0,UPDATE_JACKPOT:0},ctors:{init:function(){this.MESSAGE_DATA=0,this.JACKPOT_DATA=1,this.SETTING_JACKPOT=2,this.UPDATE_JACKPOT=3}}}}),Bridge.define("Client.Common.Packets.IPrototype",{$kind:"interface"}),Bridge.define("Client.Common.Packets.IParser",{$kind:"interface"}),Bridge.define("Client.Common.Packets.IPacket",{$kind:"interface"}),Bridge.define("Client.Common.Networks.ArrayRange",{$kind:"enum",statics:{fields:{U3:2,U7:3,U15:4,U31:5,U63:6,U127:7,U255:8,U511:9,U1023:10,U2047:11}}}),Bridge.define("Client.Common.Networks.Bit5StringEncoder",{statics:{fields:{CHAR_LENGTH:0,token:null},ctors:{init:function(){this.CHAR_LENGTH=Client.Common.Networks.URange.U31,this.token="ABCDEFGHIJKLMNOPQRSTUVWXYZ123456"}}},fields:{tokenCharToByte:null,tokenByteToChar:null},ctors:{ctor:function(){this.$initialize(),this.tokenCharToByte=System.Linq.Enumerable.from(Client.Common.Networks.Bit5StringEncoder.token,System.Char).select(function(e,t){return{Index:t,Char:e}}).toDictionary(function(e){return e.Char},function(e){return 255&e.Index},System.Char,System.Byte),this.tokenByteToChar=System.Linq.Enumerable.from(this.tokenCharToByte,System.Collections.Generic.KeyValuePair$2(System.Char,System.Byte)).toDictionary(function(e){return e.value},function(e){return e.key},System.Byte,System.Char)}},methods:{getTokenCharToByte:function(){return this.tokenCharToByte},getTokenByteToChar:function(){return this.tokenByteToChar}}}),Bridge.define("Client.Common.Networks.FloatToIntConverter",{$kind:"struct",statics:{methods:{getDefaultValue:function(){return new Client.Common.Networks.FloatToIntConverter}}},fields:{IntValue:0,FloatValue:0},ctors:{ctor:function(){this.$initialize()}},methods:{getHashCode:function(){return Bridge.addHash([6660165898,this.IntValue,this.FloatValue])},equals:function(e){return!!Bridge.is(e,Client.Common.Networks.FloatToIntConverter)&&(Bridge.equals(this.IntValue,e.IntValue)&&Bridge.equals(this.FloatValue,e.FloatValue))},$clone:function(e){e=e||new Client.Common.Networks.FloatToIntConverter;return e.IntValue=this.IntValue,e.FloatValue=this.FloatValue,e}}}),Bridge.define("Client.Common.Networks.Packer",{statics:{fields:{MiniPointBitSize:0,SmallPointBitSize:0,MidPointBitSize:0,PointBitSize:0,MiniPointMaxSize:System.Int64(0),SmallPointMaxSize:System.Int64(0),MidPointMaxSize:System.Int64(0),PointMaxSize:System.Int64(0),MAX_SIZE_ALLOW:0,MAXIMUM_BYTE_ARRAY_ALLOW:0,MAXIMUM_BOOLEAN_ARRAY_ALLOW:0,MAXIMUM_SHORT_ARRAY_ALLOW:0,MAXIMUM_INTEGER_ARRAY_ALLOW:0,MAXIMUM_FLOAT_ARRAY_ALLOW:0,MAXIMUM_LONG_ARRAY_ALLOW:0,MAXIMUM_DOUBLE_ARRAY_ALLOW:0,MAXIMUM_STRING_ARRAY_ALLOW:0,MAXIMUM_STRING_UTF_ARRAY_ALLOW:0,BYTE_SIZE:0,SHORT_SIZE:0,INT_SIZE:0,LONG_SIZE:0,FLOAT_SIZE:0,STRING_SIZE:0,hexArray:null},ctors:{init:function(){this.MiniPointBitSize=17,this.SmallPointBitSize=24,this.MidPointBitSize=30,this.PointBitSize=37,this.MiniPointMaxSize=System.Int64(131071),this.SmallPointMaxSize=System.Int64(16777215),this.MidPointMaxSize=System.Int64(1073741823),this.PointMaxSize=System.Int64([1215752191,23]),this.MAX_SIZE_ALLOW=Client.Common.Networks.URange.U32767,this.MAXIMUM_BYTE_ARRAY_ALLOW=Client.Common.Networks.ArrayRange.U2047,this.MAXIMUM_BOOLEAN_ARRAY_ALLOW=Client.Common.Networks.ArrayRange.U2047,this.MAXIMUM_SHORT_ARRAY_ALLOW=Client.Common.Networks.ArrayRange.U2047,this.MAXIMUM_INTEGER_ARRAY_ALLOW=Client.Common.Networks.ArrayRange.U1023,this.MAXIMUM_FLOAT_ARRAY_ALLOW=Client.Common.Networks.ArrayRange.U1023,this.MAXIMUM_LONG_ARRAY_ALLOW=Client.Common.Networks.ArrayRange.U511,this.MAXIMUM_DOUBLE_ARRAY_ALLOW=Client.Common.Networks.ArrayRange.U511,this.MAXIMUM_STRING_ARRAY_ALLOW=Client.Common.Networks.URange.U1023,this.MAXIMUM_STRING_UTF_ARRAY_ALLOW=Client.Common.Networks.URange.U1023,this.BYTE_SIZE=Client.Common.Networks.URange.U255,this.SHORT_SIZE=Client.Common.Networks.URange.U65535,this.INT_SIZE=Client.Common.Networks.URange.UInt,this.LONG_SIZE=Client.Common.Networks.URange.U37b,this.FLOAT_SIZE=Client.Common.Networks.URange.UInt,this.STRING_SIZE=Client.Common.Networks.URange.U37b,this.hexArray=System.String.toCharArray("0123456789ABCDEF",0,"0123456789ABCDEF".length)}},methods:{createExceptionPacker:function(){var e=new Client.Common.Networks.Packer.$ctor2(8);return e.putBoolean(!1),e},createEventPacker:function(){return Client.Common.Networks.Packer.createEventPacker$1(System.Int64.clip32(Client.Common.Networks.URangeStuff.Value(Client.Common.Networks.Packer.MAX_SIZE_ALLOW)))},createEventPacker$1:function(e){return new Client.Common.Networks.Packer.$ctor2(e)},createSucceedPacker:function(){return Client.Common.Networks.Packer.createSucceedPacker$1(System.Int64.clip32(Client.Common.Networks.URangeStuff.Value(Client.Common.Networks.Packer.MAX_SIZE_ALLOW)))},createSucceedPacker$1:function(e){e=new Client.Common.Networks.Packer.$ctor2(e);return e.putBoolean(!0),e},createDataPacker:function(e){return Client.Common.Networks.Packer.createDataPacker$1(e,System.Int64.clip32(Client.Common.Networks.URangeStuff.Value(Client.Common.Networks.Packer.MAX_SIZE_ALLOW)))},createDataPacker$1:function(e,t){t=new Client.Common.Networks.Packer.$ctor2(t);return t.putBoolean(!0),t.putInt$2(e,Client.Common.Networks.URange.U1023),t},bytesToHex:function(e){for(var t=System.Array.init(Bridge.Int.mul(e.length,2),0,System.Char),n=0;n<e.length;n=n+1|0){var i=255&e[System.Array.index(n,e)];t[System.Array.index(Bridge.Int.mul(n,2),t)]=Client.Common.Networks.Packer.hexArray[System.Array.index(i>>4,Client.Common.Networks.Packer.hexArray)],t[System.Array.index(Bridge.Int.mul(n,2)+1|0,t)]=Client.Common.Networks.Packer.hexArray[System.Array.index(15&i,Client.Common.Networks.Packer.hexArray)]}return System.String.fromCharArray(t)},hextsToByte:function(e){if(e.length%2!=0)return null;for(var t=System.Array.init(0|Bridge.Int.div(e.length,2),0,System.Byte),n=System.String.toCharArray(e,0,e.length),i=0;i<n.length;i=i+2|0){var r=new System.Text.StringBuilder("",2);r.append(String.fromCharCode(n[System.Array.index(i,n)])).append(String.fromCharCode(n[System.Array.index(i+1|0,n)])),t[System.Array.index(0|Bridge.Int.div(i,2),t)]=255&System.Convert.toNumberInBase(r.toString(),16,9)}return t},GetBitSize:function(e){switch(e){case Client.Common.Networks.PointRange.MiniPoint:return Client.Common.Networks.Packer.MiniPointBitSize;case Client.Common.Networks.PointRange.SmallPoint:return Client.Common.Networks.Packer.SmallPointBitSize;case Client.Common.Networks.PointRange.MidPoint:return Client.Common.Networks.Packer.MidPointBitSize;case Client.Common.Networks.PointRange.Point:return Client.Common.Networks.Packer.PointBitSize}throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Maximum value is {0}, point-range: {1}",Client.Common.Networks.Packer.PointMaxSize,Bridge.box(e,Client.Common.Networks.PointRange,System.Enum.toStringFn(Client.Common.Networks.PointRange))))},GetBitSize$1:function(e,t){if(System.Int64(e).lte(Client.Common.Networks.Packer.MiniPointMaxSize))return t.v=Client.Common.Networks.PointRange.MiniPoint,Client.Common.Networks.Packer.MiniPointBitSize;if(System.Int64(e).lte(Client.Common.Networks.Packer.SmallPointMaxSize))return t.v=Client.Common.Networks.PointRange.SmallPoint,Client.Common.Networks.Packer.SmallPointBitSize;if(System.Int64(e).lte(Client.Common.Networks.Packer.MidPointMaxSize))return t.v=Client.Common.Networks.PointRange.MidPoint,Client.Common.Networks.Packer.MidPointBitSize;if(System.Int64(e).lte(Client.Common.Networks.Packer.PointMaxSize))return t.v=Client.Common.Networks.PointRange.Point,Client.Common.Networks.Packer.PointBitSize;throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Maximum value is {0}, value: {1}",Client.Common.Networks.Packer.PointMaxSize,Bridge.box(e,System.Int32)))},GetPointUrange:function(e){switch(e){case Client.Common.Networks.Packer.MiniPointBitSize:return Client.Common.Networks.URange.U131071;case Client.Common.Networks.Packer.SmallPointBitSize:return Client.Common.Networks.URange.U24b;case Client.Common.Networks.Packer.MidPointBitSize:return Client.Common.Networks.URange.U30b;case Client.Common.Networks.Packer.PointBitSize:return Client.Common.Networks.URange.U37b}throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Maximum bit size is {0}",[Bridge.box(Client.Common.Networks.Packer.PointBitSize,System.Int32)]))},CheckLimit:function(e,t){if(t.gt(Client.Common.Networks.Packer.PointMaxSize))throw new System.ArgumentOutOfRangeException.$ctor4(e,System.String.format("Maximum value is {0}, value: {1}",Client.Common.Networks.Packer.PointMaxSize,t))}}},fields:{maxSizeAllow:0,data:null,numBits:0,readCursor:0,converter:null,bit5StringEncoder:null,tokenStringEncoder:null},ctors:{init:function(){this.converter=new Client.Common.Networks.FloatToIntConverter,this.numBits=0,this.readCursor=0,this.bit5StringEncoder=new Client.Common.Networks.Bit5StringEncoder,this.tokenStringEncoder=new Client.Common.Networks.TokenStringEncoder},ctor:function(){Client.Common.Networks.Packer.$ctor2.call(this,System.Int64.clip32(Client.Common.Networks.URangeStuff.Value(Client.Common.Networks.Packer.MAX_SIZE_ALLOW)))},$ctor1:function(e){this.$initialize(),this.maxSizeAllow=Bridge.Int.mul(e.length,8),this.data=new System.Collections.BitArray.$ctor3(this.maxSizeAllow);for(var t=0;t<e.length;t=t+1|0)this.putByte(e[System.Array.index(t,e)]);this.converter=new Client.Common.Networks.FloatToIntConverter,this.numBits=this.maxSizeAllow},$ctor2:function(e){this.$initialize(),e>System.Int64.clip32(Client.Common.Networks.URangeStuff.Value(Client.Common.Networks.Packer.MAX_SIZE_ALLOW))&&(e=System.Int64.clip32(Client.Common.Networks.URangeStuff.Value(Client.Common.Networks.Packer.MAX_SIZE_ALLOW))),this.maxSizeAllow=e,this.data=new System.Collections.BitArray.$ctor3(this.maxSizeAllow),this.converter=new Client.Common.Networks.FloatToIntConverter}},methods:{putBoolean:function(e){this.data.setItem(Bridge.identity(this.numBits,this.numBits=this.numBits+1|0),e)},putBoolean$1:function(e,t){if(null!=e&&0!==e.length){this.putBoolean(!0);var n=e.length;this.putInternal$6(n,t);for(var i=0;i<n;i=i+1|0)this.putBitInternal(e[System.Array.index(i,e)])}else this.putBoolean(!1)},putBoolean$2:function(e,t,n){if(null!=e&&0!==e.length){this.putBoolean(!0);var i=e.length;this.putInternal$6(i,t);for(var r=0;r<i;r=r+1|0){var s=e[System.Array.index(r,e)];this.putBoolean$1(s,n)}}else this.putBoolean(!1)},putByte:function(e){this.putInternal(e,Client.Common.Networks.Packer.BYTE_SIZE)},putByte$1:function(e,t){if(Client.Common.Networks.URangeStuff.IsBigger(t,Client.Common.Networks.Packer.BYTE_SIZE))throw new System.Exception("URange is out of U"+System.Enum.toString(Client.Common.Networks.URange,Client.Common.Networks.Packer.BYTE_SIZE));this.putInternal(e,t)},putByte$2:function(e){this.putByte$3(e,Client.Common.Networks.Packer.MAXIMUM_BYTE_ARRAY_ALLOW,Client.Common.Networks.Packer.BYTE_SIZE)},putByte$3:function(e,t,n){this.putInternal$1(e,t,n)},putByte$4:function(e,t,n,i){this.putInternal$2(e,t,n,i)},putShort:function(e){this.putInternal$3(e,Client.Common.Networks.Packer.SHORT_SIZE)},putShort$1:function(e,t){this.putInternal$3(e,t)},putShort$2:function(e){this.putShort$3(e,Client.Common.Networks.Packer.MAXIMUM_SHORT_ARRAY_ALLOW,Client.Common.Networks.Packer.SHORT_SIZE)},putShort$3:function(e,t,n){this.putInternal$4(e,t,n)},putShort$4:function(e,t,n,i){this.putInternal$5(e,t,n,i)},putInt:function(e){this.putInternal$7(e,Client.Common.Networks.Packer.INT_SIZE)},putInt$2:function(e,t){this.putInternal$7(e,t)},putInt$1:function(e,t){this.putInternal$6(e,t)},putInt$3:function(e){this.putInt$4(e,Client.Common.Networks.Packer.MAXIMUM_INTEGER_ARRAY_ALLOW,Client.Common.Networks.Packer.INT_SIZE)},putInt$4:function(e,t,n){this.putInternal$8(e,t,n)},putInt$5:function(e,t,n,i){this.putInternal$9(e,t,n,i)},putLong:function(e){this.putInternal$10(e,Client.Common.Networks.Packer.LONG_SIZE)},putLong$1:function(e,t){this.putInternal$10(e,t)},putLong$2:function(e){this.putLong$3(e,Client.Common.Networks.Packer.MAXIMUM_LONG_ARRAY_ALLOW,Client.Common.Networks.Packer.LONG_SIZE)},putLong$3:function(e,t,n){this.putInternal$11(e,t,n)},putLong$4:function(e,t,n,i){this.putInternal$12(e,t,n,i)},putFloat:function(e){this.putInternal$13(e,Client.Common.Networks.Packer.FLOAT_SIZE)},putFloat$1:function(e,t){this.putInternal$13(e,t)},putFloat$2:function(e){this.putFloat$3(e,Client.Common.Networks.Packer.MAXIMUM_FLOAT_ARRAY_ALLOW,Client.Common.Networks.Packer.FLOAT_SIZE)},putFloat$3:function(e,t,n){this.putInternal$14(e,t,n)},putFloat$4:function(e,t,n,i){this.putInternal$15(e,t,n,i)},putString:function(e,t){var n;if(System.String.isNullOrEmpty(e))this.putBoolean(!1);else{this.putBoolean(!0);var i=System.Text.Encoding.UTF8.GetBytes$2(e);switch(t){case Client.Common.Networks.StringRange.UTF:Client.Common.Networks.RangesUtils.checkLimit$2(t,System.Int64(i.length)),127<i.length?(this.putInternal$7(128|127&i.length,Client.Common.Networks.URange.U255),this.putInternal$7(i.length>>7,Client.Common.Networks.URange.U255)):this.putInternal$7(i.length,Client.Common.Networks.URange.U255),n=Bridge.getEnumerator(i);try{for(;n.moveNext();){var r=n.Current;this.putInternal$10(System.Int64(r),Client.Common.Networks.URange.U255)}}finally{Bridge.is(n,System.IDisposable)&&n.System$IDisposable$Dispose()}break;case Client.Common.Networks.StringRange.Bit5:case Client.Common.Networks.StringRange.Token:Client.Common.Networks.RangesUtils.checkLimit$2(t,System.Int64(e.length)),this.putInternal$7(e.length,Client.Common.Networks.URange.U31);var s=System.String.toCharArray(e,0,e.length);if(t===Client.Common.Networks.StringRange.Bit5){var o=this.bit5StringEncoder.getTokenCharToByte(),a=Bridge.getEnumerator(s);try{for(;a.moveNext();){var u=a.Current;this.putInternal(o.getItem(u),Client.Common.Networks.Bit5StringEncoder.CHAR_LENGTH)}}finally{Bridge.is(a,System.IDisposable)&&a.System$IDisposable$Dispose()}}else{var l=this.tokenStringEncoder.getTokenCharToByte(),c=Bridge.getEnumerator(s);try{for(;c.moveNext();){var m=c.Current;this.putInternal(l.getItem(m),Client.Common.Networks.TokenStringEncoder.CHAR_LENGTH)}}finally{Bridge.is(c,System.IDisposable)&&c.System$IDisposable$Dispose()}}}}},putString$1:function(e,t,n){var i;if(null!=e&&0!==e.length){Client.Common.Networks.RangesUtils.checkLimit(t,System.Int64(e.length)),this.putBoolean(!0);var r=e.length;this.putInt$1(r,t),i=Bridge.getEnumerator(e);try{for(;i.moveNext();){var s=i.Current;this.putString(s,n)}}finally{Bridge.is(i,System.IDisposable)&&i.System$IDisposable$Dispose()}}else this.putBoolean(!1)},getBoolean:function(){return this.getBooleanInternal()},getBooleanArray:function(e){return this.getBooleanArray$1(e,Client.Common.Networks.Packer.MAXIMUM_BOOLEAN_ARRAY_ALLOW)},getBooleanArray$1:function(e,t){if(!this.getBooleanInternal())return System.Array.init(0,!1,System.Boolean);for(var n=this.getInt$1(e,t),i=System.Array.init(n,!1,System.Boolean),r=0;r<n;r=r+1|0)i[System.Array.index(r,i)]=this.getBooleanInternal();return i},getBooleanArray$2:function(e,t,n){if(!this.getBooleanInternal())return System.Array.init(0,null,System.Array.type(System.Boolean));for(var i=this.getInt$1(e,t),r=System.Array.init(i,null,System.Array.type(System.Boolean)),s=0;s<i;s=s+1|0)r[System.Array.index(s,r)]=this.getBooleanArray$1(e,n);return r},getByte:function(e){return this.getByte$1(e,Client.Common.Networks.Packer.BYTE_SIZE)},getByte$1:function(e,t){return this.throwLengthIfNeed$2(e,t),this.getByteInternal$1(t)},getByteArray:function(e){return this.getByteArray$1(e,Client.Common.Networks.Packer.MAXIMUM_BYTE_ARRAY_ALLOW,Client.Common.Networks.Packer.BYTE_SIZE)},getByteArray$1:function(e,t,n){if(!this.getBooleanInternal())return System.Array.init(0,0,System.Byte);for(var i=this.getInt$1(e,t),r=System.Array.init(i,0,System.Byte),s=0;s<i;s=s+1|0)r[System.Array.index(s,r)]=this.getByteInternal$1(n);return r},getByteArray$2:function(e,t,n,i){if(!this.getBooleanInternal())return System.Array.init(0,null,System.Array.type(System.Byte));for(var r=this.getInt$1(e,t),s=System.Array.init(r,null,System.Array.type(System.Byte)),o=0;o<r;o=o+1|0)s[System.Array.index(o,s)]=this.getByteArray$1(e,n,i);return s},getShort:function(e){return this.getShort$1(e,Client.Common.Networks.Packer.SHORT_SIZE)},getShort$1:function(e,t){return this.throwLengthIfNeed$2(e,t),this.getShortInternal$1(t)},getShortArray:function(e){return this.getShortArray$1(e,Client.Common.Networks.Packer.MAXIMUM_SHORT_ARRAY_ALLOW,Client.Common.Networks.Packer.SHORT_SIZE)},getShortArray$1:function(e,t,n){if(!this.getBooleanInternal())return System.Array.init(0,0,System.Int16);for(var i=this.getInt$1(e,t),r=System.Array.init(i,0,System.Int16),s=0;s<i;s=s+1|0)r[System.Array.index(s,r)]=this.getByteInternal$1(n);return r},getShortArray$2:function(e,t,n,i){if(!this.getBooleanInternal())return System.Array.init(0,null,System.Array.type(System.Int16));for(var r=this.getInt$1(e,t),s=System.Array.init(r,null,System.Array.type(System.Int16)),o=0;o<r;o=o+1|0)s[System.Array.index(o,s)]=this.getShortArray$1(e,n,i);return s},getInt:function(e){return this.getInt$3(e,Client.Common.Networks.Packer.INT_SIZE)},getInt$3:function(e,t){return this.throwLengthIfNeed$2(e,t),this.getIntInternal$2(t)},getInt$2:function(e,t){return this.throwLengthIfNeed$1(e,t),this.getIntInternal$1(t)},getInt$1:function(e,t){return this.throwLengthIfNeed(e,t),this.getIntInternal(t)},getIntArray:function(e){return this.getIntArray$2(e,Client.Common.Networks.Packer.MAXIMUM_INTEGER_ARRAY_ALLOW,Client.Common.Networks.Packer.INT_SIZE)},getIntArray$1:function(e,t){return this.getIntArray$2(e,t,Client.Common.Networks.Packer.INT_SIZE)},getIntArray$2:function(e,t,n){if(!this.getBooleanInternal())return System.Array.init(0,0,System.Int32);for(var i=this.getInt$1(e,t),r=System.Array.init(i,0,System.Int32),s=0;s<i;s=s+1|0)r[System.Array.index(s,r)]=this.getIntInternal$2(n);return r},getIntArray$3:function(e,t,n,i){if(!this.getBooleanInternal())return System.Array.init(0,null,System.Array.type(System.Int32));for(var r=this.getInt$1(e,t),s=System.Array.init(r,null,System.Array.type(System.Int32)),o=0;o<r;o=o+1|0)s[System.Array.index(o,s)]=this.getIntArray$2(e,n,i);return s},getLong:function(e){return this.getLong$1(e,Com.Slotty.Connector.Common.Packet.Packer.LONG_SIZE)},getLong$2:function(e,t){System.Int64(0);return this.throwLengthIfNeed$2(e,t),this.getLongInternal(t)},getLong$1:function(e,t){System.Int64(0);return this.throwLengthIfNeed$1(e,t),this.getLongInternal$1(t)},getLongArray:function(e){return this.getLongArray$1(e,Client.Common.Networks.Packer.MAXIMUM_LONG_ARRAY_ALLOW,Client.Common.Networks.Packer.LONG_SIZE)},getLongArray$1:function(e,t,n){var i=null;if(this.getBooleanInternal())for(var r=this.getInt$1(e,t),i=function(e){for(var t=[];0<e--;)t.push(0);return t}(r),s=0;s<r;s++)i[s]=this.getLongInternal(n);else i=[];return i},getLongArray$2:function(e,t,n,i){var r=null;if(this.getBooleanInternal())for(var s=this.getInt$1(e,t),r=new Array(s),o=0;o<s;o++)r[o]=this.getLongArray$(e,n,i);else r=[];return r},getFloat:function(e){return this.getFloat$1(e,Client.Common.Networks.Packer.FLOAT_SIZE)},getFloat$1:function(e,t){return this.throwLengthIfNeed$2(e,t),this.getFloatInternal$1(t)},getFloatArray:function(e){return this.getFloatArray$3(e,Client.Common.Networks.Packer.MAXIMUM_FLOAT_ARRAY_ALLOW,Client.Common.Networks.Packer.FLOAT_SIZE)},getFloatArray$1:function(e,t){if(!this.getBooleanInternal())return System.Array.init(0,0,System.Single);for(var n=this.getInt$1(e,t),i=System.Array.init(n,0,System.Single),r=0;r<n;r=r+1|0)i[System.Array.index(r,i)]=this.getFloatInternal$1(Client.Common.Networks.Packer.FLOAT_SIZE);return i},getFloatArray$3:function(e,t,n){if(!this.getBooleanInternal())return System.Array.init(0,0,System.Single);for(var i=this.getInt$1(e,t),r=System.Array.init(i,0,System.Single),s=0;s<i;s=s+1|0)r[System.Array.index(s,r)]=this.getFloatInternal$1(n);return r},getFloatArray$2:function(e,t,n,i){if(!this.getBooleanInternal())return System.Array.init(0,null,System.Array.type(System.Single));for(var r=this.getInt$1(e,t),s=System.Array.init(r,null,System.Array.type(System.Single)),o=0;o<r;o=o+1|0)s[System.Array.index(o,s)]=this.getFloatArray$3(e,n,i);return s},getBooleanInternal:function(){return this.data.getItem(Bridge.identity(this.readCursor,this.readCursor=this.readCursor+1|0))},getByteInternal$1:function(e){for(var t=0,n=0;n<e;n=n+1|0)t=255&(t|this.nextBit()<<n%Client.Common.Networks.Packer.BYTE_SIZE&255);return t},getByteInternal:function(e){for(var t=0,n=0;n<e;n=n+1|0)t=255&(t|this.nextBit()<<n%Client.Common.Networks.Packer.BYTE_SIZE&255);return t},getShortInternal$1:function(e){for(var t=0,n=0;n<e;n=n+1|0)t=Bridge.Int.sxs(65535&(t|Bridge.Int.sxs(this.nextBit()<<n%Client.Common.Networks.Packer.SHORT_SIZE&65535)));return t},getShortInternal:function(e){for(var t=0,n=0;n<e;n=n+1|0)t=Bridge.Int.sxs(65535&(t|Bridge.Int.sxs(this.nextBit()<<n%Client.Common.Networks.Packer.SHORT_SIZE&65535)));return t},getIntInternal$2:function(e){for(var t=0,n=0;n<e;n=n+1|0)t|=this.nextBit()<<n%Client.Common.Networks.Packer.INT_SIZE;return t},getIntInternal$1:function(e){for(var t=0,n=0;n<e;n=n+1|0)t|=this.nextBit()<<n%Client.Common.Networks.Packer.INT_SIZE;var i=Client.Common.Networks.RangesUtils.GetLimitMinMax$1(e).value;return 0<(t&1<<e-1>>>0)>>>0&&(t|=~i),t},getIntInternal:function(e){for(var t=0,n=0;n<e;n=n+1|0)t|=this.nextBit()<<n%Client.Common.Networks.Packer.INT_SIZE;return t},getLongInternal$2:function(e){for(var t,n=0,i=0,r=0,s=0,o=0;o<e;o=o+1|0){var a=System.Int64(this.nextBit());o<16?n|=a.shl(o%16):o<32?i|=a.shl(o%16):o<48?r|=a.shl(o%16):s|=a.shl(o%16)}return t=s*System.Int64([0,65536])+r*System.Int64([0,1])+i*System.Int64(65536)+n,System.Int64(t)},getLongInternal$1:function(e){for(var t=0,n=0,i=0,r=0,s=0,o=0;o<e;o=o+1|0){var a=System.Int64(this.nextBit());o<16?n|=a.shl(o%16):o<32?i|=a.shl(o%16):o<48?r|=a.shl(o%16):s|=a.shl(o%16)}t=s*System.Int64([0,65536])+r*System.Int64([0,1])+i*System.Int64(65536)+n;var u=Client.Common.Networks.RangesUtils.GetLimitMinMax$1(e).value;return 0<(t&1<<e-1>>>0)>>>0&&(t|=~u),System.Int64(t)},getLongInternal:function(e){for(var t,n=0,i=0,r=0,s=0,o=0;o<e;o=o+1|0){var a=System.Int64(this.nextBit());o<16?n|=a.shl(o%16):o<32?i|=a.shl(o%16):o<48?r|=a.shl(o%16):s|=a.shl(o%16)}return t=s*System.Int64([0,65536])+r*System.Int64([0,1])+i*System.Int64(65536)+n,System.Int64(t)},getFloatInternal$1:function(e){for(var t=0,n=0;n<e;n=n+1|0)t|=this.nextBit()<<n%Client.Common.Networks.Packer.FLOAT_SIZE;var i=System.BitConverter.getBytes$4(t);return 10*System.BitConverter.toSingle(i,0)/10},getFloatInternal:function(e){for(var t=0,n=0;n<e;n=n+1|0)t|=this.nextBit()<<n%Client.Common.Networks.Packer.FLOAT_SIZE;var i=System.BitConverter.getBytes$4(t);return System.BitConverter.toSingle(i,0)},getString:function(e,t){if(!this.getBoolean())return"";switch(t){case Client.Common.Networks.StringRange.UTF:var n=this.getIntInternal$2(Client.Common.Networks.URange.U255);0<(128&n)&&(n=127&n|this.getIntInternal$2(Client.Common.Networks.URange.U255)<<7);for(var i=System.Array.init(n,0,System.Byte),r=0;r<n;r=r+1|0)i[System.Array.index(r,i)]=255&this.getIntInternal$2(Client.Common.Networks.URange.U255);return System.Text.Encoding.UTF8.GetString(i);case Client.Common.Networks.StringRange.Bit5:case Client.Common.Networks.StringRange.Token:var s=this.getIntInternal$2(Client.Common.Networks.URange.U31),o=System.Array.init(s,0,System.Char);if(t===Client.Common.Networks.StringRange.Bit5)for(var a=this.bit5StringEncoder.getTokenByteToChar(),u=0;u<s;u=u+1|0)o[System.Array.index(u,o)]=a.getItem(255&this.getIntInternal$2(Client.Common.Networks.Bit5StringEncoder.CHAR_LENGTH));else for(var l=this.tokenStringEncoder.getTokenByteToChar(),c=0;c<s;c=c+1|0)o[System.Array.index(c,o)]=l.getItem(255&this.getIntInternal$2(Client.Common.Networks.TokenStringEncoder.CHAR_LENGTH));return System.String.fromCharArray(o)}return""},getString$1:function(e,t,n){if(!this.getBoolean())return System.Array.init(0,null,System.String);for(var i=this.getIntInternal(n),r=System.Array.init(i,null,System.String),s=0;s<i;s=s+1|0)r[System.Array.index(s,r)]=this.getString(e,t);return r},nextBit:function(){return this.data.getItem(Bridge.identity(this.readCursor,this.readCursor=this.readCursor+1|0))?1:0},putInternal$6:function(e,t){for(var n=0;n<t;n=n+1|0)this.putBitInternal(1==(e>>n&1))},putInternal:function(e,t){for(var n=0;n<t;n=n+1|0)this.putBitInternal(1==(e>>n&1))},putInternal$3:function(e,t){for(var n=0;n<t;n=n+1|0)this.putBitInternal(1==(e>>n&1))},putInternal$7:function(e,t){for(var n=0;n<t;n=n+1|0)this.putBitInternal(1==(e>>n&1))},putInternal$10:function(e,t){for(var n=0;n<t;n=n+1|0)this.putBitInternal(1==(e>>n&1))},putInternal$13:function(e,t){e=System.BitConverter.getBytes$6(e);System.Array.reverse(e);for(var n=System.BitConverter.toInt32(e,0),i=0;i<t;i=i+1|0)this.putBitInternal(1==(n>>i&1))},putInternal$1:function(e,t,n){if(null!=e&&0!==e.length){this.putBoolean(!0);var i=e.length;this.putInternal$6(i,t);for(var r=0;r<i;r=r+1|0)this.putInternal(e[System.Array.index(r,e)],n)}else this.putBoolean(!1)},putInternal$4:function(e,t,n){if(null!=e&&0!==e.length){this.putBoolean(!0);var i=e.length;this.putInternal$6(i,t);for(var r=0;r<i;r=r+1|0)this.putInternal$3(e[System.Array.index(r,e)],n)}else this.putBoolean(!1)},putInternal$8:function(e,t,n){if(null!=e&&0!==e.length){this.putBoolean(!0);var i=e.length;this.putInternal$6(i,t);for(var r=0;r<i;r=r+1|0)this.putInternal$7(e[System.Array.index(r,e)],n)}else this.putBoolean(!1)},putInternal$11:function(e,t,n){if(null!=e&&0!==e.length){this.putBoolean(!0);var i=e.length;this.putInternal$6(i,t);for(var r=0;r<i;r=r+1|0)this.putInternal$10(e[System.Array.index(r,e)],n)}else this.putBoolean(!1)},putInternal$14:function(e,t,n){if(null!=e&&0!==e.length){this.putBoolean(!0);var i=e.length;this.putInternal$6(i,t);for(var r=0;r<i;r=r+1|0)this.putInternal$13(e[System.Array.index(r,e)],n)}else this.putBoolean(!1)},putInternal$2:function(e,t,n,i){if(null!=e&&0!==e.length){this.putBoolean(!0);var r=e.length;this.putInternal$6(r,t);for(var s=0;s<r;s=s+1|0)this.putInternal$1(e[System.Array.index(s,e)],n,i)}else this.putBoolean(!1)},putInternal$5:function(e,t,n,i){if(null!=e&&0!==e.length){this.putBoolean(!0);var r=e.length;this.putInternal$6(r,t);for(var s=0;s<r;s=s+1|0)this.putInternal$4(e[System.Array.index(s,e)],n,i)}else this.putBoolean(!1)},putInternal$9:function(e,t,n,i){if(null!=e&&0!==e.length){this.putBoolean(!0);var r=e.length;this.putInternal$6(r,t);for(var s=0;s<r;s=s+1|0)this.putInternal$8(e[System.Array.index(s,e)],n,i)}else this.putBoolean(!1)},putInternal$12:function(e,t,n,i){if(null!=e&&0!==e.length){this.putBoolean(!0);var r=e.length;this.putInternal$6(r,t);for(var s=0;s<r;s=s+1|0)this.putInternal$11(e[System.Array.index(s,e)],n,i)}else this.putBoolean(!1)},putInternal$15:function(e,t,n,i){if(null!=e&&0!==e.length){this.putBoolean(!0);var r=e.length;this.putInternal$6(r,t);for(var s=0;s<r;s=s+1|0)this.putInternal$14(e[System.Array.index(s,e)],n,i)}else this.putBoolean(!1)},putBitInternal:function(e){this.data.setItem(Bridge.identity(this.numBits,this.numBits=this.numBits+1|0),e)},throwLengthIfNeed$2:function(e,t){if((this.readCursor+t|0)>this.numBits)throw new System.Exception("Out of bound error("+(e||"")+"), read: "+this.readCursor+", numBits: "+this.numBits)},throwLengthIfNeed$1:function(e,t){if((this.readCursor+t|0)>this.numBits)throw new System.Exception("Out of bound error("+(e||"")+"), read: "+this.readCursor+", numBits: "+this.numBits)},throwLengthIfNeed:function(e,t){if((this.readCursor+t|0)>this.numBits)throw new System.Exception("Out of bound error("+(e||"")+"), read: "+this.readCursor+", numBits: "+this.numBits)},hasNext:function(){return 8<=(this.numBits-this.readCursor|0)},pad:function(){for(var e=8-this.numBits%Client.Common.Networks.Packer.BYTE_SIZE|0,t=0;t<e;t=t+1|0)this.putBoolean(!1)},clear:function(){this.data=new System.Collections.BitArray.$ctor3(this.maxSizeAllow),this.numBits=0,this.readCursor=0},toBytes:function(){this.pad();for(var e=System.Array.init(0|Bridge.Int.div(this.numBits,8),0,System.Byte),t=0;t<e.length;t=t+1|0)e[System.Array.index(t,e)]=this.getByteInternal$1(Client.Common.Networks.URange.U255);return e},toHex:function(){return Client.Common.Networks.Packer.bytesToHex(this.toBytes())},putPoint:function(e){var t={v:new Client.Common.Networks.PointRange},n=Client.Common.Networks.Packer.GetBitSize$1(System.Int64.clip32(e),t);this.putInt$2(t.v,Client.Common.Networks.URange.U3),this.putLong$1(e,Client.Common.Networks.Packer.GetPointUrange(n))},putPoint$1:function(e,t){if(null!=e&&0!==e.length){this.putBoolean(!0);var n=e.length;this.putInternal$6(n,t);for(var i=0;i<n;i=i+1|0)this.putPoint(e[System.Array.index(i,e)])}else this.putBoolean(!1)},putPoint$2:function(e,t,n){if(null!=e&&0!==e.length){this.putBoolean(!0);var i=e.length;this.putInternal$6(i,t);for(var r=0;r<i;r=r+1|0)this.putPoint$1(e[System.Array.index(r,e)],n)}else this.putBoolean(!1)},getPoint:function(e){var t=this.getInt$3(e,Client.Common.Networks.URange.U3),t=Client.Common.Networks.Packer.GetBitSize(t);return this.getLong$2(e,Client.Common.Networks.Packer.GetPointUrange(t))},getPointArray:function(e,t){var n=null;if(this.getBooleanInternal())for(var i=this.getInt$1(e,t),n=function(e){for(var t=[];0<e--;)t.push(0);return t}(i),r=0;r<i;r++)n[r]=this.getPoint(e);else n=[];return n},getPointArray$1:function(e,t,n){var i=null;if(this.getBooleanInternal())for(var r=this.getInt$1(e,t),i=new Array(r),s=0;s<r;s=s+1|0)i[s]=this.getPointArray(e,n);else i=[];return i}}}),Bridge.define("Client.Common.Networks.PointRange",{$kind:"enum",statics:{fields:{MiniPoint:0,SmallPoint:1,MidPoint:2,Point:3}}}),Bridge.define("Client.Common.Networks.PointRangeSize",{statics:{fields:{MiniPointBitSize:0,SmallPointBitSize:0,MidPointBitSize:0,PointBitSize:0,MiniPointMaxSize:System.Int64(0),SmallPointMaxSize:System.Int64(0),MidPointMaxSize:System.Int64(0),PointMaxSize:System.Int64(0)},ctors:{init:function(){this.MiniPointBitSize=17,this.SmallPointBitSize=24,this.MidPointBitSize=30,this.PointBitSize=37,this.MiniPointMaxSize=System.Int64(131071),this.SmallPointMaxSize=System.Int64(16777215),this.MidPointMaxSize=System.Int64(1073741823),this.PointMaxSize=System.Int64([1215752191,23])}},methods:{GetBitSize:function(e){switch(e){case Client.Common.Networks.PointRange.MiniPoint:return Client.Common.Networks.PointRangeSize.MiniPointBitSize;case Client.Common.Networks.PointRange.SmallPoint:return Client.Common.Networks.PointRangeSize.SmallPointBitSize;case Client.Common.Networks.PointRange.MidPoint:return Client.Common.Networks.PointRangeSize.MidPointBitSize;case Client.Common.Networks.PointRange.Point:return Client.Common.Networks.PointRangeSize.PointBitSize}throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Maximum value is {0}, point-range: {1}",Client.Common.Networks.PointRangeSize.PointMaxSize,Bridge.box(e,Client.Common.Networks.PointRange,System.Enum.toStringFn(Client.Common.Networks.PointRange))))},GetBitSize$1:function(e,t){if(e.lte(Client.Common.Networks.PointRangeSize.MiniPointMaxSize))return t.v=Client.Common.Networks.PointRange.MiniPoint,Client.Common.Networks.PointRangeSize.MiniPointBitSize;if(e.lte(Client.Common.Networks.PointRangeSize.SmallPointMaxSize))return t.v=Client.Common.Networks.PointRange.SmallPoint,Client.Common.Networks.PointRangeSize.SmallPointBitSize;if(e.lte(Client.Common.Networks.PointRangeSize.MidPointMaxSize))return t.v=Client.Common.Networks.PointRange.MidPoint,Client.Common.Networks.PointRangeSize.MidPointBitSize;if(e.lte(Client.Common.Networks.PointRangeSize.PointMaxSize))return t.v=Client.Common.Networks.PointRange.Point,Client.Common.Networks.PointRangeSize.PointBitSize;throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Maximum value is {0}, value: {1}",Client.Common.Networks.PointRangeSize.PointMaxSize,e))},CheckLimit:function(e,t){if(t.gt(Client.Common.Networks.PointRangeSize.PointMaxSize))throw new System.ArgumentOutOfRangeException.$ctor4(e,System.String.format("Maximum value is {0}, value: {1}",Client.Common.Networks.PointRangeSize.PointMaxSize,t))}}}}),Bridge.define("Client.Common.Networks.RangesUtils",{statics:{methods:{GetLimitMinMax$3:function(e){switch(e){case Client.Common.Networks.URange.U3:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(3));case Client.Common.Networks.URange.U7:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(7));case Client.Common.Networks.URange.U15:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(15));case Client.Common.Networks.URange.U31:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(31));case Client.Common.Networks.URange.U63:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(63));case Client.Common.Networks.URange.U127:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(127));case Client.Common.Networks.URange.U255:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(255));case Client.Common.Networks.URange.U511:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(511));case Client.Common.Networks.URange.U1023:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(1023));case Client.Common.Networks.URange.U2047:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(2047));case Client.Common.Networks.URange.U4095:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(4095));case Client.Common.Networks.URange.U8191:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(8191));case Client.Common.Networks.URange.U16383:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(16383));case Client.Common.Networks.URange.U32767:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(32767));case Client.Common.Networks.URange.U65535:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(65535));case Client.Common.Networks.URange.U131071:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(131071));case Client.Common.Networks.URange.U262143:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(262143));case Client.Common.Networks.URange.U524287:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(524287));case Client.Common.Networks.URange.U1048575:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(1048575));case Client.Common.Networks.URange.U24b:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(16777215));case Client.Common.Networks.URange.U30b:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(1073741823));case Client.Common.Networks.URange.UInt:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(4294967295));case Client.Common.Networks.URange.U37b:default:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64([1215752191,23]))}},GetLimitMinMax$1:function(e){switch(e){case Client.Common.Networks.SRange.I7:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-8),System.Int64(7));case Client.Common.Networks.SRange.I15:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-16),System.Int64(15));case Client.Common.Networks.SRange.I31:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-32),System.Int64(31));case Client.Common.Networks.SRange.I63:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-64),System.Int64(63));case Client.Common.Networks.SRange.I127:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-128),System.Int64(127));case Client.Common.Networks.SRange.I255:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-256),System.Int64(255));case Client.Common.Networks.SRange.I511:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-512),System.Int64(511));case Client.Common.Networks.SRange.I1023:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-1024),System.Int64(1023));case Client.Common.Networks.SRange.I2047:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-2048),System.Int64(2047));case Client.Common.Networks.SRange.I4095:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-4096),System.Int64(4095));case Client.Common.Networks.SRange.I8191:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-8192),System.Int64(8191));case Client.Common.Networks.SRange.I16383:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-16384),System.Int64(16383));case Client.Common.Networks.SRange.I32767:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-32768),System.Int64(32767));case Client.Common.Networks.SRange.I65535:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-65536),System.Int64(65535));case Client.Common.Networks.SRange.I131071:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-131072),System.Int64(131071));case Client.Common.Networks.SRange.I262143:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-262144),System.Int64(262143));case Client.Common.Networks.SRange.I524287:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-524288),System.Int64(524287));case Client.Common.Networks.SRange.S25b:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-16777216),System.Int64(16777215));case Client.Common.Networks.SRange.Int:default:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(-2147483648),System.Int64(2147483647))}},GetLimitMinMax$2:function(e){switch(e){case Client.Common.Networks.StringRange.UTF:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(32767));case Client.Common.Networks.StringRange.Bit5:case Client.Common.Networks.StringRange.Token:default:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(31))}},GetLimitMinMax:function(e){switch(e){case Client.Common.Networks.ArrayRange.U3:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(3));case Client.Common.Networks.ArrayRange.U7:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(7));case Client.Common.Networks.ArrayRange.U15:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(15));case Client.Common.Networks.ArrayRange.U31:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(31));case Client.Common.Networks.ArrayRange.U63:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(63));case Client.Common.Networks.ArrayRange.U127:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(127));case Client.Common.Networks.ArrayRange.U255:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(255));case Client.Common.Networks.ArrayRange.U511:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(511));case Client.Common.Networks.ArrayRange.U1023:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(1023));case Client.Common.Networks.ArrayRange.U2047:default:return new(System.Collections.Generic.KeyValuePair$2(System.Int64,System.Int64).$ctor1)(System.Int64(0),System.Int64(2047))}},checkLimit$3:function(e,t){e=Client.Common.Networks.RangesUtils.GetLimitMinMax$3(e);if(t.lt(e.key))throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Minimum value is {0}, value: {1}",e.key,t));if(t.gt(e.value))throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Maximum value is {0}, value: {1}",e.value,t))},checkLimit$1:function(e,t){e=Client.Common.Networks.RangesUtils.GetLimitMinMax$1(e);if(t.lt(e.key))throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Minimum value is {0}, value: {1}",e.key,t));if(t.gt(e.value))throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Maximum value is {0}, value: {1}",e.value,t))},checkLimit$2:function(e,t){e=Client.Common.Networks.RangesUtils.GetLimitMinMax$2(e);if(t.lt(e.key))throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Minimum value is {0}, value: {1}",e.key,t));if(t.gt(e.value))throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Maximum value is {0}, value: {1}",e.value,t))},checkLimit:function(e,t){e=Client.Common.Networks.RangesUtils.GetLimitMinMax(e);if(t.lt(e.key))throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Minimum value is {0}, value: {1}",e.key,t));if(t.gt(e.value))throw new System.ArgumentOutOfRangeException.$ctor4("value",System.String.format("Maximum value is {0}, value: {1}",e.value,t))}}}}),Bridge.define("Client.Common.Networks.SRange",{$kind:"enum",statics:{fields:{I7:4,I15:5,I31:6,I63:7,I127:8,I255:9,I511:10,I1023:11,I2047:12,I4095:13,I8191:14,I16383:15,I32767:16,I65535:17,I131071:18,I262143:19,I524287:20,S25b:25,Int:32}}}),Bridge.define("Client.Common.Networks.StringRange",{$kind:"enum",statics:{fields:{UTF:0,Bit5:1,Token:2}}}),Bridge.define("Client.Common.Networks.TokenStringEncoder",{statics:{fields:{CHAR_LENGTH:0,token:null},ctors:{init:function(){this.CHAR_LENGTH=Client.Common.Networks.URange.U31,this.token="ybndrfg8ejkmcpqxot1uwisza345h769"}}},fields:{tokenCharToByte:null,tokenByteToChar:null},ctors:{ctor:function(){this.$initialize(),this.tokenCharToByte=System.Linq.Enumerable.from(Client.Common.Networks.TokenStringEncoder.token,System.Char).select(function(e,t){return{Index:t,Char:e}}).toDictionary(function(e){return e.Char},function(e){return 255&e.Index},System.Char,System.Byte),this.tokenByteToChar=System.Linq.Enumerable.from(this.tokenCharToByte,System.Collections.Generic.KeyValuePair$2(System.Char,System.Byte)).toDictionary(function(e){return e.value},function(e){return e.key},System.Byte,System.Char)}},methods:{getTokenCharToByte:function(){return this.tokenCharToByte},getTokenByteToChar:function(){return this.tokenByteToChar}}}),Bridge.define("Client.Common.Networks.URange",{$kind:"enum",statics:{fields:{U3:2,U7:3,U15:4,U31:5,U63:6,U127:7,U255:8,U511:9,U1023:10,U2047:11,U4095:12,U8191:13,U16383:14,U32767:15,U65535:16,U131071:17,U262143:18,U524287:19,U1048575:20,U24b:24,U30b:30,UInt:32,U37b:37}}}),Bridge.define("Client.Common.Networks.URangeStuff",{statics:{methods:{Length:function(e){return e},Value:function(e){return System.Int64(1<<e)},IsBigger:function(e,t){return t<e}}}}),Bridge.define("Client.Common.Packets.IBuilder",{$kind:"interface"}),Bridge.define("Client.Common.Packets.IPacketFactory",{$kind:"interface"}),Bridge.define("Client.Lightstreamer.Models.ICustomMessageResponse",{$kind:"interface"}),Bridge.define("Client.Lightstreamer.Models.ClientData",{fields:{Type:null,Data:null},ctors:{ctor:function(e,t){this.$initialize(),this.Type=e,this.Data=t}}}),Bridge.define("Client.Lightstreamer.Models.CommandType",{$kind:"enum",statics:{fields:{CommandText:0,Shutdown:1,Restart:2,Extract:3,ShutdownOS:4,RestartOS:5,RequestInfo:6,ForceUpdate:7}}}),Bridge.define("Client.Lightstreamer.Models.FreeRound",{fields:{Token:null,BetPoint:null,Add:0,GameCode:null},ctors:{ctor:function(e,t,n,i){this.$initialize(),this.Token=e,this.BetPoint=t,this.Add=n,this.GameCode=i}}}),Bridge.define("Client.Lightstreamer.Models.MessageType",{$kind:"enum",statics:{fields:{Normal:0,Preset:1,PopUp:2,Banner:3,PresetPopUp:4}}}),Bridge.define("Client.Lightstreamer.PacketID",{statics:{fields:{MessageData:0,CompetitionAction:0,PointAction:0,PrizeAction:0,SessionEventAction:0,LuckyDraw:0,CommandAction:0,GameJackpotAction:0,FreeRounds:0,MiniGame:0,JackpotAdapterData:0,RequestAdapterData:0,EnergyBarCurrentStage:0,PrizeSummary:0,AnnouncementSummary:0,LeaderBoardSummary:0},ctors:{init:function(){this.MessageData=10,this.CompetitionAction=11,this.PointAction=12,this.PrizeAction=13,this.SessionEventAction=14,this.LuckyDraw=15,this.CommandAction=16,this.GameJackpotAction=17,this.FreeRounds=18,this.MiniGame=19,this.JackpotAdapterData=20,this.RequestAdapterData=21,this.EnergyBarCurrentStage=22,this.PrizeSummary=23,this.AnnouncementSummary=24,this.LeaderBoardSummary=25}}}}),Bridge.define("Client.Common.Packets.IResponse",{inherits:[Client.Common.Packets.IPacket,Client.Common.Packets.IParser,Client.Common.Packets.IPrototype],$kind:"interface"}),Bridge.define("Client.Common.Packets.PrototypePacketFactory",{inherits:[Client.Common.Packets.IPacketFactory],fields:{prototypes:null},alias:["Register","Client$Common$Packets$IPacketFactory$Register"],ctors:{init:function(){this.prototypes=new(System.Collections.Generic.Dictionary$2(System.Int32,Client.Common.Packets.IResponse).ctor)},ctor:function(){this.$initialize()}},methods:{Register:function(e){var t=e.Client$Common$Packets$IPacket$GetCommandID();this.prototypes.System$Collections$Generic$IDictionary$2$System$Int32$Client$Common$Packets$IResponse$containsKey(t)&&this.prototypes.System$Collections$Generic$IDictionary$2$System$Int32$Client$Common$Packets$IResponse$remove(t),this.prototypes.System$Collections$Generic$IDictionary$2$System$Int32$Client$Common$Packets$IResponse$add(t,e)}}}),Bridge.define("Client.Common.Models.BaseResponse",{inherits:[Client.Common.Packets.IResponse],alias:["Clone","Client$Common$Packets$IPrototype$Clone"],methods:{Clone:function(){return Bridge.cast(Bridge.createInstance(Bridge.getType(this)),Client.Common.Models.BaseResponse)}}}),Bridge.define("Client.Lightstreamer.LightstreamerParser",{inherits:[Client.Common.Packets.PrototypePacketFactory],statics:{fields:{lsParser:null},methods:{GetInstance:function(){return null==Client.Lightstreamer.LightstreamerParser.lsParser&&(Client.Lightstreamer.LightstreamerParser.lsParser=new Client.Lightstreamer.LightstreamerParser),Client.Lightstreamer.LightstreamerParser.lsParser},isDataUsedPacker:function(e,t){return!(System.String.contains(t,"Subscription")||System.String.contains(t,"PRIZE")||System.String.contains(t,"ANNOUNCEMENT")||System.String.contains(t,"LEADER"))}}},ctors:{ctor:function(){this.$initialize(),Client.Common.Packets.PrototypePacketFactory.ctor.call(this),this.Register(new Client.Lightstreamer.Models.MessageData),this.Register(new Client.Lightstreamer.Models.GameJackpotData),this.Register(new Client.Lightstreamer.Models.CompetitionData),this.Register(new Client.Lightstreamer.Models.PointData),this.Register(new Client.Lightstreamer.Models.PrizeData),this.Register(new Client.Lightstreamer.Models.SessionEventData),this.Register(new Client.Lightstreamer.Models.LuckyDrawData),this.Register(new Client.Lightstreamer.Models.CommandData),this.Register(new Client.Lightstreamer.Models.FreeRoundsData),this.Register(new Client.Lightstreamer.Models.MiniGamePrizeData),this.Register(new Client.Lightstreamer.Models.JackpotAdapterData),this.Register(new Client.Lightstreamer.Models.RequestAdapterData),this.Register(new Client.Lightstreamer.Models.EnergyBarCurrentStageData),this.Register(new Client.Lightstreamer.Models.PrizeSummary),this.Register(new Client.Lightstreamer.Models.AnnouncementSummary),this.Register(new Client.Lightstreamer.Models.LeaderBoardSummary)}},methods:{parsingData:function(e){for(var t=null,n=new Array(e.length),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);t=new Uint8Array(n);var r=new Client.Common.Networks.Packer.$ctor1(t);if(r.getBoolean()){var s=r.getInt$3("CommandId",Client.Common.Networks.URange.U1023);if(this.prototypes.System$Collections$Generic$IDictionary$2$System$Int32$Client$Common$Packets$IResponse$containsKey(s)){var t=this.prototypes.System$Collections$Generic$IDictionary$2$System$Int32$Client$Common$Packets$IResponse$getItem(s);(t=Bridge.as(t.Client$Common$Packets$IPrototype$Clone(),Client.Common.Packets.IResponse)).Client$Common$Packets$IParser$Parse(r);if(!this.needConstructData(s))return JSON.stringify(t);if(null!=(s=Bridge.as(t,Client.Lightstreamer.Models.ICustomMessageResponse)))return s.Client$Lightstreamer$Models$ICustomMessageResponse$toCustomMessage();if(null!=(t=Bridge.as(t,Client.Lightstreamer.Models.BaseClientDataResponse)))return t.toClientData()}}return null},needConstructData:function(e){return e!==Client.Lightstreamer.PacketID.JackpotAdapterData},deserializeData:function(e,t,n){return null!=n&&0!==n.length&&Client.Lightstreamer.LightstreamerParser.isDataUsedPacker(e,t)?this.parsingData(n):n}}}),Bridge.define("Client.Lightstreamer.Models.AnnouncementSummary",{inherits:[Client.Common.Models.BaseResponse,Client.Lightstreamer.Models.ICustomMessageResponse],fields:{Message:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse","toCustomMessage","Client$Lightstreamer$Models$ICustomMessageResponse$toCustomMessage"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.AnnouncementSummary},Parse:function(e){this.Message=e.getString("Message",Client.Common.Networks.StringRange.UTF)},toCustomMessage:function(){return this.Message}}}),Bridge.define("Client.Lightstreamer.Models.BaseClientDataResponse",{inherits:[Client.Common.Models.BaseResponse],fields:{ActionType:null},methods:{toClientData:function(){var e=new Client.Lightstreamer.Models.ClientData(this.ActionType,this);return JSON.stringify(e)}}}),Bridge.define("Client.Lightstreamer.Models.LeaderBoardSummary",{inherits:[Client.Common.Models.BaseResponse,Client.Lightstreamer.Models.ICustomMessageResponse],fields:{Message:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse","toCustomMessage","Client$Lightstreamer$Models$ICustomMessageResponse$toCustomMessage"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.LeaderBoardSummary},Parse:function(e){this.Message=e.getString("Message",Client.Common.Networks.StringRange.UTF)},toCustomMessage:function(){return this.Message}}}),Bridge.define("Client.Lightstreamer.Models.PrizeSummary",{inherits:[Client.Common.Models.BaseResponse,Client.Lightstreamer.Models.ICustomMessageResponse],fields:{Message:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse","toCustomMessage","Client$Lightstreamer$Models$ICustomMessageResponse$toCustomMessage"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.PrizeSummary},Parse:function(e){this.Message=e.getString("Message",Client.Common.Networks.StringRange.UTF)},toCustomMessage:function(){return this.Message}}}),Bridge.define("Client.Lightstreamer.Models.RequestAdapterData",{inherits:[Client.Common.Models.BaseResponse,Client.Lightstreamer.Models.ICustomMessageResponse],statics:{fields:{REQUEST_DATA_SEPARATOR:null},ctors:{init:function(){this.REQUEST_DATA_SEPARATOR="=="}}},fields:{StatusCode:0,Message:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse","toCustomMessage","Client$Lightstreamer$Models$ICustomMessageResponse$toCustomMessage"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.RequestAdapterData},Parse:function(e){this.StatusCode=e.getInt$2("StatusCode",Client.Common.Networks.SRange.I2047),this.Message=e.getString("Message",Client.Common.Networks.StringRange.UTF)},toCustomMessage:function(){return this.StatusCode+(Client.Lightstreamer.Models.RequestAdapterData.REQUEST_DATA_SEPARATOR||"")+(this.Message||"")}}}),Bridge.define("Client.Lightstreamer.Models.CommandData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{Type:null,CommandText:null,CommandArgument:null,Filter:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.CommandAction},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF),this.Filter=e.getString("Filter",Client.Common.Networks.StringRange.UTF);var t=e.getInt$3("TypeValue",Client.Common.Networks.URange.U255);this.Type=System.Enum.toString(Client.Lightstreamer.Models.CommandType,t),this.CommandText=e.getString("CommandText",Client.Common.Networks.StringRange.UTF),this.CommandArgument=e.getString("CommandArgument",Client.Common.Networks.StringRange.UTF),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)}}}),Bridge.define("Client.Lightstreamer.Models.CompetitionData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{OCode:null,Name:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.CommandAction},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF),this.OCode=e.getString("OCode",Client.Common.Networks.StringRange.Token),this.Name=e.getString("Name",Client.Common.Networks.StringRange.UTF),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)}}}),Bridge.define("Client.Lightstreamer.Models.EnergyBarCurrentStageData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{stageName:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.EnergyBarCurrentStage},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF),this.stageName=e.getString("StageName",Client.Common.Networks.StringRange.UTF)},toClientData:function(){var e=new Client.Lightstreamer.Models.ClientData(this.ActionType,((e=new Client.Lightstreamer.Models.JackpotAdapterData).name=this.stageName,e.point=0,e.timeout=0,e));return JSON.stringify(e)}}}),Bridge.define("Client.Lightstreamer.Models.FreeRoundsData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],statics:{fields:{ArrayRangeValue:0},ctors:{init:function(){this.ArrayRangeValue=Client.Common.Networks.ArrayRange.U15}}},fields:{freeSpins:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],ctors:{init:function(){this.freeSpins=System.Array.init(0,null,Client.Lightstreamer.Models.FreeRound)}},methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.FreeRounds},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF);var t=e.getString("Token",Client.Common.Networks.StringRange.Token),n=e.getPointArray("BetPoint",Client.Lightstreamer.Models.FreeRoundsData.ArrayRangeValue),i=e.getIntArray$2("Add",Client.Lightstreamer.Models.FreeRoundsData.ArrayRangeValue,Client.Common.Networks.URange.UInt),r=e.getString$1("GameCode",Client.Common.Networks.StringRange.UTF,Client.Lightstreamer.Models.FreeRoundsData.ArrayRangeValue);e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF);for(var s=System.Array.init(r.length,null,Client.Lightstreamer.Models.FreeRound),o=0;o<r.length;o=o+1|0){var a=new Client.Lightstreamer.Models.FreeRound(t,n[System.Array.index(o,n)],i[System.Array.index(o,i)],r[System.Array.index(o,r)]);s[System.Array.index(o,s)]=a}this.freeSpins=s}}}),Bridge.define("Client.Lightstreamer.Models.GameJackpotData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{GameCode:null,WinPoint:null,JackpotType:null,Username:null,Currency:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.GameJackpotAction},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF),this.GameCode=e.getString("GameCode",Client.Common.Networks.StringRange.UTF),this.WinPoint=e.getPoint("WinPoint"),this.JackpotType=e.getString("JackpotType",Client.Common.Networks.StringRange.UTF),this.Username=e.getString("Username",Client.Common.Networks.StringRange.UTF),this.Currency=e.getString("Currency",Client.Common.Networks.StringRange.UTF),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)}}}),Bridge.define("Client.Lightstreamer.Models.JackpotAdapterData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse,Client.Lightstreamer.Models.ICustomMessageResponse],fields:{name:null,timeout:0,point:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse","toCustomMessage","Client$Lightstreamer$Models$ICustomMessageResponse$toCustomMessage"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.JackpotAdapterData},Parse:function(e){this.name=e.getString("Name",Client.Common.Networks.StringRange.UTF),this.timeout=e.getInt$3("Timeout",Client.Common.Networks.URange.U524287),this.point=e.getPoint("Point"),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)},toCustomMessage:function(){return JSON.stringify(this)}}}),Bridge.define("Client.Lightstreamer.Models.LuckyDrawData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{OCode:null,SessionOCode:null,PostLink:null,Display:null,ImageLink:null,Value:0,ItemCode:null,ValueCode:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.LuckyDraw},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF),this.OCode=e.getString("OCode",Client.Common.Networks.StringRange.Token),this.SessionOCode=e.getString("SessionOCode",Client.Common.Networks.StringRange.Token),this.PostLink=e.getString("PostLink",Client.Common.Networks.StringRange.UTF),this.Display=e.getString("Display",Client.Common.Networks.StringRange.UTF),this.ImageLink=e.getString("ImageLink",Client.Common.Networks.StringRange.UTF),this.Value=e.getFloat("Value"),this.ItemCode=e.getString("ItemCode",Client.Common.Networks.StringRange.UTF),this.ValueCode=e.getString("ValueCode",Client.Common.Networks.StringRange.UTF),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)}}}),Bridge.define("Client.Lightstreamer.Models.MessageData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{Type:null,ID:0,Message:null,Preset:0,PresetData:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.MessageData},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF);var t=e.getInt$3("MessageType",Client.Common.Networks.URange.U255);this.Type=System.Enum.toString(Client.Lightstreamer.Models.MessageType,t),t!==Client.Lightstreamer.Models.MessageType.Preset&&t!==Client.Lightstreamer.Models.MessageType.PresetPopUp?this.Message=e.getString("Message",Client.Common.Networks.StringRange.UTF):(this.Preset=e.getInt$3("PresetValue",Client.Common.Networks.URange.U255),this.PresetData=e.getString$1("PresetData",Client.Common.Networks.StringRange.UTF,Client.Common.Networks.ArrayRange.U255)),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)}}}),Bridge.define("Client.Lightstreamer.Models.MiniGamePrizeData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{OCode:null,Type:null,PostLink:null,Values:null,Others:null,Multiplier:0,Theme:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],ctors:{init:function(){this.Multiplier=1}},methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.MiniGame},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF),this.OCode=e.getString("OCode",Client.Common.Networks.StringRange.Token),this.Type=e.getString("Type",Client.Common.Networks.StringRange.UTF),this.PostLink=e.getString("PostLink",Client.Common.Networks.StringRange.UTF);var t=e.getString("Values",Client.Common.Networks.StringRange.UTF);this.Values=JSON.parse(t);t=e.getString("Others",Client.Common.Networks.StringRange.UTF);this.Others=JSON.parse(t),this.Multiplier=e.getInt$3("Multiplier",Client.Common.Networks.URange.U1023),this.Theme=e.getString("Theme",Client.Common.Networks.StringRange.UTF),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)}}}),Bridge.define("Client.Lightstreamer.Models.PointData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{CurrentPoint:null,FreePoint:null,Change:null,FreeChange:null,NotifyUser:!1},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.PointAction},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF),this.CurrentPoint=e.getPoint("CurrentPoint"),this.FreePoint=e.getPoint("FreePoint"),this.Change=e.getLong$1("Change",Client.Common.Networks.SRange.Int),this.FreeChange=e.getLong$1("FreeChange",Client.Common.Networks.SRange.Int),this.NotifyUser=e.getBoolean(),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)}}}),Bridge.define("Client.Lightstreamer.Models.PrizeData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{OCode:null,Type:null,PostLink:null,Display:null,ImageLink:null,Value:0,Data:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.PrizeAction},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF),this.OCode=e.getString("Ocode",Client.Common.Networks.StringRange.Token),this.Type=e.getString("Type",Client.Common.Networks.StringRange.UTF),this.PostLink=e.getString("PostLink",Client.Common.Networks.StringRange.UTF),this.Display=e.getString("Display",Client.Common.Networks.StringRange.UTF),this.ImageLink=e.getString("ImageLink",Client.Common.Networks.StringRange.UTF),this.Value=e.getFloat("Value"),this.Data=e.getString$1("Data",Client.Common.Networks.StringRange.UTF,Client.Common.Networks.ArrayRange.U31),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)}}}),Bridge.define("Client.Lightstreamer.Models.SessionEventData",{inherits:[Client.Lightstreamer.Models.BaseClientDataResponse],fields:{Type:null,Reason:null},alias:["GetCommandID","Client$Common$Packets$IPacket$GetCommandID","Parse","Client$Common$Packets$IParser$Parse"],methods:{GetCommandID:function(){return Client.Lightstreamer.PacketID.SessionEventAction},Parse:function(e){this.ActionType=e.getString("ActionType",Client.Common.Networks.StringRange.UTF),this.Type=e.getString("Type",Client.Common.Networks.StringRange.UTF),this.Reason=e.getString("Reason",Client.Common.Networks.StringRange.UTF),e.getString("CreatedTime",Client.Common.Networks.StringRange.UTF)}}})});;
var helper = {
    isMobile: () => {
        var check = false;
        (function (a, b) { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true })(navigator.userAgent || navigator.vendor || window.opera);
        return check || navigator.userAgent.match(/iPad/i) != null || navigator.userAgent.match(/android/i) != null;
    },

    getParameterByName: (name, url) => {
        if (!url) url = window.location.href;
        url = url.toLowerCase();
        name = name.replace(/[\[\]]/g, "\\$&");
        var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
            results = regex.exec(url);
        if (!results) return null;
        if (!results[2]) return '';
        return decodeURIComponent(results[2].replace(/\+/g, " "));
    },

    isLandscape: () => {
        var object = window.screen.orientation || window.screen.msOrientation || window.screen.mozOrientation || null;
        if (object) {
            if (object.type.indexOf('landscape') !== -1) { return true; }
            if (object.type.indexOf('portrait') !== -1) { return false; }
        }
        if ('orientation' in window) {
            var value = window.orientation;
            if (value === 0 || value === 180) {
                return false;
            } else if (value === 90 || value === 270) {
                return true;
            }
        }
        // fallback to comparing width to height
        return window.innerWidth > window.innerHeight;
    },

    getAllParamsFromUrl: (url) => {
        var regex = /([^=&?]+)=([^&#]*)/g, params = {}, parts, key, value;

        while ((parts = regex.exec(url)) != null) {

            key = parts[1], value = parts[2];
            var isArray = /\[\]$/.test(key);

            if (isArray) {
                key = key.replace('[]', '');
                params[key] = params[key] || [];
                params[key].push(value);
            }
            else {
                params[key] = value;
            }
        }
        return params;
    },

    wrapId: (id, addedId) => {
        if (!id) {
            id = "";
        }
        return id + ":" + addedId;
    },
    unwrapId: (id, addedId) => {
        if (!id) {
            id = "";
        }
        return id.replace(":" + addedId, "");
    },
    correctId: (id, addedId) => {
        if (!id) {
            id = "";
        }
        return id.indexOf(":" + addedId) > -1;
    },

    isFullScreen: () => {
        try {
            var isInFullScreen = (document.fullscreenElement && document.fullscreenElement !== null) ||
                (document.webkitFullscreenElement && document.webkitFullscreenElement !== null) ||
                (document.mozFullScreenElement && document.mozFullScreenElement !== null) ||
                (document.msFullscreenElement && document.msFullscreenElement !== null);

            return isInFullScreen || false;
        }
        catch (ex) { }

        return false;
    },
    setFullScreen: () => {
        try {
            var isInFullScreen = (document.fullscreenElement && document.fullscreenElement !== null) ||
                (document.webkitFullscreenElement && document.webkitFullscreenElement !== null) ||
                (document.mozFullScreenElement && document.mozFullScreenElement !== null) ||
                (document.msFullscreenElement && document.msFullscreenElement !== null);

            var documentElem = document.documentElement;
            if (!isInFullScreen) {
                if (documentElem.requestFullscreen) {
                    documentElem.requestFullscreen();
                } else if (documentElem.mozRequestFullScreen) {
                    documentElem.mozRequestFullScreen();
                } else if (documentElem.webkitRequestFullScreen) {
                    documentElem.webkitRequestFullScreen();
                } else if (documentElem.msRequestFullscreen) {
                    documentElem.msRequestFullscreen();
                }
            }
        }
        catch (ex) { }
    },
    exitFullScreen: () => {
        try {
            if (document.exitFullscreen) {
                document.exitFullscreen();
            } else if (document.mozCancelFullScreen) {
                document.mozCancelFullScreen();
            } else if (document.webkitExitFullscreen) {
                document.webkitExitFullscreen();
            } else if (document.msExitFullscreen) {
                document.msExitFullscreen();
            }
        }
        catch (ex) { }
    }
    
};
Number.prototype.toAmount = function (pointRate) {
    var number = this;
    return number * pointRate;
};

Number.prototype.toPoint = function (pointRate) {
    var number = this;
    return number / pointRate;
}

var SessionModel = function (amount, freeAmount, exists) {
    this.amount = amount;
    this.freeAmount = freeAmount;
    this.exists = exists;
}

var AmountChangeModel = function (data, pointRate, currency, displayCurrency) {
    this.currency = currency;
    this.displayCurrency = displayCurrency;
    this.points = data.Change;
    this.freePoints = data.FreeChange;
    this.change = Math.abs(data.Change).toAmount(pointRate);
    this.freeChange = Math.abs(data.FreeChange).toAmount(pointRate);
    this.currentAmount = Math.abs(data.CurrentPoint).toAmount(pointRate);
    this.currentFreeAmount = Math.abs(data.FreePoint).toAmount(pointRate);
    this.notifyUser = data.NotifyUser;
    this.type = data.Change > 0 || data.FreeChange > 0 ? 'deposit' : 'withdraw';
}

var MiniGameStreamerModel = function (data, pointRate, displayCurrencyCode) {

    this.oCode = data.OCode;
    this.mode = "Normal";

    if (data.ActionType == "MiniGame" && data.Type.indexOf("H") == 0) {
        this.mode = "HighRoller";
    }
    this.type = data.Type;
    if (data.ActionType == "MiniGame") {
        this.type = data.ActionType;
    }

    this.theme = data.Type;

    if (data.Values) {
        this.values = data.Values;
    }
    if (data.Others) {
        this.others = data.Others;
    }
}

var EnergyBarStatusModel = function (data) {
    this.username = data.username;
    this.name = data.name;
    this.point = data.point;
    this.percent = (data.point * 100) / 10000;
    this.type = data.name.indexOf("H") === 0 ? "HighRoller" : "Normal";
    this.theme = ""
    if (data.name.endsWith("_BR") === true || data.name.endsWith("Bronze") === true) {
        this.theme = "Bronze";
    }
    else if (data.name.endsWith("_SI") === true || data.name.endsWith("Silver") === true) {
        this.theme = "Silver";
    }
    else if (data.name.endsWith("_GO") === true || data.name.endsWith("Gold") === true) {
        this.theme = "Gold";
    }
    else if (data.name.endsWith("_DI") === true || data.name.endsWith("Diamond") === true) {
        this.theme = "Diamond";
    }
    else if (data.name.endsWith("_EM") === true || data.name.endsWith("Emerald") === true) {
        this.theme = "Emerald";
    }
}

var JackpotModel = function (data, pointRate) {
    var lobbyJackpot;
    var lobbyHighRollerJackpot;
    var gameJackpots;

    $.each(data, (index, item) => {
        item.value.amount = item.value.point * pointRate;

        if (item.field == "JPHG") {
            item.value.name = "HG";
        }
        if (item.field == "JPE") {
            item.value.name = "JPGrand";
        }

        if (item.field == "LobbyService") {
            lobbyJackpot = item.value;
        }
        else if (item.field == "LobbyServiceHi") {
            lobbyHighRollerJackpot = item.value;
        }
        else {
            if (!gameJackpots) {
                gameJackpots = [];
            }
            gameJackpots.push(item.value);
        }
    })

    return {
        lobbyJackpot: lobbyJackpot,
        lobbyHighRollerJackpot: lobbyHighRollerJackpot,
        gameJackpots: gameJackpots
    }
}

var AnnouncementsModel = function (data) {
    var announcements = [];

    announcements.push(AnnouncementLeaderboardModel(data));
    announcements.push(AnnouncementVideoModel(data));
    announcements = announcements.filter(function (item, index) {
        return item.templateUrl.length > 0;
    });

    return announcements;
}

var AnnouncementVideoModel = function (data) {
    var announcement = {
        isShowIcon: false,
        type: "video",
        templateUrl: "",
        hideIfSeen: false,
        content: {},
        order: 1,
        bagNumber: 0
    };
    $.each(data, function (index, item) {
        if (item.Type.toLowerCase() == announcement.type.toLowerCase()) {
            announcement.templateUrl = item.Localizations[0].Url.split("?")[0];
            announcement.hideIfSeen = item.HideIfSeen;

            $.each(item.Localizations, function (index, localization) {
                var params = helper.getAllParamsFromUrl(localization.Url);
                if (!announcement.content[localization.Language]) {
                    announcement.content[localization.Language] = [];
                }
                var videoUrl = helper.isMobile() == false ? params.videoUrl : params.videoMobileUrl;

                if (videoUrl) {
                    announcement.content[localization.Language].push({
                        id: item.Id,
                        videoUrl: videoUrl,
                        masks: params.masks
                    });
                }
            })
        }
    })

    return announcement;
}
var AnnouncementLeaderboardModel = function (data) {
    var announcement = {
        isShowIcon: true,
        type: "leaderboard",
        templateUrl: "",
        order: 2,
        bagNumber: 0
    };
    $.each(data, function (index, item) {
        if (item.Type.toLowerCase() == announcement.type.toLowerCase()) {
            announcement.templateUrl = item.Localizations[0].Url.split("?")[0];
        }
    })

    return announcement;
}
var AnnouncementLobbyModel = function (templateUrl) {
    var announcement = {
        isShowIcon: true,
        type: "lobby",
        templateUrl: templateUrl,
        order: 3,
        bagNumber: 0
    };

    return announcement;
}
var AnnouncementTournamentModel = function (templateUrl, bagNumber) {
    var announcement = {
        isShowIcon: true,
        type: "tournament",
        templateUrl: templateUrl,
        order: 4,
        bagNumber: bagNumber
    };

    return announcement;
}

var GameDataModel = function (data, currentGameCode, currentGameCategoryCode) {
    data.currentGame = {
        code: currentGameCode,
        categoryCode: currentGameCategoryCode
    }
    return data;
}

var LeaderboardsModel = function (data, leaderboardConfig, publisher) {
    var leaderboardTypes = leaderboardConfig.leaderboardTypes;
    if (leaderboardConfig[publisher.toLocaleLowerCase()] && leaderboardConfig[publisher.toLocaleLowerCase()].leaderboardTypes) {
        leaderboardTypes = leaderboardConfig[publisher].leaderboardTypes;
    }

    var leaderboards = {};
    $.each(data, function (index, item) {
        $.each(item.Localizations, function (index, localization) {
            if (!leaderboardTypes[localization.Language]) {
                leaderboardTypes[localization.Language] = [];
            }
            if (!leaderboardTypes[localization.Language].find(function (x) { return x.type === item.Type })) {
                leaderboardTypes[localization.Language].push({
                    type: item.Type,
                    title: localization.Title
                });
            }

            if (!leaderboards[localization.Language]) {
                leaderboards[localization.Language] = [];
            }

            var leaderboard = {
                id: item.Id,
                type: item.Type,
                startTimeUTC: item.StartTimeUTC,
                endTimeUTC: item.EndTimeUTC,
                scoreFormat: item.ScoreFormat,
                showTime: true
            };
            if (leaderboard.type == "BigWin") {
                leaderboard.showTime = false;
            }

            leaderboards[localization.Language].push(leaderboard);
        })
    })

    return {
        ...leaderboardConfig, leaderboardTypes, leaderboards
    }
}

var LeaderboardWinnersModel = function (response, loginUsername, games, displayCurrency) {
    var winners = [];
    $.each(response.data, function (index, item) {
        try {
            if (item.Info) {
                var info = item.Info;
                item.TimeUtc = info.TimeUTC;
                
                if (info.Info) {
                    var detail = JSON.parse(info.Info);
                    item.OCode = detail.OCode;
                    item.GameName = detail.GameName;
                    if (item.GameName && games[detail.GameCode]) {
                        item.GameNameLocales = games[detail.GameCode].nameLocales;
                    }
                    item.Multiplier = detail.Multiplier;
                    item.Amount = detail.BetAmount || detail.Amount;
                    item.Result = detail.Result || detail.Win;
                    item.ExclusivePass = detail.ExclusivePass;
                    item.Passes = detail.Passes;
                    item.FreeSpins = detail.FreeSpins;
                }
            }
        }
        catch (err) {
        }
        
        var winner = {
            ocode: item.OCode,
            position: item.Position,
            gameName: item.GameName,
            gameNameLocales: item.GameNameLocales,
            timeUtc: item.TimeUtc,
            displayName: item.DisplayName,
            amount: item.Amount,
            freeSpins: item.FreeSpins,
            result: item.Result,
            score: item.Score,
            multiplier: item.Multiplier,
            exclusivePass: item.ExclusivePass,
            passes: item.Passes,
            isActive: item.Username == loginUsername,
            displayCurrency: displayCurrency
        };

        winners.push(winner);
    })


    return {
        isError: false,
        winners: winners,
        requestId: response.requestId
    };
}

var CashdropWinnersModel = function (data, requestCode, requestId) {
    return {
        data: data,
        requestCode: requestCode,
        requestId: requestId
    }
}

var LeaderboardWinnerModel = function (data, requestCode, requestId) {
    return {
        data: data,
        requestCode: requestCode,
        requestId: requestId
    }
};
var LightstreamerApp = function (stream) {
    const prefixCacheKey = "LS_";
    const cacheKeys = {
        LSConfig: prefixCacheKey + "LSConfig:v7",
        GameData: prefixCacheKey + "GameData:v7",
        CompetitionTickets: prefixCacheKey + "CompetitionTickets:v7",
        LeaderboardWinner: (id) => {
            return prefixCacheKey + "LeaderboardWinner:v7" + id;
        }
    }
    localStorageHelper.cleanUp(prefixCacheKey, stream.username);

    const types = {
        SessionEventAction: "SessionEventAction",
        PointAction: "PointAction",
        LobbyService: "LobbyService",
        LobbyServiceHi: "LobbyServiceHi",
        PrizeAction: "PrizeAction",
        MiniGame: "MiniGame",
        FreeRounds: "FreeRounds",
    };
    const cashDropFields = {
        prizeSummary: "PRIZE_SUMMARY",
        prizeProgress: "PRIZE_PROGRESS"
    }
    const adapters = {
        jackpot: {
            value: "JACKPOT"
        },
        direct: {
            value: "DIRECT"
        },
        request: {
            value: "REQUEST"
        },
        powerbar: {
            value: "POWERBAR"
        },
        cashDrop: {
            value: "PRIZE",
            items: ["PRIZE_{Token}_{GameCode}"],
            fields: ["PRIZE_SUMMARY", "PRIZE_PROGRESS"]
        },
        announcement: {
            value: "ANNOUNCEMENT",
            items: ["ANNOUNCEMENT_{Token}_{GameCode}"],
            fields: ["ANNOUNCEMENT"]
        },
        leaderboard: {
            value: "LEADERBOARD",
            items: ["LEADERBOARD_{Token}_{GameCode}"],
            fields: ["LEADERBOARD"]
        }
    }

    const requestCode = {
        HearBeat: '1002',
        SetLastActiveSession: '1003',
        NextEnergyBar: '1004',
        CashDropWinner: '1005',
        LeaderboardWinner: '1006'
    }

    const keyLocalEnergy = 'energy';
    const signOffType = {
        LsSessionClose: "LsSessionClose",
        ClientSignOut: "ClientSignOut"
    };

    const isValidJSON = function (str) {
        try {
            JSON.parse(str);
            return true;
        } catch (e) {
            return false;
        }
    };

    const traceLog = (message) => {
        if (localStorage.getItem("log")) {
            console.log("%cfeature: LightstreamerApp", "color: red", "date:" + (new Date()).toString().split("GMT")[0] + ", message: " + message.substring(0, 200));
        }
    }

    var stackMiniGame = (() => {
        var listItems = [];
        var public = {};
        var isExecuting = false;

        public.execute = () => {
            if (isExecuting === false) {
                if (listItems.length > 0) {
                    isExecuting = true;

                    var item = listItems[0];
                    traceLog('Queue-pullMiniGame:' + JSON.stringify(item));
                    this.sendMiniGame(item);


                    if (item.type == "MiniGame" && item.mode === "Normal") {
                        var dataEnergyBar = new EnergyBarStatusModel({
                            username: this.username,
                            name: item.theme,
                            point: 10000
                        });
                        localStorageHelper.set(keyLocalEnergy, this.username, dataEnergyBar, 10);
                        traceLog('energyBarStatusModel-full:' + JSON.stringify(dataEnergyBar));
                        this.sendCurrentEnergyBar(dataEnergyBar);
                    }
                }
            }
        }

        public.remove = function () {
            traceLog("Queue-dequeueMiniGame");
            isExecuting = false;
            if (listItems.length > 0) {
                listItems.shift();
            }
        };

        public.add = function (inputItem) {
            if (listItems.some(x => x.oCode == inputItem.oCode) == true) {
                return false;
            }

            listItems.push(inputItem);
            return true;
        };

        public.getList = function () {
            return listItems;
        }
        return public;
    })();

    var streamerLockKey = "streamerLock";
    var lock = () => {
        if (localStorage.getItem(streamerLockKey)) {
            return false
        }
        localStorage.setItem(streamerLockKey, 1);
        traceLog("Streamer enabled lock");
        return true
    }
    var unlock = () => {
        traceLog("Streamer disabled lock");
        localStorage.removeItem(streamerLockKey);
    }

    var events = ['beforeunload', 'pagehide'];
    events.forEach(function (itemEvent, i) {
        window.addEventListener(itemEvent, function (event) {
            unlock();
        });
    });

    var subscribeJackpot = null;
    var subscribeDirect = null;
    var subscribeRequest = null;
    var subscribeBroadcast = null;
    var subscribeEnergyBar = null;
    var subscribeCashDropPrize = null;

    var subcribeEmpty = () => {
        return {
            onListenLSChange: () => {
            }
        };
    }

    var subscribe = (token, adapter, mode, isSnapshot, items, fields) => {
        traceLog("subscribe token:" + token + ", adapter: " + adapter + ", mode: " + mode + ", isSnapshot: " + isSnapshot + ", items: " + items + ", fields: " + fields);
        const self = this;
        const adaptertSubscription = new LS.Subscription("MERGE", [adapter + "_Subscription_" + token], ["ItemArray", "FieldArray"]);

        var receiveDataCallBack;
        var createItemSubscription = (mode, adapter, items, fields, isSnapshot) => {
            var itemSubscription = new LS.Subscription(mode);
            itemSubscription.setDataAdapter(adapter);
            itemSubscription.setItems(items);
            itemSubscription.setFields(fields);
            itemSubscription.setRequestedSnapshot(isSnapshot);
            itemSubscription.addListener({
                onItemUpdate: (updateInfo) => {
                    let response = {
                        status: 200,
                        requestCode: "",
                        requestId: "",
                        items: []
                    }

                    updateInfo.forEachChangedField((field, position, value) => {
                        if (value != null) {
                            try {
                                value = Client.Lightstreamer.LightstreamerParser.GetInstance().deserializeData(adapter, field, value);
                            } catch (error) {
                                console.error(error);
                                return;
                            }
                        }
                        else {
                            return;
                        }

                        if (isValidJSON(value) == true) {
                            response.items.push({
                                field: field,
                                value: JSON.parse(value)
                            });

                        } else {
                            let splitStr = value.split('==');
                            var status = splitStr[0];
                            if (status != 200) {
                                response.status = status;
                            }

                            response.requestCode = splitStr[1];
                            response.requestId = splitStr.length > 3 ? splitStr[3] : ""

                            if (isValidJSON(splitStr[2]) == true) {
                                response.items.push({
                                    field: field,
                                    value: JSON.parse(splitStr[2])
                                });
                            }
                            else {
                                response.items.push({
                                    field: field,
                                    value: splitStr[2]
                                });
                            }
                        }
                    });

                    if (response.status && response.status == -1) {
                        if (response.status == -1) {
                            this.isLSConnected = false;
                            this.disconnect();
                            this.sendSignedOff(new SignOffStreamerModel(signOffType.ClientSignOut));
                        }
                        else if (response.responseStatus != 200) {
                            return;
                        }
                    }

                    receiveDataCallBack(response);
                },
                onSubscriptionError: (code, message) => {
                    traceLog(adapter + " onSubscriptionError " + code + ": " + message);
                }
            })

            return itemSubscription;
        };

        if (!items && !fields) {
            adaptertSubscription.setDataAdapter(adapter);
            adaptertSubscription.setRequestedSnapshot("no");
            adaptertSubscription.addListener({
                onItemUpdate: (updateInfo) => {
                    var items, fields;
                    updateInfo.forEachChangedField((field, position, value) => {
                        if (field === "ItemArray") {
                            items = value.split(",");
                        } else if (field === "FieldArray") {
                            fields = value.split(",");
                        }
                    });

                    var itemSubscription = createItemSubscription(mode, adapter, items, fields, isSnapshot);
                    self.client.subscribe(itemSubscription);
                },
                onSubscriptionError: (code, message) => {
                    traceLog(adapter + " onSubscriptionError " + code + ": " + message);
                }
            });
            self.client.subscribe(adaptertSubscription);
            adaptertSubscription.onListenLSChange = (callbackFn) => {
                receiveDataCallBack = callbackFn;
            }
            return adaptertSubscription;
        }
        else {
            var itemSubscription = createItemSubscription(mode, adapter, items, fields, isSnapshot);
            self.client.subscribe(itemSubscription);

            itemSubscription.onListenLSChange = (callbackFn) => {
                receiveDataCallBack = callbackFn;
            }

            return itemSubscription;
        }
    };
    var unsubscribe = (subscribeAdapter) => {
        traceLog("unsubscribe");
        this.client.unsubscribe(subscribeAdapter);
    }

    this.username = stream.username;
    this.token = stream.sessionToken;
    this.hash = stream.sessionHash;
    this.currency = stream.currency;
    this.publisher = stream.publisher;
    this.pointRate = stream.pointRate;
    this.displayCurrency = stream.displayCurrency;
    this.gameCode = stream.gameCode;
    this.gameCategoryCode = stream.gameCategoryCode;
    this.isExternal = stream.isExternal;

    this.isSubcribeJackpot = stream.isSubcribeJackpot;
    this.isSubcribeDirect = stream.isSubcribeDirect;
    this.isSubcribeRequest = stream.isSubcribeRequest;
    this.isSubcribePowerbar = stream.isSubcribePowerbar;
    this.isSubcribeCashdrop = stream.isSubcribeCashdrop;
    this.isSubcribeAnnouncement = stream.isSubcribeAnnouncement;
    this.isSubcribeLeaderboard = stream.isSubcribeLeaderboard;

    this.isLSConnected = false;
    this.isRequestSetLastActive = false;

    this.lightstreamerConfig = localStorageHelper.get(cacheKeys.LSConfig, this.username);
    if (!this.lightstreamerConfig) {
        $.ajax("/Service/GetConfig", {
            data: { key: "LightStreamer" },
            dataType: 'json',
            method: 'GET',
            async: false
        }).then((result) => {
            this.lightstreamerConfig = JSON.parse(result.Data);
            localStorageHelper.set(cacheKeys.LSConfig, this.username, this.lightstreamerConfig, 1 * 15);
        }).fail((xhr, status) => {
        });
    }

    this.lightstreamerConfig.host = window.location.protocol === 'https:' ? this.lightstreamerConfig.hostssl : this.lightstreamerConfig.host;
    this.lightstreamerConfig.intervalHearbeat = this.lightstreamerConfig.intervalHearbeat || 5000;
    this.lightstreamerConfig.intervalLastActiveSession = this.lightstreamerConfig.intervalLastActiveSession || (2 * 60 * 1000);
    this.password = encrypt(this.token + ":LOBBY", this.hash, this.hash + this.lightstreamerConfig.privateHash);
    this.client = new LS.LightstreamerClient(this.lightstreamerConfig.host, "LOBBY");
    this.client.connectionDetails.setUser(this.token);
    this.client.connectionDetails.setPassword(this.password);
    this.client.connectionOptions.setRetryDelay(1 * 60 * 1000);
    this.client.connectionOptions.setFirstRetryMaxDelay(1 * 60 * 1000);
    this.client.enableSharing(new LS.ConnectionSharing(this.token, "ATTACH", "CREATE"));

    subscribeJackpot = this.isSubcribeJackpot == true ? subscribe(this.token, adapters.jackpot.value, "MERGE", "no") : subcribeEmpty();
    subscribeDirect = this.isSubcribeDirect == true ? subscribe(this.token, adapters.direct.value, "DISTINCT", "no") : subcribeEmpty();
    subscribeRequest = this.isSubcribeRequest == true ? subscribe(this.token, adapters.request.value, "DISTINCT", "no") : subcribeEmpty();
    subscribeEnergyBar = this.isSubcribePowerbar == true ? subscribe(this.token, adapters.powerbar.value, "DISTINCT", "no") : subcribeEmpty();

    //subscribeBroadcast = subscribe(this.token, "BROADCAST", "MERGE", "no");

    if (this.isSubcribeCashdrop == true) {
        for (var i = 0; i < adapters.cashDrop.items.length; i++) {
            adapters.cashDrop.items[i] = adapters.cashDrop.items[i].replace("{GameCode}", this.gameCode).replace("{Token}", this.token);
        }
        subscribeCashDropPrize = subscribe(this.token, adapters.cashDrop.value, "DISTINCT", "no", adapters.cashDrop.items, adapters.cashDrop.fields);
    }
    else {
        subscribeCashDropPrize = subcribeEmpty();
    }

    if (this.isSubcribeAnnouncement == true) {
        for (var i = 0; i < adapters.announcement.items.length; i++) {
            adapters.announcement.items[i] = adapters.announcement.items[i].replace("{GameCode}", this.gameCode).replace("{Token}", this.token);
        }
        subscribeAnnouncement = subscribe(this.token, adapters.announcement.value, "DISTINCT", "no", adapters.announcement.items, adapters.announcement.fields);
    }
    else {
        subscribeAnnouncement = subcribeEmpty();
    }

    if (this.isSubcribeLeaderboard == true) {
        for (var i = 0; i < adapters.leaderboard.items.length; i++) {
            adapters.leaderboard.items[i] = adapters.leaderboard.items[i].replace("{GameCode}", this.gameCode).replace("{Token}", this.token);
        }
        subscribeLeaderboard = subscribe(this.token, adapters.leaderboard.value, "DISTINCT", "no", adapters.leaderboard.items, adapters.leaderboard.fields);
    }
    else {
        subscribeLeaderboard = subcribeEmpty();
    }

    subscribeDirect.onListenLSChange((response) => {
        traceLog('subscribeDirect:' + JSON.stringify(response));
        response = response.items[0].value;

        if (response.Type === types.SessionEventAction) {
            traceLog("signOffModel");
            if (response.Data.Type !== signOffType.LsSessionClose) {
                this.sendSignedOff();
            }

        }
        else if (response.Type === types.PointAction) {
            var data = new AmountChangeModel(response.Data, this.pointRate, this.currency, this.displayCurrency);
            traceLog('receviceAmountModel:' + JSON.stringify(data));
            this.sendAmount(data);

        }
        else if (response.Type === types.MiniGame || response.Type === types.PrizeAction) {
            var data = new MiniGameStreamerModel(response.Data, this.pointRate, this.displayCurrency);
            traceLog('miniGameStreamerModel:' + JSON.stringify(data));

            var ok = stackMiniGame.add(data);

            if (ok == true) {
                setTimeout(() => {
                    stackMiniGame.execute();
                }, Math.floor(Math.random() * 100) * 50);
            }

        } else if (response.Type === types.FreeRounds) {
            this.sendPrize(response);
        }
    });
    subscribeJackpot.onListenLSChange((response) => {
        traceLog('subscribeJackpot:' + JSON.stringify(response));

        var data = JackpotModel(response.items, this.pointRate);
        this.sendJackpots(data);
    });
    subscribeEnergyBar.onListenLSChange((response) => {
        traceLog("subscribeEnergyBar: " + JSON.stringify(response));
        response = response.items[0].value;;
        response.username = this.username;

        var data = new EnergyBarStatusModel(response);
        if (data.type.toLocaleLowerCase() === 'normal') {
            localStorageHelper.set(keyLocalEnergy, this.username, data, 10);
            this.sendCurrentEnergyBar(data);
        }
    });
    subscribeRequest.onListenLSChange((response) => {
        traceLog("subscribeRequest: " + JSON.stringify(response));

        if (response.requestCode == requestCode.NextEnergyBar) {
            response = response.items[0].value;
            response.username = this.username;
            var data = new EnergyBarStatusModel(response.data[0]);
            if (data.type.toLocaleLowerCase() === 'normal') {
                localStorageHelper.set(keyLocalEnergy, this.username, data, 10);
                this.sendCurrentEnergyBar(data);
            }
        }
        else if (response.requestCode == requestCode.CashDropWinner) {
            var result = CashdropWinnersModel(response.items[0].value, response.requestCode, response.requestId);
            this.sendCashDropWinners(result);
        }
        else if (response.requestCode == requestCode.LeaderboardWinner) {
            response.request = getInternalRequestId(response);
            response.requestId = removeInternalRequestId(response);

            var winnersResult = LeaderboardWinnerModel(response.items[0].value, response.requestCode, response.requestId);

            getGameData(true, true).then((games) => {
                var result = LeaderboardWinnersModel(winnersResult, this.username, games, this.displayCurrency);
                this.sendLeaderboardWinners(result);
            });

            setCacheResponseLeaderboardWinners(winnersResult);
        }
    });
    subscribeCashDropPrize.onListenLSChange((response) => {
        traceLog("subscribeCashDropPrize: " + JSON.stringify(response));

        $.each(response.items, (index, record) => {
            if (record.field == cashDropFields.prizeSummary) {
                if (this.gameCode != "LOBBY"
                    || this.gameCode == "LOBBY" && (!this.lightstreamerConfig.enableCashDropByPublishers || this.lightstreamerConfig.enableCashDropByPublishers.indexOf(this.publisher) > -1)) {
                    this.sendCashDrop(record.value);
                }
            }
            else if (record.field == cashDropFields.prizeProgress) {
                this.sendProgressCashDrop(record.value);
            }
        })
    });
    subscribeAnnouncement.onListenLSChange((response) => {
        traceLog("subscribeAnnouncement: " + JSON.stringify(response));
        response = response.items[0].value;

        var announcements = AnnouncementsModel(response);
        var newAnnouncements = [];
        $.each(announcements, (index, item) => {
            var isEnable = true;
            if (this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes) {
                if (this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["*"]) {
                    isEnable = this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["*"].filter((prefix, index) => {
                        return this.username.indexOf(prefix) == 0;
                    }).length == 0;
                }
                if (isEnable == true) {
                    if (this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes[item.type]) {
                        isEnable = this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes[item.type].filter((prefix, index) => {
                            return this.username.indexOf(prefix) == 0;
                        }).length == 0;
                    }
                }
            }

            if (isEnable == true) {
                item.templateUrl = item.templateUrl.replace("leaderboardTemplateUrl", this.lightstreamerConfig.leaderboardTemplateUrl);
                newAnnouncements.push(item);
            }

        })

        this.sendAnnouncements(announcements);

        unsubscribe(subscribeAnnouncement);
    });
    subscribeLeaderboard.onListenLSChange((response) => {
        traceLog("subscribeLeaderboard: " + JSON.stringify(response));
        response = response.items[0].value;

        this.sendLeaderboards(LeaderboardsModel(response, this.lightstreamerConfig.leaderboardConfig, this.publisher));

        unsubscribe(subscribeLeaderboard);
    });

    this.client.addListener({
        onStatusChange: (status) => {
            traceLog("ServerLS statusChanged: " + status);
            if (status === 'DISCONNECTED:TRYING-RECOVERY' || status === 'DISCONNECTED:WILL-RETRY') {

            }
            else if (status === 'DISCONNECTED') {
                this.isLSConnected = false;
                unlock();
            } else if (status === 'CONNECTED:HTTP-STREAMING' || status === 'CONNECTED:WS-STREAMING') {
                this.isLSConnected = true;
                unlock();
            }
        },
        onServerError: (code, status) => {
            traceLog("ServerLSError statusCode: " + code + "-statusError:" + status);
            if (code == 32) {
                var url = "/Service/GetGameAccess";
                $.get(url + "?token=" + this.token, (result) => {
                    traceLog('Token: "' + this.token + '" is alive');
                }).fail(() => {
                    traceLog('Token: "' + this.token + '" is expired');
                    this.isLSConnected = false;
                    this.disconnect();
                    this.sendSignedOff();
                });
            }
            else if (code == 1) {
                this.isLSConnected = false;
                this.disconnect();
            }
            else {
                unlock();
            }
        }
    });

    setTimeout(() => {
        tryRequestHeartBeat();
    }, 5 * 1000);
    setInterval(() => {
        tryRequestHeartBeat();
        if (this.isLSConnected === true) {
            if (this.isRequestSetLastActive === true) {
                requestSetLastActiveSession();

                $.post("/Service/SetLastActive?token=" + this.token, (result) => { });
            }
        }

    }, this.lightstreamerConfig.intervalHearbeat);

    var tryRequestHeartBeat = () => {
        if (this.isLSConnected === true && this.client.isMaster() === true) {
            traceLog('tryRequestHeartBeat');
            var subscriptions = this.client.getSubscriptions();
            if (subscriptions.filter(d => d.isSubscribed() == true).length > 0) {

                const messesageRQ = "RQ$${sessionOCode}$${code}";
                var message = messesageRQ.replace('{sessionOCode}', this.token).replace('{code}', requestCode.HearBeat);
                traceLog('requestHeartBeat:' + message);
                this.client.sendMessage(message);
            }
            else {
                traceLog('tryRequestHeartBeat - a subscription is failed');
            }
        }
    }

    var requestSetLastActiveSession = () => {
        const messesageRQ = "RQ$${sessionOCode}$${code}";
        var message = messesageRQ.replace('{sessionOCode}', this.token).replace('{code}', requestCode.SetLastActiveSession);
        traceLog('requestSetLastActiveSession:' + message);
        this.client.sendMessage(message);
    }

    var executeConnect = () => {
        if (this.isLSConnected === true) {
            return;
        }

        if (lock() === false) {
            return;
        }

        this.client.connect();
    }

    //Sign Off
    this.sendSignedOff = () => { };
    this.receiveSignedOff = (fncallback) => {
        this.sendSignedOff = fncallback;
    }

    //Balance
    this.sendAmount = () => { };
    this.receiveAmount = (fncallback) => {
        this.sendAmount = fncallback;
    }

    //Prize
    this.sendPrize = () => { };
    this.receivePrize = (fncallback) => {
        this.sendPrize = fncallback;
    }

    //Jackpot
    this.sendJackpots = () => { };
    this.receiveJackpots = (fncallback) => {
        this.sendJackpots = fncallback;
    }


    //MiniGame
    this.sendMiniGame = () => { };
    this.receiveMiniGame = (fncallback) => {
        this.sendMiniGame = fncallback;
    }
    this.removeItemQueueMiniGame = () => {
        stackMiniGame.remove();
        stackMiniGame.execute();
    }

    //PowerBar
    this.sendCurrentEnergyBar = () => { };
    this.receiveCurrentEnergyBar = (fncallback) => {
        this.sendCurrentEnergyBar = fncallback;
    }
    this.requestCurrentEnergyBar = () => {
        var data = localStorageHelper.get(keyLocalEnergy, this.username);
        if (data) {
            var obj = new EnergyBarStatusModel(data);
            this.sendCurrentEnergyBar(obj);
        }
    }
    this.requestNextEnergyBar = (highRoller) => {
        const messesageRQ = highRoller == true ? "RQ$${sessionOCode}$${code}==2" : "RQ$${sessionOCode}$${code}==1";
        var message = messesageRQ.replace('{sessionOCode}', this.token).replace('{code}', requestCode.NextEnergyBar);
        traceLog('requestNextEnergyBar:' + message);
        this.client.sendMessage(message);
    };

    //Set Last Active
    this.runIntervalSetLastActive = () => {
        this.isRequestSetLastActive = true;
    }
    this.stopIntervalSetLastActive = () => {
        this.isRequestSetLastActive = false;
    }


    //Cast Drop
    this.sendCashDrop = () => { };
    this.receiveCashDrop = (fncallback) => {
        this.sendCashDrop = fncallback;
    }

    this.sendProgressCashDrop = () => { };
    this.receiveProgressCashDrop = (fncallback) => {
        this.sendProgressCashDrop = fncallback;
    }

    this.sendCashDropWinners = () => { };
    this.receiveCashDropWinners = (fncallback) => {
        this.sendCashDropWinners = fncallback;
    }
    this.requestCashDropWinners = (request) => {
        const messesageRQ = "RQ$${sessionOCode}$${code}=={id}_{skip}_{limit}=={requestId}";
        var message = messesageRQ.replace('{sessionOCode}', this.token).replace('{code}', requestCode.CashDropWinner)
            .replace("{id}", request.id).replace("{skip}", request.skip).replace("{limit}", request.limit)
            .replace("{requestId}", request.requestId);
        traceLog('requestCashDropWinner:' + message);
        this.client.sendMessage(message);
    }

    //Announcement
    this.sendAnnouncements = () => { };
    this.receiveAnnouncements = (fncallback) => {
        this.sendAnnouncements = fncallback;
        var announcements = [];

        //Video
        var isEnableVideo = true;
        if (this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes) {
            if (this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["*"]) {
                isEnableVideo = this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["*"].filter((prefix, index) => {
                    return this.username.indexOf(prefix) == 0;
                }).length == 0;
            }
            if (isEnableVideo == true) {
                if (this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["video"]) {
                    isEnableVideo = this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["video"].filter((prefix, index) => {
                        return this.username.indexOf(prefix) == 0;
                    }).length == 0;
                }
            }
        }

        if (isEnableVideo == true) {
            if (this.lightstreamerConfig.gameCodesForVideo.indexOf(this.gameCode) > -1) {
                var index = Math.floor(Math.random() * this.lightstreamerConfig.videos.length);
                var localizations = this.lightstreamerConfig.videos[index];

                var announcement = {
                    Id: "Video:xj8xdgdk35umk",
                    Type: "Video",
                    Localizations: localizations,
                    Trigger: "auto",
                    Mode: "popup",
                    HideIfSeen: false,
                    Order: 0
                }

                announcements.push(AnnouncementVideoModel([announcement]));
            }
        }


        //Lobby and Tournament
        var isEnableLobby = true;
        if (this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes) {
            if (this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["*"]) {
                isEnableLobby = this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["*"].filter((prefix, index) => {
                    return this.username.indexOf(prefix) == 0;
                }).length == 0;
            }
            if (isEnableLobby == true) {
                if (this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["lobby"]) {
                    isEnableLobby = this.lightstreamerConfig.disableAnnouncementByKeyAndUserPrefixes["lobby"].filter((prefix, index) => {
                        return this.username.indexOf(prefix) == 0;
                    }).length == 0;
                }
            }
        }

        if (isEnableLobby == true) {
            if (this.lightstreamerConfig.lobbyTemplateUrl) {
                announcements.push(AnnouncementLobbyModel(this.lightstreamerConfig.lobbyTemplateUrl));
            }
        }

        //Tournament
        var isEnableTournament = this.isExternal == true ? false : true;
        if (isEnableTournament == true) {
            if (this.lightstreamerConfig.tournamentTemplateUrl) {
                var sendTournament = () => {
                    this.getCompetitionTickets({}).then((response) => {
                        this.sendAnnouncements([AnnouncementTournamentModel(this.lightstreamerConfig.tournamentTemplateUrl, response.tickets.Valid.length)]);
                        setTimeout(() => {
                            sendTournament();
                        }, 5 * 1000);
                    });
                }

                sendTournament();
            }
        }


        $.each(announcements, (index, item) => {
            item.templateUrl = item.templateUrl.replace("videoTemplateUrl", this.lightstreamerConfig.videoTemplateUrl);
        })

        if (announcements.length > 0) {
            this.sendAnnouncements(announcements);
        }
    }


    //Leadboard
    var addInternalRequestId = (request) => {
        var internalRequestId = {
            id: request.id,
            type: request.type,
            endTimeUTC: request.endTimeUTC
        };

        return request.requestId + "::" + JSON.stringify(internalRequestId);
    }
    var getInternalRequestId = (response) => {
        var jsonInternalRequestId = response.requestId.split("::")[1];
        return JSON.parse(jsonInternalRequestId);
    }
    var removeInternalRequestId = (response) => {
        return response.requestId.split("::")[0];
    }
    var getCacheResponseLeaderboardWinners = (request) => {
        var cacheResponse = localStorageHelper.get(cacheKeys.LeaderboardWinner(request.id), this.username);
        if (!cacheResponse) {
            return null;
        }

        cacheResponse.requestId = request.requestId;
        return cacheResponse;
    }
    var setCacheResponseLeaderboardWinners = (response) => {
        var isRunning = moment.utc() < moment.utc(response.request.endTimeUTC).add(1, "hours");
        if (isRunning == false) {
            localStorageHelper.set(cacheKeys.LeaderboardWinner(response.request.id), this.username, response, 4 * 60);
        }
    }


    this.sendLeaderboards = () => { };
    this.receiveLeaderboards = (fncallback) => {
        this.sendLeaderboards = fncallback;
    }

    this.sendLeaderboardWinners = () => { };
    this.receiveLeaderboardWinners = (fncallback) => {
        this.sendLeaderboardWinners = fncallback;
    }
    this.requestLeaderboardWinners = (request) => {
        var cacheResponse = getCacheResponseLeaderboardWinners(request);
        if (cacheResponse) {
            getGameData(true, true).then((games) => {
                var result = LeaderboardWinnersModel(cacheResponse, this.username, games, this.displayCurrency);
                this.sendLeaderboardWinners(result);
            })

            return;
        }

        request.requestId = addInternalRequestId(request);

        const messesageRQ = "RQ$${sessionOCode}$${code}=={id}_{skip}_{limit}_true=={requestId}";
        var message = messesageRQ.replace('{sessionOCode}', this.token)
            .replace('{code}', requestCode.LeaderboardWinner)
            .replace("{id}", request.id).replace("{skip}", request.skip)
            .replace("{limit}", request.limit)
            .replace("{requestId}", request.requestId);
        traceLog('requestLeaderboardWinners:' + message);
        this.client.sendMessage(message);
    }


    //Game
    this.sendGameData = () => { };
    this.receiveGameData = (fncallback) => {
        this.sendGameData = fncallback;
    }
    this.requestGameData = () => {
        getGameData().then((games) => {
            var lobby = GameDataModel(games, this.gameCode, this.gameCategoryCode);
            this.sendGameData(lobby);
        })
    }

    var getGameData = (gamesOnly, useDictionary) => {
        var modifyResponse = (gameData, gamesOnly, useDictionary) => {
            if (useDictionary == true) {
                var newGames = {};
                $.each(gameData.games, (index, game) => {
                    newGames[game.code] = game;
                })

                gameData.games = newGames;
            }

            if (gamesOnly == true) {
                return gameData.games;
            }

            return gameData;
        }

        var gameData = localStorageHelper.get(cacheKeys.GameData, this.username);
        if (!gameData) {
            return $.ajax("/Service/GetGameData", {
                data: { token: this.token },
                dataType: 'json',
                method: 'GET'
            }).then((result) => {
                localStorageHelper.set(cacheKeys.GameData, this.username, result.Data, 4 * 60);

                return modifyResponse(result.Data, gamesOnly, useDictionary);
            }).fail((xhr, status) => {
            });

        }
        else {
            return new Promise((resolutionFunc, rejectionFunc) => {
                resolutionFunc(modifyResponse(gameData, gamesOnly, useDictionary));
            });

        }
    }



    //Tournament
    this.sendTournamentData = () => { };
    this.receiveTournamentData = (fncallback) => {
        this.sendTournamentData = fncallback;
    }
    this.requestTournamentData = () => {
        var data = { displayCurrency: this.displayCurrency, currency: this.currency, username: this.username };
        this.sendTournamentData({ ...data, ...this.lightstreamerConfig.serverInfo });
    }

    this.getCompetitions = (request) => {
        var url = "";
        if (request.status == "completed") {
            url = "/Service/GetCompletedCompetitions";
        }
        else if (request.status == "active") {
            url = "/Service/GetActiveCompetition";
        }

        return new Promise((resolve, reject) => {
            $.ajax(url, {
                data: { token: this.token },
                dataType: 'json',
                method: 'GET'
            }).then((competitions) => {
                resolve({
                    competitions: competitions,
                    requestId: request.requestId,
                    success: true
                });
            }).fail((xhr, status) => {
                resolve({
                    competitions: [],
                    requestId: request.requestId,
                    success: false
                });
            });
        })

    }
    this.clearCacheCompetitionTickets = () => {
        localStorageHelper.remove(cacheKeys.CompetitionTickets);
    }
    this.getCompetitionTickets = (request) => {
        return new Promise((resolve, reject) => {
            var response = localStorageHelper.get(cacheKeys.CompetitionTickets, this.username);
            if (!response) {
                $.ajax("/Service/GetCompetitionTickets", {
                    data: { token: this.token, ignoreCache: true },
                    dataType: 'json',
                    method: 'GET'
                }).then((tickets) => {
                    var response = {
                        tickets: tickets,
                        requestId: request.requestId,
                        success: true
                    };

                    localStorageHelper.set(cacheKeys.CompetitionTickets, this.username, response, 4 * 60);
                    resolve(response);
                }).fail((xhr, status) => {
                    resolve({
                        tickets: [],
                        requestId: request.requestId,
                        success: false
                    });
                });
            }
            else {
                response.requestId = request.requestId;
                resolve(response);
            }

        })
    }
    this.joinCompetition = (request) => {
        return new Promise((resolve, reject) => {
            $.ajax("/Service/JoinCompetition", {
                data: { token: this.token, competitionOCode: request.competitionOCode, joinAgain: request.joinAgain},
                dataType: 'json',
                method: 'GET'
            }).then((result) => {
                resolve({
                    data: result.Data,
                    requestId: request.requestId,
                    success: result.Success,
                    message: result.Message
                });
            }).fail((xhr, status) => {
                resolve({
                    requestId: request.requestId,
                    success: false,
                    message: ""
                });
            }).always(() => {
                this.clearCacheCompetitionTickets();
            });
        })
    }
    this.getCompetitionParticipants = (request) => {
        return new Promise((resolve, reject) => {
            $.ajax("/Service/GetCompetitionParticipants", {
                data: { token: this.token, competitionOCode: request.competitionOCode, pageIndex: request.pageIndex, limit: request.limit },
                dataType: 'json',
                method: 'GET'
            }).then((participants) => {
                var response = {
                    participants: participants,
                    requestId: request.requestId,
                    success: true
                };

                $.each(response.participants, (index, item) => {
                    response.participants[index].IsActive = false;
                    if (response.participants[index].Username == this.username) {
                        response.participants[index].IsActive = true;
                    }
                });

                resolve(response);

            }).fail((xhr, status) => {
                var response = {
                    participants: [],
                    requestId: request.requestId,
                    success: false
                };

                resolve(response);
            });
        })
    }


    //History
    this.getGameTransactionReplayUrl = (request) => {
        return new Promise((resolve, reject) => {
            $.ajax("/Service/GetGameTransactionReplayUrl", {
                data: { token: this.token, ocode: request.ocode },
                dataType: 'json',
                method: 'GET'
            }).then((result) => {
                resolve({ requestId: request.requestId, url: result.Url });
            }).fail((xhr, status) => {
                resolve({ requestId: request.requestId});
            });

        })
    }


    //Connect
    var $intervalReconnectLS;
    this.connect = () => {
        executeConnect();
        var intervalTimeReconnect = 1; //minutes;
        $intervalReconnectLS = setInterval(() => {
            executeConnect();
        }, intervalTimeReconnect * 60 * 1000);
    }

    this.disconnect = () => {
        clearInterval($intervalReconnectLS);
        this.client.disconnect();
    }
};;
var sessionToken = $(document.body).data('id');
var sessionHash = $(document.body).data('hash');
var pointRate = $(document.body).data('point-rate');
var displayCurrency = $(document.body).data('display-currency');
var currency = $(document.body).data('currency-code');
var publisher = $(document.body).data('publisher');
var username = $(document.body).data('username').toString();
var gameCode = $(document.body).data('game-code') || "LOBBY";
var gameCategoryCode = $(document.body).data('game-category-code');
var isExternal = $(document.body).data('is-external') || false;

var isTournament = $(document.body).data('is-tournament') !== undefined ? $(document.body).data('is-tournament') : false;

var isExternalPlatform = $(document.body).data('devices-platform') ? true : false;
var isGameContainer = $(document.body).data('is-game-container') ? true : false;

if (sessionToken.length > 0) {
    var Streamer = function (params) {
        var request = {
            username: username,
            sessionToken: sessionToken,
            sessionHash: sessionHash,
            pointRate: pointRate,
            currency: currency,
            displayCurrency: displayCurrency,
            publisher: publisher,
            gameCode: gameCode,
            gameCategoryCode: gameCategoryCode,
            isExternal: isExternal
        }

        request = { ...request, ...params };

        if (isTournament == true) {
            return new LightstreamerAppTourn(request);
        }
        if (isGameContainer == true || isExternalPlatform == true) {
            return new LightstreamerAppExternal(request);
        }
        else {
            return new LightstreamerApp(request);
        }

    }
}
else {
    if (typeof LightstreamerAppAnn !== "undefined") {
        var Streamer = function () {
            var request = {
                currency: currency,
                publisher: publisher,
                gameCode: gameCode,
                gameCategoryCode: gameCategoryCode
            }

            return new LightstreamerAppAnn(request);
        }
    }
};
var minigame = function () {

    var miniGameStorageKey = 'minigame';

    const traceLog = (message) => {
        if (localStorage.getItem("log")) {
            console.log("%cfeature: minigame", "color: green", "date:" + (new Date()).toString().split("GMT")[0] + ", message: " + message);
        }
    }

    var take = function () {
        var item = localStorageHelper.get(miniGameStorageKey, "");
        if (!item) {
            localStorageHelper.set(miniGameStorageKey, "", 1, 1);

            return true;
        }
        else {
            return false;
        }
    }
    var release = function () {
        localStorageHelper.remove(miniGameStorageKey);
    }
    var releaseAll = function () {
        localStorageHelper.remove(miniGameStorageKey);
        minigame = null;
        unlockMiniGame();
    }

    var openMiniGame = function (token, data) {
        if (take() == true) {
            var $iframe = $('#mini-game');
            if ($iframe.length == 0) {
                traceLog("open mini game");
                var iframeHtml = "<iframe id='mini-game' class='mini-game minimize-screen' style='z-index: 600; opacity: 0'></iframe>";
                var $iframe = $(iframeHtml);

                $iframe.attr("src", "/Service/PlayMiniGame?token=" + token + "&ocode=" + data.oCode + "&data=" + (data.others ? encodeURI(JSON.stringify(data.others)) : ""));

                $iframe.appendTo("body");
            }
        }
       
    }
    var showMiniGame = function () {
        var $iframe = $('#mini-game');
        traceLog("show mini game");
        $('body').addClass('opening-minigame');
        $iframe.removeClass("minimize-screen");
        $iframe.addClass("full-screen");
        $iframe.animate({ 'opacity': 1 }, 500);
    }

    var lock = false;
    var minigame = null;
    var lockMiniGame = function () {
        lock = true;
        var $iframe = $('#mini-game');
        if ($iframe.length > 0) {
            traceLog("lock mini game");
            $iframe.css({
                width: '1px',
                height: '1px'
            });
            return true;
        }

        return false;
    }
    var unlockMiniGame = function () {
        lock = false;

        var $iframe = $('#mini-game');
        if ($iframe.length > 0) {
            traceLog("unlock mini game");
            $iframe.css({
                width: '',
                height: ''
            });
            return true;
        }
        else {
            if (minigame) {
                traceLog("try open mini game again after unlock");
                openMiniGame(minigame.token, minigame.data);
                minigame = null;
            }
        }

        return false;
    }

    var closeMiniGame = function () {
        var $iframe = $('#mini-game');
        if ($iframe.length > 0) {
            traceLog("close mini game");
            $('body').removeClass('opening-minigame');
            $iframe.remove();

            if (window.checkSession) {
                window.checkSession();
            }

            return true;
        }

        return false;
    }

    var balanceUpdateCallBackfns = [];
    var claimCallBackfns = [];
    var openCallBackfns = [];
    var closeCallBackfns = [];
    var functions = {
        open: function (token, data) {
            if (lock == true) {
                traceLog("locked");
                minigame = {
                    token: token,
                    data: data
                };
                return;
            }

            traceLog("try open mini game");
            openMiniGame(token, data);
            return null;
        },
        lock: function () {
            lockMiniGame();
        },
        unlock: function () {
            unlockMiniGame();
        },
        releaseAll: releaseAll,
        receiveBalanceEvent: function (callbackFn) {
            balanceUpdateCallBackfns.push(callbackFn);
        },
        receiveClaimEvent: function (callbackFn) {
            claimCallBackfns.push(callbackFn);
        },
        receiveOpenEvent: function (callbackFn) {
            openCallBackfns.push(callbackFn);
        },
        receiveCloseEvent: function (callbackFn) {
            closeCallBackfns.push(callbackFn);
        }
    };

    var events = ['beforeunload', 'pagehide'];
    events.forEach(function (itemEvent, i) {
        window.addEventListener(itemEvent, function (event) {
            release();
        });
    });


    window.addEventListener('message', function (e) {
        if (e.data) {
            if (e.data.category === "MiniGame") {
                if (e.data.type === "loaded") {
                    traceLog("loaded " + e.data.type);
                    showMiniGame();

                    if (openCallBackfns) {
                        $.each(openCallBackfns, function (index, fn) {
                            try {
                                fn(e.data);
                            } catch (ex) {
                            }
                        })
                    }
                }
                else if (e.data.type === "claim") {
                    traceLog("claim " + e.data.type);
                    release();

                    if (claimCallBackfns) {
                        $.each(claimCallBackfns, function (index, fn) {
                            try {
                                fn(e.data);
                            } catch (ex) {
                            }
                        })
                    }
                }
                else if (e.data.type === "balance") {
                    traceLog("balance " + e.data.type);
                    if (balanceUpdateCallBackfns) {

                        $.each(balanceUpdateCallBackfns, function (index, fn) {
                            try {
                                fn(e.data);
                            } catch (ex) {
                            }
                        })
                    }

                }
                else if (e.data.type === "close") {
                    traceLog("close " + e.data.type);
                    closeMiniGame();

                    if (closeCallBackfns) {
                        $.each(closeCallBackfns, function (index, fn) {
                            try {
                                fn(e.data);
                            } catch (ex) {
                            }
                        })
                    }
                }
            }

        }
    }, false);

    return functions;
}();

window.minigame = minigame;
;
var cashDropIFrame = function (id, token, ratio, disableAnnouncement) {
    var public = {}
    var $iframe = $("<iframe class='event-games event-energy-bar'></iframe>");
    var requestActions = {
        setData: "setData",
        resetProgress: "resetProgress"
    }
    var receiveTypes = {
        loaded: "loaded",
        requestCashDropWinner: "requestCashDropWinner",
        setSize: "setSize"
    }

    const traceLog = (message) => {
        if (localStorage.getItem("log")) {
            console.log("%cfeature: cashDropIFrame", "color: orange", "date:" + (new Date()).toString().split("GMT")[0] + ", message: " + message.substring(0, 150));
        }
    }

    var postMessage = function (action, data) {
        try {
            traceLog("postMessage: " + action + ", " + JSON.stringify(data));
            $iframe[0].contentWindow.postMessage({ type: 'cashdrop', action: action, data: data }, "*");
        }
        catch (ex) { }
    }

    function render() {
        $iframe.attr("src", "/Service/OpenEventGame?token=" + token + "&type=cashdrop" + "&ratio=" + ratio + "&disableAnnouncement=" + disableAnnouncement);

        $iframe.css({
            'position': 'fixed',
            'z-index': 501,
            'visibility': 'hidden',
            'border': 'none',
            'width': 1,
            'height': 1
        });
    }

    public.rerender = () => {
        render();
    }
    public.appendToBody = () => {
        traceLog("appendToBody");
        $iframe.appendTo("body");
    }

    public.visible = () => {
        traceLog("visible");
        $iframe.css({ 'visibility': 'visible' });
    }
    public.invisible = () => {
        traceLog("invisible");
        $iframe.css({ 'visibility': 'hidden' });
    }

    var lastData = {
        prizeSummary: null,
        betData: null,
        winners: null,
        parent: {
            width: window.innerWidth,
            height: window.innerHeight,
        },
        language: null,
        position: null
    };
    public.sendPrizeSummary = (data) => {
        traceLog("postPrizeSummary: " + JSON.stringify(data));
        lastData.prizeSummary = data;
        postMessage(requestActions.setData, { prizeSummary: data });
    }
    public.sendBetData = (data) => {
        traceLog("postBetData: " + JSON.stringify(data));
        lastData.betData = data;
        postMessage(requestActions.setData, { betData: data });
    }
    public.sendSetNumberOfSpin = (data) => {
        traceLog("sendSetNumberOfSpin: " + JSON.stringify(data));
        postMessage(requestActions.setData, { numberOfSpin: data });
    }
    public.sendPrizeProgress = (data) => {
        traceLog("sendPrizeProgress: " + JSON.stringify(data));
        postMessage(requestActions.setData, { prizeProgress: data });
    }
    public.resetProgress = () => {
        traceLog("resetProgress");
        postMessage(requestActions.resetProgress, {});
    }
    public.sendLocale = (language) => {
        traceLog("sendLocale");
        lastData.language = language;
        postMessage(requestActions.setData, lastData);
    }

    public.sendWinners = (data) => {
        traceLog("sendWinners: " + JSON.stringify(data));
        if (helper.correctId(data.requestId, id) == true) {
            data.requestId = helper.unwrapId(data.requestId, id);
            lastData.winners = data;
            postMessage(requestActions.setData, { winners: data });
        }
    }
    var requestSendWinnerFn = () => { };
    public.receiveRequestCashDropWinner = (fncallback) => {
        traceLog("registerRequestCashDropWinner");
        requestSendWinnerFn = fncallback;
    }

    var ignoreAutoResize = false;
    public.sendParentSize = (width, height) => {
        ignoreAutoResize = true;
        traceLog("postParentSize, width: " + width + ", height: " + height);
        lastData.parent = {
            width: width,
            height: height
        }
        postMessage(requestActions.setData, { parent: { width: width, height: height } });
    }

    var sendSize = () => { };
    public.registerSendSize = (fncallback) => {
        traceLog("registerSendSize");
        sendSize = fncallback
    }

    public.registerAutoSetParentSize = () => {
        traceLog("registerAutoSetParentSize");
        $(window).resize(function () {
            if (ignoreAutoResize == false) {
                lastData.parent = {
                    width: window.innerWidth,
                    height: window.innerHeight
                }
                postMessage(requestActions.setData, { parent: { width: lastData.parent.width, height: lastData.parent.height } });
            }
        });
    }

    var setSize = (css) => {
        $iframe.css(css);
        sendSize(css);
    }

    var setPosition = (css, force) => {
        traceLog("setPosition: " + JSON.stringify(css));
        if (typeof (css.left) == "undefined") {
            css.left = "auto";
        }
        if (typeof (css.right) == "undefined") {
            css.right = "auto";
        }
        if (typeof (css.top) == "undefined") {
            css.top = "auto";
        }

        lastData.position = { ...lastData.position, ...css };

        if ($iframe.width() != window.innerWidth || force === true) {
            $iframe.css(lastData.position);
        }
    }
    public.setPosition = setPosition;


    window.addEventListener('message', function (e) {
        if (e.data && e.data.name === "cashdrop") {
            traceLog("listen: " + JSON.stringify(e.data));

            if (e.data.type === receiveTypes.loaded) {
                postMessage(requestActions.setData, lastData);
            }
            else if (e.data.type === receiveTypes.requestCashDropWinner) {
                var request = e.data.data;
                request.requestId = helper.wrapId(request.requestId, id);
                requestSendWinnerFn(request);
            }
            else if (e.data.type === receiveTypes.setSize) {
                setSize(e.data.data);
                if (e.data.fullscreen === true) {
                    $iframe.css({ top: 0, left: 0 });
                }
                else {
                    setPosition(lastData.position, true);
                }
            }
        }
    }, false);


    var events = ['beforeunload', 'pagehide'];
    events.forEach(function (itemEvent, i) {
        window.addEventListener(itemEvent, function (event) {
            if ($iframe.length) {
                $iframe.remove();
            }
        });
    });

    traceLog("render");
    render();

    return public;
}

window.cashDropIFrame = cashDropIFrame;;
var prize = function () {

    const traceLog = (message) => {
        if (localStorage.getItem("log")) {
            console.log("%cfeature: prize", "color: green", "date:" + (new Date()).toString().split("GMT")[0] + ", message: " + message);
        }
    }

    var openPrize = function (token, data) {
        var $iframe = $('#prize-game');
        if ($iframe.length == 0) {
            traceLog("open prize");
            var iframeHtml = "<iframe id='prize-game' class='mini-game minimize-screen' style='z-index: 599;'></iframe>";
            var $iframe = $(iframeHtml);
            $iframe.attr("src", "/Service/OpenPrize?token=" + token + "&data=" + encodeURI(JSON.stringify(data)));
            $iframe.appendTo("body");
        }
    }

    var showPrize = function () {
        var $iframe = $('#prize-game');
        traceLog("show prize");
        $iframe.removeClass("minimize-screen");
        $iframe.addClass("full-screen");
        $iframe.animate({ 'opacity': 1 }, 500);
    }

    var closePrize = function () {
        var $iframe = $('#prize-game');
        if ($iframe.length > 0) {
            traceLog("close prize");
            $iframe.remove();
            return true;
        }

        return false;
    }

    var functions = {
        open: function (token, data) {
            openPrize(token, data);
        }
    };

    window.addEventListener('message', function (e) {
        if (e.data) {
            if (e.data.category === "prize") {
                if (e.data.type == "loaded") {
                    traceLog("loaded " + e.data.type);
                    showPrize();
                }
                else if (e.data.type == "close") {
                    traceLog("close " + e.data.type);
                    closePrize();
                }

            }
        }
    }, false);

    return functions;
}();

window.prize = prize;
;
if (Streamer && window.location.pathname.indexOf('Agreement') === -1) {
    var $body = $(document.body);
    var sessionToken = $body.data('id');

    var streamer = new Streamer({
        isSubcribeJackpot: true,
        isSubcribeDirect: true,
        isSubcribeRequest: true,
        isSubcribePowerbar: false,
        isSubcribeCashdrop: false,
        isSubcribeAnnouncement: false,
        isSubcribeLeaderboard: false
    });
    
    streamer.receiveSignedOff(() => {
        window.app.vm.logout();
    });

    streamer.receiveAmount((result) => {
        var currencyDenom = $(document.body).data('currency-denom') || 1;

        var displayCurrency = result.displayCurrency;

        window.checkSession();

        if (result.notifyUser) {
            var messages = "";
            messages = "<div class='inner-message-content'>";
            if (result.change > 0) {
                messages += "<div class='row m-t-10'>";
                if (result.type === 'deposit') {
                    messages += String.format("<div class='col'>{0} : {1} {2}</div>", localeMessages.DepositCredit, displayCurrency, numeral(result.change * currencyDenom).format('0,0.00'));
                }
                else if (result.type === 'withdraw') {
                    messages += String.format("<div class='col'>{0} : {1} {2}</div> ", localeMessages.CashOutCredit, displayCurrency, numeral(result.change * currencyDenom).format('0,0.00'));
                }
                messages += "</div>";
            } 
            if (result.freeChange > 0) {
                messages += "<div class='row m-t-10'>";
                if (result.type === 'deposit') {
                    messages += String.format("<div class='col'>{0} : {1} {2}</div>", localeMessages.DepositFreeCredit, displayCurrency, numeral(result.freeChange * currencyDenom).format('0,0.00'));
                }
                else if (result.type === 'withdraw') {
                    messages += String.format("<div class='col'>{0} : {1} {2}</div>", localeMessages.CashOutFreeCredit, displayCurrency, numeral(result.freeChange * currencyDenom).format('0,0.00'));
                }
                messages += "</div>";
            }

            messages += "</div>";
            
            if (messages.length > 0) {
                showMessagePopup("info", messages);
            }
        }
    });

    streamer.receiveMiniGame((data) => {
        if ($("#wrapper-play-game").hasClass("open") == false) {
            if ($body.hasClass("list-games") == true || $body.hasClass("page-tournament") == true) {
                if (data.type != "MiniGame") {
                    minigame.open(sessionToken, data);
                }
            }
        }
    });

    window.minigame.receiveClaimEvent(function (data) {
        streamer.clearCacheCompetitionTickets();
    });

    window.minigame.receiveCloseEvent(function (data) {
        streamer.removeItemQueueMiniGame();
    });


    streamer.connect();
};
var a = "v1";
console.info(a);
var b = "v2";
console.info(b);
console.info("v3");
console.info("v4");
console.info("v5");
console.info("v6");
console.info("v7");;
