
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
import { localize2 } from '../../../../../nls.js';
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
import { IThemeService } from '../../../../../platform/theme/common/themeService.service.js';
import { IKeybindingService } from '../../../../../platform/keybinding/common/keybinding.service.js';
import { IContextMenuService } from '../../../../../platform/contextview/browser/contextView.service.js';
import { isTemporaryWorkspace, WorkbenchState } from '../../../../../platform/workspace/common/workspace.js';
import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.service.js';
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.service.js';
import { ViewPane } from '../../../../browser/parts/views/viewPane.js';
import { ResourcesDropHandler } from '../../../../browser/dnd.js';
import '../../../../../platform/theme/common/colorUtils.js';
import '../../../../../platform/theme/common/colors/baseColors.js';
import '../../../../../platform/theme/common/colors/chartsColors.js';
import '../../../../../platform/theme/common/colors/editorColors.js';
import '../../../../../platform/theme/common/colors/inputColors.js';
import { listDropOverBackground } from '../../../../../platform/theme/common/colors/listColors.js';
import '../../../../../platform/theme/common/colors/menuColors.js';
import '../../../../../platform/theme/common/colors/minimapColors.js';
import '../../../../../platform/theme/common/colors/miscColors.js';
import '../../../../../platform/theme/common/colors/quickpickColors.js';
import '../../../../../platform/theme/common/colors/searchColors.js';
import { ILabelService } from '../../../../../platform/label/common/label.service.js';
import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.service.js';
import { IViewDescriptorService } from '../../../../common/views.service.js';
import { IOpenerService } from '../../../../../platform/opener/common/opener.service.js';
import { isWeb } from '../../../../../base/common/platform.js';
import { DragAndDropObserver, getWindow } from '../../../../../base/browser/dom.js';
import { IHoverService } from '../../../../../platform/hover/browser/hover.service.js';

var EmptyView_1;
let EmptyView = class EmptyView extends ViewPane {
    static {
        EmptyView_1 = this;
    }
    static {
        this.ID = "workbench.explorer.emptyView";
    }
    static {
        this.NAME = ( localize2(10590, "No Folder Opened"));
    }
    constructor(
        options,
        themeService,
        viewDescriptorService,
        instantiationService,
        keybindingService,
        contextMenuService,
        contextService,
        configurationService,
        labelService,
        contextKeyService,
        openerService,
        hoverService
    ) {
        super(
            options,
            keybindingService,
            contextMenuService,
            configurationService,
            contextKeyService,
            viewDescriptorService,
            instantiationService,
            openerService,
            themeService,
            hoverService
        );
        this.contextService = contextService;
        this.labelService = labelService;
        this._disposed = false;
        this._register(this.contextService.onDidChangeWorkbenchState(() => this.refreshTitle()));
        this._register(this.labelService.onDidChangeFormatters(() => this.refreshTitle()));
    }
    shouldShowWelcome() {
        return true;
    }
    renderBody(container) {
        super.renderBody(container);
        this._register(new DragAndDropObserver(container, {
            onDrop: e => {
                container.style.backgroundColor = "";
                const dropHandler = this.instantiationService.createInstance(ResourcesDropHandler, {
                    allowWorkspaceOpen: !isWeb || isTemporaryWorkspace(this.contextService.getWorkspace())
                });
                dropHandler.handleDrop(e, getWindow(container));
            },
            onDragEnter: () => {
                const color = this.themeService.getColorTheme().getColor(listDropOverBackground);
                container.style.backgroundColor = color ? ( color.toString()) : "";
            },
            onDragEnd: () => {
                container.style.backgroundColor = "";
            },
            onDragLeave: () => {
                container.style.backgroundColor = "";
            },
            onDragOver: e => {
                if (e.dataTransfer) {
                    e.dataTransfer.dropEffect = "copy";
                }
            }
        }));
        this.refreshTitle();
    }
    refreshTitle() {
        if (this._disposed) {
            return;
        }
        if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) {
            this.updateTitle(EmptyView_1.NAME.value);
        } else {
            this.updateTitle(this.title);
        }
    }
    dispose() {
        this._disposed = true;
        super.dispose();
    }
};
EmptyView = EmptyView_1 = ( __decorate([( __param(1, IThemeService)), ( __param(2, IViewDescriptorService)), ( __param(3, IInstantiationService)), ( __param(4, IKeybindingService)), ( __param(5, IContextMenuService)), ( __param(6, IWorkspaceContextService)), ( __param(7, IConfigurationService)), ( __param(8, ILabelService)), ( __param(9, IContextKeyService)), ( __param(10, IOpenerService)), ( __param(11, IHoverService))], EmptyView));

export { EmptyView };
