1import{_ as $}from"./By8x4QfM.js";import{f as _,o as u,y as S,w as m,a,b as c,d as y,t as p,m as C,k as l,G as F,e as H,c as g,F as N,x as T,z as U,A as j,H as B,j as z,I as f,J as A,g as x,u as D,l as E,K as v}from"./CRQVmoW2.js";import{t as b}from"./yI7HeE6Z.js";const I={class:"group-hover:bg-primary/5 transition-all rounded-2xl p-3 sm:p-6 py-8"},J={class:"group relative"},K=_({__name:"Post",props:{post:{},pageName:{}},setup(t){return(n,s)=>{const i=$,r=C,e=H;return u(),S(e,{to:`/${t.pageName}/${t.post.slug}/${l(F)(t.post.fields.heading.value)}`,class:"group"},{default:m(()=>[a("div",I,[a("div",null,[a("div",J,[c(i,{as:"h3",class:"mb-3"},{default:m(()=>[y(p(t.post.fields.heading.value),1)]),_:1}),c(r,{class:"line-clamp-5",field:t.post.fields.content},null,8,["field"])])])])]),_:1},8,["to"])}}}),L=Object.assign(K,{__name:"UiPost"}),R={key:0,class:"isolate flex justify-center"},W={class:"inline-flex -space-x-px shadow-xs rounded-full"},Q=["disabled"],X=["disabled","onClick"],Y=["disabled"],w=3,Z=_({__name:"Paginator",props:{currentPage:{},totalPages:{}},emits:["goToPage"],setup(t,{emit:n}){const s=n,i=B(()=>{const r=Math.max(1,t.currentPage-w),e=Math.min(t.totalPages,t.currentPage+w),o=[];for(let d=r;d<=e;d++)o.push(d);return o});return(r,e)=>t.totalPages>1?(u(),g("nav",R,[a("div",W,[a("button",{class:"w-10 h-12 relative inline-flex items-center justify-center ring-1 ring-inset ring-neutral-200 cursor-pointer disabled:cursor-not-allowed text-neutral-900 rounded-l-full",disabled:t.currentPage===1,onClick:e[0]||(e[0]=o=>s("goToPage",t.currentPage-1))},[...e[2]||(e[2]=[a("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})],-1)])],8,Q),(u(!0),g(N,null,T(l(i),o=>(u(),g("button",{key:o,class:U(["w-10 h-12 relative inline-flex items-center justify-center ring-1 ring-inset ring-neutral-200 cursor-pointer disabled:cursor-not-allowed text-neutral-900",{"bg-accent text-white z-10":t.currentPage===o}]),disabled:t.currentPage===o,onClick:d=>s("goToPage",o)},p(o),11,X))),128)),a("button",{class:"w-10 h-12 relative inline-flex items-center justify-center ring-1 ring-inset ring-neutral-200 cursor-pointer disabled:cursor-not-allowed text-neutral-900 rounded-r-full",disabled:t.currentPage===t.totalPages,onClick:e[1]||(e[1]=o=>s("goToPage",t.currentPage+1))},[...e[3]||(e[3]=[a("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-4"},[a("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})],-1)])],8,Y)])])):j("",!0)}}),q=Object.assign(Z,{__name:"UiPaginator"});class ee{currentPage=z(1);itemsPerPage=5;totalPages;collections;url;constructor(n,s,i,r=5){if(this.collections=n,this.url=s,this.itemsPerPage=r,!this.collections.length)this.totalPages=1,this.currentPage.value=1;else if(this.totalPages=Math.ceil(this.collections.length/this.itemsPerPage),"page"in i&&!Number.isNaN(i.page)){const e=Number(i.page);e>0&&e<=this.totalPages?this.currentPage.value=e:f(`${this.url}?page=${this.currentPage.value}`)}}paginatedCollections=()=>{const n=(this.currentPage.value-1)*this.itemsPerPage,s=n+this.itemsPerPage;return this.collections.slice(n,s)};goToPage=n=>{n>0&&n<=this.totalPages&&(this.currentPage.value=n,f(`${this.url}?page=${this.currentPage.value}`))}}const te={class:"mx-auto max-w-4xl"},ne={class:"mb-6"},se={class:"mx-auto max-w-4xl"},ae={key:0,class:"divide-y divide-primary/10"},k="appendices",re=_({__name:"index",setup(t){const n=A(),s=x("writing"),i=x("writing_posts");D({title:"Writing",meta:[{name:"description",content:b(s.body.value,155,v)},{name:"twitter:description",content:b(s.body.value,155,v)}]});const r=z(i),e=B(()=>new ee(r.value,`/${k}`,n.query));return(o,d)=>{const M=$,V=C,h=E,G=L,O=q;return u(),g("div",null,[c(h,{first:"","outer-class":"bg-primary"},{default:m(()=>[a("div",te,[a("div",ne,[c(M,{light:"",as:"h1",class:"mb-6"},{default:m(()=>[y(p(l(s)?.heading.value),1)]),_:1}),c(V,{white:"",large:"",field:l(s)?.body},null,8,["field"])])])]),_:1}),c(h,{"outer-class":"bg-secondary"},{default:m(()=>[a("div",se,[l(e).paginatedCollections().length?(u(),g("div",ae,[(u(!0),g(N,null,T(l(e).paginatedCollections(),P=>(u(),g("article",{key:P.fields.title},[c(G,{post:P,"page-name":k},null,8,["post"])]))),128)),c(O,{"current-page":l(e).currentPage.value,"total-pages":l(e).totalPages,onGoToPage:l(e).goToPage},null,8,["current-page","total-pages","onGoToPage"])])):j("",!0)])]),_:1})])}}});
1export{re 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.