1import{f as ue,v as ce,j as de,I as ve,g as fe,p as pe,r as T,G as Y,s as Z,c as r,b as F,w as A,i as a,U as _e,h as he,O as ye,m as h,o as l,a as n,t as g,k as c,F as p,B as m,C as q,d as C,x as M,T as ge,V as me,S as ee,W as ke,H as we,X as be,e as je,_ as Ce}from"./B5dAucdC.js";import{_ as xe}from"./BAql6LVn.js";import{A as Te,m as Fe,a as Ae}from"./CqhUvuBW.js";const Me={class:"v-project-list"},Pe={class:"v-project-list__content app-show-background-on-nav"},Be={key:0,class:"v-project-list__description"},Ge={key:1,class:"v-project-list__tags"},Le=["aria-pressed","onClick"],Ie={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 16 16","aria-hidden":"true"},Se={key:2,class:"v-project-list__mobile-filter-trigger"},$e={key:0},Ee={class:"v-project-list__modal"},Oe={class:"v-project-list__modal-body"},Ve={key:0,class:"v-project-list__modal-section"},qe={class:"v-project-list__modal-filters"},ze=["aria-pressed","onClick"],Ne={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 16 16","aria-hidden":"true"},De={key:0,class:"v-project-list__modal-section"},Qe={class:"v-project-list__modal-filters"},Re=["aria-pressed","onClick"],He={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 16 16","aria-hidden":"true"},Ue={class:"v-project-list__modal-footer"},We={key:3,class:"v-project-list__filters-row"},Xe={class:"v-project-list__filters"},Je=["aria-pressed","onClick"],Ke={key:0,xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 16 16","aria-hidden":"true"},Ye={key:4,class:"v-project-list__content__grid"},Ze={key:5,class:"v-project-list__empty"},et=ue({__name:"AppProjectList",props:{apiEndpoint:{},filterMap:{default:()=>({})},filterDescription:{default:""},emptyMessage:{},pageType:{},filterGroups:{default:()=>[]},tagsAsLinks:{type:Boolean,default:!1},setPageTitle:{type:Boolean,default:!0}},emits:["play-video","play-podcast"],async setup(y,{emit:te}){let x,z;const d=y,N=te,P=T(!1),se=h(()=>{const e=!d.tagsAsLinks&&j.value.length>0,t=d.filterGroups.length>0;return e||t});function le(){P.value=!0,document.body.style.overflow="hidden"}function B(){P.value=!1,document.body.style.overflow=""}ce(()=>{document.body.style.overflow=""}),_e().public.backendBaseUrl;const G=de(),re=ve(),{data:_}=([x,z]=fe(()=>he(()=>`projectlist-${d.apiEndpoint}`,()=>ye(d.apiEndpoint),{watch:[()=>d.apiEndpoint]})),x=await x,z(),x);d.setPageTitle&&pe(_);const oe=h(()=>_.value?.options.headerTitle),D=h(()=>_.value?.options.preview),k=h(()=>_.value?Object.values(_.value.children):void 0),Q=h(()=>_.value?.options.availableTags??[]),L=T(_.value?.options.headerImage?.resize.tiny);Y(_,e=>{L.value=e?.options.headerImage?.resize.tiny,W(e?.options.headerImage?.url||"")});const u=T(I(G.query.tags)),v=T({});function R(){const e={};for(const t of d.filterGroups){const i=G.query[t.queryParam];t.type==="single"?e[t.id]=i?[i]:[]:e[t.id]=I(i)}v.value=e}function w(e,t){return v.value[e]?.includes(t)??!1}function H(e,t){const i=v.value[e.id]||[];let f;e.type==="single"?f=i.includes(t)?[]:[t]:i.indexOf(t)===-1?f=[...i,t]:f=i.filter(o=>o!==t),v.value={...v.value,[e.id]:f},E()}function I(e){return e?Array.isArray(e)?e.filter(t=>typeof t=="string"):e.split(",").filter(Boolean):[]}function b(e){return u.value.includes(e)}const U=h(()=>{if(!k.value)return[];const e=u.value.length>0,t=d.filterGroups.some(i=>(v.value[i.id]?.length??0)>0);return!e&&!t?k.value:ie(k.value)});function ie(e){return S(e,u.value,v.value)}function S(e,t,i){return Object.values(e).filter(f=>{if(t.length>0){const s=f.content.tags;if(!s||!Array.isArray(s)||!s.some(V=>t.includes(V.slug)))return!1}for(const s of d.filterGroups){const o=i[s.id]||[];if(o.length>0&&!s.filterFn(f,o))return!1}return!0})}const j=h(()=>k.value?d.tagsAsLinks?Q.value:Q.value.filter(e=>{if(b(e.slug))return!0;const t=[...u.value,e.slug];return S(k.value,t,v.value).length>0}):[]);function $(e){return k.value?e.options.filter(t=>{if(w(e.id,t.key))return!0;const i={...v.value};return e.type==="single"?i[e.id]=[t.key]:i[e.id]=[...v.value[e.id]||[],t.key],S(k.value,u.value,i).length>0}):[]}Z(()=>{W(_.value?.options.headerImage?.url||"")});function W(e){const t=new Image;t.src=e,t.addEventListener("load",()=>L.value=e)}function X(e){u.value.indexOf(e)===-1?u.value=[...u.value,e]:u.value=u.value.filter(i=>i!==e),E()}function J(){u.value=[];const e={};for(const t of d.filterGroups)e[t.id]=[];v.value=e,E()}function E(){const e={};u.value.length>0&&(e.tags=u.value.join(","));for(const t of d.filterGroups){const i=v.value[t.id]||[];
1i.length>0&&(e[t.queryParam]=i.join(","))}re.push({query:e})}const O=h(()=>{let e=u.value.length;for(const t of d.filterGroups)e+=v.value[t.id]?.length??0;return e}),K=h(()=>O.value>0);Y(()=>G.query,e=>{u.value=I(e.tags),R()},{immediate:!0}),Z(()=>{R()});function ne(e,t){N("play-video",e,t)}function ae(e,t){N("play-podcast",e,t)}return(e,t)=>{const i=je,f=xe;return l(),r("div",Me,[F(Te,{"header-cover":a(L),"header-text":a(oe),"header-type":"list"},{default:A(()=>[n("div",Pe,[a(D)?(l(),r("div",Be,g(a(D)),1)):c("",!0),a(j).length>0?(l(),r("div",Ge,[y.tagsAsLinks?(l(!0),r(p,{key:0},m(a(j),s=>(l(),q(i,{key:s.slug,to:`/tag/${s.slug}`,class:"v-project-list__filter v-project-list__filter--link"},{default:A(()=>[C(g(s.name),1)]),_:2},1032,["to"]))),128)):(l(!0),r(p,{key:1},m(a(j),s=>(l(),r("button",{type:"button",class:M(["v-project-list__filter",{"v-project-list__filter--active":b(s.slug)}]),key:s.slug,"aria-pressed":b(s.slug),onClick:o=>X(s.slug)},[C(g(s.name)+" ",1),b(s.slug)?(l(),r("svg",Ie,[...t[0]||(t[0]=[n("path",{d:"M4 4l8 8M12 4l-8 8"},null,-1)])])):c("",!0)],10,Le))),128))])):c("",!0),a(se)?(l(),r("div",Se,[n("button",{type:"button",class:"v-project-list__mobile-filter-btn app-button app-button--small",onClick:le},[n("span",null,[t[1]||(t[1]=C("Filtrer",-1)),a(O)>0?(l(),r("span",$e," ("+g(a(O))+")",1)):c("",!0)])])])):c("",!0),(l(),q(ke,{to:"body"},[F(ge,{name:"filter-modal"},{default:A(()=>[a(P)?(l(),r("div",{key:0,class:"v-project-list__modal-overlay",onClick:me(B,["self"])},[n("div",Ee,[n("div",{class:"v-project-list__modal-header"},[t[3]||(t[3]=n("span",{class:"v-project-list__modal-title"},"Filtrer",-1)),n("button",{type:"button",class:"v-project-list__modal-close",onClick:B,"aria-label":"Fermer"},[...t[2]||(t[2]=[n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 16 16"},[n("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])])]),n("div",Oe,[a(j).length>0&&!y.tagsAsLinks?(l(),r("div",Ve,[n("div",qe,[(l(!0),r(p,null,m(a(j),s=>(l(),r("button",{type:"button",class:M(["v-project-list__filter",{"v-project-list__filter--active":b(s.slug)}]),key:s.slug,"aria-pressed":b(s.slug),onClick:o=>X(s.slug)},[C(g(s.name)+" ",1),b(s.slug)?(l(),r("svg",Ne,[...t[4]||(t[4]=[n("path",{d:"M4 4l8 8M12 4l-8 8"},null,-1)])])):c("",!0)],10,ze))),128))])])):c("",!0),(l(!0),r(p,null,m(y.filterGroups,s=>(l(),r(p,{key:s.id},[$(s).length>0?(l(),r("div",De,[n("div",Qe,[(l(!0),r(p,null,m($(s),o=>(l(),r("button",{type:"button",class:M(["v-project-list__filter",[`v-project-list__filter--${s.id}`,{"v-project-list__filter--active":w(s.id,o.key)}]]),key:o.key,style:ee({"--filter-bg":o.bgColor||"transparent","--filter-text":o.textColor||"var(--app-color-grey-text)","--filter-border":o.borderColor||"var(--app-color-grey-text)"}),"aria-pressed":w(s.id,o.key),onClick:V=>H(s,o.key)},[C(g(o.label)+" ",1),w(s.id,o.key)?(l(),r("svg",He,[...t[5]||(t[5]=[n("path",{d:"M4 4l8 8M12 4l-8 8"},null,-1)])])):c("",!0)],14,Re))),128))])])):c("",!0)],64))),128))]),n("div",Ue,[a(K)?(l(),r("button",{key:0,type:"button",class:"v-project-list__modal-clear",onClick:J}," Effacer tous les filtres ")):c("",!0),n("button",{type:"button",class:"v-project-list__modal-apply app-button app-button--small",onClick:B}," Appliquer ")])])])):c("",!0)]),_:1})])),y.filterGroups.length>0||a(j).length>0?(l(),r("div",We,[n("div",Xe,[(l(!0),r(p,null,m(y.filterGroups,s=>(l(),r(p,{key:s.id},[(l(!0),r(p,null,m($(s),o=>(l(),r("button",{type:"button",class:M(["v-project-list__filter",[`v-project-list__filter--${s.id}`,{"v-project-list__filter--active":w(s.id,o.key)}]]),key:o.key,style:ee({"--filter-bg":o.bgColor||"transparent","--filter-text":o.textColor||"var(--app-color-grey-text)","--filter-border":o.borderColor||"var(--app-color-grey-text)"}),"aria-pressed":w(s.id,o.key),onClick:V=>H(s,o.key)},[C(g(o.label)+" ",1),w(s.id,o.key)?(l(),r("svg",Ke,[...t[6]||(t[6]=[n("path",{d:"M4 4l8 8M12 4l-8 8"},null,-1)])])):c("",!0)],14,Je))),128))],64))),128))]),a(K)?(l(),r("button",{key:0,type:"button",class:"v-project-list__filter v-project-list__filter--clear",onClick:J},[...t[7]||(t[7]=[C(" Effacer tous les filtres ",-1),n("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 16 16","aria-hidden":"true"},[n("path",{d:"M4 4l8 8M12 4l-8 8"})],-1)])])):c("",!0)])):c("",!0),a(U).length>0?(l(),r("div",Ye,[F(we,{name:"list-fade"},{default:A(()=>[(l(!0),r(p,null,m(a(U),s=>(l(),q(Ae,be({key:s.slug},{ref_for:!0},a(Fe)(s,y.pageType),{onPlayVideo:ne,onPlayPodcast:ae}),null,16))),128))]),_:1})])):(l(),r("div",Ze,g(y.emptyMessage),1))])]),_:1},8,["header-cover","header-text"]),F(f)])}}}),ot=Object.assign(Ce(et,[["__scopeId","data-v-cec01b9c"]]),{__name:"AppProjectList"});export{ot as A};
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.