Full Code of QTGate/QTGate-Desktop-Client for AI

master 6b52a041d1e8 cached
64 files
1.4 MB
567.5k tokens
658 symbols
1 requests
Download .txt
Showing preview only (1,681K chars total). Download the full file or copy to clipboard to get everything.
Repository: QTGate/QTGate-Desktop-Client
Branch: master
Commit: 6b52a041d1e8
Files: 64
Total size: 1.4 MB

Directory structure:
gitextract_mixerr74/

├── .travis.yml
├── LICENSE
├── README.md
├── app/
│   ├── CoNET.d.ts
│   ├── localWebServer.js
│   ├── localWebServer.ts
│   ├── main.js
│   ├── main.ts
│   ├── package.json.npm
│   ├── public/
│   │   ├── css/
│   │   │   ├── c3.css
│   │   │   └── page.css
│   │   └── scripts/
│   │       ├── CanadaSvg.js
│   │       ├── Cleave.js
│   │       ├── CoNETConnect.js
│   │       ├── CoNETConnect.ts
│   │       ├── appCosearch.js
│   │       ├── appCosearch.ts
│   │       ├── appsManager.js
│   │       ├── appsManager.ts
│   │       ├── connectInformationMessage.js
│   │       ├── connectInformationMessage.ts
│   │       ├── encryptoClass.js
│   │       ├── encryptoClass.ts
│   │       ├── home.js
│   │       ├── home.ts
│   │       ├── imapForm.js
│   │       ├── imapForm.ts
│   │       ├── jquery.cookie.js
│   │       ├── keyPairGenerateForm.js
│   │       ├── keyPairGenerateForm.ts
│   │       ├── keyPairPassword.js
│   │       ├── keyPairPassword.ts
│   │       ├── knockout.animate.js
│   │       ├── knockout.js
│   │       ├── showHTMLComplete.js
│   │       ├── showHTMLComplete.ts
│   │       ├── siteShare.js
│   │       ├── siteShare.ts
│   │       └── socket.io.js
│   ├── tools/
│   │   ├── 1231B119.pem
│   │   ├── coNETConnect.js
│   │   ├── coNETConnect.ts
│   │   ├── compress.js
│   │   ├── compress.ts
│   │   ├── imap.js
│   │   ├── imap.ts
│   │   ├── initSystem.js
│   │   └── initSystem.ts
│   └── views/
│       ├── Shared/
│       │   ├── CoNETConnectInfo.pug
│       │   ├── CoSearchLayout.pug
│       │   ├── appHtml.pug
│       │   ├── header.pug
│       │   └── mainMenu.pug
│       ├── home/
│       │   ├── Wrt.pug
│       │   ├── coSearchImage.html
│       │   ├── customProxy.pug
│       │   └── index.pug
│       └── shared/
│           └── coreLayout.pug
├── build/
│   └── icon.icns
├── index.html
├── index.js
├── index.ts
├── package.json
└── tsconfig.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .travis.yml
================================================
sudo: false
language: node_js

os:
  - linux

before_install:
  - nvm install 8.7.0
  - nvm use 8.7.0
  - npm i electron-builder

================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2018 CoNET Technology Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

================================================
FILE: README.md
================================================
### This is the beginning of CoNET project
### now migrate to
## The new era of CoNET

### New Link here:

https://bitbucket.org/matheus_moraes_pinheiro/conet

## Homepage

https://conet.network

