1import{N as x,C as b,z as M,c as e,a7 as A,g as a,d as n,F as B,r as C,n as D,a as r,k as h,t as d,b as _,e as k,x as N,f,l as S,a0 as E,m as v,o as t}from"./app-C8sttQnK.js";import{u as L}from"./useAdminView-B6dTTC91.js";const V={class:"article-content"},z={key:0,class:"h-44 w-full rounded-lg skeleton-shimmer"},H={key:1,class:"h-8 w-2/3 rounded skeleton-shimmer"},I={key:2,class:"h-4 w-1/3 rounded skeleton-shimmer"},T={key:3,class:"space-y-2"},F={class:"space-y-2 pt-1"},$={key:1,class:"bg-red-50 border border-red-200 rounded-lg p-4 text-red-700"},j={class:"flex items-center"},q={key:2},R={key:0,class:"mb-4 flex items-center justify-end"},U={key:1,class:"mb-6"},W=["src","alt"],G={key:2,class:"text-2xl font-bold text-gray-900 mb-4"},J={key:3,class:"flex flex-wrap items-center gap-4 text-sm text-gray-600 mb-6 pb-4 border-b"},K={key:0,class:"flex items-center"},O={class:"flex items-center"},P={key:4,class:"text-lg text-gray-600 mb-4 italic"},Q={class:"prose prose-lg max-w-none"},X={__name:"ArticleContent",props:{slug:{type:String,required:!0},showTitle:{type:Boolean,default:!1},showDescription:{type:Boolean,default:!1},showImage:{type:Boolean,default:!1},showMeta:{type:Boolean,default:!1},skeletonLines:{type:Number,default:6},skeletonMinHeight:{type:String,default:""}},setup(l){const c=l,s=v(null),m=v(!0),u=v(null),{showAdminFeatures:p}=L(),w=["w-full","w-full","w-10/12","w-full","w-9/12","w-11/12","w-8/12","w-full","w-7/12","w-10/12","w-11/12","w-9/12"],y=async()=>{m.value=!0,u.value=null;try{const o=await fetch(`/api/articles/content/${c.slug}`);if(!o.ok)throw new Error("Article not found");const i=await o.json();s.value=i.article}catch(o){u.value=o.message,console.error("Error fetching article:",o)}finally{m.value=!1}};return b(()=>{y()}),M(()=>c.slug,()=>{y()}),(o,i)=>(t(),e("div",V,[m.value?(t(),e("div",{key:0,class:"space-y-4",style:A(c.skeletonMinHeight?{minHeight:c.skeletonMinHeight}:void 0)},[l.showImage?(t(),e("div",z)):a("",!0),l.showTitle?(t(),e("div",H)):a("",!0),l.showMeta?(t(),e("div",I)):a("",!0),l.showDescription?(t(),e("div",T,[...i[0]||(i[0]=[n("div",{class:"h-4 w-11/12 rounded skeleton-shimmer"},null,-1),n("div",{class:"h-4 w-3/4 rounded skeleton-shimmer"},null,-1)])])):a("",!0),n("div",F,[(t(!0),e(B,null,C(Math.max(1,c.skeletonLines),g=>(t(),e("div",{key:g,class:D(["h-4 rounded skeleton-shimmer",w[(g-1)%w.length]])},null,2))),128))])],4)):u.value?(t(),e("div",$,[n("div",j,[r(h,{icon:"mdi-alert-circle",class:"mr-2"}),n("span",null,"Error loading article: "+d(u.value),1)])])):s.value?(t(),e("div",q,[_(p)&&s.value.id?(t(),e("div",R,[r(_(S),{href:o.route("admin.articles.edit",s.value.id)},{default:k(()=>[r(N,{variant:"secondary",icon:"mdi-pencil",size:"xs",class:"m-1"},{default:k(()=>[...i[1]||(i[1]=[f(" Edit Article ",-1)])]),_:1})]),_:1},8,["href"])])):a("",!0),l.showImage&&s.value.image?(t(),e("div",U,[n("img",{src:s.value.image,alt:s.value.title,class:"w-full h-auto rounded-lg"},null,8,W)])):a("",!0),l.showTitle?(t(),e("h2",G,d(s.value.title),1)):a("",!0),l.showMeta?(t(),e("div",J,[s.value.category?(t(),e("div",K,[r(h,{icon:"mdi-folder",class:"mr-1"}),f(" "+d(s.value.category.name),1)])):a("",!0),n("div",O,[r(h,{icon:"mdi-calendar",class:"mr-1"}),f(" "+d(new Date(s.value.updated_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})),1)])])):a("",!0),l.showDescription&&s.value.description?(t(),e("div",P,d(s.value.description),1)):a("",!0),n("div",Q,[r(E,{content:s.value.content},null,8,["content"])])])):a("",!0)]))}},ee=x(X,[["__scopeId","data-v-13c362aa"]]);export{ee as A};
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.