1import{u as z}from"./Dy9pVEbO.js";import{f as B,D as L,H as F,r as m,h as I,q as D,c as r,i as u,a as t,j as n,B as q,t as i,F as x,k as _,d as f,o as l,y as H}from"#entry";import{u as K}from"./CI36eZX6.js";import"./DKLWY9DJ.js";const A={class:"min-h-screen bg-gray-50"},E={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"},O={key:0,class:"mb-8"},T={key:1,class:"bg-white rounded-lg shadow-md p-8 mb-8"},V={class:"grid md:grid-cols-2 gap-8 items-center"},R={key:0,class:"rounded-lg overflow-hidden"},W=["src","alt"],Y={key:2,class:"text-center py-12"},G={key:3,class:"bg-red-50 border border-red-200 rounded-lg p-4 text-red-700"},J={key:4},Q={class:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 mb-8"},X={class:"p-6 border-b border-gray-200"},Z={class:"flex items-center gap-4"},ee={class:"flex-shrink-0"},te=["src","alt"],se={key:1,class:"h-16 w-16 rounded-full bg-blue-100 flex items-center justify-center text-2xl font-bold text-blue-600"},oe={class:"flex-1 min-w-0"},re={class:"text-lg font-semibold text-gray-900 truncate"},ne={class:"text-sm text-gray-400 mt-1"},le={class:"p-6"},ae={class:"text-sm font-semibold text-gray-700 mb-3"},ie={key:0,class:"space-y-3"},de={class:"flex-shrink-0"},ce=["src","alt"],ue={key:1,class:"h-12 w-12 rounded-full bg-blue-100 flex items-center justify-center text-xl"},me={class:"flex-1 min-w-0"},ge={class:"font-medium text-gray-900 truncate"},he={class:"text-sm text-gray-600 truncate"},be={key:0},pe={key:1},ye={key:2},xe={key:3},fe={key:1,class:"text-center py-4 text-gray-500 text-sm"},ve={class:"flex items-center justify-between border-t border-gray-200 pt-6"},we={class:"flex-1 flex justify-between sm:hidden"},_e=["disabled"],ke=["disabled"],Ce={class:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"},Pe={class:"text-sm text-gray-700"},De={class:"font-medium"},Me={class:"font-medium"},je={class:"font-medium"},Ue={class:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px","aria-label":"Pagination"},$e=["disabled"],Ne=["onClick"],Se={key:1,class:"relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700"},ze=["disabled"],Be={key:5,class:"text-center py-12"},k=20,Ke=B({__name:"index",setup(Le){z({title:"DogHealthy Community â Meet UK Dog Owners",description:"Explore the DogHealthy community of UK dog owners. See member profiles, discover breeds, and get inspired by how others care for their dogsâ health and wellbeing.",keywords:"dog owner community UK, DogHealthy members, dog lovers UK, pet owner profiles, dog breeds community",path:"/members"});const M=L(),j=F(),{fetchImageWithFallback:C}=K(),p=m(""),g=m(null);I(async()=>{try{const e=await C("dog community group",{orientation:"landscape",width:1920,height:600});e&&(p.value=e.url)}catch{}try{const e=await C("dogs playing together",{orientation:"landscape",width:800,height:600});e&&(g.value=e)}catch{}const a=parseInt(M.query.page)||1;P(a)});const h=m([]),d=m({page:1,pageSize:20,totalCount:0,totalPages:0,hasNextPage:!1,hasPreviousPage:!1}),v=m(!0),y=m(""),c=D(()=>d.value.page),U=D(()=>{const a=d.value.totalPages,e=c.value,s=[];if(a<=7)for(let o=1;o<=a;o++)s.push(o);else if(e<=4){for(let o=1;o<=5;o++)s.push(o);s.push(-1),s.push(a)}else if(e>=a-3){s.push(1),s.push(-1);for(let o=a-4;o<=a;o++)s.push(o)}else{s.push(1),s.push(-1);for(let o=e-1;o<=e+1;o++)s.push(o);s.push(-1),s.push(a)}return s}),P=async(a=1)=>{try{v.value=!0,y.value="";const e=await $fetch("/.netlify/functions/members",{query:{page:a,pageSize:k}});h.value=e.members,d.value=e.pagination,j.replace({query:{page:a.toString()}})}catch(e){console.error("Error fetching members:",e),y.value=e?.data?.error||e?.message||"Failed to load members",h.value=[]}finally{v.value=!1}},b=a=>{a<1||a>d.value.totalPages||P(a)},$=a=>new Date(a).toLocaleDateString("en-GB",{year:"numeric",month:"short",day:"numeric"}),N=a=>{const e=new Date(a),s=new Date,o=s.getFullYear()-e.getFullYear(),w=s.getMonth()-e.getMonth();return o>0?w<0?`${o-1} years old`:`${o} years old`:w>0?`${w} months old`:"Less than a month old"},S=a=>a?a.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2):"?";return(a,e)=>(l(),r("div",A,[n(p)?(l(),r("div",{key:0,class:"relative h-64 bg-cover bg-center",style:q({backgroundImage:`url(${n(p)})`})},[...e[4]||(e[4]=[t("div",{class:"absolute inset-0 bg-black opacity-30"},null,-1),t("div",{class:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-full flex items-center"},[t("div",null,[t("h1",{class:"text-4xl font-bold text-white mb-2"},"Community Members"),t("p",{class:"text-xl text-white"},"Discover other dog owners and their furry friends")])],-1)])],4)):u("",!0),t("div",E,[n(p)?u("",!0):(l(),r("div",O,[...e[5]||(e[5]=[t("h1",{class:"text-3xl font-bold text-gray-900 mb-2"},"Community Members",-1),t("p",{class:"text-gray-600"},"Discover other dog owners and their furry friends. Connect with fellow dog lovers and share experiences about caring for your pets.",-1)])])),n(g)?(l(),r("div",T,[t("div",V,[n(g)?(l(),r("div",R,[t("img",{src:n(g).url,alt:n(g).description||"Dog community",class:"w-full h-auto object-cover"},null,8,W)])):u("",!0),e[6]||(e[6]=t("div",null,[t("h2",{class:"text-2xl font-bold text-gray-900 mb-4"},"Join Our Dog Lovers Community"),t("p",{class:"text-gray-600 mb-4"}," Our community is made up of thousands of dog owners who are passionate about their pets' health and wellbeing. Browse member profiles to see how others are caring for their dogs, discover new breeds, and get inspired by their stories. "),t("p",{class:"text-gray-600"}," Whether you're a first-time dog owner or have years of experience, connecting with other members can provide valuable insights, tips, and support for your dog care journey. ")],-1))])])):u("",!0),n(v)?(l(),r("div",Y,[...e[7]||(e[7]=[t("div",{class:"inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"},null,-1),t("p",{class:"mt-4 text-gray-600"},"Loading members...",-1)])])):n(y)?(l(),r("div",G,i(n(y)),1)):n(h)&&n(h).length>0?(l(),r("div",J,[t("div",Q,[(l(!0),r(x,null,_(n(h),s=>(l(),r("div",{key:s.id,class:"bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow"},[t("div",X,[t("div",Z,[t("div",ee,[s.avatarUrl?(l(),r("img",{key:0,src:s.avatarUrl,alt:s.fullName||"Member",class:"h-16 w-16 rounded-full object-cover"},null,8,te)):(l(),r("div",se,i(S(s.fullName)),1))]),t("div",oe,[t("h3",re,i(s.fullName||"Anonymous Member"),1),t("p",ne,i($(s.createdAt)),1)])])]),t("div",le,[t("h4",ae," Dogs ("+i(s.dogs.length)+") ",1),s.dogs.length>0?(l(),r("div",ie,[(l(!0),r(x,null,_(s.dogs,o=>(l(),r("div",{key:o.id,class:"flex items-center gap-3 p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors"},[t("div",de,[o.photoUrl?(l(),r("img",{key:0,src:o.photoUrl,alt:o.name,class:"h-12 w-12 rounded-full object-cover"},null,8,ce)):(l(),r("div",ue," ð "))]),t("div",me,[t("p",ge,i(o.name),1),t("p",he,[o.breed?(l(),r("span",be,i(o.breed),1)):u("",!0),o.breed&&o.gender?(l(),r("span",pe," ⢠")):u("",!0),o.gender?(l(),r("span",ye,i(o.gender),1)):u("",!0),o.birthDate?(l(),r("span",xe," ⢠"+i(N(o.birthDate)),1)):u("",!0)])])]))),128))])):(l(),r("div",fe," No dogs registered yet "))])]))),128))]),t("div",ve,[t("div",we,[t("button",{onClick:e[0]||(e[0]=s=>b(n(c)-1)),disabled:!n(d).hasPreviousPage,class:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"}," Previous ",8,_e),t("button",{onClick:e[1]||(e[1]=s=>b(n(c)+1)),disabled:!n(d).hasNextPage,class:"ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"}," Next ",8,ke)]),t("div",Ce,[t("div",null,[t("p",Pe,[e[8]||(e[8]=f(" Showing ",-1)),t("span",De,i((n(c)-1)*k+1),1),e[9]||(e[9]=f(" to ",-1)),t("span",Me,i(Math.min(n(c)*k,n(d).totalCount)),1),e[10]||(e[10]=f(" of ",-1)),t("span",je,i(n(d).totalCount),1),e[11]||(e[11]=f(" members ",-1))])]),t("div",null,[t("nav",Ue,[t("button",{onClick:e[2]||(e[2]=s=>b(n(c)-1)),disabled:!n(d).hasPreviousPage,class:"relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 text-sm font-medium text-gray-500 bg-white hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[...e[12]||(e[12]=[t("span",{class:"sr-only"},"Previous",-1),t("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[t("path",{"fill-rule":"evenodd",d:"M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z","clip-rule":"evenodd"})],-1)])],8,$e),(l(!0),r(x,null,_(n(U),s=>(l(),r(x,{key:s},[s!==-1?(l(),r("button",{key:0,onClick:o=>b(s),class:H(["relative inline-flex items-center px-4 py-2 border text-sm font-medium",s===n(c)?"z-10 bg-blue-50 border-blue-500 text-blue-600":"bg-white border-gray-300 text-gray-500 hover:bg-gray-50"])},i(s),11,Ne)):(l(),r("span",Se," ... "))],64))),128)),t("button",{onClick:e[3]||(e[3]=s=>b(n(c)+1)),disabled:!n(d).hasNextPage,class:"relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 text-sm font-medium text-gray-500 bg-white hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"},[...e[13]||(e[13]=[t("span",{class:"sr-only"},"Next",-1),t("svg",{class:"h-5 w-5",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},[t("path",{"fill-rule":"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z","clip-rule":"evenodd"})],-1)])],8,ze)])])])])])):(l(),r("div",Be,[...e[14]||(e[14]=[t("div",{class:"text-6xl mb-4"},"ð¥",-1),t("h2",{class:"text-2xl font-semibold text-gray-900 mb-2"},"No members found",-1),t("p",{class:"text-gray-600"},"There are no members to display at this time.",-1)])]))])]))}});
1export{Ke 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.