{% import 'search_properties/_macros.twig' as macros %}
<header class='z-3 no-scrollbar-flicker bg-white border-bottom header-offers'>
<div class='grid-container fluid'>
<div class='grid-x grid-margin-x align-middle header-height-offers'>
<div class='shrink large-2 cell' :class='{"show-for-xlarge": showDetail}'>
<div class='header-height-offers flex-container align-middle'>
<a href='/' class='header-logo c-dark-blue'>
{% include 'search_properties/elements/logo.svg.twig' with { attrs: 'width="180" height="45"' } %}
</a>
</div>
</div>
<div class="auto cell pr-hamburger-width">
<button @click='closeDetail' v-show="showDetail" style='display: none'
class='button-reset t-label-regular icon-left icon-left--text-visible border hover-bc-dark-blue c-black'
>
<svg width="17" height="9">
<g class='scale-x--1'>
<use xlink:href='#arrow-small' />
</g>
</svg>
{{'Retour aux résultats'|trans|capitalize}}
</button>
<form v-show="!showDetail" class='offers-search show-for-xlarge'>
<div class='grid-x'>
<div class='shrink cell'>
<div class='dropdown dropdown--hoverable mr-32'>
<div class='bg-dark-blue c-white bg-arrow px-24 py-24'>
<p class='t-label-regular mr-12'
v-text='rent ? "{{'Louer'|trans|capitalize}}" : "{{'Acheter'|trans|capitalize}}"'
></p>
</div>
<div class='dropdown__body bg-white z-2'>
<ul>
<li class='list-style-none'>
<a href='#' class='checkbox border-bottom checkbox-dropdown-item checkbox-dropdown-item--py-24 px-24 t-label-regular ws-nowrap'
@click.prevent='rent = !rent'
v-text='rent ? "{{'Acheter'|trans|capitalize}}" : "{{'Louer'|trans|capitalize}}"'
></a>
</li>
</ul>
</div>
</div>
</div>
<label class='small-2 cell border hover-bc-dark-blue custom-multiselect custom-multiselect--topbar'>
<locations-picker
v-model="filters.location"
url="{{path('offers_locations_autocomplete')}}"
placeholder="{{'Localité(s) (Canton, ville, NPA)'|trans}}"
:limit="topbarOptionsLimit"
open-direction="bottom"
/>
</label>
<label class='small-1 cell border hover-bc-dark-blue custom-multiselect custom-multiselect--topbar' v-show="isRadiusEnabled">
<multiselect
v-model="filters.radius"
:options="{{radiusOptions | json_encode}}"
placeholder="{{'Radius'|capitalize}}"
open-direction="bottom"
:show-labels="false"
:option-height="49"
:searchable="false"
:max-height="320"
open-direction="bottom"
>
<div slot='singleLabel' slot-scope='{ option }'>
<span v-text='"+" + option + "km"'></span>
</div>
<span class="checkbox checkbox--radio" slot='option' slot-scope='{ option }'>
<span class='checkbox__fake' :class='{"checkbox__fake--active": filters.radius && filters.radius == option }'>
<svg width='10' height='10' viewBox='0 0 10 10'>
<polyline points='2,5 4,7 8,3'></polyline>
</svg>
</span>
<span class='checkbox__label t-label-regular' v-text='option + "km"'></span>
</span>
</multiselect>
</label>
<div class='small-3 cell border hover-bc-dark-blue custom-multiselect custom-multiselect--topbar'>
<multiselect
v-model="filters.type"
:multiple="true"
:options="{{categories | json_encode}}"
placeholder="{{'type(s) de bien'|capitalize}}"
open-direction="bottom"
:show-labels="false"
:option-height="49"
:searchable="false"
:limit="topbarOptionsLimit"
:limit-text="count => `+${count}`"
:max-height="320"
>
<span class="checkbox" slot='option' slot-scope='props'>
<span class='checkbox__fake' :class='{"checkbox__fake--active": filters.type && filters.type.includes(props.option) }'>
<svg width='10' height='10' viewBox='0 0 10 10'>
<polyline points='2,5 4,7 8,3'></polyline>
</svg>
</span>
<span class='checkbox__label t-label-regular' v-text='props.option'></span>
</span>
</multiselect>
</div>
<div class='auto cell grid-x'>
<div class='auto cell dropdown border hover-bc-dark-blue' tabindex='0'>
<div class='input-block skip' :class='{"input-block_collapsed": !!surfaceSelectionDisplay}'>
<span class='input-label t-label-regular'>{{'surface'|trans|title}}</span>
<input class='input-field t-label-regular c-dark-blue' disabled tabindex='-1' :value='surfaceSelectionDisplay'>
</div>
<div class='dropdown__body dropdown__body--auto dropdown__body--auto-height bg-white z-2'>
<div class='flex-container py-16'>
<div class='px-16'>
<number-input-with-suggestions input-class='simple-input number-input-reset w-176'
v-model='filters.surfaceMin' :suggestions='minSurfaceSuggestions' :format-option='formatSurfaceOption'
placeholder='Min' @change='handleFiltersChange'>
</div>
<div class='border-right o-02'></div>
<div class='px-16 text-right'>
<number-input-with-suggestions input-class='simple-input number-input-reset w-176'
v-model='filters.surfaceMax' :suggestions='maxSurfaceSuggestions' :format-option='formatSurfaceOption'
placeholder='Max' @change='handleFiltersChange'>
</div>
</div>
</div>
</div>
</div>
<div class='auto cell dropdown border hover-bc-dark-blue' tabindex='0'>
<div class='input-block skip' :class='{"input-block_collapsed": priceSelectionDisplay}'>
<span class='input-label t-label-regular' v-text='rent ? "{{'loyer'|trans|title}}" : "{{'budget'|trans|title}}"'></span>
<input class='input-field t-label-regular c-dark-blue' disabled tabindex='-1' :value='priceSelectionDisplay'>
</div>
<div class='dropdown__body dropdown__body--auto dropdown__body--right dropdown__body--auto-height bg-white z-2 py-16'>
<div class='grid-x px-16 mb-16' v-if='rent'>
<button type='button' class='button-reset t-label-regular small-tab-button small-6 cell text-center bg-white'
:class='{"active": !filters.priceSqm}'
@click='togglePricePerSqm(false)'
>
<span v-if="rent">{{'par mois'|trans|capitalize}}</span>
<span v-else>{{'totale'|trans|capitalize}}</span>
</button>
<button type='button' class='button-reset t-label-regular small-tab-button small-6 cell text-center bg-white'
:class='{"active": filters.priceSqm}'
@click='togglePricePerSqm(true)'
>
{{'par m²'|trans|capitalize}} <span v-if="rent">{% if app.request.locale == "en" %}/year{% else %}/an{% endif %}</span>
</button>
</div>
<div class='flex-container'>
<div class='px-16'>
<number-input-with-suggestions v-if="filters.priceSqm" input-class='simple-input number-input-reset w-176'
v-model='filters.priceSqmMin' :suggestions='minPriceSuggestions' :format-option='formatPriceOption'
placeholder='Min' @change='handleFiltersChange'></number-input-with-suggestions>
<number-input-with-suggestions v-else input-class='simple-input number-input-reset w-176'
v-model='filters.priceMin' :suggestions='minPriceSuggestions' :format-option='formatPriceOption'
placeholder='Min' @change='handleFiltersChange'></number-input-with-suggestions>
</div>
<div class='border-right o-02'></div>
<div class='px-16 text-right'>
<number-input-with-suggestions v-if="filters.priceSqm" input-class='simple-input number-input-reset w-176'
v-model='filters.priceSqmMax' :suggestions='maxPriceSuggestions' :format-option='formatPriceOption'
placeholder='Max' @change='handleFiltersChange'></number-input-with-suggestions>
<number-input-with-suggestions v-else input-class='simple-input number-input-reset w-176'
v-model='filters.priceMax' :suggestions='maxPriceSuggestions' :format-option='formatPriceOption'
placeholder='Max' @change='handleFiltersChange'></number-input-with-suggestions>
</div>
</div>
</div>
</div>
<div class='shrink cell flex-container align-middle'>
{{macros.checkbox({name: 'onlyNew', value: 'Projets neufs'|trans, class: 'px-16 ws-nowrap', attrs: {
'v-model': 'filters.isNewProject'
}})}}
{# {{macros.checkbox({name: 'link360', value: 'Vue 360°', class: 'checkbox-dropdown-item checkbox-dropdown-item--py-24 px-16 ws-nowrap', attrs: {
'v-model': 'filters.has360'
}})}} #}
</div>
</div>
</form>
</div>
</div>
</div>
<div class='border-top hide-for-xlarge px-16 py-16' v-if='!showDetail && !showMobileFilters'>
<button class='button-reset w-100 icon-left icon-left--text-visible icon-left--center pr-32 border bc-dark-blue c-dark-blue grid-x'
@click='showMobileFilters = true'>
<svg width='16' height='16'><use xlink:href='#search-16' /></svg>
<span class='t-button-medium auto cell'>{{'Rechercher'|trans|title}}</span>
</button>
</div>
</header>