1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8646],{3381:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});let l=(0,r(17963).A)("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]])},5427:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});let l=(0,r(17963).A)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]])},14228:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/projects/housing",function(){return r(49849)}])},46930:(e,t,r)=>{"use strict";r.d(t,{y:()=>s});var l=r(37876);function s(e){let{message:t,tone:r="info",className:s=""}=e;return(0,l.jsx)("div",{role:"error"===r?"alert":"status","aria-atomic":"true",className:"fixed right-4 z-50 px-4 py-2 rounded-full shadow-lg text-sm font-semibold ".concat("success"===r?"bg-emerald-600 text-white":"error"===r?"bg-red-600 text-white":"bg-gray-800 text-white"," ").concat(s," bottom-[calc(env(safe-area-inset-bottom)+4.5rem)] md:bottom-4"),children:t})}},49849:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>R});var l=r(37876),s=r(14232),a=r(89099),i=r(5427),n=r(64041),o=r(76158),c=r(28249),d=r(77328),u=r.n(d),m=r(67915),h=r(62097),p=r(88509),x=r(95680),g=r(46930),b=r(93851),f=r(68425),y=r(54587),v=r.n(y),j=r(6781),w=r(73305),N=r(3381);function S(e){var t,r,s;let{listing:a,onOpen:i,onContact:n}=e,{t:o}=(0,p.o)(),c=[a.city,a.state].filter(Boolean).join(", "),d=a.area?" - ".concat(a.area):"",u=(0,f.H)(a.listing_type),m=a.listing_type?u?o(u):a.listing_type:"",h=null==(t=a.photos)?void 0:t[0];return(0,l.jsxs)("article",{className:"rounded-2xl border bg-white shadow-card overflow-hidden flex flex-col cursor-pointer hover:shadow-lg transition ".concat(a.is_promoted?"border-amber-200 ring-1 ring-amber-200/60":"border-emerald-100"),role:"button",tabIndex:0,onClick:i,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),i())},children:[(0,l.jsxs)("div",{className:"relative h-36",children:[h?(0,l.jsx)(v(),{src:h,alt:a.title,fill:!0,sizes:"(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 33vw",className:"object-cover"}):(0,l.jsx)("div",{className:"h-36 w-full bg-gradient-to-br from-emerald-100 via-amber-50 to-white flex items-center justify-center text-emerald-700 font-semibold",children:(null==(r=a.title)?void 0:r.charAt(0))||"H"}),a.is_promoted&&(0,l.jsx)("span",{className:"absolute left-3 top-3 rounded-full bg-white/90 border border-amber-200 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-amber-800",children:o("housingPromotedTag")})]}),(0,l.jsxs)("div",{className:"p-4 space-y-2 flex-1 flex flex-col",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("h3",{className:"text-base font-semibold text-gray-900",children:a.title}),(0,l.jsxs)("p",{className:"text-xs text-gray-500 flex items-center gap-1",children:[(0,l.jsx)(j.A,{size:12,className:"text-emerald-600"}),c," ",d]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsxs)("p",{className:"text-sm font-semibold text-emerald-700",children:["$",(s=a.price_monthly)?new Intl.NumberFormat("en-US").format(s):"-",(0,l.jsx)("span",{className:"text-xs text-emerald-600",children:"/mo"})]}),m&&(0,l.jsx)("span",{className:"px-2 py-0.5 rounded-full border border-emerald-100 text-[11px] font-semibold text-emerald-700 bg-emerald-50",children:m})]}),(0,l.jsx)("p",{className:"text-xs text-gray-500",children:(e=>{if(!e)return o("housingAvailableNow");let t=new Date(e);return o("housingAvailableFrom",{date:Number.isNaN(t.getTime())?e:t.toLocaleDateString()})})(a.availability_date)}),a.description&&(0,l.jsx)("p",{className:"text-sm text-gray-600 line-clamp-3",children:a.description}),(0,l.jsxs)("div",{className:"mt-auto pt-2 flex items-center justify-between",children:[(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-gray-500",children:["phone"===a.contact_method?(0,l.jsx)(w.A,{size:12}):(0,l.jsx)(N.A,{size:12}),"phone"===a.contact_method?o("housingContactPhone"):o("housingContactChat")]}),n&&(0,l.jsx)("button",{type:"button",className:"px-3 py-1.5 rounded-full bg-emerald-600 text-white text-xs font-semibold",onClick:e=>{e.stopPropagation(),n(a)},children:o("housingMessageOwner")})]})]})]})}
1let C={name:"",email:"",phone:"",message:""},P={title:"",location:"",area:"",type:"",price:"",availability:"",lease:"",description:"",contact:"chat",photos:"",proof:""},E=[{value:"water",labelKey:"housingUtilityWater"},{value:"electric",labelKey:"housingUtilityElectric"},{value:"internet",labelKey:"housingUtilityInternet"},{value:"gas",labelKey:"housingUtilityGas"}],k="vietusa_housing_browse_state_v2",_="vietusa_housing_post_draft_v1",L=e=>"vietusa:housingBrowseContactDraft:".concat(e),A=e=>{if(Array.isArray(e))return{results:e,meta:{returned:e.length,has_more:!1,next_cursor:null}};let t=e||{};return{results:Array.isArray(t.results)?t.results:[],meta:t.meta||{}}};function R(){let{t:e}=(0,p.o)(),{user:t,initialized:r}=(0,h.A)(),d=!!(null==t?void 0:t.id),y=(0,a.useRouter)(),v=(0,s.useMemo)(()=>{let e=y.query.tab;return"post"===(Array.isArray(e)?e[0]:e)?"post":"browse"},[y.query.tab]),[j,w]=(0,s.useState)("browse"),N=(0,s.useMemo)(()=>{let e=y.query.edit;if(!e)return null;let t=Number(Array.isArray(e)?e[0]:e);return Number.isFinite(t)&&t>0?t:null},[y.query.edit]),R=null!=N,[T,U]=(0,s.useState)([]),[M,O]=(0,s.useState)(null),[q,F]=(0,s.useState)(0),[D,I]=(0,s.useState)(!1),[B,K]=(0,s.useState)(!1),[z,H]=(0,s.useState)(!1),[$,J]=(0,s.useState)(null),[Y,W]=(0,s.useState)(null),[X,G]=(0,s.useState)({open:!1}),[Q,V]=(0,s.useState)(C),[Z,ee]=(0,s.useState)(null),[et,er]=(0,s.useState)(!1),[el,es]=(0,s.useState)({location:"",type:"all",minPrice:"",maxPrice:"",availability:""}),[ea,ei]=(0,s.useState)(P),[en,eo]=(0,s.useState)([]),[ec,ed]=(0,s.useState)(!1),[eu,em]=(0,s.useState)(null),[eh,ep]=(0,s.use
1State)(null),[ex,eg]=(0,s.useState)(!1),[eb,ef]=(0,s.useState)(null),ey=(0,s.useRef)(null),ev=(0,s.useRef)(null),[ej,ew]=(0,s.useState)([]),[eN,eS]=(0,s.useState)([]),[eC,eP]=(0,s.useState)(!1),[eE,ek]=(0,s.useState)(!1),[e_,eL]=(0,s.useState)(null),[eA,eR]=(0,s.useState)(null),eT=(0,s.useRef)([]),eU=(0,s.useRef)(!1),eM=(0,s.useRef)(null),eO=(0,s.useRef)(0),eq=(0,s.useRef)(el),eF=(0,s.useRef)(!1),eD=(0,s.useRef)(!1),eI=(0,s.useRef)(null),eB=(0,s.useRef)(!1),eK=(0,s.useRef)(null),ez=(0,s.useRef)(!1),eH=(0,s.useRef)(!1),e$=(0,s.useCallback)(e=>{var t;let r=null!=(t=null==e?void 0:e.editId)?t:N;if(r)return"/projects/housing?edit=".concat(r);if((null==e?void 0:e.forcePost)||"post"===j)return"/projects/housing?tab=post";{let e="".concat(window.location.pathname).concat(window.location.search).trim();if(e)return e}return"string"==typeof y.asPath&&y.asPath?y.asPath:"/projects/housing"},[j,N,y.asPath]),eJ=(0,s.useCallback)(e=>{y.replace((0,x.PU)(e$(e)))},[e$,y]),eY=(0,s.useCallback)((e,t)=>401===e.status||!!(t&&"object"==typeof t&&!Array.isArray(t)&&(0,x.$7)(t)),[]),eW=(0,s.useCallback)(e=>{if(w(e),!y.isReady||N)return;let t={...y.query};"post"===e?t.tab="post":delete t.tab,y.replace({pathname:y.pathname,query:t},void 0,{shallow:!0})},[N,y]);(0,s.useEffect)(()=>{eT.current=T},[T]),(0,s.useEffect)(()=>{eU.current=D},[D]),(0,s.useEffect)(()=>{eM.current=M},[M]),(0,s.useEffect)(()=>{eO.current=q},[q]),(0,s.useEffect)(()=>{eq.current=el},[el]);let eX=(0,s.useCallback)((e,t)=>{eK.current&&(clearTimeout(eK.current),eK.current=null),W({message:e,tone:t}),eK.current=setTimeout(()=>{W(null),eK.current=null},2e3)},[]);(0,s.useEffect)(()=>()=>{eK.current&&clearTimeout(eK.current)},[]);let eG=(0,s.useCallback)(()=>{if("browse"!==j)return;let e=eT.current;(e.length>0||eU.current||eO.current>0)&&(0,b.q)(k,{listings:e,nextCursor:eM.current,nextOffset:eO.current,hasMoreListings:eU.current,filters:eq.current,scrollY:Math.max(0,Math.trunc(window.scrollY||window.pageYOffset||0))})},[j]);(0,s.useEffect)(()=>{var e,t,r,l,s;if(!y.isReady||eD.current)return;eD.current=!0;let a=(0,b.B)(k,6e5,!1).value;if(!a){eF.current=!1,eI.current=null,eB.current=!0;return}let i={location:"string"==typeof(null==(e=a.filters)?void 0:e.location)?a.filters.location:"",type:"string"==typeof(null==(t=a.filters)?void 0:t.type)&&a.filters.type.trim()?a.filters.type:"all",minPrice:"string"==typeof(null==(r=a.filters)?void 0:r.minPrice)?a.filters.minPrice:"",maxPrice:"string"==typeof(null==(l=a.filters)?void 0:l.maxPrice)?a.filters.maxPrice:"",availability:"string"==typeof(null==(s=a.filters)?void 0:s.availability)?a.filters.availability:""};es(i),eq.current=i;let n=Array.isArray(a.listings)?a.listings.filter(e=>e&&Number.isFinite(Number(e.id))):[];U(n),eT.current=n;let o=!!a.hasMoreListings;I(o),eU.current=o;let c="string"==typeof a.nextCursor&&a.nextCursor.trim()?a.nextCursor.trim():null;O(c),eM.current=c;let d="number"==typeof a.nextOffset&&Number.isFinite(a.nextOffset)?Math.max(0,Math.trunc(a.nextOffset)):n.length;F(d),eO.current=d,eF.current=n.length>0,K(!1),H(!1),"number"==typeof a.scrollY&&Number.isFinite(a.scrollY)?(eI.current=Math.max(0,Math.trunc(a.scrollY)),eB.current=!1):(eI.current=null,eB.current=!0)},[y.isReady]),(0,s.useEffect)(()=>{if(y.isReady){if(N)return void w("post");"post"===v&&w("post")}},[N,v,y.isReady]),(0,s.useEffect)(()=>{eG()},[eG,T,D,M,q,el,j]),(0,s.useEffect)(()=>{if(!y.isReady)return;let e=()=>{eG()};return y.events.on("routeChangeStart",e),()=>{y.events.off("routeChangeStart",e)}},[y,y.isReady,eG]),(0,s.useEffect)(()=>{let e=()=>{eG()};return window.addEventListener("pagehide",e),window.addEventListener("beforeunload",e),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("beforeunload",e)}},[eG]),(0,s.useEffect)(()=>{if("browse"!==j||eB.current)return;let e=eI.current;if(null==e)return;let t=!1,r=0,l=()=>{if(t)return;r+=1;let s=Math.max(0,document.documentElement.scrollHeight-window.innerHeight),a=Math.min(Math.max(0,e),s);Math.abs(window.scrollY-a)>2&&window.scrollTo({top:a,behavior:"auto"});let i=s+12>=e,n=6>=Math.abs(window.scrollY-a);if(i&&n||r>=60&&!B&&!z&&T.length>0){eI.current=null,eB.current=!0;return}r>=60||window.setTimeout(l,80)};return window.requestAnimationFrame(l),()=>{t=!0}},[j,T.length,B,z]),(0,s.useEffect)(()=>
1{if(R){eH.current=!0;return}if("post"===j){if(ez.current){eH.current=!0;return}ez.current=!0;try{let e=window.sessionStorage.getItem(_);if(e){let t=JSON.parse(e),r={...P,...t.form||{}};ei({title:"string"==typeof r.title?r.title:"",location:"string"==typeof r.location?r.location:"",area:"string"==typeof r.area?r.area:"",type:"string"==typeof r.type?r.type:"",price:"string"==typeof r.price?r.price:"",availability:"string"==typeof r.availability?r.availability:"",lease:"string"==typeof r.lease?r.lease:"",description:"string"==typeof r.description?r.description:"",contact:"string"==typeof r.contact&&r.contact?r.contact:"chat",photos:"string"==typeof r.photos?r.photos:"",proof:"string"==typeof r.proof?r.proof:""}),eo(Array.isArray(t.utilities)?t.utilities.filter(e=>"string"==typeof e&&e.trim().length>0):[])}}catch(e){}finally{eH.current=!0}}},[j,R]),(0,s.useEffect)(()=>{if(R||"post"!==j||!eH.current)return;let e=!!ea.title.trim()||!!ea.location.trim()||!!ea.area.trim()||!!ea.type.trim()||!!ea.price.trim()||!!ea.availability.trim()||!!ea.lease.trim()||!!ea.description.trim()||"chat"!==ea.contact||!!ea.photos.trim()||!!ea.proof.trim()||en.length>0;try{if(!e)return void window.sessionStorage.removeItem(_);window.sessionStorage.setItem(_,JSON.stringify({form:ea,utilities:en}))}catch(e){}},[j,ea,R,en]),(0,s.useEffect)(()=>{if(!N){eg(!1),ef(null);return}let t=!1;return(async()=>{w("post"),eg(!0),ef(null);try{let r=await fetch((0,x.y0)("/api/projects/housing/".concat(N)),{credentials:"include"}),l=await (0,x.s$)(r,{});if(!r.ok){if(eY(r,l))return void eJ({editId:N});throw Error((null==l?void 0:l.error)||e("housingSubmitError"))}if(t)return;let s=[null==l?void 0:l.city,null==l?void 0:l.state].filter(Boolean).join(", ");ei({title:(null==l?void 0:l.title)||"",location:s||(null==l?void 0:l.city)||"",area:(null==l?void 0:l.area)||"",type:(null==l?void 0:l.listing_type)||"",price:(null==l?void 0:l.price_monthly)!=null?String(l.price_monthly):"",availability:(null==l?void 0:l.availability_date)||"",lease:(null==l?void 0:l.lease_length)||"",description:(null==l?void 0:l.description)||"",contact:(null==l?void 0:l.contact_method)||"chat",photos:Array.isArray(null==l?void 0:l.photos)?l.photos.join(", "):"",proof:Array.isArray(null==l?void 0:l.proof_links)?l.proof_links.join(", "):""}),eo(Array.isArray(null==l?void 0:l.utilities)?l.utilities:[])}catch(r){t||ef(r instanceof Error?r.message:e("housingSubmitError"))}finally{t||eg(!1)}})(),()=>{t=!0}},[N,eY,eJ,e]);let eQ=f.c.map(t=>({...t,label:e(t.labelKey)})),eV=E.map(t=>({...t,label:e(t.labelKey)}));(0,s.useEffect)(()=>{let t=!1;return(async()=>{if(eF.current){eF.current=!1;return}K(!0),J(null),I(!1),O(null),F(0);try{var r,l,s;let a=new URLSearchParams;el.location.trim()&&a.set("location",el.location.trim()),"all"!==el.type&&a.set("type",el.type),el.minPrice.trim()&&a.set("min_price",el.minPrice.trim()),el.maxPrice.trim()&&a.set("max_price",el.maxPrice.trim()),el.availability.trim()&&a.set("availability",el.availability.trim()),a.set("limit",String(24)),a.set("include_meta","1");let i=await fetch((0,x.y0)("/api/projects/housing?".concat(a.toString())));if(!i.ok)throw Error(e("housingSubmitError"));let n=await (0,x.s$)(i,[]),o=A(n),c=Number((null==(r=o.meta)?void 0:r.returned)||o.results.length||0),d=!!(null==(l=o.meta)?void 0:l.has_more),u="string"==typeof(null==(s=o.meta)?void 0:s.next_cursor)?o.meta.next_cursor:null;t||(U(o.results),I(d),O(u),F(c))}catch(r){t||(U([]),J(r instanceof Error?r.message:e("housingSubmitError")),I(!1),O(null),F(0))}finally{t||K(!1)}})(),()=>{t=!0}},[el,e]);let eZ=async()=>{if(!B&&!z&&D){H(!0),J(null);try{var t,r,l;let s=new URLSearchParams;el.location.trim()&&s.set("location",el.location.trim()),"all"!==el.type&&s.set("type",el.type),el.minPrice.trim()&&s.set("min_price",el.minPrice.trim()),el.maxPrice.trim()&&s.set("max_price",el.maxPrice.trim()),el.availability.trim()&&s.set("availability",el.availability.trim()),s.set("limit",String(24)),s.set("include_meta","1"),M?s.set("cursor",M):s.set("offset",String(q));let a=await fetch((0,x.y0)("/api/projects/housing?".concat(s.toString())));if(!a.ok)throw Error(e("housingSubmitError"));let i=await (0,x.s$)(a,[]),n=A(i),o=Number((null==(t=n.meta)?void 0:t.returned)||n.results.length||0),c=!!(null==(r=n.meta)?void 0:r.has_more),d="string"==typeof(null==(l=n.meta)?void 0:l.next_cursor)?n.meta.next_cursor:null;U(e=>((e,t)=>{if(!t.length)return e;let r=new Set(e.map(e=>e.id)),l=[...e];for(let e of t)!(null==e?void 0:e.id)||r.has(e.id)||(r.add(e.id),l.push(e));return l})(e,n.results)),I(c),O(d),F(e=>e+o)}catch(t){J(t instanceof Error?t.message:e("housingSubmitError"))}finally{H(!1)}}},e0=()=>{V(C)},e1=e=>{try{let t=window.sessionStorage.getItem(L(e.id));if(t){let e=JSON.parse(t);V({name:"string"==typeof(null==e?void 0:e.name)?e.name:"",email:"string"==typeof(null==e?void 0:e.email)?e.email:"",ph
1one:"string"==typeof(null==e?void 0:e.phone)?e.phone:"",message:"string"==typeof(null==e?void 0:e.message)?e.message:""})}else e0()}catch(e){e0()}G({open:!0,listing:e}),ee(null)},e2=()=>{e0(),G({open:!1}),ee(null)};(0,s.useEffect)(()=>{if(!X.open||!X.listing)return;let e=L(X.listing.id),t=Object.values(Q).some(e=>String(e||"").trim().length>0);try{if(!t)return void window.sessionStorage.removeItem(e);window.sessionStorage.setItem(e,JSON.stringify(Q))}catch(e){}},[Q,X]);let e3=async t=>{if(t.preventDefault(),X.listing){if(!Q.message.trim()||!Q.email.trim()&&!Q.phone.trim())return void ee(e("housingContactMissing"));er(!0),ee(null);try{let t=await fetch((0,x.y0)("/api/projects/housing/".concat(X.listing.id,"/contact")),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:Q.name.trim(),email:Q.email.trim(),phone:Q.phone.trim(),message:Q.message.trim()})}),r=await (0,x.s$)(t,{});if(!t.ok){if(eY(t,r))return void eJ();throw Error((null==r?void 0:r.error)||e("housingContactError"))}eX(e("housingContactSuccess"),"success");try{window.sessionStorage.removeItem(L(X.listing.id))}catch(e){}e0(),G({open:!1})}catch(t){ee(t instanceof Error?t.message:e("housingContactError"))}finally{er(!1)}}},e6=e=>e.split(",").map(e=>e.trim()).filter(Boolean),e4=(e,t)=>{let r=[...e6(e),...t],l=new Set;return r.filter(e=>{let t=e.trim();return!(!t||l.has(t))&&(l.add(t),!0)}).join(", ")},e5=async()=>{if(!ej.length)return[];eP(!0),eL(null);let t=[];try{for(let e of ej){let r=new FormData;r.append("file",e.file);let l=await fetch((0,x.y0)("/api/media/upload?purpose=photo"),{method:"POST",body:r,credentials:"include"}),s=await (0,x.s$)(l,{});if(!l.ok){if(eY(l,s))throw eJ({forcePost:!0}),Error("reauth-required");continue}let a=(null==s?void 0:s.url)||(null==s?void 0:s.absolute_url);a&&t.push(a)}if(!t.length)throw Error("no_uploads");return t}catch(t){if(t instanceof Error&&"reauth-required"===t.message)throw t;return eL(e("housingPhotosUploadFailed")),[]}finally{eP(!1)}},e7=async()=>{if(!eN.length)return[];ek(!0),eR(null);let t=[];try{for(let e of eN){let r=new FormData;r.append("file",e.file);let l=await fetch((0,x.y0)("/api/media/upload?purpose=proof"),{method:"POST",body:r,credentials:"include"}),s=await (0,x.s$)(l,{});if(!l.ok){if(eY(l,s))throw eJ({forcePost:!0}),Error("reauth-required");continue}let a=(null==s?void 0:s.url)||(null==s?void 0:s.absolute_url);a&&t.push(a)}if(!t.length)throw Error("no_uploads");return t}catch(t){if(t instanceof Error&&"reauth-required"===t.message)throw t;return eR(e("housingProofUploadFailed")),[]}finally{ek(!1)}},e8=async t=>{t.preventDefault(),ed(!0),em(null),ep(null),eL(null),eR(null);try{let t=await e5(),r=await e7();t.length&&(ei(e=>({...e,photos:e4(e.photos,t)})),ew(e=>(e.forEach(e=>URL.revokeObjectURL(e.preview)),[]))),r.length&&(ei(e=>({...e,proof:e4(e.proof,r)})),eS(e=>(e.forEach(e=>e.preview&&URL.revokeObjectURL(e.preview)),[])));let l=[...e6(ea.photos),...t].filter(Boolean),s=[...e6(ea.proof),...r].filter(Boolean);if(!s.length)throw Error(e("housingProofRequired"));let a=Number(ea.price);if(!Number.isFinite(a)||a<=0)throw Error(e("housingPricePositive"));if(a>Number.MAX_SAFE_INTEGER)throw Error(e("housingPriceTooLarge"));let i=R?"/api/projects/housing/".concat(N):"/api/projects/housing",n=R?"PATCH":"POST",o=await fetch((0,x.y0)(i),{method:n,headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({title:ea.title.trim(),location:ea.location.trim(),area:ea.area.trim(),listing_type:ea.type,price_monthly:Math.trunc(a),availability_date:ea.availability,lease_length:ea.lease.trim(),utilities:en,contact_method:ea.contact,description:ea.description.trim(),photos:l,proof_links:s})}),c=await (0,x.s$)(o,{});if(!o.ok){if(eY(o,c))return void eJ({forcePost:!0,editId:N});throw Error((null==c?void 0:c.error)||e("housingSubmitError"))}if(R){ep(e("housingSavedChanges")),eX(e("housingSavedChanges"),"success"),ew(e=>(e.forEach(e=>URL.revokeObjectURL(e.preview)),[])),eS(e=>(e.forEach(e=>e.preview&&URL.revokeObjectURL(e.preview)),[])),y.push("/business");return}ep(e("housingSubmitSuccess"));let d=ea.location;ei({...P,location:d}),eo([]);try{window.sessionStorage.removeItem(_)}catch(e){}ew(e=>
1(e.forEach(e=>URL.revokeObjectURL(e.preview)),[])),eS(e=>(e.forEach(e=>e.preview&&URL.revokeObjectURL(e.preview)),[])),eW("browse"),eX(e("housingSubmitSuccess"),"success")}catch(r){if(r instanceof Error&&"reauth-required"===r.message)return;let t=r instanceof Error?r.message:e("housingSubmitError");em(t),eX(t,"info")}finally{ed(!1)}};return(0,l.jsxs)("div",{className:"min-h-screen bg-gray-50",children:[(0,l.jsxs)(u(),{children:[(0,l.jsx)("title",{children:e("housingPageTitle")}),(0,l.jsx)("meta",{name:"description",content:e("housingPageDesc")}),(0,l.jsx)("meta",{property:"og:title",content:e("housingPageTitle")}),(0,l.jsx)("meta",{property:"og:description",content:e("housingPageDesc")}),(0,l.jsx)("meta",{property:"og:type",content:"website"})]}),(0,l.jsx)(m.A,{}),(0,l.jsxs)("main",{className:"max-w-6xl px-6 py-10 mx-auto space-y-8",children:[(0,l.jsxs)("section",{className:"rounded-3xl bg-white border border-emerald-100 shadow-card p-6 md:p-8 space-y-6",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("p",{className:"inline-flex items-center gap-2 px-3 py-1 text-sm font-semibold bg-emerald-50 rounded-full border border-emerald-100",children:e("projectsHousingTitle")}),(0,l.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:e("housingTitle")}),(0,l.jsx)("p",{className:"text-gray-600",children:e("housingSubtitle")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>eW("browse"),className:"px-4 py-2 rounded-full text-sm font-semibold border transition ".concat("browse"===j?"bg-emerald-600 text-white border-emerald-600":"bg-white text-emerald-700 border-emerald-100 hover:bg-emerald-50"),children:e("housingBrowseTab")}),(0,l.jsx)("button",{type:"button",onClick:()=>eW("post"),className:"px-4 py-2 rounded-full text-sm font-semibold border transition ".concat("post"===j?"bg-emerald-600 text-white border-emerald-600":"bg-white text-emerald-700 border-emerald-100 hover:bg-emerald-50"),children:e("housingPostTab")})]})]}),"browse"===j&&(0,l.jsxs)("section",{className:"grid gap-6 md:grid-cols-[240px,1fr]",children:[(0,l.jsxs)("aside",{className:"bg-white rounded-2xl border border-emerald-100 shadow-card p-5 space-y-4 h-fit",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:e("housingFiltersTitle")}),(0,l.jsx)(i.A,{size:16,className:"text-emerald-600"})]}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsx)("label",{className:"block text-xs font-semibold text-gray-500 uppercase",children:e("housingFilterLocation")}),(0,l.jsx)("input",{type:"text",value:el.location,onChange:e=>es(t=>({...t,location:e.target.value})),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl focus:outline-none focus:ring-2 focus:ring-emerald-500"})]}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsx)("label",{className:"block text-xs font-semibold text-gray-500 uppercase",children:e("housingFilterType")}),(0,l.jsxs)("select",{value:el.type,onChange:e=>es(t=>({...t,type:e.target.value})),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl bg-white",children:[(0,l.jsx)("option",{value:"all",children:e("projectsCategoryAll")}),eQ.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))]})]}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsx)("label",{className:"block text-xs font-semibold text-gray-500 uppercase",children:e("housingFilterPrice")}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,l.jsx)("input",{type:"number",placeholder:e("housingFilterMinPrice"),value:el.minPrice,onChange:e=>es(t=>({...t,minPrice:e.target.value})),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl"}),(0,l.jsx)("input",{type:"number",placeholder:e("housingFilterMaxPrice"),value:el.maxPrice,onChange:e=>es(t=>({...t,maxPrice:e.target.value})),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl"})]})]}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsx)("label",{className:"block text-xs font-semibold text-gray-500 uppercase",children:e("housingFilterAvailability")}),(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(n.A,{size:14,className:"absolute left-3 top-3 text-emerald-600"}),(0,l.jsx)("input",{type:"date",value:el.availability,onChange:e=>es(t=>({...t,availability:e.target.value})),className:"w-full pl-8 pr-3 py-2 border border-emerald-100 rounded-xl"})]})]})]}),(0,l.jsxs)("div",{className:"space-y-4",children:[B&&(0,l.jsx)("p",{className:"text-sm text-gray-500",children:e("commonLoading")}),$&&(0,l.jsx)("p",{className:"text-sm text-amber-700",children:$}),!B&&0===T.length&&(0,l.jsxs)("div",{className:"rounded-2xl border border-emerald-100 bg-white p-6 text-center space-y-2",children:[(0,l.jsx)("p",{className:"text-lg font-semibold text-gray-900",children:e("housingEmptyTitle")}),(0,l.jsx)("p",{className:"text-sm text-gray-600",children:e("housingEmptyBody")}),(0,l.jsx)("button",{type:"button",onClick:()=>
1{if(r&&!d)return void y.push((0,x.PU)("/projects/housing?tab=post"));eW("post")},className:"inline-flex items-center justify-center px-4 py-2 rounded-full bg-emerald-600 text-white text-sm font-semibold",children:r&&!d?e("housingPostCtaLoggedOut"):e("housingPostCta")})]}),(0,l.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:T.map(e=>(0,l.jsx)(S,{listing:e,onOpen:()=>{eG(),y.push("/projects/housing/".concat(e.id))},onContact:e1},e.id))}),D&&(0,l.jsx)("div",{className:"flex justify-center pt-2",children:(0,l.jsx)("button",{type:"button",onClick:eZ,disabled:z,className:"px-4 py-2 text-sm font-semibold text-emerald-700 bg-emerald-50 border border-emerald-200 rounded-lg hover:bg-emerald-100 disabled:opacity-60 disabled:cursor-not-allowed",children:z?e("commonLoading"):e("commonLoadMore")})}),!B&&!D&&T.length>0&&(0,l.jsx)("p",{className:"pt-2 text-center text-xs text-gray-500",children:e("commonNoMoreResults")})]})]}),"post"===j&&(0,l.jsx)("section",{className:"rounded-3xl bg-white border border-emerald-100 shadow-card p-6 md:p-8 space-y-6",children:(0,l.jsxs)("form",{className:"space-y-6",onSubmit:e8,children:[R&&(0,l.jsxs)("div",{className:"rounded-2xl border border-amber-200 bg-amber-50/60 p-4 flex flex-wrap items-center justify-between gap-3",children:[(0,l.jsxs)("div",{className:"space-y-0.5",children:[(0,l.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-amber-900",children:e("housingEditingListing")}),(0,l.jsx)("p",{className:"text-sm text-amber-800",children:e("housingEditNote")})]}),(0,l.jsx)("button",{type:"button",className:"px-4 py-2 rounded-lg border border-amber-200 bg-white text-sm font-semibold text-amber-900 hover:bg-amber-50",onClick:()=>y.push("/projects/housing"),children:e("housingCancelEdit")})]}),ex&&(0,l.jsx)("p",{className:"text-sm text-gray-600",children:e("commonLoading")}),eb&&(0,l.jsx)("p",{className:"text-sm font-semibold text-amber-700",children:eb}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:e("housingBasicsTitle")}),(0,l.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingListingTitleLabel")}),(0,l.jsx)("input",{type:"text",value:ea.title,onChange:e=>ei(t=>({...t,title:e.target.value})),placeholder:e("housingListingTitlePlaceholder"),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl",required:!0})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingLocationLabel")}),(0,l.jsx)("input",{type:"text",value:ea.location,onChange:e=>ei(t=>({...t,location:e.target.value})),placeholder:e("housingLocationPlaceholder"),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl",required:!0})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingAreaLabel")}),(0,l.jsx)("input",{type:"text",value:ea.area,onChange:e=>ei(t=>({...t,area:e.target.value})),placeholder:e("housingAreaPlaceholder"),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl"})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingTypeLabel")}),(0,l.jsxs)("select",{value:ea.type,onChange:e=>ei(t=>({...t,type:e.target.value})),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl bg-white",required:!0,children:[(0,l.jsx)("option",{value:"",children:e("projectsCategoryAll")}),eQ.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))]})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingPriceLabel")}),(0,l.jsx)("input",{type:"number",value:ea.price,onChange:e=>ei(t=>({...t,price:e.target.value})),placeholder:e("housingPricePlaceholder"),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl",required:!0})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingAvailabilityLabel")}),(0,l.jsx)("input",{type:"date",value:ea.availability,onChange:e=>ei(t=>({...t,availability:e.target.value})),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl"})]})]})]}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:e("housingDetailsTitle")}),(0,l.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingLeaseLabel")}),(0,l.jsx)("input",{type:"text",value:ea.lease,onChange:e=>ei(t=>({...t,lease:e.target.value})),placeholder:e("housingLeasePlaceholder"),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl"})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingContactLabel")}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)("button",{type:"button",onClick:()=>ei(e=>({...e,contact:"chat"})),className:"px-3 py-2 rounded-full text-sm font-semibold border ".concat("chat"===ea.contact?"bg-emerald-600 text-white border-emerald-600":"bg-white border-emerald-100 text-emerald-700"),children:e("housingContactChat")}),(0,l.jsx)("button",{type:"button",onClick:()=>ei(e=>({...e,contact:"phone"})),className:"px-3 py-2 rounded-full text-sm font-semibold border ".concat("phone"===ea.contact?"bg-emerald-600 text-white border-emerald-600":"bg-white border-emerald-100 text-emerald-700"),children:e("housingContactPhone")})]})]})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingUtilitiesLabel")}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:eV.map(e=>(0,l.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.value,void eo(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"px-3 py-1.5 rounded-full text-sm font-semibold border ".concat(en.includes(e.value)?"bg-emerald-600 text-white border-emerald-600":"bg-white border-emerald-100 text-emerald-700"),children:e.label},e.value))})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingDescriptionLabel")}),(0,l.jsx)("textarea",{rows:4,value:ea.description,onChange:e=>ei(t=>({...t,description:e.target.value})),placeholder:e("housingDescriptionPlaceholder"),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl"})]}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingProofLabel")}),(0,l.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[eN.map(t=>(0,l.jsxs)("div",{className:"border border-emerald-50 rounded-2xl overflow-hidden bg-white",children:[t.preview?(0,l.jsx)("img",{src:t.preview,alt:e("housingUploadPreviewAlt"),className:"h-24 w-full object-cover"}):(0,l.jsxs)("div",{className:"h-24 flex flex-col items-center justify-center text-xs text-gray-500 px-2 text-center",children:[(0,l.jsx)(o.A,{className:"text-emerald-500",size:18}),(0,l.jsx)("span",{className:"mt-1 line-clamp-2",children:t.file.name})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 text-xs",children:[(0,l.jsx)("span",{className:"text-gray-500 truncate",children:t.file.name}),(0,l.jsx)("button",{type:"button",onClick:()=>{var e;return e=t.id,void eS(t=>{let r=t.find(t=>
1t.id===e);return(null==r?void 0:r.preview)&&URL.revokeObjectURL(r.preview),t.filter(t=>t.id!==e)})},className:"text-gray-500 hover:text-gray-700",children:e("commonRemove")})]})]},t.id)),0===eN.length&&(0,l.jsx)("div",{className:"col-span-full p-4 text-center text-xs text-gray-500 border border-dashed rounded-2xl border-emerald-100 bg-emerald-50/30",children:e("housingProofHint")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("input",{ref:ev,type:"file",accept:"image/*,.pdf,.doc,.docx",multiple:!0,className:"hidden",onChange:e=>(e=>{if(!e)return;let t=Math.max(0,5-eN.length);if(t<=0)return;let r=Array.from(e).slice(0,t).map((e,t)=>{let r=e.type.startsWith("image/");return{id:"".concat(e.name,"-").concat(Date.now(),"-").concat(t),file:e,isImage:r,preview:r?URL.createObjectURL(e):null}});r.length&&eS(e=>[...e,...r])})(e.target.files)}),(0,l.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=ev.current)?void 0:e.click()},className:"px-4 py-2 text-sm font-semibold text-emerald-700 bg-emerald-50 border border-emerald-100 rounded-lg hover:bg-emerald-100",children:e("housingProofUploadButton")}),eE&&(0,l.jsx)("span",{className:"text-xs font-semibold text-emerald-700",children:e("housingProofUploading")})]}),eA&&(0,l.jsx)("p",{className:"text-xs font-semibold text-red-600",children:eA}),(0,l.jsx)("input",{type:"text",value:ea.proof,onChange:e=>ei(t=>({...t,proof:e.target.value})),placeholder:e("housingProofPlaceholder"),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl"})]})]}),(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:e("housingPhotosTitle")}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("label",{className:"text-sm font-semibold text-gray-700",children:e("housingPhotosLabel")}),(0,l.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[ej.map(t=>(0,l.jsxs)("div",{className:"border border-emerald-50 rounded-2xl overflow-hidden bg-white",children:[(0,l.jsx)("img",{src:t.preview,alt:e("housingUploadPreviewAlt"),className:"h-24 w-full object-cover"}),(0,l.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 text-xs",children:[(0,l.jsx)("span",{className:"text-gray-500 truncate",children:t.file.name}),(0,l.jsx)("button",{type:"button",onClick:()=>{var e;return e=t.id,void ew(t=>{let r=t.find(t=>t.id===e);return r&&URL.revokeObjectURL(r.preview),t.filter(t=>t.id!==e)})},className:"text-gray-500 hover:text-gray-700",children:e("commonRemove")})]})]},t.id)),0===ej.length&&(0,l.jsx)("div",{className:"col-span-full p-4 text-center text-xs text-gray-500 border border-dashed rounded-2xl border-emerald-100 bg-emerald-50/30",children:e("housingPhotosHint")})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("input",{ref:ey,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>(e=>{if(!e)return;let t=Math.max(0,10-ej.length);if(t<=0)return;let r=Array.from(e).slice(0,t).filter(e=>e.type.startsWith("image/")).map((e,t)=>({id:"".concat(e.name,"-").concat(Date.now(),"-").concat(t),file:e,preview:URL.createObjectURL(e)}));r.length&&ew(e=>[...e,...r])})(e.target.files)}),(0,l.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=ey.current)?void 0:e.click()},className:"px-4 py-2 text-sm font-semibold text-white bg-emerald-700 rounded-lg hover:bg-emerald-800",children:e("housingPhotosUploadButton")}),eC&&(0,l.jsx)("span",{className:"text-xs font-semibold text-emerald-700",children:e("housingPhotosUploading")})]}),e_&&(0,l.jsx)("p",{className:"text-xs font-semibold text-red-600",children:e_}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(o.A,{size:16,className:"text-emerald-600"}),(0,l.jsx)("input",{type:"text",value:ea.photos,onChange:e=>ei(t=>({...t,photos:e.target.value})),placeholder:e("housingPhotoPlaceholder"),className:"w-full px-3 py-2 border border-emerald-100 rounded-xl"})]})]})]}),(0,l.jsx)("div",{className:"rounded-2xl border border-emerald-100 bg-emerald-50/60 p-4 text-sm text-emerald-700",children:e("housingReviewNote")}),eu&&(0,l.jsx)("p",{className:"text-sm font-semibold text-red-600",children:eu}),eh&&(0,l.jsx)("p",{className:"text-sm font-semibold text-emerald-700",children:eh}),(0,l.jsx)("button",{type:"submit",className:"w-full px-4 py-3 rounded-xl bg-emerald-600 text-white font-semibold hover:bg-emerald-700 disabled:opacity-60",disabled:ec,children:ec?e("housingSubmitting"):e("housingSubmit")})]})})]}),X.open&&X.listing&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm px-4",children:(0,l.jsxs)("div",{className:"w-full max-w-lg rounded-2xl bg-white border border-emerald-100 shadow-2xl p-6 space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:e("housingContactTitle")}),(0,l.jsx)("p",{className:"text-sm text-gray-600",children:e("housingContactSubtitle")}),(0,l.jsxs)("p",{className:"text-xs text-gray-500",children:[X.listing.title," - ",[X.listing.city,X.listing.state].filter(
1Boolean).join(", ")]})]}),(0,l.jsx)("button",{type:"button",className:"rounded-full p-1 text-gray-400 hover:text-gray-600",onClick:e2,"aria-label":e("commonClose"),children:(0,l.jsx)(c.A,{size:18})})]}),(0,l.jsxs)("form",{className:"space-y-3",onSubmit:e3,children:[(0,l.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("label",{className:"text-xs font-semibold text-gray-600",children:e("housingContactNameLabel")}),(0,l.jsx)("input",{type:"text",value:Q.name,onChange:e=>V(t=>({...t,name:e.target.value})),className:"w-full rounded-lg border border-emerald-100 px-3 py-2 text-base"})]}),(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("label",{className:"text-xs font-semibold text-gray-600",children:e("housingContactEmailLabel")}),(0,l.jsx)("input",{type:"email",value:Q.email,onChange:e=>V(t=>({...t,email:e.target.value})),className:"w-full rounded-lg border border-emerald-100 px-3 py-2 text-base"})]})]}),(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("label",{className:"text-xs font-semibold text-gray-600",children:e("housingContactPhoneLabel")}),(0,l.jsx)("input",{type:"tel",value:Q.phone,onChange:e=>V(t=>({...t,phone:e.target.value})),className:"w-full rounded-lg border border-emerald-100 px-3 py-2 text-base"})]}),(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("label",{className:"text-xs font-semibold text-gray-600",children:e("housingContactMessageLabel")}),(0,l.jsx)("textarea",{rows:4,value:Q.message,onChange:e=>V(t=>({...t,message:e.target.value})),placeholder:e("housingContactMessagePlaceholder"),className:"w-full rounded-lg border border-emerald-100 px-3 py-2 text-base"})]}),Z&&(0,l.jsx)("p",{className:"text-sm font-semibold text-red-600",children:Z}),(0,l.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 text-sm font-semibold",children:[(0,l.jsx)("button",{type:"button",className:"px-4 py-2 rounded-lg border border-gray-200 hover:bg-gray-50",onClick:()=>{e2(),e0()},disabled:et,children:e("commonCancel")}),(0,l.jsx)("button",{type:"submit",className:"px-4 py-2 rounded-lg bg-emerald-600 text-white hover:bg-emerald-700 disabled:opacity-60",disabled:et,children:et?e("housingContactSending"):e("housingContactSend")})]})]})]})}),Y&&(0,l.jsx)(g.y,{message:Y.message,tone:Y.tone})]})}},64041:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});let l=(0,r(17963).A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},68425:(e,t,r)=>{"use strict";r.d(t,{H:()=>a,c:()=>l});let l=[{value:"room",labelKey:"housingTypeRoom"},{value:"apartment",labelKey:"housingTypeApartment"},{value:"house",labelKey:"housingTypeHouse"},{value:"sublease",labelKey:"housingTypeSublease"},{value:"temporary",labelKey:"housingTypeTemporary"}],s={unit:"housingTypeUnit"},a=e=>{if(!e)return null;let t=l.find(t=>t.value===e);return t?t.labelKey:s[e]||null}},76158:(e,t,r)=>{"use strict";r.d(t,{A:()=>l});let l=(0,r(17963).A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]])},93851:(e,t,r)=>{"use strict";r.d(t,{B:()=>l,q:()=>s});let l=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let l=window.sessionStorage.getItem(e);if(!l)return{value:null,isStale:!1};let s=JSON.parse(l);if(!s||"number"!=typeof s.ts)return{value:null,isStale:!1};if(Date.now()-s.ts<=t)return{value:s.value,isStale:!1};if(r)return{value:s.value,isStale:!0}}catch(e){}return{value:null,isStale:!1}},s=(e,t)=>{try{let r={ts:Date.now(),value:t};window.sessionStorage.setItem(e,JSON.stringify(r))}catch(e){}}}},e=>{e.O(0,[4e3,8441,7915,636,6593,8792],()=>e(e.s=14228)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.