1import{_ as C}from"./BbHnALaO.js";import{_ as I}from"./OTB3yi_y.js";import{q as L,K as U,L as j,x as A,v as B,h as g,y as v,u as R,c as l,a as h,l as r,k as H,F as V,G as D,b as E,N as F,o,j as M}from"./By76FmM_.js";import{u as O}from"./BUo2t9N4.js";import{u as z}from"./CpUzIpVH.js";import{u as G}from"./Dwj1deVD.js";const J={class:"mt-25 lg:mt-37.5 left-0 right-0 mx-auto px-4 flex flex-col lg:w-220 gap-5 lg:gap-10 justify-center items-start self-stretch"},K={class:"w-full overflow-hidden"},Q={key:0,class:"mt-6"},T={key:1},W={class:"grid grid-cols-1 gap-4 mt-6"},X={key:0,class:"mt-10 text-center w-full flex justify-center"},P=20,re=L({__name:"index",async setup(Y){let c,w;const i=U(),b=j(),{siteUrl:f,siteName:u,siteDescription:d}=O(),{fetchPagesList:k}=z(),p=t=>{const e=Array.isArray(t)?t[0]:t,s=Number(e);return Number.isInteger(s)&&s>0?s:1},a=A(p(i.query.page)),{data:x,pending:$}=([c,w]=B(()=>G(()=>`pages:list:${a.value}:${P}`,()=>k({page:a.value,per_page:P}),{watch:[a]})),c=await c,w(),c),N=g(()=>x.value?.items??[]),m=g(()=>x.value?.meta??null),q=g(()=>(m.value?.last_page??1)>1);v(()=>i.query.page,t=>{const e=p(t);e!==a.value&&(a.value=e)}),v(a,async t=>{const e=p(t);if(e!==t){a.value=e;return}const s=p(i.query.page),y=i.query.page!==void 0;s===e&&(e>1||!y)||await b.replace({query:{...i.query,page:e===1?void 0:String(e)}})}),v(m,t=>{if(!t)return;const e=Math.max(1,t.last_page);a.value>e&&(a.value=e)},{immediate:!0});const S=(t,e=140)=>{const s=(t??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();return s?s.length>e?s.slice(0,e)+"...":s:""},_=g(()=>{const t=new URL(f);return t.pathname="/pusat-informasi",a.value>1&&t.searchParams.set("page",String(a.value)),t.toString()});return R(()=>({title:`Informasi${a.value>1?` (Halaman ${a.value})`:""}`,meta:[{name:"description",content:d},{property:"og:title",content:`Informasi - ${u}`},{property:"og:description",content:d},{property:"og:url",content:_.value},{property:"og:image",content:`${f}/og-image.jpg`},{property:"og:type",content:"website"},{name:"twitter:card",content:"summary_large_image"},{name:"twitter:title",content:`Informasi - ${u}`},{name:"twitter:description",content:d},...a.value>1?[{name:"robots",content:"noindex,follow"}]:[]],link:[{rel:"canonical",href:_.value}],script:[{type:"application/ld+json",innerHTML:JSON.stringify({"@context":"https://schema.org","@type":"CollectionPage",name:`Informasi - ${u}`,url:_.value,isPartOf:{"@type":"WebSite",name:u,url:f}})}]})),(t,e)=>{const s=C,y=I;return o(),l("div",J,[h("div",K,[e[1]||(e[1]=h("div",{class:"mt-3 title"},"Pusat Informasi",-1)),r($)?(o(),l("div",Q,"Loading...")):(o(),l("div",T,[h("div",W,[(o(!0),l(V,null,D(r(N),n=>(o(),M(s,{key:n.id,title:n.title,subtitle:S(n.content),to:"/pusat-informasi/"+n.slug,class:"border-b border-soft"},null,8,["title","subtitle","to"]))),128))]),r(q)?(o(),l("div",X,[E(y,{page:r(a),"onUpdate:page":e[0]||(e[0]=n=>F(a)?a.value=n:null),total:r(m)?.total??0,"items-per-page":r(m)?.per_page??20,variant:"link"},null,8,["page","total","items-per-page"])])):H("",!0)]))])])}}});export{re 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.