import { NgModule }                     from '@angular/core'

// Router

import { SearchRouting }                    from './rte.search'

// Shared Modules
import { SharedModule }                 from '@k-core/modules/shared/mod.shared'
import { B2B_CommonSearchModule } from '@k-sites/b2b/common/search/com.search'

// Components
import { ToggleComponent }              from '@k-core/modules/search/components/toggle/cmp.toggle'
import { SearchResultsComponent }       from '@k-core/modules/search/components/results/cmp.results'

// Views
import { B2B_SearchView } from './page/cmp.view'


/**
 * Modules is un-importable, due to the fact, that the route
 * is set up as a lazyloadable route. If one is to load this, ensure that it is lazyloaded
 * and utilizes the technology for such.
 * 
 * If the module is imported, it will overrule the base route, due to the lazyloadable route,
 * and display this page instead
 * 
 * Search-partial module is created to be able to include search-input on any page, and
 * send the result to this module, allowing this to keep its lazyloadable state, while
 * still allowing a very simple module to be included for embedding search on different pages
 */
@NgModule({
    imports: [ 
        SharedModule,
        B2B_CommonSearchModule,
        SearchRouting,
    ],
    exports: [
        ToggleComponent,
        B2B_SearchView
    ],
    declarations: [
        // Components
        ToggleComponent,
        SearchResultsComponent,

        // Views
        B2B_SearchView
    ],
    providers: [
    ]
})

export class B2B_SearchModule {}
