PageSourceSearch

https://answers.sg/build/assets/Category-73GBhA-P.js

js answers.sg collected 2026-10-07 23:57:10 UTC 2,725 bytes, 1 lines download raw bytes

1import{z as A,r as n,c as C,d as o,l as y,w as I,O as N,f as h,g as d,H as V,j as s,x as L,e as v,P as w,F as b,n as f}from"./app-4h8KysWF.js";import{s as j}from"./paginator.esm-nktAhL-o.js";import{_ as B}from"./PollCard-IVUMhFQw.js";import{A as $}from"./AxiosService-xrT-wMRI.js";import{a as U}from"./HelperServices-Tzqfgswf.js";import{s as F}from"./dropdown.esm-jmt6jYhv.js";import{s as H}from"./skeleton.esm-PXa613in.js";/* empty css            */import"./inputnumber.esm-UFt6-rBO.js";import"./overlayeventbus.esm-2wSqM255.js";import"./virtualscroller.esm-bmgfc2Vw.js";const R={class:"space-y-5"},q={class:"home-section space-y-4"},z={class:"flex"},D={class:"flex-grow"},E={class:"ans-heading text-lg font-bold line-clamp-1x"},M={class:"flex-shrink-0"},G={class:"grid grid-cols-2 lg:grid-cols-4 gap-4"},J={key:2},K={name:"CategoryPage"},le=Object.assign(K,{props:{header:String,category:{type:Object},polls:Array,pagination:Object,pageIndex:Number,limit:Number,sortOption:String},setup(c){const S=new $;A();const p=n(0),e=c;C(()=>{e.pageIndex>1&&(p.value=(e.pageIndex-1)*e.limit)});const g=n(1),_=n(e.polls),u=n(e.pagination),k=async a=>{g.value=a.page+1,p.value=a.first,await x()},P=()=>{const a=new URLSearchParams;a.append("page",g.value),a.append("sort",m.value);let r=e.category?route("public.polls.category",{alias:e.category.alias}):route("public.polls.all");r+="?"+a.toString(),window.history.pushState({},"",r)},x=async(a={})=>{l.value=!0;const i={...{page:g.value,categoryId:e.category?e.category.id:0,limit:e.limit,sort:m.value},...a},t=await S.get(route("api.polls.index",i));return t!=null&&t.polls&&(_.value=t.polls,u.value=t.pagination,P()),l.value=!1,t},m=n(e.sortOption),l=n(!1),O=async()=>{g.value=1,p.value=0,await x()};return(a,r)=>(o(),y(N,null,{default:I(()=>[h(d(V),{title:c.category?c.category.name:"All Categories"},null,8,["title"]),s("div",R,[s("section",q,[s("div",z,[s("div",D,[s("div",E,L(c.header),1)]),s("div",M,[h(d(F),{modelValue:m.value,"onUpdate:modelValue":r[0]||(r[0]=i=>m.value=i),options:d(U)(),"option-label":"label","option-value":"value",class:"rounded-lg w-full",disabled:l.value,onChange:O},null,8,["modelValue","options","disabled"])])]),s("div",G,[l.value?f("",!0):(o(!0),v(b,{key:0},w(_.value,(i,t)=>(o(),v("div",{key:t},[h(B,{poll:i}
1,null,8,["poll"])]))),128)),l.value?(o(!0),v(b,{key:1},w(new Array(c.limit),(i,t)=>(o(),y(d(H),{key:t,width:"100%",height:"150px"}))),128)):f("",!0),!l.value&&!u.value.total?(o(),v("div",J," No polls found under this category. ")):f("",!0)]),u.value.total?(o(),y(d(j),{key:0,rows:u.value.perPage,"total-records":u.value.total,first:p.value,onPage:k},null,8,["rows","total-records","first"])):f("",!0)])])]),_:1}))}});export{le 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.