<div class="app-header bg-header-1">
    <div class="layout-fixed full-h text-center">
        <div class="full-h v-bottom-i pdB15">
            <div class="app-content-header bg-header-1">
                <div class="text-title-header-1 nowrap mgT10">Search message</div>
            </div>
        </div>
    </div>
    <button class="popup-back-button bg-transparent pd0-i biger-3-time" type="button" ng-click="closeTarget('#popupChatSearchChat')"></button>
</div>
<div class="app-content">
    <div class="app-content-inner content-pd">
        <ion-scroll class="scroll-area" direction="y" has-bouncing="false" overflow-scroll="false" delegate-handle="scrollerPopupChatSearchChat" on-scroll="scrollContent('scrollerPopupChatSearchChat')">
            <div class="box-setting-4 form-field-container no-saperator">
                <div class="content content-in">
                    <div class="itm">
                        <label class="label-form-field-1">Search in</label>
                        <div class="layout-fixed">
                            <div>
                                <div class="input-form-field-1" ng-click="focusHandle($event)">
                                    <input type="text" class="h32px" name="" value="{{dataSearchChat.in}}" placeholder="">
                                    <div class="sign-r clear">
                                        <button class="bg-transparent full-h right pdR10" type="button">
                                            <svg class="h17px clr-symbol-clickable" viewBox="0 0 63.215 63.215"><path fill="#1075BB" d="M59.807,15.717L31.491,43.791L3.419,15.475c-0.777-0.785-2.044-0.789-2.828-0.012c-0.784,0.777-0.789,2.044-0.012,2.827    l29.194,29.448c0.365,0.368,0.835,0.563,1.312,0.589c0.139,0.008,0.278-0.001,0.415-0.021c0.054,0.008,0.106,0.021,0.16,0.022    c0.544,0.029,1.099-0.162,1.515-0.576l29.447-29.196c0.785-0.777,0.79-2.043,0.012-2.828    C61.856,14.943,60.59,14.939,59.807,15.717z" /></svg>
                                        </button>
                                    </div>
                                    <select ng-model="dataSearchChat.in" ng-init="dataSearchChat.in='person'" class="field-overlay">
                                        <option value="person">Person</option>
                                        <option value="room">Room</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="itm" ng-if="dataSearchChat.in == 'person'">
                        <label class="label-form-field-1">Select User</label>
                        <div class="layout-fixed">
                            <div>
                                <div class="input-form-field-1" ng-click="focusHandle($event)">
                                    <input autocomplete="off" class="ion-autocomplete" ion-autocomplete="" item-value-key="id" item-view-value-key="display_name"
                                           items-method="filterUserSearch(query)" items-method-value-key="items" items-removed-method="filterUserSearchRemoved(callback)"
                                           items-clicked-method="filterUserSearchClicked(callback)" max-selected-items="1" ng-model="dataSearchChat.user"
                                           placeholder="" type="text" required>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="itm" ng-if="dataSearchChat.in == 'room' ">
                        <label class="label-form-field-1">Select Room</label>
                        <div class="layout-fixed">
                            <div>
                                <div class="input-form-field-1" ng-click="focusHandle($event)">
                                    <input type="text" class="h32px" id="areaSearchRoom" value="{{dataSearchChat.inRoom.name||'All'}}" placeholder="">
                                    <div class="sign-r clear">
                                        <button class="bg-transparent full-h right pdR10" type="button">
                                            <svg class="h17px clr-symbol-clickable" viewBox="0 0 63.215 63.215"> <g> <g> <path fill="#1075BB" d="M59.807,15.717L31.491,43.791L3.419,15.475c-0.777-0.785-2.044-0.789-2.828-0.012c-0.784,0.777-0.789,2.044-0.012,2.827    l29.194,29.448c0.365,0.368,0.835,0.563,1.312,0.589c0.139,0.008,0.278-0.001,0.415-0.021c0.054,0.008,0.106,0.021,0.16,0.022    c0.544,0.029,1.099-0.162,1.515-0.576l29.447-29.196c0.785-0.777,0.79-2.043,0.012-2.828    C61.856,14.943,60.59,14.939,59.807,15.717z" /> </g> </g> </svg>
                                        </button>
                                    </div>
                                    <select class="field-overlay" ng-options="option.name for option in rooms track by option.id" ng-model="dataSearchChat.inRoom">
                                        <option value="">All</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="itm" ng-if="dataSearchChat.in == 'room' && dataSearchChat.inRoom!='all' ">
                        <label class="label-form-field-1">Select User</label>
                        <div class="layout-fixed">
                            <div>
                                <div class="input-form-field-1" ng-click="focusHandle($event)">
                                    <input autocomplete="off" class="ion-autocomplete" ion-autocomplete="" item-value-key="id" item-view-value-key="display_name"
                                           items-method="filterUserSearch(query)" items-method-value-key="items" items-removed-method="filterUserSearchRemoved(callback)"
                                           items-clicked-method="filterUserSearchClicked2(callback)" max-selected-items="1" ng-model="dataSearchChat.userInRoom"
                                           placeholder="" type="text">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="itm">
                        <label class="label-form-field-1" ng-class="{ 'has-errors' : popupChatSearchChat.key.$invalid  }">Key word</label>
                        <div class="layout-fixed">
                            <div>
                                <div class="input-form-field-1" ng-class="{ 'has-errors' : popupChatSearchChat.key.$invalid  }" ng-click="focusHandle($event)">
                                    <input type="text" class="h32px" ng-model="dataSearchChat.key" required value="" name="key" placeholder="">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="itm">
                        <label class="label-form-field-1">Search condition</label>
                        <div class="layout-fixed">
                            <div>
                                <div class="input-form-field-1" ng-click="focusHandle($event)">
                                    <input type="text" class="h32px" name="" value="{{dataSearchChat.type}}" placeholder="">
                                    <div class="sign-r clear">
                                        <button class="bg-transparent full-h right pdR10" type="button">
                                            <svg class="h17px clr-symbol-clickable" viewBox="0 0 63.215 63.215"><path fill="#1075BB" d="M59.807,15.717L31.491,43.791L3.419,15.475c-0.777-0.785-2.044-0.789-2.828-0.012c-0.784,0.777-0.789,2.044-0.012,2.827    l29.194,29.448c0.365,0.368,0.835,0.563,1.312,0.589c0.139,0.008,0.278-0.001,0.415-0.021c0.054,0.008,0.106,0.021,0.16,0.022    c0.544,0.029,1.099-0.162,1.515-0.576l29.447-29.196c0.785-0.777,0.79-2.043,0.012-2.828    C61.856,14.943,60.59,14.939,59.807,15.717z" /></svg>
                                        </button>
                                    </div>
                                    <select class="field-overlay" id="newfeedtype_id" ng-model="dataSearchChat.type" ng-init="dataSearchChat.type='exact'">
                                        <option value="exact">Exact match</option>
                                        <option value="fuzzy">Fuzzy search</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="itm">
                        <div class="layout-fixed input-1-group">
                            <div>
                                <label class="label-form-field-1" ng-class="{ 'has-errors' : popupChatSearchChat.from.$invalid || popupChatSearchChat.to.$invalid }">Date</label>
                                <div class="layout-fixed">
                                    <div>
                                        <div class="input-form-field-1" ng-class="{ 'has-errors' : popupChatSearchChat.from.$invalid  }" ng-click="focusHandle($event)">
                                            <input type="text" class="h32px" name="dataSearchChat.from" value="{{dataSearchChat.from| date: 'MM/dd/yyyy'}}" placeholder="From">
                                            <div class="field-overlay datetime" date="" required ion-datetime-picker="" ng-model="dataSearchChat.from" name="from" only-valid="{'before': 'today', 'inclusive': true}">
                                                {{dataSearchChat.from| date: 'MM/dd/yyyy'}}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div>
                                <div class="layout-fixed">
                                    <div>
                                        <div class="input-form-field-1" ng-class="{ 'has-errors' : popupChatSearchChat.to.$invalid  }" ng-click="focusHandle($event)">
                                            <input type="text" class="h32px" name="dataSearchChat.to" placeholder="To" value="{{dataSearchChat.to| date: 'MM/dd/yyyy'}}">
                                            <div class="field-overlay datetime" date="" required ion-datetime-picker="" ng-model="dataSearchChat.to" name="to" only-valid="{'before': 'today', 'inclusive': true}">
                                                {{dataSearchChat.to| date: 'MM/dd/yyyy'}}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </ion-scroll>
    </div>