[![Build Status](https://travis-ci.org/QTGate/QTGate-Desktop-Client.svg?branch=master)](https://travis-ci.org/QTGate/QTGate-Desktop-Client)
[![Gitter](https://img.shields.io/badge/chat-on%20gitter-blue.svg)](https://gitter.im/QTGate/Lobby)
[![Known Vulnerabilities](https://snyk.io/test/github/qtgate/qtgate-desktop-client/badge.svg)](https://snyk.io/test/github/qtgate/qtgate-desktop-client)
[![Telegram](https://img.shields.io/badge/telebot-community%20group-blue.svg)](https://t.me/joinchat/IpX64hGK_95XDTXit42vOg)

![http protocol](/resources/CoPlatform4.png?raw=true)


================================================
FILE: app/CoNET.d.ts
================================================
/*!
 * Copyright 2018 CoNET Technology Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */



interface ReadonlyArray<T> {
    /**
     * Returns the value of the first element in the array where predicate is true, and undefined
     * otherwise.
     * @param predicate find calls predicate once for each element of the array, in ascending
     * order, until it finds one where predicate returns true. If such an element is found, find
     * immediately returns that element value. Otherwise, find returns undefined.
     * @param thisArg If provided, it will be used as the this value for each invocation of
     * predicate. If it is not provided, undefined is used instead.
     */
    find<S extends T>(predicate: (this: void, value: T, index: number, obj: ReadonlyArray<T>) => value is S, thisArg?: any): S | undefined;
    find(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): T | undefined;

    /**
     * Returns the index of the first element in the array where predicate is true, and -1
     * otherwise.
     * @param predicate find calls predicate once for each element of the array, in ascending
     * order, until it finds one where predicate returns true. If such an element is found,
     * findIndex immediately returns that element index. Otherwise, findIndex returns -1.
     * @param thisArg If provided, it will be used as the this value for each invocation of
     * predicate. If it is not provided, undefined is used instead.
     */
    findIndex(predicate: (value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg?: any): number;
}


interface Map<K, V> {
    clear(): void;
    delete(key: K): boolean;
    forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
    get(key: K): V | undefined;
    has(key: K): boolean;
    set(key: K, value: V): this;
    readonly size: number;
}

interface MapConstructor {
    new (): Map<any, any>;
    new <K, V>(entries?: ReadonlyArray<[K, V]>): Map<K, V>;
    readonly prototype: Map<any, any>;
}
declare var Map: MapConstructor;

interface ReadonlyMap<K, V> {
    forEach(callbackfn: (value: V, key: K, map: ReadonlyMap<K, V>) => void, thisArg?: any): void;
    get(key: K): V | undefined;
    has(key: K): boolean;
    readonly size: number;
}

interface WeakMap<K extends object, V> {
    delete(key: K): boolean;
    get(key: K): V | undefined;
    has(key: K): boolean;
    set(key: K, value: V): this;
}

interface WeakMapConstructor {
    new (): WeakMap<object, any>;
    new <K extends object, V>(entries?: ReadonlyArray<[K, V]>): WeakMap<K, V>;
    readonly prototype: WeakMap<object, any>;
}
declare var WeakMap: WeakMapConstructor;

interface Set<T> {
    add(value: T): this;
    clear(): void;
    delete(value: T): boolean;
    forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
    has(value: T): boolean;
    readonly size: number;
}

interface SetConstructor {
    new (): Set<any>;
    new <T>(values?: ReadonlyArray<T>): Set<T>;
    readonly prototype: Set<any>;
}
declare var Set: SetConstructor;

interface ReadonlySet<T> {
    forEach(callbackfn: (value: T, value2: T, set: ReadonlySet<T>) => void, thisArg?: any): void;
    has(value: T): boolean;
    readonly size: number;
}

interface WeakSet<T extends object> {
    add(value: T): this;
    delete(value: T): boolean;
    has(value: T): boolean;
}

interface WeakSetConstructor {
    new (): WeakSet<object>;
    new <T extends object>(values?: ReadonlyArray<T>): WeakSet<T>;
    readonly prototype: WeakSet<object>;
}
declare var WeakSet: WeakSetConstructor;

interface imapConnect {
    imapServer: string
    imapUserName: string
    imapUserPassword: string
    imapPortNumber: number|number[]
    imapSsl: boolean
    imapIgnoreCertificate: boolean
}

interface keypair {
	publicKey?: string
	privateKey?: string
	keyLength: number
	nikeName: string
	createDate: string
	email: string
	passwordOK: boolean
    verified: boolean
    publicKeyID: string
    showLoginPasswordField?: KnockoutObservable < boolean >
    delete_btn_view?: KnockoutObservable < boolean >
    delete_btn_click?: () => void
    showConform?: KnockoutObservable < boolean >
    deleteKeyPairNext?: () => void
	_password: string
	CoNET_publicKey?: string 
    keyPairPassword?: KnockoutObservable < keyPairPassword >
    showDeleteKeyPairNoite?: KnockoutObservable < boolean >
}


interface StringValidator {
    isAcceptable(s: string): boolean;
}
interface INewKeyPair {
    email: string
    nikeName: string
    password: string
}

interface keyPair {
    publicKey: string;
    privateKey: string;
}

interface imapData {
    email: string
}

interface requestPoolData {
    
    timeout: any
}

interface regionV1 {
    regionName: string
    testHostIp: string
    testUrl: string
    testHost: string
    freeUser: boolean
    VoE: boolean
}

interface IinputData extends imapConnect {
    account:string
    email: string
    smtpServer:string
    smtpUserName:string
    smtpUserPassword:string
    smtpPortNumber:number|number[]
    smtpSsl:boolean
    smtpIgnoreCertificate: boolean
    imapTestResult: boolean
    language: string
    clientFolder: string
    serverFolder: string
    timeZoneOffset: number
    randomPassword: string
    uuid: string
    clientIpAddress: string
    ciphers: string
    confirmRisk: boolean
    sendToQTGate: boolean
}

interface CoPromo {
    datePromo: number
    pricePromo: number
    promoDetail: string[]
    promoFor: string[]
}

interface iTransferData {
    startDate: string
    transferDayLimit: number
    transferMonthly: number
    account: string
    resetTime: string
    usedDayTransfer: number
    productionPackage: string
    usedMonthlyTransfer: number
    availableDayTransfer: number
    availableMonthlyTransfer: number
    usedMonthlyOverTransfer: number
    uploaded?: number
    downloaded?: number
    power: number
    timeZoneOffset: number
    expire: string
    isAnnual: boolean
    paidID: string[]
    totalMonth: number
    paidAmount: number
    automatically: boolean
    promo: CoPromo[]
}

interface multipleGateway {
    gateWayIpAddress: string
    gateWayPort: number
    dockerName: string
    password: string
}


interface QTGate_DnsAddress {
	dnsName: string,
	ipv4: string,
	url: string
}

interface IConnectCommand {
    region: string
    account: string
    imapData: IinputData
    connectType: number
    transferData?: iTransferData
    error?: number
    dockerName?: string
    randomPassword?: string
    runningDocker?: string
    AllDataToGateway?: boolean
    fingerprint: string
    gateWayIpAddress: string
    gateWayPort?: number
    totalUserPower?: number
    requestContainerEachPower?: number
    connectPeer?: string
    requestRegions?: string[]
    multipleGateway?: multipleGateway[]
    requestMultipleGateway?: number
    containerUUID?: string
    peerUuid?: string
    localServerIp?: string[]
    localServerPort: string
    webWrt?: boolean
    requestPortNumber: string
    globalIpAddress: string
}

interface QTGateAPIRequestCommand {
    command: string
    subCom: string
    myIpServer?: QTGate_DnsAddress []
    account?: string
	error: number
	requestSerial?: string
    Args: any
    fingerprint?: string
    dataTransfer?: iTransferData
    requestTimes?: number
	region?: string
	CallBack?: any
    
}

interface QTGateCommand {
    account: string
    QTGateVersion: string
    command: string
    imapData?: IinputData
    language: string
    error: Error
    callback: any
    publicKey: string
}

interface IQTGateRegionsSetup {
    title: string
}

interface QTGateRegions {
    icon: string
    content: string[]
    description: string[]
    meta: string[]
    canVoe: KnockoutObservable < boolean >
    canVoH: KnockoutObservable < boolean >
    available: KnockoutObservable < boolean >
    selected: KnockoutObservable < boolean >
    showExtraContent: KnockoutObservable < boolean >
    QTGateRegionsSetup: IQTGateRegionsSetup[]
    qtRegion: string
    error: KnockoutObservable<number >
    showRegionConnectProcessBar: KnockoutObservable < boolean >
    showConnectedArea: KnockoutObservable < boolean >
    ping: KnockoutObservable <number >
    downloadSpeed: KnockoutObservable <number >
    freeUser: KnockoutObservable < boolean >
}

interface domainData {
	dns: dnsAddress[]
	expire: number
}
interface dnsAddress {
	address: string
	family: number
	expire: Date
	connect: Date []
}

interface VE_IPptpStream1 {
    type?: string;
    buffer: string;
    host: string;
    port: number;
    cmd: number;
    ATYP: number;
    uuid?: string;
    length?:number;
    randomBuffer?: any
    ssl: boolean
}

interface proxyServerInfo {
    serverAddress: string
    serverPort: number
    password: string
    allToGateway: boolean
    localPort: number
}
interface iQTGatePayment {
    cardNumber?: string
    cardExpirationYear?: string
    cardPostcode?: string
    cardcvc?: string
    tokenID?: string
    isAnnual: boolean
    plan: string
    Amount: number
    autoRenew: boolean
}
interface twitter_entities_media {

}
interface twitter_entities_urls {
    display_url: string
    expanded_url: string
    indices: string[]
    url: string
}
interface twitter_entities {
    hashtags: any[]
    media: twitter_entities_media[]
    symbols: any[]
    urls: twitter_entities_urls[]
}
interface tweetCountSummary {

}
interface twitter_post {
    order: number
    contributors: any
    coordinates: any
    created_at: string
    QTGate_created_at: KnockoutComputed< string >
    entities: any
    favorite_count:  number
    favorite_count_ko : KnockoutObservable < number >
    favorited_ko: KnockoutObservable < boolean >
    favoritedLoader_ko: KnockoutObservable < boolean >
    favorited:  boolean
    geo: any
    id: number
    id_str: string
    in_reply_to_screen_name: any
    in_reply_to_status_id: any
    in_reply_to_status_id_str: any
    in_reply_to_user_id: any
    in_reply_to_user_id_str: any
    is_quote_status: boolean
    quoted_status: twitter_post
    lang: string
    full_text: string
    full_text_split_line: string
    retweeted_status: twitter_post
    place: any
    possibly_sensitive: boolean
    possibly_sensitive_appealable: boolean
    retweet_count: number
    retweeted: twitter_post
    extended_entities: twitter_extended_entities
    source: string
    text: string
    truncated: boolean
    user: Twitter_verify_credentials
    tweetCountSummary: tweetCountSummary
    showUser: KnockoutObservable < boolean >
    CoNET_totalTwitter: number
    CoNET_currentTwitter: number
}


interface twitter_size {
    h: number
    resize: string
    w: number
}


interface twitter_media_video_info_variants {
    bitrate: number
    content_type: string
    url: string
}


interface twitter_media_video_info {
    aspect_ratio: number []
    duration_millis: number
    variants: twitter_media_video_info_variants[]
    QTDownload: string
}

interface twitter_media {
    display_url?: string
    expanded_url?: string
    id?: number
    id_str?: string
    indices?: number []
    media_url?: string
    media_url_https?: string
    sizes?: {
        large: twitter_size
        medium: twitter_size
        small: twitter_size
        thumb: twitter_size
    }
    type?: string        //  photo
    url?: string
    video_info: twitter_media_video_info
}

interface twitter_extended_entities extends twitter_post {
    media: twitter_media[]
}

interface twitter_mediaData {
	total_bytes: number
	media_type: string
    rawData: string
    media_id_string: string
}

interface twitter_postData {
    text: string
    images: string[]
    media_data: twitter_mediaData[]
    videoSize: number
    videoFileName: string
    uuid: string
}


interface twitter_uploadImageInitData_imageObj {
	image_type: string
	w: number
	h: number
}

interface twitter_uploadImageInitData {
	media_id: number
	media_id_string: string
	size: number
	expires_after_secs: number
	image: twitter_uploadImageInitData_imageObj
}

interface twitter_uploadImageInitData_status_processing_info {
	state: string					//				in_progress, failed, succeeded
	check_after_secs: number
	progress_percent: number
	error?: {
		code: number
		name: string
		message: string
	}
}

interface twitter_uploadImageInitData_status {
	media_id: number
	media_id_string: string
	expires_after_secs: number
	processing_info: twitter_uploadImageInitData_status_processing_info
}

interface TwitterAccount {
    consumer_key: string
    consumer_secret: string
    access_token_key: string
    access_token_secret: string
    twitter_verify_credentials?: Twitter_verify_credentials
}

interface Twitter_verify_credentials {
    id: number
    id_str: string
    name: string
    screen_name: string
    location: string
    description: string
    url: string
    entities: any
    protected: boolean
    followers_count: number
    friends_count: number
    listed_count: number
    created_at: string
    favourites_count: number
    utc_offset: number
    time_zone: string
    geo_enabled: boolean
    verified: boolean
    statuses_count: number
    lang: string
    status: Titter_status
    contributors_enabled: boolean
    is_translator: boolean
    is_translation_enabled: boolean
    profile_background_color: string
    profile_background_image_url: string
    profile_background_image_url_https: string
    profile_background_tile: boolean
    profile_image_url: string
    profile_image_url_https: string
    profile_banner_url: string
    profile_link_color: string
    profile_sidebar_border_color: string
    profile_sidebar_fill_color: string
    profile_text_color: string
    profile_use_background_image: boolean
    has_extended_profile: boolean
    default_profile: boolean
    default_profile_image: boolean
    following: boolean
    follow_request_sent: boolean
    notifications: boolean
    translator_type: string

}

interface Titter_status {
    created_at: string
    id: number
    id_str: string
    text: string
    truncated: boolean
    entities: any
    source: string
    in_reply_to_status_id: any
    in_reply_to_status_id_str: any
    in_reply_to_user_id: any
    in_reply_to_user_id_str: any
    in_reply_to_screen_name: any
    geo: any
    coordinates: any
    place: any
    contributors: any
    retweeted_status: Titter_status
    is_quote_status: boolean
    retweet_count: number
    favorite_count: number
    favorited: boolean
    retweeted: boolean
    possibly_sensitive: boolean
    lang: string

}


interface twitter_text_parseTweet {
    weightedLength: number
    valid: boolean
    permillage: number
    validRangeStart: number
    validRangeEnd: number
    displayRangeStart: number
    displayRangeEnd: number
}

interface install_config {
    alreadyInit: boolean
    multiLogin: boolean
    firstRun: boolean
    version: string
    newVersion?: string
    newVersionCheckFault?: boolean
    newVersionDownloadFault?: number
    newVerReady?: boolean
    keypair: keypair
    iterations: number
    salt?: any
    keylen?: number
    digest?: string
    freeUser: boolean
    connectedImapDataUuid: string
    account: string
    serverGlobalIpAddress: string
    serverPort: number
    connectedQTGateServer: boolean          //      true when connect to QTGate network
    lastConnectType: number
    localIpAddress: any[]
    
}

interface Jimp {
    read( ...args: any): any
}

declare namespace SemanticUI {

}

declare namespace SocketIOClient {
    interface Emitter {
        emit11
        emit22
    }
}

interface DateConstructor {
    isLeapYear: ( year: number ) => boolean
    getDaysInMonth: (year: number, month: number ) => number
    
    
}

interface Date {
    isLeapYear: ()=> boolean
    getDaysInMonth: () => number
    addMonths: ( n: number ) => Date
}

interface coSearch_Object {
    command: string
    args: string[]
    screenSize_x: number
    screenSize_y: number
}

interface JQuery<TElement extends Node = HTMLElement> extends Iterable<TElement> {
    //css(properties: JQuery.PlainObject<string | number | ((this: TElement, index: number, value: string) => string | number | void | undefined)>): this;
    /**
     * Get the computed style properties for the first element in the set of matched elements.
     *
     * @param propertyName A CSS property.
     *                     An array of one or more CSS properties.
     * @see {@link https://api.jquery.com/css/}
     * @since 1.0
     */
    //css(propertyName: string): string;
    /**
     * Get the computed style properties for the first element in the set of matched elements.
     *
     * @param propertyNames An array of one or more CSS properties.
     * @see {@link https://api.jquery.com/css/}
     * @since 1.9
     */
    //css(propertyNames: string[]): JQuery.PlainObject<string>;

    progress(k?:any ): any
    transition(k?:any): any
    dropdown(k?:any):any
    popup(k?:any): any
    shape(k?:any):any
    dimmer(k?:any):any
    checkbox(k?:any): any
    
}
interface JQueryStatic<TElement extends Node = HTMLElement> {
    //'langEH', this.tLang(), { expires: 180, path: '/' }
    cookie( ...obj:any): any
}

================================================
FILE: app/localWebServer.js
================================================
"use strict";
/*!
 * Copyright 2018 CoNET Technology Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
const Express = require("express");
const Path = require("path");
const HTTP = require("http");
const SocketIo = require("socket.io");
const Tool = require("./tools/initSystem");
const Async = require("async");
const Fs = require("fs");
const Util = require("util");
const Uuid = require("node-uuid");
const Imap = require("./tools/imap");
const coNETConnect_1 = require("./tools/coNETConnect");
const Crypto = require("crypto");
const mime = require("mime-types");
Express.static.mime.define({ 'multipart/related': ['mht'] });
//Express.static.mime.define({ 'message/rfc822' : ['mhtml','mht'] })
Express.static.mime.define({ 'application/x-mimearchive': ['mhtml', 'mht'] });
Express.static.mime.define({ 'multipart/related': ['mhtml', 'mht'] });
let logFileFlag = 'w';
const conetImapAccount = /^qtgate_test\d\d?@icloud.com$/i;
const saveLog = (err) => {
    if (!err) {
        return;
    }
    const data = `${new Date().toUTCString()}: ${typeof err === 'object' ? (err['message'] ? err['message'] : '') : err}\r\n`;
    console.log(data);
    return Fs.appendFile(Tool.ErrorLogFile, data, { flag: logFileFlag }, () => {
        return logFileFlag = 'a';
    });
};
const saveServerStartup = (localIpaddress) => {
    const info = `\n*************************** CoNET Platform [ ${Tool.CoNET_version} ] server start up *****************************\n` +
        `Access url: http://${localIpaddress}:${Tool.LocalServerPortNumber}\n`;
    saveLog(info);
};
const saveServerStartupError = (err) => {
    const info = `\n*************************** CoNET Platform [ ${Tool.CoNET_version} ] server startup falied *****************************\n` +
        `platform ${process.platform}\n` +
        `${err['message']}\n`;
    saveLog(info);
};
const imapErrorCallBack = (message) => {
    if (message && message.length) {
        if (/auth|login|log in|Too many simultaneous|UNAVAILABLE/i.test(message)) {
            return 1;
        }
        if (/ECONNREFUSED/i.test(message)) {
            return 5;
        }
        if (/OVERQUOTA/i.test(message)) {
            return 6;
        }
        if (/certificate/i.test(message)) {
            return 2;
        }
        if (/timeout|ENOTFOUND/i.test(message)) {
            return 0;
        }
        return 5;
    }
    return -1;
};
class localServer {
    constructor(cmdResponse, test) {
        this.cmdResponse = cmdResponse;
        this.expressServer = Express();
        this.httpServer = HTTP.createServer(this.expressServer);
        this.socketServer = SocketIo(this.httpServer);
        this.socketServer_CoSearch = this.socketServer.of('/CoSearch');
        this.config = null;
        this.keyPair = null;
        this.savedPasswrod = '';
        this.imapConnectData = null;
        this.localConnected = new Map();
        this.CoNETConnectCalss = null;
        this.openPgpKeyOption = null;
        this.sessionHashPool = [];
        this.Pbkdf2Password = null;
        this.nodeList = [{
                email: 'node@Kloak.app',
                keyID: '',
                key: ''
            }];
        this.requestPool = new Map();
        //Express.static.mime.define({ 'message/rfc822' : ['mhtml','mht'] })
        //Express.static.mime.define ({ 'multipart/related' : ['mhtml','mht'] })
        Express.static.mime.define({ 'application/x-mimearchive': ['mhtml', 'mht'] });
        this.expressServer.set('views', Path.join(__dirname, 'views'));
        this.expressServer.set('view engine', 'pug');
        this.expressServer.use(Express.static(Tool.QTGateFolder));
        this.expressServer.use(Express.static(Path.join(__dirname, 'public')));
        this.expressServer.use(Express.static(Path.join(__dirname, 'html')));
        this.expressServer.get('/', (req, res) => {
            res.render('home', { title: 'home', proxyErr: false });
        });
        this.socketServer.on('connection', socker => {
            return this.socketServerConnected(socker);
        });
        this.httpServer.once('error', err => {
            console.log(`httpServer error`, err);
            saveServerStartupError(err);
            return process.exit(1);
        });
        Async.series([
            next => Tool.checkSystemFolder(next),
            next => Tool.checkConfig(next)
        ], (err, data) => {
            if (err) {
                return saveServerStartupError(err);
            }
            this.config = data['1'];
            if (!test) {
                this.httpServer.listen(Tool.LocalServerPortNumber, () => {
                    return saveServerStartup(`localhost`);
                });
            }
        });
    }
    catchCmd(mail, uuid) {
        if (!this.imapConnectData.sendToQTGate) {
            this.imapConnectData.sendToQTGate = true;
            Tool.saveEncryptoData(Tool.imapDataFileName1, this.imapConnectData, this.config, this.savedPasswrod, err => {
            });
        }
        console.log(`Get response from CoNET uuid [${uuid}] length [${mail.length}]`);
        const socket = this.requestPool.get(uuid);
        if (!socket) {
            return console.log(`Get cmd that have no matched socket \n\n`, mail);
        }
        socket.emit('doingRequest', mail, uuid);
    }
    tryConnectCoNET(socket, sessionHash) {
        console.log(`doing tryConnectCoNET`);
        //		have CoGate connect
        if (this.CoNETConnectCalss) {
            return this.CoNETConnectCalss.Ping();
        }
        let sendMail = false;
        const _exitFunction = err => {
            console.trace(`makeConnect on _exitFunction err this.CoNETConnectCalss destroy!`, err);
            this.CoNETConnectCalss = null;
        };
        const makeConnect = () => {
            return this.CoNETConnectCalss = new coNETConnect_1.default(this.imapConnectData, this.socketServer, !this.imapConnectData.sendToQTGate, this.nodeList[0].email, this.openPgpKeyOption, this.keyPair.publicKey, (mail, uuid) => {
                return this.catchCmd(mail, uuid);
            }, _exitFunction);
        };
        return makeConnect();
    }
    listenAfterPassword(socket, sessionHash) {
        socket.on('checkImap', (emailAddress, password, timeZone, tLang, CallBack1) => {
            CallBack1();
            console.log(`localServer on checkImap!`);
            const imapServer = Tool.getImapSmtpHost(emailAddress);
            this.imapConnectData = {
                email: this.config.account,
                account: this.config.account,
                smtpServer: imapServer.smtp,
                smtpUserName: emailAddress,
                smtpPortNumber: imapServer.SmtpPort,
                smtpSsl: imapServer.smtpSsl,
                smtpIgnoreCertificate: false,
                smtpUserPassword: password,
                imapServer: imapServer.imap,
                imapPortNumber: imapServer.ImapPort,
                imapSsl: imapServer.imapSsl,
                imapUserName: emailAddress,
                imapIgnoreCertificate: false,
                imapUserPassword: password,
                timeZoneOffset: timeZone,
                language: tLang,
                imapTestResult: null,
                clientFolder: Uuid.v4(),
                serverFolder: Uuid.v4(),
                randomPassword: Uuid.v4(),
                uuid: Uuid.v4(),
                confirmRisk: false,
                clientIpAddress: null,
                ciphers: null,
                sendToQTGate: false
            };
            return this.doingCheckImap(socket);
        });
        socket.on('tryConnectCoNET', CallBack1 => {
            const uuid = Uuid.v4();
            CallBack1(uuid);
            const _callBack = (...data) => {
                socket.emit(uuid, ...data);
            };
            console.log(`socket on tryConnectCoNET!\n\n`);
            if (!this.imapConnectData) {
                console.log(`socket.on ( 'tryConnectCoNET') !this.imapConnectData \n\n `);
                return _callBack('systemError');
            }
            if (!this.imapConnectData.confirmRisk) {
                this.imapConnectData.confirmRisk = true;
                return Tool.saveEncryptoData(Tool.imapDataFileName1, this.imapConnectData, this.config, this.savedPasswrod, err => {
                    return this.tryConnectCoNET(socket, sessionHash);
                });
            }
            return this.tryConnectCoNET(socket, sessionHash);
        });
        socket.on('sendRequestMail', CallBack1 => {
            CallBack1();
            if (!this.CoNETConnectCalss) {
                return console.log(`localServer on sendRequestMail Error! have no this.CoNETConnectCalss!`);
            }
            socket.emit('tryConnectCoNETStage', null, 2, false);
            if (this.CoNETConnectCalss) {
                console.log(`localWebServer on sendRequestMail !`);
                return this.CoNETConnectCalss.sendRequestMail();
            }
            console.log(`localWebServer on sendRequestMail have no CoNETConnectCalss create CoNETConnectCalss`);
            return this.tryConnectCoNET(socket, sessionHash);
        });
        socket.on('checkActiveEmailSubmit', (text, CallBack1) => {
            const uuid = Uuid.v4();
            CallBack1(uuid);
            const _callBack = (...data) => {
                socket.emit(uuid, ...data);
            };
            const key = Buffer.from(text, 'base64').toString();
            console.log(`checkActiveEmailSubmit`, key);
            if (key && key.length) {
                console.log(`active key success! \n[${key}]`);
                this.keyPair.publicKey = this.config.keypair.publicKey = key;
                this.keyPair.verified = this.config.keypair.verified = true;
                this.imapConnectData.sendToQTGate = true;
                _callBack();
                Tool.saveEncryptoData(Tool.imapDataFileName1, this.imapConnectData, this.config, this.savedPasswrod, err => {
                    if (err) {
                        saveLog(`Tool.saveConfig return Error: [${err.message}]`);
                    }
                });
                return Tool.saveConfig(this.config, err => {
                    if (err) {
                        saveLog(`Tool.saveConfig return Error: [${err.message}]`);
                    }
                });
            }
        });
        socket.on('doingRequest', (uuid, request, CallBack1) => {
            const _uuid = Uuid.v4();
            CallBack1(_uuid);
            const _callBack = (...data) => {
                socket.emit(_uuid, ...data);
            };
            this.requestPool.set(uuid, socket);
            console.log(`on doingRequest uuid = [${uuid}]\n${request}\n`);
            if (this.CoNETConnectCalss) {
                saveLog(`doingRequest on ${uuid}`);
                return this.CoNETConnectCalss.requestCoNET_v1(uuid, request, _callBack);
            }
            saveLog(`doingRequest on ${uuid} but have not CoNETConnectCalss need restart! socket.emit ( 'systemErr' )`);
            socket.emit('systemErr');
        });
        socket.on('getFilesFromImap', (files, CallBack1) => {
            const uuid = Uuid.v4();
            CallBack1(uuid);
            const _callBack = (...data) => {
                socket.emit(uuid, ...data);
            };
            if (typeof files !== 'string' || !files.length) {
                return _callBack(new Error('invalidRequest'));
            }
            const _files = files.split(',');
            console.log(`socket.on ('getFilesFromImap') _files = [${_files}] _files.length = [${_files.length}]`);
            let ret = '';
            return Async.eachSeries(_files, (n, next) => {
                console.log(`Async.eachSeries _files[${n}]`);
                return this.CoNETConnectCalss.getFile(n, (err, data) => {
                    if (err) {
                        return next(err);
                    }
                    ret += data.toString();
                    return next();
                });
            }, err => {
                if (err) {
                    return _callBack(err);
                }
                //console.log (`******************** getFilesFromImap success all [${ ret.length }] fies!\n\n${ ret }\n\n`)
                return _callBack(null, ret);
            });
        });
        socket.on('sendMedia', (uuid, rawData, CallBack1) => {
            const _uuid = Uuid.v4();
            CallBack1(_uuid);
            const _callBack = (...data) => {
                socket.emit(_uuid, ...data);
            };
            return this.CoNETConnectCalss.sendDataToANewUuidFolder(Buffer.from(rawData).toString('base64'), uuid, uuid, _callBack);
        });
        socket.on('mime', (_mime, CallBack1) => {
            const _uuid = Uuid.v4();
            CallBack1(_uuid);
            const _callBack = (...data) => {
                socket.emit(_uuid, ...data);
            };
            let y = mime.lookup(_mime);
            if (!y) {
                return _callBack(new Error('no mime'));
            }
            return _callBack(null, y);
        });
        /*
                socket.on ('getUrl', ( url: string, CallBack ) => {
                    const uu = new URLSearchParams ( url )
                    if ( !uu || typeof uu.get !== 'function' ) {
                        console.log (`getUrl [${ url }] have not any URLSearchParams`)
                        return CallBack ()
                    }
                    
                    return CallBack ( null, uu.get('imgrefurl'), uu.get('/imgres?imgurl'))
                })
        */
    }
    doingCheckImap(socket) {
        this.imapConnectData.imapTestResult = false;
        return Async.series([
            next => Imap.imapAccountTest(this.imapConnectData, err => {
                if (err) {
                    return next(err);
                }
                console.log(`imapAccountTest success!`, typeof next);
                socket.emit('imapTest');
                return next();
            }),
            next => Tool.smtpVerify(this.imapConnectData, next)
        ], (err) => {
            if (err) {
                console.log(`doingCheckImap Async.series Error!`, err);
                return socket.emit('smtpTest', imapErrorCallBack(err.message));
            }
            this.imapConnectData.imapTestResult = true;
            return Tool.saveEncryptoData(Tool.imapDataFileName1, this.imapConnectData, this.config, this.savedPasswrod, err => {
                console.log(`socket.emit ( 'imapTestFinish' )`);
                socket.emit('imapTestFinish', this.imapConnectData);
            });
        });
    }
    socketServerConnected(socket) {
        const clientName = `[${socket.id}][ ${socket.conn.remoteAddress}]`;
        let sessionHash = '';
        const clientObj = {
            listenAfterPasswd: false,
            socket: socket,
            login: false
        };
        saveLog(`socketServerConnected ${clientName} connect ${this.localConnected.size}`);
        socket.once('init', Callback1 => {
            const uuid = Uuid.v4();
            Callback1(uuid);
            const ret = Tool.emitConfig(this.config, false);
            //console.log ( Util.inspect( ret, false, 3, true  ))
            //console.log ( `typeof Callback1 [${ typeof Callback1 }]`)
            return socket.emit(uuid, null, ret);
        });
        socket.once('agreeClick', () => {
            this.config.firstRun = false;
            return Tool.saveConfig(this.config, saveLog);
        });
        socket.on('checkPemPassword', (password, CallBack1) => {
            const uuid = Uuid.v4();
            CallBack1(uuid);
            this.sessionHashPool.push(sessionHash = Crypto.randomBytes(10).toString('hex'));
            const passwordFail = (imap) => {
                //onsole.log (`passwordFail this.Pbkdf2Password = [${ this.Pbkdf2Password }]`)
                return socket.emit(uuid, null, imap, this.Pbkdf2Password, sessionHash);
            };
            if (!this.config.keypair || !this.config.keypair.publicKey) {
                console.log(`checkPemPassword !this.config.keypair`);
                return passwordFail(true);
            }
            if (!password || password.length < 5) {
                console.log(`! password `);
                return passwordFail(true);
            }
            if (this.savedPasswrod && this.savedPasswrod.length) {
                if (this.savedPasswrod !== password) {
                    console.log(`savedPasswrod !== password `);
                    return passwordFail(true);
                }
                this.listenAfterPassword(socket, sessionHash);
                return passwordFail(this.imapConnectData);
            }
            return Async.waterfall([
                next => Tool.getPbkdf2(this.config, password, next),
                (Pbkdf2Password, next) => {
                    this.Pbkdf2Password = Pbkdf2Password.toString('hex');
                    Tool.getKeyPairInfo(this.config.keypair.publicKey, this.config.keypair.privateKey, this.Pbkdf2Password, next);
                },
                (key, next) => {
                    //console.log ( `checkPemPassword Tool.getKeyPairInfo success!`)
                    if (!key.passwordOK) {
                        this.Pbkdf2Password = null;
                        saveLog(`[${clientName}] on checkPemPassword had try password! [${password}]`);
                        return passwordFail(true);
                    }
                    //console.log (`checkPemPassword this.Pbkdf2Password = [${ this.Pbkdf2Password}]`)
                    this.savedPasswrod = password;
                    this.keyPair = key;
                    clientObj.listenAfterPasswd = clientObj.login = true;
                    this.localConnected.set(clientName, clientObj);
                    return Tool.makeGpgKeyOption(this.config, this.savedPasswrod, next);
                },
                (option_KeyOption, next) => {
                    console.log(`checkPemPassword Tool.makeGpgKeyOption success!`);
                    this.openPgpKeyOption = option_KeyOption;
                    return Tool.readEncryptoFile(Tool.imapDataFileName1, password, this.config, next);
                }
            ], (err, data) => {
                console.log(`checkPemPassword Async.waterfall success!`);
                if (err) {
                    if (!(err.message && /no such file/i.test(err.message))) {
                        passwordFail(err);
                        return saveLog(`Tool.makeGpgKeyOption return err [${err && err.message ? err.message : null}]`);
                    }
                }
                // console.log (`this.sessionHashPool.push!\n${ this.sessionHashPool }\n${ this.sessionHashPool.length }`)
                this.listenAfterPassword(socket, sessionHash);
                try {
                    this.imapConnectData = JSON.parse(data);
                }
                catch (ex) {
                    return passwordFail(ex);
                }
                this.localConnected.set(clientName, clientObj);
                return passwordFail(this.imapConnectData);
            });
        });
        socket.on('deleteKeyPairNext', CallBack1 => {
            CallBack1();
            console.log(`on deleteKeyPairNext`);
            const thisConnect = this.localConnected.get(clientName);
            if (this.localConnected.size > 1 && thisConnect && !thisConnect.login) {
                console.log(`this.localConnected = [${Util.inspect(this.localConnected, false, 2, true)}], thisConnect.login = [${thisConnect.login}]`);
                return this.socketServer.emit('deleteKeyPairNoite');
            }
            const info = `socket on deleteKeyPairNext, delete key pair now.`;
            saveLog(info);
            this.config = Tool.InitConfig();
            this.config.firstRun = false;
            this.keyPair = null;
            Tool.saveConfig(this.config, saveLog);
            if (this.CoNETConnectCalss) {
                this.CoNETConnectCalss.destroy(2);
                this.CoNETConnectCalss = null;
            }
            sessionHash = '';
            Tool.deleteImapFile();
            return this.socketServer.emit('init', null, this.config);
        });
        socket.on('NewKeyPair', (preData, CallBack1) => {
            const uuid = Uuid.v4();
            CallBack1(uuid);
            const _callBack = (...data) => {
                socket.emit(uuid, ...data);
            };
            //		already have key pair
            if (this.config.keypair && this.config.keypair.createDate) {
                return saveLog(`[${clientName}] on NewKeyPair but system already have keypair: ${this.config.keypair.publicKeyID} stop and return keypair.`);
            }
            this.savedPasswrod = preData.password;
            return Tool.getPbkdf2(this.config, this.savedPasswrod, (err, Pbkdf2Password) => {
                if (err) {
                    saveLog(`NewKeyPair getPbkdf2 Error: [${err.message}]`);
                    return _callBack('systemError');
                }
                preData.password = Pbkdf2Password.toString('hex');
                //console.log (`preData.password = [${ preData.password }]`)
                return Tool.newKeyPair(preData.email, preData.nikeName, preData.password, (err, retData) => {
                    if (err) {
                        console.log(err);
                        _callBack();
                        return saveLog(`CreateKeyPairProcess return err: [${err.message}]`);
                    }
                    if (!retData) {
                        const info = `newKeyPair return null key!`;
                        saveLog(info);
                        console.log(info);
                        return _callBack();
                    }
                    if (!clientObj.listenAfterPasswd) {
                        clientObj.listenAfterPasswd = clientObj.login = true;
                        this.localConnected.set(clientName, clientObj);
                        this.sessionHashPool.push(sessionHash = Crypto.randomBytes(10).toString('hex'));
                        //console.log ( `this.sessionHashPool.push!\n${ this.sessionHashPool }\n${ this.sessionHashPool.length }`)
                        this.listenAfterPassword(socket, sessionHash);
                    }
                    return Tool.getKeyPairInfo(retData.publicKey, retData.privateKey, preData.password, (err, key) => {
                        if (err) {
                            const info = `Tool.getKeyPairInfo Error [${err.message ? err.message : 'null err message '}]`;
                            return _callBack('systemError');
                        }
                        this.keyPair = this.config.keypair = key;
                        this.config.account = this.config.keypair.email;
                        return Tool.makeGpgKeyOption(this.config, this.savedPasswrod, (err, data) => {
                            if (err) {
                                return saveLog(err.message);
                            }
                            this.openPgpKeyOption = data;
                            Tool.saveConfig(this.config, saveLog);
                            return _callBack(null, this.config.keypair, sessionHash);
                        });
                    });
                });
            });
        });
    }
}
exports.default = localServer;


================================================
FILE: app/localWebServer.ts
================================================
/*!
 * Copyright 2018 CoNET Technology Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import * as Express from 'express'
import * as Path from 'path'
import * as HTTP from 'http'
import * as SocketIo from 'socket.io'
import * as Tool from './tools/initSystem'
import * as Async from 'async'
import * as Fs from 'fs'
import * as Util from 'util'
import * as Uuid from 'node-uuid'
import * as Imap from './tools/imap'
import CoNETConnectCalss from './tools/coNETConnect'
import * as Crypto from 'crypto'
import * as mime from 'mime-types'

Express.static.mime.define({ 'multipart/related': ['mht'] })
//Express.static.mime.define({ 'message/rfc822' : ['mhtml','mht'] })
Express.static.mime.define({ 'application/x-mimearchive' : ['mhtml','mht'] })
Express.static.mime.define({ 'multipart/related' : ['mhtml','mht'] })

interface localConnect {
	socket: SocketIO.Socket
	login: boolean
	listenAfterPasswd: boolean
}

let logFileFlag = 'w'
const conetImapAccount = /^qtgate_test\d\d?@icloud.com$/i

const saveLog = ( err: {} | string ) => {
	if ( !err ) {
		return 
	}
	const data = `${ new Date().toUTCString () }: ${ typeof err === 'object' ? ( err['message'] ? err['message'] : '' ) : err }\r\n`
	console.log ( data )
	return Fs.appendFile ( Tool.ErrorLogFile, data, { flag: logFileFlag }, () => {
		return logFileFlag = 'a'
	})
}

const saveServerStartup = ( localIpaddress: string ) => {
	const info = `\n*************************** CoNET Platform [ ${ Tool.CoNET_version } ] server start up *****************************\n` +
			`Access url: http://${localIpaddress}:${ Tool.LocalServerPortNumber }\n`
	saveLog ( info )
}

const saveServerStartupError = ( err: {} ) => {
	const info = `\n*************************** CoNET Platform [ ${ Tool.CoNET_version } ] server startup falied *****************************\n` +
			`platform ${ process.platform }\n` +
			`${ err['message'] }\n`
	saveLog ( info )
}

const imapErrorCallBack = ( message: string ) => {
	if ( message && message.length ) {
		if ( /auth|login|log in|Too many simultaneous|UNAVAILABLE/i.test( message )) {
			return 1
		}
			
		if ( /ECONNREFUSED/i.test ( message )) {
			return 5
		}

		if (/OVERQUOTA/i.test ( message )) {
			return 6
		}
			
		if ( /certificate/i.test ( message )) {
			return 2
		}
			
		if ( /timeout|ENOTFOUND/i.test ( message )) {
			return 0
		}

		return 5
	}
	
	return -1

}


export default class localServer {
	private expressServer = Express()
	private httpServer = HTTP.createServer ( this.expressServer )
	private socketServer = SocketIo ( this.httpServer )
	private socketServer_CoSearch = this.socketServer.of ('/CoSearch')
	public config: install_config  = null
	public keyPair: keypair = null
	public savedPasswrod: string = ''
	public imapConnectData: IinputData = null
	public localConnected: Map < string, localConnect > = new Map ()
	private CoNETConnectCalss: CoNETConnectCalss = null
	private openPgpKeyOption = null
	private sessionHashPool = []
	private Pbkdf2Password = null
	private nodeList = [{
		email: 'node@Kloak.app',
		keyID:'',
		key: ''
	}]

	private requestPool: Map < string, SocketIO.Socket > = new Map()


	private catchCmd ( mail: string, uuid: string ) {
		if ( !this.imapConnectData.sendToQTGate ) {
			this.imapConnectData.sendToQTGate = true
			Tool.saveEncryptoData (  Tool.imapDataFileName1, this.imapConnectData, this.config, this.savedPasswrod, err => {

			})
		}
		console.log ( `Get response from CoNET uuid [${ uuid }] length [${ mail.length }]`)
		const socket = this.requestPool.get ( uuid )
		if ( !socket ) {
			return console.log (`Get cmd that have no matched socket \n\n`, mail )
		}

		socket.emit ( 'doingRequest', mail, uuid )
	}
	
	private tryConnectCoNET ( socket: SocketIO.Socket, sessionHash: string ) {
		console.log (`doing tryConnectCoNET`)
		//		have CoGate connect

		if ( this.CoNETConnectCalss ) {
			return this.CoNETConnectCalss.Ping()
		}

		let sendMail = false
		const _exitFunction = err => {
			console.trace ( `makeConnect on _exitFunction err this.CoNETConnectCalss destroy!`, err )
			this.CoNETConnectCalss = null
			
		}

		const makeConnect = () => {
			
			return this.CoNETConnectCalss = new CoNETConnectCalss ( this.imapConnectData, this.socketServer, !this.imapConnectData.sendToQTGate, this.nodeList[0].email,
				this.openPgpKeyOption, this.keyPair.publicKey, ( mail, uuid ) => {
				return this.catchCmd ( mail, uuid )
			}, _exitFunction )
			
		}
		
		return makeConnect ()
		
	}

	private listenAfterPassword ( socket: SocketIO.Socket, sessionHash: string ) {
		
		socket.on ( 'checkImap', ( emailAddress: string, password: string, timeZone, tLang, CallBack1 ) => {
			CallBack1()
			console.log (`localServer on checkImap!`)
			const imapServer = Tool.getImapSmtpHost( emailAddress )
			this.imapConnectData = {
				email: this.config.account,
				account: this.config.account,
				smtpServer: imapServer.smtp,
				smtpUserName: emailAddress,
				smtpPortNumber: imapServer.SmtpPort,
				smtpSsl: imapServer.smtpSsl,
				smtpIgnoreCertificate: false,
				smtpUserPassword: password,
				imapServer: imapServer.imap,
				imapPortNumber: imapServer.ImapPort,
				imapSsl: imapServer.imapSsl,
				imapUserName: emailAddress,
				imapIgnoreCertificate: false,
				imapUserPassword: password,
				timeZoneOffset: timeZone,
				language: tLang,
				imapTestResult: null,
				clientFolder: Uuid.v4(),
				serverFolder: Uuid.v4(),
				randomPassword: Uuid.v4(),
				uuid: Uuid.v4(),
				confirmRisk: false,
				clientIpAddress: null,
				ciphers: null,
				sendToQTGate: false

			}

			return this.doingCheckImap ( socket )
		})

		socket.on ( 'tryConnectCoNET', CallBack1 => {
			const uuid = Uuid.v4()
			CallBack1( uuid )

			const _callBack = ( ...data ) => {
				socket.emit ( uuid, ...data )
			}
			console.log (`socket on tryConnectCoNET!\n\n`)
			if ( !this.imapConnectData ) {
				console.log (`socket.on ( 'tryConnectCoNET') !this.imapConnectData \n\n `)
				return _callBack ( 'systemError' )
				
			}
			if ( !this.imapConnectData.confirmRisk ) {
				this.imapConnectData.confirmRisk = true
				
				return Tool.saveEncryptoData (  Tool.imapDataFileName1, this.imapConnectData, this.config, this.savedPasswrod, err => {
					return this.tryConnectCoNET ( socket, sessionHash )
				})
			}
			return this.tryConnectCoNET ( socket, sessionHash )
			
		})

		socket.on ( 'sendRequestMail', CallBack1 => {

			
			CallBack1 ()
			if ( !this.CoNETConnectCalss ) {
				return console.log (`localServer on sendRequestMail Error! have no this.CoNETConnectCalss!`)
			}
			socket.emit ( 'tryConnectCoNETStage', null, 2, false )
			if ( this.CoNETConnectCalss ) {
				console.log (`localWebServer on sendRequestMail !`)
				return this.CoNETConnectCalss.sendRequestMail ()
			}
			console.log (`localWebServer on sendRequestMail have no CoNETConnectCalss create CoNETConnectCalss`)
			return this.tryConnectCoNET ( socket, sessionHash )
			
		})

		socket.on ( 'checkActiveEmailSubmit', ( text, CallBack1 ) => {
			const uuid = Uuid.v4()
			CallBack1( uuid )
			
			const _callBack = ( ...data ) => {
				socket.emit ( uuid, ...data )
			}

			const key = Buffer.from ( text, 'base64' ).toString ()
			console.log (`checkActiveEmailSubmit`, key )
			if ( key && key.length ) {
				console.log ( `active key success! \n[${ key }]`)
				
				this.keyPair.publicKey = this.config.keypair.publicKey = key
				this.keyPair.verified = this.config.keypair.verified = true
				this.imapConnectData.sendToQTGate = true
				_callBack ()
				Tool.saveEncryptoData ( Tool.imapDataFileName1, this.imapConnectData, this.config, this.savedPasswrod, err => {
					if ( err ) {
						saveLog (`Tool.saveConfig return Error: [${ err.message }]`)
					}
				})
				return Tool.saveConfig ( this.config, err => {
					if ( err ) {
						saveLog (`Tool.saveConfig return Error: [${ err.message }]`)
					}
					
					
				})
				
			}
			
		})

		socket.on ( 'doingRequest', ( uuid, request, CallBack1 ) => {
			const _uuid = Uuid.v4()
			CallBack1 ( _uuid )

			const _callBack = ( ...data ) => {
				socket.emit ( _uuid, ...data )
			}
			this.requestPool.set ( uuid, socket )
			
			console.log (`on doingRequest uuid = [${ uuid }]\n${ request }\n`)

			if ( this.CoNETConnectCalss ) {
				saveLog (`doingRequest on ${ uuid }`)
				return this.CoNETConnectCalss.requestCoNET_v1 ( uuid, request, _callBack )
			}
			saveLog ( `doingRequest on ${ uuid } but have not CoNETConnectCalss need restart! socket.emit ( 'systemErr' )`)
			socket.emit ( 'systemErr' )
		})

		socket.on ( 'getFilesFromImap', ( files: string, CallBack1 ) => {
			const uuid = Uuid.v4()
			CallBack1( uuid )

			const _callBack = ( ...data ) => {
				socket.emit ( uuid, ...data )
			}
			
			if ( typeof files !== 'string' || !files.length ) {
				return _callBack ( new Error ('invalidRequest'))
			}
			const _files = files.split (',')
			console.log (`socket.on ('getFilesFromImap') _files = [${ _files }] _files.length = [${ _files.length }]`  )
			
			let ret = ''
			return Async.eachSeries ( _files, ( n, next ) => {
				console.log (`Async.eachSeries _files[${ n }]`)
				return this.CoNETConnectCalss.getFile ( n, ( err, data ) => {
					if ( err ) {
						return next ( err )
					}
					ret += data.toString ()
					return next ()
				})
			}, err => {
				if ( err ) {
					return _callBack ( err )
				}
				
				//console.log (`******************** getFilesFromImap success all [${ ret.length }] fies!\n\n${ ret }\n\n`)

				
				return _callBack ( null, ret )
			})
			
		})

		socket.on ( 'sendMedia', ( uuid, rawData, CallBack1 ) => {
			const _uuid = Uuid.v4()
			CallBack1( _uuid )

			const _callBack = ( ...data ) => {
				socket.emit ( _uuid, ...data )
			}
			return this.CoNETConnectCalss.sendDataToANewUuidFolder ( Buffer.from ( rawData ).toString ( 'base64' ), uuid, uuid, _callBack )
		})

		socket.on ( 'mime', ( _mime, CallBack1 ) => {
			const _uuid = Uuid.v4()
			CallBack1( _uuid )

			const _callBack = ( ...data ) => {
				socket.emit ( _uuid, ...data )
			}
			let y = mime.lookup( _mime )
			if ( !y ) {
				return _callBack ( new Error ('no mime'))
			}
			return _callBack ( null, y )
		})
/*
		socket.on ('getUrl', ( url: string, CallBack ) => {
			const uu = new URLSearchParams ( url )
			if ( !uu || typeof uu.get !== 'function' ) {
				console.log (`getUrl [${ url }] have not any URLSearchParams`)
				return CallBack ()
			}
			
			return CallBack ( null, uu.get('imgrefurl'), uu.get('/imgres?imgurl'))
		})
*/
	}

	private doingCheckImap ( socket: SocketIO.Socket ) {
		this.imapConnectData.imapTestResult = false
		return Async.series ([
			next => Imap.imapAccountTest ( this.imapConnectData, err => {
				if ( err ) {
					
					return next ( err )
				}
				console.log (`imapAccountTest success!`, typeof next )
				socket.emit ( 'imapTest' )
				return next ()
			}),
			next => Tool.smtpVerify ( this.imapConnectData, next )
		], ( err: Error ) => {
			
			if ( err ) {
				console.log (`doingCheckImap Async.series Error!`, err )
				return socket.emit ( 'smtpTest', imapErrorCallBack ( err.message ))
			}

			this.imapConnectData.imapTestResult = true
			return Tool.saveEncryptoData ( Tool.imapDataFileName1, this.imapConnectData, this.config, this.savedPasswrod, err => {
				console.log (`socket.emit ( 'imapTestFinish' )`)
				socket.emit ( 'imapTestFinish' , this.imapConnectData )
			})
			
		})
			
		
	}

	private socketServerConnected ( socket: SocketIO.Socket ) {
		const clientName = `[${ socket.id }][ ${ socket.conn.remoteAddress }]`
		let sessionHash = ''
		const clientObj: localConnect = {
			listenAfterPasswd: false,
			socket: socket,
			login: false
		}

		saveLog ( `socketServerConnected ${ clientName } connect ${ this.localConnected.size }`)


		socket.once ( 'init', Callback1 => {
			const uuid = Uuid.v4()
			Callback1 ( uuid )
			const ret = Tool.emitConfig ( this.config, false )
			//console.log ( Util.inspect( ret, false, 3, true  ))
			//console.log ( `typeof Callback1 [${ typeof Callback1 }]`)
			return socket.emit ( uuid, null, ret )
		})

		socket.once ( 'agreeClick', () => {
			this.config.firstRun = false
			return Tool.saveConfig ( this.config, saveLog )
		})

		socket.on ( 'checkPemPassword', ( password: string, CallBack1 ) => {

			const uuid = Uuid.v4()
			CallBack1 ( uuid )

			this.sessionHashPool.push ( sessionHash = Crypto.randomBytes ( 10 ).toString ('hex'))

			const passwordFail = ( imap ) => {

				//onsole.log (`passwordFail this.Pbkdf2Password = [${ this.Pbkdf2Password }]`)
				return socket.emit ( uuid, null, imap, this.Pbkdf2Password, sessionHash )
				
			}

			if ( !this.config.keypair || !this.config.keypair.publicKey ) {
				console.log ( `checkPemPassword !this.config.keypair` )
				return passwordFail ( true )
			}

			if ( !password || password.length < 5 ) {
				console.log (`! password `)
				return passwordFail ( true )
			}
			
			if ( this.savedPasswrod && this.savedPasswrod.length ) {
				if ( this.savedPasswrod !== password ) {
					console.log ( `savedPasswrod !== password `)
					return passwordFail ( true )
				}
				
				this.listenAfterPassword ( socket, sessionHash )
				return passwordFail ( this.imapConnectData )
				
				
			}
			
			return Async.waterfall ([
				next => Tool.getPbkdf2 ( this.config, password, next ),
				( Pbkdf2Password: Buffer, next ) => {
					this.Pbkdf2Password = Pbkdf2Password.toString ( 'hex' )
					
					Tool.getKeyPairInfo ( this.config.keypair.publicKey, this.config.keypair.privateKey, this.Pbkdf2Password, next )
				},
				( key, next ) => {
					//console.log ( `checkPemPassword Tool.getKeyPairInfo success!`)
					if ( ! key.passwordOK ) {
						this.Pbkdf2Password = null
						saveLog ( `[${ clientName }] on checkPemPassword had try password! [${ password }]` )
						return passwordFail ( true )
					}
					//console.log (`checkPemPassword this.Pbkdf2Password = [${ this.Pbkdf2Password}]`)
					this.savedPasswrod = password
					
					this.keyPair = key
					clientObj.listenAfterPasswd = clientObj.login = true
					this.localConnected.set ( clientName, clientObj )
					return Tool.makeGpgKeyOption ( this.config, this.savedPasswrod, next )
				},
				( option_KeyOption, next ) => {
					console.log (`checkPemPassword Tool.makeGpgKeyOption success!`)
					this.openPgpKeyOption = option_KeyOption

					return Tool.readEncryptoFile ( Tool.imapDataFileName1, password, this.config, next )
			}], ( err: Error, data: string ) => {
				console.log (`checkPemPassword Async.waterfall success!`)
				if ( err ) {
					if ( !( err.message && /no such file/i.test( err.message ))) {
						passwordFail ( err )
						return saveLog ( `Tool.makeGpgKeyOption return err [${ err && err.message ? err.message : null }]` )
					}
				}

				
				// console.log (`this.sessionHashPool.push!\n${ this.sessionHashPool }\n${ this.sessionHashPool.length }`)
				this.listenAfterPassword ( socket, sessionHash )

				try {
					this.imapConnectData = JSON.parse ( data )
					
				} catch ( ex ) {
					return passwordFail ( ex )
				}
				this.localConnected.set ( clientName, clientObj )
					
				return passwordFail ( this.imapConnectData )
			})
			
		})

		socket.on ( 'deleteKeyPairNext', CallBack1 => {
			CallBack1()
			console.log ( `on deleteKeyPairNext` )
			const thisConnect = this.localConnected.get ( clientName )

			if ( this.localConnected.size > 1 && thisConnect && ! thisConnect.login ) {
				console.log (`this.localConnected = [${ Util.inspect( this.localConnected, false, 2, true )}], thisConnect.login = [${ thisConnect.login }]`)
				return this.socketServer.emit ( 'deleteKeyPairNoite' )
			}
			const info = `socket on deleteKeyPairNext, delete key pair now.`
			
			saveLog ( info )
			this.config = Tool.InitConfig ()
			this.config.firstRun = false
			this.keyPair = null
			Tool.saveConfig ( this.config, saveLog )
			if ( this.CoNETConnectCalss ) {
				this.CoNETConnectCalss.destroy ( 2 )
				this.CoNETConnectCalss = null
			}
			sessionHash = ''
			Tool.deleteImapFile ()
			return this.socketServer.emit ( 'init', null, this.config )
		})

		socket.on ( 'NewKeyPair', ( preData: INewKeyPair, CallBack1 ) => {
			const uuid = Uuid.v4()
			CallBack1( uuid )

			const _callBack = ( ...data ) => {
				socket.emit ( uuid, ...data )
			}
			//		already have key pair

			if ( this.config.keypair && this.config.keypair.createDate ) {
				return saveLog (`[${ clientName }] on NewKeyPair but system already have keypair: ${ this.config.keypair.publicKeyID } stop and return keypair.`)
			}

			this.savedPasswrod = preData.password
			return Tool.getPbkdf2 ( this.config, this.savedPasswrod, ( err, Pbkdf2Password: Buffer ) => {
				if ( err ) {
					saveLog ( `NewKeyPair getPbkdf2 Error: [${ err.message }]`)
					return _callBack ('systemError')
				}
				
				preData.password = Pbkdf2Password.toString ( 'hex' )
				//console.log (`preData.password = [${ preData.password }]`)
				return Tool.newKeyPair( preData.email, preData.nikeName, preData.password, ( err, retData )=> {
					if ( err ) {
						console.log ( err )
						_callBack ()
						return saveLog (`CreateKeyPairProcess return err: [${ err.message }]`)
					}
					
				
					if ( ! retData ) {
						const info = `newKeyPair return null key!`
						saveLog ( info )
						console.log ( info )
						return _callBack ( )
					}
					
					if ( !clientObj.listenAfterPasswd ) {
						clientObj.listenAfterPasswd = clientObj.login = true
						
						this.localConnected.set ( clientName, clientObj )
						this.sessionHashPool.push ( sessionHash = Crypto.randomBytes (10).toString ('hex'))
						//console.log ( `this.sessionHashPool.push!\n${ this.sessionHashPool }\n${ this.sessionHashPool.length }`)
						this.listenAfterPassword ( socket, sessionHash )
					}
					
					return Tool.getKeyPairInfo ( retData.publicKey, retData.privateKey, preData.password, ( err, key ) => {
						if ( err ) {
							const info = `Tool.getKeyPairInfo Error [${ err.message ? err.message : 'null err message '}]`
							return _callBack ( 'systemError' )
						}
						this.keyPair = this.config.keypair = key
						this.config.account = this.config.keypair.email
						return Tool.makeGpgKeyOption ( this.config, this.savedPasswrod, ( err, data ) => {
							if ( err ) {
								return saveLog ( err.message )
							}
							this.openPgpKeyOption = data
							Tool.saveConfig ( this.config, saveLog )
							
							return _callBack ( null, this.config.keypair, sessionHash )
						})
						
					})
				})
								
			})
			
		})


	}

	constructor( private cmdResponse: ( cmd: QTGateAPIRequestCommand ) => void, test: boolean ) {
		//Express.static.mime.define({ 'message/rfc822' : ['mhtml','mht'] })
		//Express.static.mime.define ({ 'multipart/related' : ['mhtml','mht'] })
		Express.static.mime.define ({ 'application/x-mimearchive' : ['mhtml','mht'] })
		this.expressServer.set ( 'views', Path.join ( __dirname, 'views' ))
		this.expressServer.set ( 'view engine', 'pug' )
		this.expressServer.use ( Express.static ( Tool.QTGateFolder ))
		this.expressServer.use ( Express.static ( Path.join ( __dirname, 'public' )))
		this.expressServer.use ( Express.static ( Path.join ( __dirname, 'html' )))
	
		
		
		this.expressServer.get ( '/', ( req, res ) => {

            res.render( 'home', { title: 'home', proxyErr: false  })
		})

		this.socketServer.on ( 'connection', socker => {
			return this.socketServerConnected ( socker )
		})
		

		this.httpServer.once ( 'error', err => {
			console.log (`httpServer error`, err )
			saveServerStartupError ( err )
			return process.exit (1)
		})

		

		Async.series ([
			next => Tool.checkSystemFolder ( next ),
			next => Tool.checkConfig ( next )	
		], ( err, data ) => {
			if ( err ) {
				return saveServerStartupError ( err )
			}
			
			this.config = data['1']
			if ( !test ) {
				this.httpServer.listen ( Tool.LocalServerPortNumber, () => {
					return saveServerStartup ( `localhost`)
				})
			}
		})
		
	}
}


================================================
FILE: app/main.js
================================================
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const localWebServer_1 = require("./localWebServer");
const test = /^true$/.test(process.argv[2]) ? true : false;
const _start = process.argv[3] || false;
exports.start = (cmd, _test) => {
    const localServer = new localWebServer_1.default(cmd, _test);
};
if (_start) {
    exports.start(null, false);
}


================================================
FILE: app/main.ts
================================================
/*!
 * Copyright 2018 CoNET Technology Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
declare const process: any
import LocalServer from './localWebServer'
const test = /^true$/.test ( process.argv[2] ) ? true : false
const _start = process.argv [3] || false
export const start = ( cmd: () => void, _test ) => {
	const localServer = new LocalServer ( cmd, _test )
}
if ( _start ) {
	start ( null, false )
}

================================================
FILE: app/package.json.npm
================================================
{
  "name": "conet",
  "version": "3.0.20",
  "license": "MIT",
  "description": "CoNET",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/QTGate/CoNET.git"
  },
  "author": {
    "name": "CoNET Technology Inc.",
    "email": "info@CoNETTech.ca"
  },
  "main": "./main",
  "bugs": {
    "url": "https://github.com/QTGate/CoNET/issues"
  },
  "homepage": "https://www.CoNETTech.ca",
  "dependencies": {
    "async": "^3.1.0",
    "cookie-parser": "^1.4.4",
    "express": "^4.17.1",
    "jimp": "^0.8.5",
    "jszip": "^3.2.2",
    "mime-types": "^2.1.24",
    "node-uuid": "^1.4.8",
    "nodemailer": "^6.3.1",
    "openpgp": "^4.6.2",
    "pug": "^2.0.4",
    "socket.io": "^2.3.0",
    "socket.io-client": "^2.3.0"
  },
  "scripts": {
    "start": "node main false true"
  },
  "devDependencies": {
    "@types/async": "^3.0.3",
    "@types/cleave.js": "^1.4.1",
    "@types/cookie-parser": "^1.4.2",
    "@types/express": "^4.17.1",
    "@types/jcanvas": "^15.2.2",
    "@types/jquery": "^3.3.31",
    "@types/jquery.cookie": "^1.4.31",
    "@types/knockout": "^3.4.66",
    "@types/openpgp": "^4.4.7",
    "@types/semantic-ui": "^2.2.7",
    "@types/socket.io": "^2.1.4",
    "@types/socket.io-client": "^1.4.32",
    "source-map-support": "^0.5.16"
  }
}


================================================
FILE: app/public/css/c3.css
================================================
.c3 svg{font:10px sans-serif;-webkit-tap-highlight-color:transparent}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.c3-bars path,.c3-event-rect,.c3-legend-item-tile,.c3-xgrid-focus,.c3-ygrid{shape-rendering:crispEdges}.c3-chart-arc path{stroke:#fff}.c3-chart-arc text{fill:#fff;font-size:13px}.c3-grid line{stroke:#aaa}.c3-grid text{fill:#aaa}.c3-xgrid,.c3-ygrid{stroke-dasharray:3 3}.c3-text.c3-empty{fill:grey;font-size:2em}.c3-line{stroke-width:1px}.c3-circle._expanded_{stroke-width:1px;stroke:#fff}.c3-selected-circle{fill:#fff;stroke-width:2px}.c3-bar{stroke-width:0}.c3-bar._expanded_{fill-opacity:1;fill-opacity:.75}.c3-target.c3-focused{opacity:1}.c3-target.c3-focused path.c3-line,.c3-target.c3-focused path.c3-step{stroke-width:2px}.c3-target.c3-defocused{opacity:.3!important}.c3-region{fill:#4682b4;fill-opacity:.1}.c3-brush .extent{fill-opacity:.1}.c3-legend-item{font-size:12px}.c3-legend-item-hidden{opacity:.15}.c3-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.c3-title{font:14px sans-serif}.c3-tooltip-container{z-index:10}.c3-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;opacity:.9}.c3-tooltip tr{border:1px solid #ccc}.c3-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#fff}.c3-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.c3-tooltip td>span{display:inline-block;width:10px;height:10px;margin-right:6px}.c3-tooltip td.value{text-align:right}.c3-area{stroke-width:0;opacity:.2}.c3-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.c3-chart-arcs .c3-chart-arcs-background{fill:#e0e0e0;stroke:none}.c3-chart-arcs .c3-chart-arcs-gauge-unit{fill:#000;font-size:16px}.c3-chart-arcs .c3-chart-arcs-gauge-max{fill:#777}.c3-chart-arcs .c3-chart-arcs-gauge-min{fill:#777}.c3-chart-arc .c3-gauge-value{fill:#000}.c3-chart-arc.c3-target g path{opacity:1}.c3-chart-arc.c3-target.c3-focused g path{opacity:1}

================================================
FILE: app/public/css/page.css
================================================


.bodyCoNETBlue {
	background: rgba(101,226,245,1);
	background: -moz-linear-gradient(left, rgba(101,226,245,1) 0%, rgba(125,175,250,1) 100%);
	background: -webkit-gradient(left top, right top, color-stop(0%, rgba(101,226,245,1)), color-stop(100%, rgba(125,175,250,1)));
	background: -webkit-linear-gradient(left, rgba(101,226,245,1) 0%, rgba(125,175,250,1) 100%);
	background: -o-linear-gradient(left, rgba(101,226,245,1) 0%, rgba(125,175,250,1) 100%);
	background: -ms-linear-gradient(left, rgba(101,226,245,1) 0%, rgba(125,175,250,1) 100%);
	background: linear-gradient(to right, rgba(101,226,245,1) 0%, rgba(125,175,250,1) 100%);
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#65e2f5', endColorstr='#7daffa', GradientType=1 );
	height: unset!important;
}

.bodyWhite {
	background: white
}

.welcome-bg {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	
	-ms-flex-pack: center;
		justify-content: center;

	-ms-flex-align: center;
			align-items: center;
  }

.fade-up {
	opacity: 0;
	-webkit-animation: fade-up 1s forwards cubic-bezier(0.2, 2, 0.4, 1);
			animation: fade-up 1s forwards cubic-bezier(0.2, 2, 0.4, 1);
}
  
.languageText {
	width: 100%;
	-webkit-transition: opacity 0.4s ease-in-out;
	-moz-transition: opacity 0.4s ease-in-out;
	-ms-transition: opacity 0.4s ease-in-out;
	-o-transition: opacity 0.4s ease-in-out;
	transition: opacity 0.4s ease-in-out;
	opacity: 0.6;
}
#languageArea {
	z-index: 100;
	width: 160px;
	top: 15px;
	left: 20px;
	position: fixed;
}
.languageItem {
	cursor: pointer;
	color: white!important;
}
.languageText:hover {
	text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
	opacity: 1;
}
.welcome {
	width: 100%;
	height: 100%;
	margin-bottom: 10em;
	display: -webkit-box;
	display: -ms-flexbox;
	display: flex;
	
		-ms-flex-pack: center;
			justify-content: center;
	
		-ms-flex-align: center;
			align-items: center;
	
		-ms-flex-direction: column;
			flex-direction: column;
}
.welcome h1.fade-up {
	font-weight: 300;
	font-size: 40px;
	-webkit-animation-delay: .25s;
			animation-delay: .25s;
}
.welcome h2.fade-up {
	font-weight: 400;
	color: rgba(255, 255, 255, 0.5);
	-webkit-animation-delay: .5s;
			animation-delay: .5s;
}
#agreement{
	background-color: #d3d9db;
	width: 100%;
	position: absolute;
	transition: opacity 0.4s ease-in;
	top: 0px;
}
#agreement .firstNodeContent {
	margin: 0px auto;
	margin-top: 5em;
	max-width: 50em;

}
.detailSegment {
	margin: 3em;
}
.agreementButtom {
	margin: 3em;
}
.CoContent {
    width: 95%;
    position: relative;
		transition: opacity 0.4s ease-in;
		margin: auto;
}
.loginCards {
	margin: 0px auto!important;
    margin-top: 5em!important;
    max-width: 50em;
}
.CoGateCards {
	margin: 0px auto!important;
    margin-top: 1em!important;
    max-width: 45em;
}
.searchItems {
	margin: 0px auto!important;
    margin-top: 1em!important;
    max-width: 40em;
}
.background-clolr-white {
    background-color: transparent!important;
}
.displayNono {
	display: none;
}

.iconButton {
	cursor: pointer;
	-webkit-transition: opacity 0.2s ease-in-out;
	-moz-transition: opacity 0.2s ease-in-out;
	-ms-transition: opacity 0.2s ease-in-out;
	-o-transition: opacity 0.2s ease-in-out;
	transition: opacity 0.2s ease-in-out;
	opacity: 0.6!important;
}

.iconButton:hover {
	text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
	opacity: 1!important;
}

.CoNET_info {
	text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
	opacity: 0.7;
	
	padding-right: 1em;
}
.green {
	 color: green!important;
}
.white {
	color: white;
}
.red {
	color: brown;
}
.yellow {
	color: yellow;
}
.grey {
	color: gray!important;
}
.QTGateGatewayCardHeader.active {
	color: yellowgreen!important;
 }
 .QTGateGatewayCardHeader {
	color: rgba(255,0,0,0.2)!important;
 
 }
 .plans {
	margin: 20px auto;
	width: 48em;
	zoom: 1;
  }
  .plans:before, .plans:after {
	content: '';
	display: table;
  }
  .plans:after {
	clear: both;
  }
  .plan {
		float: left;
		width: 16em;
		margin: 10px 0;
		padding: 20px;
		text-align: center;
		background: #fafafa;
		background-clip: padding-box;
		border: solid #453b5d;
		border-width: 2px 0 2px 2px;
		-webkit-box-sizing: border-box;
		-moz-box-sizing: border-box;
		box-sizing: border-box;
		-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
		box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  .plan:first-child {
		border-top-left-radius: 7px;
		border-bottom-left-radius: 7px;
  }
.shadowText {
	text-shadow: 10px 10px 30px rgba(0, 0, 0, 0.4);
}

.shadowText1 {
	text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
}

  .plan:last-child {
		border-width: 2px;
		border-top-right-radius: 7px;
		border-bottom-right-radius: 7px;
  }
  
  .plan-title {
		position: relative;
		margin: -20px -10px 20px;
		padding: 20px;
		line-height: 1;
		font-size: 16px;
		font-weight: bold;
		color: #595f6b;
		border-bottom: 1px dashed #d2d2d2;
  }
  
  .plan-title:before {
		content: '';
		position: absolute;
		bottom: -1px;
		left: 0;
		right: 0;
		height: 1px;
		background-size: 3px 1px;
		background-image: -webkit-linear-gradient(left, white, white 33%, #d2d2d2 34%, #d2d2d2);
		background-image: -moz-linear-gradient(left, white, white 33%, #d2d2d2 34%, #d2d2d2);
		background-image: -o-linear-gradient(left, white, white 33%, #d2d2d2 34%, #d2d2d2);
		background-image: linear-gradient(to right, white, white 33%, #d2d2d2 34%, #d2d2d2);
  }
  
  .plan-price {
		margin: 0 auto 20px;
		width: 90px;
		height: 90px;
		line-height: 90px;
		font-size: 19px;
		font-weight: bold;
		color: white;
		background: #595f6b;
		border-radius: 45px;
  }
  
  .plan-price > span {
		font-size: 12px;
		font-weight: normal;
		color: rgba(255, 255, 255, 0.9);
  }
  
  .plan-features {
		margin-bottom: 20px;
		line-height: 2;
		font-size: 12px;
		color: #999;
		text-align: center;
  }
.plan-tall {
		margin: 0;
		background-color: white;
		border-width: 2px;
		border-radius: 7px;
}
  
.plan-tall > .plan-title {
		font-size: 18px;
}
  
.plan-tall > .plan-price {
		width: 100px;
		height: 100px;
		line-height: 100px;
		font-size: 21px;
		border-radius: 50px;
}
  
.plan-tall > .plan-features {
	font-size: 13px;
}
  
.plan-tall > .plan-button {
		padding: 0 16px;
		line-height: 32px;
}
  
.plan-tall + .plan {
		border-left: 0;
}
  
.plan-features > li > strong {
		font-weight: bold;
		color: #888;
		padding-right: 1em;
}
ul.plan-features {
		list-style-type: none;
		padding: 0px;
}
	
.AppCardTop {
		max-width: 11em!important;
}

.AppCardImageArea {
  background: white!important;
}
.AppCardImage {
    max-width: 6em!important;
}
.AppListHeader {
	text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
}
.hideCardImage {
  opacity: 0.2
}
.usDollar {
	font-weight: lighter;
	font-style: italic;
	padding-left: 0.5em;
	font-size: smaller;
}
.amount {
	font-size: large;
	font-weight: bold;
	color: darkslategray;
}
.unavailable {
	background-color: rgba(0,0,0,.03)!important;
	opacity: 0.4
 }

@media only screen and ( max-width: 1144px ) {
	.TimelinesView {
	 background-color: white;
	 padding: 0em;
	 padding-top: 4em;
	}
	#QTGateStartScreen {
	 display: block;
   }
	#QTGateStartScreen-Device {
	  display: none;
	}
	#TimelinesView {
	 max-width:100%;
	 margin: 0px auto;
	}
	.itemContent {
	 max-width: 90%;
	}
 }
 @media only screen and (min-width: 992px) {
   
 }
 
 @media screen and ( max-width: 801px ) {
   .TimelinesView {
	background-color: white;
	padding: 0em;
	padding-top: 4em;
   }
   #QTGateStartScreen-Device {
	 display: block;
   }
   #QTGateStartScreen {
	 display: none;
   }
   #TimelinesView {
	max-width:100%;
	margin: 0px auto;
   }
   .itemContent {
	max-width: 90%;
   }
 }
 
 @media screen and ( min-width: 800px ) {
   #QTGateStartScreen {
	 display: block;
   }
   #QTGateStartScreen-Device {
	 display: none;
   }
   .TimelinesView {
	 background-color: #e6ecf0;
	 padding: 4em;
   }
   #TimelinesView {
	 max-width:590px;
	 margin: 0px auto;
   }
   .itemContent {
	 max-width:530px;
   }
 }




 .flapLeft, .flapeRight {
   position: relative;
   cursor: pointer;
 }
 
 .flapLeft i:hover, .flapeRight i:hover {
   background: rgba(255,255,255,0.4);
 }
 .flapLeft i, .flapeRight i {
   color:grey;
   position: absolute;
   margin-top: -1em;
 }
 .tweetTrashButton {
	cursor: pointer;
	 color: grey;
 }
 .tweetTrashButton:hover {
   color: red;
 }
 .tweetPhotoButton{
	 background: transparent!important;
	 color: rgba(0, 0, 0, 0.2);
	 cursor: pointer;
	 right: 0.5em;
	 margin-top: 2.5em;
 }
 .tweetPhotoButton:hover {
   color: rgba(0, 0, 0, 0.6);
 
 }
 .newTweetCloseButton{
   color: rgba(0, 0, 0, 0.2)!important;
   cursor: pointer;
   position: absolute;
   top: 0.3em;
   right: 0.3em;
 }
 .newTweetCloseButton:hover {
 color: rgba(0, 0, 0, 0.6)!important;
 
 }
 .approveButtons {
   position: absolute;
 }
 .ui.modal {
   top: 15em;
   width: 600px;
 }
 #QTGateStartScreen{
   height: 100%;
 }
 #QTGateStartScreen .VideoBox{
   display: block;
   width: 600px;
 }
 #QTGateStartScreen .VideoBox .iframe {
   width: 550px;
   height: 310px;
   overflow: hidden;
   border-radius: 25px;
 }
 #QTGateStartScreen-Drive{
   height: 100%;
 }
 #QTGateStartScreen-Drive .VideoBox{
   display: block;
 
 }
 #QTGateStartScreen-Drive .VideoBox .iframe {
   overflow: hidden;
   border-radius: 25px;
 }
 .AppCardTop {
	max-width: 11em!important;
 }
 .AppCardImageArea {
   background: white!important;
 }
 .AppCardImage {
	 max-width: 6em!important;
 }
 .templateImapAccount {
	color: blue;
 }
 .closeIcon {
	position: absolute;
    top: 1em;
    right: 1em;
 }

 .localIP {
	position: relative;
	left: 19em;
	top: 7.8em;
	color: blue;
  
  }
  
  .localIPPort {
	position: relative;
	left: 3.9em;
	top: 8.8em;
	color: blue;
  
  }
  .localNetwork {
	position: relative;
	left: 3.9em;
	top: 8.8em;
	color: blue;
  }


.WindowsUseInfoLocalServerIp {
	position: relative;
	left: 10.4em;
	top: 12.5em;
	color: blue;
  }
  .WindowsUseInfoPort{
	position: relative;
	left: -1.9em;
	top: 16.5em;
	color: blue;
  }
  .firefoxUseLocalIp{
	position: relative;
	left: 4.5em;
	top: 32.2em;
	color: blue;
  }
  .firefoxUseLocalPort{
	position: relative;
	left: -10.6em;
	top: 33.3em;
	color: blue;
  }
  
  
  .iOSUseInfoLocalServerIp{
	position: relative;
	left: 2em;
	top: 12.6em;
	color: blue;
  }
  .iOSUseInfoPort{
	position: relative;
	left: -13.1em;
	top: 13.7em;
	color: blue;
  }
  .androidUseInfoLocalServerIp{
	position: relative;
	left: 6em;
	top: 7.7em;
	color: blue;
  }
  .androidUseInfoPort{
	position: relative;
	left: -9.1em;
	top: 8.8em;;
	color: blue;
  }
  .videoBackground{
		position: absolute;
  top: 50%; 
  left: 50%;
  -webkit-transform: translateX(-50%) translateY(-50%);
  transform: translateX(-50%) translateY(-50%);
  min-width: 100%; 
  min-height: 100%; 
  width: auto; 
  height: auto;
  z-index: -1000; 
  overflow: hidden;
	}
	.startupView {
		position: fixed; 
		top: 0; 
		width: 100%; 
		height: 100%; 
		z-index: -1;
	}
	.loading {
		z-index: 9999;
	}


	.loaderCoNET {
		overflow: hidden;
		padding: 2em;
		position: relative;
	}
	
	.loaderCoNET-div {
		width: 20px;
		height: 20px;
		position: absolute;
		background-color: #ccc;
		top: 45%;
		border-radius: 50%;
	}
	
	.loaderCoNET-div:nth-child(1) {
		background-color: rgba(255, 84, 95, 0.274);
		-webkit-animation: move 2s infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
						animation: move 2s infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
	}
	
	.loaderCoNET-div:nth-child(2) {
		background-color: rgba(255, 157, 132, 0.315);
		-webkit-animation: move 2s 150ms infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
						animation: move 2s 150ms infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
	}
	
	.loaderCoNET-div:nth-child(3) {
		background-color: rgba(240, 231, 151, 0.356);
		-webkit-animation: move 2s 300ms infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
						animation: move 2s 300ms infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
	}
	
	.loaderCoNET-div:nth-child(4) {
		background-color: rgba(117, 176, 138, 0.377);
		-webkit-animation: move 2s 450ms infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
						animation: move 2s 450ms infinite cubic-bezier(0.2, 0.64, 0.81, 0.23);
	}
	
	@-webkit-keyframes move {
		0% {
			left: 0%;
		}
		100% {
			left: 90%;
		}
	}
	
	@keyframes move {
		0% {
			left: 0%;
		}
		100% {
			left: 90%;
		}
	}

	play-btn {
		width: 5em;
		height: 5em;
		background: radial-gradient( rgba(140, 0, 255, 0.87) 60%, rgba(140, 0, 255, 0.87) 62%);
		border-radius: 50%;
		position: relative;
		display: block;
		margin: 100px auto;
		box-shadow: 0px 0px 25px 3px rgba(140, 0, 255, 0.87);
	}
	
	/* triangle */
	.play-btn::after {
		content: "";
		position: absolute;
		left: 50%;
		top: 50%;
		-webkit-transform: translateX(-40%) translateY(-50%);
		transform: translateX(-40%) translateY(-50%);
		transform-origin: center center;
		width: 0;
		height: 0;
		border-top: 15px solid transparent;
		border-bottom: 15px solid transparent;
		border-left: 25px solid rgba(227, 196, 252, 0.616);
		z-index: 100;
		-webkit-transition: all 400ms cubic-bezier(0.55, 0.055, 0.675, 0.19);
		transition: all 400ms cubic-bezier(0.55, 0.055, 0.675, 0.19);
	}
	
	/* pulse wave */
	.play-btn:before {
		content: "";
		position: absolute;
		width: 150%;
		height: 150%;
		-webkit-animation-delay: 0s;
		animation-delay: 0s;
		-webkit-animation: pulsate1 2s;
		animation: pulsate1 2s;
		-webkit-animation-direction: forwards;
		animation-direction: forwards;
		-webkit-animation-iteration-count: infinite;
		animation-iteration-count: infinite;
		-webkit-animation-timing-function: steps;
		animation-timing-function: steps;
		opacity: 1;
		border-radius: 50%;
		border: 5px solid rgba(216, 119, 211, 0.75);
		top: -30%;
		left: -30%;
		background: rgba(216, 119, 211, 0.75);
	}
	
	@-webkit-keyframes pulsate1 {
		0% {
			-webkit-transform: scale(0.6);
			transform: scale(0.6);
			opacity: 1;
			box-shadow: inset 0px 0px 25px 3px rgba(140, 0, 255, 0.87), 0px 0px 25px 10px rgba(140, 0, 255, 0.87);
		}
		100% {
			-webkit-transform: scale(1);
			transform: scale(1);
			opacity: 0;
			box-shadow: none;
	
		}
	}
	
	@keyframes pulsate1 {
		0% {
			-webkit-transform: scale(0.6);
			transform: scale(0.6);
			opacity: 1;
			box-shadow: inset 0px 0px 25px 3px rgba(140, 0, 255, 0.87), 0px 0px 25px 10px rgba(140, 0, 255, 0.87);
		}
		100% {
			-webkit-transform: scale(1, 1);
			transform: scale(1);
			opacity: 0;
			box-shadow: none;
	
		}
	}
.coSearchBackGroumd {
	background: #B4E4ED!important;
}

@keyframes BlurAnimation {
	to { filter: blur(3px);}
	
}

@keyframes coSearchInputAnimation {
	to { background: white ;}
	to { box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);}
}

.animationSearchInput {
	-webkit-animation-name: coSearchInputAnimation;
	-webkit-animation-duration: 0.5s;
	animation-name: coSearchInputAnimation;
	animation-duration: 0.5s;
	animation-timing-function: ease-in;
	animation-fill-mode: forwards;
}	

.animationBlur {
	-webkit-animation-name: BlurAnimation;
	-webkit-animation-duration: 0.5s;
	animation-name: BlurAnimation;
	animation-duration: 0.5s;
	animation-timing-function: ease-in;
	animation-fill-mode: forwards;
}



.backgroundTransparent {
  background: rgba(255,255,255,0.01)!important;
}


#coSearchForm {
	position: absolute;
	margin-top: -30%;
	width: 100%;
	padding: 2em;
}
#coSearchForm input::-webkit-input-placeholder {
		color: rgba(0,0,0,0.3)
}
#coSearchForm input:-moz-placeholder {
	color: rgba(0,0,0,0.3)
}
#coSearchForm input::-moz-placeholder  {
	color: rgba(0,0,0,0.3)
}
#coSearchForm input:-ms-input-placeholder {
	color: rgba(0,0,0,0.3)
}
#itemList{
	position: absolute;
	margin-top: -25%;
	width: 90%;
	padding: 2em;
}

