import{r,w as T,u as B,c as o,a as e,t as c,k as p,v as b,e as i,i as f,F as I,f as V,b as w,l as g,g as C,h as A,o as u,n as F,j as R}from"./entry.0b5aa3d9.js";import{_ as y}from"./search.b7b33edb.js";const j={class:"animate-fade w-full"},D={class:"bg-white uhjk py-6 mt-6 w-[90%] mx-auto rounded-xl my-12",style:{border:"1.4px solid #EFEFEF"}},M={class:"sm:flex items-center justify-between w-full pb-4",style:{"border-bottom":"1px solid #EFEFEF"}},N={class:"font-bold"},S={class:"sm:flex items-center w-full mt-8 px-4 mx-auto"},z={class:"w-full mt-8 grid grid-cols-1 sm:grid-cols-2 gap-6"},H={style:{border:"1px solid #EFEFEF"},class:"sm:flex items-center rounded-xl p-4"},q={class:"pl-2 ui"},G=["onClick"],J={class:"mt-1 text-[#7F7F7F]"},K=["onClick"],O={class:"mt-5 flex items-center justify-between"},Q={class:"flex items-center"},W={class:"flex-0 mr-2"},X={class:"flex-1"},Y={class:"text-base font-medium"},se={__name:"index",async setup(Z){let d,_;const n=r(null),m=r(null),a=r(1),v=r(0),{data:$,total:E}=([d,_]=T(()=>$fetch(g().public.API_PUBLIC_URL+"/api/pengumuman?limit=6&page=1")),d=await d,_(),d);m.value=$,v.value=Math.ceil(E/6);async function k(){let t;if(n.value?t=await $fetch(g().public.API_PUBLIC_URL+`/api/pengumuman?limit=6&page=${a.value}&search=${n.value}`):t=await $fetch(g().public.API_PUBLIC_URL+`/api/pengumuman?limit=6&page=${a.value}`),m.value=t.data,navigator.userAgent.includes("Chrome")){window.scrollTo({behavior:"smooth",top:0,left:0});return}windowScrollTo(window,{behavior:"smooth",top:0,left:0})}async function x(){a.value=1;const{data:t,total:s}=await $fetch(g().public.API_PUBLIC_URL+`/api/pengumuman?limit=6&page=${a.value}&search=${n.value}`);m.value=t,v.value=Math.ceil(s/6)}return B({title:"Pengumuman"}),(t,s)=>{const P=C("v-img"),U=C("v-pagination"),h=A("ripple");return u(),o("div",j,[e("div",D,[e("div",M,[e("h1",N,c(t.$t("pengumuman")),1)]),e("div",S,[p(e("input",{"onUpdate:modelValue":s[0]||(s[0]=l=>f(n)?n.value=l:null),class:"bg-[#F8F8F8] flex-1 sm:flex hidden rounded-xl px-4 h-[50px]",placeholder:"Cari Pengumuman"},null,512),[[b,i(n)]]),p(e("input",{"onUpdate:modelValue":s[1]||(s[1]=l=>f(n)?n.value=l:null),class:"flex sm:hidden bg-[#F8F8F8] w-full rounded-xl px-4 h-[50px]",placeholder:"Cari {{ $t('pengumuman') }}"},null,512),[[b,i(n)]]),p((u(),o("button",{onClick:x,class:"text-base sm:text-lg hidden sm:flex items-center flex-none bg-[#B91C1C] text-white ml-2 rounded-xl font-semibold text-center px-8 py-3"},s[3]||(s[3]=[e("div",{class:"mr-1"},"Cari",-1),e("img",{src:y},null,-1)]))),[[h]]),p((u(),o("button",{onClick:x,class:"text-base sm:text-lg flex sm:hidden items-center w-full justify-center mt-3 flex-none bg-[#2E8586] text-white rounded-xl font-semibold text-center px-8 py-3"},s[4]||(s[4]=[e("div",{class:"mr-1"},"Cari",-1),e("img",{src:y},null,-1)]))),[[h]])]),e("div",z,[(u(!0),o(I,null,V(i(m),l=>(u(),o("div",H,[e("div",q,[e("div",{onClick:L=>("navigateTo"in t?t.navigateTo:i(F))("/pengumuman/"+l.slug),class:"cursor-pointer mb-1 text-2xl font-semibold"},[e("span",null,c(l.title),1)],8,G),e("div",J,[e("span",null,[R(c(l.description),1),e("span",{class:"ml-1 text-[#2E8586] font-medium cursor-pointer",onClick:L=>("navigateTo"in t?t.navigateTo:i(F))("/pengumuman/"+l.slug)},"Selengkapnya",8,K)])]),e("div",O,[e("div",Q,[e("div",W,[w(P,{src:"/avatar.png",width:"30"})]),e("div",X,[e("div",Y,[e("span",null,c(l.created_by),1)])])])])])]))),256))]),w(U,{size:(t.$vuetify.display.mobile,"small"),class:"mt-10 mb-6",modelValue:i(a),"onUpdate:modelValue":[s[2]||(s[2]=l=>f(a)?a.value=l:null),k],"total-visible":5,length:i(v)},null,8,["size","modelValue","length"])])])}}};export{se as default};
