.input-group
    input.search-input.form-control(
        type='text',
        [(ngModel)]='query',
        (ngModelChange)='onQueryChange()',
        [class.text-danger]='state.resultCount == 0',
        (click)='$event.stopPropagation()',
        (keyup.enter)='findPrevious()',
        (keyup.esc)='close.emit()',
        [placeholder]='"Search"|translate'
    )
    .input-group-text.result-counter(*ngIf='state.resultCount > 0') {{(state.resultIndex ?? 0) + 1}} / {{state.resultCount}}

ng-container(*ngIf='state.resultCount > 0')
    button.btn.btn-link(
        (click)='findPrevious()',
        ngbTooltip='Search up',
        placement='bottom',
        [fastHtmlBind]='icons.arrowUp'
    )

    button.btn.btn-link(
        (click)='findNext()',
        ngbTooltip='Search down',
        placement='bottom',
        [fastHtmlBind]='icons.arrowDown'
    )

.me-2

button.btn(
    (click)='options.caseSensitive = !options.caseSensitive; saveSearchOptions()',
    [class.btn-link]='!options.caseSensitive',
    [class.btn-info]='options.caseSensitive',
    ngbTooltip='Case sensitivity',
    placement='bottom',
    [fastHtmlBind]='icons.case'
)

button.btn(
    (click)='options.regex = !options.regex; saveSearchOptions()',
    [class.btn-link]='!options.regex',
    [class.btn-info]='options.regex',
    ngbTooltip='Regular expression',
    placement='bottom',
    [fastHtmlBind]='icons.regexp'
)

button.btn(
    (click)='options.wholeWord = !options.wholeWord; saveSearchOptions()',
    [class.btn-link]='!options.wholeWord',
    [class.btn-info]='options.wholeWord',
    ngbTooltip='Whole word',
    placement='bottom',
    [fastHtmlBind]='icons.wholeWord'
)

.me-2

button.btn.btn-link(
    (click)='close.emit()',
    [fastHtmlBind]='icons.close'
)