</div>
<div class="app-control">
    <div class="layout-fixed full-h pdT2">
        <div class="w42px full-h relative">
            <button class="bg-transparent pd0-i full text-left pdL10-i" type="button" onclick="openQuickOption(this)">
                <svg class="h20px" viewBox="0 0 460.713 460.713"><rect y="115.356" width="302" height="30" fill="#FFFFFF" /><polygon points="335.786,202.231 398.25,264.694 460.713,202.232  " fill="#FFFFFF" /><rect y="315.356" width="302" height="30" fill="#FFFFFF" /><rect y="215.356" width="302" height="30" fill="#FFFFFF" /></svg>
            </button>
            <div class="quick-popup box-popup-1 display-bottom-left mgB55" onclick="closeQuickOption(this)">
                <div class="popup-content w140px">
                    <ul class="list-item-03">
                        <li onclick="">
                            <div class="layout-fixed">
                                <div class="icon-area">
                                    <svg class="h15px" viewBox="0 0 423.755 423.755"><path d="M43.84,281.457c-18.585-44.869-18.586-94.29,0-139.159c10.649-25.709,26.678-48.152,46.86-66.135l60.86,60.86V15.099   H29.635l39.88,39.88c-64.293,58.426-88.5,153.2-53.391,237.959c14.167,34.202,37.07,64.159,66.234,86.634   c28.275,21.789,61.873,36.201,97.162,41.677l4.601-29.646C120.778,381.774,68.337,340.597,43.84,281.457z" fill="#FFFFFF" /><path d="M407.516,292.938c21.652-52.272,21.652-109.848,0-162.12c-14.167-34.202-37.071-64.159-66.234-86.633   C313.007,22.395,279.409,7.983,244.12,2.507l-4.601,29.646c63.342,9.829,115.783,51.005,140.28,110.146   c18.586,44.869,18.586,94.29,0,139.159c-10.649,25.709-26.678,48.152-46.859,66.135l-60.86-60.86v121.924h121.924l-39.801-39.801   C377.118,348.099,395.334,322.348,407.516,292.938z" fill="#FFFFFF" /></svg>
                                </div>
                                <div class="name-area text-link-1">
                                    Reset all
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="popup-overlay"></div>
            </div>
        </div>
        <div class="full-h">
            <button class="button-form-field-1 darkgray position-left full" type="button" ng-click="closeTarget('#popupChatSearchChat');">
                Cancel
            </button>
        </div>
        <div class="full-h">
            <button class="button-form-field-1 position-right full" type="submit" ng-disabled="popupChatSearchChat.$invalid">
                <svg class="icon h12px" viewBox="0 0 174.239 174.239"><path d="M172.032,161.492l-27.432-27.429c-0.277-0.277-0.633-0.399-0.939-0.624c26.711-31.913,25.119-79.643-4.86-109.622  C123.441,8.459,103.019,0,81.3,0C59.579,0,39.158,8.459,23.8,23.817c-31.707,31.707-31.707,83.298,0,115.001  c15.358,15.363,35.779,23.822,57.5,23.822c19.285,0,37.524-6.698,52.125-18.944c0.222,0.303,0.342,0.654,0.616,0.927l27.432,27.429  c1.458,1.458,3.369,2.188,5.28,2.188s3.824-0.729,5.28-2.188C174.949,169.135,174.949,164.409,172.032,161.492z M81.3,147.705  c-17.733,0-34.403-6.908-46.941-19.446c-25.883-25.883-25.883-67.994,0-93.882C46.897,21.838,63.568,14.935,81.3,14.935  c17.73,0,34.403,6.903,46.941,19.441c25.883,25.888,25.883,67.999,0,93.882C115.701,140.796,99.031,147.705,81.3,147.705z" /></svg>
                Search
            </button>
        </div>
    </div>
</div>
