import * as i0 from '@angular/core';
import { Injectable } from '@angular/core';
import { gettext, hookRoute, ViewContext, hookService } from '@c8y/ngx-components';
import * as i1 from '@c8y/ngx-components/remote-access/data';
import { canActivateRemoteAccess } from '@c8y/ngx-components/remote-access/data';

class TelnetRemoteAccessProtocolProviderService {
    constructor(remoteAccess) {
        this.remoteAccess = remoteAccess;
        this.protocolName = 'TELNET';
        this.protocolLabel = gettext('Telnet');
        this.protocolDescription = gettext('Allows to connect to a Telnet service.');
        this.protocolIcon = 'laptop';
    }
    async getDefaultEndpointConfiguration() {
        return {
            hostname: '127.0.0.1',
            port: 23
        };
    }
    removeEndpoint(deviceId, currentEndpointConfig) {
        return this.remoteAccess.deleteConfiguration(deviceId, currentEndpointConfig.id);
    }
    async connectEndpointHref(deviceId, configuration) {
        return `/device/${deviceId}/telnet/${configuration.id}`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TelnetRemoteAccessProtocolProviderService, deps: [{ token: i1.RemoteAccessService }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TelnetRemoteAccessProtocolProviderService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TelnetRemoteAccessProtocolProviderService, decorators: [{
            type: Injectable,
            args: [{ providedIn: 'root' }]
        }], ctorParameters: () => [{ type: i1.RemoteAccessService }] });
const remoteAccessTelnetProviders = [
    hookRoute({
        loadComponent: () => import('@c8y/ngx-components/remote-access/terminal-viewer').then(m => m.TerminalViewerComponent),
        path: 'telnet/:configurationId',
        context: ViewContext.Device,
        tabs: [],
        canActivate: [canActivateRemoteAccess]
    }),
    hookService('remoteAccessProtocolHook', TelnetRemoteAccessProtocolProviderService)
];

/**
 * Generated bundle index. Do not edit.
 */

export { TelnetRemoteAccessProtocolProviderService, remoteAccessTelnetProviders };
//# sourceMappingURL=c8y-ngx-components-remote-access-telnet.mjs.map