#coTranslateForm {
	position: absolute;
	margin-top: -10%;
	width: 90%;
	padding: 2em;
}
.space {
	margin: 1em;
}

.ui.input.error>input {
	background-color: #fff6f6!important;
	border-color: #e0b4b4!important;
	color: #9f3a38!important;

}
.ui.input.error>input::-webkit-input-placeholder
{
	color:#e7bdbc!important;
}
.ui.input.error>input:focus::-moz-placeholder
{
	color:#da9796!important;
}
.ui.input.error>input:-ms-input-placeholder
{
	color:#e7bdbc!important
}


.loadingGetResponse::after {
	border-color: #ab9420d9 transparent transparent!important;
}

.loadingGetResponse {
	color: #ab9420d9!important;
}
.conetResponse {
	color: #36c576d9!important;
}

.conetResponse::after {
	border-color: #36c576d9 transparent transparent!important;
}

.buttonUnActive {
	background: #e0e1e288 none!important;
}

@keyframes svg_Background {
	to { filter: blur(3px);}
	to { background: black ;}
}

.svgBackground_Animation {
	-webkit-animation-name: svg_Background;
	-webkit-animation-duration: 0.5s;
	animation-name: svg_Background;
	animation-duration: 0.5s;
	animation-timing-function: ease-in;
	animation-fill-mode: forwards;
}
.terminalText { 
	position: relative;
	display: inline-block;
	min-width: 360px;
  }
  
  .terminalText::after {
	content: "";
	position: absolute;
	/* Remove display: inline-block if not required to be on the same line as text etc */
	display: inline-block;
	background-color:grey;
	top: 14px;
	margin-left: 2px;
	width: 10px;
	/* Set height to the line height of .text */
	height: 2px;
	/* 
	Animation paramaters:
	blink = animation-name, 
	1s = animation-duration, 
	step-end = animation-timing-function,
	infinite = animation-iteration-count
	*/
	-webkit-animation: blink 1s step-end infinite;
	animation: blink 1s step-end infinite;
  }
  
  @-webkit-keyframes blink {
	0% { opacity: 1.0; }
	50% { opacity: 0.0; }
	100% { opacity: 1.0; }
  }
  
  @keyframes blink {
	0% { opacity: 1.0; }
	50% { opacity: 0.0; }
	100% { opacity: 1.0; }
  }

================================================
FILE: app/public/scripts/CanadaSvg.js
================================================
/* Day */
var dayGroup = document.getElementById("DayGroup");
/* Canoe */
var canoe = document.getElementsByClassName("canoe");
var canoeReflection = document.getElementsByClassName("canoeReflection");
/* Island */
var treesPink = document.getElementsByClassName("treesPink");
var treesOrange = document.getElementsByClassName("treesOrange");
var CoralTriangle1 = document.getElementsByClassName("CoralTriangle1");
var CoralTriangle2 = document.getElementsByClassName("CoralTriangle2");
var CoralTriangle3 = document.getElementsByClassName("CoralTriangle3");
/*Sea */
var waveRight = document.getElementsByClassName("waveRight");
var waveLeft = document.getElementsByClassName("waveLeft");
/* Sky */
var blueCloudLeft = document.getElementsByClassName("blueCloudLeft");
var blueCloudRight = document.getElementsByClassName("blueCloudRight");
var pinkCloud = document.getElementsByClassName("pinkCloud");
var sunRayLeft = document.getElementsByClassName("sunRayLeft");
var sunRayRight = document.getElementsByClassName("sunRayRight");
/*Rflection*/
var treesPinkR = document.getElementsByClassName("treesPinkR");
var treesOrangeR = document.getElementsByClassName("treesOrangeR");
var RCoralTriangle1 = document.getElementsByClassName("RCoralTriangle1");
var RCoralTriangle2 = document.getElementsByClassName("RCoralTriangle2");
var RCoralTriangle3 = document.getElementsByClassName("RCoralTriangle3");
/* --------------------------- */
/* Animation */
//canoe
var tlCanoe = new TimelineMax({
repeat:-1,
yoyo:true,
ease: "easeInOut"
});
tlCanoe.fromTo(canoe, 1.5, {
y:0
}, {
y:4
})
tlCanoe.fromTo(canoeReflection, 1.5, {
y:0
}, {
y:-4
}, "-=1.5")
//Sea
var tlwaveLeft = new TimelineMax({
repeat:-1,
yoyo:true,
ease: "easeInOut"
});
tlwaveLeft.fromTo(waveLeft, 5, {
x:0
}, {
x:35
})
tlwaveLeft.fromTo(waveRight, 5, {
x:0
}, {
x:-35
}, "-=5")
//tree
var tlswingingTree = new TimelineMax({
repeat:-1,
yoyo:true,
ease: "easeInOut"
});
tlswingingTree.staggerFromTo(treesPink, 2, {
transformOrigin:"50% 0%",
rotation:"5deg",
}, {
rotation:"-5deg",
}, .2);
var ReflectswingingTree = new TimelineMax({
repeat:-1,
yoyo:true,
});
ReflectswingingTree.staggerFromTo(treesPinkR, 2, {
transformOrigin:"50% 0%",
rotation:"-5deg",
}, {
rotation:"5deg",
}, .2);
var tlOrangeTrees = new TimelineMax({
repeat:-1,
yoyo:true,
ease: "easeInOut"
});
tlOrangeTrees.fromTo(treesOrange, 2, {
transformOrigin:"50% 100%",
rotation:"1deg",
}, {
rotation:"-1deg",
}, .2);
var ReflectOrangeTrees = new TimelineMax({
repeat:-1,
yoyo:true});
ReflectOrangeTrees.fromTo(treesOrangeR, 2, {
transformOrigin:"50% 0%",
rotation:"-1deg",
}, {
rotation:"1deg",
}, .2);
var tlCoralTrees = new TimelineMax({repeat:-1});
tlCoralTrees.set([CoralTriangle1, CoralTriangle3], {
transformOrigin: "50% 20%",
rotation: "0deg",
repeatDelay:2
})
tlCoralTrees.to([CoralTriangle1, CoralTriangle3], 1, {
rotation: "6deg",
ease: "easeInOut"
})
tlCoralTrees.to([CoralTriangle1, CoralTriangle3], 1, {
rotation: "-6deg",
ease: "easeInOut"
})
tlCoralTrees.to([CoralTriangle1, CoralTriangle3], .5, {
rotation: "3deg",
ease: "easeInOut"
})
tlCoralTrees.to([CoralTriangle1, CoralTriangle3], .5, {
rotation: "-3deg",
ease: "easeInOut"
})
tlCoralTrees.to([CoralTriangle1, CoralTriangle3], .4, {
rotation: "2.5deg",
ease: "easeInOut"
})
tlCoralTrees.to([CoralTriangle1, CoralTriangle3], .4, {
rotation: "-2.5deg",
ease: "easeInOut"
})
tlCoralTrees.to([CoralTriangle1, CoralTriangle3], .4, {
rotation: "0deg",
ease: "easeInOut"
})
var tlCoralTree2 = new TimelineMax({repeat:-1});
tlCoralTree2.set(CoralTriangle2, {
transformOrigin: "50% 20%",
rotation: "0deg",
delay:.5,
repeatDelay:2.2
})
tlCoralTree2.to(CoralTriangle2, .85, {
rotation: "6deg",
ease: "easeInOut"
})
tlCoralTree2.to(CoralTriangle2, .85, {
rotation: "-6deg",
ease: "easeInOut"
})
tlCoralTree2.to(CoralTriangle2, .5, {
rotation: "3deg",
ease: "easeInOut"
})
tlCoralTree2.to(CoralTriangle2, .5, {
rotation: "-3deg",
ease: "easeInOut"
})
tlCoralTree2.to(CoralTriangle2, .4, {
rotation: "2.5deg",
ease: "easeInOut"
})
tlCoralTree2.to(CoralTriangle2, .4, {
rotation: "-2.5deg",
ease: "easeInOut"
})
tlCoralTree2.to(CoralTriangle2, .4, {
rotation: "0deg",
ease: "easeInOut"
})
//Coral Tirangles Reflection
var ReflectCoralTrees = new TimelineMax({repeat:-1});
ReflectCoralTrees.set([RCoralTriangle1, RCoralTriangle3], {
transformOrigin: "50% 80%",
rotation: "0deg",
repeatDelay:2
})
ReflectCoralTrees.to([RCoralTriangle1, RCoralTriangle3], 1, {
rotation: "-6deg",
ease: "easeInOut"
})
ReflectCoralTrees.to([RCoralTriangle1, RCoralTriangle3], 1, {
rotation: "6deg",
ease: "easeInOut"
})
ReflectCoralTrees.to([RCoralTriangle1, RCoralTriangle3], .5, {
rotation: "-3deg",
ease: "easeInOut"
})
ReflectCoralTrees.to([RCoralTriangle1, RCoralTriangle3], .5, {
rotation: "3deg",
ease: "easeInOut"
})
ReflectCoralTrees.to([RCoralTriangle1, RCoralTriangle3], .4, {
rotation: "-2.5deg",
ease: "easeInOut"
})
ReflectCoralTrees.to([RCoralTriangle1, RCoralTriangle3], .4, {
rotation: "2.5deg",
ease: "easeInOut"
})
ReflectCoralTrees.to([RCoralTriangle1, RCoralTriangle3], .4, {
rotation: "0deg",
ease: "easeInOut"
})
var ReflectCoralTree2 = new TimelineMax({repeat:-1});
ReflectCoralTree2.set(CoralTriangle2, {
transformOrigin: "50% 80%",
rotation: "0deg",
delay:.5,
repeatDelay:2.2
})
ReflectCoralTree2.to(RCoralTriangle2, .85, {
rotation: "-6deg",
ease: "easeInOut"
})
ReflectCoralTree2.to(RCoralTriangle2, .85, {
rotation: "6deg",
ease: "easeInOut"
})
ReflectCoralTree2.to(RCoralTriangle2, .5, {
rotation: "-3deg",
ease: "easeInOut"
})
ReflectCoralTree2.to(RCoralTriangle2, .5, {
rotation: "3deg",
ease: "easeInOut"
})
ReflectCoralTree2.to(RCoralTriangle2, .4, {
rotation: "-2.5deg",
ease: "easeInOut"
})
ReflectCoralTree2.to(RCoralTriangle2, .4, {
rotation: "2.5deg",
ease: "easeInOut"
})
ReflectCoralTree2.to(RCoralTriangle2, .4, {
rotation: "0deg",
ease: "easeInOut"
})
//sky
var tlblueCloud = new TimelineMax({
repeat:-1,
yoyo:true,
});
tlblueCloud.fromTo(blueCloudLeft, 5.5, {
x:0
}, {
x:55,
ease: "linear"
})
tlblueCloud.fromTo(blueCloudRight, 5.5, {
x:0
}, {
x:-55,
ease: "linear"
}, "-=5")
var tlpinkCloud = new TimelineMax({
repeat:-1,
yoyo:true,
ease: "easeInOut"
});
tlpinkCloud.staggerFromTo(pinkCloud, 20, {
x:0
}, {
x:300
}, 1.5)
var tlsunRays = new TimelineMax({
repeat:-1,
yoyo:true,
});
tlsunRays.fromTo(sunRayLeft, 4.5, {
x:0
}, {
x:25,
ease:"linear"
})
tlsunRays.fromTo(sunRayRight, 4.5, {
x:0
}, {
x:-25,
ease:"linear"
}, "-=5");

