1import{b1 as L,p as N,o as E,aH as I,aO as O}from"./DdjJ_Nrq.js";import{_ as U}from"./BYePjdKQ.js";import{_ as z}from"./DqXbUa79.js";import{_ as M}from"./COA5z87w.js";import{_ as Q}from"./Bef2eoY2.js";import{d as R,v as T,c as m,aw as j,aP as q,aq as H,E as g,D as p,F as i,P as s,h as e,V as c,M as W,N as Y,C as Z,Z as G,Y as J}from"./BasuKg0Z.js";import"./_L0Hp-FU.js";import"./C3S843hV.js";import"./yYdHygWG.js";const K={class:""},X={class:"flex justify-between flex-wrap items-center mb-4"},ee={class:"flex gap-2"},te={class:"grid grid-cols-1 gap-4 lg:gap-2"},ae={class:"min-h-36 grid place-content-center"},_e=R({__name:"index",async setup(se){let l,d;const u=L(),y=T(),h=m(()=>j(u.categories,["type","template"])),x={cursor:"",category:"",search:"",per_page:10,direction:"desc",filter:"template"},{values:o,setFieldValue:v,setValues:oe}=N({formOptions:{initialValues:x},onLoadingData:()=>f(),onBeforeSetQueryItems:(r,t)=>{if(r.cursor===t.cursor)return{cursor:""}}}),{data:_,status:w,error:B,execute:f}=([l,d]=q(async()=>H("prompter-list",async()=>(await y.prompter.index({sort:"created_at",...o}))._data,{default:()=>[],server:!1})),l=await l,d(),l),V=async r=>{await u.onDeleteItem(r,f)},n=m(()=>_.value?.data||[]),P=m(()=>_.value.meta);return(r,t)=>{const C=E,F=U,b=z,D=M,$=Q,S=G,k=I,A=O;return p(),g("div",K,[i("div",X,[s(C,{modelValue:e(o).search,"onUpdate:modelValue":t[0]||(t[0]=a=>e(o).search=a),icon:"search",size:"sm",clear:"","custom-input-classes":"bg-white",placeholder:"Start typing...",class:"lg:max-w-sm",name:"search"},null,8,["modelValue"]),s(F,{modelValue:e(o).category,"onUpdate:modelValue":t[1]||(t[1]=a=>e(o).category=a),name:"category",placeholder:"Select a category",searchable:"","label-prop":"title","value-prop":"id","sync-v-model":"",class:"lg:max-w-sm",options:e(h)},null,8,["modelValue","options"])]),s(b,{type:"template",class:"my-4"}),s(A,{"expand-icons":"","expand-action":e(n).length},{header:c(()=>[i("div",ee,[s(D)])]),default:c(()=>[s(k,{"static-slot":"",navigation:e(P),"show-not-found":e(n)&&!e(n).length,status:e(w),items:e(n),errors:e(B),"page-items":"","page-key":"per_page",onSetPage:t[2]||(t[2]=a=>e(v)("cursor",a))},{empty:c(()=>[i("div",ae,[s(S,{icon:"add",color:"primary",to:"/prompt-central/app/templates/start?template=1"},{default:c(()=>[...t[3]||(t[3]=[J(" Add Template ",-1)])]),_:1})])]),default:c(()=>[i("div",te,[(p(!0),g(W,null,Y(e(n),a=>(p(),Z($,{key:a.id,card:a,templates:"",class:"shadow border",onOnDelete:V},null,8,["card"]))),128))])]),_:1},8,["navigation","show-not-found","status","items","errors"])]),_:1},8,["expand-action"])])}}});export{_e 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.