PageSourceSearch

https://karibu.tz/_nuxt/Dcy7xiUZ.js

js karibu.tz collected 2026-10-02 06:44:58 UTC 12,540 bytes, 1 lines download raw bytes

1import{e as ie,g as se,f as ae,i as ne,h as le,j as V,l as oe,K as re,T as ce,u as de,A as ue,c,a as s,n as e,N as me,p as M,m as o,q as m,b as a,v as O,x as A,w as h,d as $,t as g,y as w,D as pe,U as he,r as ge,k as E,o as n,F as fe,s as ve,I as ye,z as I}from"./CH-ZEK4R.js";import we from"./ChrnKzII.js";import{_ as ke}from"./krlaXjWg.js";import{c as L,s as S,f as k,i as b,_ as P,a as j}from"./W6-tx0bJ.js";import{_ as N}from"./YTWfuy-V.js";import{_ as be}from"./Cp6bh98m.js";import{_ as p}from"./d2KK8iZE.js";import{f as U,N as xe,B as _e}from"./BKpTMJfV.js";import{u as Ae}from"./Ces88HTk.js";import{u as $e}from"./COIsd2PM.js";import{c as K}from"./BPWlCE7M.js";import{u as Se,a as Te,A as Q}from"./CG21KSk8.js";import{C as Me}from"./3D8htXEZ.js";import{F as Y}from"./B6EqxVQH.js";const Pe=L("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Le=L("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);const Ce=L("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);const He=L("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),ze={class:"page-shell light:bg-linear-to-br from-gray-50 to-gray-100"},Oe={class:"fixed top-0 left-0 z-50 h-1 w-full bg-transparent"},je={class:"flex flex-col gap-6 animate-pulse"},Ne={class:"space-y-2"},qe={class:"mt-12 pt-8 flex flex-col sm:flex-row items-center justify-between gap-4"},De={key:1,class:"max-w-7xl mx-auto px-4 py-14"},Be={class:"flex items-center justify-between"},Fe={class:"mb-3"},Re=["initial","visibleOnce","innerHTML"],Ve=["initial","visibleOnce"],Ee={class:"flex items-center"},Ie=["datetime"],Ue=["innerHTML"],Ke={key:0,class:"flex items-center"},Qe={key:0,class:"mb-8 rounded-lg overflow-hidden shadow-xl"},Ye={key:0,class:"prose prose-lg max-w-none text-left md:text-justify dark:text-gray-400 custom-prose"},Ge={key:1,class:"text-center py-8"},Je={class:"mt-4 pt-6 border-t border-gray-200 flex items-center justify-between gap-4"},We={class:"flex gap-2"},Xe=["initial","enter"],Ze={class:"sticky top-24"},et={class:"px-6"},tt={class:"text-lg font-semibold mb-4 flex items-center gap-2"},it={class:"space-y-4"},st={class:"flex gap-4 items-start"},at={class:"shrink-0 w-20 h-20 rounded-lg overflow-hidden bg-gray-100"},nt={key:1,class:"w-full h-full flex items-center justify-center text-gray-400"},lt={class:"flex-1 min-w-0 flex flex-col justify-between"},ot=["innerHTML"],rt=["innerHTML"],ct={class:"flex items-center justify-between"},dt=["innerHTML"],ut={key:2,class:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-14"},mt={class:"text-center space-y-4"},pt={class:"mx-auto w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center"},ht={class:"text-2xl font-bold text-gray-900"},gt={class:"text-gray-600"},Ct=ie({__name:"[slug]",async setup(ft){let f,T;const G=se(),C=ae(),x=ne(),{find:q}=Ae(),{locale:v,waitForPendingLocaleChange:J,t:D}=le(),u=$e(),y=w(()=>G.params.slug),{data:i,status:B}=([f,T]=V(()=>E(()=>`post-${y.value}-${v.value}`,()=>q("karibu-posts",{filters:{slug:{$eq:y.value},locale:{$eq:v.value}},fields:["type","title","publishedAt","introduction","readingTime","description","slug"],populate:{cover:{fields:["url","alternativeText","formats"]},localizations:{fields:["slug","locale"]}}}).then(t=>t.data?.[0]||null).catch(()=>null),{getCachedData:K,watch:[y],default:()=>null})),f=await f,T(),f),{data:F,status:W}=([f,T]=V(()=>E(()=>`recent-posts-${v.value}-${y.value}-${i.value?.type??""}`,()=>i.value?.type?q("karibu-posts",{filters:{locale:{$eq:v.value},slug:{$ne:y.value},type:{$eq:i.value.type}},sort:["publishedAt:desc"],pagination:{page:1,pageSize:8},fields:["title","slug","introduction","publishedAt","type"],populate:{cover:{fields:["url","alternativeText"]}}}).then(t=>t.data||[]).catch(()=>[]):Promise.resolve([]),{getCachedData:K,transform:t=>t?.filter(r=>r?.slug!==i.value?.slug),default:()=>[],watch:[v,y,()=>i.value?.type],server:!1})),f=await f,T(),f),X=w(()=>i.value?.type==="notification"?D("news.details.recentNotifications"):D("news.details.recentNews")),H=w(()=>W.value==="success"&&(F.value?.length??0)>0);oe(v,async t=>{if(!i.value)return;const r=i.value?.localizations?.find(_=>_.locale===t);if(await J(),await ye(),r?.slug&&r.slug!==y.value){const _=x(`/news/${r.slug}`);await I(_,{replace:!0,external:!0})}else r||await I(x("/news"),{replace:!0})});const Z=async()=>
1{if(navigator.share&&i.value)try{await navigator.share({title:i.value?.title,text:i.value?.introduction,url:window.location.href})}catch{console.log("Share cancelled")}else await navigator.clipboard.writeText(window.location.href),alert("Link copied to clipboard!")},R=pe(0),z=()=>{const t=window.scrollY,r=document.documentElement.scrollHeight-window.innerHeight;R.value=r>0?Math.min(t/r*100,100):0};return re(()=>{window.addEventListener("scroll",z,{passive:!0}),z()}),ce(()=>{window.removeEventListener("scroll",z)}),de({title:S(i.value?.title||"Post"),meta:[{name:"description",content:S(i.value?.introduction||"")},{property:"og:title",content:S(i.value?.title||"Post")},{property:"og:description",content:S(i.value?.introduction||"")},{property:"og:image",content:i.value?.cover?.formats?.small?.url||i.value?.cover?.url||""}]}),Se([Te({"@type":"NewsArticle",headline:w(()=>S(i.value?.title||"")),description:w(()=>S(i.value?.introduction||"")),image:w(()=>i.value?.cover?.formats?.medium?.url||i.value?.cover?.url||""),datePublished:w(()=>i.value?.publishedAt||""),author:[{name:"Karibu .tz",url:ue().public.siteUrl}]})]),(t,r)=>{const _=he,ee=we,te=ke,l=ge("motion");return n(),c("div",ze,[s("div",Oe,[e(i)?(n(),c("div",{key:0,class:"h-full bg-primary transition-[width] duration-150",style:me({width:e(R)+"%"})},null,4)):M("",!0)]),e(B)==="pending"||e(B)==="idle"||!e(i)?o((n(),c("div",m({key:0},e(u).skeletonPanel,{class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-14"}),[s("div",je,[o(a(e(p),m({class:"h-8 w-32 mb-6 skel"},e(u).skeletonStagger(0)),null,16),[[l]]),o(a(e(p),m({class:"h-12 w-3/4 mb-4 skel"},e(u).skeletonStagger(1)),null,16),[[l]]),o(a(e(p),m({class:"h-6 w-48 mb-8 skel"},e(u).skeletonStagger(2)),null,16),[[l]]),o(a(e(p),m({class:"h-96 w-full mb-8 rounded-lg skel"},e(u).skeletonStagger(3)),null,16),[[l]]),s("div",Ne,[o(a(e(p),m({class:"h-4 w-full skel"},e(u).skeletonStagger(4)),null,16),[[l]]),o(a(e(p),m({class:"h-4 w-full skel"},e(u).skeletonStagger(5)),null,16),[[l]]),o(a(e(p),m({class:"h-4 w-3/4 skel"},e(u).skeletonStagger(6)),null,16),[[l]]),o(a(e(p),m({class:"h-4 w-5/6 skel"},e(u).skeletonStagger(7)),null,16),[[l]]),o(a(e(p),m({class:"h-4 w-4/5 skel"},e(u).skeletonStagger(8)),null,16),[[l]])]),s("div",qe,[o(a(e(p),m({class:"h-8 w-32 skel"},e(u).skeletonStagger(9)),null,16),[[l]]),o(a(e(p),m({class:"h-8 w-12 skel"},e(u).skeletonStagger(10)),null,16),[[l]])])])],16)),[[l]]):e(i)?(n(),c("article",De,[s("div",{class:O(["grid grid-cols-1 gap-8",{"lg:grid-cols-12":e(H)}])},[s("div",{class:O(["flex flex-col gap-4",e(H)?"lg:col-span-8":"w-full"])},[s("div",Be,[o((n(),A(e(P),{initial:("initialAnimation"in t?t.initialAnimation:e(b))({xPosition:200}),visibleOnce:("finalAnimation"in t?t.finalAnimation:e(k))({}),onClick:r[0]||(r[0]=d=>e(C).push(e(x)({name:"news"}))),variant:"ghost",size:"sm",class:"-ml-2 cursor-pointer border hover:bg-gray-200"},{default:h(()=>[a(e(Q),{class:"h-4 w-4 mr-2"}),$(" "+g(t.$t("news.details.back")),1)]),_:1},8,["initial","visibleOnce"])),[[l]]),o((n(),A(e(be),{initial:("initialAnimation"in t?t.initialAnimation:e(b))({xPosition:-200}),visibleOnce:("finalAnimation"in t?t.finalAnimation:e(k))({}),variant:e(i)?.type==="new"?"default":"secondary",class:O(["dark:text-gray-800 flex items-center gap-1.5 border-0",e(i)?.type==="new"?"bg-blue-600 dark:bg-blue-600 text-white":"bg-amber-400 dark:bg-amber-400 text-black dark:text-black"])},{default:h(()=>[e(i)?.type==="new"?(n(),A(e(xe),{key:0,class:"w-3.5 h-3.5"})):(n(),A(e(_e),{key:1,class:"w-3.5 h-3.5"})),$(" "+g(e(i)?.type==="new"?t.$t("news.details.type.news"):t.$t("news.details.type.notification")),1)]),_:1},8,["initial","visibleOnce","variant","class"])),[[l]])]),s("header",Fe,[o((n(),c("h1",{key:e(v),initial:("initialAnimation"in t?t.initialAnimation:e(b))({yPosition:30}),visibleOnce:("finalAnimation"in t?t.finalAnimation:e(k))({}),class:"text-4xl md:text-5xl font-bold text-gray-900 dark:text-gray-300 mb-4 leading-tight",innerHTML:e(j)(e(i)?.title)},null,8,Re)),[[l]]),o((n(),c("div",{key:e(v),initial:("initialAnimation"in t?t.initialAnimation:e(b))({yPosition:30}),visibleOnce:("finalAnimation"in t?t.finalAnimation:e(k))({}),class:"flex flex-wrap items-center gap-4 text-sm text-gray-600 dark:text-gray-400"},[s("div",Ee,[a(e(Me),{class:"h-4 w-4 mr-2"}),s("time",{datetime:String(e(i)?.publishedAt)},[s("span",{innerHTML:e(U)(e(i)?.publishedAt?String(e(i).publishedAt):void 0)},null,8,Ue)],8,Ie)]),e(i)?.introduction?(n(),c("div",Ke,[a(e(Le),{class:"h-4 w-4 mr-2"}),$(" "+g(t.$t("news.details.meta.minRead",{count:Math.ceil(Number(e(i)?.readingTime??0)*2||1)})),1)])):M("",!0)],8,Ve)),[[l]])]),e(i)?.cover?(n(),c("div",Qe,[o(a(_,{initial:("initialAnimation"in t?t.initialAnimation:e(b))({opacity:0}
1),visibleOnce:("finalAnimation"in t?t.finalAnimation:e(k))({duration:2e3}),provider:"strapi",src:e(i)?.cover?.formats?.medium?.url??e(i)?.cover?.url,alt:e(i)?.cover?.alternativeText||e(i)?.title,quality:"60",class:"w-full h-[450px] object-cover"},null,8,["initial","visibleOnce","src","alt"]),[[l]])])):M("",!0),o((n(),A(e(N),{initial:("initialAnimation"in t?t.initialAnimation:e(b))({yPosition:150}),visibleOnce:("finalAnimation"in t?t.finalAnimation:e(k))({duration:500}),class:"px-4 lg:px-8 card-bg"},{default:h(()=>[e(i)?.description?(n(),c("div",Ye,[a(ee,{nodes:e(i)?.description},null,8,["nodes"])])):(n(),c("div",Ge,[a(e(Y),{class:"h-12 w-12 mx-auto mb-4 mini-title"}),s("p",null,g(t.$t("news.details.noContent")),1)]))]),_:1},8,["initial","visibleOnce"])),[[l]]),s("div",Je,[a(e(P),{onClick:r[1]||(r[1]=d=>e(C).push(e(x)("/news"))),variant:"outline",class:"cursor-pointer hover:bg-gray-100"},{default:h(()=>[a(e(Ce),{class:"h-4 w-4 mr-2"}),r[3]||(r[3]=$(" View all posts ",-1))]),_:1}),s("div",We,[a(e(P),{variant:"ghost",size:"icon",class:"cursor-pointer hover:bg-gray-100",onClick:Z},{default:h(()=>[a(e(He),{class:"h-4 w-4"})]),_:1})])])],2),e(H)?o((n(),c("aside",{key:0,initial:("initialAnimation"in t?t.initialAnimation:e(b))({yPosition:150}),enter:("finalAnimation"in t?t.finalAnimation:e(k))({duration:500}),class:"lg:col-span-4"},[s("div",Ze,[a(e(N),{class:"card-bg"},{default:h(()=>[s("div",et,[s("h3",tt,g(e(X)),1),s("ul",it,[(n(!0),c(fe,null,ve(e(F),d=>(n(),c("li",{key:d?.id,class:"group"},[s("div",st,[s("div",at,[d?.cover?(n(),A(_,{key:0,provider:"strapi",src:d?.cover?.url,alt:d?.cover?.alternativeText||d?.title,quality:"50",width:"80",height:"80",class:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-300"},null,8,["src","alt"])):(n(),c("div",nt,[a(e(Y),{class:"h-8 w-8"})]))]),s("div",lt,[s("div",null,[s("p",{class:"text-sm font-medium mini-title group-hover:text-primary line-clamp-2 mb-1",innerHTML:e(j)(d?.title)},null,8,ot),s("p",{class:"text-xs description line-clamp-2 mb-2",innerHTML:e(j)(d?.introduction)},null,8,rt)]),s("div",ct,[s("p",{class:"text-xs description",innerHTML:e(U)(d?.publishedAt?String(d.publishedAt):void 0)},null,8,dt),a(te,{to:e(x)(`/news/${d?.slug}`),class:"text-xs bg-primary text-white py-1 px-2 rounded-sm hover:opacity-70"},{default:h(()=>[$(g(t.$t("news.post.readMore")),1)]),_:1},8,["to"])])])])]))),128))])])]),_:1})])],8,Xe)),[[l]]):M("",!0)],2)])):(n(),c("div",ut,[a(e(N),{class:"p-12 card-bg"},{default:h(()=>[s("div",mt,[s("div",pt,[a(e(Pe),{class:"h-8 w-8 text-gray-400"})]),s("h2",ht,g(t.$t("news.details.notFound.title")),1),s("p",gt,g(t.$t("news.details.notFound.description")),1),a(e(P),{onClick:r[2]||(r[2]=d=>e(C).push(e(x)("/news"))),variant:"default",class:"mt-4 cursor-pointer"},{default:h(()=>[a(e(Q),{class:"h-4 w-4 mr-2"}),$(" "+g(t.$t("news.details.viewAll")),1)]),_:1})])]),_:1})]))])}}});export{Ct 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.