================================================
FILE: app/public/scripts/Cleave.js
================================================
/*!
 * cleave.js - 1.3.8
 * https://github.com/nosir/cleave.js
 * Apache License Version 2.0
 *
 * Copyright (C) 2012-2018 Max Huang https://github.com/nosir/
 */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.Cleave=t():e.Cleave=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return e[n].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){(function(t){"use strict";var n=function(e,t){var r=this;if("string"==typeof e?r.element=document.querySelector(e):r.element="undefined"!=typeof e.length&&e.length>0?e[0]:e,!r.element)throw new Error("[cleave.js] Please check the element");t.initValue=r.element.value,r.properties=n.DefaultProperties.assign({},t),r.init()};n.prototype={init:function(){var e=this,t=e.properties;return t.numeral||t.phone||t.creditCard||t.date||0!==t.blocksLength||t.prefix?(t.maxLength=n.Util.getMaxLength(t.blocks),e.isAndroid=n.Util.isAndroid(),e.lastInputValue="",e.onChangeListener=e.onChange.bind(e),e.onKeyDownListener=e.onKeyDown.bind(e),e.onFocusListener=e.onFocus.bind(e),e.onCutListener=e.onCut.bind(e),e.onCopyListener=e.onCopy.bind(e),e.element.addEventListener("input",e.onChangeListener),e.element.addEventListener("keydown",e.onKeyDownListener),e.element.addEventListener("focus",e.onFocusListener),e.element.addEventListener("cut",e.onCutListener),e.element.addEventListener("copy",e.onCopyListener),e.initPhoneFormatter(),e.initDateFormatter(),e.initNumeralFormatter(),void((t.initValue||t.prefix&&!t.noImmediatePrefix)&&e.onInput(t.initValue))):void e.onInput(t.initValue)},initNumeralFormatter:function(){var e=this,t=e.properties;t.numeral&&(t.numeralFormatter=new n.NumeralFormatter(t.numeralDecimalMark,t.numeralIntegerScale,t.numeralDecimalScale,t.numeralThousandsGroupStyle,t.numeralPositiveOnly,t.stripLeadingZeroes,t.delimiter))},initDateFormatter:function(){var e=this,t=e.properties;t.date&&(t.dateFormatter=new n.DateFormatter(t.datePattern),t.blocks=t.dateFormatter.getBlocks(),t.blocksLength=t.blocks.length,t.maxLength=n.Util.getMaxLength(t.blocks))},initPhoneFormatter:function(){var e=this,t=e.properties;if(t.phone)try{t.phoneFormatter=new n.PhoneFormatter(new t.root.Cleave.AsYouTypeFormatter(t.phoneRegionCode),t.delimiter)}catch(r){throw new Error("[cleave.js] Please include phone-type-formatter.{country}.js lib")}},onKeyDown:function(e){var t=this,r=t.properties,i=e.which||e.keyCode,a=n.Util,o=t.element.value;return a.isAndroidBackspaceKeydown(t.lastInputValue,o)&&(i=8),t.lastInputValue=o,8===i&&a.isDelimiter(o.slice(-r.delimiterLength),r.delimiter,r.delimiters)?void(r.backspace=!0):void(r.backspace=!1)},onChange:function(){this.onInput(this.element.value)},onFocus:function(){var e=this,t=e.properties;n.Util.fixPrefixCursor(e.element,t.prefix,t.delimiter,t.delimiters)},onCut:function(e){this.copyClipboardData(e),this.onInput("")},onCopy:function(e){this.copyClipboardData(e)},copyClipboardData:function(e){var t=this,r=t.properties,i=n.Util,a=t.element.value,o="";o=r.copyDelimiter?a:i.stripDelimiters(a,r.delimiter,r.delimiters);try{e.clipboardData?e.clipboardData.setData("Text",o):window.clipboardData.setData("Text",o),e.preventDefault()}catch(l){}},onInput:function(e){var t=this,r=t.properties,i=n.Util;return r.numeral||!r.backspace||i.isDelimiter(e.slice(-r.delimiterLength),r.delimiter,r.delimiters)||(e=i.headStr(e,e.length-r.delimiterLength)),r.phone?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.phoneFormatter.format(e):r.result=r.prefix+r.phoneFormatter.format(e).slice(r.prefix.length),void t.updateValueState()):r.numeral?(!r.prefix||r.noImmediatePrefix&&!e.length?r.result=r.numeralFormatter.format(e):r.result=r.prefix+r.numeralFormatter.format(e),void t.updateValueState()):(r.date&&(e=r.dateFormatter.getValidatedDate(e)),e=i.stripDelimiters(e,r.delimiter,r.delimiters),e=i.getPrefixStrippedValue(e,r.prefix,r.prefixLength,r.result),e=r.numericOnly?i.strip(e,/[^\d]/g):e,e=r.uppercase?e.toUpperCase():e,e=r.lowercase?e.toLowerCase():e,!r.prefix||r.noImmediatePrefix&&!e.length||(e=r.prefix+e,0!==r.blocksLength)?(r.creditCard&&t.updateCreditCardPropsByValue(e),e=i.headStr(e,r.maxLength),r.result=i.getFormattedValue(e,r.blocks,r.blocksLength,r.delimiter,r.delimiters,r.delimiterLazyShow),void t.updateValueState()):(r.result=e,void t.updateValueState()))},updateCreditCardPropsByValue:function(e){var t,r=this,i=r.properties,a=n.Util;a.headStr(i.result,4)!==a.headStr(e,4)&&(t=n.CreditCardDetector.getInfo(e,i.creditCardStrictMode),i.blocks=t.blocks,i.blocksLength=i.blocks.length,i.maxLength=a.getMaxLength(i.blocks),i.creditCardType!==t.type&&(i.creditCardType=t.type,i.onCreditCardTypeChanged.call(r,i.creditCardType)))},updateValueState:function(){var e=this,t=n.Util,r=e.properties;if(e.element){var i=e.element.selectionEnd,a=e.element.value,o=r.result;if(i=t.getNextCursorPosition(i,a,o,r.delimiter,r.delimiters),e.isAndroid)return void window.setTimeout(function(){e.element.value=o,t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged()},1);e.element.value=o,t.setSelection(e.element,i,r.document,!1),e.callOnValueChanged()}},callOnValueChanged:function(){var e=this,t=e.properties;t.onValueChanged.call(e,{target:{value:t.result,rawValue:e.getRawValue()}})},setPhoneRegionCode:function(e){var t=this,r=t.properties;r.phoneRegionCode=e,t.initPhoneFormatter(),t.onChange()},setRawValue:function(e){var t=this,r=t.properties;e=void 0!==e&&null!==e?e.toString():"",r.numeral&&(e=e.replace(".",r.numeralDecimalMark)),r.backspace=!1,t.element.value=e,t.onInput(e)},getRawValue:function(){var e=this,t=e.properties,r=n.Util,i=e.element.value;return t.rawValueTrimPrefix&&(i=r.getPrefixStrippedValue(i,t.prefix,t.prefixLength,t.result)),i=t.numeral?t.numeralFormatter.getRawValue(i):r.stripDelimiters(i,t.delimiter,t.delimiters)},getISOFormatDate:function(){var e=this,t=e.properties;return t.date?t.dateFormatter.getISOFormatDate():""},getFormattedValue:function(){return this.element.value},destroy:function(){var e=this;e.element.removeEventListener("input",e.onChangeListener),e.element.removeEventListener("keydown",e.onKeyDownListener),e.element.removeEventListener("focus",e.onFocusListener),e.element.removeEventListener("cut",e.onCutListener),e.element.removeEventListener("copy",e.onCopyListener)},toString:function(){return"[Cleave Object]"}},n.NumeralFormatter=r(1),n.DateFormatter=r(2),n.PhoneFormatter=r(3),n.CreditCardDetector=r(4),n.Util=r(5),n.DefaultProperties=r(6),("object"==typeof t&&t?t:window).Cleave=n,e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";var r=function(e,t,n,i,a,o,l){var s=this;s.numeralDecimalMark=e||".",s.numeralIntegerScale=t>0?t:0,s.numeralDecimalScale=n>=0?n:2,s.numeralThousandsGroupStyle=i||r.groupStyle.thousand,s.numeralPositiveOnly=!!a,s.stripLeadingZeroes=o!==!1,s.delimiter=l||""===l?l:",",s.delimiterRE=l?new RegExp("\\"+l,"g"):""};r.groupStyle={thousand:"thousand",lakh:"lakh",wan:"wan",none:"none"},r.prototype={getRawValue:function(e){return e.replace(this.delimiterRE,"").replace(this.numeralDecimalMark,".")},format:function(e){var t,n,i=this,a="";switch(e=e.replace(/[A-Za-z]/g,"").replace(i.numeralDecimalMark,"M").replace(/[^\dM-]/g,"").replace(/^\-/,"N").replace(/\-/g,"").replace("N",i.numeralPositiveOnly?"":"-").replace("M",i.numeralDecimalMark),i.stripLeadingZeroes&&(e=e.replace(/^(-)?0+(?=\d)/,"$1")),n=e,e.indexOf(i.numeralDecimalMark)>=0&&(t=e.split(i.numeralDecimalMark),n=t[0],a=i.numeralDecimalMark+t[1].slice(0,i.numeralDecimalScale)),i.numeralIntegerScale>0&&(n=n.slice(0,i.numeralIntegerScale+("-"===e.slice(0,1)?1:0))),i.numeralThousandsGroupStyle){case r.groupStyle.lakh:n=n.replace(/(\d)(?=(\d\d)+\d$)/g,"$1"+i.delimiter);break;case r.groupStyle.wan:n=n.replace(/(\d)(?=(\d{4})+$)/g,"$1"+i.delimiter);break;case r.groupStyle.thousand:n=n.replace(/(\d)(?=(\d{3})+$)/g,"$1"+i.delimiter)}return n.toString()+(i.numeralDecimalScale>0?a.toString():"")}},e.exports=r},function(e,t){"use strict";var r=function(e){var t=this;t.date=[],t.blocks=[],t.datePattern=e,t.initBlocks()};r.prototype={initBlocks:function(){var e=this;e.datePattern.forEach(function(t){"Y"===t?e.blocks.push(4):e.blocks.push(2)})},getISOFormatDate:function(){var e=this,t=e.date;return t[2]?t[2]+"-"+e.addLeadingZero(t[1])+"-"+e.addLeadingZero(t[0]):""},getBlocks:function(){return this.blocks},getValidatedDate:function(e){var t=this,r="";return e=e.replace(/[^\d]/g,""),t.blocks.forEach(function(n,i){if(e.length>0){var a=e.slice(0,n),o=a.slice(0,1),l=e.slice(n);switch(t.datePattern[i]){case"d":"00"===a?a="01":parseInt(o,10)>3?a="0"+o:parseInt(a,10)>31&&(a="31");break;case"m":"00"===a?a="01":parseInt(o,10)>1?a="0"+o:parseInt(a,10)>12&&(a="12")}r+=a,e=l}}),this.getFixedDateString(r)},getFixedDateString:function(e){var t,r,n,i=this,a=i.datePattern,o=[],l=0,s=0,u=0,c=0,d=0,m=0,p=!1;return 4===e.length&&"y"!==a[0].toLowerCase()&&"y"!==a[1].toLowerCase()&&(c="d"===a[0]?0:2,d=2-c,t=parseInt(e.slice(c,c+2),10),r=parseInt(e.slice(d,d+2),10),o=this.getFixedDate(t,r,0)),8===e.length&&(a.forEach(function(e,t){switch(e){case"d":l=t;break;case"m":s=t;break;default:u=t}}),m=2*u,c=l<=u?2*l:2*l+2,d=s<=u?2*s:2*s+2,t=parseInt(e.slice(c,c+2),10),r=parseInt(e.slice(d,d+2),10),n=parseInt(e.slice(m,m+4),10),p=4===e.slice(m,m+4).length,o=this.getFixedDate(t,r,n)),i.date=o,0===o.length?e:a.reduce(function(e,t){switch(t){case"d":return e+i.addLeadingZero(o[0]);case"m":return e+i.addLeadingZero(o[1]);default:return e+(p?i.addLeadingZeroForYear(o[2]):"")}},"")},getFixedDate:function(e,t,r){return e=Math.min(e,31),t=Math.min(t,12),r=parseInt(r||0,10),(t<7&&t%2===0||t>8&&t%2===1)&&(e=Math.min(e,2===t?this.isLeapYear(r)?29:28:30)),[e,t,r]},isLeapYear:function(e){return e%4===0&&e%100!==0||e%400===0},addLeadingZero:function(e){return(e<10?"0":"")+e},addLeadingZeroForYear:function(e){return(e<10?"000":e<100?"00":e<1e3?"0":"")+e}},e.exports=r},function(e,t){"use strict";var r=function(e,t){var r=this;r.delimiter=t||""===t?t:" ",r.delimiterRE=t?new RegExp("\\"+t,"g"):"",r.formatter=e};r.prototype={setFormatter:function(e){this.formatter=e},format:function(e){var t=this;t.formatter.clear(),e=e.replace(/[^\d+]/g,""),e=e.replace(t.delimiterRE,"");for(var r,n="",i=!1,a=0,o=e.length;a<o;a++)r=t.formatter.inputDigit(e.charAt(a)),/[\s()-]/g.test(r)?(n=r,i=!0):i||(n=r);return n=n.replace(/[()]/g,""),n=n.replace(/[\s-]/g,t.delimiter)}},e.exports=r},function(e,t){"use strict";var r={blocks:{uatp:[4,5,6],amex:[4,6,5],diners:[4,6,4],discover:[4,4,4,4],mastercard:[4,4,4,4],dankort:[4,4,4,4],instapayment:[4,4,4,4],jcb15:[4,6,5],jcb:[4,4,4,4],maestro:[4,4,4,4],visa:[4,4,4,4],mir:[4,4,4,4],unionPay:[4,4,4,4],general:[4,4,4,4],generalStrict:[4,4,4,7]},re:{uatp:/^(?!1800)1\d{0,14}/,amex:/^3[47]\d{0,13}/,discover:/^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/,diners:/^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/,mastercard:/^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/,dankort:/^(5019|4175|4571)\d{0,12}/,instapayment:/^63[7-9]\d{0,13}/,jcb15:/^(?:2131|1800)\d{0,11}/,jcb:/^(?:35\d{0,2})\d{0,12}/,maestro:/^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/,mir:/^220[0-4]\d{0,12}/,visa:/^4\d{0,15}/,unionPay:/^62\d{0,14}/},getInfo:function(e,t){var n=r.blocks,i=r.re;t=!!t;for(var a in i)if(i[a].test(e)){var o;return o=t?n.generalStrict:n[a],{type:a,blocks:o}}return{type:"unknown",blocks:t?n.generalStrict:n.general}}};e.exports=r},function(e,t){"use strict";var r={noop:function(){},strip:function(e,t){return e.replace(t,"")},isDelimiter:function(e,t,r){return 0===r.length?e===t:r.some(function(t){if(e===t)return!0})},getDelimiterREByDelimiter:function(e){return new RegExp(e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g")},getNextCursorPosition:function(e,t,r,n,i){return t.length===e?r.length:e+this.getPositionOffset(e,t,r,n,i)},getPositionOffset:function(e,t,r,n,i){var a,o,l;return a=this.stripDelimiters(t.slice(0,e),n,i),o=this.stripDelimiters(r.slice(0,e),n,i),l=a.length-o.length,0!==l?l/Math.abs(l):0},stripDelimiters:function(e,t,r){var n=this;if(0===r.length){var i=t?n.getDelimiterREByDelimiter(t):"";return e.replace(i,"")}return r.forEach(function(t){e=e.replace(n.getDelimiterREByDelimiter(t),"")}),e},headStr:function(e,t){return e.slice(0,t)},getMaxLength:function(e){return e.reduce(function(e,t){return e+t},0)},getPrefixStrippedValue:function(e,t,r,n){if(e.slice(0,r)!==t)if(e.length<n.length)e=e.length>r?n:t;else{var i=this.getFirstDiffIndex(t,e.slice(0,r));e=t+e.slice(i,i+1)+e.slice(r+1)}return e.slice(r)},getFirstDiffIndex:function(e,t){for(var r=0;e.charAt(r)===t.charAt(r);)if(""===e.charAt(r++))return-1;return r},getFormattedValue:function(e,t,r,n,i,a){var o,l="",s=i.length>0;return 0===r?e:(t.forEach(function(t,u){if(e.length>0){var c=e.slice(0,t),d=e.slice(t);o=s?i[a?u-1:u]||o:n,a?(u>0&&(l+=o),l+=c):(l+=c,c.length===t&&u<r-1&&(l+=o)),e=d}}),l)},fixPrefixCursor:function(e,t,r,n){if(e){var i=e.value,a=r||n[0]||" ";if(e.setSelectionRange&&t&&!(t.length+a.length<i.length)){var o=2*i.length;setTimeout(function(){e.setSelectionRange(o,o)},1)}}},setSelection:function(e,t,r){if(e===r.activeElement&&!(e&&e.value.length<=t))if(e.createTextRange){var n=e.createTextRange();n.move("character",t),n.select()}else try{e.setSelectionRange(t,t)}catch(i){console.warn("The input element type does not support selection")}},isAndroid:function(){return navigator&&/android/i.test(navigator.userAgent)},isAndroidBackspaceKeydown:function(e,t){return!!(this.isAndroid()&&e&&t)&&t===e.slice(0,-1)}};e.exports=r},function(e,t){(function(t){"use strict";var r={assign:function(e,r){return e=e||{},r=r||{},e.creditCard=!!r.creditCard,e.creditCardStrictMode=!!r.creditCardStrictMode,e.creditCardType="",e.onCreditCardTypeChanged=r.onCreditCardTypeChanged||function(){},e.phone=!!r.phone,e.phoneRegionCode=r.phoneRegionCode||"AU",e.phoneFormatter={},e.date=!!r.date,e.datePattern=r.datePattern||["d","m","Y"],e.dateFormatter={},e.numeral=!!r.numeral,e.numeralIntegerScale=r.numeralIntegerScale>0?r.numeralIntegerScale:0,e.numeralDecimalScale=r.numeralDecimalScale>=0?r.numeralDecimalScale:2,e.numeralDecimalMark=r.numeralDecimalMark||".",e.numeralThousandsGroupStyle=r.numeralThousandsGroupStyle||"thousand",e.numeralPositiveOnly=!!r.numeralPositiveOnly,e.stripLeadingZeroes=r.stripLeadingZeroes!==!1,e.numericOnly=e.creditCard||e.date||!!r.numericOnly,e.uppercase=!!r.uppercase,e.lowercase=!!r.lowercase,e.prefix=e.creditCard||e.date?"":r.prefix||"",e.noImmediatePrefix=!!r.noImmediatePrefix,e.prefixLength=e.prefix.length,e.rawValueTrimPrefix=!!r.rawValueTrimPrefix,e.copyDelimiter=!!r.copyDelimiter,e.initValue=void 0!==r.initValue&&null!==r.initValue?r.initValue.toString():"",e.delimiter=r.delimiter||""===r.delimiter?r.delimiter:r.date?"/":r.numeral?",":(r.phone," "),e.delimiterLength=e.delimiter.length,e.delimiterLazyShow=!!r.delimiterLazyShow,e.delimiters=r.delimiters||[],e.blocks=r.blocks||[],e.blocksLength=e.blocks.length,e.root="object"==typeof t&&t?t:window,e.document=r.document||e.root.document,e.maxLength=0,e.backspace=!1,e.result="",e.onValueChanged=r.onValueChanged||function(){},e}};e.exports=r}).call(t,function(){return this}())}])});

================================================
FILE: app/public/scripts/CoNETConnect.js
================================================
/*!
 * Copyright 2018 CoNET Technology Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
class CoNETConnect {
    constructor(email, isKeypairBeSign, confirmRisk, account, ready) {
        this.email = email;
        this.isKeypairBeSign = isKeypairBeSign;
        this.account = account;
        this.ready = ready;
        this.showSendImapDataWarning = ko.observable(false);
        this.showConnectCoNETProcess = ko.observable(true);
        this.connectStage = ko.observable(0);
        this.connetcError = ko.observable(-1);
        this.connectedCoNET = ko.observable(false);
        this.maynotConnectConet = ko.observable(false);
        this.Loading = ko.observable(false);
        this.listenFun = null;
        this.showTryAgain = ko.observable(false);
        this.showSendConnectMail = ko.observable(false);
        this.showNetworkError = ko.observable(false);
        this.infoTextArray = ko.observableArray([]);
        this.keyPairSign = ko.observable(null);
        const self = this;
        if (!confirmRisk) {
            this.showSendImapDataWarning(true);
        }
        else {
            this.imapConform();
            this.Loading(true);
        }
    }
    listingConnectStage(err, stage, publicKeyMessage) {
        const self = this;
        this.showConnectCoNETProcess(true);
        switch (stage) {
            case 1: {
                const index = this.infoTextArray()[this.infoTextArray().length - 1];
                if (!index) {
                    return;
                }
                index.text('connectedMailServer');
                return index.err(false);
            }
            /**
             * 	waiting pong
             */
            case 2: {
                return this.infoTextArray.push({ text: ko.observable('waitingPong'), err: ko.observable(null) });
            }
            /**
             * 	sendConnectRequestMail
             */
            case 3: {
                return this.infoTextArray.push({ text: ko.observable('sendConnectRequestMail'), err: ko.observable(null) });
            }
            /**
             * 	timeOut error!
             */
            case 0: {
                self.Loading(false);
                self.showSendConnectMail(true);
                return self.infoTextArray.push({ text: ko.observable('timeOut'), err: ko.observable(true) });
            }
            /**
             * 	connected node
             */
            case 4: {
                this.Loading(false);
                this.showConnectCoNETProcess(false);
                this.connectedCoNET(true);
                _view.connectInformationMessage.socketIo.removeListener('tryConnectCoNETStage', this.listenFun);
                return _view.keyPairCalss.decryptMessage(publicKeyMessage, (err, data) => {
                    if (err) {
                        return self.infoTextArray.push({ text: ko.observable('unKnowError'), err: ko.observable(true) });
                    }
                    if (!this.isKeypairBeSign) {
                        if (!this.keyPairSign()) {
                            let u = null;
                            return this.keyPairSign(u = new keyPairSign((function () {
                                self.keyPairSign(u = null);
                                self.ready(null);
                            })));
                        }
                        return;
                    }
                    _view.showIconBar(true);
                    return this.ready(null);
                });
            }
            /**
             * 	connectToMailServer
             */
            case 5: {
                return this.infoTextArray.push({ text: ko.observable('connectToMailServer'), err: ko.observable(null) });
            }
            /**
             * 	Client error!
             */
            case -1: {
                this.Loading(false);
                _view.connectInformationMessage.socketIo.removeListener('tryConnectCoNETStage', this.listenFun);
                return this.infoTextArray.push({ text: ko.observable('systemError'), err: ko.observable(true) });
            }
            /**
             * 	network error!
             */
            case -2: {
                this.Loading(false);
                this.showNetworkError(true);
                return this.infoTextArray.push({ text: ko.observable('offline'), err: ko.observable(true) });
            }
        }
    }
    returnToImapSetup() {
        return this.ready(0);
    }
    sendConnectMail() {
        this.Loading(true);
        this.showTryAgain(false);
        _view.connectInformationMessage.sockEmit('sendRequestMail', err => {
            if (err) {
                return this.listingConnectStage(null, -1, null);
            }
        });
    }
    tryAgain() {
        this.resetAll();
        this.infoTextArray([]);
        return this.imapConform();
    }
    resetAll() {
        this.showNetworkError(false);
        this.showSendConnectMail(false);
        this.showSendImapDataWarning(false);
        this.showTryAgain(false);
    }
    imapConform() {
        const self = this;
        this.showSendImapDataWarning(false);
        this.connetcError(-1);
        this.Loading(true);
        //return this.test ()
        this.listenFun = (err, stage, message) => {
            return self.listingConnectStage(err, stage, message);
        };
        _view.connectInformationMessage.socketIo.on('tryConnectCoNETStage', this.listenFun);
        _view.connectInformationMessage.sockEmit('tryConnectCoNET', err => {
            if (err) {
                return this.listingConnectStage(null, -1, null);
            }
        });
    }
    /**
     * 			test unit
     */
    test() {
        /**
         * 		localServerError
         */
        /*
        this.listingConnectStage ( null, 5 )
        setTimeout (() => {
            this.listingConnectStage ( null, -1 )
        }, 3000 )
        /** */
        /**
         * 		connect to mail server error
         */
        /*
        this.listingConnectStage ( null, 5 )
        setTimeout (() => {
            this.listingConnectStage ( null, -2 )
        }, 3000 )
        /** */
        /**
         * 		waiting pong
         */
        /*
        this.listingConnectStage ( null, 5 )
        setTimeout (() => {
            this.listingConnectStage ( null, 1 )
            this.listingConnectStage ( null, 2 )
        }, 3000 )
        /** */
        /**
         * 		waiting pong error automatic send request mail
         */
        /*
        this.listingConnectStage ( null, 5 )
        setTimeout (() => {
            this.listingConnectStage ( null, 1 )
            this.listingConnectStage ( null, 2 )
            setTimeout (() => {
                this.listingConnectStage ( null, 3 )
            })
        }, 3000 )
        /** */
        /**
         * 		waiting pong error automatic send request mail and timeout error
         */
        /*
        this.listingConnectStage ( null, 5 )
        setTimeout (() => {
            this.listingConnectStage ( null, 1 )
            this.listingConnectStage ( null, 2 )
            setTimeout (() => {
                this.listingConnectStage ( null, 3 )
                setTimeout (() => {
                    this.listingConnectStage ( null, 0 )
                }, 2000 )
            })
        }, 3000 )
        /** */
    }
}


================================================
FILE: app/public/scripts/CoNETConnect.ts
================================================
/*!
 * Copyright 2018 CoNET Technology Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

interface connectInfo {
	text: KnockoutObservable < string >
	err: KnockoutObservable < boolean >
}

class CoNETConnect {
	public showSendImapDataWarning = ko.observable ( false )
	public showConnectCoNETProcess = ko.observable ( true )
	public connectStage = ko.observable ( 0 )
	public connetcError = ko.observable ( -1 )
	public connectedCoNET = ko.observable ( false )
	public maynotConnectConet = ko.observable ( false )
	public Loading = ko.observable ( false )
	public listenFun = null
	public showTryAgain = ko.observable ( false )
	public showSendConnectMail = ko.observable ( false )
	public showNetworkError = ko.observable ( false )
	public infoTextArray: KnockoutObservableArray < connectInfo > = ko.observableArray ([])
	public keyPairSign: KnockoutObservable< keyPairSign > = ko.observable ( null )
	constructor ( public email: string, private isKeypairBeSign: boolean, confirmRisk: boolean, public account: string, private ready: ( err ) => void ) {
		const self = this
		if ( !confirmRisk ) {
			this.showSendImapDataWarning ( true )
		} else {
			this.imapConform ()
			this.Loading ( true )
		}
	}


	public listingConnectStage ( err, stage, publicKeyMessage ) {
		const self = this
		this.showConnectCoNETProcess ( true )
		

		switch ( stage ) {
			case 1: {
				const index = this.infoTextArray ()[ this.infoTextArray ().length -1 ]
				if ( !index ) {
					return
				}
				index.text ( 'connectedMailServer' )
				return index.err ( false )
			}

			/**
			 * 	waiting pong
			 */

			case 2: {
				return this.infoTextArray.push ({ text: ko.observable ('waitingPong'), err: ko.observable ( null )})
			}

			/**
			 * 	sendConnectRequestMail
			 */
			case 3: {
				
				return this.infoTextArray.push ({ text: ko.observable ('sendConnectRequestMail'), err: ko.observable ( null )})
			}

			/**
			 * 	timeOut error!
			 */
			case 0: {
				self.Loading ( false )
				self.showSendConnectMail ( true )
				return self.infoTextArray.push ({ text: ko.observable ( 'timeOut' ), err: ko.observable ( true )})
			}


			/**
			 * 	connected node
			 */
			case 4: {
				this.Loading ( false )
				this.showConnectCoNETProcess ( false )
				this.connectedCoNET ( true )
				_view.connectInformationMessage.socketIo.removeListener ( 'tryConnectCoNETStage', this.listenFun )

				return _view.keyPairCalss.decryptMessage ( publicKeyMessage, ( err, data ) => {
					if ( err ) {
						return self.infoTextArray.push ({ text: ko.observable ( 'unKnowError' ), err: ko.observable ( true )})
					}
					
					if ( ! this.isKeypairBeSign ) {
						if ( ! this.keyPairSign ()) {
							let u = null
							return this.keyPairSign ( u = new keyPairSign (( function () {
								
								self.keyPairSign ( u = null )
								self.ready ( null )
							})))
						}
						return
					}
					_view.showIconBar ( true )
					return this.ready ( null )
				})

				
			}

			/**
			 * 	connectToMailServer
			 */
			case 5: {
				return this.infoTextArray.push ({ text: ko.observable ( 'connectToMailServer' ), err: ko.observable ( null ) })
			}

			/**
			 * 	Client error!
			 */
			case -1: {
				this.Loading ( false )
				_view.connectInformationMessage.socketIo.removeListener ( 'tryConnectCoNETStage', this.listenFun )
				return this.infoTextArray.push ({ text: ko.observable ( 'systemError' ), err: ko.observable ( true ) })
			}

			/**
			 * 	network error!
			 */
			case -2: {
				this.Loading ( false )
				this.showNetworkError ( true )
				return this.infoTextArray.push ({ text: ko.observable ( 'offline' ), err: ko.observable ( true ) })
			}

		}
		
	}


	public returnToImapSetup () {
		return this.ready ( 0 )
	}


	public sendConnectMail () {
		
		this.Loading ( true )
		this.showTryAgain ( false )
		_view.connectInformationMessage.sockEmit ( 'sendRequestMail', err => {
			if ( err ) {
				return this.listingConnectStage ( null, -1, null )
			}
		})
	}

	public tryAgain () {
		this.resetAll ()
		this.infoTextArray ([])
		return this.imapConform ()
	}

	private resetAll () {
		this.showNetworkError ( false )
		this.showSendConnectMail ( false )
		this.showSendImapDataWarning ( false )
		this.showTryAgain ( false )
	}



	public imapConform () {
		const self = this
		this.showSendImapDataWarning ( false )
		this.connetcError ( -1 )
		this.Loading ( true )

		//return this.test ()


		this.listenFun = (  err, stage, message  ) => {
			return self.listingConnectStage ( err, stage, message )
		}

		_view.connectInformationMessage.socketIo.on ( 'tryConnectCoNETStage', this.listenFun )
		
		_view.connectInformationMessage.sockEmit ( 'tryConnectCoNET', err => {
			if ( err ) {
				return this.listingConnectStage ( null, -1, null )
			}
		})

	}

	/**
	 * 			test unit
	 */
	private test () {
		/**
		 * 		localServerError
		 */
		/*
		this.listingConnectStage ( null, 5 )
		setTimeout (() => {
			this.listingConnectStage ( null, -1 )
		}, 3000 )
		/** */

		/**
		 * 		connect to mail server error
		 */
		/*
		this.listingConnectStage ( null, 5 )
		setTimeout (() => {
			this.listingConnectStage ( null, -2 )
		}, 3000 )
		/** */

		/**
		 * 		waiting pong
		 */
		/*
		this.listingConnectStage ( null, 5 )
		setTimeout (() => {
			this.listingConnectStage ( null, 1 )
			this.listingConnectStage ( null, 2 )
		}, 3000 )
		/** */

		/**
		 * 		waiting pong error automatic send request mail
		 */
		/*
		this.listingConnectStage ( null, 5 )
		setTimeout (() => {
			this.listingConnectStage ( null, 1 )
			this.listingConnectStage ( null, 2 )
			setTimeout (() => {
				this.listingConnectStage ( null, 3 )
			})
		}, 3000 )
		/** */

		/**
		 * 		waiting pong error automatic send request mail and timeout error
		 */
		/*
		this.listingConnectStage ( null, 5 )
		setTimeout (() => {
			this.listingConnectStage ( null, 1 )
			this.listingConnectStage ( null, 2 )
			setTimeout (() => {
				this.listingConnectStage ( null, 3 )
				setTimeout (() => {
					this.listingConnectStage ( null, 0 )
				}, 2000 )
			})
		}, 3000 )
		/** */

	}

	
}



