react-listing-engine 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # react-listing-engine
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - `/styled`: add a mobile header (search + Filters + optional action) and move the List|Map toggle into the footer, so the compact mobile chrome mirrors the desktop filter bar. The `search` prop is now library-wired -- pass `{ filterKey }` (the `TFilters` field it drives) instead of the consumer-managed `{ value, onChange }`; the layout reads/writes that field on the engine directly.
8
+
9
+ ## 0.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Packaging metadata update.
14
+
3
15
  ## 0.1.0
4
16
 
5
17
  ### Minor Changes
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{A as ne,B as se,h as q,i as G,j as J,k as Q,l as X,n as Y,p as j,q as P,s as C,u as ee,v as R,w as te,x as re,y as ie,z as oe}from"./chunk-PFPHWJAA.js";import{useEffect as Se,useRef as we}from"react";function le(e,r){let t=C(),i=we(r);i.current=r,Se(()=>t.on(e,s=>i.current(s)),[t,e])}function L(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}import{Fragment as Ce,jsx as m,jsxs as ae}from"react/jsx-runtime";function Pe(e){return e?"rle-card rle-card--selected":"rle-card"}function T({item:e,selected:r,onSelect:t}){let i=e??{},s=Pe(r),a=ae(Ce,{children:[i.imageUrl?m("img",{src:i.imageUrl,alt:i.title??"",className:"rle-card-media"}):m("div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),ae("div",{className:"rle-card-body",children:[i.title&&m("span",{className:"rle-card-title",children:i.title}),i.subtitle&&m("span",{className:"rle-card-address",children:i.subtitle}),i.badge&&m("div",{className:"rle-card-info",children:m("span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&m("span",{className:"rle-card-price",children:L(i.price)})]})]});return t?m("button",{type:"button",onClick:t,"aria-pressed":r??!1,className:s,children:a}):m("article",{className:s,children:a})}import{jsx as x,jsxs as de}from"react/jsx-runtime";function B(e){return de("div",{role:"status",className:"rle-empty",children:[de("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[x("circle",{cx:"11",cy:"11",r:"7"}),x("path",{d:"m21 21-4.3-4.3"})]}),x("p",{className:"rle-empty-title",children:"No results"}),x("p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}import{jsx as xe}from"react/jsx-runtime";function A({children:e}){return xe("div",{className:"rle-filter-panel",children:e})}import{jsx as k,jsxs as ke}from"react/jsx-runtime";function V(e){return k("div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>ke("div",{className:"rle-loading-item",children:[k("div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),k("div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),k("div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}import{jsx as Ie}from"react/jsx-runtime";function K({point:e}){let r=e.entity??{};return Ie("span",{className:"rle-pin",children:r.price!=null?L(r.price):""})}import{jsx as N,jsxs as H}from"react/jsx-runtime";function D({entity:e,onClose:r}){let t=e??{};return H("div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[N("button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:H("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[N("path",{d:"M18 6 6 18"}),N("path",{d:"m6 6 12 12"})]})}),H("div",{children:[t.title&&N("div",{className:"rle-card-title",children:t.title}),t.subtitle&&N("div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&N("div",{className:"rle-card-price",children:L(t.price)})]})]})}import{jsx as Fe}from"react/jsx-runtime";function O({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return Fe("div",{className:"rle-result-header",children:t})}import{jsx as Me}from"react/jsx-runtime";function W({value:e,onChange:r,placeholder:t}){return Me("input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":t??"Search",className:"rle-input"})}import{jsx as Ee}from"react/jsx-runtime";function $({children:e}){return Ee("aside",{className:"rle-sidebar",children:e})}import{jsx as _e}from"react/jsx-runtime";function z({children:e}){return _e("div",{className:"rle-toolbar",children:e})}var pe={Card:T,Marker:K,Popup:D,Sidebar:$,FilterPanel:A,Search:W,Empty:B,Loading:V,ResultHeader:O,Toolbar:z};import{jsx as o,jsxs as f}from"react/jsx-runtime";function ce({view:e,onViewChange:r}){return o("nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:f("div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[f("button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[o(Re,{}),"List"]}),f("button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[o(Te,{}),"Map"]})]})})}function me(){return f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),o("circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),o("circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"18",x2:"20",y2:"18"}),o("circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function Re(){return f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("line",{x1:"8",y1:"6",x2:"20",y2:"6"}),o("line",{x1:"8",y1:"12",x2:"20",y2:"12"}),o("line",{x1:"8",y1:"18",x2:"20",y2:"18"}),o("line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),o("line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),o("line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Te(){return f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),o("line",{x1:"8",y1:"3",x2:"8",y2:"18"}),o("line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ue(){return f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),o("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{useEffect as U,useRef as Be,useState as ge}from"react";import{createPortal as Ae}from"react-dom";import{Fragment as Ke,jsx as u,jsxs as I}from"react/jsx-runtime";function fe({open:e,onOpenChange:r,title:t,children:i,footer:s}){let a=Be(null),[n,d]=ge(!1),[v,g]=ge(!1);return U(()=>{if(!e){g(!1),d(!1);return}d(!0);let c=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(c)},[e]),U(()=>{if(!n)return;let c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=c}},[n]),U(()=>{if(!n)return;a.current?.focus();function c(h){h.key==="Escape"&&r(!1)}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[n,r]),!n||typeof document>"u"?null:Ae(I(Ke,{children:[u("div",{className:`rle-sheet-backdrop${v?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),I("div",{ref:a,className:`rle-sheet${v?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[u("div",{className:"rle-sheet__handle","aria-hidden":"true"}),I("div",{className:"rle-sheet__header",children:[t&&u("div",{className:"rle-sheet__title",children:t}),u("button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:u(Ve,{})})]}),u("div",{className:"rle-sheet__body",children:i}),s&&u("div",{className:"rle-sheet__footer",children:s})]})]}),document.body)}function Ve(){return I("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[u("path",{d:"M18 6 6 18"}),u("path",{d:"m6 6 12 12"})]})}import{useEffect as He,useState as he}from"react";import{jsx as S,jsxs as ye}from"react/jsx-runtime";function ve({search:e,onFiltersClick:r,action:t}){let{Search:i}=P();return ye("header",{className:"rle-mobile-header",children:[e&&S("div",{className:"rle-mobile-header__search",children:S(i,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),ye("button",{type:"button",className:"rle-mobile-header__btn",onClick:r,children:[S(me,{}),S("span",{children:"Filters"})]}),t&&S("button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:t.onClick,"aria-label":t.label,children:t.icon??S(ue,{})})]})}import{Fragment as Oe,jsx as l,jsxs as y}from"react/jsx-runtime";var De=l("div",{className:"rle-empty",children:"Map unavailable"});function be({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,mapCenter:s,mapZoom:a,className:n}){let d=C(),{Search:v}=P(),g=te(),{filters:c}=ee(),[h,F]=he("list"),[M,b]=he(!1),p=e?{value:String(c[e.filterKey]??""),onChange:w=>{d.applyFilters({[e.filterKey]:w||void 0})},placeholder:e.placeholder}:void 0;He(()=>{i!==!1&&d.applyFilters({})},[d,i]);let E=()=>{let w=Object.fromEntries(d.filters.list().map(Ne=>[Ne.key,void 0]));d.applyFilters(w)},_=g.total??g.items.length;return y("div",{className:n?`rle-app ${n}`:"rle-app",children:[y("div",{className:"rle-filter-bar",children:[p&&l(v,{value:p.value,onChange:p.onChange,placeholder:p.placeholder}),l(R,{className:"rle-filters-row",groupClassName:"rle-filter-group"}),y("div",{className:"rle-filter-bar__end",children:[l(ne,{}),r]})]}),l(ve,{search:p,onFiltersClick:()=>b(!0),action:t}),y("div",{className:"rle-body rle-split","data-mobile-view":h,children:[y("div",{className:"rle-list",children:[l(re,{className:"rle-list-grid"}),l(oe,{})]}),l("div",{className:"rle-map",children:l(ie,{center:s,zoom:a,fallback:De})})]}),l(ce,{view:h,onViewChange:F}),l(fe,{title:"Filters",open:M,onOpenChange:b,footer:y(Oe,{children:[l("button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:E,children:"Clear all"}),y("button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>b(!1),children:["Show ",_," results"]})]}),children:l(R,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}import{useEffect as We,useRef as $e,useState as ze}from"react";import{jsx as Z,jsxs as qe}from"react/jsx-runtime";function Le(e){return"provider"in e}function Ue(e){let r=e!=null&&!Le(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[s,a]=ze(()=>!e||Le(e)?{ready:!0,provider:e?.provider}:{ready:!1});return We(()=>{if(!t)return;let n=!1;return import("./maps/google/index.js").then(({googleProvider:d})=>{n||a({ready:!0,provider:d({apiKey:t,mapId:i})})}),()=>{n=!0}},[t,i]),s}function Ze({onFiltersChange:e}){let r=$e(e);return r.current=e,le("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function rr(e){let{datasets:r,filters:t,map:i,components:s,initialFilters:a,onFiltersChange:n,mobileAction:d,search:v,toolbarEnd:g,config:c,autoFetch:h,className:F}=e,{ready:M,provider:b}=Ue(i);if(!M)return null;let p=[];for(let w of r)p.push(Q(w));t&&p.push(X(t)),b&&p.push(J(b)),a&&p.push(Y(a)),c&&p.push(G(c));let E=q(...p),_={...pe,...s};return qe(se,{...E,children:[n&&Z(Ze,{onFiltersChange:n}),Z(j,{..._,children:Z(be,{className:F,search:v,toolbarEnd:g,mobileAction:d,autoFetch:h,mapCenter:i?.center,mapZoom:i?.zoom})})]})}export{le as a,T as b,B as c,A as d,V as e,K as f,D as g,O as h,W as i,$ as j,z as k,pe as l,ce as m,fe as n,be as o,rr as p};
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
+ var _chunk5O36WI7Hcjs = require('./chunk-5O36WI7H.cjs');var _react = require('react');function le(e,r){let t=_chunk5O36WI7Hcjs.s.call(void 0, ),i=_react.useRef.call(void 0, r);i.current=r,_react.useEffect.call(void 0, ()=>t.on(e,s=>i.current(s)),[t,e])}function L(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}var _jsxruntime = require('react/jsx-runtime');function Pe(e){return e?"rle-card rle-card--selected":"rle-card"}function T({item:e,selected:r,onSelect:t}){let i=_nullishCoalesce(e, () => ({})),s=Pe(r),a=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[i.imageUrl?_jsxruntime.jsx.call(void 0, "img",{src:i.imageUrl,alt:_nullishCoalesce(i.title, () => ("")),className:"rle-card-media"}):_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-card-body",children:[i.title&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-title",children:i.title}),i.subtitle&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-address",children:i.subtitle}),i.badge&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-info",children:_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-price",children:L(i.price)})]})]});return t?_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:t,"aria-pressed":_nullishCoalesce(r, () => (!1)),className:s,children:a}):_jsxruntime.jsx.call(void 0, "article",{className:s,children:a})}function B(e){return _jsxruntime.jsxs.call(void 0, "div",{role:"status",className:"rle-empty",children:[_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"11",r:"7"}),_jsxruntime.jsx.call(void 0, "path",{d:"m21 21-4.3-4.3"})]}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-title",children:"No results"}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}function A({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-panel",children:e})}function V(e){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>_jsxruntime.jsxs.call(void 0, "div",{className:"rle-loading-item",children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}function K({point:e}){let r=_nullishCoalesce(e.entity, () => ({}));return _jsxruntime.jsx.call(void 0, "span",{className:"rle-pin",children:r.price!=null?L(r.price):""})}function D({entity:e,onClose:r}){let t=_nullishCoalesce(e, () => ({}));return _jsxruntime.jsxs.call(void 0, "div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}),_jsxruntime.jsxs.call(void 0, "div",{children:[t.title&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-title",children:t.title}),t.subtitle&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-price",children:L(t.price)})]})]})}function O({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return _jsxruntime.jsx.call(void 0, "div",{className:"rle-result-header",children:t})}function W({value:e,onChange:r,placeholder:t}){return _jsxruntime.jsx.call(void 0, "input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":_nullishCoalesce(t, () => ("Search")),className:"rle-input"})}function $({children:e}){return _jsxruntime.jsx.call(void 0, "aside",{className:"rle-sidebar",children:e})}function z({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-toolbar",children:e})}var pe={Card:T,Marker:K,Popup:D,Sidebar:$,FilterPanel:A,Search:W,Empty:B,Loading:V,ResultHeader:O,Toolbar:z};function ce({view:e,onViewChange:r}){return _jsxruntime.jsx.call(void 0, "nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:_jsxruntime.jsxs.call(void 0, "div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[_jsxruntime.jsx.call(void 0, Re,{}),"List"]}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[_jsxruntime.jsx.call(void 0, Te,{}),"Map"]})]})})}function me(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function Re(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Te(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"3",x2:"8",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function ue(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_jsxruntime.jsx.call(void 0, "line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var _reactdom = require('react-dom');function fe({open:e,onOpenChange:r,title:t,children:i,footer:s}){let a=_react.useRef.call(void 0, null),[n,d]=_react.useState.call(void 0, !1),[v,g]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{if(!e){g(!1),d(!1);return}d(!0);let c=requestAnimationFrame(()=>g(!0));return()=>cancelAnimationFrame(c)},[e]),_react.useEffect.call(void 0, ()=>{if(!n)return;let c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=c}},[n]),_react.useEffect.call(void 0, ()=>{if(!n)return;_optionalChain([a, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.focus, 'call', _4 => _4()]);function c(h){h.key==="Escape"&&r(!1)}return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[n,r]),!n||typeof document>"u"?null:_reactdom.createPortal.call(void 0, _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "div",{className:`rle-sheet-backdrop${v?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{ref:a,className:`rle-sheet${v?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__handle","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-sheet__header",children:[t&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__title",children:t}),_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:_jsxruntime.jsx.call(void 0, Ve,{})})]}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__body",children:i}),s&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__footer",children:s})]})]}),document.body)}function Ve(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}function ve({search:e,onFiltersClick:r,action:t}){let{Search:i}=_chunk5O36WI7Hcjs.q.call(void 0, );return _jsxruntime.jsxs.call(void 0, "header",{className:"rle-mobile-header",children:[e&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-mobile-header__search",children:_jsxruntime.jsx.call(void 0, i,{value:e.value,onChange:e.onChange,placeholder:e.placeholder})}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn",onClick:r,children:[_jsxruntime.jsx.call(void 0, me,{}),_jsxruntime.jsx.call(void 0, "span",{children:"Filters"})]}),t&&_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-mobile-header__btn rle-mobile-header__btn--icon",onClick:t.onClick,"aria-label":t.label,children:_nullishCoalesce(t.icon, () => (_jsxruntime.jsx.call(void 0, ue,{})))})]})}var De=_jsxruntime.jsx.call(void 0, "div",{className:"rle-empty",children:"Map unavailable"});function be({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,mapCenter:s,mapZoom:a,className:n}){let d=_chunk5O36WI7Hcjs.s.call(void 0, ),{Search:v}=_chunk5O36WI7Hcjs.q.call(void 0, ),g=_chunk5O36WI7Hcjs.w.call(void 0, ),{filters:c}=_chunk5O36WI7Hcjs.u.call(void 0, ),[h,F]=_react.useState.call(void 0, "list"),[M,b]=_react.useState.call(void 0, !1),p=e?{value:String(_nullishCoalesce(c[e.filterKey], () => (""))),onChange:w=>{d.applyFilters({[e.filterKey]:w||void 0})},placeholder:e.placeholder}:void 0;_react.useEffect.call(void 0, ()=>{i!==!1&&d.applyFilters({})},[d,i]);let E=()=>{let w=Object.fromEntries(d.filters.list().map(Ne=>[Ne.key,void 0]));d.applyFilters(w)},_=_nullishCoalesce(g.total, () => (g.items.length));return _jsxruntime.jsxs.call(void 0, "div",{className:n?`rle-app ${n}`:"rle-app",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar",children:[p&&_jsxruntime.jsx.call(void 0, v,{value:p.value,onChange:p.onChange,placeholder:p.placeholder}),_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.v,{className:"rle-filters-row",groupClassName:"rle-filter-group"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar__end",children:[_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.A,{}),r]})]}),_jsxruntime.jsx.call(void 0, ve,{search:p,onFiltersClick:()=>b(!0),action:t}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-body rle-split","data-mobile-view":h,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-list",children:[_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.x,{className:"rle-list-grid"}),_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.z,{})]}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-map",children:_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.y,{center:s,zoom:a,fallback:De})})]}),_jsxruntime.jsx.call(void 0, ce,{view:h,onViewChange:F}),_jsxruntime.jsx.call(void 0, fe,{title:"Filters",open:M,onOpenChange:b,footer:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:E,children:"Clear all"}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>b(!1),children:["Show ",_," results"]})]}),children:_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.v,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}function Le(e){return"provider"in e}function Ue(e){let r=e!=null&&!Le(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[s,a]=_react.useState.call(void 0, ()=>!e||Le(e)?{ready:!0,provider:_optionalChain([e, 'optionalAccess', _5 => _5.provider])}:{ready:!1});return _react.useEffect.call(void 0, ()=>{if(!t)return;let n=!1;return Promise.resolve().then(() => _interopRequireWildcard(require("./maps/google/index.cjs"))).then(({googleProvider:d})=>{n||a({ready:!0,provider:d({apiKey:t,mapId:i})})}),()=>{n=!0}},[t,i]),s}function Ze({onFiltersChange:e}){let r=_react.useRef.call(void 0, e);return r.current=e,le("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function rr(e){let{datasets:r,filters:t,map:i,components:s,initialFilters:a,onFiltersChange:n,mobileAction:d,search:v,toolbarEnd:g,config:c,autoFetch:h,className:F}=e,{ready:M,provider:b}=Ue(i);if(!M)return null;let p=[];for(let w of r)p.push(_chunk5O36WI7Hcjs.k.call(void 0, w));t&&p.push(_chunk5O36WI7Hcjs.l.call(void 0, t)),b&&p.push(_chunk5O36WI7Hcjs.j.call(void 0, b)),a&&p.push(_chunk5O36WI7Hcjs.n.call(void 0, a)),c&&p.push(_chunk5O36WI7Hcjs.i.call(void 0, c));let E=_chunk5O36WI7Hcjs.h.call(void 0, ...p),_={...pe,...s};return _jsxruntime.jsxs.call(void 0, _chunk5O36WI7Hcjs.B,{...E,children:[n&&_jsxruntime.jsx.call(void 0, Ze,{onFiltersChange:n}),_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.p,{..._,children:_jsxruntime.jsx.call(void 0, be,{className:F,search:v,toolbarEnd:g,mobileAction:d,autoFetch:h,mapCenter:_optionalChain([i, 'optionalAccess', _6 => _6.center]),mapZoom:_optionalChain([i, 'optionalAccess', _7 => _7.zoom])})})]})}exports.a = le; exports.b = T; exports.c = B; exports.d = A; exports.e = V; exports.f = K; exports.g = D; exports.h = O; exports.i = W; exports.j = $; exports.k = z; exports.l = pe; exports.m = ce; exports.n = fe; exports.o = be; exports.p = rr;
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _class;"use client";
2
- var _chunkN3OZ2HK2cjs = require('./chunk-N3OZ2HK2.cjs');var _chunk5O36WI7Hcjs = require('./chunk-5O36WI7H.cjs');var _chunkCHNUE46Kcjs = require('./chunk-CHNUE46K.cjs');var _chunk2VUHLHHXcjs = require('./chunk-2VUHLHHX.cjs');var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u= (_class =class{__init() {this.listeners=new Set}constructor(t={}){;_class.prototype.__init.call(this);this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}}, _class);var _jsxruntime = require('react/jsx-runtime');function Z({children:e}){let{Toolbar:t}=_chunk5O36WI7Hcjs.q.call(void 0, );return _jsxruntime.jsx.call(void 0, t,{children:e})}var _react = require('react');function tt(){let e=_chunk5O36WI7Hcjs.s.call(void 0, ),t=_chunk5O36WI7Hcjs.t.call(void 0, ),o=_react.useCallback.call(void 0, a=>e.loadPoints(a),[e]),n=_react.useCallback.call(void 0, (a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}function it(e){let t=_chunk5O36WI7Hcjs.s.call(void 0, ),o=_chunk5O36WI7Hcjs.t.call(void 0, ),n=_react.useCallback.call(void 0, ()=>t.toggleLayer(e),[t,e]);return{visible:_nullishCoalesce(o.layers[e], () => (!0)),points:_nullishCoalesce(o.points[e], () => ([])),toggle:n}}exports.BrowserHistoryPort = _chunkCHNUE46Kcjs.a; exports.DatasetRegistry = _chunk5O36WI7Hcjs.c; exports.FilterRegistry = _chunk5O36WI7Hcjs.b; exports.ListingApp = _chunkN3OZ2HK2cjs.p; exports.ListingComponentsProvider = _chunk5O36WI7Hcjs.p; exports.ListingConfig = _chunk5O36WI7Hcjs.f; exports.ListingEngine = _chunk5O36WI7Hcjs.g; exports.ListingEngineContext = _chunk5O36WI7Hcjs.r; exports.ListingEventType = f; exports.ListingFilters = _chunk5O36WI7Hcjs.v; exports.ListingList = _chunk5O36WI7Hcjs.x; exports.ListingMap = _chunk5O36WI7Hcjs.y; exports.ListingPagination = _chunk5O36WI7Hcjs.z; exports.ListingProvider = _chunk5O36WI7Hcjs.B; exports.ListingResultHeader = _chunk5O36WI7Hcjs.A; exports.ListingStore = _chunk5O36WI7Hcjs.a; exports.ListingToolbar = Z; exports.MemoryHistoryPort = u; exports.PaginationMode = d; exports.TypedEmitter = _chunk5O36WI7Hcjs.d; exports.UrlSyncController = _chunk2VUHLHHXcjs.a; exports.composeListingProviders = _chunk5O36WI7Hcjs.h; exports.listingDefaultConfig = _chunk5O36WI7Hcjs.e; exports.useListing = _chunk5O36WI7Hcjs.s; exports.useListingComponents = _chunk5O36WI7Hcjs.q; exports.useListingEvent = _chunkN3OZ2HK2cjs.a; exports.useListingFilters = _chunk5O36WI7Hcjs.u; exports.useListingLayer = it; exports.useListingMap = tt; exports.useListingResults = _chunk5O36WI7Hcjs.w; exports.useListingState = _chunk5O36WI7Hcjs.t; exports.withConfig = _chunk5O36WI7Hcjs.i; exports.withDataset = _chunk5O36WI7Hcjs.k; exports.withFilters = _chunk5O36WI7Hcjs.l; exports.withInitialFilters = _chunk5O36WI7Hcjs.n; exports.withMap = _chunk5O36WI7Hcjs.j; exports.withPrimaryDataset = _chunk5O36WI7Hcjs.o; exports.withUrlSync = _chunk5O36WI7Hcjs.m;
2
+ var _chunkWSAS5XXVcjs = require('./chunk-WSAS5XXV.cjs');var _chunk5O36WI7Hcjs = require('./chunk-5O36WI7H.cjs');var _chunkCHNUE46Kcjs = require('./chunk-CHNUE46K.cjs');var _chunk2VUHLHHXcjs = require('./chunk-2VUHLHHX.cjs');var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u= (_class =class{__init() {this.listeners=new Set}constructor(t={}){;_class.prototype.__init.call(this);this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}}, _class);var _jsxruntime = require('react/jsx-runtime');function Z({children:e}){let{Toolbar:t}=_chunk5O36WI7Hcjs.q.call(void 0, );return _jsxruntime.jsx.call(void 0, t,{children:e})}var _react = require('react');function tt(){let e=_chunk5O36WI7Hcjs.s.call(void 0, ),t=_chunk5O36WI7Hcjs.t.call(void 0, ),o=_react.useCallback.call(void 0, a=>e.loadPoints(a),[e]),n=_react.useCallback.call(void 0, (a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}function it(e){let t=_chunk5O36WI7Hcjs.s.call(void 0, ),o=_chunk5O36WI7Hcjs.t.call(void 0, ),n=_react.useCallback.call(void 0, ()=>t.toggleLayer(e),[t,e]);return{visible:_nullishCoalesce(o.layers[e], () => (!0)),points:_nullishCoalesce(o.points[e], () => ([])),toggle:n}}exports.BrowserHistoryPort = _chunkCHNUE46Kcjs.a; exports.DatasetRegistry = _chunk5O36WI7Hcjs.c; exports.FilterRegistry = _chunk5O36WI7Hcjs.b; exports.ListingApp = _chunkWSAS5XXVcjs.p; exports.ListingComponentsProvider = _chunk5O36WI7Hcjs.p; exports.ListingConfig = _chunk5O36WI7Hcjs.f; exports.ListingEngine = _chunk5O36WI7Hcjs.g; exports.ListingEngineContext = _chunk5O36WI7Hcjs.r; exports.ListingEventType = f; exports.ListingFilters = _chunk5O36WI7Hcjs.v; exports.ListingList = _chunk5O36WI7Hcjs.x; exports.ListingMap = _chunk5O36WI7Hcjs.y; exports.ListingPagination = _chunk5O36WI7Hcjs.z; exports.ListingProvider = _chunk5O36WI7Hcjs.B; exports.ListingResultHeader = _chunk5O36WI7Hcjs.A; exports.ListingStore = _chunk5O36WI7Hcjs.a; exports.ListingToolbar = Z; exports.MemoryHistoryPort = u; exports.PaginationMode = d; exports.TypedEmitter = _chunk5O36WI7Hcjs.d; exports.UrlSyncController = _chunk2VUHLHHXcjs.a; exports.composeListingProviders = _chunk5O36WI7Hcjs.h; exports.listingDefaultConfig = _chunk5O36WI7Hcjs.e; exports.useListing = _chunk5O36WI7Hcjs.s; exports.useListingComponents = _chunk5O36WI7Hcjs.q; exports.useListingEvent = _chunkWSAS5XXVcjs.a; exports.useListingFilters = _chunk5O36WI7Hcjs.u; exports.useListingLayer = it; exports.useListingMap = tt; exports.useListingResults = _chunk5O36WI7Hcjs.w; exports.useListingState = _chunk5O36WI7Hcjs.t; exports.withConfig = _chunk5O36WI7Hcjs.i; exports.withDataset = _chunk5O36WI7Hcjs.k; exports.withFilters = _chunk5O36WI7Hcjs.l; exports.withInitialFilters = _chunk5O36WI7Hcjs.n; exports.withMap = _chunk5O36WI7Hcjs.j; exports.withPrimaryDataset = _chunk5O36WI7Hcjs.o; exports.withUrlSync = _chunk5O36WI7Hcjs.m;
package/dist/index.d.cts CHANGED
@@ -9,7 +9,7 @@ import { H as HistoryPort, U as UrlSyncController } from './url-sync.controller-
9
9
  export { a as UrlSyncEngine, b as UrlSyncOptions } from './url-sync.controller-CsU_QxoS.cjs';
10
10
  import * as react from 'react';
11
11
  import { ReactNode } from 'react';
12
- export { L as ListingApp, a as ListingAppProps } from './listing-app-pKMQBuQI.cjs';
12
+ export { L as ListingApp, a as ListingAppProps } from './listing-app-CVGVzkaD.cjs';
13
13
 
14
14
  declare enum ListingEventType {
15
15
  FiltersChanged = "FiltersChanged",
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ import { H as HistoryPort, U as UrlSyncController } from './url-sync.controller-
9
9
  export { a as UrlSyncEngine, b as UrlSyncOptions } from './url-sync.controller-DX67JivW.js';
10
10
  import * as react from 'react';
11
11
  import { ReactNode } from 'react';
12
- export { L as ListingApp, a as ListingAppProps } from './listing-app-De6OqpUC.js';
12
+ export { L as ListingApp, a as ListingAppProps } from './listing-app-Cxw8Kym4.js';
13
13
 
14
14
  declare enum ListingEventType {
15
15
  FiltersChanged = "FiltersChanged",
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as O,p as m}from"./chunk-2T5PE5MB.js";import{A as N,B as U,a as y,b as P,c as L,d as h,e as b,f as x,g as C,h as I,i as k,j as q,k as v,l as B,m as S,n as A,o as F,p as T,q as p,r as w,s,t as i,u as H,v as z,w as D,x as G,y as J,z as K}from"./chunk-PFPHWJAA.js";import{a as R}from"./chunk-5FBI2WIM.js";import{a as Q}from"./chunk-35KYEBAC.js";var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u=class{query;listeners=new Set;constructor(t={}){this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}};import{jsx as c}from"react/jsx-runtime";function Z({children:e}){let{Toolbar:t}=p();return c(t,{children:e})}import{useCallback as l}from"react";function tt(){let e=s(),t=i(),o=l(a=>e.loadPoints(a),[e]),n=l((a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}import{useCallback as g}from"react";function it(e){let t=s(),o=i(),n=g(()=>t.toggleLayer(e),[t,e]);return{visible:o.layers[e]??!0,points:o.points[e]??[],toggle:n}}export{R as BrowserHistoryPort,L as DatasetRegistry,P as FilterRegistry,m as ListingApp,T as ListingComponentsProvider,x as ListingConfig,C as ListingEngine,w as ListingEngineContext,f as ListingEventType,z as ListingFilters,G as ListingList,J as ListingMap,K as ListingPagination,U as ListingProvider,N as ListingResultHeader,y as ListingStore,Z as ListingToolbar,u as MemoryHistoryPort,d as PaginationMode,h as TypedEmitter,Q as UrlSyncController,I as composeListingProviders,b as listingDefaultConfig,s as useListing,p as useListingComponents,O as useListingEvent,H as useListingFilters,it as useListingLayer,tt as useListingMap,D as useListingResults,i as useListingState,k as withConfig,v as withDataset,B as withFilters,A as withInitialFilters,q as withMap,F as withPrimaryDataset,S as withUrlSync};
2
+ import{a as O,p as m}from"./chunk-SDF5ANTO.js";import{A as N,B as U,a as y,b as P,c as L,d as h,e as b,f as x,g as C,h as I,i as k,j as q,k as v,l as B,m as S,n as A,o as F,p as T,q as p,r as w,s,t as i,u as H,v as z,w as D,x as G,y as J,z as K}from"./chunk-PFPHWJAA.js";import{a as R}from"./chunk-5FBI2WIM.js";import{a as Q}from"./chunk-35KYEBAC.js";var d=(o=>(o.Paged="paged",o.Infinite="infinite",o))(d||{});var f=(r=>(r.FiltersChanged="FiltersChanged",r.ResultsLoaded="ResultsLoaded",r.PointClicked="PointClicked",r.BoundsChanged="BoundsChanged",r.LayerToggled="LayerToggled",r))(f||{});var u=class{query;listeners=new Set;constructor(t={}){this.query={...t}}getQuery(){return{...this.query}}setQuery(t){this.query={...t},this.notify()}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){for(let t of[...this.listeners])t()}};import{jsx as c}from"react/jsx-runtime";function Z({children:e}){let{Toolbar:t}=p();return c(t,{children:e})}import{useCallback as l}from"react";function tt(){let e=s(),t=i(),o=l(a=>e.loadPoints(a),[e]),n=l((a,r)=>e.selectPoint(a,r),[e]);return{bounds:t.bounds,points:t.points,loadPoints:o,selectPoint:n}}import{useCallback as g}from"react";function it(e){let t=s(),o=i(),n=g(()=>t.toggleLayer(e),[t,e]);return{visible:o.layers[e]??!0,points:o.points[e]??[],toggle:n}}export{R as BrowserHistoryPort,L as DatasetRegistry,P as FilterRegistry,m as ListingApp,T as ListingComponentsProvider,x as ListingConfig,C as ListingEngine,w as ListingEngineContext,f as ListingEventType,z as ListingFilters,G as ListingList,J as ListingMap,K as ListingPagination,U as ListingProvider,N as ListingResultHeader,y as ListingStore,Z as ListingToolbar,u as MemoryHistoryPort,d as PaginationMode,h as TypedEmitter,Q as UrlSyncController,I as composeListingProviders,b as listingDefaultConfig,s as useListing,p as useListingComponents,O as useListingEvent,H as useListingFilters,it as useListingLayer,tt as useListingMap,D as useListingResults,i as useListingState,k as withConfig,v as withDataset,B as withFilters,A as withInitialFilters,q as withMap,F as withPrimaryDataset,S as withUrlSync};
@@ -14,25 +14,31 @@ interface IBottomNavAction {
14
14
  interface IBottomNavProps {
15
15
  view: BottomNavView;
16
16
  onViewChange(view: BottomNavView): void;
17
- onFiltersClick(): void;
18
- action?: IBottomNavAction;
19
17
  }
20
18
  /**
21
- * Mobile-only bottom navigation bar (`.rle-bottom-nav`, hidden at 768px+ by
22
- * CSS -- see `styles.css`): a **Filters** button that opens the mobile
23
- * `BottomSheet`, an optional caller-supplied `action` button (e.g. "Add"),
24
- * and a **List | Map** segmented toggle (`.rle-viewtoggle`) that drives which
25
- * of `StyledListingLayout`'s two full-area panels is visible. No lucide/icon
26
- * library dependency -- every icon here is a small inline SVG, matching the
27
- * rest of `/styled`'s zero-extra-dependency policy.
19
+ * Mobile-only bottom navigation (`.rle-bottom-nav`, hidden at 768px+ by CSS --
20
+ * see `styles.css`): a floating **List | Map** segmented toggle
21
+ * (`.rle-viewtoggle`) that drives which of `StyledListingLayout`'s two
22
+ * full-area panels is visible. The **Filters** button and the optional caller
23
+ * action (e.g. "Save") live in the mobile header (`MobileHeader`) instead, so
24
+ * the footer pill carries the view toggle alone. No lucide/icon library
25
+ * dependency -- every icon here is a small inline SVG, matching the rest of
26
+ * `/styled`'s zero-extra-dependency policy.
28
27
  */
29
- declare function BottomNav({ view, onViewChange, onFiltersClick, action }: IBottomNavProps): react.JSX.Element;
28
+ declare function BottomNav({ view, onViewChange }: IBottomNavProps): react.JSX.Element;
30
29
 
31
30
  interface IStyledListingLayoutProps {
32
- /** Optional search box -- same shape/reasoning as `/shadcn`'s `ListingLayout.search`; omitted entirely when not passed. */
31
+ /**
32
+ * Optional header search box, LIBRARY-wired (unlike `/shadcn`'s
33
+ * consumer-managed `search`): name the `TFilters` field it drives via
34
+ * `filterKey`, and the layout reads the current value from the engine's
35
+ * filters and writes edits back with `applyFilters({ [filterKey]: value ||
36
+ * undefined })`. Rendered in BOTH the desktop filter bar and the mobile
37
+ * header. Do NOT also register `filterKey` as a `ListingFilters` control --
38
+ * it would then render twice. Omitted entirely when not passed.
39
+ */
33
40
  search?: {
34
- value: string;
35
- onChange: (value: string) => void;
41
+ filterKey: string;
36
42
  placeholder?: string;
37
43
  };
38
44
  /** Extra content rendered at the end of the desktop filter bar, alongside `ListingResultHeader` (e.g. a sort control). */
@@ -14,25 +14,31 @@ interface IBottomNavAction {
14
14
  interface IBottomNavProps {
15
15
  view: BottomNavView;
16
16
  onViewChange(view: BottomNavView): void;
17
- onFiltersClick(): void;
18
- action?: IBottomNavAction;
19
17
  }
20
18
  /**
21
- * Mobile-only bottom navigation bar (`.rle-bottom-nav`, hidden at 768px+ by
22
- * CSS -- see `styles.css`): a **Filters** button that opens the mobile
23
- * `BottomSheet`, an optional caller-supplied `action` button (e.g. "Add"),
24
- * and a **List | Map** segmented toggle (`.rle-viewtoggle`) that drives which
25
- * of `StyledListingLayout`'s two full-area panels is visible. No lucide/icon
26
- * library dependency -- every icon here is a small inline SVG, matching the
27
- * rest of `/styled`'s zero-extra-dependency policy.
19
+ * Mobile-only bottom navigation (`.rle-bottom-nav`, hidden at 768px+ by CSS --
20
+ * see `styles.css`): a floating **List | Map** segmented toggle
21
+ * (`.rle-viewtoggle`) that drives which of `StyledListingLayout`'s two
22
+ * full-area panels is visible. The **Filters** button and the optional caller
23
+ * action (e.g. "Save") live in the mobile header (`MobileHeader`) instead, so
24
+ * the footer pill carries the view toggle alone. No lucide/icon library
25
+ * dependency -- every icon here is a small inline SVG, matching the rest of
26
+ * `/styled`'s zero-extra-dependency policy.
28
27
  */
29
- declare function BottomNav({ view, onViewChange, onFiltersClick, action }: IBottomNavProps): react.JSX.Element;
28
+ declare function BottomNav({ view, onViewChange }: IBottomNavProps): react.JSX.Element;
30
29
 
31
30
  interface IStyledListingLayoutProps {
32
- /** Optional search box -- same shape/reasoning as `/shadcn`'s `ListingLayout.search`; omitted entirely when not passed. */
31
+ /**
32
+ * Optional header search box, LIBRARY-wired (unlike `/shadcn`'s
33
+ * consumer-managed `search`): name the `TFilters` field it drives via
34
+ * `filterKey`, and the layout reads the current value from the engine's
35
+ * filters and writes edits back with `applyFilters({ [filterKey]: value ||
36
+ * undefined })`. Rendered in BOTH the desktop filter bar and the mobile
37
+ * header. Do NOT also register `filterKey` as a `ListingFilters` control --
38
+ * it would then render twice. Omitted entirely when not passed.
39
+ */
33
40
  search?: {
34
- value: string;
35
- onChange: (value: string) => void;
41
+ filterKey: string;
36
42
  placeholder?: string;
37
43
  };
38
44
  /** Extra content rendered at the end of the desktop filter bar, alongside `ListingResultHeader` (e.g. a sort control). */
@@ -1,2 +1,2 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
- var _chunkN3OZ2HK2cjs = require('../chunk-N3OZ2HK2.cjs');var _chunk5O36WI7Hcjs = require('../chunk-5O36WI7H.cjs');var _jsxruntime = require('react/jsx-runtime');function L({children:o}){return _jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.p,{..._chunkN3OZ2HK2cjs.l,children:o})}exports.BottomNav = _chunkN3OZ2HK2cjs.m; exports.BottomSheet = _chunkN3OZ2HK2cjs.n; exports.ListingApp = _chunkN3OZ2HK2cjs.p; exports.StyledCard = _chunkN3OZ2HK2cjs.b; exports.StyledComponentsProviderWithDefaults = L; exports.StyledEmpty = _chunkN3OZ2HK2cjs.c; exports.StyledFilterPanel = _chunkN3OZ2HK2cjs.d; exports.StyledListingLayout = _chunkN3OZ2HK2cjs.o; exports.StyledLoading = _chunkN3OZ2HK2cjs.e; exports.StyledMarker = _chunkN3OZ2HK2cjs.f; exports.StyledPopup = _chunkN3OZ2HK2cjs.g; exports.StyledResultHeader = _chunkN3OZ2HK2cjs.h; exports.StyledSearch = _chunkN3OZ2HK2cjs.i; exports.StyledSidebar = _chunkN3OZ2HK2cjs.j; exports.StyledToolbar = _chunkN3OZ2HK2cjs.k; exports.styledDefaultComponents = _chunkN3OZ2HK2cjs.l;
2
+ var _chunkWSAS5XXVcjs = require('../chunk-WSAS5XXV.cjs');var _chunk5O36WI7Hcjs = require('../chunk-5O36WI7H.cjs');var _jsxruntime = require('react/jsx-runtime');function L({children:o}){return _jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.p,{..._chunkWSAS5XXVcjs.l,children:o})}exports.BottomNav = _chunkWSAS5XXVcjs.m; exports.BottomSheet = _chunkWSAS5XXVcjs.n; exports.ListingApp = _chunkWSAS5XXVcjs.p; exports.StyledCard = _chunkWSAS5XXVcjs.b; exports.StyledComponentsProviderWithDefaults = L; exports.StyledEmpty = _chunkWSAS5XXVcjs.c; exports.StyledFilterPanel = _chunkWSAS5XXVcjs.d; exports.StyledListingLayout = _chunkWSAS5XXVcjs.o; exports.StyledLoading = _chunkWSAS5XXVcjs.e; exports.StyledMarker = _chunkWSAS5XXVcjs.f; exports.StyledPopup = _chunkWSAS5XXVcjs.g; exports.StyledResultHeader = _chunkWSAS5XXVcjs.h; exports.StyledSearch = _chunkWSAS5XXVcjs.i; exports.StyledSidebar = _chunkWSAS5XXVcjs.j; exports.StyledToolbar = _chunkWSAS5XXVcjs.k; exports.styledDefaultComponents = _chunkWSAS5XXVcjs.l;
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { c as IListingCardProps, e as IListingEmptyProps, f as IListingFilterPanelProps, g as IListingLoadingProps, h as IListingMarkerProps, i as IListingPopupProps, j as IListingResultHeaderProps, k as IListingSearchProps, l as IListingSidebarProps, I as IListingToolbarProps, d as IListingComponents } from '../components-provider-CF0Mo0B8.cjs';
4
- export { B as BottomNav, b as BottomNavView, I as IBottomNavAction, c as IBottomNavProps, d as IStyledListingLayoutProps, L as ListingApp, e as ListingAppMapProp, a as ListingAppProps, S as StyledListingLayout } from '../listing-app-pKMQBuQI.cjs';
4
+ export { B as BottomNav, b as BottomNavView, I as IBottomNavAction, c as IBottomNavProps, d as IStyledListingLayoutProps, L as ListingApp, e as ListingAppMapProp, a as ListingAppProps, S as StyledListingLayout } from '../listing-app-CVGVzkaD.cjs';
5
5
  import '../entity-adapter.interface-BDgbSxhq.cjs';
6
6
  import '../map-provider.interface-BMnwW3ob.cjs';
7
7
  import '../listing-config-options.interface-ZJYY_ZvR.cjs';
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { c as IListingCardProps, e as IListingEmptyProps, f as IListingFilterPanelProps, g as IListingLoadingProps, h as IListingMarkerProps, i as IListingPopupProps, j as IListingResultHeaderProps, k as IListingSearchProps, l as IListingSidebarProps, I as IListingToolbarProps, d as IListingComponents } from '../components-provider-CjMxkxrP.js';
4
- export { B as BottomNav, b as BottomNavView, I as IBottomNavAction, c as IBottomNavProps, d as IStyledListingLayoutProps, L as ListingApp, e as ListingAppMapProp, a as ListingAppProps, S as StyledListingLayout } from '../listing-app-De6OqpUC.js';
4
+ export { B as BottomNav, b as BottomNavView, I as IBottomNavAction, c as IBottomNavProps, d as IStyledListingLayoutProps, L as ListingApp, e as ListingAppMapProp, a as ListingAppProps, S as StyledListingLayout } from '../listing-app-Cxw8Kym4.js';
5
5
  import '../entity-adapter.interface-BDgbSxhq.js';
6
6
  import '../map-provider.interface-BxexMT3X.js';
7
7
  import '../listing-config-options.interface-ZJYY_ZvR.js';
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{b as r,c as p,d as i,e as d,f as y,g as l,h as n,i as m,j as s,k as a,l as t,m as S,n as f,o as P,p as u}from"../chunk-2T5PE5MB.js";import{p as e}from"../chunk-PFPHWJAA.js";import{jsx as g}from"react/jsx-runtime";function L({children:o}){return g(e,{...t,children:o})}export{S as BottomNav,f as BottomSheet,u as ListingApp,r as StyledCard,L as StyledComponentsProviderWithDefaults,p as StyledEmpty,i as StyledFilterPanel,P as StyledListingLayout,d as StyledLoading,y as StyledMarker,l as StyledPopup,n as StyledResultHeader,m as StyledSearch,s as StyledSidebar,a as StyledToolbar,t as styledDefaultComponents};
2
+ import{b as r,c as p,d as i,e as d,f as y,g as l,h as n,i as m,j as s,k as a,l as t,m as S,n as f,o as P,p as u}from"../chunk-SDF5ANTO.js";import{p as e}from"../chunk-PFPHWJAA.js";import{jsx as g}from"react/jsx-runtime";function L({children:o}){return g(e,{...t,children:o})}export{S as BottomNav,f as BottomSheet,u as ListingApp,r as StyledCard,L as StyledComponentsProviderWithDefaults,p as StyledEmpty,i as StyledFilterPanel,P as StyledListingLayout,d as StyledLoading,y as StyledMarker,l as StyledPopup,n as StyledResultHeader,m as StyledSearch,s as StyledSidebar,a as StyledToolbar,t as styledDefaultComponents};
package/dist/styles.css CHANGED
@@ -588,7 +588,6 @@
588
588
  .rle-select,
589
589
  .rle-dropdown,
590
590
  .rle-btn,
591
- .rle-bottom-nav__btn,
592
591
  .rle-viewtoggle__btn,
593
592
  .rle-sheet,
594
593
  .rle-sheet-backdrop {
@@ -619,7 +618,6 @@
619
618
  .rle-list-grid,
620
619
  .rle-map,
621
620
  .rle-bottom-nav,
622
- .rle-bottom-nav__btn,
623
621
  .rle-viewtoggle,
624
622
  .rle-viewtoggle__btn,
625
623
  .rle-sheet-backdrop,
@@ -694,6 +692,78 @@
694
692
  min-width: 0;
695
693
  }
696
694
 
695
+ /* -----------------------------------------------------------------------
696
+ * Mobile header -- shown below 768px (hidden at 768px+), the compact
697
+ * counterpart to the desktop `.rle-filter-bar`: the search input (grows to
698
+ * fill), a Filters button that opens the bottom sheet, and an optional
699
+ * trailing action (e.g. Save). The List|Map toggle lives in the floating
700
+ * footer (`.rle-bottom-nav`) instead.
701
+ * --------------------------------------------------------------------- */
702
+
703
+ .rle-mobile-header {
704
+ display: none;
705
+ }
706
+
707
+ @media (max-width: 767px) {
708
+ .rle-mobile-header {
709
+ position: sticky;
710
+ top: 0;
711
+ z-index: 10;
712
+ display: flex;
713
+ align-items: center;
714
+ gap: 8px;
715
+ padding: var(--rle-space);
716
+ background: var(--rle-surface);
717
+ border-bottom: 1px solid var(--rle-border);
718
+ }
719
+ }
720
+
721
+ .rle-mobile-header__search {
722
+ flex: 1;
723
+ min-width: 0;
724
+ }
725
+
726
+ .rle-mobile-header__btn {
727
+ display: inline-flex;
728
+ flex-shrink: 0;
729
+ align-items: center;
730
+ justify-content: center;
731
+ gap: 6px;
732
+ height: 40px;
733
+ padding: 0 12px;
734
+ background: var(--rle-surface);
735
+ border: 1px solid var(--rle-border);
736
+ border-radius: var(--rle-radius-sm);
737
+ color: var(--rle-fg);
738
+ font-size: var(--rle-fs-sm);
739
+ font-weight: 500;
740
+ white-space: nowrap;
741
+ cursor: pointer;
742
+ transition:
743
+ background-color 150ms ease,
744
+ border-color 150ms ease;
745
+ }
746
+
747
+ .rle-mobile-header__btn svg {
748
+ width: 18px;
749
+ height: 18px;
750
+ }
751
+
752
+ .rle-mobile-header__btn:hover {
753
+ background: var(--rle-muted-bg);
754
+ }
755
+
756
+ .rle-mobile-header__btn:focus-visible {
757
+ outline: none;
758
+ box-shadow: 0 0 0 3px var(--rle-ring);
759
+ }
760
+
761
+ .rle-mobile-header__btn--icon {
762
+ width: 40px;
763
+ padding: 0;
764
+ color: var(--rle-muted);
765
+ }
766
+
697
767
  /* -----------------------------------------------------------------------
698
768
  * Body / split -- list-left, map-right from 768px up; a single full-area
699
769
  * panel (one of `.rle-list`/`.rle-map` visible at a time) below it.
@@ -789,45 +859,6 @@
789
859
  }
790
860
  }
791
861
 
792
- .rle-bottom-nav__btn {
793
- display: flex;
794
- flex: 1;
795
- flex-direction: column;
796
- align-items: center;
797
- justify-content: center;
798
- gap: 2px;
799
- min-height: 44px;
800
- padding: 6px 4px;
801
- background: transparent;
802
- border: none;
803
- color: var(--rle-muted);
804
- font-size: var(--rle-fs-sm);
805
- font-weight: 500;
806
- line-height: 1.2;
807
- cursor: pointer;
808
- transition:
809
- color 150ms ease,
810
- background-color 150ms ease;
811
- }
812
-
813
- .rle-bottom-nav__btn svg {
814
- width: 20px;
815
- height: 20px;
816
- }
817
-
818
- .rle-bottom-nav__btn:hover {
819
- background: var(--rle-muted-bg);
820
- }
821
-
822
- .rle-bottom-nav__btn:focus-visible {
823
- outline: none;
824
- box-shadow: inset 0 0 0 2px var(--rle-ring);
825
- }
826
-
827
- .rle-bottom-nav__btn--active {
828
- color: var(--rle-primary);
829
- }
830
-
831
862
  .rle-viewtoggle {
832
863
  display: flex;
833
864
  flex: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-listing-engine",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "description": "Headless, composable listing engine for React: filterable list + Google-Maps multi-layer map, with pluggable data adapters, a filter/dataset registry, injectable components, and a shadcn-compatible styled adapter.",
6
6
  "funding": [
@@ -30,14 +30,6 @@
30
30
  "shadcn"
31
31
  ],
32
32
  "author": "knazark",
33
- "repository": {
34
- "type": "git",
35
- "url": "git+https://github.com/knazark/react-listing-engine.git"
36
- },
37
- "homepage": "https://github.com/knazark/react-listing-engine#readme",
38
- "bugs": {
39
- "url": "https://github.com/knazark/react-listing-engine/issues"
40
- },
41
33
  "type": "module",
42
34
  "sideEffects": [
43
35
  "./dist/styles.css"
@@ -103,6 +95,14 @@
103
95
  "optional": true
104
96
  }
105
97
  },
98
+ "scripts": {
99
+ "build": "tsup",
100
+ "test": "vitest run",
101
+ "test:watch": "vitest",
102
+ "typecheck": "tsc -p tsconfig.json --noEmit",
103
+ "lint": "eslint .",
104
+ "release": "changeset publish"
105
+ },
106
106
  "devDependencies": {
107
107
  "@changesets/cli": "^2.31.1",
108
108
  "@googlemaps/js-api-loader": "^2.1.1",
@@ -131,13 +131,5 @@
131
131
  },
132
132
  "publishConfig": {
133
133
  "access": "public"
134
- },
135
- "scripts": {
136
- "build": "tsup",
137
- "test": "vitest run",
138
- "test:watch": "vitest",
139
- "typecheck": "tsc -p tsconfig.json --noEmit",
140
- "lint": "eslint .",
141
- "release": "changeset publish"
142
134
  }
143
- }
135
+ }
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{A as re,B as ie,h as z,i as U,j as Z,k as q,l as G,n as J,p as Q,q as X,s as w,v as M,w as Y,x as j,y as ee,z as te}from"./chunk-PFPHWJAA.js";import{useEffect as fe,useRef as ye}from"react";function oe(e,r){let t=w(),i=ye(r);i.current=r,fe(()=>t.on(e,s=>i.current(s)),[t,e])}function h(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}import{Fragment as he,jsx as m,jsxs as ne}from"react/jsx-runtime";function ve(e){return e?"rle-card rle-card--selected":"rle-card"}function E({item:e,selected:r,onSelect:t}){let i=e??{},s=ve(r),a=ne(he,{children:[i.imageUrl?m("img",{src:i.imageUrl,alt:i.title??"",className:"rle-card-media"}):m("div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),ne("div",{className:"rle-card-body",children:[i.title&&m("span",{className:"rle-card-title",children:i.title}),i.subtitle&&m("span",{className:"rle-card-address",children:i.subtitle}),i.badge&&m("div",{className:"rle-card-info",children:m("span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&m("span",{className:"rle-card-price",children:h(i.price)})]})]});return t?m("button",{type:"button",onClick:t,"aria-pressed":r??!1,className:s,children:a}):m("article",{className:s,children:a})}import{jsx as P,jsxs as se}from"react/jsx-runtime";function T(e){return se("div",{role:"status",className:"rle-empty",children:[se("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[P("circle",{cx:"11",cy:"11",r:"7"}),P("path",{d:"m21 21-4.3-4.3"})]}),P("p",{className:"rle-empty-title",children:"No results"}),P("p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}import{jsx as be}from"react/jsx-runtime";function _({children:e}){return be("div",{className:"rle-filter-panel",children:e})}import{jsx as C,jsxs as Le}from"react/jsx-runtime";function R(e){return C("div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>Le("div",{className:"rle-loading-item",children:[C("div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),C("div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),C("div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}import{jsx as Ne}from"react/jsx-runtime";function B({point:e}){let r=e.entity??{};return Ne("span",{className:"rle-pin",children:r.price!=null?h(r.price):""})}import{jsx as b,jsxs as A}from"react/jsx-runtime";function V({entity:e,onClose:r}){let t=e??{};return A("div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[b("button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:A("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[b("path",{d:"M18 6 6 18"}),b("path",{d:"m6 6 12 12"})]})}),A("div",{children:[t.title&&b("div",{className:"rle-card-title",children:t.title}),t.subtitle&&b("div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&b("div",{className:"rle-card-price",children:h(t.price)})]})]})}import{jsx as Se}from"react/jsx-runtime";function D({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return Se("div",{className:"rle-result-header",children:t})}import{jsx as we}from"react/jsx-runtime";function O({value:e,onChange:r,placeholder:t}){return we("input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":t??"Search",className:"rle-input"})}import{jsx as Pe}from"react/jsx-runtime";function K({children:e}){return Pe("aside",{className:"rle-sidebar",children:e})}import{jsx as Ce}from"react/jsx-runtime";function W({children:e}){return Ce("div",{className:"rle-toolbar",children:e})}var ae={Card:E,Marker:B,Popup:V,Sidebar:K,FilterPanel:_,Search:O,Empty:T,Loading:R,ResultHeader:D,Toolbar:W};import{jsx as o,jsxs as c}from"react/jsx-runtime";function le({view:e,onViewChange:r,onFiltersClick:t,action:i}){return c("nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:[c("button",{type:"button",className:"rle-bottom-nav__btn",onClick:t,children:[o(xe,{}),o("span",{children:"Filters"})]}),i&&c("button",{type:"button",className:"rle-bottom-nav__btn",onClick:i.onClick,children:[i.icon??o(Fe,{}),o("span",{children:i.label})]}),c("div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[c("button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[o(ke,{}),"List"]}),c("button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[o(Ie,{}),"Map"]})]})]})}function xe(){return c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"4",y1:"6",x2:"20",y2:"6"}),o("circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"12",x2:"20",y2:"12"}),o("circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),o("line",{x1:"4",y1:"18",x2:"20",y2:"18"}),o("circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function ke(){return c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("line",{x1:"8",y1:"6",x2:"20",y2:"6"}),o("line",{x1:"8",y1:"12",x2:"20",y2:"12"}),o("line",{x1:"8",y1:"18",x2:"20",y2:"18"}),o("line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),o("line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),o("line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Ie(){return c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[o("polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),o("line",{x1:"8",y1:"3",x2:"8",y2:"18"}),o("line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function Fe(){return c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[o("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),o("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}import{useEffect as H,useRef as Me,useState as de}from"react";import{createPortal as Ee}from"react-dom";import{Fragment as _e,jsx as u,jsxs as x}from"react/jsx-runtime";function pe({open:e,onOpenChange:r,title:t,children:i,footer:s}){let a=Me(null),[n,p]=de(!1),[v,f]=de(!1);return H(()=>{if(!e){f(!1),p(!1);return}p(!0);let l=requestAnimationFrame(()=>f(!0));return()=>cancelAnimationFrame(l)},[e]),H(()=>{if(!n)return;let l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=l}},[n]),H(()=>{if(!n)return;a.current?.focus();function l(L){L.key==="Escape"&&r(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[n,r]),!n||typeof document>"u"?null:Ee(x(_e,{children:[u("div",{className:`rle-sheet-backdrop${v?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),x("div",{ref:a,className:`rle-sheet${v?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[u("div",{className:"rle-sheet__handle","aria-hidden":"true"}),x("div",{className:"rle-sheet__header",children:[t&&u("div",{className:"rle-sheet__title",children:t}),u("button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:u(Te,{})})]}),u("div",{className:"rle-sheet__body",children:i}),s&&u("div",{className:"rle-sheet__footer",children:s})]})]}),document.body)}function Te(){return x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[u("path",{d:"M18 6 6 18"}),u("path",{d:"m6 6 12 12"})]})}import{useEffect as Re,useState as ce}from"react";import{Fragment as Ae,jsx as d,jsxs as y}from"react/jsx-runtime";var Be=d("div",{className:"rle-empty",children:"Map unavailable"});function me({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,mapCenter:s,mapZoom:a,className:n}){let p=w(),{Search:v}=X(),f=Y(),[l,L]=ce("list"),[k,N]=ce(!1);Re(()=>{i!==!1&&p.applyFilters({})},[p,i]);let S=()=>{let I=Object.fromEntries(p.filters.list().map(F=>[F.key,void 0]));p.applyFilters(I)},g=f.total??f.items.length;return y("div",{className:n?`rle-app ${n}`:"rle-app",children:[y("div",{className:"rle-filter-bar",children:[e&&d(v,{value:e.value,onChange:e.onChange,placeholder:e.placeholder}),d(M,{className:"rle-filters-row",groupClassName:"rle-filter-group"}),y("div",{className:"rle-filter-bar__end",children:[d(re,{}),r]})]}),y("div",{className:"rle-body rle-split","data-mobile-view":l,children:[y("div",{className:"rle-list",children:[d(j,{className:"rle-list-grid"}),d(te,{})]}),d("div",{className:"rle-map",children:d(ee,{center:s,zoom:a,fallback:Be})})]}),d(le,{view:l,onViewChange:L,onFiltersClick:()=>N(!0),action:t}),d(pe,{title:"Filters",open:k,onOpenChange:N,footer:y(Ae,{children:[d("button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:S,children:"Clear all"}),y("button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>N(!1),children:["Show ",g," results"]})]}),children:d(M,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}import{useEffect as Ve,useRef as De,useState as Oe}from"react";import{jsx as $,jsxs as He}from"react/jsx-runtime";function ue(e){return"provider"in e}function Ke(e){let r=e!=null&&!ue(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[s,a]=Oe(()=>!e||ue(e)?{ready:!0,provider:e?.provider}:{ready:!1});return Ve(()=>{if(!t)return;let n=!1;return import("./maps/google/index.js").then(({googleProvider:p})=>{n||a({ready:!0,provider:p({apiKey:t,mapId:i})})}),()=>{n=!0}},[t,i]),s}function We({onFiltersChange:e}){let r=De(e);return r.current=e,oe("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function Zt(e){let{datasets:r,filters:t,map:i,components:s,initialFilters:a,onFiltersChange:n,mobileAction:p,search:v,toolbarEnd:f,config:l,autoFetch:L,className:k}=e,{ready:N,provider:S}=Ke(i);if(!N)return null;let g=[];for(let ge of r)g.push(q(ge));t&&g.push(G(t)),S&&g.push(Z(S)),a&&g.push(J(a)),l&&g.push(U(l));let I=z(...g),F={...ae,...s};return He(ie,{...I,children:[n&&$(We,{onFiltersChange:n}),$(Q,{...F,children:$(me,{className:k,search:v,toolbarEnd:f,mobileAction:p,autoFetch:L,mapCenter:i?.center,mapZoom:i?.zoom})})]})}export{oe as a,E as b,T as c,_ as d,R as e,B as f,V as g,D as h,O as i,K as j,W as k,ae as l,le as m,pe as n,me as o,Zt as p};
@@ -1,2 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
- var _chunk5O36WI7Hcjs = require('./chunk-5O36WI7H.cjs');var _react = require('react');function oe(e,r){let t=_chunk5O36WI7Hcjs.s.call(void 0, ),i=_react.useRef.call(void 0, r);i.current=r,_react.useEffect.call(void 0, ()=>t.on(e,s=>i.current(s)),[t,e])}function h(e){return typeof e!="number"?e:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}var _jsxruntime = require('react/jsx-runtime');function ve(e){return e?"rle-card rle-card--selected":"rle-card"}function E({item:e,selected:r,onSelect:t}){let i=_nullishCoalesce(e, () => ({})),s=ve(r),a=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[i.imageUrl?_jsxruntime.jsx.call(void 0, "img",{src:i.imageUrl,alt:_nullishCoalesce(i.title, () => ("")),className:"rle-card-media"}):_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-media rle-card-media--placeholder","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-card-body",children:[i.title&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-title",children:i.title}),i.subtitle&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-address",children:i.subtitle}),i.badge&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-info",children:_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-info-item",children:i.badge})}),i.price!=null&&_jsxruntime.jsx.call(void 0, "span",{className:"rle-card-price",children:h(i.price)})]})]});return t?_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:t,"aria-pressed":_nullishCoalesce(r, () => (!1)),className:s,children:a}):_jsxruntime.jsx.call(void 0, "article",{className:s,children:a})}function T(e){return _jsxruntime.jsxs.call(void 0, "div",{role:"status",className:"rle-empty",children:[_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",className:"rle-empty-icon","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"11",r:"7"}),_jsxruntime.jsx.call(void 0, "path",{d:"m21 21-4.3-4.3"})]}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-title",children:"No results"}),_jsxruntime.jsx.call(void 0, "p",{className:"rle-empty-hint",children:"Try adjusting your filters or search terms."})]})}function _({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-filter-panel",children:e})}function R(e){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-loading",role:"status","aria-busy":"true","aria-label":"Loading results",children:Array.from({length:3}).map((r,t)=>_jsxruntime.jsxs.call(void 0, "div",{className:"rle-loading-item",children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{aspectRatio:"4 / 3",width:"100%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:16,width:"65%"}}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-skeleton",style:{height:12,width:"35%"}})]},t))})}function B({point:e}){let r=_nullishCoalesce(e.entity, () => ({}));return _jsxruntime.jsx.call(void 0, "span",{className:"rle-pin",children:r.price!=null?h(r.price):""})}function V({entity:e,onClose:r}){let t=_nullishCoalesce(e, () => ({}));return _jsxruntime.jsxs.call(void 0, "div",{className:"rle-popup",role:"group","aria-label":"Location details",children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",onClick:r,"aria-label":"Close",className:"rle-popup-close",children:_jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}),_jsxruntime.jsxs.call(void 0, "div",{children:[t.title&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-title",children:t.title}),t.subtitle&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-address",children:t.subtitle}),t.price!=null&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-card-price",children:h(t.price)})]})]})}function D({count:e,total:r}){let t=r!=null&&r!==e?`${e} of ${r} results`:`${e} results`;return _jsxruntime.jsx.call(void 0, "div",{className:"rle-result-header",children:t})}function O({value:e,onChange:r,placeholder:t}){return _jsxruntime.jsx.call(void 0, "input",{type:"search",value:e,placeholder:t,onChange:i=>r(i.target.value),"aria-label":_nullishCoalesce(t, () => ("Search")),className:"rle-input"})}function K({children:e}){return _jsxruntime.jsx.call(void 0, "aside",{className:"rle-sidebar",children:e})}function W({children:e}){return _jsxruntime.jsx.call(void 0, "div",{className:"rle-toolbar",children:e})}var ae={Card:E,Marker:B,Popup:V,Sidebar:K,FilterPanel:_,Search:O,Empty:T,Loading:R,ResultHeader:D,Toolbar:W};function le({view:e,onViewChange:r,onFiltersClick:t,action:i}){return _jsxruntime.jsxs.call(void 0, "nav",{className:"rle-bottom-nav","aria-label":"Listing navigation",children:[_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-bottom-nav__btn",onClick:t,children:[_jsxruntime.jsx.call(void 0, xe,{}),_jsxruntime.jsx.call(void 0, "span",{children:"Filters"})]}),i&&_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-bottom-nav__btn",onClick:i.onClick,children:[_nullishCoalesce(i.icon, () => (_jsxruntime.jsx.call(void 0, Fe,{}))),_jsxruntime.jsx.call(void 0, "span",{children:i.label})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-viewtoggle",role:"group","aria-label":"View",children:[_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="list"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="list",onClick:()=>r("list"),children:[_jsxruntime.jsx.call(void 0, ke,{}),"List"]}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:`rle-viewtoggle__btn${e==="map"?" rle-viewtoggle__btn--active":""}`,"aria-pressed":e==="map",onClick:()=>r("map"),children:[_jsxruntime.jsx.call(void 0, Ie,{}),"Map"]})]})]})}function xe(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"9",cy:"6",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"15",cy:"12",r:"2",fill:"currentColor",stroke:"none"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "circle",{cx:"11",cy:"18",r:"2",fill:"currentColor",stroke:"none"})]})}function ke(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"6",x2:"20",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"12",x2:"20",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"18",x2:"20",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"6",x2:"4.01",y2:"6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"12",x2:"4.01",y2:"12"}),_jsxruntime.jsx.call(void 0, "line",{x1:"4",y1:"18",x2:"4.01",y2:"18"})]})}function Ie(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "polygon",{points:"1 6 8 3 16 6 23 3 23 18 16 21 8 18 1 21 1 6"}),_jsxruntime.jsx.call(void 0, "line",{x1:"8",y1:"3",x2:"8",y2:"18"}),_jsxruntime.jsx.call(void 0, "line",{x1:"16",y1:"6",x2:"16",y2:"21"})]})}function Fe(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_jsxruntime.jsx.call(void 0, "line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}var _reactdom = require('react-dom');function pe({open:e,onOpenChange:r,title:t,children:i,footer:s}){let a=_react.useRef.call(void 0, null),[n,p]=_react.useState.call(void 0, !1),[v,f]=_react.useState.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{if(!e){f(!1),p(!1);return}p(!0);let l=requestAnimationFrame(()=>f(!0));return()=>cancelAnimationFrame(l)},[e]),_react.useEffect.call(void 0, ()=>{if(!n)return;let l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=l}},[n]),_react.useEffect.call(void 0, ()=>{if(!n)return;_optionalChain([a, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.focus, 'call', _4 => _4()]);function l(L){L.key==="Escape"&&r(!1)}return document.addEventListener("keydown",l),()=>document.removeEventListener("keydown",l)},[n,r]),!n||typeof document>"u"?null:_reactdom.createPortal.call(void 0, _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "div",{className:`rle-sheet-backdrop${v?" rle-sheet-backdrop--open":""}`,onClick:()=>r(!1),"aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{ref:a,className:`rle-sheet${v?" rle-sheet--open":""}`,role:"dialog","aria-modal":"true","aria-label":t,tabIndex:-1,children:[_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__handle","aria-hidden":"true"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-sheet__header",children:[t&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__title",children:t}),_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-sheet__close",onClick:()=>r(!1),"aria-label":"Close",children:_jsxruntime.jsx.call(void 0, Te,{})})]}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__body",children:i}),s&&_jsxruntime.jsx.call(void 0, "div",{className:"rle-sheet__footer",children:s})]})]}),document.body)}function Te(){return _jsxruntime.jsxs.call(void 0, "svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16","aria-hidden":"true",children:[_jsxruntime.jsx.call(void 0, "path",{d:"M18 6 6 18"}),_jsxruntime.jsx.call(void 0, "path",{d:"m6 6 12 12"})]})}var Be=_jsxruntime.jsx.call(void 0, "div",{className:"rle-empty",children:"Map unavailable"});function me({search:e,toolbarEnd:r,mobileAction:t,autoFetch:i=!0,mapCenter:s,mapZoom:a,className:n}){let p=_chunk5O36WI7Hcjs.s.call(void 0, ),{Search:v}=_chunk5O36WI7Hcjs.q.call(void 0, ),f=_chunk5O36WI7Hcjs.w.call(void 0, ),[l,L]=_react.useState.call(void 0, "list"),[k,N]=_react.useState.call(void 0, !1);_react.useEffect.call(void 0, ()=>{i!==!1&&p.applyFilters({})},[p,i]);let S=()=>{let I=Object.fromEntries(p.filters.list().map(F=>[F.key,void 0]));p.applyFilters(I)},g=_nullishCoalesce(f.total, () => (f.items.length));return _jsxruntime.jsxs.call(void 0, "div",{className:n?`rle-app ${n}`:"rle-app",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar",children:[e&&_jsxruntime.jsx.call(void 0, v,{value:e.value,onChange:e.onChange,placeholder:e.placeholder}),_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.v,{className:"rle-filters-row",groupClassName:"rle-filter-group"}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-filter-bar__end",children:[_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.A,{}),r]})]}),_jsxruntime.jsxs.call(void 0, "div",{className:"rle-body rle-split","data-mobile-view":l,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"rle-list",children:[_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.x,{className:"rle-list-grid"}),_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.z,{})]}),_jsxruntime.jsx.call(void 0, "div",{className:"rle-map",children:_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.y,{center:s,zoom:a,fallback:Be})})]}),_jsxruntime.jsx.call(void 0, le,{view:l,onViewChange:L,onFiltersClick:()=>N(!0),action:t}),_jsxruntime.jsx.call(void 0, pe,{title:"Filters",open:k,onOpenChange:N,footer:_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--ghost",onClick:S,children:"Clear all"}),_jsxruntime.jsxs.call(void 0, "button",{type:"button",className:"rle-btn rle-btn--primary",onClick:()=>N(!1),children:["Show ",g," results"]})]}),children:_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.v,{className:"rle-filter-stack",groupClassName:"rle-filter-group"})})]})}function ue(e){return"provider"in e}function Ke(e){let r=e!=null&&!ue(e),t=r?e.apiKey:void 0,i=r?e.mapId:void 0,[s,a]=_react.useState.call(void 0, ()=>!e||ue(e)?{ready:!0,provider:_optionalChain([e, 'optionalAccess', _5 => _5.provider])}:{ready:!1});return _react.useEffect.call(void 0, ()=>{if(!t)return;let n=!1;return Promise.resolve().then(() => _interopRequireWildcard(require("./maps/google/index.cjs"))).then(({googleProvider:p})=>{n||a({ready:!0,provider:p({apiKey:t,mapId:i})})}),()=>{n=!0}},[t,i]),s}function We({onFiltersChange:e}){let r=_react.useRef.call(void 0, e);return r.current=e,oe("FiltersChanged",t=>{t.type==="FiltersChanged"&&r.current(t.filters)}),null}function Zt(e){let{datasets:r,filters:t,map:i,components:s,initialFilters:a,onFiltersChange:n,mobileAction:p,search:v,toolbarEnd:f,config:l,autoFetch:L,className:k}=e,{ready:N,provider:S}=Ke(i);if(!N)return null;let g=[];for(let ge of r)g.push(_chunk5O36WI7Hcjs.k.call(void 0, ge));t&&g.push(_chunk5O36WI7Hcjs.l.call(void 0, t)),S&&g.push(_chunk5O36WI7Hcjs.j.call(void 0, S)),a&&g.push(_chunk5O36WI7Hcjs.n.call(void 0, a)),l&&g.push(_chunk5O36WI7Hcjs.i.call(void 0, l));let I=_chunk5O36WI7Hcjs.h.call(void 0, ...g),F={...ae,...s};return _jsxruntime.jsxs.call(void 0, _chunk5O36WI7Hcjs.B,{...I,children:[n&&_jsxruntime.jsx.call(void 0, We,{onFiltersChange:n}),_jsxruntime.jsx.call(void 0, _chunk5O36WI7Hcjs.p,{...F,children:_jsxruntime.jsx.call(void 0, me,{className:k,search:v,toolbarEnd:f,mobileAction:p,autoFetch:L,mapCenter:_optionalChain([i, 'optionalAccess', _6 => _6.center]),mapZoom:_optionalChain([i, 'optionalAccess', _7 => _7.zoom])})})]})}exports.a = oe; exports.b = E; exports.c = T; exports.d = _; exports.e = R; exports.f = B; exports.g = V; exports.h = D; exports.i = O; exports.j = K; exports.k = W; exports.l = ae; exports.m = le; exports.n = pe; exports.o = me; exports.p = Zt;