PageSourceSearch

https://sats.ac.za/_nuxt/Cu_G5Ulr.js

js sats.ac.za collected 2026-10-02 11:12:35 UTC 2,538 bytes, 2 lines download raw bytes

1import{h as g,q as m}from"./1QO8lmmS.js";import{u as b}from"./DbmC6K1S.js";import{ae as C,af as S,ah as N,aj as _,N as k,ab as A,aa as O}from"./DyD9PeWo.js";import"./CSVF6NRY.js";const Q=C({name:"ContentQuery",props:{path:{type:String,required:!1,default:void 0},only:{type:Array,required:!1,default:void 0},without:{type:Array,required:!1,default:void 0},where:{type:Object,required:!1,default:void 0},sort:{type:Object,required:!1,default:void 0},limit:{type:Number,required:!1,default:void 0},skip:{type:Number,required:!1,default:void 0},locale:{type:String,required:!1,default:void 0},find:{type:String,required:!1,default:void 0}},async setup(i){const{path:t,only:r,without:o,where:u,sort:f,limit:l,skip:d,locale:s,find:h}=_(i),y=k(()=>{var e;return(e=t.value)==null?void 0:e.includes("/_")}),p=!A().public.content.experimental.advanceQuery;O(()=>i,()=>n(),{deep:!0});const a=e=>p?e!=null&&e.surround?e.surround:e!=null&&e._id||Array.isArray(e)?e:e==null?void 0:e.result:e.result,{data:v,refresh:n}=await b(`content-query-${g(i)}`,()=>{let e;return t.value?e=m(t.value):e=m(),r.value&&(e=e.only(r.value)),o.value&&(e=e.without(o.value)),u.value&&(e=e.where(u.value)),f.value&&(e=e.sort(f.value)),l.value&&(e=e.limit(l.value)),d.value&&(e=e.skip(d.value)),s.value&&(e=e.where({_locale:s.value})),h.value==="one"?e.findOne().then(a):h.value==="surround"?t.value?p?e.findSurround(t.value):e.withSurround(t.value).findOne().then(a):(console.warn("[Content] Surround queries requires `path` prop to be set."),console.warn("[Content] Query without `path` will return regular `find()` results."),e.find().then(a)):e.find().then(a)});return{isPartial:y,data:v,refresh:n}},render(i){var c;const t=S(),{data:r,refresh:o,isPartial:u,path:f,only:l,without:d,where:s,sort:h,limit:y,skip:p,locale:a,find:v}=i,n={path:f,only:l,without:d,where:s,sort:h,limit:y,skip:p,locale:a,find:v};if(n.find==="one"){if(!r&&(t!=null&&t["not-found"]))return t["not-found"]({props:n,...this.$attrs});if(t!=null&&t.empty&&(r==null?void 0:r._type)==="markdown"&&!((c=r==null?void 0:r.body)!=null&&c.children.length))return t.empty({props:n,...this.$attrs})}else if((!r||!r.length)&&t!=null&&t["not-found"])return t["not-found"]({props:n,...this.$attrs});return t!=null&&t.default?t.default({data:r,refresh:o,isPartial:u,props:n,...this.$attrs}):((w,q)=>N("pre",null,JSON.stringify({message:"You should use slots with <ContentQuery>!",slot:w,data:q},null,2)))("default",{data:r,props:n,isPartial:u})}}),P=Q;export{P as default};
2//# sourceMappingURL=Cu_G5Ulr.js.map

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.