PageSourceSearch

https://manob.ai/assets/ServiceCardSkeleton-Cfpp-dPq.js

js manob.ai collected 2026-10-05 13:51:12 UTC 11,532 bytes, 15 lines download raw bytes

1import{r as u,j as e}from"./jsx-runtime-CjU7sb_n.js";import{u as v}from"./useUrlFilters-CfKwZGZL.js";import{C as f}from"./chevron-down-PMJ_lf5s.js";import{X as M}from"./x-CNfLdl-B.js";import{S as F}from"./search-BlBSdm93.js";import{C as $}from"./chevron-right-DM0HG_Wv.js";import{L as A}from"./components-D9qBRUEw.js";import"./Select-BgIz2sqs.js";import{S as h}from"./DropdownMenu-DQjPEH3D.js";function S({category:m,options:p,showSearch:t}){const[l,i]=u.useState(""),[o,d]=u.useState(!1),a=u.useMemo(()=>p?p.filter(c=>c.name?.toLowerCase().includes(l.toLowerCase())):[],[p,l]),s=o?a:a.slice(0,8);return e.jsxs(e.Fragment,{children:[t&&e.jsxs("div",{className:"relative mb-3",children:[e.jsx("input",{type:"text",placeholder:"What are you looking for?",value:l,onChange:c=>i(c.target.value),maxLength:30,className:"w-full border border-manob-mist rounded-lg px-3 py-2 text-sm focus:outline-none focus:border-manob-teal"}),e.jsx(F,{size:14,className:"absolute right-3 top-1/2 -translate-y-1/2 text-manob-ash"})]}),e.jsx("div",{className:"flex flex-col gap-2",children:s.map(c=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{size:14,className:"text-manob-ash"}),e.jsx(A,{to:`/category/${m}/${c.id}/${c.slug||""}`,className:"text-sm text-manob-ink hover:text-manob-teal transition-colors",children:c.name}),e.jsxs("span",{className:"text-xs text-manob-ash ml-auto",children:["(",c.item_count||c.doc_count||0,")"]})]},c.id))}),a.length>8&&e.jsx("button",{type:"button",onClick:()=>d(!o),className:"text-manob-teal text-sm mt-3 hover:underline",children:o?"Show less":`+${a.length-8} more`})]})}function C({options:m,onPriceChange:p,currentMin:t,currentMax:l}){return e.jsx("div",{className:"flex flex-col gap-2",children:m.map(i=>{const o=t===i.min&&l===i.max;return e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[e.jsx("input",{type:"checkbox",checked:o,onChange:()=>p(o?0:i.min,o?0:i.max),className:"w-4 h-4 accent-manob-teal cursor-pointer"}),e.jsx("span",{className:"text-sm text-manob-ink group-hover:text-manob-teal transition-colors flex-1",children:i.name}),e.jsxs("span",{className:"text-xs text-manob-ash",children:["(",i.doc_count,")"]})]},i.id)})})}function k({options:m,onAttributeChange:p,selectedAttributes:t}){const[l,i]=u.useState({});return e.jsx("div",{className:"space-y-4",children:m.map((o,d)=>{const a=l[d]?o.filters:o.filters?.slice(0,5);return e.jsxs("div",{children:[e.jsxs("h6",{className:"text-sm font-semibold text-manob-ink mb-2",children:["- ",o.type_name]}),e.jsx("div",{className:"space-y-2",children:a?.map(s=>e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer group",children:[e.jsx("input",{type:"checkbox",checked:t.includes(s.key),onChange:()=>p(s.key),className:"w-4 h-4 accent-manob-teal cursor-pointer"}),e.jsx("span",{className:"text-sm text-manob-ink group-hover:text-manob-teal transition-colors flex-1",children:s.key}),s.doc_count!==void 0&&e.jsxs("span",{className:"text-xs text-manob-ash",children:["(",s.doc_count,")"]})]},s.key))}),o.filters?.length>5&&e.jsx("button",{type:"button",onClick:()=>i(s=>({...s,[d]:!s[d]})),className:"text-manob-teal text-sm mt-2 hover:underline",children:l[d]?"Show less":`+${o.filters.length-5} more`})]},d)})})}function U({filters:m,onClearAll:p}){const[t,l]=u.useState(null),{setRangFilter:i,setFilter:o,getFilters:d}=v(),a=d(),[s,c]=u.useState([]),y=(n,x)=>{if(n===0&&x===0){const N=new URLSearchParams(window.location.search);N.delete("priceMin"),N.delete("priceMax"),window.history.replaceState({},"",`?${N.toString()}`),window.location.reload()}else i(x.toString(),n.toString());l(null)},_=n=>{const x=s.includes(n)?s.filter(N=>N!==n):[...s,n];c(x),o("attributes",x)},w=n=>{l(t===n?null:n)},g=()=>a.priceMin||a.priceMax?`$${a.priceMin||0} - $${a.priceMax||"∞"}`:"Budget",b=m.find(n=>n.type==="CategoryFilter"),j=m.find(n=>n.type==="pricing"),r=m.find(n=>n.type==="attributes");return e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[b&&b.options?.length>0&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>w("category"),className:`inline-flex items-center gap-2 px-4 py-2.5 bg-white rounded-xl text-sm font-medium transition-colors shadow-[0_4px_8px_0_rgba(41,41,41,0.06),0_2px_4px_0_rgba(41,41,41,0.04),0_1px_2px_0_rgba(41,41,41,0.04),0_0_0_1px_rgba(41,41,41,0.08),inset_0_-0.5px_0.5px_0_rgba(41,41,41,0.08)] ${t==="category"?"border-manob-teal text-manob-teal":"border-gray-200 text-manob-ink hover:border-manob-teal"}`,children:["Category",e.jsx(f,{size:16,className:`transition-transform ${t==="category"?"rotate-180":""}`})]}),t==="category"&&e.jsx("div",{className:"absolute top-full left-0 mt-2 w-64 bg-white border border-gray-200 rounded-xl shadow-lg z-50 p-4 max-h-80 overflow-y-auto animate-dropdown-in origin-top",children:e.jsx(S,{category:b.category,options:b.options||[],showSearch:b.showSearch})})]}),j&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>w("budget"),className:`inline-flex items-center gap-2 px-4 py-2.5 bg-white rounded-xl text-sm font-medium transition-colors shadow-[0_4px_8px_0_rgba(41,41,41,0.06),0_2px_4px_0_rgba(41,41,41,0.04),0_1px_2px_0_rgba(41,41,41,0.04),0_0_0_1px_rgba(41,41,41,0.08),inset_0_-0.5px_0.5px_0_rgba(41,41,41,0.08)] ${a.priceMin||a.priceMax?"border-manob-teal bg-manob-teal-tint text-manob-teal":t==="budget"?"border-manob-teal text-manob-teal":"border-gray-200 text-manob-ink hover:border-manob-teal"}`,children:[g(),e.jsx(f,{size:16,className:`transition-transform ${t==="budget"?"rotate-180":""}`})]}),t==="budget"&&e.jsx("div",{className:"absolute top-full left-0 mt-2 w-56 bg-white border border-gray-200 rounded-xl shadow-lg z-50 p-4 animate-dropdown-in origin-top",children:e.jsx(C,{options:j.options||[],onPriceChange:y,currentMin:a.priceMin?Number(a.priceMin):void 0,currentMax:a.priceMax?Number(a.priceMax):void 0})})]}),r&&r.options?.length>0&&e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>w("attributes"),className:`inline-flex items-center gap-2 px-4 py-2.5 bg-white rounded-xl text-sm font-medium transition-colors shadow-[0_4px_8px_0_rgba(41,41,41,0.06),0_2px_4px_0_rgba(41,41,41,0.04),0_1px_2px_0_rgba(41,41,41,0.04),0_0_0_1px_rgba(41,41,41,0.08),inset_0_-0.5px_0.5px_0_rgba(41,41,41,0.08)] ${s.length>0?"border-manob-teal bg-manob-teal-tint text-manob-teal":t==="attributes"?"border-manob-teal text-manob-teal":"border-gray-200 text-manob-ink hover:border-manob-teal"}`,children:["More filters",s.length>0&&e.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 text-xs bg-manob-teal text-white rounded-full",children:s.length}),e.jsx(f,{size:16,className:`transition-transform ${t==="attributes"?"rotate-180":""}`})]}),t==="attributes"&&e.jsx("div",{className:"absolute top-full left-0 mt-2 w-72 bg-white border border-gray-200 rounded-xl shadow-lg z-50 p-4 max-h-80 overflow-y-auto animate-dropdown-in origin-top",children:e.jsx(k,{options:r.options,onAttributeChange:_,selectedAttributes:s})})]}),(a.priceMin||a.priceMax||s.length>0)&&e.jsxs("button",{type:"button",onClick:p,className:"inline-flex items-center gap-1.5 px-4 py-2.5 text-sm font-medium text-manob-danger hover:text-manob-danger/80 transition-colors",children:[e.jsx(M,{size:16}),"Clear all"]}),t&&e.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>l(null)}),e.jsx("style",{children:`
2        @keyframes dropdown-in {
3          from {
4            opacity: 0;
5            transform: scaleY(0.95) translateY(-4px);
6          }
7          to {
8            opacity: 1;
9            transform: scaleY(1) translateY(0);
10          }
11        }
12        .animate-dropdown-in {
13          animation: dropdown-in 0.15s ease-out;
14        }
15      `})]})}function B({filters:m,onClose:p}){const[t,l]=u.useState({category:!0,pricing:!0,delivery:!0,attributes:!1}),{setRangFilter:i,setFilter:o,getFilters:d}=v(),a=d(),[s,c]=u.useState([]),y=r=>{l(n=>({...n,[r]:!n[r]}))},_=(r,n)=>{if(r===0&&n===0){const x=new URLSearchParams(window.location.search);x.delete("priceMin"),x.delete("priceMax"),window.history.replaceState({},"",`?${x.toString()}`),window.location.reload()}else i(n.toString(),r.toString())},w=r=>{const n=s.includes(r)?s.filter(x=>x!==r):[...s,r];c(n),o("attributes",n)},g=m.find(r=>r.type==="CategoryFilter"),b=m.find(r=>r.type==="pricing"),j=m.find(r=>r.type==="attributes");return e.jsxs("div",{className:"space-y-4",children:[g&&g.options?.length>0&&e.jsxs("div",{className:"border-b border-gray-100 pb-4",children:[e.jsxs("button",{type:"button",onClick:()=>y("category"),className:"w-full flex items-center justify-between py-2 text-left",children:[e.jsx("span",{className:"font-semibold text-manob-ink",children:"Category"}),e.jsx(f,{size:18,className:`text-manob-ash transition-transform ${t.category?"rotate-180":""}`})]}),t.category&&e.jsx("div",{className:"mt-3",children:e.jsx(S,{category:g.category,options:g.options||[],showSearch:g.showSearch})})]}),b&&e.jsxs("div",{className:"border-b border-gray-100 pb-4",children:[e.jsxs("button",{type:"button",onClick:()=>y("pricing"),className:"w-full flex items-center justify-between py-2 text-left",children:[e.jsx("span",{className:"font-semibold text-manob-ink",children:"Budget"}),e.jsx(f,{size:18,className:`text-manob-ash transition-transform ${t.pricing?"rotate-180":""}`})]}),t.pricing&&e.jsx("div",{className:"mt-3",children:e.jsx(C,{options:b.options||[],onPriceChange:_,currentMin:a.priceMin?Number(a.priceMin):void 0,currentMax:a.priceMax?Number(a.priceMax):void 0})})]}),e.jsxs("div",{className:"border-b border-gray-100 pb-4",children:[e.jsxs("button",{type:"button",onClick:()=>y("delivery"),className:"w-full flex items-center justify-between py-2 text-left",children:[e.jsx("span",{className:"font-semibold text-manob-ink",children:"Delivery Time"}),e.jsx(f,{size:18,className:`text-manob-ash transition-transform ${t.delivery?"rotate-180":""}`})]}),t.delivery&&e.jsx("div",{className:"mt-3 space-y-2",children:["24 Hours","3 Days","7 Days","14 Days","Any"].map(r=>e.jsxs("label",{className:"flex items-center gap-3 cursor-pointer py-1",children:[e.jsx("input",{type:"checkbox",className:"w-5 h-5 accent-manob-teal cursor-pointer rounded"}),e.jsx("span",{className:"text-sm text-manob-ink",children:r})]},r))})]}),j&&j.options?.length>0&&e.jsxs("div",{className:"pb-4",children:[e.jsxs("button",{type:"button",onClick:()=>y("attributes"),className:"w-full flex items-center justify-between py-2 text-left",children:[e.jsx("span",{className:"font-semibold text-manob-ink",children:"More Filters"}),e.jsx(f,{size:18,className:`text-manob-ash transition-transform ${t.attributes?"rotate-180":""}`})]}),t.attributes&&e.jsx("div",{className:"mt-3",children:e.jsx(k,{options:j.options,onAttributeChange:w,selectedAttributes:s})})]})]})}function H(){return e.jsxs("div",{className:"bg-white rounded-xl shadow-sm overflow-hidden border border-gray-100",children:[e.jsx(h,{className:"w-full h-48"}),e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{className:"w-8 h-8 rounded-full"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx(h,{className:"h-4 w-24"}),e.jsx(h,{className:"h-3 w-16"})]})]}),e.jsx(h,{className:"h-4 w-full"}),e.jsx(h,{className:"h-4 w-3/4"}),e.jsxs("div",{className:"flex justify-between pt-3",children:[e.jsx(h,{className:"h-4 w-16"}),e.jsx(h,{className:"h-6 w-12"})]})]})]})}export{B as M,H as S,U as T};

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.