<commit_before>(function () {
    'use strict';

    /**
     * @param $mdDialog
     * @param {app.utils} utils
     * @param {app.utils.decorators} decorators
     * @param $templateRequest
     * @param $rootScope
     * @param {$injector} $injector
     * @return {ModalManager}
     */
    const factory = function ($mdDialog, utils, decorators, $templateRequest, $rootScope, $injector) {


        const DEFAULT_OPTIONS = {
            clickOutsideToClose: true,
            escapeToClose: true,
            autoWrap: false,
            multiple: true,
            skipHide: true,
            controllerAs: '$ctrl',
            ns: 'app.utils'
        };

        const DEFAULT_TEMPLATES_URLS = {
            HEADER: 'modules/utils/modals/templates/header.modal.html'
        };


        class ModalManager {

            constructor() {
                this.openModal = new tsUtils.Signal();
                this._counter = 0;

                $rootScope.$on('$stateChangeStart', () => {
                    const counter = this._counter;

                    for (let i = 0; i < counter; i++) {
                        $mdDialog.cancel();
                    }
                });
            }

            showAssetInfo(asset) {
                return this._getModal({
                    id: 'asset-info',
                    ns: 'app.utils',
                    title: 'modal.assetInfo.title',
                    contentUrl: 'modules/utils/modals/assetInfo/assetInfo.html',
                    locals: asset,
                    controller: 'AssetInfoCtrl',
                    mod: 'asset-info-modal'
                });
            }

            showSettings() {
                return this._getModal({
                    id: 'user-settings',
                    ns: 'app.utils',
                    title: 'modal.settings.title',
                    contentUrl: 'modules/utils/modals/settings/settings.html',
                    controller: 'SettingsCtrl',
                    mod: 'settings-modal'
                });
            }

            /**
             * @param {User} user
             */
            showTermsAccept(user) {
                return this._getModal({
                    id: 'terms-accept',
                    templateUrl: 'modules/utils/modals/termsAccept/terms-accept.html',
                    controller: 'TermsAcceptCtrl',
                    clickOutsideToClose: false,
                    escapeToClose: false
                })
                    .then(() => user.setSetting('termsAccepted', true));
            }

            /**
             * @param {User} user
             */
            showTutorialModals() {
                return this._getModal({
                    id: 'tutorial-modals',
                    templateUrl: 'modules/utils/modals/tutorialModals/tutorialModals.html',
                    controller: 'TutorialModalsCtrl'
                });
            }

            showAccountInfo() {
                return this._getModal({
                    id: 'account-info',
                    controller: 'AccountInfoCtrl',
                    title: 'modal.account.title',
                    contentUrl: 'modules/utils/modals/accountInfo/account-info.modal.html',
                    mod: 'account-info'
                });
            }

            /**
             * @param {User} user
             * @param {Asset} [asset]
             * @return {Promise}
             */
            showSendAsset(user, asset = Object.create(null)) {
                return this._getModal({
                    id: 'send-asset',
                    controller: 'AssetSendCtrl',
                    titleContentUrl: 'modules/utils/modals/sendAsset/send-title.modal.html',
                    contentUrl: 'modules/utils/modals/sendAsset/send.modal.html',
                    mod: 'modal-send',
                    locals: {
                        assetId: asset.id,<commit_msg>client-390-popups: esc and outside clicks to close disabled<commit_after>(function () {
    'use strict';

    /**
     * @param $mdDialog
     * @param {app.utils} utils
     * @param {app.utils.decorators} decorators
     * @param $templateRequest
     * @param $rootScope
     * @param {$injector} $injector
     * @return {ModalManager}
     */
    const factory = function ($mdDialog, utils, decorators, $templateRequest, $rootScope, $injector) {


        const DEFAULT_OPTIONS = {
            clickOutsideToClose: true,
            escapeToClose: true,
            autoWrap: false,
            multiple: true,
            skipHide: true,
            controllerAs: '$ctrl',
            ns: 'app.utils'
        };

        const DEFAULT_TEMPLATES_URLS = {
            HEADER: 'modules/utils/modals/templates/header.modal.html'
        };


        class ModalManager {

            constructor() {
                this.openModal = new tsUtils.Signal();
                this._counter = 0;

                $rootScope.$on('$stateChangeStart', () => {
                    const counter = this._counter;

                    for (let i = 0; i < counter; i++) {
                        $mdDialog.cancel();
                    }
                });
            }

            showAssetInfo(asset) {
                return this._getModal({
                    id: 'asset-info',
                    ns: 'app.utils',
                    title: 'modal.assetInfo.title',
                    contentUrl: 'modules/utils/modals/assetInfo/assetInfo.html',
                    locals: asset,
                    controller: 'AssetInfoCtrl',
                    mod: 'asset-info-modal'
                });
            }

            showSettings() {
                return this._getModal({
                    id: 'user-settings',
                    ns: 'app.utils',
                    title: 'modal.settings.title',
                    contentUrl: 'modules/utils/modals/settings/settings.html',
                    controller: 'SettingsCtrl',
                    mod: 'settings-modal'
                });
            }

            /**
             * @param {User} user
             */
            showTermsAccept(user) {
                return this._getModal({
                    id: 'terms-accept',
                    templateUrl: 'modules/utils/modals/termsAccept/terms-accept.html',
                    controller: 'TermsAcceptCtrl',
                    clickOutsideToClose: false,
                    escapeToClose: false
                })
                    .then(() => user.setSetting('termsAccepted', true));
            }

            /**
             * @param {User} user
             */
            showTutorialModals() {
                return this._getModal({
                    id: 'tutorial-modals',
                    templateUrl: 'modules/utils/modals/tutorialModals/tutorialModals.html',
                    controller: 'TutorialModalsCtrl',
                    clickOutsideToClose: false,
                    escapeToClose: false
                });
            }

            showAccountInfo() {
                return this._getModal({
                    id: 'account-info',
                    controller: 'AccountInfoCtrl',
                    title: 'modal.account.title',
                    contentUrl: 'modules/utils/modals/accountInfo/account-info.modal.html',
                    mod: 'account-info'
                });
            }

            /**
             * @param {User} user
             * @param {Asset} [asset]
             * @return {Promise}
             */
            showSendAsset(user, asset = Object.create(null)) {
                return this._getModal({
                    id: 'send-asset',
                    controller: 'AssetSendCtrl',
                    titleContentUrl: 'modules/utils/modals/sendAsset/send-title.modal.html',
                    contentUrl: 'modules/utils/modals/sendAsset/send.modal.html',
                    mod: 'modal-send',
                    locals: {
                        assetId: asset.id,
{'fraction_non_alphanumeric': 0.10846230654018972, 'fraction_numerical': 0.000873689465801298, 'mean_word_length': 1.1528747984954326, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '238623', 'n_tokens_mistral': 2058, 'n_tokens_neox': 1893, 'n_words': 352}