PageSourceSearch

https://worldviewstream.com/wp-content/themes/worldviewstream/temp…/dist/chunks/HeaderMenu-DVWWSMPU.js

js worldviewstream.com collected 2026-09-25 14:08:47 UTC 3,930 bytes, 1 lines download raw bytes

1import{r,x as A,o as D,y as O,w as k,c as N,j as S,e as o,l as b,b as n,g as f,h as s,f as a,z,A as P,B as U,F as M,s as w,k as C,C as B,D as q,n as G,T as W}from"../app-0.5.6.js";import{w as p,c as j,t as x}from"./global-nglKSoR3.js";import{a as H}from"./index-CMW59wn3.js";const J={key:0,class:"header-mobile-menu"},K={class:"header-menu-container"},Q={class:"menu-header"},R={class:"logo"},X=["src"],Y={class:"close-menu"},Z={class:"search-form"},I=["action"],ee=["placeholder","aria-label"],te={class:"cat-tree"},ae={key:0,class:"menu-breadcrumbs"},le=["onClick"],se=["innerHTML"],oe={key:1,class:"category-list"},ne=["onClick"],ie=["src","alt"],ce=["innerHTML"],re={key:2,class:"category-list fallback-posts"},ue=["href"],de=["innerHTML"],fe={__name:"HeaderMenu",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(E){let i=r(!1),m=r(null),v=r({}),g=r({}),c=r([]),L=r(null),h=r([]);const u=A(E,"modelValue");D(async()=>{await O(),m.value=document.getElementById("wvs-overlay-block");const e=document.querySelectorAll(".menu-toggle");e&&e.length>0&&e.forEach(l=>{l.addEventListener("click",()=>{i.value=!i.value})}),m.value.addEventListener("click",()=>{i.value=!1}),await $(),g.value=v.value}),k(()=>i.value,e=>{e?(document.body.classList.add("body-overlay"),m.value.classList.add("active")):(document.body.classList.remove("body-overlay"),m.value.classList.remove("active"))}),k(()=>c.value,e=>{e&&e.length?g.value=e[e.length-1].parent:g.value=v.value,u.value=""},{deep:!0}),k(()=>u.value,e=>{h.value=[],e&&!y.value.length&&(clearTimeout(L.value),L.value=setTimeout(async()=>{try{h.value=await H.searchPosts({search_value:e,locale:p.value.locale})}catch{h.value=[]}},500))});const y=N(()=>{const e=g.value;if(!u.value)return e;const t=[],d=T=>{Object.values(T).forEach(_=>{_.title.toLowerCase().includes(u.value.toLowerCase())&&t.push(_),_.parent&&Object.values(_.parent).length&&d(_.parent)})};return d(e),t});async function $(e){v.value=await H.getFullMenu({cat_id:e,locale:p.value.locale}),j.countries=v.value.find(l=>l.id===1)?.parent,j.categories=v.value.find(l=>l.id===2)?.parent}function F(e){e.parent&&e.parent.length?c.value.push(e):window.location.href=e.url}function V(e){c.value=c.value.slice(0,e)}return(e,l)=>(o(),S(W,{name:"slide-left-fade"},{default:b(()=>[s(i)?(o(),n("section",J,[a("div",K,[a("div",Q,[a("div",R,[a("img",{src:s(p).templateDirectoryUri+"/images/logo.svg",alt:"Worldviewstream",width:"35",height:"35"},null,8,X)]),a("div",Y,[a("div",{class:"wvs-btn",onClick:l[0]||(l[0]=t=>z(i)?i.value=!s(i):i=!s(i))},"✖")]),a("div",Z,[a("form",{action:s(p).locale==="en"?"/":"/"+s(p).locale+"/",method:"get"},[P(a("input",{type:"text",placeholder:s(x).search,"aria-label":s(x).search,name:"s",id:"search",value:"","onUpdate:modelValue":l[1]||(l[1]=t=>u.value=t)},null,8,ee),[[U,u.value]]),l[2]||(l[2]=a("button",{class:"search-icon icon"},"🔍",-1))],8,I)])]),a("div",te,[l[3]||(l[3]=a("div",{class:"title"},null,-1)),s(c)&&s(c).length?(o(),n("div",ae,[(o(!0),n(M,null,w(s(c),(t,d)=>(o(),n("a",{key:`selected-item-${d}`,href:"javascript:",onClick:T=>V(d),class:"back-to-menu"},[a("span",{innerHTML:t.title},null,8,se)],8,le))),128))])):f("",!0),y.value&&Object.keys(y.value).length?(o(),n("div",oe,[C(B,{name:"list",tag:"ul"},{default:b(()=>[(o(!0),n(M,null,w(y.value,t=>(o(),n("li",{key:`menu-id-${t.id}`},[a("a",{href:"javascript:",class:G([{"has-children":t.parent&&Object.keys(t.parent).length}]),onClick:q(d=>F(t),["prevent","stop"])},[t.image?(o(),n("img",{key:0,src:t.image,alt:t.title},null,8,ie)):f("",!0),a("span",{innerHTML:t.title},null,8,ce)],10,ne)]))),128))]),_:1})])):f("",!0),s(h).length?(o(),n("div",re,[C(B,{name:"list",tag:"ul"},{default:b(()=>[(o(!0),n(M,null,w(s(h),t=>(o(),n("li",{key:`post-id-${t.post_id}`},[a("a",{href:t.link},[a("span",{innerHTML:t.title},null,8,de)],8,ue)]))),128))]),_:1})])):f("",!0)])])])):f("",!0)]),_:1}))}};export{fe 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.