!function(){"use strict";try{if("undefined"!=typeof document){var r=document.createElement("style");r.appendChild(document.createTextNode('._list_14fgh_1{gap:var(--half-gap-size);display:grid}._list_14fgh_1>*{order:1}@media screen and (min-width:1248px){._list_14fgh_1{grid-template-columns:repeat(4,1fr)}._list_14fgh_1 :nth-child(n+17){order:3}}@media screen and (max-width:1247px){._list_14fgh_1{grid-template-columns:repeat(3,1fr)}._list_14fgh_1 :nth-child(n+19){order:3}}@media screen and (max-width:1023px){._list_14fgh_1{grid-template-columns:repeat(2,1fr)}}@media screen and (max-width:639px){._list_14fgh_1{grid-template-columns:repeat(1,1fr)}}._list_14fgh_1 ._middleListComponent_14fgh_34{order:2;grid-column:1/-1}._paginate_14fgh_39{align-items:center;margin-top:2rem;display:flex}@media screen and (max-width:1023px){._paginate_14fgh_39 ._pageItem_14fgh_45:not(:-webkit-any(._previous_14fgh_45,._next_14fgh_45)){display:none}._paginate_14fgh_39 ._pageItem_14fgh_45:not(:-moz-any(._previous_14fgh_45,._next_14fgh_45)){display:none}._paginate_14fgh_39 ._pageItem_14fgh_45:not(:is(._previous_14fgh_45,._next_14fgh_45)){display:none}}._paginate_14fgh_39 ._pageItem_14fgh_45{cursor:pointer}._paginate_14fgh_39 ._pageItem_14fgh_45 ._pageItemLink_14fgh_52,._paginate_14fgh_39 ._pageItem_14fgh_45._previous_14fgh_45 a,._paginate_14fgh_39 ._pageItem_14fgh_45._next_14fgh_45 a{border:1px solid var(--primary-color);border-radius:min(var(--button-border-radius),var(--border-radius));color:var(--primary-color);min-width:45px;padding:0 10px;line-height:45px;transition:all .25s;display:block}._paginate_14fgh_39 ._pageItem_14fgh_45._disabledItemPage_14fgh_62{cursor:default;filter:grayscale();opacity:.5}._paginate_14fgh_39 ._pageItem_14fgh_45:not(._paginate_14fgh_39 ._pageItem_14fgh_45:-webkit-any(._previous_14fgh_45,._next_14fgh_45)) ._pageItemLink_14fgh_52{place-items:center;margin-inline-start:.5rem;margin-inline-end:.5rem;display:grid}._paginate_14fgh_39 ._pageItem_14fgh_45:not(._paginate_14fgh_39 ._pageItem_14fgh_45:-moz-any(._previous_14fgh_45,._next_14fgh_45)) ._pageItemLink_14fgh_52{place-items:center;margin-inline-start:.5rem;margin-inline-end:.5rem;display:grid}._paginate_14fgh_39 ._pageItem_14fgh_45:not(._paginate_14fgh_39 ._pageItem_14fgh_45:is(._previous_14fgh_45,._next_14fgh_45)) ._pageItemLink_14fgh_52{place-items:center;margin-inline-start:.5rem;margin-inline-end:.5rem;display:grid}._paginate_14fgh_39 ._pageItem_14fgh_45:not(._active_14fgh_72) ._pageItemLink_14fgh_52:-webkit-any(:hover,:focus-visible){background-color:var(--primary-background);opacity:.75;color:#fff}._paginate_14fgh_39 ._pageItem_14fgh_45:not(._active_14fgh_72) ._pageItemLink_14fgh_52:-moz-any(:hover,:focus-visible){background-color:var(--primary-background);opacity:.75;color:#fff}._paginate_14fgh_39 ._pageItem_14fgh_45:not(._active_14fgh_72) ._pageItemLink_14fgh_52:is(:hover,:focus-visible){background-color:var(--primary-background);opacity:.75;color:#fff}._paginate_14fgh_39 ._pageItem_14fgh_45:-webkit-any(._previous_14fgh_45,._next_14fgh_45):not(._disabledItemPage_14fgh_62) a:-webkit-any(:hover,:focus-visible){background-color:var(--primary-background);opacity:.75;color:#fff}._paginate_14fgh_39 ._pageItem_14fgh_45:-moz-any(._previous_14fgh_45,._next_14fgh_45):not(._disabledItemPage_14fgh_62) a:-moz-any(:hover,:focus-visible){background-color:var(--primary-background);opacity:.75;color:#fff}._paginate_14fgh_39 ._pageItem_14fgh_45:is(._previous_14fgh_45,._next_14fgh_45):not(._disabledItemPage_14fgh_62) a:is(:hover,:focus-visible){background-color:var(--primary-background);opacity:.75;color:#fff}._paginate_14fgh_39 ._pageItem_14fgh_45._active_14fgh_72 ._pageItemLink_14fgh_52{background-color:var(--primary-color);color:#fff}._paginate_14fgh_39 ._pageItem_14fgh_45._previous_14fgh_45{margin-right:auto}._paginate_14fgh_39 ._pageItem_14fgh_45._next_14fgh_45{margin-left:auto}._currentPageInfo_14fgh_88{text-align:center;color:var(--paragraph-color);margin-top:-2.3rem;display:block}@media screen and (min-width:1024px){._currentPageInfo_14fgh_88{display:none}}._observer_14fgh_100{background-color:purple;width:100vw;height:20px;position:fixed;bottom:20vh;left:0}._mainWrapper_z8uop_1{border-radius:var(--border-radius);flex-direction:column;justify-content:center;align-items:center;width:100%;margin-bottom:1.5em;padding:1em 1.5em;display:flex}._mainWrapper_z8uop_1 ._titleLine_z8uop_11{justify-content:center;align-items:center;gap:.5em;display:flex}._mainWrapper_z8uop_1 ._titleLine_z8uop_11 ._title_z8uop_11{color:var(--color);text-align:center;font-size:1.2em;font-weight:600}._mainWrapper_z8uop_1 ._titleLine_z8uop_11 ._link_z8uop_23{color:var(--primary-color);font-size:1.2em;font-weight:600;text-decoration:underline}._mainWrapper_z8uop_1 ._titleLine_z8uop_11 ._dash_z8uop_29{display:block}@media screen and (max-width:1023px){._mainWrapper_z8uop_1 ._titleLine_z8uop_11{flex-direction:column}._mainWrapper_z8uop_1 ._titleLine_z8uop_11 ._dash_z8uop_29{display:none}}._mainWrapper_z8uop_1 ._description_z8uop_40{color:var(--paragraph-color);text-align:center;margin-top:.4em;padding:0 5em;font-size:1em;font-weight:400}@media screen and (max-width:1023px){._mainWrapper_z8uop_1 ._description_z8uop_40{padding:0 1em}}@media screen and (max-width:399px){._mainWrapper_z8uop_1 ._description_z8uop_40{padding:0 .5em}}._layout_k7xb7_1{gap:var(--half-gap-size);flex-direction:column;display:flex}._emptyState_1b42a_1{text-align:center;grid-gap:15px;flex-flow:column;align-items:center;margin-block-start:15vh;margin-block-end:15vh;display:flex}._emptyState_1b42a_1 ._h1_1b42a_9{font-size:1.5rem;font-weight:600}._emptyState_1b42a_1 ._image_1b42a_13{width:auto;height:auto}._emptyState_1b42a_1 ._filter_1b42a_17{color:var(--primary-color);background:0 0;padding:0}._map_jynnk_1{border-radius:var(--border-radius);height:max(400px,100vh - 330px);overflow:hidden}._map_jynnk_1 ._skeleton_jynnk_6{background-color:var(--paragraph-color);place-items:center;height:80vh;display:grid}._map_jynnk_1 ._skeleton_jynnk_6 ._loadingIcon_jynnk_12{color:#fff;animation:3.5s linear infinite _rotate_jynnk_1}@keyframes _rotate_jynnk_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._header_13rc6_1{--buttonHeight:50px}._header_13rc6_1 ._numberOfResults_13rc6_4{color:var(--paragraph-color);font-size:1rem;font-weight:400}._header_13rc6_1 ._title_13rc6_9{-webkit-line-clamp:1;-webkit-box-orient:vertical;padding-right:.25em;font-size:1.5em;display:-webkit-box;overflow:hidden}._header_13rc6_1 ._title_13rc6_9 ._petCount_13rc6_17{color:var(--color);font-weight:700}._header_13rc6_1 ._filtersRow_13rc6_21{padding-top:var(--half-gap-size);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:1em;display:flex}@media screen and (max-width:1023px){._header_13rc6_1 ._filtersRow_13rc6_21{justify-content:center}._header_13rc6_1 ._filtersRow_13rc6_21>*{width:180px}}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37{border:2px solid var(--separator-color);border-radius:min(var(--button-border-radius),var(--border-radius));height:var(--buttonHeight);cursor:pointer;justify-content:center;align-items:center;padding-inline-start:1em;padding-inline-end:1em;transition:all .3s;display:flex}@media screen and (max-width:1023px){._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37{flex-grow:1}}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37:hover{opacity:.8}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37:focus-visible{opacity:.8}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37:focus-visible{outline:var(--focus-outline)}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37 ._text_13rc6_59{width:max-content;padding-left:.5rem;font-weight:600}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37 ._animateTrash_13rc6_64{animation:1s _trash_13rc6_1}@keyframes _trash_13rc6_1{10%{transform:rotate(20deg)translate(3px,-1px)}20%{transform:rotate(-20deg)translate(-3px,-1px)}30%{transform:rotate(15deg)translate(2px,-1px)}40%{transform:rotate(-10deg)translate(-1px,-1px)}50%{transform:rotate(10deg)translate(1px,-1px)}60%{transform:rotate(0)translate(0)}}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37 ._number_13rc6_4{background-color:var(--primary-color);text-align:center;color:#fff;border-radius:50px;width:1.3rem;height:1.3rem;margin-left:.5rem;font-size:.8rem;line-height:1.3rem}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37 ._number_13rc6_4._gray_13rc6_98{color:var(--paragraph-color);border:1px solid var(--separator-color);background-color:#0000}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37._mapButton_13rc6_103{min-width:165px}._header_13rc6_1 ._filtersRow_13rc6_21 ._filterButton_13rc6_37._interchangeButton_13rc6_106{background-color:var(--primary-color);border-color:var(--primary-color);color:#fff}._header_13rc6_1 ._filtersRow_13rc6_21 ._configs_13rc6_111{justify-content:right;align-items:center;gap:1em;min-width:min(250px,95vw);display:flex}@media screen and (max-width:1023px){._header_13rc6_1 ._filtersRow_13rc6_21 ._configs_13rc6_111{flex-grow:1;min-width:-moz-fit-content;min-width:fit-content}}@media screen and (min-width:1024px){._header_13rc6_1 ._filtersRow_13rc6_21 ._configs_13rc6_111{margin-left:auto}}._filterModal_y9qtf_1 .labelsWrapper{--marginVertical:calc(var(--modalPaddingVertical)*-1);--marginHorizontal:calc(var(--modalPaddingHorizontal)*-1);margin:var(--marginVertical)var(--marginHorizontal)var(--modalPaddingVertical)var(--marginHorizontal)}._filterModal_y9qtf_1 ._footerButtons_y9qtf_6{justify-content:space-between;align-items:center;display:flex}._filterModal_y9qtf_1 ._footerButtons_y9qtf_6 ._rightButtonContainer_y9qtf_11{justify-content:center;align-items:center;gap:5px;display:flex}._filterModal_y9qtf_1 ._footerButtons_y9qtf_6 ._rightButtonContainer_y9qtf_11 ._submitButton_y9qtf_17,._filterModal_y9qtf_1 ._footerButtons_y9qtf_6 ._rightButtonContainer_y9qtf_11 ._resetFilterButton_y9qtf_18{cursor:pointer;border-radius:var(--border-radius)}._filterModal_y9qtf_1 ._footerButtons_y9qtf_6 ._rightButtonContainer_y9qtf_11 ._cancelButton_y9qtf_22{border:2px solid var(--separator-color);background-color:var(--background-color);border-radius:var(--border-radius);color:var(--paragrph-color)}@media screen and (max-width:479px){._filterModal_y9qtf_1 ._footerButtons_y9qtf_6 ._rightButtonContainer_y9qtf_11 ._cancelButton_y9qtf_22{display:none}}._filterModal_y9qtf_1 ._footerButtons_y9qtf_6 ._resetFilterButton_y9qtf_18{color:var(--paragraph-color);background:0 0;padding:0;font-weight:600}._activeFilters_1nxgh_1{scroll-snap-type:x mandatory;justify-content:left;align-items:stretch;gap:var(--half-gap-size);flex-direction:row;gap:.5em;padding:0;scroll-padding:0 25px;display:flex;overflow-x:auto}._activeFilters_1nxgh_1>*{scroll-snap-align:start;min-width:240px}._activeFilters_1nxgh_1::-webkit-scrollbar{height:5px}._activeFilters_1nxgh_1::-webkit-scrollbar-thumb:horizontal{background:var(--paragraph-color);border-radius:100vmax}@media screen and (max-width:1023px){._activeFilters_1nxgh_1{display:none}}._activeFilters_1nxgh_1 ._activeFilterWrapper_1nxgh_30{padding-top:var(--half-gap-size);min-width:unset;padding-bottom:0}._activeFilters_1nxgh_1 ._activeFilterWrapper_1nxgh_30 ._activeFilter_1nxgh_1{color:var(--primary-color);border:1px solid var(--primary-color);border-radius:min(var(--button-border-radius),var(--border-radius));align-items:center;padding:.75em;display:flex}._activeFilters_1nxgh_1 ._activeFilterWrapper_1nxgh_30 ._activeFilter_1nxgh_1 ._activeFilterName_1nxgh_43{white-space:nowrap;padding-right:5px}._activeFilters_1nxgh_1 ._activeFilterWrapper_1nxgh_30 ._activeFilter_1nxgh_1 ._closeFilterIcon_1nxgh_47{color:var(--primary-color);cursor:pointer}._sortSelect_11k2l_1{border:2px solid var(--separator-color);border-radius:min(var(--button-border-radius),var(--border-radius));height:var(--buttonHeight);justify-content:right;align-items:center;display:flex}._sortSelect_11k2l_1:focus{outline:none!important}._interchangeModal_1spxz_1{max-width:min(640px,97vw)!important;overflow:visible!important}._interchangeModal_1spxz_1 ._footer_1spxz_5{justify-content:flex-end;gap:.625rem;display:flex}._interchangeModal_1spxz_1 ._footer_1spxz_5 ._resetButton_1spxz_10{color:var(--paragraph-color);background-color:#0000;border-radius:0;font-size:14px}._interchangeModal_1spxz_1 ._footer_1spxz_5 ._rightButtonsContainer_1spxz_16{gap:.625rem;margin-left:auto;display:flex}._interchangeModal_1spxz_1 ._footer_1spxz_5 ._rightButtonsContainer_1spxz_16 ._cancelButton_1spxz_21{border-radius:var(--border-radius);border:1px solid var(--color);color:var(--color);background-color:#0000;margin-left:auto}@media screen and (max-width:559px){._interchangeModal_1spxz_1 ._footer_1spxz_5 ._rightButtonsContainer_1spxz_16 ._cancelButton_1spxz_21{display:none}}._interchangeModal_1spxz_1 ._footer_1spxz_5 ._rightButtonsContainer_1spxz_16 ._submitButton_1spxz_33{border-radius:var(--border-radius)}._interchangeModal_1spxz_1 ._footer_1spxz_5 ._rightButtonsContainer_1spxz_16 ._submitButton_1spxz_33._disabled_1spxz_36{color:#c1c1c1;cursor:not-allowed;background-color:#e0e0e0}@media screen and (max-width:399px){._interchangeModal_1spxz_1{overflow:scroll!important}}._interchangeModal_1spxz_1 .modalHeader{border-radius:var(--border-radius)var(--border-radius)0 0!important}._interchangeModal_1spxz_1 .modalContentFlow{overflow:visible!important}._interchangeModal_1spxz_1 .modalFooter{border-radius:0 0 var(--border-radius)var(--border-radius)!important}._filterView_1utbo_1 form{flex-direction:column;gap:1.5rem;display:flex}._filterView_1utbo_1 form ._row_1utbo_6{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1.5rem .75rem;display:grid}._filterView_1utbo_1 form ._fieldLabel_1utbo_11{color:var(--color);padding-bottom:.5rem;font-weight:600;display:inline-block}._filterView_1utbo_1 form ._fieldLabel_1utbo_11._required_1utbo_17:after{content:"*";color:#e95853;padding-left:.125rem}._filterView_1utbo_1 form ._input_1utbo_22{border-radius:var(--border-radius-small);border:1px solid var(--separator-color);color:var(--paragraph-color);width:100%;height:44px;padding:.75rem .625rem;transition:border-color .2s ease-in-out}._filterView_1utbo_1 form ._input_1utbo_22::placeholder{color:var(--separator-color)}._filterView_1utbo_1 form ._input_1utbo_22:focus{border-color:var(--paragraph-color)}._filterView_1utbo_1 form ._input_1utbo_22[type=number]{-webkit-appearance:none;-moz-appearance:none;appearance:none}._filterView_1utbo_1 form ._input_1utbo_22[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}._filterView_1utbo_1 form ._input_1utbo_22[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;-moz-appearance:none;appearance:none}._filterView_1utbo_1 form ._options_1utbo_43{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));grid-auto-rows:1fr;gap:.75rem;display:grid}._filterView_1utbo_1 form ._options_1utbo_43 ._radioWrapper_1utbo_49{border-radius:var(--border-radius-small);border:1px solid var(--separator-color);color:var(--paragraph-color);cursor:pointer;align-items:center;padding:1rem .875rem;transition:all .3s;display:flex}._filterView_1utbo_1 form ._options_1utbo_43 ._radioWrapper_1utbo_49 ._radio_1utbo_49{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto;accent-color:var(--paragraph-color);margin-top:1px;display:inline-block}._filterView_1utbo_1 form ._options_1utbo_43 ._radioWrapper_1utbo_49 ._icon_1utbo_65{padding-left:.75rem}._filterView_1utbo_1 form ._options_1utbo_43 ._radioWrapper_1utbo_49 ._text_1utbo_68{padding-left:.625rem}._filterView_1utbo_1 form ._options_1utbo_43 ._radioWrapper_1utbo_49:hover{box-shadow:0 0 2px #2c2c2c55}._filterView_1utbo_1 form ._options_1utbo_43 ._radioWrapper_1utbo_49._selected_1utbo_74{border-color:var(--primary-color);color:var(--color);box-shadow:0 0 2px var(--primary-color)}._filterView_1utbo_1 form ._options_1utbo_43 ._radioWrapper_1utbo_49._selected_1utbo_74 ._radio_1utbo_49{accent-color:var(--primary-color)}._activeFilters_1aaia_1{scroll-snap-type:x mandatory;justify-content:left;align-items:stretch;gap:var(--half-gap-size);flex-direction:row;gap:.5em;padding:0;scroll-padding:0 25px;display:flex;overflow-x:auto}._activeFilters_1aaia_1>*{scroll-snap-align:start;min-width:240px}._activeFilters_1aaia_1::-webkit-scrollbar{height:5px}._activeFilters_1aaia_1::-webkit-scrollbar-thumb:horizontal{background:var(--paragraph-color);border-radius:100vmax}@media screen and (max-width:1023px){._activeFilters_1aaia_1{display:none}}._activeFilters_1aaia_1 ._activeFilterWrapper_1aaia_30{padding-top:var(--half-gap-size);min-width:unset;padding-bottom:0}._activeFilters_1aaia_1 ._activeFilterWrapper_1aaia_30 ._activeFilter_1aaia_1{color:var(--primary-color);border:1px solid var(--primary-color);border-radius:min(var(--button-border-radius),var(--border-radius));align-items:center;padding:.75em;display:flex}._activeFilters_1aaia_1 ._activeFilterWrapper_1aaia_30 ._activeFilter_1aaia_1 ._activeFilterName_1aaia_43{white-space:nowrap;text-transform:capitalize;padding-right:5px}._activeFilters_1aaia_1 ._activeFilterWrapper_1aaia_30 ._activeFilter_1aaia_1 ._closeFilterIcon_1aaia_48{color:var(--primary-color);cursor:pointer}')),document.head.appendChild(r)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}}();
import{r as e,j as a,L as s,p as r,as as n,at as t,ah as i,V as l,n as o,y as c,z as d,au as u,x as m,v as p,A as h,o as g,q as _,ap as x,av as v,aw as b,a0 as f,a2 as j,Y as N,ax as C,ay as y,az as k,aA as P,aB as T,aC as I,aD as S,aE as L,aF as F,aG as E,aH as R,aI as A,aJ as w,aK as B,aL as M,aM as O,aN as z,N as $,aO as D,aP as V,a7 as q,Q as H,a8 as U,aQ as W,aR as G,aS as Q,aT as Y,aU as J,a6 as K,aV as Z,aW as X}from"./modal-DHjdkE9t.js";import{R as ee}from"./react-paginate-DDi4CSkI.js";import{C as ae}from"./CTA-HoN7YRae.js";import se from"./Map-OgwvVZpm.js";import{I as re,a as ne,b as te}from"./interchange-BQ_MDuLl.js";import{C as ie,P as le,a as oe}from"./characteristic-DGl4zNUl.js";import{M as ce}from"./pets-Bcs4dSgB.js";function de(a){const[s,r]=e.useState(null),n=e.useRef(null);return{ref:e.useCallback((e=>{n.current&&(n.current.disconnect(),n.current=null),null!==e?(n.current=new IntersectionObserver((([e])=>{r(e)}),a),n.current.observe(e)):r(null)}),[null==a?void 0:a.rootMargin,null==a?void 0:a.root,null==a?void 0:a.threshold]),entry:s}}const ue="_list_14fgh_1",me="_middleListComponent_14fgh_34",pe="_paginate_14fgh_39",he="_pageItem_14fgh_45",ge="_previous_14fgh_45",_e="_next_14fgh_45",xe="_pageItemLink_14fgh_52",ve="_disabledItemPage_14fgh_62",be="_active_14fgh_72",fe="_currentPageInfo_14fgh_88",je="_mainWrapper_z8uop_1",Ne="_titleLine_z8uop_11",Ce="_title_z8uop_11",ye="_link_z8uop_23",ke="_dash_z8uop_29",Pe="_description_z8uop_40",Te=({title:e,description:r,link:n,backgroundColor:t})=>a.jsxs("div",{className:je,style:{backgroundColor:t},children:[a.jsxs("span",{className:Ne,children:[a.jsx("h3",{className:Ce,children:e}),n&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:ke,children:" - "}),a.jsx(s,{href:n.url,target:"_blank",className:ye,children:n.label})]})]}),a.jsx("p",{className:Pe,children:r})]}),Ie=({itemsPerPage:s,buildings:c=Array(s).fill(void 0),totalProperties:d=s,currentPage:u=1,currentPageSetter:m,middleListCTA:p,handleLoadMore:h,isFetching:g,campaignBanner:_})=>{const x=e.useRef(null),{realEstateData:v}=r(),b=Math.ceil(d/s),{cardComponent:f,contractParam:j}=e.useContext(n),N=!!(null==_?void 0:_.key)&&"true"===new URLSearchParams(window.location.search).get(null==_?void 0:_.key),{ref:C,entry:y}=de({root:x.current,threshold:.1});e.useEffect((()=>{(null==y?void 0:y.isIntersecting)&&!g&&h()}),[null==y?void 0:y.isIntersecting]);const k=e=>{if(e===c.length-1)return C};return a.jsxs("div",{className:"container",children:[_&&N&&a.jsx(Te,{..._}),a.jsxs("div",{className:ue,children:[null==c?void 0:c.map(((e,s)=>a.jsx(f,{cardRef:k(s),lazyLoadImage:s>8,styling:v.styling.verticalCards,data:e,showHighlightLevel:j?v.featuresIds.includes(t.HAS_HIGHLIGHTS_LABELS):void 0,contractToShow:j&&"permuta"!==j?i[j]:void 0},s))),g&&[...Array(8-Math.ceil(c.length%8))].map(((e,s)=>a.jsx(l,{},`skeleton-${s}`))),p&&a.jsx(ae,{config:p,className:me})]}),a.jsx(ee,{onPageChange:e=>{m(e.selected),window.scrollTo(0,0)},forcePage:u>b?void 0:u,pageCount:b,pageRangeDisplayed:8,marginPagesDisplayed:1,breakLabel:"...",previousLabel:"Anterior",nextLabel:"Próximo",className:pe,pageClassName:he,pageLinkClassName:xe,breakClassName:he,breakLinkClassName:xe,previousClassName:o(he,ge),nextClassName:o(he,_e),activeClassName:be,disabledClassName:ve}),a.jsxs("span",{className:fe,children:[u+1," de ",b]})]})},Se=({middleListCTA:s,campaignBanner:r})=>{const{jetimobData:t,currentPage:i,setCurrentPage:l,itemsPerPage:o,handleLoadMore:u,totalItems:m,isFetching:p}=e.useContext(n),h=null==t?void 0:t.map((e=>e.items)).flat(),[g]=c(),_=d();return e.useEffect((()=>{g.get("code")&&1===m&&_(h[0].url,{replace:!0})}),[m,g,h]),a.jsx(Ie,{buildings:h,itemsPerPage:o,totalProperties:m,currentPage:i,middleListCTA:s,campaignBanner:r,currentPageSetter:l,handleLoadMore:u,isFetching:p})},Le=({itemsPerPage:s,buildings:n=Array(s).fill(void 0),totalProperties:t=s,currentPage:i=1,currentPageSetter:c,middleListCTA:d,handleLoadMore:m,isFetching:p,campaignBanner:h})=>{const g=e.useRef(null),{realEstateData:_}=r(),x=Math.ceil(t/s),{cardComponent:v}=e.useContext(u),b=!!(null==h?void 0:h.key)&&"true"===new URLSearchParams(window.location.search).get(null==h?void 0:h.key),{ref:f,entry:j}=de({root:g.current,threshold:.1});e.useEffect((()=>{(null==j?void 0:j.isIntersecting)&&!p&&m()}),[null==j?void 0:j.isIntersecting]);const N=e=>{if(e===n.length-1)return f};return a.jsxs("div",{className:"container",children:[h&&b&&a.jsx(Te,{...h}),a.jsxs("div",{className:ue,children:[null==n?void 0:n.map(((e,s)=>a.jsx(v,{cardRef:N(s),lazyLoadImage:s>8,styling:_.styling.verticalCards,data:e},s))),p&&[...Array(8-Math.ceil(n.length%8))].map(((e,s)=>a.jsx(l,{},`skeleton-${s}`))),d&&a.jsx(ae,{config:d,className:me})]}),a.jsx(ee,{onPageChange:e=>{c(e.selected),window.scrollTo(0,0)},forcePage:i>x?void 0:i,pageCount:x,pageRangeDisplayed:8,marginPagesDisplayed:1,breakLabel:"...",previousLabel:"Anterior",nextLabel:"Próximo",className:pe,pageClassName:he,pageLinkClassName:xe,breakClassName:he,breakLinkClassName:xe,previousClassName:o(he,ge),nextClassName:o(he,_e),activeClassName:be,disabledClassName:ve}),a.jsxs("span",{className:fe,children:[i+1," de ",x]})]})},Fe=({middleListCTA:s,campaignBanner:r})=>{const{jetimobData:n,currentPage:t,setCurrentPage:i,itemsPerPage:l,handleLoadMore:o,totalItems:m,isFetching:p}=e.useContext(u),h=null==n?void 0:n.map((e=>e.items)).flat(),[g]=c(),_=d();return e.useEffect((()=>{g.get("code")&&1===m&&_(h[0].url,{replace:!0})}),[m,g,h]),a.jsx(Le,{buildings:h,itemsPerPage:l,totalProperties:m,currentPage:t,middleListCTA:s,campaignBanner:r,currentPageSetter:i,handleLoadMore:o,isFetching:p})},Ee="_layout_k7xb7_1",Re="_emptyState_1b42a_1",Ae="_h1_1b42a_9",we="_image_1b42a_13",Be="_filter_1b42a_17",Me=({className:e,title:s,subtitle:r,button:n,buildingType:t,...i})=>a.jsxs("div",{className:o(Re,e),...i,children:[a.jsx(m,{className:we,alt:"Desenho de uma casa com uma lupa por cima",image:{src:"pet"===t?"/static/images/petListEmptyState.png":"/static/images/listEmptyState.svg"}}),a.jsx("h1",{className:Ae,children:s}),r&&a.jsx("p",{children:r}),n&&a.jsx(p,{className:Be,onClick:n.onClick,children:n.text})]}),Oe="_map_jynnk_1",ze="_skeleton_jynnk_6",$e="_loadingIcon_jynnk_12",De=({...s})=>{var r,t,l;const{mapBackendPath:c,contractParam:d,searchParams:u,buildingType:m}=e.useContext(n),{jetimobData:p}=h(c??"",{contract:null==(r=i[d])?void 0:r.toString(),filter:null==u?void 0:u.toString()},{suspense:!1,revalidateOnFocus:!1}),_={markers:p,center:(null==(t=null==p?void 0:p[0])?void 0:t.position)??[0,0]};return a.jsx("div",{className:o("container",Oe),...s,children:p?(null==(l=_.markers)?void 0:l.some((e=>e.position[0]&&e.position[1])))?a.jsx(se,{mapData:_,defaultZoom:13}):a.jsx(Me,{title:"Nenhum imóvel encontrado",buildingType:m}):a.jsx("div",{className:ze,children:a.jsx(g,{icon:"loader",size:"3x",className:$e})})})},Ve="_header_13rc6_1",qe="_numberOfResults_13rc6_4",He="_title_13rc6_9",Ue="_filtersRow_13rc6_21",We="_filterButton_13rc6_37",Ge="_text_13rc6_59",Qe="_animateTrash_13rc6_64",Ye="_number_13rc6_4",Je="_gray_13rc6_98",Ke="_mapButton_13rc6_103",Ze="_interchangeButton_13rc6_106",Xe="_configs_13rc6_111",ea=e.createContext({});function aa({children:s}){var r,t,i;const l=e.useRef(null),[o,c]=_(["interchangeCookies"]),[d,u]=e.useState((null==(r=o.interchangeCookies)?void 0:r.interchangeType)??void 0),[m,p]=e.useState((null==(t=o.interchangeCookies)?void 0:t.price)??void 0),[h,g]=e.useState((null==(i=o.interchangeCookies)?void 0:i.propertyType)??void 0),{formValues:x,setFormValues:v}=e.useContext(n);return a.jsx(ea.Provider,{value:{interchangeType:d,setInterchangeType:u,price:m,setPrice:p,propertyType:h,setPropertyType:g,formSubmit:e=>{const a=Object.entries(e).reduce(((e,[a,s])=>s?{...e,[a]:s}:e),{}),s={...x,...Object.keys(a).length?{interchange:a}:{}};v(s),c("interchangeCookies",{...e},{path:"/",maxAge:604800})},formRef:l},children:s})}const sa="_filterModal_y9qtf_1",ra="_footerButtons_y9qtf_6",na="_rightButtonContainer_y9qtf_11",ta="_submitButton_y9qtf_17",ia="_resetFilterButton_y9qtf_18",la="_cancelButton_y9qtf_22",oa=({close:s})=>{const{formRef:r,totalCount:t,setFormValues:i,tab:l,resetForm:o}=e.useContext(n),c="/imoveis"===l,d=a.jsxs("div",{className:ra,children:[a.jsx(p,{as:"button",className:ia,onClick:()=>{o(),i({reset:!0})},children:"Limpar Filtros"}),a.jsxs("span",{className:na,children:[a.jsx(p,{as:"button",className:la,onClick:s,children:"Cancelar"}),a.jsxs(p,{as:"button",className:ta,onClick:()=>{(null==r?void 0:r.current)&&(r.current.handleSubmit(),s())},children:["Procurar imóveis ",!c&&(t>1e3?"(1000+)":`(${t.toString()})`)]})]})]});return a.jsx(x,{className:sa,icon:a.jsx(g,{icon:"sliders-simple"}),title:"Filtrar a busca do seu imóvel",footer:d,close:s,showHeader:!0,showClose:!0,children:a.jsx(e.Suspense,{fallback:a.jsx(v,{showTabs:!0}),children:a.jsx(b,{})})})},ca="_activeFilters_1nxgh_1",da="_activeFilterWrapper_1nxgh_30",ua="_activeFilter_1nxgh_1",ma="_activeFilterName_1nxgh_43",pa="_closeFilterIcon_1nxgh_47",ha=Object.freeze({ON_CONSTRUCTION:1,ON_BLUEPRINT:2,NEW_RELEASE:3,USED:4,DONE:5}),ga=Object.freeze({[ha.ON_CONSTRUCTION]:"Em construção",[ha.ON_BLUEPRINT]:"Na planta",[ha.NEW_RELEASE]:"Novo",[ha.USED]:"Usado",[ha.DONE]:"Pronto para morar"});Object.freeze(Object.entries(ga).reduce(((e,a)=>({...e,[a[0]]:{id:a[0],label:a[1]}})),{}));const _a=()=>{const{formValues:s,activeFilterLabels:r,setActiveFilterLabels:t,setFormValues:i}=e.useContext(n);return e.useEffect((()=>{t(va(s))}),[s]),r.length?a.jsx("div",{className:ca,children:r.map(((e,r)=>{if(e)return a.jsx("div",{className:da,children:a.jsxs("div",{className:ua,children:[a.jsx("span",{className:ma,children:e.label}),a.jsx(g,{icon:"xmark",className:pa,onClick:()=>xa(e,s,i)})]})},r)}))}):null},xa=(e,a,s)=>{var r,n,t,i,l;let o;["bedrooms","bathrooms","suites","garages"].includes(e.formInputName)?o={[e.formInputName]:""}:["property_type","characteristic","facility","status","purchase_options"].includes(e.formInputName)?(o={[e.formInputName]:a&&a[e.formInputName].filter((a=>a!==e.value))},o[e.formInputName].length||(o={[e.formInputName]:""})):"price_range"===e.formInputName||["rent_price_range","sell_price_range","season_price_range"].includes(e.formInputName)?o={[e.formInputName]:a&&(null==(r=a[e.formInputName])?void 0:r.min)&&(null==(n=a[e.formInputName])?void 0:n.max)&&(null==(t=a[e.formInputName])?void 0:t.price_range_checkbox)?"":{min:a&&(null==(i=a[e.formInputName])?void 0:i.min)?null:a&&a[e.formInputName].min,max:a&&(null==(l=a[e.formInputName])?void 0:l.max)?null:a&&a[e.formInputName].max}}:"interchange"===e.formInputName?o={[e.formInputName]:null}:"season_calendar"===e.formInputName&&(o={[e.formInputName]:null}),s((e=>({...e,...o,redirect:!0})))},va=e=>{var a,s,r,n,t,i,l,o,c,d,u,m;return e?[...ya(e),...fa(e,"bedrooms",f(e.bedrooms?Math.max(...e.bedrooms):0,"quarto","s"),e.bedrooms,null==(a=e.bedrooms)?void 0:a.length),...fa(e,"bathrooms",f(e.bathrooms?Math.max(...e.bathrooms):0,"banheiro","s"),e.bathrooms,null==(s=e.bathrooms)?void 0:s.length),...fa(e,"suites",f(e.suites?Math.max(...e.suites):0,"suite","s"),e.suites,null==(r=e.suites)?void 0:r.length),...fa(e,"garages",f(e.garages?Math.max(...e.garages):0,"garagem","-ns"),e.garages,null==(n=e.garages)?void 0:n.length),...Ca(e,e.property_type),...e.characteristic?e.characteristic.map((a=>Na(e,"characteristic",ie[a],a)[0])):[],...e.purchase_options?e.purchase_options.map((a=>Na(e,"purchase_options",le[a],a)[0])):[],...e.facility?e.facility.map((a=>Na(e,"facility",j[a],a)[0])):[],...e.status?e.status.map((a=>Na(e,"status",ga[a],a)[0])):[],...(null==(t=e.price_range)?void 0:t.price_range_checkbox)?e.price_range.price_range_checkbox.map((a=>{var s,r;return Na(e,"price_range_checkbox","Incluído preço de IPTU e condomínio",a,null==(r=null==(s=e.price_range)?void 0:s.price_range_checkbox)?void 0:r.length)[0]})):[],...Na(e,"price_range",`Preço maior que R$ ${N(null==(i=e.price_range)?void 0:i.min)}`,e.price_range,(null==(l=e.price_range)?void 0:l.min)&&!e.price_range.max),...Na(e,"price_range",`Preço menor que R$ ${N(null==(o=e.price_range)?void 0:o.max)}`,e.price_range,(null==(c=e.price_range)?void 0:c.max)&&!e.price_range.min),...Na(e,"price_range",`Preço entre R$ ${N(null==(d=e.price_range)?void 0:d.min)} e R$ ${N(null==(u=e.price_range)?void 0:u.max)}`,e.price_range,(null==(m=e.price_range)?void 0:m.min)&&e.price_range.max),...ba(e,"season_calendar"),...ja(e,"rent_price_range"),...ja(e,"rent_price_range"),...ja(e,"sell_price_range"),...ja(e,"season_price_range")]:[]},ba=(e,a)=>{var s,r,n,t;if(!(null==(s=e.season_calendar)?void 0:s.start_at)||!(null==(r=e.season_calendar)?void 0:r.end_at))return[];const i=`Aluguel para temporada entre ${C(null==(n=e.season_calendar)?void 0:n.start_at)} e ${C(null==(t=e.season_calendar)?void 0:t.end_at)}`;return[{formInputName:a,value:e.season_calendar,label:i}]},fa=(e,a,s,r,n=!0)=>{let t="";return e[a]&&(t=e[a].sort().map((e=>5===e?`${e}+`:e)).join(", ")+` ${s}`),e[a]&&n?[{formInputName:a,value:r,label:t}]:[]},ja=(e,a)=>{var s,r,n,t,i,l,o,c,d,u,m,p,h,g,_,x;if(!(null==(s=e[a])?void 0:s.min)&&!(null==(r=e[a])?void 0:r.max))return[];let v=`Preço de ${y[a.split("_")[0]]}`;(null==(n=e[a])?void 0:n.min)&&!(null==(t=e[a])?void 0:t.max)?v+=` maior que R$ ${N(null==(i=e[a])?void 0:i.min)}`:N(null==(l=e[a])?void 0:l.max)&&!N(null==(o=e[a])?void 0:o.min)?v+=` menor que R$ ${N(null==(c=e[a])?void 0:c.max)}`:N(null==(d=e[a])?void 0:d.min)&&N(null==(u=e[a])?void 0:u.max)&&(v+=` entre R$ ${N(null==(m=e[a])?void 0:m.min)} e R$ ${N(null==(p=e[a])?void 0:p.max)}`);return[{formInputName:a,value:{formInputName:e&&(null==(h=e[a])?void 0:h.min)&&(null==(g=e[a])?void 0:g.max)&&{min:e&&(null==(_=e[a])?void 0:_.min)?null:e&&e[a].min,max:e&&(null==(x=e[a])?void 0:x.max)?null:e&&e[a].max}},label:v}]},Na=(e,a,s,r,n=!0)=>e[a]&&n?[{formInputName:a,value:r,label:s}]:[],Ca=(e,a)=>e.property_type?a.map((a=>Na(e,"property_type",k[a],a)[0])):[],ya=e=>{var a,s,r,n,t,i,l,o;if(!e.interchange)return[];let c="Permuta: ";return(null==(a=e.interchange)?void 0:a.interchangeType)&&(c+=`${re[null==(s=e.interchange)?void 0:s.interchangeType]} `),(null==(r=e.interchange)?void 0:r.propertyType)&&(c+=` ${k[null==(n=e.interchange)?void 0:n.propertyType]}`),(null==(t=e.interchange)?void 0:t.price)&&(c+=` R$ ${N(null==(i=e.interchange)?void 0:i.price)} `),(null==(l=e.interchange)?void 0:l.location)&&(c+=` em ${null==(o=e.interchange)?void 0:o.location[0].label}`),[{formInputName:"interchange",label:c,value:0}]},ka="_sortSelect_11k2l_1";function Pa(){const{sortOption:s,setSortOption:t}=e.useContext(n),{realEstateData:i}=r(),l=i.isJetLar?P:T,o=I.filter((({value:e})=>l.includes(e)));return a.jsx(S,{options:o,value:o.find((({value:e})=>e===s)),isClearable:!1,isSearchable:!1,openMenuOnFocus:!0,styles:Ta,className:ka,onChange:e=>{e&&t(e.value)}})}const Ta={control:e=>({...e,border:"none",background:"transparent",boxShadow:"none",width:"100%",paddingLeft:".5rem",justifyContent:"space-between",":hover":{border:"none"}}),container:e=>({...e,width:"100%"}),option:(e,a)=>({...e,":active":{backgroundColor:"var(--gray-background)"},padding:15,borderBottom:"1px solid var(--separator-color)",backgroundColor:a.isFocused?"var(--gray-background)":"unset",color:"var(--color)",fontWeight:a.isSelected?"bold":"unset",cursor:"pointer"}),valueContainer:e=>({...e,padding:0}),indicatorSeparator:()=>({display:"none",padding:0}),indicatorsContainer:()=>({"*":{padding:0}}),menuList:e=>({...e,padding:0,backgroundColor:"var(--background-color)"}),menu:e=>({...e,overflow:"hidden",borderRadius:"var(--border-radius)",padding:0,zIndex:100}),singleValue:e=>({...e,color:"var(--paragraph-color)"})},Ia="_interchangeModal_1spxz_1",Sa="_footer_1spxz_5",La="_resetButton_1spxz_10",Fa="_rightButtonsContainer_1spxz_16",Ea="_cancelButton_1spxz_21",Ra="_submitButton_1spxz_33",Aa="_disabled_1spxz_36",wa="_filterView_1utbo_1",Ba="_row_1utbo_6",Ma="_fieldLabel_1utbo_11",Oa="_required_1utbo_17",za="_input_1utbo_22",$a="_options_1utbo_43",Da="_radioWrapper_1utbo_49",Va="_radio_1utbo_49",qa="_icon_1utbo_65",Ha="_text_1utbo_68",Ua="_selected_1utbo_74",Wa=Object.freeze(Object.entries(k).map((e=>({id:Number(e[0]),label:e[1]}))));function Ga({formRef:s,onSubmit:r,resetForm:n,closeModal:t}){const[i,l]=_(["interchangeCookies"]),[c,d]=e.useState(""),[u,m]=e.useState(null),p=L(F,(e=>e.updateMessages)),h=[...Wa],x=i.interchangeCookies??null,v={interchangeType:(null==x?void 0:x.interchangeType)??null,price:(null==x?void 0:x.price)??"",propertyType:(null==x?void 0:x.propertyType)??null,location:(null==x?void 0:x.location)??[]},[b,f]=e.useState(v),j=e=>{d("");const a=Number(e.target.value);f({interchangeType:a,price:void 0,propertyType:void 0,location:[]})},N=e.useCallback(E.debounce((async e=>{try{const a=await R.get("/real-estate-data/property/filter/generic-location",{params:{search:e,addressTypes:["state","city","neighborhood"]}});m(a.data)}catch(a){console.error("Erro ao buscar dados:",a)}}),500),[b.location]);e.useEffect((()=>{c.length<=3?m(null):N(c)}),[c,N]);return e.useEffect((()=>{n&&(d(""),f({interchangeType:void 0,price:void 0,propertyType:void 0,location:[]}))}),[n]),a.jsx("div",{className:wa,children:a.jsx(A,{initialValues:v,onSubmit:()=>{const e=Object.entries(b).reduce(((e,[a,s])=>Array.isArray(s)&&0===s.length?e:s?{...e,[a]:s}:e),{});0!==Object.keys(e).length?(l("interchangeCookies",{...e},{path:"/",maxAge:604800}),r(e),t()):z({description:"Por favor, preencha os campos obrigatórios do formulário.",updateMessages:p,iconOrigin:"MUI"})},innerRef:s,children:a.jsxs(w,{noValidate:!0,children:[a.jsxs("div",{children:[a.jsx("label",{className:o(Ma,Oa),children:"O que você pode oferecer como permuta?"}),a.jsxs("div",{className:$a,children:[a.jsx(B,{name:"interchangeType"}),ne.map((({value:e,label:s,icon:r})=>a.jsxs("label",{htmlFor:e.toString(),className:o(Da,{[Ua]:b.interchangeType===e}),children:[a.jsx(M,{className:Va,type:"radio",name:"interchangeType",value:e,id:e.toString(),onChange:j,checked:b.interchangeType===e}),a.jsx(g,{className:qa,icon:r,size:"1x"}),a.jsx("span",{className:Ha,children:s})]},s)))]})]}),a.jsxs("div",{className:Ba,children:[b.interchangeType===te.PROPERTY&&a.jsxs("div",{children:[a.jsx("label",{className:Ma,children:"Qual é o tipo de imóvel?"}),a.jsx(M,{component:S,options:O(h,"label"),name:"propertyType",value:h.find((e=>e.id===b.propertyType)),defaultValue:v.propertyType,onChange:e=>{f({...b,propertyType:null==e?void 0:e.id})},styles:Qa,placeholder:"Selecione o tipo de imóvel",noOptionsMessage:()=>"Nenhuma opção encontrada"})]}),a.jsxs("div",{children:[a.jsx("label",{className:Ma,children:"Qual é o valor?"}),a.jsx(B,{name:"price"}),a.jsx(M,{className:za,type:"text",inputMode:"numeric",value:b.price?(b.price/100).toLocaleString("pt-BR",{maximumFractionDigits:0,style:"currency",currency:"BRL"}):"",onChange:e=>{const a=Number(e.target.value.replace(/\D/g,""));f({...b,price:100*a})},placeholder:"R$ 0,00",name:"price"})]})]}),b.interchangeType===te.PROPERTY&&a.jsxs("div",{children:[a.jsx("label",{className:Ma,children:"Onde está localizado?"}),a.jsx(S,{value:b.location,onInputChange:e=>d(e),onChange:e=>{return a=[e],void f({...b,location:a});var a},options:u??[],name:"location",styles:Qa,placeholder:"Selecione a cidade ou bairro",filterOption:()=>!0,noOptionsMessage:()=>c.length>3?Array.isArray(u)?"Nenhuma opção encontrada":"Carregando...":"Digite para pesquisar",menuPlacement:"top"})]})]})})})}const Qa={control:e=>({...e,borderRadius:"var(--border-radius-small)",backgroundColor:"transparent",height:"44px",border:"1px solid var(--separator-color)",boxShadow:"none",transition:".3s",":hover, :active":{borderColor:"var(--paragraph-color)",boxShadow:"0 0 2px #2C2C2C55"}}),indicatorSeparator:()=>({display:"none"}),placeholder:e=>({...e,color:"var(--separator-color)"}),menu:e=>({...e,boxShadow:"0 0 5px #00000045",overflow:"hidden",borderRadius:"var(--border-radius-small)",padding:"0",zIndex:"9999",marginBottom:0,marginTop:0}),menuPortal:e=>({...e,zIndex:9999}),option:(e,a)=>({...e,":active":{backgroundColor:"var(--gray-background)"},padding:15,backgroundColor:a.isFocused?"var(--gray-background)":"unset",color:"var(--color)",cursor:"pointer"})},Ya=({close:s})=>{const r=e.useRef(null),{formValues:t,setFormValues:i}=e.useContext(n),[l,c]=e.useState(!1),d=a.jsxs(a.Fragment,{children:[a.jsx(p,{className:La,onClick:()=>(c(!0),void setTimeout((()=>{c(!1)}),250)),children:"Limpar Filtros"}),a.jsxs("div",{className:Fa,children:[a.jsx(p,{className:Ea,onClick:s,children:"Cancelar"}),a.jsx(p,{onClick:()=>{(null==r?void 0:r.current)&&r.current.handleSubmit()},className:o(Ra,{[Aa]:!1}),children:"Procurar imóveis compatíveis"})]})]});return a.jsx(x,{className:Ia,close:s,title:"Minha permuta",showClose:!0,showHeader:!0,footer:a.jsx("div",{className:Sa,children:d}),children:a.jsx(Ga,{formRef:r,onSubmit:e=>{i({...t,interchange:e,purchase_options:[oe.ACCEPTS_INTERCHANGE],redirect:!0})},resetForm:l,closeModal:s})})},Ja=()=>{var s;const[l,d]=e.useState(!1),[u,m]=e.useState(!1),{realEstateData:p}=r(),{jetimobData:h,formValues:_,setFormValues:x,activeFilterLabels:v,contractParam:b,buildingType:j,isMapOpen:N,setIsMapOpen:C,showMap:y,totalItems:k,setTab:P}=e.useContext(n),[T]=c(),[I,S]=e.useState(""),{discardedPropertiesIds:L,animateDiscard:F,openModal:E}=e.useContext($),{enterpriseLocationCookie:R}=e.useContext(D),A=()=>{W.flushSync((()=>{P(G(location.pathname))})),T&&x(V(T.toString())),d((e=>!e))},w=()=>{m((e=>!e))};e.useEffect((()=>{const e=V(T.toString(),!0);l&&d(!1),x(e)}),[T]),e.useEffect((()=>{"permuta"===b?S("que aceitam permuta"):q[i[b]]?S(`para ${q[i[b]].toLowerCase()}`):T.has("property_type_group")&&"1"===T.get("property_type_group")&&S("rurais")}),[h]),e.useEffect((()=>{"permuta"===b&&m(!0)}),[b]);const B=!!p.featuresIds.includes(t.HAS_INTERCHANGE_SEARCH)&&[H[U.SELL],"permuta"].includes(b);return a.jsxs("div",{className:o("container",Ve),children:[a.jsxs("span",{className:qe,children:[h&&k," ",f(k,"resultado","s")]}),a.jsx("span",{className:He,children:a.jsxs("h1",{children:[(()=>{switch(j){case"condominium":return"Condomínios";case"enterprise":return"Empreendimentos";default:return"Imóveis"}})(),_&&_.address&&!!(null==(s=_.address)?void 0:s.length)&&a.jsxs(a.Fragment,{children:[" ","em ",a.jsx("b",{children:_.address.map((e=>e.label)).join(" ou ")})]}),_&&_.coordinates&&a.jsxs(a.Fragment,{children:[" ",_.highlight&&"em destaque"," próximos a ",a.jsx("b",{children:R.address[0].label})]})]})}),a.jsxs("div",{className:Ue,children:[a.jsxs("button",{className:We,onClick:()=>A(),children:[a.jsx(g,{icon:"sliders-simple",size:"lg"}),a.jsx("span",{className:Ge,children:"Filtros"}),!!(null==v?void 0:v.length)&&a.jsx("span",{className:Ye,children:null==v?void 0:v.length})]}),B&&a.jsxs("button",{className:o(We,Ze),onClick:()=>w(),children:[a.jsx(g,{icon:"badge-dollar",size:"lg"}),a.jsx("span",{className:Ge,children:"Minha permuta"})]}),!!(null==L?void 0:L.length)&&a.jsxs("button",{className:We,onClick:()=>{E("discarded")},children:[a.jsx(g,{icon:"trash",className:o({[Qe]:F})}),a.jsx("span",{className:Ge,children:"Descartados"}),a.jsx("span",{className:o(Ye,Je),children:null==L?void 0:L.length})]}),a.jsxs("div",{className:Xe,children:[!N&&a.jsx(Pa,{}),y&&a.jsx("button",{className:o(We,Ke),onClick:()=>C((e=>!e)),children:N?a.jsxs(a.Fragment,{children:[a.jsx(g,{icon:"list",size:"lg"},1),a.jsx("span",{className:Ge,children:"Ver na Lista"})]}):a.jsxs(a.Fragment,{children:[a.jsx(g,{icon:"map",size:"lg"},2),a.jsx("span",{className:Ge,children:"Ver no Mapa"})]})})]})]}),a.jsx(_a,{}),l&&a.jsx(oa,{close:A}),u&&a.jsx(aa,{children:a.jsx(Ya,{close:w})})]})},Ka=({close:s})=>{const{formRef:r,totalCount:n,setFormValues:t,resetForm:i}=e.useContext(u),l=a.jsxs("div",{className:ra,children:[a.jsx(p,{as:"button",className:ia,onClick:()=>{var e;i(),t({reset:!0}),null==(e=r.current)||e.resetForm()},children:"Limpar Filtros"}),a.jsxs("span",{className:na,children:[a.jsx(p,{as:"button",className:la,onClick:s,children:"Cancelar"}),a.jsxs(p,{as:"button",className:ta,onClick:()=>{(null==r?void 0:r.current)&&(r.current.handleSubmit(),s())},children:["Procurar pets",n>1e3?"(1000+)":` (${n.toString()})`]})]})]});return a.jsx(x,{className:sa,title:"Filtrar a busca do pet",footer:l,close:s,showHeader:!0,showClose:!0,children:a.jsx(e.Suspense,{fallback:a.jsx(v,{showTabs:!0}),children:a.jsx(Q,{})})})},Za="_activeFilters_1aaia_1",Xa="_activeFilterWrapper_1aaia_30",es="_activeFilter_1aaia_1",as="_activeFilterName_1aaia_43",ss="_closeFilterIcon_1aaia_48",rs=()=>{const{formValues:s,activeFilterLabels:r,setActiveFilterLabels:n,setFormValues:t}=e.useContext(u),{jetimobData:i}=h("/pets/form-build");if(e.useEffect((()=>{n(ns(s,i))}),[s]),!r.length)return null;return a.jsx("div",{className:Za,children:r.map(((e,r)=>{if(e)return a.jsx("div",{className:Xa,children:a.jsxs("div",{className:es,children:[a.jsx("span",{className:as,children:e.label}),a.jsx(g,{icon:"xmark",className:ss,onClick:()=>((e,a)=>{const r={...s};Array.isArray(r[e])?(r[e]=r[e].filter((e=>e!==a)),r[e].length||delete r[e]):r[e]="",t({...r,redirect:!0})})(e.formInputName,e.value)})]})},`active-filter-${e.label}`)}))})},ns=(e,a)=>{if(!a||!e)return[];const s=(e,s)=>{const r=(e=>{const s=a[ce[e]];return Array.isArray(s)?s.find((a=>a.name===e)).options:(null==s?void 0:s.options)?s.options:[]})(e),n=r.find((e=>e.value===s));return n?n.label:s};return Object.entries(e).filter((([e,a])=>!["reset","sort","page","excluded_properties"].includes(e))).reduce(((e,[a,r])=>{if("address"===a){const a=ts(r);if(a)return[...e,...a]}if(r&&0!==r.length){if(Array.isArray(r))return r.forEach((r=>{e.push({label:s(a,r),value:r,formInputName:a})})),e;e.push({label:s(a,r),value:r,formInputName:a})}return e}),[])},ts=e=>e?e.map((e=>({label:e.label,value:e,formInputName:"address"}))):null,is=()=>{const{jetimobData:s,totalCount:r,setFormValues:n,activeFilterLabels:t}=e.useContext(u),[i,l]=e.useState(!1),[d]=c(),m=()=>{d&&n(V(d.toString())),l((e=>!e))};return e.useEffect((()=>{const e=V(d.toString(),!0);i&&l(!1),n(e)}),[d]),a.jsxs("div",{className:o("container",Ve),children:[a.jsxs("span",{className:qe,children:[s&&r," ",f(r,"resultado","s")]}),a.jsx("span",{className:He,children:"Pets para adotar"}),a.jsx("div",{className:Ue,children:a.jsxs("button",{className:We,onClick:()=>m(),children:[a.jsx(g,{icon:"sliders-simple",size:"lg"}),a.jsx("span",{className:Ge,children:"Filtros"}),!!(null==t?void 0:t.length)&&a.jsx("span",{className:Ye,children:null==t?void 0:t.length})]})}),a.jsx(rs,{}),i&&a.jsx(Ka,{close:m})]})},ls=({buildingType:e,listBackendPath:s,filterBackendPath:r,mapBackendPath:n,cardComponent:t,showMap:i,middleListCTA:l,campaignBanner:o,showStatus:c=!1,isEnterprise:d=!1})=>"pet"===e?a.jsx(Y,{listBackendPath:s,mapBackendPath:n,cardComponent:t,buildingType:e,filterBackendPath:r,showMap:i,children:a.jsx(os,{middleListCTA:l,campaignBanner:o})}):a.jsx(J,{listBackendPath:s,mapBackendPath:n,cardComponent:t,buildingType:e,filterBackendPath:r,showMap:i,showStatus:c,isEnterprise:d,children:a.jsx(cs,{middleListCTA:l,campaignBanner:o})}),os=({middleListCTA:s,campaignBanner:r})=>{const{jetimobData:n,buildingType:t,totalItems:i}=e.useContext(u),l=void 0===n||i>0;return a.jsxs("div",{className:o(Ee,"container"),children:[a.jsx(is,{}),a.jsx(K,{condition:l,children:a.jsx(Fe,{middleListCTA:s,campaignBanner:r})}),a.jsx(K,{condition:!l,children:a.jsx(Me,{title:"Nenhum pet encontrado",buildingType:t})})]})},cs=({middleListCTA:s,campaignBanner:r})=>{const{jetimobData:t,isMapOpen:i,buildingType:l,totalItems:c}=e.useContext(n);e.useEffect((()=>{Z(X)&&i&&window.scrollTo({behavior:"smooth",top:150})}),[i]);const d=void 0===t||c>0;return a.jsxs("div",{className:o(Ee,"container"),children:[a.jsx(Ja,{}),d?i?a.jsx(De,{id:"mapContainer"}):a.jsx(Se,{middleListCTA:s,campaignBanner:r}):a.jsx(Me,{title:"Nenhum imóvel encontrado",buildingType:l})]})};export{ls as L};