PageSourceSearch

https://bali-home-immo.com/build/assets/Index-DtyjPFG0.js

js bali-home-immo.com collected 2026-10-02 22:19:44 UTC 10,644 bytes, 1 lines download raw bytes

1import{u as ae,r as c,j as e,H as re,a as se,b as ne}from"./app-eMsMa0ov.js";import{u as ie,E as oe,A as le}from"./listing-CS2QW1LC.js";import{G as ce,P as pe}from"./GuestLayout-BY1v72Zr.js";import{S as me}from"./SeoHead-p056qC7T.js";import{C as de}from"./Container-DgCmutJ6.js";import ge,{PropertyCardSkeleton as k}from"./PropertyCard-WhMH4wSB.js";import{B as xe}from"./BreadcrumbSchema-DEeQwnJo.js";import{T as he}from"./carousel-CHYCXkGD.js";import{B as S}from"./button-rf8CBlxK.js";import{N as ue}from"./native-select-Bx_zDmNO.js";import{v as fe}from"./urls-Nf8gIrqu.js";import{L as $}from"./useZohoFormSubmit-Ba8XlRAO.js";import{b as ye}from"./sliders-horizontal-DS5CTgUA.js";import{S as Pe,C as je}from"./x-CdVSo-S4.js";import"./popover-DosrXxdZ.js";import"./map-pin-kEyCKsfw.js";import"./skeleton-BY3lCarm.js";import"./ZohoFormModal-BD8reWyg.js";import"./ContactAgentForm-CZ5T1arJ.js";import"./RoiEstimationForm-F7_6qxkM.js";import"./circle-check-r65j7Y4t.js";import"./SellRentPropertyForm-Bj7ZfMW4.js";import"./play-BGYBA_2F.js";import"./file-text-4KJ5wkiL.js";import"./map-Ca_UK6Hv.js";import"./JsonLd-DpyT5sJ_.js";import"./arrow-right-DaoC0rRO.js";const be=3e4,we=3600*1e3,Ne=60,_e=10,R=s=>typeof window<"u"?new URL(s||window.location.href,window.location.origin):new URL(s||"/","http://localhost"),M=s=>{const n=Number.parseInt(R(s).searchParams.get("page")||"1",10);return Number.isFinite(n)&&n>0?n:1},ve=s=>{const n=R(s);n.searchParams.delete("page");const i=n.searchParams.toString();return`${n.pathname}${i?`?${i}`:""}`},E=(s,n)=>{const i=R(s);return n>1?i.searchParams.set("page",n):i.searchParams.delete("page"),`${i.pathname}${i.search}`},D=(s,n)=>({properties:s||[],pagination:n||{}}),Le=s=>s?.property_id||s?.id||s?.slug||s?.url;function et({properties:s=[],pagination:n={},seo:i={},breadcrumbs:v=[],sortOptions:B=[],activeFilters:o={}}){const T=ae(),{app:G,appData:q}=T.props,j=q?.labels||{},h=T.url||(typeof window<"u"?window.location.href:"/"),u=c.useMemo(()=>ve(h),[h]),b=n.current_page||M(h),[w,N]=c.useState(b);c.useEffect(()=>{N(M(h))},[h]),c.useEffect(()=>{const t=()=>{N(M(window.location.href))};return window.addEventListener("popstate",t),()=>{window.removeEventListener("popstate",t)}},[]);const{data:H,fetchNextPage:U,fetchPreviousPage:V,isFetchingNextPage:m,isFetchingPreviousPage:f}=ie({queryKey:["property-listing",u,b],queryFn:async({pageParam:t=1})=>{const a=E(u,t),r=await ne.get(a,{headers:{Accept:"application/json","X-Requested-With":"XMLHttpRequest"}});return D(r.data?.properties,r.data?.pagination)},initialPageParam:b,initialData:{pages:[D(s,n)],pageParams:[b]},getNextPageParam:t=>{const a=t?.pagination?.current_page,r=t?.pagination?.last_page;if(!(!a||!r||a>=r))return a+1},getPreviousPageParam:t=>{const a=t?.pagination?.current_page;if(!(!a||a<=1))return a-1},refetchOnWindowFocus:!1,staleTime:be,gcTime:we}),y=H?.pages||[],g=c.useMemo(()=>y.filter(t=>(t?.pagination?.current_page||1)<=w).sort((t,a)=>(t?.pagination?.current_page||1)-(a?.pagination?.current_page||1)),[y,w]),x=c.useMemo(()=>g.flatMap(t=>t.properties||[]),[g]),l=g[g.length-1]?.pagination||n,d=g[0]?.pagination||n,X=g[0]?.properties?.length||0,L=Math.max((d.from||1)-1,0),W=Math.min(X||L,L),F=c.useCallback((t={})=>{const a=new URL(window.location.href);return Object.entries(t).forEach(([r,p])=>{p==null||p===""?a.searchParams.delete(r):a.searchParams.set(r,p)}),a.pathname+a.search},[]),K=t=>{const a=F({sort:t,page:null});se.get(a,{},{preserveScroll:!0})},A=c.useCallback(async t=>{if(t&&t.preventDefault(),!l.next_page_url||m)return;const a=w+1,r=E(u,a);if(y.find(C=>C?.pagination?.current_page===a)){N(a),window.history.pushState({page:a},"",r);return}try{await U(),N(a),window.history.pushState({page:a},"",r)}catch{window.location.href=l.next_page_url}},[l.next_page_url,m,w,u,y,U]),Y=async t=>{if(t&&t.preventDefault(),!d.prev_page_url||f)return;const a=Math.max((d.current_page||1)-1,1),r=E(u,a);if(y.find(C=>C?.pagination?.current_page===a)){window.history.pushState({page:a},"",r);return}try{await V(),window.history.pushState({page:a},"",r)}catch{window.location.href=d.prev_page_url}},P=[];if(o.saleOrRent&&P.push({key:"type",label:o.saleOrRent==="sale"?"For Sale":"For Rent"}),o.propertyCategoryLabel&&P.push({key:"category",label:o.propertyCategoryLabel}),o.propertyPriceCategory&&o.propertyPriceCategory!=="all"){const t=o.propertyPriceCategory,a=p=>p.charAt(0).toUpperCase()+p.slice(1),r=Array.isArray(t)?t.map(a).join(", "):a(t);P.push({key:"priceType",label:r})}o.areaName&&P.push({key:"area",label:o.areaName}),o.keyword&&P.push({key:"keyword",label:`"${o.keyword}"`});const I=d.current_page>1,z=l.current_page<l.last_page;x.length>=Ne||(l.current_page||1)>=_e;const O=oe,_=l.per_page||30,Q=l.total||0,J=Math.max(Q-x.length,0),Z=z?Math.max(1,Math.min(_,J||_)):0,ee=I?Math.max(1,Math.min(_,(d.from||1
1)-1)):0,te=Math.max(2,Math.min(_,12));return c.useRef(null),c.useEffect(()=>{},[O,m,A]),e.jsxs(ce,{children:[e.jsx(me,{seo:{...i,description:i.meta_description}}),e.jsx(re,{children:l.next_page_url&&e.jsx("link",{rel:"next",href:l.next_page_url})}),e.jsx(xe,{items:v}),e.jsxs("section",{className:"relative w-full min-h-[400px] h-auto flex flex-col items-center justify-center bg-black/60 overflow-hidden py-16 md:py-24",children:[e.jsx("div",{className:"absolute inset-0 z-0 bg-cover bg-center",style:{backgroundImage:"url('/assets-v2/images/top-featured-banner.jpg')"},children:e.jsx("div",{className:"absolute inset-0 bg-black/50 mix-blend-multiply"})}),e.jsxs("div",{className:"relative z-10 w-full max-w-7xl px-4 sm:px-6 lg:px-8 text-center text-white flex flex-col items-center justify-center h-full pb-6 mt-10",children:[i.h1&&e.jsx("h1",{className:"font-heading text-md md:text-xl lg:text-xl uppercase tracking-wider mb-0 drop-shadow-md leading-tight mt-12 mb-2",children:i.h1}),i.h2&&e.jsx("h2",{className:"font-heading text-sm text-white/80 leading-relaxed d-block px-3 py-1 bg-black/10 backdrop-blur-sm border border-white/20 rounded-md",children:i.h2})]})]}),e.jsxs("div",{className:"bg-slate-50",children:[e.jsx(pe,{activeFilters:o}),e.jsx("section",{className:"py-6 md:py-10 min-h-[60vh]",id:"property-listings",children:e.jsxs(de,{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 mb-6",children:[e.jsx("div",{className:"flex flex-col items-start gap-3 flex-wrap",children:e.jsx("nav",{className:"flex my-2","aria-label":"Breadcrumb",children:e.jsx("ol",{className:"inline-flex flex-wrap gap-y-2 text-sm text-slate-600",children:v.map((t,a)=>{const r=a===v.length-1;return e.jsxs("li",{className:"inline-flex items-center",children:[a>0&&e.jsx("span",{className:"mx-1 md:mx-1 text-slate-600/50",children:"/"}),t.active||r||!t.url?e.jsx("span",{className:"inline-flex items-center gap-1 rounded-sm bg-primary/5 px-2.5 py-1 text-xs font-medium text-primary","aria-current":"page",children:t.label}):e.jsx("a",{href:t.url,className:"inline-flex items-center gap-1 rounded-sm bg-primary/10 px-2.5 py-1 text-xs font-medium text-primary",children:t.label})]},a)})})})}),x.length>0&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(le,{size:14,className:"text-slate-400"}),e.jsx(ue,{"aria-label":j.sort_by||"Sort by",value:o.sort||"hi-lo-popularity",onChange:t=>K(t.target.value),className:"w-[220px]",children:B.map(t=>e.jsx("option",{value:t.value,children:t.label},t.value))})]})]}),I&&e.jsx("div",{className:"mb-6 flex flex-col items-center justify-center gap-3 text-center",children:e.jsxs("div",{className:"flex w-full items-center gap-4",children:[e.jsx("div",{className:"h-px flex-1 bg-slate-200"}),e.jsx(S,{asChild:!0,disabled:f,variant:"ghost",size:"lg",className:"h-auto min-w-[180px] rounded-none px-4 py-0 text-primary hover:bg-transparent hover:text-primary/80 cursor-pointer",children:e.jsx("a",{href:d.prev_page_url,onClick:Y,className:"flex flex-col items-center gap-1 text-xs font-semibold uppercase tracking-wide",children:f?e.jsxs(e.Fragment,{children:[e.jsx($,{size:18,className:"animate-spin"}),"Loading..."]}):e.jsxs(e.Fragment,{children:[e.jsx(ye,{size:18,strokeWidth:2.5}),e.jsx("span",{children:"Load Previous"}),e.jsxs("span",{className:"text-[11px] font-medium normal-case tracking-normal text-slate-400",children:[W," of ",L," properties"]})]})})}),e.jsx("div",{className:"h-px flex-1 bg-slate-200"})]})}),x.length>0?e.jsx(he,{delayDuration:0,children:e.jsxs("div",{className:"grid gap-6 sm:grid-cols-2","aria-label":"Property listings",children:[f&&Array.from({length:ee}).map((t,a)=>e.jsx(k,{},`skeleton-prev-${a}`)),x.map((t,a)=>e.jsx(ge,{property:t,index:a+1},Le(t)||`property-${a}`)),m&&Array.from({length:Z}).map((t,a)=>e.jsx(k,{},`skeleton-next-${a}`))]})}):m||f?e.jsx("div",{className:"grid gap-6 sm:grid-cols-2","aria-label":"Loading properties",children:Array.from({length:te}).map((t,a)=>e.jsx(k,{},`skeleton-initial-${a}`))}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-20 text-center",children:[e.jsx("div",{className:"mb-6 flex h-20 w-20 items-center justify-center rounded-full bg-slate-100",children:e.jsx(Pe,{size:32,className:"text-slate-400"})}),e.jsx("h3",{className:"text-lg font-bold text-slate-700 mb-2",children:j.no_properties_found||"No Properties Found"}),e.jsx("p",{className:"max-w-md text-sm text-slate-500 leading-relaxed",children:j.no_properties_description||"Sorry, the property you are looking for could not be found. Try adjusting your search criteria."}),e.jsx(S,{asChild:!0,variant:"outline",className:"mt-6 rounded-sm font-semibold uppercase tracking-wide",children:e.jsx("a",{href:fe("/realestate-property",G?.locale),children:j.view_all_properties||"View All Properties"})})]}),O,z&&e.jsx("div",{className:"mt-10 text-center",children:e.jsx(S,{asChild:!0,disabled:m,variant:"default",size:"lg",className:"rounded-sm font-semibold uppercase tracking-wide min-w-[250px] bg-primary hover:bg-primary/90 text-white cursor-pointer",children:e.jsx("a",{href:l.next_page_url,onClick:A,children:m?e.jsxs(e.Fragment,{children:[e.jsx($,{size:18,className:"mr-2 animate-spin"}),"Loading..."]}):e.jsxs(e.Fragment,{children:["Load More Properties",e.jsx(je,{size:18,className:"ml-2"})]})})})}),l.last_page>1&&e.jsx("div",{className:"mt-4 text-center",children:e.jsxs("span",{className:"text-xs text-slate-600",children:["Showing ",x.length," of ",l.total," properties"]})}),i.description&&e.jsx("div",{className:"mt-12 border-t border-slate-200 pt-8",children:e.jsx("div",{className:"prose prose-sm prose-slate max-w-none leading-relaxed text-slate-600",dangerouslySetInnerHTML:{__html:i.description}})})]})})]})]})}export{et as default};

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.