================================================
FILE: app/public/scripts/appCosearch.js
================================================
let appScript = {
    info: {
        totalResults: ['大约有', '約', 'About', '大約有'],
        totalResults1: ['条记录', '件', 'results', '條記錄'],
        moreResults: ['更多结果', '結果をさらに表示', 'More Results', '更多結果'],
        searchToolBarMenu: [
            [
                '网站', 'ウェイブ', 'Website', '網頁'
            ], [
                '新闻', 'ニュース', 'News', '新聞'
            ], [
                '图片', '画像', 'Picture', '圖片'
            ], [
                '视频', 'ビデオ', 'Video', '視頻'
            ]
        ]
    },
    showMain: ko.observable(true),
    showWebPage: ko.observable(null),
    htmlIframe: ko.observable(false),
    showSnapshop: ko.observable(false),
    searchItemsArray: ko.observable(),
    hasFocusShowTool: ko.observable(false),
    backGroundBlue: ko.observable(false),
    searchItem: ko.observable(null),
    showMainSearchForm: ko.observable(true),
    showSearchSetupForm: ko.observable(false),
    showSearchError: ko.observable(false),
    showInputLoading: ko.observable(false),
    errorMessageIndex: ko.observable(-1),
    searchInputText: ko.observable(''),
    hasFocus: ko.observable(false),
    passwordError: ko.observable(false),
    searchSetupIcon: ko.observable(bingIcon),
    password: ko.observable(''),
    searchInputTextActionShow: ko.observable(false),
    SearchInputNextHasFocus: ko.observable(false),
    showSearchesRelated: ko.observable(false),
    searchItemList: ko.observableArray([]),
    loadingGetResponse: ko.observable(false),
    conetResponse: ko.observable(false),
    searchInputTextShow: ko.observable(''),
    currentlyShowItems: ko.observable(0),
    newsButtonShowLoading: ko.observable(false),
    newsItemsArray: ko.observable(),
    newsButtonShowError: ko.observable(false),
    newsButtonErrorIndex: ko.observable(null),
    newsLoadingGetResponse: ko.observable(false),
    newsConetResponse: ko.observable(false),
    nextButtonShowError: ko.observable(false),
    moreResultsButtomLoading: ko.observable(false),
    imageButtonShowLoading: ko.observable(false),
    imageButtonShowError: ko.observable(false),
    imageButtonErrorIndex: ko.observable(-1),
    imageLoadingGetResponse: ko.observable(false),
    imageConetResponse: ko.observable(false),
    imageItemsArray: ko.observable(),
    searchSimilarImagesList: ko.observableArray([]),
    showSearchSimilarImagesResult: ko.observable(false),
    imageSearchItemArray: ko.observable(),
    videoButtonShowLoading: ko.observable(false),
    videoItemsArray: ko.observable(),
    videoButtonShowError: ko.observable(false),
    videoButtonErrorIndex: ko.observable(-1),
    videoLoadingGetResponse: ko.observable(false),
    videoConetResponse: ko.observable(false),
    nextButtonErrorIndex: ko.observable(false),
    nextButtonConetResponse: ko.observable(false),
    nextButtonLoadingGetResponse: ko.observable(false),
    //	['originImage']
    initSearchData: (self) => {
        self.searchItem(null);
        self.searchItemList([]);
        self.showInputLoading(true);
        self.showSearchesRelated(false);
        self.newsItemsArray(null);
        self.imageItemsArray(null);
        self.showSearchesRelated(null);
        self.videoItemsArray(null);
        self.imageSearchItemArray(null);
    },
    showResultItems: (self, items) => {
        self.searchItem(items);
        self.searchItemList(items.Result);
        $('.selection.dropdown').dropdown();
    },
    searchSetupClick: (self, event) => {
        self.showSearchSetupForm(true);
        self.backGroundBlue(true);
        /*
        $('#coSearchBackGround').one ( 'click', function() {
            self.backGroundClick ()
            $('#coSearchForm').off ('click')
        })
        $('#coSearchForm').one ( 'click', function() {
            self.backGroundClick ()
            $('#coSearchBackGround').off ('click')
        })
        */
        return false;
    },
    searchInputCloseError: (self, event) => {
        self.showSearchError(false);
        self.errorMessageIndex(null);
    },
    returnSearchResultItemsInit: (items) => {
        let i = 0;
        const y = [];
        items.Result.forEach(n => {
            i++;
            n['showLoading'] = ko.observable(false);
            n['conetResponse'] = ko.observable(false);
            n['loadingGetResponse'] = ko.observable(false);
            n['snapshotReady'] = ko.observable(false);
            n['snapshotClass'] = null;
            n['snapshotData'] = null;
            n['snapshotUuid'] = null;
            n['id'] = uuid_generate();
            n['showError'] = ko.observable(false);
            n['errorIndex'] = ko.observable(-1);
            if (!n['newsBrand']) {
                n['newsBrand'] = null;
            }
            if (n.imageInfo) {
                if (!n.imageInfo['videoTime']) {
                    n.imageInfo['videoTime'] = null;
                }
            }
            n['webUrlHref'] = n.clickUrl;
            n['imgUrlHref'] = n.imgSrc;
            n['showImageLoading'] = ko.observable(false);
            n['showImageError'] = ko.observable(false);
            n['snapshotImageReady'] = ko.observable(false);
            n['loadingImageGetResponse'] = ko.observable(false);
            n['conetImageResponse'] = ko.observable(false);
            n['imageErrorIndex'] = ko.observable(-1);
        });
    },
    search_form: (self, event) => {
        if (self.showInputLoading()) {
            return;
        }
        if (!_view.CanadaBackground()) {
            _view.CanadaBackground(true);
        }
        if (!self.showMainSearchForm()) {
            self.showMainSearchForm(true);
        }
        const search_text = self.searchInputText();
        const width = window.innerWidth;
        const height = window.outerHeight;
        self.initSearchData(self);
        const com = {
            command: 'CoSearch',
            Args: null,
            error: null,
            subCom: null
        };
        /**
         * 			web page address
         */
        if (/^http[s]?:\/\//.test(search_text)) {
            com.Args = [search_text, width, height];
            com.subCom = 'getSnapshop';
        }
        else {
            com.Args = ['google', search_text];
            com.subCom = 'webSearch';
        }
        const errorProcess = (err) => {
            self.showInputLoading(false);
            self.searchInputText('');
            self.errorMessageIndex(_view.connectInformationMessage.getErrorIndex(err));
            return self.showSearchError(true);
        };
        /**
         *
         * 		test Unit
         */
        return _view.keyPairCalss.emitRequest(com, (err, com) => {
            if (err) {
                return errorProcess(err);
            }
            if (!com) {
                return self.loadingGetResponse(true);
            }
            if (com.error === -1) {
                self.loadingGetResponse(false);
                return self.conetResponse(true);
            }
            if (com.error) {
                return errorProcess(com.error);
            }
            if (com.subCom === 'webSearch') {
                self.showInputLoading(false);
                const args = com.Args;
                self.searchInputTextShow(search_text);
                self.returnSearchResultItemsInit(args.param);
                self.searchItemsArray(args.param);
                self.showResultItems(self, args.param);
                _view.CanadaBackground(false);
                return self.showMainSearchForm(false);
            }
            const arg = com.Args[0];
            const uuid = arg.split(',')[0].split('.')[0];
            return _view.connectInformationMessage.sockEmit('getFilesFromImap', arg, (err, buffer) => {
                if (err) {
                    return errorProcess(err);
                }
                return _view.keyPairCalss.decryptMessageToZipStream(buffer, (err, data) => {
                    if (err) {
                        return errorProcess(err);
                    }
                    self.showInputLoading(false);
                    _view.CanadaBackground(false);
                    self.showMainSearchForm(false);
                    self.showMain(false);
                    self.showSnapshop(true);
                    let y = null;
                    self.showWebPage(y = new showWebPageClass(search_text, buffer, uuid, () => {
                        self.showWebPage(y = null);
                        self.showMain(true);
                        self.showSnapshop(false);
                        _view.CanadaBackground(true);
                        self.showMainSearchForm(true);
                    }));
                });
            });
        });
    },
    searchSetup: (key, self, event) => {
        self.showSearchSetupForm(false);
        self.backGroundBlue(false);
        switch (key) {
            case 'b': {
                return self.searchSetupIcon(bingIcon);
            }
            case 'd': {
                return self.searchSetupIcon(duckduckgoIcon);
            }
            case 'y': {
                return self.searchSetupIcon(YahooIcon);
            }
            default: {
                self.searchSetupIcon(googleIcon);
            }
        }
    },
    startup: (self) => {
        self.password.subscribe((_text) => {
            self.passwordError(false);
        });
        self.hasFocus.subscribe((_result) => {
            if (_result) {
                self.hasFocusShowTool(true);
                return self.backGroundBlue(true);
            }
            /*
            if ( self.showMain () ) {
                if ( !self.searchInputText().length ) {
                    self.searchInputTextActionShow ( false )
                    return self.backGroundBlue ( _result )
                }
                self.searchInputTextActionShow ( true )
                _result = false
                return true
            }
            if ( !_result ) {
                return true
            }
            if ( _result ) {
                if ( !self.showSubViewToolBar ()) {
                    self.showSubViewToolBar ( true )
                }
            }
            return true
            */
        });
        self.searchInputText.subscribe((_text) => {
            self.searchInputTextActionShow(_text.length > 0);
        });
        self.SearchInputNextHasFocus.subscribe((hasFocus) => {
            if (hasFocus) {
                self.showSearchesRelated(true);
            }
        });
        _view.showIconBar(false);
        _view.CanadaBackground(true);
    },
    nextButtonErrorClick: (self) => {
        self.nextButtonShowError(false);
        self.nextButtonErrorIndex(null);
    },
    webItemsClick: (self, event) => {
        self.currentlyShowItems(0);
        self.showResultItems(self, self.searchItemsArray());
    },
    searchNext: (self, event) => {
        const nextLink = self.searchItem().nextPage;
        if (self.moreResultsButtomLoading() || !nextLink) {
            return;
        }
        self.moreResultsButtomLoading(true);
        function showError(err) {
            self.moreResultsButtomLoading(false);
            self.nextButtonErrorIndex(_view.connectInformationMessage.getErrorIndex(err));
            self.nextButtonShowError(true);
        }
        let currentArray = null;
        const com = {
            command: 'CoSearch',
            Args: ['google', nextLink],
            error: null,
            subCom: null
        };
        switch (self.currentlyShowItems()) {
            //      google search
            case 0: {
                com.subCom = 'searchNext';
                currentArray = self.searchItemsArray();
                break;
            }
            //      news
            case 1: {
                com.subCom = 'newsNext';
                currentArray = self.newsItemsArray();
                break;
            }
            case 2: {
                com.subCom = 'imageSearchNext';
                currentArray = self.imageSearchItemArray();
                break;
            }
            default: {
                com.subCom = 'videoNext';
                currentArray = self.videoItemsArray();
                break;
            }
        }
        /** */
        return _view.keyPairCalss.emitRequest(com, (err, com) => {
            if (err) {
                return showError(err);
            }
            if (!com) {
                return self.nextButtonLoadingGetResponse(true);
            }
            if (com.error === -1) {
                self.nextButtonLoadingGetResponse(false);
                return self.nextButtonConetResponse(true);
            }
            if (com.error) {
                return showError(com.error);
            }
            self.moreResultsButtomLoading(false);
            self.nextButtonLoadingGetResponse(false);
            self.nextButtonConetResponse(false);
            const args = com.Args;
            self.returnSearchResultItemsInit(args.param);
            currentArray.Result.push(...args.param.Result);
            currentArray.nextPage = args.param.nextPage;
            return self.showResultItems(self, currentArray);
        });
    },
    createNewsResult: (self, newsResult) => {
        const newsItems = JSON.parse(JSON.stringify(self.searchItemsArray()));
        newsItems.Result = newsResult.Result;
        newsItems.nextPage = newsResult.nextPage;
        newsItems.totalResults = newsResult.totalResults;
        return newsItems;
    },
    newsButtonClick: (self, event) => {
        if (self.newsButtonShowLoading()) {
            return;
        }
        if (self.newsButtonShowError()) {
            self.newsButtonShowError(false);
            return self.newsButtonErrorIndex(null);
        }
        self.newsButtonShowLoading(true);
        const errorProcess = (err) => {
            self.newsButtonShowLoading(false);
            self.newsLoadingGetResponse(false);
            self.newsConetResponse(false);
            self.newsButtonErrorIndex(_view.connectInformationMessage.getErrorIndex(err));
            return self.newsButtonShowError(true);
        };
        if (!self.newsItemsArray()) {
            if (!self.searchItemsArray().action || !self.searchItemsArray().action.news) {
                return errorProcess('invalidRequest');
            }
            const com = {
                command: 'CoSearch',
                Args: ['google', self.searchItemsArray().action.news],
                error: null,
                subCom: 'newsNext'
            };
            return _view.keyPairCalss.emitRequest(com, (err, com) => {
                if (err) {
                    return errorProcess(err);
                }
                if (!com) {
                    return self.newsLoadingGetResponse(true);
                }
                if (com.error === -1) {
                    self.newsLoadingGetResponse(false);
                    return self.newsConetResponse(true);
                }
                if (com.error) {
                    return errorProcess(com.error);
                }
                self.newsButtonShowLoading(false);
                self.newsConetResponse(false);
                self.newsLoadingGetResponse(false);
                const args = com.Args;
                self.newsItemsArray(self.createNewsResult(self, args.param));
                self.returnSearchResultItemsInit(self.newsItemsArray());
            });
        }
        self.currentlyShowItems(1);
        self.newsButtonShowLoading(false);
        return self.showResultItems(self, self.newsItemsArray());
    },
    imageButtonClick: (self, event) => {
        if (self.imageButtonShowLoading()) {
            return;
        }
        if (self.imageButtonShowError()) {
            self.imageButtonShowError(false);
            return self.imageButtonErrorIndex(null);
        }
        const errorProcess = (err) => {
            self.imageButtonShowLoading(false);
            self.imageLoadingGetResponse(false);
            self.imageConetResponse(false);
            self.imageButtonErrorIndex(_view.connectInformationMessage.getErrorIndex(err));
            return self.imageButtonShowError(true);
        };
        if (!self.imageItemsArray()) {
            const imageLink = self.searchItemsArray() && self.searchItemsArray().action && self.searchItemsArray().action.image ? self.searchItemsArray().action.image : self.imageSearchItemArray().searchesRelated[1];
            const com = {
                command: 'CoSearch',
                Args: ['google', imageLink],
                error: null,
                subCom: 'imageNext'
            };
            self.imageButtonShowLoading(true);
            return _view.keyPairCalss.emitRequest(com, (err, com) => {
                if (err) {
                    return errorProcess(err);
                }
                if (!com) {
                    self.imageConetResponse(false);
                    return self.imageLoadingGetResponse(true);
                }
                if (com.error === -1) {
                    self.imageLoadingGetResponse(false);
                    return self.imageConetResponse(true);
                }
                const args = com.Args;
                if (com.error) {
                    return errorProcess(com.error);
                }
                if (!args.param || !args.param.Result || !args.param.Result.length) {
                    return errorProcess('timeOut');
                }
                self.imageButtonShowLoading(false);
                self.imageConetResponse(false);
                self.imageLoadingGetResponse(false);
                self.imageItemsArray(args.param);
                self.returnSearchResultItemsInit(self.imageItemsArray());
            });
            /** */
        }
        self.searchSimilarImagesList(self.imageItemsArray().Result);
        self.showMain(false);
        self.showSearchSimilarImagesResult(true);
    },
    getSnapshotClick: (self, index) => {
        const currentItem = self.searchItemList()[index];
        currentItem.showLoading(true);
        const showError = err => {
            currentItem.showLoading(false);
            currentItem.loadingGetResponse(false);
            currentItem.conetResponse(false);
            currentItem.errorIndex(_view.connectInformationMessage.getErrorIndex(err));
            currentItem.showError(true);
            const currentElm = $(`#${currentItem.id}`);
            return currentElm.popup({
                on: 'click',
                inline: true,
                onHidden: function () {
                    currentItem.showError(false);
                    currentItem.errorIndex(null);
                }
            });
        };
        const callBack = (err, com) => {
            if (err) {
                return showError(err);
            }
            if (!com) {
                currentItem.loadingGetResponse(true);
                return currentItem.conetResponse(false);
            }
            if (com.error === -1) {
                currentItem.loadingGetResponse(false);
                return currentItem.conetResponse(true);
            }
            if (com.error) {
                return showError(com.error);
            }
            const arg = com.Args[0];
            currentItem.snapshotUuid = arg.split(',')[0].split('.')[0];
            return _view.connectInformationMessage.sockEmit('getFilesFromImap', arg, (err, buffer) => {
                if (err) {
                    return showError(err);
                }
                return _view.keyPairCalss.decryptMessageToZipStream(buffer, (err, data) => {
                    if (err) {
                        return showError(err);
                    }
                    currentItem.snapshotReady(true);
                    currentItem.showLoading(false);
                    currentItem.loadingGetResponse(false);
                    currentItem.conetResponse(false);
                    return currentItem.snapshotData = buffer;
                });
            });
        };
        const url = currentItem.url;
        const width = $(window).width();
        const height = $(window).height();
        const com = {
            command: 'CoSearch',
            Args: [url, width, height],
            error: null,
            subCom: 'getSnapshop'
        };
        return _view.keyPairCalss.emitRequest(com, callBack);
    },
    showSnapshotClick: (self, index) => {
        self.showMain(false);
        self.showSnapshop(true);
        const currentItem = self.searchItemList()[index];
        let y = null;
        self.showWebPage(y = new showWebPageClass(currentItem.url, currentItem.snapshotData, currentItem.snapshotUuid, () => {
            self.showWebPage(y = null);
            self.showMain(true);
            self.showSnapshop(false);
        }));
    },
    searchesRelatedSelect: (self, index) => {
        self.searchInputText(self.searchItem().searchesRelated[index].text);
        self.showSearchesRelated(false);
    },
    closeSimilarImagesResult: (self) => {
        self.searchSimilarImagesList([]);
        self.showMain(true);
        self.showSearchSimilarImagesResult(false);
    },
    videoButtonClick: (self) => {
        if (self.videoButtonShowLoading()) {
            return;
        }
        if (self.videoButtonShowError()) {
            self.videoButtonShowError(false);
            return self.imageButtonErrorIndex(null);
        }
        const errorProcess = (err) => {
            self.videoButtonShowLoading(false);
            self.videoLoadingGetResponse(false);
            self.videoConetResponse(false);
            self.videoButtonErrorIndex(_view.connectInformationMessage.getErrorIndex(err));
            return self.videoButtonShowError(true);
        };
        if (!self.videoItemsArray()) {
            if (!self.searchItemsArray().action || !self.searchItemsArray().action.video) {
                return errorProcess('invalidRequest');
            }
            const com = {
                command: 'CoSearch',
                Args: ['google', self.searchItemsArray().action.video],
                error: null,
                subCom: 'videoNext'
            };
            self.videoButtonShowLoading(true);
            return _view.keyPairCalss.emitRequest(com, (err, com) => {
                if (err) {
                    return errorProcess(err);
                }
                if (!com) {
                    self.videoConetResponse(false);
                    return self.videoLoadingGetResponse(true);
                }
                if (com.error === -1) {
                    self.videoLoadingGetResponse(false);
                    return self.videoConetResponse(true);
                }
                if (com.error) {
                    return errorProcess(com.error);
                }
                self.videoButtonShowLoading(false);
                self.videoLoadingGetResponse(false);
                self.videoConetResponse(false);
                const args = com.Args;
                self.videoItemsArray(self.createNewsResult(self, args.param));
                self.returnSearchResultItemsInit(self.videoItemsArray());
            });
            /** */
        }
        self.currentlyShowItems(3);
        return self.showResultItems(self, self.videoItemsArray());
    },
    getPictureBase64MaxSize_mediaData: (mediaData, imageMaxWidth, imageMaxHeight, CallBack) => {
        const media = mediaData.split(',');
        const type = media[0].split(';')[0].split(':')[1];
        const _media = Buffer.from(media[1], 'base64');
        const ret = {
            total_bytes: media[1].length,
            media_type: 'image/png',
            rawData: media[1],
            media_id_string: null
        };
        //if ( mediaData.length > maxImageLength) {
        const exportImage = (_type, img) => {
            return img.getBuffer(_type, (err, _buf) => {
                if (err) {
                    return CallBack(err);
                }
                ret.rawData = _buf.toString('base64');
                ret.total_bytes = _buf.length;
                return CallBack(null, ret);
            });
        };
        return Jimp.read(_media, (err, image) => {
            if (err) {
                return CallBack(err);
            }
            const uu = image.bitmap;
            if (uu.height + uu.width > imageMaxHeight + imageMaxWidth) {
                if (uu.height > uu.widt) {
                    image.resize(Jimp.AUTO, imageMaxHeight);
                }
                else {
                    image.resize(imageMaxWidth, Jimp.AUTO);
                }
            }
            //		to PNG
            return image.deflateStrategy(2, () => {
                return exportImage(ret.media_type, image);
            });
        });
        //}
        //return CallBack ( null, ret )
    },
    imageSearch: (ee) => {
        const self = _view.appsManager().appScript();
        const errorProcess = (err) => {
            self.showInputLoading(false);
            self.searchInputText('');
            self.errorMessageIndex(_view.connectInformationMessage.getErrorIndex(err));
            return self.showSearchError(true);
        };
        const showItems = (iResult) => {
            self.showInputLoading(false);
            self.currentlyShowItems(2);
            self.returnSearchResultItemsInit(iResult);
            self.imageSearchItemArray(iResult);
            self.searchInputText(iResult.searchesRelated[0]);
            self.showResultItems(self, self.imageSearchItemArray());
        };
        if (!ee || !ee.files || !ee.files.length) {
            return;
        }
        const file = ee.files[0];
        if (!file || !file.type.match(/^image.(png$|jpg$|jpeg$|gif$)/)) {
            return;
        }
        const reader = new FileReader();
        reader.onload = e => {
            const rawData = reader.result.toString();
            self.showInputLoading(true);
            self.searchInputText(' ');
            self.searchItem(null);
            self.searchItemList([]);
            return self.getPictureBase64MaxSize_mediaData(rawData, 1024, 1024, (err, data) => {
                if (err) {
                    return errorProcess(err);
                }
                const uuid = uuid_generate() + '.png';
                return _view.keyPairCalss.encrypt(data.rawData, (err, textData) => {
                    if (err) {
                        return errorProcess(err);
                    }
                    self.initSearchData(self);
                    return _view.connectInformationMessage.sockEmit('sendMedia', uuid, textData, err => {
                        if (err) {
                            return errorProcess(err);
                        }
                        const com = {
                            command: 'CoSearch',
                            Args: ['google', uuid],
                            error: null,
                            subCom: 'imageSearch'
                        };
                        return _view.keyPairCalss.emitRequest(com, (err, com) => {
                            if (err) {
                                return errorProcess(err);
                            }
                            if (!com) {
                                return self.loadingGetResponse(true);
                            }
                            if (com.error === -1) {
                                self.loadingGetResponse(false);
                                return self.conetResponse(true);
                            }
                            if (com.error) {
                                return errorProcess(com.error);
                            }
                            _view.CanadaBackground(false);
                            self.showMainSearchForm(false);
                            return showItems(com.Args.param);
                        });
                    });
                });
            });
        };
        if (!_view.CanadaBackground()) {
            _view.CanadaBackground(true);
        }
        if (!self.showMainSearchForm()) {
            self.showMainSearchForm(true);
        }
        return reader.readAsDataURL(file);
    },
    imagesResultClick: (self, index, image) => {
        const _img = self.searchSimilarImagesList()[index];
        const currentElm = $(`#${_img.id}-1`);
        /**
         *
         * 			get web side
         *
         */
        if (_img.showError()) {
            return _img.showError(false);
        }
        if (_img.showImageError()) {
            return _img.showImageError(false);
        }
        if (image === 'link') {
            if (_img.showLoading()) {
                return;
            }
            const url = _img.webUrlHref;
            if (_img['snapshotData']) {
                self.showMain(false);
                self.showSnapshop(true);
                self.showSearchSimilarImagesResult(false);
                let y = null;
                return self.showWebPage(y = new showWebPageClass(url, _img['snapshotData'], _img['snapshotUuid'], () => {
                    self.showWebPage(y = null);
                    self.showMain(true);
                    self.showSnapshop(false);
                    self.showSearchSimilarImagesResult(true);
                }));
            }
            const errorProcess = (err) => {
                _img.errorIndex(_view.connectInformationMessage.getErrorIndex(err));
                _img.showLoading(false);
                _img.snapshotReady(false);
                _img.loadingGetResponse(false);
                _img.conetResponse(false);
                const currentElm = $(`#${_img.id}`);
                currentElm.popup({
                    on: 'click',
                    inline: true,
                    onHidden: function () {
                        _img.showError(false);
                        _img.errorIndex(null);
                    }
                });
                return _img.showError(true);
            };
            _img.showLoading(true);
            const callBack = (err, com) => {
                if (err) {
                    return errorProcess(err);
                }
                if (!com) {
                    _img.loadingGetResponse(true);
                    return _img.conetResponse(false);
                }
                if (com.error === -1) {
                    _img.loadingGetResponse(false);
                    return _img.conetResponse(true);
                }
                if (com.error) {
                    return errorProcess(com.error);
                }
                const arg = com.Args[0];
                _img['snapshotUuid'] = arg.split(',')[0].split('.')[0];
                return _view.connectInformationMessage.sockEmit('getFilesFromImap', arg, (err, buffer) => {
                    if (err) {
                        return errorProcess(err);
                    }
                    return _view.keyPairCalss.decryptMessageToZipStream(buffer, (err, data) => {
                        if (err) {
                            return errorProcess(err);
                        }
                        _img.snapshotReady(true);
                        _img.showLoading(false);
                        _img.loadingGetResponse(false);
                        _img.conetResponse(false);
                        return _img['snapshotData'] = buffer;
                    });
                });
            };
            const width = $(window).width();
            const height = $(window).height();
            const com = {
                command: 'CoSearch',
                Args: [url, width, height],
                error: null,
                subCom: 'getSnapshop'
            };
            return _view.keyPairCalss.emitRequest(com, callBack);
        }
        /**
         * n['showImageLoading'] = ko.observable ( false )
            n['snapshotImageReady'] = ko.observable ( false )
            n['loadingImageGetResponse'] = ko.observable ( false )
            n['conetImageResponse'] = ko.observable ( false )
            n['showImageError'] = ko.observable ( false )
            n['imageErrorIndex'] = ko.observable (-1)
         */
        if (image === 'img') {
            if (_img.showImageLoading()) {
                return;
            }
            if (_img['imgOriginalData']) {
                const uu = 1;
                return;
            }
            const errorProcess = (err) => {
                _img.imageErrorIndex(_view.connectInformationMessage.getErrorIndex(err));
                _img.showImageLoading(false);
                _img.snapshotImageReady(false);
                _img.loadingImageGetResponse(false);
                _img.conetImageResponse(false);
                _img.showImageError(true);
                currentElm.popup({
                    inline: true,
                    onHidden: function () {
                        _img.showImageError(false);
                    }
                });
                return;
            };
            const callBack = (err, com) => {
                if (err) {
                    return errorProcess(err);
                }
                if (!com) {
                    _img.loadingGetResponse(true);
                    return _img.conetResponse(false);
                }
                if (com.error === -1) {
                    _img.loadingGetResponse(false);
                    return _img.conetResponse(true);
                }
                if (com.error) {
                    return errorProcess(com.error);
                }
                const arg = com.Args[0];
                _img['snapshotUuid'] = arg.split(',')[0].split('.')[0];
                return _view.connectInformationMessage.sockEmit('getFilesFromImap', arg, (err, buffer) => {
                    if (err) {
                        return errorProcess(err);
                    }
                    return _view.keyPairCalss.decryptMessageToZipStream(buffer, (err, data) => {
                        if (err) {
                            return errorProcess(err);
                        }
                        _img.snapshotReady(true);
                        _img.showLoading(false);
                        _img.loadingGetResponse(false);
                        _img.conetResponse(false);
                        return _img['snapshotData'] = buffer;
                    });
                });
            };
            const com = {
                command: 'CoSearch',
                Args: [_img.imgUrlHref],
                error: null,
                subCom: 'getFile'
            };
            return _view.keyPairCalss.emitRequest(com, callBack);
            setTimeout(() => {
                _img.loadingImageGetResponse(true);
                setTimeout(() => {
                    _img.loadingImageGetResponse(false);
                    _img.conetImageResponse(true);
                    setTimeout(() => {
                        _img.loadingImageGetResponse(false);
                        _img.conetImageResponse(false);
                        _img.snapshotImageReady(true);
                        _img.showImageLoading(false);
                    }, 1000);
                }, 1000);
            }, 1000);
            _img.showImageLoading(true);
        }
    }
};


================================================
FILE: app/public/scripts/appCosearch.ts
================================================



let appScript = {
	info: {
		totalResults: ['大约有','約','About','大約有'],
		totalResults1: ['条记录','件','results','條記錄'],
		moreResults: ['更多结果','結果をさらに表示','More Results','更多結果'],
		searchToolBarMenu: [
			[
				'网站','ウェイブ','Website','網頁'
			],[
				'新闻','ニュース','News','新聞'
			],[
				'图片','画像','Picture','圖片'
			],[
				'视频','ビデオ','Video','視頻'
			]
		]
	},

	showMain: ko.observable ( true ),
	showWebPage: ko.observable ( null ), 
	htmlIframe: ko.observable ( false ),
	showSnapshop: ko.observable ( false ),
	searchItemsArray: ko.observable (),
	hasFocusShowTool: ko.observable ( false ),
	backGroundBlue: ko.observable ( false ),
	searchItem: ko.observable ( null ),
	showMainSearchForm: ko.observable ( true ),
	showSearchSetupForm: ko.observable ( false ),
	showSearchError: ko.observable ( false ),
	showInputLoading: ko.observable ( false ),
	errorMessageIndex: ko.observable ( -1 ),
	searchInputText: ko.observable (''),
	hasFocus: ko.observable ( false ),
	passwordError: ko.observable ( false ),
	searchSetupIcon: ko.observable ( bingIcon ),
	password: ko.observable (''),
	searchInputTextActionShow: ko.observable ( false ),
	SearchInputNextHasFocus: ko.observable ( false ),
	showSearchesRelated: ko.observable ( false ),
	searchItemList: ko.observableArray ([]),
	loadingGetResponse: ko.observable ( false ),
	conetResponse: ko.observable ( false ),
	searchInputTextShow: ko.observable (''),
	currentlyShowItems: ko.observable ( 0 ),
	newsButtonShowLoading: ko.observable ( false ),

	newsItemsArray: ko.observable (),
	newsButtonShowError: ko.observable ( false ),
	newsButtonErrorIndex: ko.observable ( null ),
	newsLoadingGetResponse: ko.observable ( false ),
	newsConetResponse: ko.observable ( false ), 

	nextButtonShowError: ko.observable ( false ),
	moreResultsButtomLoading: ko.observable ( false ),

	imageButtonShowLoading: ko.observable ( false ),
	imageButtonShowError: ko.observable ( false ),
	imageButtonErrorIndex: ko.observable ( -1 ),
	imageLoadingGetResponse: ko.observable ( false ),
	imageConetResponse: ko.observable ( false ),
	imageItemsArray: ko.observable (),
	searchSimilarImagesList: ko.observableArray ([]),
	showSearchSimilarImagesResult: ko.observable ( false ),
	imageSearchItemArray: ko.observable (),

	videoButtonShowLoading: ko.observable ( false ),
	videoItemsArray: ko.observable (),
	videoButtonShowError: ko.observable ( false ),
	videoButtonErrorIndex: ko.observable ( -1 ),
	videoLoadingGetResponse: ko.observable ( false ),
	videoConetResponse: ko.observable ( false ),

	nextButtonErrorIndex: ko.observable ( false ),
	nextButtonConetResponse: ko.observable ( false ),
	nextButtonLoadingGetResponse: ko.observable ( false ),


	//	['originImage']

	initSearchData: ( self ) => {
		self.searchItem ( null )
		self.searchItemList ([])
		self.showInputLoading ( true )
		self.showSearchesRelated ( false )
		self.newsItemsArray ( null )
		self.imageItemsArray ( null )
		self.showSearchesRelated ( null )
		self.videoItemsArray ( null )
		self.imageSearchItemArray ( null )
		
	},

	showResultItems: ( self, items ) => {
		self.searchItem ( items )
		self.searchItemList ( items.Result )
		$('.selection.dropdown').dropdown()
	},

	searchSetupClick: ( self, event ) => {
		self.showSearchSetupForm ( true )
		self.backGroundBlue ( true )
		
		/*
		$('#coSearchBackGround').one ( 'click', function() {
			self.backGroundClick ()
			$('#coSearchForm').off ('click')
		})
		$('#coSearchForm').one ( 'click', function() {
			self.backGroundClick ()
			$('#coSearchBackGround').off ('click')
		})
		*/
		return false
	},

	searchInputCloseError: ( self, event ) => {
		self.showSearchError ( false )
		self.errorMessageIndex (null)
		
	},

	returnSearchResultItemsInit: ( items ) => {
		let i = 0
		const y = []
		items.Result.forEach ( n => {
			i++
			
			
			n['showLoading'] = ko.observable ( false )
			n['conetResponse'] = ko.observable ( false )
			n['loadingGetResponse'] = ko.observable ( false )
			n['snapshotReady'] = ko.observable ( false )
			n['snapshotClass'] = null
			n['snapshotData'] = null
			n['snapshotUuid'] = null
			n['id'] = uuid_generate ()
			n['showError'] = ko.observable ( false )
			n['errorIndex'] = ko.observable ( -1 )
			if ( !n['newsBrand'] ) {
				n['newsBrand'] = null
			}
			if ( n.imageInfo ) {
				if ( !n.imageInfo['videoTime'] ) {
					n.imageInfo['videoTime'] = null
				}
			}
			
			n['webUrlHref'] = n.clickUrl
			n['imgUrlHref'] = n.imgSrc
			
			
			n['showImageLoading'] = ko.observable ( false )
			n['showImageError'] = ko.observable ( false )
			n['snapshotImageReady'] = ko.observable ( false )
			n['loadingImageGetResponse'] = ko.observable ( false )
			n['conetImageResponse'] = ko.observable ( false )
			n['imageErrorIndex'] = ko.observable (-1)
		})
		
	},

	search_form: ( self, event ) => {

		if ( self.showInputLoading()) {
			return 
		}
		
		if ( !_view.CanadaBackground ()) {
			_view.CanadaBackground ( true )
		}
		if ( !self.showMainSearchForm()) {
			self.showMainSearchForm( true )
		}
		const search_text = self.searchInputText ()
		
		const width = window.innerWidth
		const height = window.outerHeight
		
		self.initSearchData ( self )

		const com: QTGateAPIRequestCommand = {
			command: 'CoSearch',
			Args: null,
			error: null,
			subCom: null
		}
		/**
		 * 			web page address
		 */

		if ( /^http[s]?:\/\//.test( search_text )) {
			com.Args = [ search_text, width, height ]
			com.subCom = 'getSnapshop'
			
		} else {
			com.Args = [ 'google', search_text ]
			com.subCom = 'webSearch'
		}

		const errorProcess = ( err ) => {
			self.showInputLoading ( false )
			self.searchInputText ( '' )
			self.errorMessageIndex ( _view.connectInformationMessage.getErrorIndex( err ))
			return self.showSearchError ( true )
		}

		/**
		 * 
		 * 		test Unit
		 */

		

		return _view.keyPairCalss.emitRequest ( com, ( err, com: QTGateAPIRequestCommand ) => {
			
			if ( err ) {
				return errorProcess ( err )
			}

			if ( !com ) {
				return self.loadingGetResponse ( true )
			}

			if ( com.error === -1 ) {
				self.loadingGetResponse ( false )
				return self.conetResponse ( true )
			}

			

			if ( com.error ) {
				return errorProcess ( com.error )
			}

			if ( com.subCom === 'webSearch') {
				self.showInputLoading ( false )
				
				const args = com.Args
				self.searchInputTextShow ( search_text )
				
				self.returnSearchResultItemsInit ( args.param )
				self.searchItemsArray ( args.param )
				self.showResultItems ( self, args.param )
				_view.CanadaBackground ( false )
				return self.showMainSearchForm ( false )
			}
			
			const arg: string = com.Args[0]
			const uuid = arg.split(',')[0].split ('.')[0]
			return _view.connectInformationMessage.sockEmit ( 'getFilesFromImap', arg, ( err, buffer: string ) => {
				if ( err ) {
					return errorProcess ( err )
				}
				return _view.keyPairCalss.decryptMessageToZipStream ( buffer, ( err, data ) => {
					if ( err ) {
						return errorProcess ( err )
					}
					self.showInputLoading ( false )
					_view.CanadaBackground ( false )
					self.showMainSearchForm ( false )
					self.showMain ( false )
					self.showSnapshop ( true )
					let y = null
					self.showWebPage ( y = new showWebPageClass ( search_text, buffer, uuid , () => {
						self.showWebPage ( y = null )
						self.showMain ( true )
						self.showSnapshop ( false )
						_view.CanadaBackground ( true )
						self.showMainSearchForm ( true )
					}))
				})
				
			})
			
		})
		

	},

	searchSetup: ( key: string, self, event ) => {
		self.showSearchSetupForm ( false )
		self.backGroundBlue ( false )
		switch ( key ) {
			case 'b': {
				return self.searchSetupIcon ( bingIcon )
			}
			case 'd': {
				return self.searchSetupIcon ( duckduckgoIcon )
			}
			case 'y': {
				return self.searchSetupIcon ( YahooIcon )
			}
			default: {
				self.searchSetupIcon ( googleIcon )
			}
		}
	},

	startup: ( self ) => {
		self.password.subscribe (( _text: string ) => {
			self.passwordError ( false )
		})

		self.hasFocus.subscribe (( _result: boolean ) => {
			
			
			if ( _result ) {
				self.hasFocusShowTool ( true )
				return self.backGroundBlue ( true )
			} 
			
			/*
			if ( self.showMain () ) {
				if ( !self.searchInputText().length ) {
					self.searchInputTextActionShow ( false )
					return self.backGroundBlue ( _result )
				}
				self.searchInputTextActionShow ( true )
				_result = false
				return true
			}
			if ( !_result ) {
				return true
			}
			if ( _result ) {
				if ( !self.showSubViewToolBar ()) {
					self.showSubViewToolBar ( true )
				}
			}
			return true
			*/
			
		})
		
		self.searchInputText.subscribe (( _text: string ) => {
			
			self.searchInputTextActionShow ( _text.length > 0 )
			
		})

		self.SearchInputNextHasFocus.subscribe (( hasFocus: boolean ) => {
			if ( hasFocus ) {
				self.showSearchesRelated ( true )
			}
		})
		
		_view.showIconBar ( false )
		_view.CanadaBackground ( true )
	},

	nextButtonErrorClick: ( self ) => {
		
		self.nextButtonShowError ( false )
		self.nextButtonErrorIndex ( null )
	},

	webItemsClick: ( self, event ) => {
		self.currentlyShowItems ( 0 )
		self.showResultItems ( self, self.searchItemsArray ())
	},

	searchNext: ( self, event ) => {
		const nextLink = self.searchItem().nextPage
		if ( self.moreResultsButtomLoading () || !nextLink ) {
			return
		}

		
		self.moreResultsButtomLoading ( true )
		

		function showError ( err ) {
			self.moreResultsButtomLoading ( false )
			self.nextButtonErrorIndex (  _view.connectInformationMessage.getErrorIndex ( err ))
			self.nextButtonShowError ( true )
			
		}

		

		let currentArray = null
		const com: QTGateAPIRequestCommand = {
			command: 'CoSearch',
			Args: [ 'google', nextLink ],
			error: null,
			subCom: null
		}

		switch ( self.currentlyShowItems ()) {
			  //      google search
			case 0: {
				com.subCom = 'searchNext'
				currentArray = self.searchItemsArray()
				break
			}
			//      news
			case 1: {
				com.subCom = 'newsNext'
				currentArray = self.newsItemsArray()
				break
			}

			case 2: {
				com.subCom = 'imageSearchNext'
				currentArray = self.imageSearchItemArray()
				break
			}

			default: {
				com.subCom = 'videoNext'
				currentArray = self.videoItemsArray()
				break
			}
		}

		/** */
		
		
		return _view.keyPairCalss.emitRequest ( com, ( err, com: QTGateAPIRequestCommand ) => {
			
			if ( err ) {
				return showError ( err )
			}

			if ( !com ) {
				return self.nextButtonLoadingGetResponse ( true )
			}

			if ( com.error === -1 ) {
				self.nextButtonLoadingGetResponse ( false )
				return self.nextButtonConetResponse ( true )
			}

			if ( com.error ) {
				return showError ( com.error  )
			}
			self.moreResultsButtomLoading ( false )
			self.nextButtonLoadingGetResponse ( false )
			self.nextButtonConetResponse ( false )
			const args = com.Args
			self.returnSearchResultItemsInit ( args.param )
			currentArray.Result.push ( ...args.param.Result )
			currentArray.nextPage = args.param.nextPage
			return self.showResultItems ( self, currentArray )

		})
		
	},

	createNewsResult: ( self, newsResult ) => {
		const newsItems = JSON.parse ( JSON.stringify ( self.searchItemsArray ()))
		newsItems.Result = newsResult.Result
		newsItems.nextPage = newsResult.nextPage
		newsItems.totalResults = newsResult.totalResults
		return newsItems
	},

	newsButtonClick: ( self, event ) => {

		if ( self.newsButtonShowLoading ()) {
			return 
		}
		
		if ( self.newsButtonShowError ()) {
			self.newsButtonShowError( false )
			return self.newsButtonErrorIndex ( null )
		}

		self.newsButtonShowLoading ( true )

		const errorProcess = ( err ) => {
			self.newsButtonShowLoading ( false )
			self.newsLoadingGetResponse ( false )
			self.newsConetResponse ( false )
			self.newsButtonErrorIndex ( _view.connectInformationMessage.getErrorIndex( err ))
			return self.newsButtonShowError ( true )
		}
		if ( ! self.newsItemsArray() ) {

			if ( !self.searchItemsArray().action || !self.searchItemsArray().action.news ) {
				return errorProcess ('invalidRequest')
			}
			


			const com: QTGateAPIRequestCommand = {
				command: 'CoSearch',
				Args: [ 'google', self.searchItemsArray().action.news ],
				error: null,
				subCom: 'newsNext'
			}

			return _view.keyPairCalss.emitRequest ( com,( err, com: QTGateAPIRequestCommand ) => {
			
				if ( err ) {

					return errorProcess ( err )
				}
	
				if ( !com ) {
					return self.newsLoadingGetResponse ( true )
				}
	
				if ( com.error === -1 ) {
					self.newsLoadingGetResponse ( false )
					return self.newsConetResponse ( true )
				}
	
				if ( com.error ) {
					return errorProcess ( com.error  )
				}


				self.newsButtonShowLoading ( false )
				self.newsConetResponse ( false )
				self.newsLoadingGetResponse ( false )

				const args = com.Args
				self.newsItemsArray ( self.createNewsResult( self, args.param ))
				self.returnSearchResultItemsInit ( self.newsItemsArray () )
	
			})

		}

		self.currentlyShowItems(1)
		self.newsButtonShowLoading ( false )
		return self.showResultItems ( self, self.newsItemsArray() )

	},

	imageButtonClick: ( self, event ) => {

		if ( self.imageButtonShowLoading ()) {
			return 
		}
		
		if ( self.imageButtonShowError ()) {
			self.imageButtonShowError ( false )
			return self.imageButtonErrorIndex ( null )
		}

		const errorProcess = ( err ) => {
			self.imageButtonShowLoading ( false )
			self.imageLoadingGetResponse ( false )
			self.imageConetResponse ( false )
			self.imageButtonErrorIndex ( _view.connectInformationMessage.getErrorIndex( err ))
			return self.imageButtonShowError ( true )
		}

		if ( ! self.imageItemsArray() ) {
			const imageLink =  self.searchItemsArray() && self.searchItemsArray().action && self.searchItemsArray().action.image ? self.searchItemsArray().action.image : self.imageSearchItemArray().searchesRelated[1]
			const com: QTGateAPIRequestCommand = {
				command: 'CoSearch',
				Args: [ 'google', imageLink ],
				error: null,
				subCom: 'imageNext'
			}
			self.imageButtonShowLoading ( true )
			
			
			return _view.keyPairCalss.emitRequest ( com,( err, com: QTGateAPIRequestCommand ) => {
				
				if ( err ) {
					return errorProcess ( err )
				}

				if ( !com ) {
					self.imageConetResponse ( false )
					return self.imageLoadingGetResponse ( true )
				}

				if ( com.error === -1 ) {
					self.imageLoadingGetResponse ( false )
					return self.imageConetResponse ( true )
				}
				const args = com.Args

				if ( com.error ) {
					return errorProcess ( com.error )
				}

				if ( !args.param || !args.param.Result || !args.param.Result.length ) {
					return errorProcess ( 'timeOut' )
				}

				self.imageButtonShowLoading ( false )
				self.imageConetResponse ( false )
				self.imageLoadingGetResponse ( false )

				
				self.imageItemsArray ( args.param )
				self.returnSearchResultItemsInit ( self.imageItemsArray () )

			})
			/** */

		}


		
		self.searchSimilarImagesList( self.imageItemsArray().Result  )
		self.showMain ( false )
		self.showSearchSimilarImagesResult ( true )
		
	},

	getSnapshotClick: ( self, index ) => {
		const currentItem = self.searchItemList()[ index ]
		currentItem.showLoading ( true )
		const showError = err => {
			currentItem.showLoading ( false )
			currentItem.loadingGetResponse ( false )
			currentItem.conetResponse ( false )
			currentItem.errorIndex ( _view.connectInformationMessage.getErrorIndex ( err ))
			currentItem.showError ( true )
			const currentElm = $(`#${ currentItem.id }`)
			return currentElm.popup ({
				on: 'click',
				inline: true,
				onHidden: function () {
					currentItem.showError ( false )
					currentItem.errorIndex ( null )
					
				}
			})
		}

		const callBack = ( err?, com?: QTGateAPIRequestCommand ) => {
			if ( err ) {
				return showError ( err )
			}
			if ( !com ) {
				currentItem.loadingGetResponse ( true )
				return currentItem.conetResponse ( false )
			}
			if ( com.error === -1 ) {
				currentItem.loadingGetResponse ( false )
				return currentItem.conetResponse ( true )
			}
			if ( com.error ) {
				return showError ( com.error )
			}
			
			const arg: string = com.Args[0]
			currentItem.snapshotUuid = arg.split(',')[0].split ('.')[0]
			return _view.connectInformationMessage.sockEmit ( 'getFilesFromImap', arg, ( err, buffer: string ) => {
				if ( err ) {
					return showError ( err )
				}
				return _view.keyPairCalss.decryptMessageToZipStream ( buffer, ( err, data ) => {
					if ( err ) {
						return showError ( err )
					}
					currentItem.snapshotReady ( true )
					currentItem.showLoading ( false )
					currentItem.loadingGetResponse ( false )
					currentItem.conetResponse ( false )
					return currentItem.snapshotData = buffer
					
				})

				
			})
			
			
		}

		const url = currentItem.url
		const width = $(window).width()
		const height = $(window).height()
		
		const com: QTGateAPIRequestCommand = {
			command: 'CoSearch',
			Args: [ url, width, height ],
			error: null,
			subCom: 'getSnapshop'
		}

		return _view.keyPairCalss.emitRequest ( com, callBack )
	},

	showSnapshotClick: ( self, index ) => {
		self.showMain ( false )
		self.showSnapshop ( true )
		const currentItem = self.searchItemList()[ index ]
		let y = null
		

		self.showWebPage ( y = new showWebPageClass ( currentItem.url, currentItem.snapshotData, currentItem.snapshotUuid , () => {
			self.showWebPage ( y = null )
			self.showMain ( true )
			self.showSnapshop ( false )
			
		}))
	},

	searchesRelatedSelect: ( self, index ) => {

		self.searchInputText ( self.searchItem().searchesRelated[index].text )
		self.showSearchesRelated ( false )
	},

	closeSimilarImagesResult: ( self ) => {
		self.searchSimilarImagesList ([])
		self.showMain ( true )
		self.showSearchSimilarImagesResult ( false )
	},

	videoButtonClick: ( self ) => {

		if ( self.videoButtonShowLoading ()) {
			return 
		}
		
		if ( self.videoButtonShowError ()) {
			self.videoButtonShowError ( false )
			return self.imageButtonErrorIndex ( null )
		}

		const errorProcess = ( err ) => {
			self.videoButtonShowLoading ( false )
			self.videoLoadingGetResponse ( false )
			self.videoConetResponse ( false )
			self.videoButtonErrorIndex ( _view.connectInformationMessage.getErrorIndex ( err ))
			return self.videoButtonShowError ( true )
		}

		if ( ! self.videoItemsArray() ) {

			if ( !self.searchItemsArray().action || !self.searchItemsArray().action.video ) {
				return errorProcess ('invalidRequest')
			}

			const com: QTGateAPIRequestCommand = {
				command: 'CoSearch',
				Args: [ 'google', self.searchItemsArray().action.video ],
				error: null,
				subCom: 'videoNext'
			}

			self.videoButtonShowLoading ( true )
			
			
			return _view.keyPairCalss.emitRequest ( com,( err, com: QTGateAPIRequestCommand ) => {
				
				if ( err ) {
					return errorProcess ( err )
				}

				if ( !com ) {
					self.videoConetResponse ( false )
					return self.videoLoadingGetResponse ( true )
				}

				if ( com.error === -1 ) {
					self.videoLoadingGetResponse ( false )
					return self.videoConetResponse ( true )
				}

				if ( com.error ) {
					return errorProcess ( com.error  )
				}


				self.videoButtonShowLoading ( false )
				self.videoLoadingGetResponse ( false )
				self.videoConetResponse ( false )

				const args = com.Args
				self.videoItemsArray ( self.createNewsResult( self, args.param ))
				self.returnSearchResultItemsInit ( self.videoItemsArray () )

			})
			/** */

		
		}
		self.currentlyShowItems(3)
		
		return self.showResultItems ( self, self.videoItemsArray() )

	},

	getPictureBase64MaxSize_mediaData: ( mediaData: string, imageMaxWidth: number, imageMaxHeight: number, CallBack ) => {
		
		const media = mediaData.split(',')
		const type = media[0].split(';')[0].split (':')[1]
		const _media = Buffer.from ( media[1], 'base64')
		
		const ret: twitter_mediaData = {
			total_bytes: media[1].length,
			media_type: 'image/png',
			rawData: media[1],
			media_id_string: null
		}
		
		
		//if ( mediaData.length > maxImageLength) {
		const exportImage = ( _type, img ) => {
			return img.getBuffer ( _type, ( err, _buf: Buffer ) => {
				if ( err ) {
					return CallBack ( err )
				}
				ret.rawData = _buf.toString( 'base64' )
				ret.total_bytes = _buf.length

				return CallBack ( null, ret )
			})
		}

		return Jimp.read ( _media, ( err, image ) => {
			if ( err ) {
				return CallBack ( err )
			}
			const uu = image.bitmap

			if ( uu.height +  uu.width > imageMaxHeight + imageMaxWidth ) {
				if ( uu.height > uu.widt ) {
					image.resize ( Jimp.AUTO, imageMaxHeight )
				} else {
					image.resize ( imageMaxWidth, Jimp.AUTO )
				}
			
			}
			//		to PNG

			return image.deflateStrategy ( 2, () => {
				return exportImage ( ret.media_type, image )
			})
			

		})
		//}
		
		//return CallBack ( null, ret )
		
	},

	imageSearch: ( ee ) => {
		
			
			const self = _view.appsManager().appScript()

			const errorProcess = ( err ) => {
				self.showInputLoading ( false )
				self.searchInputText ( '' )
				self.errorMessageIndex ( _view.connectInformationMessage.getErrorIndex( err ))
				return self.showSearchError ( true )
			}

			const showItems = ( iResult ) => {
				self.showInputLoading ( false )
				self.currentlyShowItems ( 2 )
				self.returnSearchResultItemsInit ( iResult )
				self.imageSearchItemArray ( iResult )
				self.searchInputText ( iResult.searchesRelated[0])
				self.showResultItems ( self, self.imageSearchItemArray ())
			}

			if ( !ee || !ee.files || !ee.files.length ) {
				return
			}

			const file = ee.files[0]

			if ( !file || !file.type.match ( /^image.(png$|jpg$|jpeg$|gif$)/ )) {
				return
			}
			const reader = new FileReader()

			reader.onload = e => {
				
				const rawData = reader.result.toString()
				self.showInputLoading ( true )
				self.searchInputText (' ')
				self.searchItem ( null )
				
				self.searchItemList ([])

				return self.getPictureBase64MaxSize_mediaData ( rawData, 1024, 1024, ( err, data ) => {
					if ( err ) {
						return errorProcess ( err )
					}

					const uuid = uuid_generate() + '.png'

					return _view.keyPairCalss.encrypt ( data.rawData, ( err, textData ) => {

						if ( err ) {
							return errorProcess ( err )
						}
						self.initSearchData ( self )

						return _view.connectInformationMessage.sockEmit ( 'sendMedia', uuid, textData, err => {

							if ( err ) {
								return errorProcess ( err )
							}
	
							const com: QTGateAPIRequestCommand = {
								command: 'CoSearch',
								Args: [ 'google', uuid ],
								error: null,
								subCom: 'imageSearch'
							}
							
							return _view.keyPairCalss.emitRequest ( com, ( err, com: QTGateAPIRequestCommand ) => {

								if ( err ) {
									return errorProcess ( err )
								}

								if ( !com ) {
									return self.loadingGetResponse ( true )
								}

								if ( com.error === -1 ) {
									self.loadingGetResponse ( false )
									return self.conetResponse ( true )
								}
				
				
								if ( com.error ) {
									return errorProcess ( com.error  )
								}

								_view.CanadaBackground ( false )
								self.showMainSearchForm( false )
								return showItems ( com.Args.param )
				
							})
						})
						
					})
					
				})
				
			}

			if ( !_view.CanadaBackground ()) {
				_view.CanadaBackground ( true )
			}
			if ( !self.showMainSearchForm()) {
				self.showMainSearchForm( true )
			}
			return reader.readAsDataURL ( file )
		
	},

	imagesResultClick: ( self, index: number, image: string ) => {
		const _img = self.searchSimilarImagesList ()[ index ]
		const currentElm = $(`#${ _img.id }-1`)
		/**
		 * 
		 * 			get web side
		 * 
		 */
		
		if ( _img.showError()) {
			return _img.showError ( false )
		}

		if ( _img.showImageError ()) {
			return _img.showImageError ( false )
		}

		if ( image === 'link' ) {
			if ( _img.showLoading() ) {
				return
			}
			const url = _img.webUrlHref

			if ( _img['snapshotData'] ) {
				self.showMain ( false )
				self.showSnapshop ( true )
				self.showSearchSimilarImagesResult  ( false )

				let y = null
				

				return self.showWebPage ( y = new showWebPageClass ( url, _img['snapshotData'], _img['snapshotUuid'] , () => {
					self.showWebPage ( y = null )
					self.showMain ( true )
					self.showSnapshop ( false )
					self.showSearchSimilarImagesResult  ( true )
				}))
			}

			const errorProcess = ( err ) => {
				_img.errorIndex ( _view.connectInformationMessage.getErrorIndex( err ))
				_img.showLoading ( false )
				_img.snapshotReady ( false )
				_img.loadingGetResponse ( false )
				_img.conetResponse ( false )
				
				const currentElm = $(`#${ _img.id }`)
				currentElm.popup ({
					on: 'click',
					inline: true,
					onHidden: function () {
						_img.showError ( false )
						_img.errorIndex ( null )
						
					}
				})
				return _img.showError ( true )
			}

			
			
			
			_img.showLoading ( true )

			const callBack = ( err?, com?: QTGateAPIRequestCommand ) => {
				if ( err ) {
					return errorProcess ( err )
				}
				if ( !com ) {
					_img.loadingGetResponse ( true )
					return _img.conetResponse ( false )
				}
				if ( com.error === -1 ) {
					_img.loadingGetResponse ( false )
					return _img.conetResponse ( true )
				}
				if ( com.error ) {
					return errorProcess ( com.error )
				}
				
				const arg: string = com.Args[0]
				_img['snapshotUuid'] = arg.split(',')[0].split ('.')[0]
				return _view.connectInformationMessage.sockEmit ( 'getFilesFromImap', arg, ( err, buffer: string ) => {
					if ( err ) {
						return errorProcess ( err )
					}

					return _view.keyPairCalss.decryptMessageToZipStream ( buffer, ( err, data ) => {
						if ( err ) {
							return errorProcess ( err )
						}

						_img.snapshotReady ( true )
						_img.showLoading ( false )
						_img.loadingGetResponse ( false )
						_img.conetResponse ( false )
						return _img['snapshotData'] = buffer
						
					})
	
					
				})
				
				
			}
	
			
			const width = $(window).width()
			const height = $(window).height()
			
			const com: QTGateAPIRequestCommand = {
				command: 'CoSearch',
				Args: [ url, width, height ],
				error: null,
				subCom: 'getSnapshop'
			}
	
			return _view.keyPairCalss.emitRequest ( com, callBack )
		}



		/**
		 * n['showImageLoading'] = ko.observable ( false )
			n['snapshotImageReady'] = ko.observable ( false )
			n['loadingImageGetResponse'] = ko.observable ( false )
			n['conetImageResponse'] = ko.observable ( false )
			n['showImageError'] = ko.observable ( false )
			n['imageErrorIndex'] = ko.observable (-1)
		 */
		if ( image === 'img') {
			if ( _img.showImageLoading() ) {
				return 
			}
			if ( _img['imgOriginalData'] ) {
				const uu = 1
				return
			}

			const errorProcess = ( err ) => {
				_img.imageErrorIndex (_view.connectInformationMessage.getErrorIndex( err ))
				
				_img.showImageLoading ( false )
				_img.snapshotImageReady ( false )
				_img.loadingImageGetResponse ( false )
				_img.conetImageResponse ( false )
				_img.showImageError ( true )
				
				currentElm.popup ({	
					inline: true,
					onHidden: function () {
						_img.showImageError ( false )
						
					}
				})
				return
			}

			const callBack = ( err?, com?: QTGateAPIRequestCommand ) => {
				if ( err ) {
					return errorProcess ( err )
				}
				if ( !com ) {
					_img.loadingGetResponse ( true )
					return _img.conetResponse ( false )
				}
				if ( com.error === -1 ) {
					_img.loadingGetResponse ( false )
					return _img.conetResponse ( true )
				}
				if ( com.error ) {
					return errorProcess ( com.error )
				}
				
				const arg: string = com.Args[0]
				_img['snapshotUuid'] = arg.split(',')[0].split ('.')[0]
				return _view.connectInformationMessage.sockEmit ( 'getFilesFromImap', arg, ( err, buffer: string ) => {
					if ( err ) {
						return errorProcess ( err )
					}

					return _view.keyPairCalss.decryptMessageToZipStream ( buffer, ( err, data ) => {
						if ( err ) {
							return errorProcess ( err )
						}

						_img.snapshotReady ( true )
						_img.showLoading ( false )
						_img.loadingGetResponse ( false )
						_img.conetResponse ( false )
						return _img['snapshotData'] = buffer
						
					})
	
					
				})
				
				
			}

			const com: QTGateAPIRequestCommand = {
				command: 'CoSearch',
				Args: [ _img.imgUrlHref ],
				error: null,
				subCom: 'getFile'
			}
	
			return _view.keyPairCalss.emitRequest ( com, callBack )


			setTimeout (() => {
				_img.loadingImageGetResponse ( true )
				setTimeout (() => {
					_img.loadingImageGetResponse ( false )
					_img.conetImageResponse ( true )
					setTimeout (() => {
						_img.loadingImageGetResponse ( false )
						_img.conetImageResponse ( false )
						_img.snapshotImageReady ( true )
						_img.showImageLoading ( false )
					}, 1000 )
				}, 1000 )
			}, 1000 )

			_img.showImageLoading ( true )

		}


		
	}


}

