1import{r as u,o as C,w as D,c as l,x as $,d as e,F as w,A as y,s as L,a3 as z,t as v,b as o,D as T,q as V}from"./vendor.427ced2e.js";import{_ as B,e as E,a as b,C as f,H}from"./index.5505c178.js";import"./ui.8f1dbae9.js";import"./charts.e62ca2c7.js";const I={class:"min-h-screen bg-slate-50 flex flex-col"},M={class:"flex-1 max-w-7xl w-full mx-auto flex flex-col md:flex-row pt-16 lg:pt-20"},N={class:"w-full md:w-64 bg-white md:bg-transparent border-b md:border-b-0 md:border-r border-slate-200 flex-shrink-0"},P={class:"p-6 sticky top-20"},R={key:0,class:"space-y-3"},G={key:1,class:"space-y-6"},S={class:"text-sm font-semibold text-slate-800 mb-2"},j={class:"space-y-1 pl-2 border-l border-slate-100"},q=["onClick"],F={key:0,class:"text-sm text-slate-500"},U={class:"flex-1 min-w-0 bg-white shadow-sm md:rounded-xl md:my-6 md:mr-6 md:ml-6 border border-slate-200"},J={key:0,class:"p-8 sm:p-12"},K={key:1,class:"p-8 sm:p-12 prose prose-slate prose-indigo max-w-none"},O={class:"text-sm text-slate-500 mb-8 border-b border-slate-100 pb-4"},Q=["innerHTML"],W={key:2,class:"flex flex-col items-center justify-center p-20 text-center"},X={__name:"ApiDocsPage",setup(Y){const r=u([]),p=u(!0),d=u(null),g=u(!1),c=u(null),{locale:m}=E(),x=async()=>{try{p.value=!0;const s=await b(`${f()}/articles/categories/?lang=${m.value}&page_size=100`,{method:"GET"});let t=s.results||s.data||s||[];t=t.filter(i=>i.slug.toLowerCase().includes("api")||i.name.toLowerCase().includes("api"));const a=await b(`${f()}/articles/?lang=${m.value}&page_size=1000`,{method:"GET"}),n=a.results||a.data||a||[];r.value=t.map(i=>({...i,articles:n.filter(A=>A.category_slug===i.slug)}));const _=n.filter(i=>!i.category_slug);_.length>0&&r.value.push({id:"other",name:"\u5176\u4ED6\u6587\u6863",articles:_}),r.value.length>0&&r.value[0].articles.length>0&&h(r.value[0].articles[0].slug)}catch(s){console.error("\u52A0\u8F7D\u6587\u6863\u76EE\u5F55\u5931\u8D25",s)}finally{p.value=!1}},h=async(s,t=!1)=>{if(!(!t&&c.value===s)){c.value=s,g.value=!0;try{const a=await b(`${f()}/articles/${s}/?lang=${m.value}`,{method:"GET"});d.value=a.data||a}catch(a){console.error("\u52A0\u8F7D\u6587\u7AE0\u5931\u8D25",a)}finally{g.value=!1}}},k=s=>s?new Date(s).toLocaleDateString("zh-CN",{year:"numeric",month:"short",day:"numeric"}):"";return C(()=>{x()}),D(m,()=>{x(),c.value&&h(c.value,!0)}),(s,t)=>(o(),l("div",I,[$(H),e("div",M,[e("aside",N,[e("div",P,[t[1]||(t[1]=e("h2",{class:"text-xs font-bold text-slate-400 uppercase tracking-wider mb-4"},"REST API \u63A5\u53E3\u6587\u6863",-1)),p.value?(o(),l("div",R,[...t[0]||(t[0]=[e("div",{class:"h-4 bg-slate-200 rounded animate-pulse w-3/4"},null,-1),e("div",{class:"h-4 bg-slate-200 rounded animate-pulse w-1/2"},null,-1),e("div",{class:"h-4 bg-slate-200 rounded animate-pulse w-5/6"},null,-1)])])):(o(),l("nav",G,[(o(!0),l(w,null,y(r.value,a=>(o(),l("div",{key:a.id},[e("h3",S,v(a.name),1),e("ul",j,[(o(!0),l(w,null,y(a.articles,n=>(o(),l("li",{key:n.slug},[e("a",{href:"#",onClick:T(_=>h(n.slug),["prevent"]),class:V(["block px-3 py-1.5 text-sm transition-colors rounded-r-lg border-l-2 -ml-[1px]",c.value===n.slug?"text-indigo-600 border-indigo-600 bg-indigo-50/50 font-medium":"text-slate-600 border-transparent hover:text-slate-900 hover:bg-slate-50 hover:border-slate-300"])},v(n.title),11,q)]))),128))])]))),128)),r.value.length===0?(o(),l("div",F," \u6682\u65E0\u5206\u7C7B ")):L("",!0)]))])]),e("main",U,[g.value?(o(),l("div",J,[...t[2]||(t[2]=[z('<div class="h-8 bg-slate-200 rounded animate-pulse w-1/3 mb-6" data-v-b0c82c12></div><div class="space-y-3" data-v-b0c82c12><div class="h-4 bg-slate-200 rounded animate-pulse w-full" data-v-b0c82c12></div><div class="h-4 bg-slate-200 rounded animate-pulse w-5/6" data-v-b0c82c12></div><div class="h-4 bg-slate-200 rounded animate-pulse w-3/4" data-v-b0c82c12></div></div>',2)])])):d.value?(o(),l("article",K,[e("h1",null,v(d.value.title),1),e("div",O," \u6700\u540E\u66F4\u65B0\u4E8E: "+v(k(d.value.updated_at)),1),e("div",{class:"article-content",innerHTML:d.value.content},null,8,Q)])):(o(),l("div",W,[...t[3]||(t[3]=[e("svg",{class:"w-16 h-16 text-slate-200 mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1),e("h3",{class:"text-lg font-medium text-slate-900"}
1,"\u8BF7\u9009\u62E9\u5DE6\u4FA7\u6587\u6863",-1),e("p",{class:"mt-1 text-sm text-slate-500"},"\u4ECE\u4FA7\u8FB9\u680F\u9009\u62E9\u60A8\u9700\u8981\u67E5\u9605\u7684\u63A5\u53E3\u6216\u8BF4\u660E\u6587\u6863\u3002",-1)])]))])])]))}},ae=B(X,[["__scopeId","data-v-b0c82c12"]]);export{ae 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.