1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./8DpF8wzA.js","./entry.DO6mxuDE.css"])))=>i.map(i=>d[i]); 2import{s as e,u as a,a as t,c as s,o as l,a1 as n,b as o,f as r,P as c,R as i,g as m,h as d,j as g,Y as u,a4 as p,y as h,l as f,q as v,v as y,r as b,t as _,A as w,p as k,x,k as S,_ as j,m as M,i as C,a5 as P}from"./8DpF8wzA.js";import{_ as B}from"./B7eF4aZA.js";import{x as I}from"./Bbj44vVb.js";import{c as L}from"./Bp-mfJYC.js";import{u as V}from"./DcHP4MKI.js";import F from"./BkosW2yX.js";import O from"./CRSc9c9A.js";import T from"./Blq2kV-S.js";import"./puHORNpQ.js";import"./P4baaePn.js";import"./Bz_IglSm.js";const $={class:"row mx-0 bg-white align-items-center mb-4"},q={class:"col col-10 col-md-11 px-0"},A=["placeholder"],E={class:"col col-2 col-md-1 px-0 justify-content-center d-flex align-self-stretch bg-secondary"},R={key:0,class:"fe-loading m-0"},U={key:1,class:"mdi mdi-magnify fs-subtitle-1 fw-700"},H=r({__name:"PartSearchInput",props:c({placeholder:{},searching:{type:Boolean},onSearch:{type:Function},hideInputBorder:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=i(e,"modelValue");return(e,t)=>(d(),m("div",$,[g("div",q,[u(g("input",{"onUpdate:modelValue":t[0]||(t[0]=e=>a.value=e),class:f(["w-100 p-3 fs-content-1 fw-500",{"border-0":e.hideInputBorder}]),placeholder:e.placeholder,onKeyup:t[1]||(t[1]=h((...a)=>e.onSearch&&e.onSearch(...a),["enter"]))},null,42,A),[[p,a.value]])]),g("div",E,[g("button",{class:"border-0 d-flex align-items-center h-100 bg-secondary w-100 justify-content-center",onClick:t[2]||(t[2]=(...a)=>e.onSearch&&e.onSearch(...a))},[e.searching?(d(),m("span",R)):(d(),m("span",U))])])]))}}),N={key:0,class:"d-flex flex-wrap text-primary fs-content-1 fw-600"},D={class:"pr-3 py-2"},K=["onClick"],Q=r({__name:"PartSegmentList",props:{segments:{},segment:{},navbarLabel:{},onSegmentChange:{type:Function}},setup:e=>(e,a)=>e.segments.length>0?(d(),m("div",N,[g("div",D,y(e.navbarLabel),1),(d(!0),m(b,null,_(e.segments,(a,t)=>(d(),m("div",{key:t,class:f({"px-3":!0,"py-2":!0,"text-secondary":e.segment===a.segment,"bg-white":e.segment===a.segment,"cursor-pointer":e.segment!==a.segment}),onClick:t=>e.onSegmentChange(a.segment)},y(a.label),11,K))),128))])):v("",!0)}),Y={class:"bg-white w-100 fe-wrapper pt-4 pb-5"},z={class:"d-flex mt-4"},G={key:0,class:"fe-loading mx-auto"},J=r({__name:"PartSearchResults",props:{items:{},labelItems:{},loadingMore:{type:Boolean},hasMore:{type:Boolean},fetchMore:{type:Function}},setup:e=>(e,a)=>{const t=F,s=O,l=T;return d(),m("div",Y,[e.items.length>0?(d(!0),m(b,{key:0},_(e.items,(a,l)=>(d(),m(b,null,["page"===a.type?(d(),k(t,{key:l,data:a},null,8,["data"])):v("",!0),"profile"===a.type?(d(),k(s,{key:l,data:a,labels:e.labelItems},null,8,["data","labels"])):v("",!0)],64))),256)):w(e.$slots,"no-result",{key:1}),g("div",z,[e.loadingMore?(d(),m("div",G)):v("",!0),e.hasMore&&!e.loadingMore?(d(),k(l,{key:1,class:"fs-content-1 fw-600 mx-auto",title:"Load More",type:"secondary","icon-cls":"mdi-arrow-right-bold-circle",onClick:e.fetchMore},null,8,["onClick"])):v("",!0)])])}}),W=S(()=>j(()=>import("./8DpF8wzA.js").then(e=>e.aT),__vite__mapDeps([0,1]),import.meta.url).then(e=>e.default||e)),X=["id"],Z={key:0,class:"w-100"},ee={class:"fe-wrapper bg-light-gray pt-5 w-100"},ae={class:"row mx-0"},te={class:"col col-12 col-md-4 col-xl-3"},se={class:"col col-12 col-md-8 col-xl-9 pt-5"},le={class:"fs-title-2 font-title fw-700 text-black mb-3"},ne=["innerHTML"],oe={key:1,class:"fe-wrapper row align-items-center justify-content-center pt-3 pb-5"},re={class:"col col-12 col-md-6"},ce=r({__name:"Index",props:{data:{}},setup(r){const c=r,{keyword:i,segment:u,segments:p,items:h,loading_more:f,has_more:v,searching:b,body:_,onSearch:w,onSegmentChange:S,fetchMore:j}=function(r){const c=e(""),i=e(null),m=e([]),d=e([]),g=e(!1),u=e(!1),p=e(""),h=e(!1),f=a();t();const v=V(),y=s(()=>r.data.body),b=s(()=>v.data?.widget);function _(e){const a=b.value?.search?.action_path||"";return`${window.location.origin}/${a}${e?"?"+e:""}`}l(()=>{const{items:e,key:a,segment:t,navbar:s,pagination:l}=y.value;(e||[]).length>0&&(d.value=e),a&&(c.value=a),t&&(i.value=t),(s||[]).length>0&&(m.value=s),u.value=l?.has_more_pages||!1,p.value=l?.next_page_url||""});const w=n();return{keyword:c,segment:i,segments:m,items:d,loading_more:g,has_more:u,searching:h,body:y,onSearch:function({resetSegment:e=!1}){const a=["key","debug","segment"];
2if(!h.value&&(c.value||"").trim()){h.value=!0;const t={...f.query,key:I(c.value.trim())};Object.keys(t).forEach(s=>{a.includes(s)||delete t[s],e&&"segment"===s&&t.hasOwnProperty("segment")&&delete t[s]});const s=L(t);window.location.href=_(s)}},onSegmentChange:function(e){if(i.value!==e){h.value=!1;const a={...f.query,segment:I(e)};a.segment||delete a.segment;const t=L(a);window.location.href=_(t)}},fetchMore:async function(){if(u.value)try{w.start(),g.value=!0;const e=await $fetch("/api/load-more",{method:"POST",body:{url:p.value}}),a=e?.items,t=e?.pagination;p.value=t?.next_page_url??p.value,u.value=t?.has_more_pages??!1,a&&a.length>0&&(d.value=[...d.value,...a])}catch(e){throw o({stack:"error",message:"error loading fetch more"})}finally{w.finish(),g.value=!1}}}}(c);return(e,a)=>{const t=B,s=W;return d(),k(s,null,{default:x(()=>[g("section",{id:e.data.slug_id,class:"fe-section"},[M(_).key?(d(),m("div",Z,[g("div",ee,[C(H,{"model-value":M(i),"onUpdate:modelValue":a[0]||(a[0]=e=>P(i)?i.value=e:null),placeholder:M(_)?.label?.placeholder,searching:M(b),"hide-input-border":!0,onSearch:a[1]||(a[1]=()=>M(w)({resetSegment:!1}))},null,8,["model-value","placeholder","searching"]),C(Q,{segments:M(p),segment:M(u),"navbar-label":M(_)?.label?.navbar,onSegmentChange:M(S)},null,8,["segments","segment","navbar-label","onSegmentChange"])]),C(J,{items:M(h),"label-items":M(_).label_items,"loading-more":M(f),"has-more":M(v),"fetch-more":M(j)},{"no-result":x(()=>[g("div",ae,[g("div",te,[C(t,{draggable:"false",class:"w-100",alt:"image search not found",src:"/images/search-not-found.gif",style:{height:"20rem",objectFit:"contain",objectPosition:"center"}})]),g("div",se,[g("div",le,y(M(_)?.no_result?.title),1),g("div",{class:"fs-content-1 text-gray",innerHTML:M(_)?.no_result?.description},null,8,ne)])])]),_:1},8,["items","label-items","loading-more","has-more","fetch-more"])])):(d(),m("div",oe,[g("div",re,[C(t,{draggable:"false",class:"w-100",alt:"search-image",src:"/images/search-image.gif",style:{height:"22rem",objectFit:"cover",objectPosition:"center"}}),C(H,{"model-value":M(i),"onUpdate:modelValue":a[2]||(a[2]=e=>P(i)?i.value=e:null),placeholder:M(_)?.label?.placeholder,searching:M(b),onSearch:a[3]||(a[3]=()=>M(w)({resetSegment:!0}))},null,8,["model-value","placeholder","searching"])])]))],8,X)]),_:1})}}}),ie=Object.assign(ce,{__name:"AppCustomPagesSearch"});export{ie as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.