declare const TimelineMax


================================================
FILE: app/public/scripts/appsManager.js
================================================
const _mainMenuObj111 = {
    nodeName: ['CoNET官方节点', 'CoNET公式パブリックノード', 'CoNET official public node', 'CoNET官方節點'],
    nodeAddress: 'QTGate@CoNETTech.ca',
    mainMenuItem: [
        /*
        , {
            imgSrc: 'data:image/png;base64,',
            headerText: ['','','',''],

            headerTextColor: '',
            textColor: '',
            meta: ['','','',''],
            description: [
                '','','',''
            ],
            extra: [
                '','','',''
            ]
            
        },
        */
        {
            imgSrc: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACgCAIAAAA5GsY1AAAMSWlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnltSSWiBCEgJvQlSpEsJoUUQkCrYCEkgocSQEETsLosKrl1EwIauiiju6grIWlHXugh21/JQFpWVdbFgQ+VNCui633vve+f75t4/Z875T8nce2cA0KnlSaV5qC4A+ZJCWUJkKGtyWjqL1A1wYATIwBVo8/hyKTs+PgZAGb7/XV7fAIjyftVFyfXP+f8qegKhnA8AEg9xpkDOz4f4JwDwUr5UVggA0RfqrWcVSpV4KsQGMpggxFIlzlbjUiXOVOMqlU1SAgfivQCQaTyeLBsA7RaoZxXxsyGP9i2I3SQCsQQAHTLEQXwRTwBxFMRj8vNnKjG0Aw6ZX/Bk/40zc4STx8sewepaVEIOE8ulebzZ/2c7/rfk5ymGY9jBQRPJohKUNcO+3cqdGa3ENIj7JJmxcRDrQ/xWLFDZQ4xSRYqoZLU9asqXc2DPABNiNwEvLBpiU4gjJHmxMRp9ZpY4ggsxXCFosbiQm6TxXSqUhydqOGtlMxPihnGWjMPW+DbyZKq4SvvTitxktob/lkjIHeZ/VSJKSlXnjFGLxCmxEGtDzJTnJkarbTCbEhEndthGpkhQ5m8Dsb9QEhmq5semZ8kiEjT2snz5cL3YUpGYG6vB1YWipCgNz14+T5W/EcQtQgk7eZhHKJ8cM1yLQBgWrq4d6xBKkjX1Yl3SwtAEje8LaV68xh6nCvMilXoriE3lRYkaXzyoEC5INT8eKy2MT1LniWfm8CbEq/PBi0EM4IAwwAIKODLBTJADxO19zX3wl3omAvCADGQDIXDRaIY9UlUzEnhNBCXgT4iEQD7iF6qaFYIiqP84olVfXUCWarZI5ZELHkGcD6JBHvytUHlJRqKlgN+hRvyP6HyYax4cyrl/6thQE6PRKIZ5WTrDlsRwYhgxihhBdMRN8CA8AI+B1xA4PHBf3G8428/2hEeETsJDwnVCF+H2DPFi2Vf1sMBE0AUjRGhqzvyyZtwOsnrhoXgg5IfcOBM3AS74OBiJjQfD2F5Qy9Fkrqz+a+6/1fBF1zV2FDcKShlFCaE4fO2p7aTtNcKi7OmXHVLnmjnSV87IzNfxOV90WgDv0V9bYkuxg9hZ7CR2HjuCNQMWdhxrwS5hR5V4ZBX9rlpFw9ESVPnkQh7xP+LxNDGVnZS7Nbj1un1QzxUKi5XvR8CZKZ0tE2eLClls+OYXsrgSvusYloebux8Ayu+I+jX1kqn6PiDMC591BScA8CuHyuzPOp41AIcfAcB4/Vln/QI+HqsAONrBV8iK1DpceSEAKtCBT5QxMAfWwAHW4wG8QQAIAeFgAogDSSANTIddFsH1LAOzwFywCJSBCrAKrAfVYAvYDnaDfeAAaAZHwEnwC7gIOsB1cAeunh7wFPSD12AQQRASQkcYiDFigdgizogH4osEIeFIDJKApCEZSDYiQRTIXOQbpAJZg1Qj25B65EfkMHISOY90IreRB0gv8gJ5j2IoDTVAzVA7dCzqi7LRaDQJnYZmowVoCVqKrkCr0Dp0L9qEnkQvotfRLvQpOoABTAtjYpaYC+aLcbA4LB3LwmTYfKwcq8TqsEasFf7PV7EurA97hxNxBs7CXeAKjsKTcT5egM/Hl+PV+G68CT+NX8Uf4P34JwKdYEpwJvgTuITJhGzCLEIZoZKwk3CIcAY+TT2E10QikUm0J/rApzGNmEOcQ1xO3ETcTzxB7CR2EwdIJJIxyZkUSIoj8UiFpDLSRtJe0nHSFVIP6S1Zi2xB9iBHkNPJEvJiciV5D/kY+Qr5MXmQokuxpfhT4igCymzKSsoOSivlMqWHMkjVo9pTA6lJ1BzqImoVtZF6hnqX+lJLS8tKy09rkpZYa6FWldYPWue0Hmi9o+nTnGgc2lSagraCtot2gnab9pJOp9vRQ+jp9EL6Cno9/RT9Pv2tNkPbVZurLdBeoF2j3aR9RfuZDkXHVoetM12nRKdS56DOZZ0+XYqunS5Hl6c7X7dG97DuTd0BPYaeu16cXr7ecr09euf1nuiT9O30w/UF+qX62/VP6XczMIY1g8PgM75h7GCcYfQYEA3sDbgGOQYVBvsM2g36DfUNxxmmGBYb1hgeNexiYkw7JpeZx1zJPMC8wXw/ymwUe5Rw1LJRjaOujHpjNNooxEhoVG603+i60XtjlnG4ca7xauNm43smuImTySSTWSabTc6Y9I02GB0wmj+6fPSB0b+ZoqZOpgmmc0y3m14yHTAzN4s0k5ptNDtl1mfONA8xzzFfZ37MvNeCYRFkIbZYZ3Hc4g+WIYvNymNVsU6z+i1NLaMsFZbbLNstB63srZKtFlvtt7pnTbX2tc6yXmfdZt1vY2Ez0WauTYPNb7YUW19bke0G27O2b+zs7VLtltg12z2xN7Ln2pfYN9jfdaA7BDsUONQ5XHMkOvo65jpucuxwQp28nERONU6XnVFnb2ex8ybnzjGEMX5jJGPqxtx0obmwXYpcGlweuDJdY1wXuza7PhtrMzZ97OqxZ8d+cvNyy3Pb4XbHXd99gvti91b3Fx5OHnyPGo9rnnTPCM8Fni2ez8c5jxOO2zzulhfDa6LXEq82r4/ePt4y70bvXh8bnwyfWp+bvga+8b7Lfc/5EfxC/Rb4HfF75+/tX+h/wP+vAJeA3IA9AU/G248Xjt8xvjvQKpAXuC2wK4gVlBG0Nagr2DKYF1wX/DDEOkQQsjPkMduRncPey34W6hYqCz0U+objz5nHORGGhUWGlYe1h+uHJ4dXh9+PsIrIjmiI6I/0ipwTeSKKEBUdtTrqJteMy+fWc/sn+EyYN+F0NC06Mbo6+mGMU4wspnUiOnHCxLUT78baxkpim+NAHDdubdy9ePv4gvifJxEnxU+qmfQowT1hbsLZREbijMQ9ia+TQpNWJt1JdkhWJLel6KRMTalPeZMalromtWvy2MnzJl9MM0kTp7Wkk9JT0nemD0wJn7J+Ss9Ur6llU29Ms59WPO38dJPpedOPztCZwZtxMIOQkZqxJ+MDL45XxxvI5GbWZvbzOfwN/KeCEME6Qa8wULhG+DgrMGtN1pPswOy12b2iYFGlqE/MEVeLn+dE5WzJeZMbl7srdygvNW9/Pjk/I/+wRF+SKzk903xm8cxOqbO0TNpV4F+wvqBfFi3bKUfk0+QthQZww35J4aD4VvGgKKiopujtrJRZB4v1iiXFl2Y7zV42+3FJRMn3c/A5/Dltcy3nLpr7YB573rb5yPzM+W0LrBeULuhZGLlw9yLqotxFvy52W7xm8atvUr9pLTUrXVja/W3ktw1l2mWysptLApZsWYovFS9tX+a5bOOyT+WC8gsVbhWVFR+W85df+M79u6rvhlZkrWhf6b1y8yriKsmqG6uDV+9eo7emZE332olrm9ax1pWve7V+xvrzleMqt2ygblBs6KqKqWrZaLNx1cYP1aLq6zWhNftrTWuX1b7ZJNh0ZXPI5sYtZlsqtrzfKt56a1vktqY6u7rK7cTtRdsf7UjZcfZ73+/rd5rsrNj5cZdkV9fuhN2n633q6/eY7lnZgDYoGnr3Tt3bsS9sX0ujS+O2/cz9FT+AHxQ//PFjxo83DkQfaDvoe7DxJ9ufag8xDpU3IU2zm/qbRc1dLWktnYcnHG5rDWg99LPrz7uOWB6pOWp4dOUx6rHSY0PHS44PnJCe6DuZfbK7bUbbnVOTT107Pel0+5noM+d+ifjl1Fn22ePnAs8dOe9//vAF3wvNF70vNl3yunToV69fD7V7tzdd9rnc0uHX0do5vvPYleArJ6+GXf3lGvfaxeux1ztvJN+4dXPqza5bgltPbufdfv5b0W+DdxbeJdwtv6d7r/K+6f26fzn+a3+Xd9fRB2EPLj1MfHinm9/99Hf57x96Sh/RH1U+tnhc/8TjyZHeiN6OP6b80fNU+nSwr+xPvT9rnzk8++mvkL8u9U/u73kuez70YvlL45e7Xo171TYQP3D/df7rwTflb43f7n7n++7s+9T3jwdnfSB9qPro+LH1U/Snu0P5Q0NSnoyn2gpgcKBZWQC82AUAPQ3uHToAoE5Rn/NUgqjPpioE/hNWnwVV4g3ArhAAkhcCEAP3KJvhsIWYBu/KrXpSCEA9PUeGRuRZnh5qLho88RDeDg29NAOA1ArAR9nQ0OCmoaGPO2CytwE4UaA+XyqFCM8GW62U6FfrJeBr+Td+LX426mUPVAAAAAlwSFlzAAALEwAACxMBAJqcGAAAAgtpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpDb21wcmVzc2lvbj4xPC90aWZmOkNvbXByZXNzaW9uPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpQaG90b21ldHJpY0ludGVycHJldGF0aW9uPjI8L3RpZmY6UGhvdG9tZXRyaWNJbnRlcnByZXRhdGlvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+Cg9FKpMAAEAASURBVHgB7L0HuGVXdtd5z7k5vhyrXkVVUJVUKrXULTo70La7CW5sGAZsMPCZYT4wnzEwNtGMwcN4Po9hPhjMhwH3GIMbu9tg09huy53cSa1WVpWkCqocXk435zu//9rn3vdeqeq9V6UqqdRm16tz99lh7bXWXmuHtcPxfvvKfOg+dp1QyLv/0Ot0QhE/lAj7IXwbXA9feUqtG2I3JH3LXkAiFur4ndb6EgNEwd8Tg/nf8PxWyF+f5qb+aKcd7bTaoY63oWYEz6hVeMMPN0L+lhVHgghwOu2OMhlGDi3PA9f2Bvg3wcWlvUnE/RQEklEvFPehso0fB8s7uKZ42Gq2Ws2GmL4lsyzvPXw45G5awNuO2xuxAlu0LxH2xEuijan65R+iZGHIVD3g+RsBvNUhkVDbDyHoXTYbwmIsHtNAPC1p4NbMJkU41O5qYADQfoK8fshre/52NJBcYfEMZ+rMs+vAZEsNJO1ahm7G++1XNKKBiIvQBV9DmVDoVqPTcY2eonl7e939z80b+BPzPXgosXZyzFtXlMRrGnLPq7/tbDWkvVA7jKfdFpMdwogCSOJ3TiT4TcnH1vUQ6zR9y2iZg/T88MofQPnf9LbuAyk5DMcsm9PBoHADYcAD7N7pPxGYrYYGUXEkShdFoCRIPvr8rYcf94IL71wuw0xGFxGkGhnCGXekgeaVPBtza00T+nvBu9uEGZGsq5MDxUAMHAQQdujTZPj+dnoev9NGA9umrFIW02NXlfDBWOE1vMh2elRQcN0g2SSUDoo9ab/c220Set8lhygaa/5MVByDrOX20LpAJ6G98XYpoVXYjVy7/1kPhpoKMr7vap2jQYoHy00F6QXqrfb9MRmUfKu+5aRw3f8WQLDFtH2/uUE7LfYND7LHmKaZLJHc5RDMbkrUEk1urAV0Izb+uvRMBVW6vTj8hE3QUmzM8I59QxJor5nwikrTPlEakOzYEGowEeh03p6e8KaMDfC6adx9Eih7jDoQehVhJM0z53TSGvVmO4QGungX+bY9rdMWomAZ/Alf57V+UXi3JCRb8J4sTCxpaYyWIIN7cSEGkx41vC7QYt7wIAHdqUAFmEn1zK/3DbajN+R9BwVAH8YYtAsO+8wJw3KemxxChokKRoO6NWsMrP6H2xYHYGs07EU8bAZOfqRqgfAGv2JtrYXdwhJsC+o9TBSjreh1yUi6tRTogJC1fgj7JfM311JvggdZNAJvoyDKbS1MAMZySZ8A3/LCTCwldpvAsig3GDMeOf7xFE50pE4dtwLwDohnxIRJhoFoq94uN1uZUGul1Yl1vHgmLuyN/7IaSGQ6/0MJt1ujCBrje+OgiZlTPCeBcJVBhefV2jLeu5jtwr0H6cAvwvxNMmDibQi5yaq6HRN/sCRWDfFWDp1BA9EP17gYC6QzpnvKrJeQ9Bm/sWYziLLHuPguInpTCxFiNrhZzndUXDysoQbjfH++NBoN9y1eS8TS0w3P2zcai/gilm5f1YMzxr2jqNsM2S0lYLPMm8YB2SyiSCIWFyvHOIjP/iRYeBr3gQZCB9rA6NENlt3TEdcbT9LlMEpqepHNex6nE1G3lCdlQ66MdnsayaaKiFQ4CumbslB5QKw7Rw2aApcFbJwObw7hHRELR0xURC+iko40d3YqqfzsrnCnv1UmhKZGA9E1RsrOd2+doXJvi+hB30IKeulu0wNbGV3EpHwSWpO7AES37baB6P2xMAjDNX/TYrf6ZBvvgLJ5uuiCPY00iW7FMcLJwh8642sgKtpJ7tK7PpBYK4E1iXDDXhRwa9ctCw5aW0UWsVSIfcv0gZAjUdEgRC0OjJouNeaL1R3hzLnlRqFUm7BJQV0r92q4XQXccyV01dmtgFtX0X0cg+hpx4PxFLFxksjPGlEyb3Tuh24QJFkVZMiHW4fgOq/xecv1dOA4F2Ugas1ON2CtPp0GkZI1CZ5r3OgmveGXNQmTy3WIOW3eAP+GTO+kV7GGbpDRpikYPMGMl9k5yJxwKTwRqzcno5FYNFJvySLq+GjkvSVzwi2rZ5Mq3CTqzdTPNsE6TmGWQLLFOOldVybXdYi0ajWMjFvS+WYw3l5epDzK3Ep28QAbJxAB2gJCRGeTPrBXjmRIaiNW9SgzvvVeNa1shSPYY3oJetlv8JAS3HCkhHNMrq0jUMi3TDdI78dUEFGBS3LWEEaTsX4L6U/G23SAbYmKIjVnDJLek57QqkpobNNtUoWbRG0T+E2TbRMshCA6sTDrrQiay+SGdsGrk6cm3DXxumlZbybwdjnJnjJmrT0NpGihrdo2VTJPOxyxZQkLvPUDYYrZksF6HHqwXL42czkK24qbQABaIHFOD90bgsgEaetO1JV2vz9ZgNDCoATEnDGG9tDsY2p6iGS4ZPyEcjOKiXX3xjCzVaUESL4jfmjbxLYeZ8W0gD6mSVhEadeYZN8jkm8LLOO9cG9NostcVbnsKSYZBq7R64O6aW76G+k0tUvUdIan5sNOfoLOTHCbfmQ7/Rga6LpBFWSIOJEE0ja31yjjfe+S4XCPN106+Q1aKaSGuXUdKpxABSnEjjXm3Pc0vtUIIreYudBBuUAbJIqOZTbMY7NyiGWJ21KVe0QGOKgblGoYOmCviYfqWArYbTgwQjot2AQNEjAQZWJpZCs5/9mZ7bigd/m0F25bA1HNUUHM8vGgRRAkoeZWHg3eO/sBWVEbcqxndUCycd5VSs06P+OecQA+mOy8pUro6m87/N5+yu1Au7M0cA9Ll9gqp96Ep6RPr2reSMDoQvtjFPI2OwxyWoEw4RbSGunpLIItS9j0A3upF+a0xJaIkkIbOwOnvJIWARUzRKx4gQZKn7ekPWCYcjmYhiZvbKrcOncXi/v4F6rgWFSz5/XNMYwxVolqhSMq0sGuSQYudI3Td2/bmmPw5rzassJ62befspflrnvctiPAulG+00JxtCuKqF/D5l/bof2uo7ceIDrDal6AKryTKqrijY28mPlSarMtx3FBtywhgN0ceIIlCpHvN/0oA1EguwTdsrqp7VfpXI8aJDKpAzHDqNsrbMhyw4vLd0Pg/fYK7VqaB60A3e6PNTqOWPp8VnGUhqognuRqHl3QNtrFbdJsBdyY9h3BxBuRlprZRq2gG1SvojSOnfpxr6Fqd8vDGyHcKqTHkJ7nVilvK5zRo5v+CzMHGiQhw6pZATb7CsTgFqBdDWpiaaPHAIwAOgAuXqDoxJAq3l0Q0U0OqQoFFe7C3TMY+1o6A6NoADStl74FImvBDv7a+/3ng6gocxaHWI9C2GBtjWu+iWTOYrzpcodYl9ie98Q62uPV/c/EHqrrPcwDtUPNTKJwSYaNQN7grSQSe4wWu7vquT5vz2/tnBiwngk9f8/TS78dj8oOepK15CzNS08QbqEpwPo1PN2rhfhbDkQFnGHVhgP4grQGs6tiqJBFhFzXGmcdldbcFktrKBiUd9g56dE5qx1zSQPUKIGJtPbffms4t4sjoNK1zq7VCppqMU9zFk0MrOuDG/ypwhSiaM3A/4fbyAG4EzcrhLErMG2RBGmCa8Y0ydAmC4OOyeKy9kUom0KM6U73HBQL2+xhuTSqFBAS2jtF84aI27li2TxkjwkKCKA5DQxQJ0oHbYWzK/1WRZIwxjZs9WfSPMmJkxtHczebbdTWxBJlG/LDo5FwouNFHQI+R5k6xU57pdPOt9vayi48ndRZ8dZsbXNU3C3w/v2FQyzHwx6rHvA0zpm9QC8mMDTWMt11We88xLgEluctWaynpBucQ/aGwPvhFW6yKuj2v8Mv1+AbN9VmObbCP9j6Rpl2yZrtdr3B/SGmfhqVdDh4EY9gvOZIS5jasAMuAa234oNE2iq22W4BDJh6s5WlWDhMxdOtdXycZ2sSHc+XVjj0lNGqutcZogr8kUJgb+0YiLLtG11xAuN+ELHuGJOcinEnBkm3xw8PI0xc42GnhkkJw2KeN+KFh0N+zWut+KH5ULvS1iJhoIrgIICuhFujch/E3Kpqeqg5UZHpjspRo+WI6uazWiAIq4GrEMd8nryaC5hAxrenJ7xvKwE5MjPXep6a+gWiqRaMhpzm7QYS4DTcrtQbsVBoMhEbiEeTYU4JdUqN5mypMlMuJ6Mxv9X20EYtJqkfoyZuANKrYDzUVLnZTHQ6U8lYLhqlaUCx8/XG9WI5X2umojEO42oNk6YBXexWudMzjXukEdZs6HyD5ixB1a8vY6M/smEgSpzrwE3AgpTM5SJA5ijqDs8fxzoa9VqtTrNOR+t5EVoC7djqUFynE++Exr3wYCi85LVmQ+2aTbOBteWp341IvW1vm1QNOMFMm7OYT62PwrqVYJy2QAYLMp47WIo3x6t8kiXTyLepJ3TI3G9POJO0EygSJJBzctyTXhNsIuqooPHb4W+8D1kH2DiQTR0cyKZi0fWkPdTpnF9ceerabDQajSC2bOCKcHzB1Y30BZ+rJnK5V1bJq43G/kzyyGAuEd3QUB5rtl6enntlaTUbZ/AYakXUyYIV/6y6VdMCHtS4nRjkdT1CLsG6ENLLImpZldei8ODwO
Download .txt
gitextract_mixerr74/

├── .travis.yml
├── LICENSE
├── README.md
├── app/
│   ├── CoNET.d.ts
│   ├── localWebServer.js
│   ├── localWebServer.ts
│   ├── main.js
│   ├── main.ts
│   ├── package.json.npm
│   ├── public/
│   │   ├── css/
│   │   │   ├── c3.css
│   │   │   └── page.css
│   │   └── scripts/
│   │       ├── CanadaSvg.js
│   │       ├── Cleave.js
│   │       ├── CoNETConnect.js
│   │       ├── CoNETConnect.ts
│   │       ├── appCosearch.js
│   │       ├── appCosearch.ts
│   │       ├── appsManager.js
│   │       ├── appsManager.ts
│   │       ├── connectInformationMessage.js
│   │       ├── connectInformationMessage.ts
│   │       ├── encryptoClass.js
│   │       ├── encryptoClass.ts
│   │       ├── home.js
│   │       ├── home.ts
│   │       ├── imapForm.js
│   │       ├── imapForm.ts
│   │       ├── jquery.cookie.js
│   │       ├── keyPairGenerateForm.js
│   │       ├── keyPairGenerateForm.ts
│   │       ├── keyPairPassword.js
│   │       ├── keyPairPassword.ts
│   │       ├── knockout.animate.js
│   │       ├── knockout.js
│   │       ├── showHTMLComplete.js
│   │       ├── showHTMLComplete.ts
│   │       ├── siteShare.js
│   │       ├── siteShare.ts
│   │       └── socket.io.js
│   ├── tools/
│   │   ├── 1231B119.pem
│   │   ├── coNETConnect.js
│   │   ├── coNETConnect.ts
│   │   ├── compress.js
│   │   ├── compress.ts
│   │   ├── imap.js
│   │   ├── imap.ts
│   │   ├── initSystem.js
│   │   └── initSystem.ts
│   └── views/
│       ├── Shared/
│       │   ├── CoNETConnectInfo.pug
│       │   ├── CoSearchLayout.pug
│       │   ├── appHtml.pug
│       │   ├── header.pug
│       │   └── mainMenu.pug
│       ├── home/
│       │   ├── Wrt.pug
│       │   ├── coSearchImage.html
│       │   ├── customProxy.pug
│       │   └── index.pug
│       └── shared/
│           └── coreLayout.pug
├── build/
│   └── icon.icns
├── index.html
├── index.js
├── index.ts
├── package.json
└── tsconfig.json
Download .txt
SYMBOL INDEX (658 symbols across 38 files)

FILE: app/CoNET.d.ts
  type ReadonlyArray (line 19) | interface ReadonlyArray<T> {
  type Map (line 45) | interface Map<K, V> {
  type MapConstructor (line 55) | interface MapConstructor {
  type ReadonlyMap (line 62) | interface ReadonlyMap<K, V> {
  type WeakMap (line 69) | interface WeakMap<K extends object, V> {
  type WeakMapConstructor (line 76) | interface WeakMapConstructor {
  type Set (line 83) | interface Set<T> {
  type SetConstructor (line 92) | interface SetConstructor {
  type ReadonlySet (line 99) | interface ReadonlySet<T> {
  type WeakSet (line 105) | interface WeakSet<T extends object> {
  type WeakSetConstructor (line 111) | interface WeakSetConstructor {
  type imapConnect (line 118) | interface imapConnect {
  type keypair (line 127) | interface keypair {
  type StringValidator (line 149) | interface StringValidator {
  type INewKeyPair (line 152) | interface INewKeyPair {
  type keyPair (line 158) | interface keyPair {
  type imapData (line 163) | interface imapData {
  type requestPoolData (line 167) | interface requestPoolData {
  type regionV1 (line 172) | interface regionV1 {
  type IinputData (line 181) | interface IinputData extends imapConnect {
  type CoPromo (line 203) | interface CoPromo {
  type iTransferData (line 210) | interface iTransferData {
  type multipleGateway (line 235) | interface multipleGateway {
  type QTGate_DnsAddress (line 243) | interface QTGate_DnsAddress {
  type IConnectCommand (line 249) | interface IConnectCommand {
  type QTGateAPIRequestCommand (line 278) | interface QTGateAPIRequestCommand {
  type QTGateCommand (line 294) | interface QTGateCommand {
  type IQTGateRegionsSetup (line 305) | interface IQTGateRegionsSetup {
  type QTGateRegions (line 309) | interface QTGateRegions {
  type domainData (line 329) | interface domainData {
  type dnsAddress (line 333) | interface dnsAddress {
  type VE_IPptpStream1 (line 340) | interface VE_IPptpStream1 {
  type proxyServerInfo (line 353) | interface proxyServerInfo {
  type iQTGatePayment (line 360) | interface iQTGatePayment {
  type twitter_entities_media (line 371) | interface twitter_entities_media {
  type twitter_entities_urls (line 374) | interface twitter_entities_urls {
  type twitter_entities (line 380) | interface twitter_entities {
  type tweetCountSummary (line 386) | interface tweetCountSummary {
  type twitter_post (line 389) | interface twitter_post {
  type twitter_size (line 432) | interface twitter_size {
  type twitter_media_video_info_variants (line 439) | interface twitter_media_video_info_variants {
  type twitter_media_video_info (line 446) | interface twitter_media_video_info {
  type twitter_media (line 453) | interface twitter_media {
  type twitter_extended_entities (line 472) | interface twitter_extended_entities extends twitter_post {
  type twitter_mediaData (line 476) | interface twitter_mediaData {
  type twitter_postData (line 483) | interface twitter_postData {
  type twitter_uploadImageInitData_imageObj (line 493) | interface twitter_uploadImageInitData_imageObj {
  type twitter_uploadImageInitData (line 499) | interface twitter_uploadImageInitData {
  type twitter_uploadImageInitData_status_processing_info (line 507) | interface twitter_uploadImageInitData_status_processing_info {
  type twitter_uploadImageInitData_status (line 518) | interface twitter_uploadImageInitData_status {
  type TwitterAccount (line 525) | interface TwitterAccount {
  type Twitter_verify_credentials (line 533) | interface Twitter_verify_credentials {
  type Titter_status (line 580) | interface Titter_status {
  type twitter_text_parseTweet (line 609) | interface twitter_text_parseTweet {
  type install_config (line 619) | interface install_config {
  type Jimp (line 644) | interface Jimp {
  type Emitter (line 653) | interface Emitter {
  type DateConstructor (line 659) | interface DateConstructor {
  type Date (line 666) | interface Date {
  type coSearch_Object (line 672) | interface coSearch_Object {
  type JQuery (line 679) | interface JQuery<TElement extends Node = HTMLElement> extends Iterable<T...
  type JQueryStatic (line 708) | interface JQueryStatic<TElement extends Node = HTMLElement> {

FILE: app/localWebServer.js
  constant HTTP (line 20) | const HTTP = require("http");
  class localServer (line 79) | class localServer {
    method constructor (line 80) | constructor(cmdResponse, test) {
    method catchCmd (line 135) | catchCmd(mail, uuid) {
    method tryConnectCoNET (line 148) | tryConnectCoNET(socket, sessionHash) {
    method listenAfterPassword (line 166) | listenAfterPassword(socket, sessionHash) {
    method doingCheckImap (line 334) | doingCheckImap(socket) {
    method socketServerConnected (line 358) | socketServerConnected(socket) {

FILE: app/localWebServer.ts
  type localConnect (line 36) | interface localConnect {
  class localServer (line 99) | class localServer {
    method catchCmd (line 122) | private catchCmd ( mail: string, uuid: string ) {
    method tryConnectCoNET (line 138) | private tryConnectCoNET ( socket: SocketIO.Socket, sessionHash: string...
    method listenAfterPassword (line 166) | private listenAfterPassword ( socket: SocketIO.Socket, sessionHash: st...
    method doingCheckImap (line 371) | private doingCheckImap ( socket: SocketIO.Socket ) {
    method socketServerConnected (line 402) | private socketServerConnected ( socket: SocketIO.Socket ) {
    method constructor (line 615) | constructor( private cmdResponse: ( cmd: QTGateAPIRequestCommand ) => ...

FILE: app/public/scripts/Cleave.js
  function t (line 8) | function t(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,lo...

FILE: app/public/scripts/CoNETConnect.js
  class CoNETConnect (line 16) | class CoNETConnect {
    method constructor (line 17) | constructor(email, isKeypairBeSign, confirmRisk, account, ready) {
    method listingConnectStage (line 44) | listingConnectStage(err, stage, publicKeyMessage) {
    method returnToImapSetup (line 126) | returnToImapSetup() {
    method sendConnectMail (line 129) | sendConnectMail() {
    method tryAgain (line 138) | tryAgain() {
    method resetAll (line 143) | resetAll() {
    method imapConform (line 149) | imapConform() {
    method test (line 168) | test() {

FILE: app/public/scripts/CoNETConnect.ts
  type connectInfo (line 17) | interface connectInfo {
  class CoNETConnect (line 22) | class CoNETConnect {
    method constructor (line 36) | constructor ( public email: string, private isKeypairBeSign: boolean, ...
    method listingConnectStage (line 47) | public listingConnectStage ( err, stage, publicKeyMessage ) {
    method returnToImapSetup (line 150) | public returnToImapSetup () {
    method sendConnectMail (line 155) | public sendConnectMail () {
    method tryAgain (line 166) | public tryAgain () {
    method resetAll (line 172) | private resetAll () {
    method imapConform (line 181) | public imapConform () {
    method test (line 207) | private test () {

FILE: app/public/scripts/appCosearch.js
  function showError (line 304) | function showError(err) {

FILE: app/public/scripts/appCosearch.ts
  function showError (line 375) | function showError ( err ) {

FILE: app/public/scripts/appsManager.js
  class appsManager (line 379) | class appsManager {
    method constructor (line 380) | constructor(exit) {
    method getAppMenu (line 412) | getAppMenu() {
    method initMenuArray (line 421) | initMenuArray(mainMenuArray) {
    method showLoadingGetResponse (line 428) | showLoadingGetResponse(item) {
    method showConetResponse (line 432) | showConetResponse(item) {
    method getAppObject (line 436) | getAppObject(mainMenuItem) {
    method updateAppsManu (line 450) | updateAppsManu(_self = null) {
    method mainNemuError (line 520) | mainNemuError() {
    method appClick (line 523) | appClick(appIndex) {

FILE: app/public/scripts/appsManager.ts
  class appsManager (line 389) | class appsManager {
    method getAppMenu (line 421) | private getAppMenu () {
    method initMenuArray (line 431) | private initMenuArray ( mainMenuArray ) {
    method showLoadingGetResponse (line 441) | private showLoadingGetResponse ( item ) {
    method showConetResponse (line 446) | private showConetResponse ( item ) {
    method getAppObject (line 451) | private getAppObject ( mainMenuItem ) {
    method updateAppsManu (line 467) | public updateAppsManu ( _self = null ) {
    method mainNemuError (line 562) | public mainNemuError () {
    method appClick (line 569) | public appClick ( appIndex: number ) {
    method constructor (line 702) | constructor ( private exit: () => void ) {

FILE: app/public/scripts/connectInformationMessage.js
  class connectInformationMessage (line 99) | class connectInformationMessage {
    method constructor (line 100) | constructor(url = "/") {
    method sockEmit (line 133) | sockEmit(eventName, ...args) {
    method showErrorMessage (line 162) | showErrorMessage(err) {
    method showSystemError (line 175) | showSystemError() {
    method showRestartCoNET_Connect (line 178) | showRestartCoNET_Connect() {
    method hideMessage (line 181) | hideMessage() {
    method getErrorIndex (line 186) | getErrorIndex(err) {

FILE: app/public/scripts/connectInformationMessage.ts
  class connectInformationMessage (line 111) | class connectInformationMessage {
    method constructor (line 120) | constructor ( private url: string = "/") {
    method sockEmit (line 155) | public sockEmit ( eventName: string, ...args ) {
    method showErrorMessage (line 192) | public showErrorMessage ( err ) {
    method showSystemError (line 207) | public showSystemError () {
    method showRestartCoNET_Connect (line 211) | public showRestartCoNET_Connect () {
    method hideMessage (line 215) | public hideMessage() {
    method getErrorIndex (line 222) | public getErrorIndex ( err ) {

FILE: app/public/scripts/encryptoClass.js
  class encryptoClass (line 2) | class encryptoClass {
    method constructor (line 3) | constructor(_keypair) {
    method decryptMessageToZipStream (line 51) | decryptMessageToZipStream(encryptoText, CallBack) {
    method encrypt (line 68) | encrypt(message, CallBack) {
    method emitRequest (line 82) | emitRequest(cmd, CallBack) {

FILE: app/public/scripts/encryptoClass.ts
  class encryptoClass (line 4) | class encryptoClass {
    method decryptMessageToZipStream (line 38) | public decryptMessageToZipStream ( encryptoText: string, CallBack ) {
    method constructor (line 84) | constructor ( private _keypair: keypair ) {
    method encrypt (line 91) | public encrypt ( message, CallBack ) {
    method emitRequest (line 111) | public emitRequest ( cmd: QTGateAPIRequestCommand, CallBack ) {

FILE: app/public/scripts/home.js
  class showWebPageClass (line 82) | class showWebPageClass {
    method constructor (line 83) | constructor(showUrl, zipBase64Stream, zipBase64StreamUuid, exit) {
    method showErrorMessageProcess (line 143) | showErrorMessageProcess() {
    method close (line 147) | close() {
    method imgClick (line 153) | imgClick() {
    method htmlClick (line 157) | htmlClick() {
  class view (line 164) | class view {
    method constructor (line 165) | constructor() {
    method afterInitConfig (line 209) | afterInitConfig() {
    method initConfig (line 216) | initConfig(config) {
    method clearImapData (line 264) | clearImapData() {
    method socketListen (line 268) | socketListen() {
    method selectItem (line 284) | selectItem(that, site) {
    method openClick (line 306) | openClick() {
    method deletedKeypairResetView (line 324) | deletedKeypairResetView() {
    method agreeClick (line 327) | agreeClick() {
    method refresh (line 333) | refresh() {
    method showKeyInfoClick (line 343) | showKeyInfoClick() {
    method imapSetupClassExit (line 349) | imapSetupClassExit(_imapData, sessionHash) {
    method reFreshLocalServer (line 365) | reFreshLocalServer() {
    method homeClick (line 368) | homeClick() {
    method svgDemo_showLanguage (line 393) | svgDemo_showLanguage() {

FILE: app/public/scripts/home.ts
  class showWebPageClass (line 99) | class showWebPageClass {
    method showErrorMessageProcess (line 105) | public showErrorMessageProcess () {
    method close (line 111) | public close () {
    method imgClick (line 118) | public imgClick () {
    method htmlClick (line 123) | public htmlClick () {
    method constructor (line 128) | constructor ( public showUrl: string, private zipBase64Stream: string,...
  class view (line 194) | class view {
    method afterInitConfig (line 234) | private afterInitConfig ( ) {
    method initConfig (line 243) | private initConfig ( config: install_config ) {
    method clearImapData (line 298) | private clearImapData () {
    method socketListen (line 304) | private socketListen () {
    method constructor (line 323) | constructor () {
    method selectItem (line 339) | public selectItem ( that?: any, site?: () => number ) {
    method openClick (line 366) | public openClick () {
    method deletedKeypairResetView (line 388) | public deletedKeypairResetView () {
    method agreeClick (line 393) | public agreeClick () {
    method refresh (line 402) | public refresh () {
    method showKeyInfoClick (line 414) | public showKeyInfoClick () {
    method imapSetupClassExit (line 421) | public imapSetupClassExit ( _imapData: IinputData, sessionHash: string...
    method reFreshLocalServer (line 444) | public reFreshLocalServer () {
    method homeClick (line 449) | public homeClick () {
    method svgDemo_showLanguage (line 477) | private svgDemo_showLanguage () {

FILE: app/public/scripts/imapForm.js
  class keyPairSign (line 147) | class keyPairSign {
    method constructor (line 148) | constructor(exit) {
    method checkActiveEmailSubmit (line 170) | checkActiveEmailSubmit() {
    method clearError (line 244) | clearError() {
    method requestActivEmail (line 248) | requestActivEmail() {
  class imapForm (line 298) | class imapForm {
    method constructor (line 299) | constructor(account, imapData, exit) {
    method clearError (line 324) | clearError() {
    method checkImapSetup (line 329) | checkImapSetup() {
    method checkEmailAddress (line 363) | checkEmailAddress(email) {
    method imapAccountGoCheckClick (line 377) | imapAccountGoCheckClick() {
    method returnImapSetup (line 388) | returnImapSetup() {

FILE: app/public/scripts/imapForm.ts
  class keyPairSign (line 165) | class keyPairSign {
    method constructor (line 177) | constructor ( private exit: () => void ) {
    method checkActiveEmailSubmit (line 188) | public checkActiveEmailSubmit () {
    method clearError (line 274) | public clearError () {
    method requestActivEmail (line 280) | public requestActivEmail () {
  class imapForm (line 339) | class imapForm {
    method clearError (line 352) | private clearError () {
    method checkImapSetup (line 358) | private checkImapSetup () {
    method checkEmailAddress (line 403) | private checkEmailAddress ( email: string ) {
    method constructor (line 418) | constructor ( private account: string, imapData: IinputData, private e...
    method imapAccountGoCheckClick (line 434) | public imapAccountGoCheckClick () {
    method returnImapSetup (line 449) | public returnImapSetup () {

FILE: app/public/scripts/jquery.cookie.js
  function encode (line 23) | function encode(s) {
  function decode (line 27) | function decode(s) {
  function stringifyCookieValue (line 31) | function stringifyCookieValue(value) {
  function parseCookieValue (line 35) | function parseCookieValue(s) {
  function read (line 50) | function read(s, converter) {

FILE: app/public/scripts/keyPairGenerateForm.js
  class IsNullValidator (line 30) | class IsNullValidator {
    method isAcceptable (line 31) | isAcceptable(s) {
  class EmailValidator (line 43) | class EmailValidator {
    method isAcceptable (line 44) | isAcceptable(s) {
  class keyPairGenerateForm (line 59) | class keyPairGenerateForm {
    method constructor (line 60) | constructor(exit) {
    method checkEmailAddress (line 91) | checkEmailAddress(email) {
    method checkNickname (line 115) | checkNickname(nickname) {
    method checkPassword (line 123) | checkPassword(password) {
    method stopDoingProcessBar (line 131) | stopDoingProcessBar() {
    method form_AdministratorEmail_submit (line 138) | form_AdministratorEmail_submit() {
    method CloseKeyPairGenerateFormMessage (line 178) | CloseKeyPairGenerateFormMessage() {

FILE: app/public/scripts/keyPairGenerateForm.ts
  class IsNullValidator (line 32) | class IsNullValidator implements StringValidator {
    method isAcceptable (line 33) | isAcceptable ( s: string ) {
  class EmailValidator (line 45) | class EmailValidator implements StringValidator {
    method isAcceptable (line 46) | isAcceptable ( s: string ) {
  class keyPairGenerateForm (line 67) | class keyPairGenerateForm {
    method checkEmailAddress (line 85) | private checkEmailAddress ( email: string ) {
    method checkNickname (line 117) | private checkNickname ( nickname: string ) {
    method checkPassword (line 126) | private checkPassword ( password: string ) {
    method stopDoingProcessBar (line 135) | private stopDoingProcessBar () {
    method constructor (line 143) | constructor ( private exit: ( keyPair, sessionHash: string ) => void ) {
    method form_AdministratorEmail_submit (line 158) | public form_AdministratorEmail_submit () {
    method CloseKeyPairGenerateFormMessage (line 202) | public CloseKeyPairGenerateFormMessage () {

FILE: app/public/scripts/keyPairPassword.js
  class keyPairPassword (line 16) | class keyPairPassword {
    method constructor (line 17) | constructor(exit) {
    method showPasswordError (line 31) | showPasswordError() {
    method keyPair_checkPemPasswordClick (line 36) | keyPair_checkPemPasswordClick() {

FILE: app/public/scripts/keyPairPassword.ts
  class keyPairPassword (line 17) | class keyPairPassword {
    method constructor (line 22) | constructor ( private exit: ( imapDat: imapData, passwd: string, sessi...
    method showPasswordError (line 33) | private showPasswordError() {
    method keyPair_checkPemPasswordClick (line 39) | public keyPair_checkPemPasswordClick () {

FILE: app/public/scripts/knockout.animate.js
  function addPrefixedEvent (line 22) | function addPrefixedEvent(element, type, callback) {
  function removePrefixedEvent (line 29) | function removePrefixedEvent(element, type, fun) {
  function hasClass (line 36) | function hasClass(ele,cls) {
  function addClass (line 40) | function addClass(ele,cls) {
  function removeClass (line 46) | function removeClass(ele,cls) {
  function doAnimationWork (line 53) | function doAnimationWork(element, animation, callback, state, delay ){

FILE: app/public/scripts/knockout.js
  function K (line 7) | function K(a,c){return null===a||typeof a in W?a===c:!1}
  function X (line 7) | function X(b,c){var d;return function(){d||(d=a.a.setTimeout(function(){...
  function Y (line 7) | function Y(b,c){var d;return function(){clearTimeout(d);
  function Z (line 8) | function Z(a,c){c&&"change"!==c?"beforeChange"===c?this.pc(a):this.gb(a,...
  function aa (line 8) | function aa(a,c){null!==c&&c.s&&c.s()}
  function ba (line 8) | function ba(a,c){var d=this.qd,e=d[r];e.ra||(this.Qb&&this.mb[c]?(d.uc(c...
  function b (line 9) | function b(a,b){for(var c in a)f.call(a,c)&&b(c,a[c])}
  function c (line 9) | function c(a,b){if(b)for(var c in b)f.call(b,c)&&(a[c]=b[c]);return a}
  function d (line 9) | function d(a,b){a.__proto__=b;return a}
  function e (line 9) | function e(b,c,d,e){var l=b[c].match(q)||[];a.a.D(d.match(q),function(b)...
  function b (line 26) | function b(b,c){var d=a.a.g.get(b,e);
  function c (line 27) | function c(c){var e=b(c,!1);if(e)for(var e=e.slice(0),k=0;k<e.length;k++...
  function d (line 27) | function d(b,d){for(var e=[],l,f=0;f<b.length;f++)if(!d||8===b[f].nodeTy...
  function b (line 31) | function b(c,e){if(c)if(8==c.nodeType){var f=a.aa.Uc(c.nodeValue);null!=...
  function b (line 33) | function b(){if(f)for(var b=f,c=0,d;h<f;)if(d=e[h++]){if(h>b){if(5E3<=
  function c (line 34) | function c(){b();h=f=e.length=0}
  function b (line 41) | function b(a){d.push(e);e=a}
  function c (line 41) | function c(){e=d.pop()}
  function c (line 42) | function c(){if(0<arguments.length)return c.sb(c[I],arguments[0])&&(c.ya...
  function d (line 48) | function d(){function c(){if(m){var d=[].concat(b.v()||[]),e;if(b.Wa("ar...
  function l (line 49) | function l(a,b,c){return k[k.length]={status:a,value:b,index:c}}
  function e (line 50) | function e(){if(0<arguments.length){if("function"===typeof f)f.apply(g.n...
  function b (line 59) | function b(a,f,g){g=g||new d;a=f(a);if("object"!=typeof a||null===a||a==...
  function c (line 60) | function c(a,b){if(a instanceof Array){for(var c=0;c<a.length;c++)b(c);"...
  function d (line 60) | function d(){this.keys=[];this.values=[]}
  function e (line 61) | function e(c){var e=a.xb(b,d).extend({ma:"always"}),h=e.subscribe(functi...
  function b (line 63) | function b(b){b=a.a.Db(b);123===b.charCodeAt(0)&&(b=b.slice(1,
  function l (line 66) | function l(b,e){var f;if(!x){var k=a.getBindingHandler(b);if(k&&k.prepro...
  function b (line 68) | function b(a){return 8==a.nodeType&&g.test(f?a.text:a.nodeValue)}
  function c (line 68) | function c(a){return 8==a.nodeType&&h.test(f?a.text:a.nodeValue)}
  function d (line 68) | function d(d,e){for(var f=d,h=1,g=[];f=f.nextSibling;){if(c(f)&&(a.a.g.s...
  function e (line 68) | function e(a,b){var c=d(a,b);return c?
  function b (line 74) | function b(b){var c=(b=a.a.g.get(b,z))&&b.N;c&&(b.N=null,c.Tc())}
  function c (line 74) | function c(c,d,e){this.node=c;this.yc=
  function d (line 75) | function d(a){return function(){return a}}
  function e (line 75) | function e(a){return a()}
  function f (line 75) | function f(b){return a.a.Ga(a.u.G(b),function(a,c){return function(){ret...
  function g (line 75) | function g(b,c,e){return"function"===typeof b?f(b.bind(null,c,e)):a.a.Ga...
  function h (line 75) | function h(a,b){return f(this.getBindings.bind(this,a,b))}
  function m (line 75) | function m(b,c){var d=a.h.firstChild(c);if(d){var e,f=a.ga.instance,l=f....
  function k (line 76) | function k(b,c){var d=b,e=1===c.nodeType;e&&a.h.Sc(c);if(e||a.ga.instanc...
  function l (line 76) | function l(b){var c=[],d={},e=[];a.a.P(b,function ca(f){if(!d[f]){var k=...
  function p (line 77) | function p(b,c,d){var f=a.a.g.Ub(b,z,{}),k=f.hd;if(!c){if(k)throw Error(...
  function q (line 80) | function q(b,c){return b&&b instanceof a.fa?b:new a.fa(b,n,n,c)}
  function k (line 80) | function k(){var b=p?h():h,f=a.a.f(b);c?(a.a.extend(l,c),x in c&&(l[x]=c...
  function c (line 86) | function c(c,e){var k=Object.prototype.hasOwnProperty.call(f,c)?f[c]:b,l...
  function d (line 86) | function d(a,b){e("getConfig",[a],function(c){c?e("loadComponent",[a,c],...
  function e (line 87) | function e(c,d,f,l){l||(l=a.j.loaders.slice(0));var g=l.shift();if(g){va...
  function b (line 88) | function b(b,c,d,e){function g(){0===--B&&e(h)}var h={},B=2,u=d.template...
  function c (line 88) | function c(a,b,d){if("function"===typeof b)d(function(a){return new b(a)});
  function d (line 89) | function d(b){switch(a.a.R(b)){case "script":return a.a.ua(b.text);case ...
  function e (line 89) | function e(a){return A.DocumentFragment?a instanceof DocumentFragment:a&...
  function f (line 89) | function f(a,b,c){"string"===typeof b.require?
  function g (line 90) | function g(a){return function(b){throw Error("Component '"+a+"': "+b);}}
  function b (line 92) | function b(b,e){var f=b.getAttribute("params");if(f){var f=c.parseBindin...
  function b (line 94) | function b(b,c,d){c=c.template;if(!c)throw Error("Component '"+b+"' has ...
  function c (line 94) | function c(a,b,c){var d=a.createViewModel;return d?d.call(a,
  function k (line 95) | function k(){var a=l&&l.dispose;"function"===typeof a&&a.call(l);q&&q.s(...
  function e (line 97) | function e(){var e=b.checked,f=g();if(!a.S.Ya()&&(e||!m&&!a.S.qa())){var...
  function f (line 98) | function f(){var d=a.a.f(c()),e=g();l?(b.checked=0<=a.a.A(d,e),t=e):b.ch...
  function e (line 102) | function e(e){b.__ko_hasfocusUpdating=!0;var f=b.ownerDocument;if("activ...
  function b (line 103) | function b(b,d,e){a.c[b]={init:function(b,c,h,m,k){var l,p,q={},t,x,n;if...
  function e (line 105) | function e(){return a.a.jb(b.options,function(a){return a.selected})}
  function f (line 105) | function f(a,b,c){var d=typeof b;return"function"==d?b(a):"string"==d?a[...
  function g (line 105) | function g(c,d){if(x&&l)a.i.ma(b,a.i.H);else if(t.length){var e=
  function e (line 108) | function e(){var e=c(),f=[];a.a.D(b.getElementsByTagName("option"),funct...
  function f (line 109) | function f(){var d=a.a.f(c()),e=b.scrollTop;d&&"number"==typeof d.length...
  function l (line 112) | function l(c,d){a.a.B(b,c,d)}
  function m (line 112) | function m(){var d=a.a.f(c());if(null===d||d===n)d="";L!==n&&d===L?a.a.s...
  function r (line 112) | function r(){w||(L=b.value,w=a.a.setTimeout(z,
  function z (line 113) | function z(){clearTimeout(w);L=w=n;var d=b.value;v!==d&&(v=d,a.m.eb(c(),...
  function b (line 119) | function b(b,c,d,h){b=a.m.ac(b);for(var m=a.m.Ra,k=0;k<b.length;k++){var...
  function b (line 124) | function b(b,c,d){var e;for(c=a.h.nextSibling(c);b&&(e=b)!==c;)b=a.h.nex...
  function c (line 124) | function c(c,d){if(c.length){var e=c[0],f=c[c.length-1],g=e.parentNode,h...
  function d (line 125) | function d(a){return a.nodeType?a:0<a.length?a[0]:null}
  function e (line 125) | function e(b,e,f,h,m){m=m||{};var n=(b&&d(b)||f||{}).ownerDocument,B=m.t...
  function f (line 126) | function f(b,c,d){return a.O(b)?b():"function"===typeof b?b(c,d):b}
  function x (line 127) | function x(b,c){a.u.G(a.a.ec,null,[h,b,u,g,r,c]);a.i.ma(h,a.i.H)}
  function r (line 128) | function r(a,b){c(b,v);g.afterRender&&g.afterRender(b,a);v=null}
  function u (line 128) | function u(a,c){v=m.createChildContext(a,{as:z,noChildContext:g.noChildC...
  function b (line 132) | function b(b,d,e,f,g){var h=Math.min,m=Math.max,k=[],l,p=b.length,q,n=d....
  function b (line 133) | function b(b,c,d,h,m){var k=[],l=a.$(function(){var l=c(d,m,a.a.Ua(k,b))...
  function l (line 134) | function l(b){y={Aa:b,pb:a.ta(w++)};v.push(y);r||F.push(y)}
  function p (line 134) | function p(b){y=t[b];w!==y.pb.v()&&D.push(y);y.pb(w++);a.a.Ua(y.Y,e);v.p...
  function q (line 134) | function q(b,c){if(b)for(var d=0,e=c.length;d<e;d++)a.a.D(c[d].Y,functio...

FILE: app/public/scripts/siteShare.js
  function getExpireWithMonths (line 403) | function getExpireWithMonths(month) {
  function cmpVersions (line 3147) | function cmpVersions(a, b) {
  function scrollToTop (line 3161) | function scrollToTop() {

FILE: app/public/scripts/siteShare.ts
  type lang (line 230) | enum lang { 'zh', 'ja', 'en', 'tw' }
  function getExpireWithMonths (line 428) | function getExpireWithMonths ( month: number ) {
  function cmpVersions (line 3310) | function cmpVersions ( a: string, b: string ) {
  function scrollToTop (line 3326) | function scrollToTop () {

FILE: app/public/scripts/socket.io.js
  function e (line 6) | function e(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,lo...
  function r (line 6) | function r(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,r=o(t),...
  function r (line 6) | function r(t,e){var n=t;e=e||"undefined"!=typeof location&&location,null...
  function o (line 6) | function o(){return!("undefined"==typeof window||!window.process||"rende...
  function i (line 6) | function i(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useC...
  function s (line 6) | function s(){var t;return"object"===("undefined"==typeof console?"undefi...
  function a (line 6) | function a(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("d...
  function c (line 6) | function c(){var t=void 0;try{t=e.storage.getItem("debug")}catch(n){}ret...
  function u (line 6) | function u(){try{return localStorage}catch(t){}}
  function n (line 6) | function n(){throw new Error("setTimeout has not been defined")}
  function r (line 6) | function r(){throw new Error("clearTimeout has not been defined")}
  function o (line 6) | function o(t){if(p===setTimeout)return setTimeout(t,0);if((p===n||!p)&&s...
  function i (line 6) | function i(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&...
  function s (line 6) | function s(){y&&l&&(y=!1,l.length?d=l.concat(d):m=-1,d.length&&a())}
  function a (line 6) | function a(){if(!y){var t=o(s);y=!0;for(var e=d.length;e;){for(l=d,d=[];...
  function c (line 6) | function c(t,e){this.fun=t,this.array=e}
  function u (line 6) | function u(){}
  function r (line 6) | function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.len...
  function o (line 6) | function o(t){function e(t){for(var e=0,n=0;n<t.length;n++)e=(e<<5)-e+t....
  function n (line 6) | function n(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+)...
  function r (line 6) | function r(t){var e=Math.abs(t);return e>=u?Math.round(t/u)+"d":e>=c?Mat...
  function o (line 6) | function o(t){var e=Math.abs(t);return e>=u?i(t,e,u,"day"):e>=c?i(t,e,c,...
  function i (line 6) | function i(t,e,n,r){var o=e>=1.5*n;return Math.round(t/n)+" "+r+(o?"s":"")}
  function r (line 6) | function r(){}
  function o (line 6) | function o(t){var n=""+t.type;if(e.BINARY_EVENT!==t.type&&e.BINARY_ACK!=...
  function i (line 6) | function i(t){try{return JSON.stringify(t)}catch(e){return!1}}
  function s (line 6) | function s(t,e){function n(t){var n=d.deconstructPacket(t),r=o(n.packet)...
  function a (line 6) | function a(){this.reconstructor=null}
  function c (line 6) | function c(t){var n=0,r={type:Number(t.charAt(0))};if(null==e.types[r.ty...
  function u (line 6) | function u(t){try{return JSON.parse(t)}catch(e){return!1}}
  function p (line 6) | function p(t){this.reconPack=t,this.buffers=[]}
  function h (line 6) | function h(t){return{type:e.ERROR,data:"parser error: "+t}}
  function o (line 6) | function o(){return!("undefined"==typeof window||!window.process||"rende...
  function i (line 6) | function i(t){var n=this.useColors;if(t[0]=(n?"%c":"")+this.namespace+(n...
  function s (line 6) | function s(){return"object"===("undefined"==typeof console?"undefined":p...
  function a (line 6) | function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=...
  function c (line 6) | function c(){var t;try{t=e.storage.debug}catch(n){}return!t&&"undefined"...
  function u (line 6) | function u(){try{return window.localStorage}catch(t){}}
  function r (line 6) | function r(t){var n,r=0;for(n in t)r=(r<<5)-r+t.charCodeAt(n),r|=0;retur...
  function o (line 6) | function o(t){function n(){if(n.enabled){var t=n,r=+new Date,i=r-(o||r);...
  function i (line 6) | function i(){var t=e.instances.indexOf(this);return t!==-1&&(e.instances...
  function s (line 6) | function s(t){e.save(t),e.names=[],e.skips=[];var n,r=("string"==typeof ...
  function a (line 6) | function a(){e.enable("")}
  function c (line 6) | function c(t){if("*"===t[t.length-1])return!0;var n,r;for(n=0,r=e.skips....
  function u (line 6) | function u(t){return t instanceof Error?t.stack||t.message:t}
  function n (line 6) | function n(t){if(t=String(t),!(t.length>100)){var e=/^((?:\d+)?\.?\d+) *...
  function r (line 6) | function r(t){return t>=u?Math.round(t/u)+"d":t>=c?Math.round(t/c)+"h":t...
  function o (line 6) | function o(t){return i(t,u,"day")||i(t,c,"hour")||i(t,a,"minute")||i(t,s...
  function i (line 6) | function i(t,e,n){if(!(t<e))return t<1.5*e?Math.floor(t/e)+" "+n:Math.ce...
  function r (line 6) | function r(t){if(t)return o(t)}
  function o (line 6) | function o(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}
  function n (line 6) | function n(){this.off(t,n),e.apply(this,arguments)}
  function r (line 6) | function r(t,e){if(!t)return t;if(s(t)){var n={_placeholder:!0,num:e.len...
  function o (line 6) | function o(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(i...
  function n (line 6) | function n(t,a,p){if(!t)return t;if(c&&t instanceof Blob||u&&t instanceo...
  function n (line 6) | function n(t){return r&&Buffer.isBuffer(t)||o&&(t instanceof ArrayBuffer...
  function r (line 6) | function r(t,e){if(!(this instanceof r))return new r(t,e);t&&"object"==t...
  function n (line 6) | function n(){~h(o.connecting,r)||o.connecting.push(r)}
  function r (line 6) | function r(t,e){return this instanceof r?(e=e||{},t&&"object"==typeof t&...
  function o (line 6) | function o(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);r...
  function e (line 7) | function e(){if(f.onlyBinaryUpgrades){var e=!this.supportsBinary&&f.tran...
  function n (line 7) | function n(){h||(h=!0,u(),p.close(),p=null)}
  function o (line 7) | function o(e){var r=new Error("probe error: "+e);r.transport=p.name,n(),...
  function i (line 7) | function i(){o("transport closed")}
  function s (line 7) | function s(){o("socket closed")}
  function c (line 7) | function c(t){p&&t.name!==p.name&&(a('"%s" works - aborting "%s"',t.name...
  function u (line 7) | function u(){p.removeListener("open",e),p.removeListener("error",o),p.re...
  function t (line 7) | function t(){r.onClose("forced close"),a("socket closing - telling trans...
  function e (line 7) | function e(){r.removeListener("upgrade",e),r.removeListener("upgradeErro...
  function n (line 7) | function n(){r.once("upgrade",e),r.once("upgradeError",e)}
  function r (line 7) | function r(t){var e,n=!1,r=!1,a=!1!==t.jsonp;if("undefined"!=typeof loca...
  function r (line 7) | function r(){}
  function o (line 7) | function o(t){if(c.call(this,t),this.requestTimeout=t.requestTimeout,thi...
  function i (line 7) | function i(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,...
  function s (line 7) | function s(){for(var t in i.requests)i.requests.hasOwnProperty(t)&&i.req...
  function r (line 7) | function r(t){var e=t&&t.forceBase64;p&&!e||(this.supportsBinary=!1),o.c...
  function e (line 7) | function e(){u("paused"),n.readyState="paused",t()}
  function t (line 7) | function t(){u("writing close packet"),e.write([{type:"close"}])}
  function r (line 7) | function r(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port...
  function r (line 7) | function r(t,n){var r="b"+e.packets[t.type]+t.data.data;return n(r)}
  function o (line 7) | function o(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=t.data,i=...
  function i (line 7) | function i(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var o=new FileR...
  function s (line 7) | function s(t,n,r){if(!n)return e.encodeBase64Packet(t,r);if(g)return i(t...
  function a (line 7) | function a(t){try{t=d.decode(t,{strict:!1})}catch(e){return!1}return t}
  function c (line 7) | function c(t,e,n){for(var r=new Array(t.length),o=l(t.length,n),i=functi...
  function o (line 7) | function o(t){return t.length+":"+t}
  function i (line 7) | function i(t,r){e.encodePacket(t,!!s&&n,!1,function(t){r(null,o(t))})}
  function r (line 7) | function r(t,n){e.encodePacket(t,!0,!0,function(t){return n(null,t)})}
  function r (line 7) | function r(t,n){e.encodePacket(t,!0,!0,function(t){var e=new Uint8Array(...
  function r (line 7) | function r(t){if(!t||"object"!=typeof t)return!1;if(o(t)){for(var e=0,n=...
  function n (line 7) | function n(t,e,n){function o(t,r){if(o.count<=0)throw new Error("after c...
  function r (line 7) | function r(){}
  function n (line 7) | function n(t){for(var e,n,r=[],o=0,i=t.length;o<i;)e=t.charCodeAt(o++),e...
  function r (line 7) | function r(t){for(var e,n=t.length,r=-1,o="";++r<n;)e=t[r],e>65535&&(e-=...
  function o (line 7) | function o(t,e){if(t>=55296&&t<=57343){if(e)throw Error("Lone surrogate ...
  function i (line 7) | function i(t,e){return d(t>>e&63|128)}
  function s (line 7) | function s(t,e){if(0==(4294967168&t))return d(t);var n="";return 0==(429...
  function a (line 7) | function a(t,e){e=e||{};for(var r,o=!1!==e.strict,i=n(t),a=i.length,c=-1...
  function c (line 7) | function c(){if(l>=f)throw Error("Invalid byte index");var t=255&h[l];if...
  function u (line 7) | function u(t){var e,n,r,i,s;if(l>f)throw Error("Invalid byte index");if(...
  function p (line 7) | function p(t,e){e=e||{};var o=!1!==e.strict;h=n(t),f=h.length,l=0;for(va...
  function n (line 8) | function n(t){return t.map(function(t){if(t.buffer instanceof ArrayBuffe...
  function r (line 8) | function r(t,e){e=e||{};var r=new i;return n(t).forEach(function(t){r.ap...
  function o (line 8) | function o(t,e){return new Blob(n(t),e||{})}
  function n (line 8) | function n(t){var e="";do e=s[t%a]+e,t=Math.floor(t/a);while(t>0);return e}
  function r (line 8) | function r(t){var e=0;for(p=0;p<t.length;p++)e=e*a+c[t.charAt(p)];return e}
  function o (line 8) | function o(){var t=n(+new Date);return t!==i?(u=0,i=t):t+"."+n(u++)}
  function r (line 8) | function r(){}
  function o (line 8) | function o(){return"undefined"!=typeof self?self:"undefined"!=typeof win...
  function i (line 8) | function i(t){if(s.call(this,t),this.query=this.query||{},!c){var e=o();...
  function n (line 8) | function n(){r(),e()}
  function r (line 8) | function r(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(t){o.onE...
  function r (line 8) | function r(t){var e=t&&t.forceBase64;e&&(this.supportsBinary=!1),this.pe...
  function e (line 8) | function e(){n.emit("flush"),setTimeout(function(){n.writable=!0,n.emit(...
  function r (line 8) | function r(t,e,n){this.io=t,this.nsp=e,this.json=this,this.ids=0,this.ac...
  function n (line 8) | function n(t,e){var n=[];e=e||0;for(var r=e||0;r<t.length;r++)n[r-e]=t[r...
  function n (line 8) | function n(t,e,n){return t.on(e,n),{destroy:function(){t.removeListener(...
  function n (line 8) | function n(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor...

FILE: app/tools/coNETConnect.js
  class default_1 (line 35) | class default_1 extends Imap.imapPeer {
    method constructor (line 36) | constructor(imapData, sockerServer, sentConnectMail, nodeEmailAddress,...
    method exit1 (line 88) | exit1(err) {
    method setTimeWaitAfterSentrequestMail (line 98) | setTimeWaitAfterSentrequestMail() {
    method sendRequestMail (line 103) | sendRequestMail() {
    method requestCoNET_v1 (line 111) | requestCoNET_v1(uuid, text, CallBack) {
    method getFile (line 114) | getFile(fileName, CallBack) {

FILE: app/tools/coNETConnect.ts
  method exit1 (line 45) | public exit1 ( err ) {
  method setTimeWaitAfterSentrequestMail (line 56) | public setTimeWaitAfterSentrequestMail () {
  method sendRequestMail (line 62) | public sendRequestMail () {
  method constructor (line 73) | constructor ( public imapData: IinputData, private sockerServer, private...
  method requestCoNET_v1 (line 127) | public requestCoNET_v1 ( uuid: string, text: string, CallBack ) {
  method getFile (line 132) | public getFile ( fileName: string, CallBack ) {

FILE: app/tools/compress.js
  constant EOF (line 21) | const EOF = Buffer.from('\r\n\r\n', 'utf8');
  constant HTTP_HEADER (line 105) | const HTTP_HEADER = Buffer.from(`HTTP/1.1 200 OK\r\nDate: ${new Date().t...
  constant HTTP_EOF (line 106) | const HTTP_EOF = Buffer.from('\r\n\r\n', 'utf8');
  class encryptStream (line 107) | class encryptStream extends Stream.Transform {
    method constructor (line 108) | constructor(password, random, httpHeader) {
    method BlockBuffer (line 116) | BlockBuffer(_buf) {
    method init (line 119) | init(callback) {
    method _transform (line 135) | _transform(chunk, encode, cb) {
  class decryptStream (line 168) | class decryptStream extends Stream.Transform {
    method constructor (line 169) | constructor(password, _buf = Buffer.allocUnsafe(0)) {
    method _decrypt (line 175) | _decrypt(_text) {
    method _First (line 191) | _First(chunk, CallBack) {
    method _transform (line 206) | _transform(chunk, encode, cb) {
  class encode (line 217) | class encode extends Stream.Transform {
    method constructor (line 218) | constructor() {
    method _transform (line 222) | _transform(chunk, encode, cb) {
  class encodeHex (line 237) | class encodeHex extends Stream.Transform {
    method constructor (line 238) | constructor() { super(); }
    method _transform (line 239) | _transform(chunk, encode, cb) {
  class getDecryptClientStreamFromHttp (line 243) | class getDecryptClientStreamFromHttp extends Stream.Transform {
    method constructor (line 244) | constructor() {
    method getBlock (line 249) | getBlock(block) {
    method _transform (line 261) | _transform(chunk, encode, cb) {
  class printStream (line 294) | class printStream extends Stream.Transform {
    method constructor (line 295) | constructor(headString) {
    method _transform (line 299) | _transform(chunk, encode, cb) {
  class blockBuffer16 (line 307) | class blockBuffer16 extends Stream.Writable {
    method constructor (line 308) | constructor(socket) {
    method _write (line 313) | _write(chunk, encoding, cb) {
  class getDecrypGatwayStreamFromHttp (line 325) | class getDecrypGatwayStreamFromHttp extends Stream.Transform {
    method constructor (line 326) | constructor(saveLog) {
    method formatErr (line 331) | formatErr(text) {
    method _transform (line 336) | _transform(chunk, encode, cb) {

FILE: app/tools/compress.ts
  constant EOF (line 21) | const EOF = Buffer.from ( '\r\n\r\n', 'utf8' )
  type packetBuffer (line 23) | interface packetBuffer {
  type pairConnect (line 30) | interface pairConnect {
  constant HTTP_HEADER (line 132) | const HTTP_HEADER = Buffer.from (
  constant HTTP_EOF (line 134) | const HTTP_EOF = Buffer.from ( '\r\n\r\n', 'utf8' )
  class encryptStream (line 136) | class encryptStream extends Stream.Transform {
    method BlockBuffer (line 142) | private BlockBuffer ( _buf: Buffer ) {
    method init (line 145) | private init ( callback ) {
    method constructor (line 163) | constructor ( private password: string, private random: number, privat...
    method _transform (line 167) | public _transform ( chunk: Buffer, encode, cb ) {
  class decryptStream (line 208) | class decryptStream extends Stream.Transform {
    method _decrypt (line 214) | private _decrypt ( _text: Buffer ) {
    method _First (line 233) | public _First (  chunk: Buffer, CallBack: ( err?: Error, text?: Buffer...
    method constructor (line 249) | constructor ( private password: string, _buf: Buffer = Buffer.allocUns...
    method _transform (line 254) | public _transform ( chunk: Buffer, encode, cb ) {
  class encode (line 268) | class encode extends Stream.Transform {
    method constructor (line 269) | constructor () { super ()}
    method _transform (line 271) | public _transform ( chunk: Buffer, encode, cb ) {
  class encodeHex (line 288) | class encodeHex extends Stream.Transform {
    method constructor (line 289) | constructor () { super ()}
    method _transform (line 290) | public _transform ( chunk: Buffer, encode, cb ) {
  class getDecryptClientStreamFromHttp (line 296) | class getDecryptClientStreamFromHttp extends Stream.Transform {
    method constructor (line 300) | constructor () { super ()}
    method getBlock (line 302) | public getBlock ( block: string ) {
    method _transform (line 319) | public _transform ( chunk: Buffer, encode, cb ) {
  class printStream (line 362) | class printStream extends Stream.Transform {
    method constructor (line 364) | constructor ( private headString: string ) { super ()}
    method _transform (line 365) | public _transform ( chunk: Buffer, encode, cb ) {
  class blockBuffer16 (line 374) | class blockBuffer16 extends Stream.Writable {
    method constructor (line 375) | constructor ( private socket: Net.Socket ) {
    method _write (line 379) | public _write ( chunk: Buffer, encoding, cb ) {
  class getDecrypGatwayStreamFromHttp (line 391) | class getDecrypGatwayStreamFromHttp extends Stream.Transform {
    method formatErr (line 394) | private formatErr ( text: string ) {
    method constructor (line 399) | constructor ( private saveLog: ( str: string ) => void ) { super ()}
    method _transform (line 401) | public _transform ( chunk: Buffer, encode, cb ) {

FILE: app/tools/imap.js
  constant MAX_INT (line 30) | const MAX_INT = 9007199254740992;
  class ImapServerSwitchStream (line 48) | class ImapServerSwitchStream extends Stream.Transform {
    method constructor (line 49) | constructor(imapServer, exitWithDeleteBox, debug) {
    method commandProcess (line 77) | commandProcess(text, cmdArray, next, callback) { }
    method serverCommandError (line 78) | serverCommandError(err, CallBack) {
    method idleDoingDown (line 84) | idleDoingDown() {
    method doCapability (line 96) | doCapability(capability) {
    method preProcessCommane (line 106) | preProcessCommane(commandLine, _next, callback) {
    method checkFetchEnd (line 140) | checkFetchEnd() {
    method _transform (line 155) | _transform(chunk, encoding, next) {
    method capability (line 211) | capability() {
    method doNewMail (line 267) | doNewMail(UID = '') {
    method checkLogout (line 314) | checkLogout(CallBack) {
    method idleNoop (line 334) | idleNoop() {
    method login (line 407) | login(text, cmdArray, next, _callback) {
    method createBox (line 447) | createBox(openBox, folderName, CallBack) {
    method openBox (line 470) | openBox(CallBack) {
    method _logout (line 503) | _logout(CallBack) {
    method append (line 530) | append(text, subject, CallBack) {
    method appendStreamV4 (line 586) | appendStreamV4(Base64Data = '', subject = null, folderName, CallBack) {
    method seachUnseen (line 655) | seachUnseen(callabck) {
    method fetch (line 692) | fetch(fetchNum, callback) {
    method deleteBox (line 730) | deleteBox(CallBack) {
    method deleteAMailBox (line 743) | deleteAMailBox(boxName, CallBack) {
    method logout (line 758) | logout(callback) {
    method logout_process (line 765) | logout_process(callback) {
    method flagsDeleted (line 784) | flagsDeleted(num, CallBack) {
    method expunge (line 801) | expunge(CallBack) {
    method listAllMailBox (line 826) | listAllMailBox(CallBack) {
  class qtGateImap (line 854) | class qtGateImap extends Event.EventEmitter {
    method constructor (line 855) | constructor(IMapConnect, listenFolder, deleteBoxWhenEnd, writeFolder, ...
    method TagCount1 (line 885) | TagCount1() {
    method connect (line 890) | connect() {
    method destroyAll (line 921) | destroyAll(err) {
    method logout (line 929) | logout(CallBack = null) {
  class qtGateImapRead (line 973) | class qtGateImapRead extends qtGateImap {
    method constructor (line 974) | constructor(IMapConnect, listenFolder, deleteBoxWhenEnd, newMail) {
    method fetchAndDelete (line 981) | fetchAndDelete(Uid, CallBack) {
  class imapPeer (line 1061) | class imapPeer extends Event.EventEmitter {
    method constructor (line 1062) | constructor(imapData, listenBox, writeBox, exit) {
    method mail (line 1084) | mail(email) {
    method replyPing (line 1106) | replyPing(uu) {
    method AppendWImap1 (line 1113) | AppendWImap1(mail, uuid, CallBack) {
    method setTimeOutOfPing (line 1116) | setTimeOutOfPing() {
    method Ping (line 1126) | Ping() {
    method newReadImap (line 1140) | newReadImap() {
    method destroy (line 1175) | destroy(err) {
    method sendDataToANewUuidFolder (line 1194) | sendDataToANewUuidFolder(data, writeBox, subject, CallBack) {

FILE: app/tools/imap.ts
  constant MAX_INT (line 34) | const MAX_INT = 9007199254740992
  type qtGateImapwriteAppendPool (line 54) | interface qtGateImapwriteAppendPool {
  class ImapServerSwitchStream (line 61) | class ImapServerSwitchStream extends Stream.Transform {
    method commandProcess (line 62) | public commandProcess ( text: string, cmdArray: string[], next, callba...
    method serverCommandError (line 65) | public serverCommandError ( err: Error, CallBack ) {
    method idleDoingDown (line 96) | private idleDoingDown () {
    method constructor (line 110) | constructor ( public imapServer: qtGateImap, private exitWithDeleteBox...
    method doCapability (line 114) | private doCapability ( capability ) {
    method preProcessCommane (line 125) | public preProcessCommane ( commandLine: string, _next, callback ) {
    method checkFetchEnd (line 166) | public checkFetchEnd () {
    method _transform (line 189) | public _transform ( chunk: Buffer, encoding, next ) {
    method capability (line 256) | private capability () {
    method doNewMail (line 324) | public doNewMail ( UID = '' ) {
    method checkLogout (line 383) | public checkLogout ( CallBack ) {
    method idleNoop (line 409) | private idleNoop () {
    method login (line 496) | private login ( text: string, cmdArray: string[], next, _callback ) {
    method createBox (line 545) | public createBox ( openBox: boolean, folderName: string, CallBack ) {
    method openBox (line 576) | private openBox ( CallBack ) {
    method _logout (line 615) | public _logout ( CallBack ) {
    method append (line 650) | public append ( text: string, subject: string, CallBack ) {
    method appendStreamV4 (line 718) | public appendStreamV4 ( Base64Data: string = '', subject: string = nul...
    method seachUnseen (line 811) | public seachUnseen ( callabck ) {
    method fetch (line 853) | public fetch ( fetchNum, callback ) {
    method deleteBox (line 902) | private deleteBox ( CallBack ) {
    method deleteAMailBox (line 916) | public deleteAMailBox ( boxName: string, CallBack ) {
    method logout (line 934) | public logout ( callback: () => void ) {
    method logout_process (line 943) | public logout_process ( callback ) {
    method flagsDeleted (line 969) | public flagsDeleted ( num: string, CallBack ) {
    method expunge (line 988) | public expunge ( CallBack ) {
    method listAllMailBox (line 1019) | public listAllMailBox ( CallBack ) {
  class qtGateImap (line 1049) | class qtGateImap extends Event.EventEmitter {
    method TagCount1 (line 1068) | public TagCount1 () {
    method connect (line 1075) | private connect () {
    method constructor (line 1113) | constructor ( public IMapConnect: imapConnect, public listenFolder: st...
    method destroyAll (line 1126) | public destroyAll ( err: Error ) {
    method logout (line 1138) | public logout ( CallBack = null ) {
  class qtGateImapRead (line 1194) | class qtGateImapRead extends qtGateImap {
    method fetchAndDelete (line 1198) | public fetchAndDelete ( Uid: string, CallBack ) {
    method constructor (line 1210) | constructor ( IMapConnect: imapConnect, listenFolder: string, deleteBo...
  type mailPool (line 1310) | interface mailPool {
  class imapPeer (line 1316) | class imapPeer extends Event.EventEmitter {
    method mail (line 1332) | private mail ( email: Buffer ) {
    method replyPing (line 1363) | private replyPing ( uu ) {
    method AppendWImap1 (line 1373) | private AppendWImap1 ( mail: string, uuid: string, CallBack ) {
    method setTimeOutOfPing (line 1379) | private setTimeOutOfPing () {
    method Ping (line 1392) | public Ping () {
    method newReadImap (line 1413) | public newReadImap() {
    method constructor (line 1460) | constructor ( public imapData: imapConnect, private listenBox: string,...
    method destroy (line 1467) | public destroy ( err?: number ) {
    method sendDataToANewUuidFolder (line 1492) | public sendDataToANewUuidFolder ( data: string, writeBox: string, subj...

FILE: app/tools/initSystem.js
  function getKeyPairInfo (line 179) | async function getKeyPairInfo(publicKey, privateKey, password, CallBack) {
  function makeGpgKeyOption (line 540) | async function makeGpgKeyOption(config, passwrod, CallBack) {
  function saveEncryptoData (line 558) | async function saveEncryptoData(fileName, data, config, password, CallBa...
  function readEncryptoFile (line 604) | async function readEncryptoFile(filename, savedPasswrod, config, CallBac...
  function decryptoMessage (line 679) | async function decryptoMessage(openKeyOption, message, CallBack) {

FILE: app/tools/initSystem.ts
  function getKeyPairInfo (line 200) | async function getKeyPairInfo ( publicKey: string, privateKey: string, p...
  function makeGpgKeyOption (line 605) | async function makeGpgKeyOption ( config: install_config, passwrod: stri...
  function saveEncryptoData (line 624) | async function saveEncryptoData ( fileName: string, data: any, config: i...
  function readEncryptoFile (line 676) | async function readEncryptoFile ( filename: string, savedPasswrod, confi...
  function decryptoMessage (line 760) | async function decryptoMessage ( openKeyOption, message: string, CallBac...

FILE: index.js
  constant DEBUG (line 18) | const DEBUG = false;

FILE: index.ts
  constant DEBUG (line 17) | const DEBUG = false
Condensed preview — 64 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,744K chars).
[
  {
    "path": ".travis.yml",
    "chars": 128,
    "preview": "sudo: false\nlanguage: node_js\n\nos:\n  - linux\n\nbefore_install:\n  - nvm install 8.7.0\n  - nvm use 8.7.0\n  - npm i electron"
  },
  {
    "path": "LICENSE",
    "chars": 1087,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2018 CoNET Technology Inc.\n\nPermission is hereby granted, free of charge, to any pe"
  },
  {
    "path": "README.md",
    "chars": 769,
    "preview": "### This is the beginning of CoNET project\n### now migrate to\n## The new era of CoNET\n\n### New Link here:\n\nhttps://bitbu"
  },
  {
    "path": "app/CoNET.d.ts",
    "chars": 17722,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/localWebServer.js",
    "chars": 24174,
    "preview": "\"use strict\";\n/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, "
  },
  {
    "path": "app/localWebServer.ts",
    "chars": 20528,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/main.js",
    "chars": 383,
    "preview": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst localWebServer_1 = require(\"./localWe"
  },
  {
    "path": "app/main.ts",
    "chars": 948,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/package.json.npm",
    "chars": 1283,
    "preview": "{\n  \"name\": \"conet\",\n  \"version\": \"3.0.20\",\n  \"license\": \"MIT\",\n  \"description\": \"CoNET\",\n  \"repository\": {\n    \"type\": "
  },
  {
    "path": "app/public/css/c3.css",
    "chars": 2161,
    "preview": ".c3 svg{font:10px sans-serif;-webkit-tap-highlight-color:transparent}.c3 line,.c3 path{fill:none;stroke:#000}.c3 text{-w"
  },
  {
    "path": "app/public/css/page.css",
    "chars": 17624,
    "preview": "\n\n.bodyCoNETBlue {\n\tbackground: rgba(101,226,245,1);\n\tbackground: -moz-linear-gradient(left, rgba(101,226,245,1) 0%, rgb"
  },
  {
    "path": "app/public/scripts/CanadaSvg.js",
    "chars": 6429,
    "preview": "/* Day */\nvar dayGroup = document.getElementById(\"DayGroup\");\n/* Canoe */\nvar canoe = document.getElementsByClassName(\"c"
  },
  {
    "path": "app/public/scripts/Cleave.js",
    "chars": 15304,
    "preview": "/*!\n * cleave.js - 1.3.8\n * https://github.com/nosir/cleave.js\n * Apache License Version 2.0\n *\n * Copyright (C) 2012-20"
  },
  {
    "path": "app/public/scripts/CoNETConnect.js",
    "chars": 7926,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/CoNETConnect.ts",
    "chars": 6620,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/appCosearch.js",
    "chars": 35480,
    "preview": "let appScript = {\n    info: {\n        totalResults: ['大约有', '約', 'About', '大約有'],\n        totalResults1: ['条记录', '件', 'r"
  },
  {
    "path": "app/public/scripts/appCosearch.ts",
    "chars": 28970,
    "preview": "\n\n\nlet appScript = {\n\tinfo: {\n\t\ttotalResults: ['大约有','約','About','大約有'],\n\t\ttotalResults1: ['条记录','件','results','條記錄'],\n\t"
  },
  {
    "path": "app/public/scripts/appsManager.js",
    "chars": 134614,
    "preview": "const _mainMenuObj111 = {\n    nodeName: ['CoNET官方节点', 'CoNET公式パブリックノード', 'CoNET official public node', 'CoNET官方節點'],\n   "
  },
  {
    "path": "app/public/scripts/appsManager.ts",
    "chars": 132622,
    "preview": "\nconst _mainMenuObj111 = {\n\tnodeName: ['CoNET官方节点','CoNET公式パブリックノード','CoNET official public node','CoNET官方節點'],\n\tnodeAdd"
  },
  {
    "path": "app/public/scripts/connectInformationMessage.js",
    "chars": 7407,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/connectInformationMessage.ts",
    "chars": 6532,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/encryptoClass.js",
    "chars": 3979,
    "preview": "const requestTimeOut = 1000 * 180;\nclass encryptoClass {\n    constructor(_keypair) {\n        this._keypair = _keypair;\n "
  },
  {
    "path": "app/public/scripts/encryptoClass.ts",
    "chars": 3580,
    "preview": "declare const openpgp: any \n\nconst requestTimeOut = 1000 * 180\nclass encryptoClass {\n\tprivate _privateKey\n\tprivate CoNET"
  },
  {
    "path": "app/public/scripts/home.js",
    "chars": 17364,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/home.ts",
    "chars": 16987,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/imapForm.js",
    "chars": 14247,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/imapForm.ts",
    "chars": 11927,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/jquery.cookie.js",
    "chars": 3121,
    "preview": "/*!\n * jQuery Cookie Plugin v1.4.1\n * https://github.com/carhartl/jquery-cookie\n *\n * Copyright 2013 Klaus Hartl\n * Rele"
  },
  {
    "path": "app/public/scripts/keyPairGenerateForm.js",
    "chars": 6512,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/keyPairGenerateForm.ts",
    "chars": 6086,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/keyPairPassword.js",
    "chars": 2053,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/keyPairPassword.ts",
    "chars": 1975,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/knockout.animate.js",
    "chars": 5810,
    "preview": "(function (factory) {\n    if (typeof require === \"function\" && typeof exports === \"object\" && typeof module === \"object\""
  },
  {
    "path": "app/public/scripts/knockout.js",
    "chars": 68382,
    "preview": "/*!\n * Knockout JavaScript library v3.5.1\n * (c) The Knockout.js team - http://knockoutjs.com/\n * License: MIT (http://w"
  },
  {
    "path": "app/public/scripts/showHTMLComplete.js",
    "chars": 2113,
    "preview": "window.URL = window.URL || window.webkitURL;\nconst getFilenameMime = (fileName, CallBack) => {\n    const exc = fileName."
  },
  {
    "path": "app/public/scripts/showHTMLComplete.ts",
    "chars": 1818,
    "preview": "\nwindow.URL = window.URL || window.webkitURL\ndeclare const JSZip\n\nconst getFilenameMime = ( fileName: string, CallBack )"
  },
  {
    "path": "app/public/scripts/siteShare.js",
    "chars": 213938,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/siteShare.ts",
    "chars": 210382,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/public/scripts/socket.io.js",
    "chars": 68686,
    "preview": "/*!\n * Socket.IO v2.3.0\n * (c) 2014-2019 Guillermo Rauch\n * Released under the MIT License.\n */\n!function(t,e){\"object\"="
  },
  {
    "path": "app/tools/1231B119.pem",
    "chars": 12075,
    "preview": "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmDMEXjMkUBYJKwYBBAHaRw8BAQdAFD5n6LecvYdEOn65nCjOvn/C2bco7JPkGg2a\nxY0rGoa0NEtsb2FrI"
  },
  {
    "path": "app/tools/coNETConnect.js",
    "chars": 5600,
    "preview": "\"use strict\";\n/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, "
  },
  {
    "path": "app/tools/coNETConnect.ts",
    "chars": 5005,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/tools/compress.js",
    "chars": 14589,
    "preview": "\"use strict\";\n/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, "
  },
  {
    "path": "app/tools/compress.ts",
    "chars": 12678,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/tools/imap.js",
    "chars": 50785,
    "preview": "\"use strict\";\n/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, "
  },
  {
    "path": "app/tools/imap.ts",
    "chars": 52093,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "app/tools/initSystem.js",
    "chars": 27193,
    "preview": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*!\n * Copyright 2018 CoNET Technology Inc."
  },
  {
    "path": "app/tools/initSystem.ts",
    "chars": 24011,
    "preview": "\n\n/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 "
  },
  {
    "path": "app/views/Shared/CoNETConnectInfo.pug",
    "chars": 745,
    "preview": "#connectInformationMessage\n\n    <!-- ko if: connectInformationMessage -->\n    <!-- ko with: connectInformationMessage --"
  },
  {
    "path": "app/views/Shared/CoSearchLayout.pug",
    "chars": 1200,
    "preview": "doctype html\nhtml\n\tinclude header_youtube\n\t//-<style> ::-webkit-scrollbar { display: none; } </style>\n\tbody#body( data-b"
  },
  {
    "path": "app/views/Shared/appHtml.pug",
    "chars": 49226,
    "preview": "\n\n#CoSearch\n\t<!-- ko with: appScript -->\n\t.backGroundSetup( data-bind = \" style: { background: searchItem() ? 'white' : "
  },
  {
    "path": "app/views/Shared/header.pug",
    "chars": 1360,
    "preview": "head\n\ttitle CoNET Platform\n\tmeta(charset = 'utf-8' )\n\tmeta(name = \"viewport\" content = \"width=device-width, initial-scal"
  },
  {
    "path": "app/views/Shared/mainMenu.pug",
    "chars": 1962,
    "preview": "\n\n#mainMenu_temp( data-bind = \"with: mainScript \" style = \"margin-top: 2em;\")\n\t.ui.divider\n\t.ui.header\n\t\t.content\n\t\t\tspa"
  },
  {
    "path": "app/views/home/Wrt.pug",
    "chars": 1059,
    "preview": "extends ../shared/coreLayout.pug\nblock jumbotron1\n\t\n\tsection.CoContent.content\n\t\t.ui.green.segment.CoGateCards( style=\"m"
  },
  {
    "path": "app/views/home/coSearchImage.html",
    "chars": 89250,
    "preview": "<svg version=\"1.1\" x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" viewBox=\"0 10 2880 1803.9\" preserveAspectRatio=\"xMidYMid meet\""
  },
  {
    "path": "app/views/home/customProxy.pug",
    "chars": 58,
    "preview": "extends ../shared/coreLayout.pug\nblock jumbotron1\n\tsection"
  },
  {
    "path": "app/views/home/index.pug",
    "chars": 24473,
    "preview": "extends ../shared/coreLayout.pug\nblock jumbotron\n\tinclude ../shared/CoNETConnectInfo\nblock jumbotron1\n\t<!-- ko if: showL"
  },
  {
    "path": "app/views/shared/coreLayout.pug",
    "chars": 1847,
    "preview": "doctype html\nhtml\n\tinclude header\n\tbody#body( data-bind = \" css: { 'bodyCoNETBlue': bodyBlue }\")\n\t\tblock jumbotron\n\t\tblo"
  },
  {
    "path": "index.html",
    "chars": 132,
    "preview": "<!DOCTYPE html>\n<html>\n  <head></head>\n  <body></body>\n  <script>\n    const server = require ('./app/main.js')\n  </scrip"
  },
  {
    "path": "index.js",
    "chars": 6168,
    "preview": "\"use strict\";\n/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, "
  },
  {
    "path": "index.ts",
    "chars": 6214,
    "preview": "/*!\n * Copyright 2018 CoNET Technology Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (t"
  },
  {
    "path": "package.json",
    "chars": 2406,
    "preview": "{\n  \"name\": \"conet_client\",\n  \"version\": \"3.3.0\",\n  \"license\": \"MIT\",\n  \"description\": \"CoNET platform\",\n  \"scripts\": {\n"
  },
  {
    "path": "tsconfig.json",
    "chars": 179,
    "preview": "{\n    \"compilerOptions\": {\n        \"target\": \"es2020\",\n        \"module\": \"commonjs\",\n        \"allowJs\": true\n    },\n    "
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the QTGate/QTGate-Desktop-Client GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 64 files (1.4 MB), approximately 567.5k tokens, and a symbol index with 658 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!