1import{b as F,u as j,a as z,_ as S,aB as V}from"./D1EJK7Tj.js";import{d as c,r as $,a as q,R as A,F as i,a9 as m,a2 as s,a5 as o,a8 as n,a4 as _,a6 as b,ab as f,a0 as P,a7 as L,am as R,aa as x}from"./vendor-vue-7DQK8ixm.js";try{(function(){var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="36c6da2e-34ec-4311-9c9e-52d326f79ac6",a._sentryDebugIdIdentifier="sentry-dbid-36c6da2e-34ec-4311-9c9e-52d326f79ac6")})()}catch{}(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a._sentryModuleMetadata=a._sentryModuleMetadata||{},a._sentryModuleMetadata[new a.Error().stack]=(function(e){for(var p=1;p<arguments.length;p++){var h=arguments[p];if(h!=null)for(var l in h)h.hasOwnProperty(l)&&(e[l]=h[l])}return e})({},a._sentryModuleMetadata[new a.Error().stack],{"_sentryBundlerPluginAppKey:cortico-website":!0})}catch{}})();const U={key:0,"aria-label":"Pagination",class:"pagination-wrapper"},W={class:"pagination"},K={key:1,class:"pagination-ctrl disabled","aria-disabled":"true"},O={key:0,"aria-hidden":"true"},G=["aria-label"],H={key:0,"aria-hidden":"true"},J={key:1,class:"pagination-ctrl disabled","aria-disabled":"true"},Q={__name:"Pagination",props:{itemsPerPage:{type:Number,required:!0},totalItems:{type:Number,default:1},maxDisplayedPages:{type:Number,default:5},currentPage:{type:Number,default:1},pageChanged:{type:Function,default:()=>{}}},setup(a){const e=a,p=j(),{$posthog:h}=z(),l=()=>{V(h,p.path,"directory_action",{action_type:"paginate",cta_location:"directory_pagination"},!0),window.scrollTo({top:0,behavior:"smooth"})},y=u=>({path:p.path,query:{...p.query,page:u}}),g=c(()=>Math.ceil(e.totalItems/e.itemsPerPage)),N=c(()=>e.totalItems>e.itemsPerPage),M=$(!1);q(()=>{const u=()=>{M.value=window.innerWidth<640};u(),window.addEventListener("resize",u,{passive:!0}),A(()=>window.removeEventListener("resize",u))});const C=c(()=>M.value?3:e.maxDisplayedPages),k=c(()=>{const u=g.value,t=e.currentPage,r=C.value,d=Math.floor(r/2);let w=Math.max(1,t-d),v=Math.min(u,w+r-1);return v-w<r-1&&(w=Math.max(1,v-r+1)),Array.from({length:v-w+1},(X,T)=>w+T)}),B=c(()=>k.value[0]>1),E=c(()=>k.value[0]>2),I=c(()=>k.value.at(-1)<g.value),D=c(()=>k.value.at(-1)<g.value-1);return(u,t)=>{const r=S;return s(N)?(o(),i("nav",U,[n("ul",W,[n("li",null,[e.currentPage>1?(o(),_(r,{key:0,class:"pagination-ctrl",to:y(e.currentPage-1),"aria-label":"Previous page",onClick:l},{default:b(()=>[...t[0]||(t[0]=[n("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},[n("path",{d:"M10 12L6 8L10 4",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),f(" Prev ",-1)])]),_:1},8,["to"])):(o(),i("span",K,[...t[1]||(t[1]=[n("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},[n("path",{d:"M10 12L6 8L10 4",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1),f(" Prev ",-1)])]))]),s(B)?(o(),i(P,{key:0},[n("li",null,[L(r,{class:"pagination-item",to:y(1),"aria-label":"Page 1",onClick:l},{default:b(()=>[...t[2]||(t[2]=[f("1",-1)])]),_:1},8,["to"])]),s(E)?(o(),i("li",O,[...t[3]||(t[3]=[n("span",{class:"pagination-ellipsis"},"â¦",-1)])])):m("",!0)],64)):m("",!0),(o(!0),i(P,null,R(s(k),d=>(o(),i("li",{key:d},[e.currentPage!==d?(o(),_(r,{key:0,class:"pagination-item",to:y(d),"aria-label":`Page ${d}`,onClick:l},{default:b(()=>[f(x(d),1)]),_:2},1032,["to","aria-label"])):(o(),i("span",{key:1,class:"pagination-item active","aria-current":"page","aria-label":`Page ${d}, current`},x(d),9,G))]))),128)),s(I)?(o(),i(P,{key:1},[s(D)?(o(),i("li",H,[...t[4]||(t[4]=[n("span",{class:"pagination-ellipsis"},"â¦",-1)])])):m("",!0),n("li",null,[L(r,{class:"pagination-item",to:y(s(g)),"aria-label":`Page ${s(g)}`,onClick:l},{default:b(()=>[f(x(s(g)),1)]),_:1},8,["to","aria-label"])])],64)):m("",!0),n("li",null,[e.currentPage<s(g)?(o(),_(r,{key:0,class:"pagination-ctrl",to:y(e.currentPage+1),"aria-label":"Next page",onClick:l},{default:b(()=>[...t[5]||(t[5]=[f(" Next ",-1),n("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},[n("path",{d:"M6 12L10 8L6 4",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),_:1},8,["to"])):(o(),i("span",J,[...t[6]||(t[6]=[f(" Next ",-1),n("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},[n("path",{d:"M6 12L10 8L6 4",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))])])])):m("",!0)}}},ee=F(Q,[["__scopeId","data-v-e02ff594"]]);export{ee as P};
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.