PageSourceSearch

https://www.sylience.fr/_nuxt/BSnJNfZy.js

js sylience.fr collected 2026-10-08 21:21:42 UTC 6,303 bytes, 1 lines download raw bytes

1import{W as K,$ as ee,p as U,be as te,G as se,Q as oe,J as ae}from"./Cr-NyzL6.js";import{e as c,b4 as ne,L as u,R as _,O as n,Y as A,x as a,H as I,W as N,a9 as R,aa as O,l as P,X as q,a1 as g,aq as le,M as w,N as M,Z as re,r as ie,v as d}from"./BSc71KA0.js";import{D as p}from"./CuXfEcPf.js";import"./ZE0XUaFf.js";import"./a3sj5zmn.js";const ue={class:"my-4"},de={class:"my-5"},ce={class:"my-5"},me={class:"flex justify-between"},pe={class:"flex gap-12"},ve=["id","value"],fe=["for"],ye={class:"my-3 flex gap-2"},ge={class:"my-5"},_e={class:"flex gap-12"},be=["id","value"],xe=["for"],ke={class:"my-5"},Ve={__name:"Agenda",async setup(W){let v,f;const S=[{id:"all",key:"Tous"},{id:"search",key:"Sélectif"}],$=[{id:"pdf",key:"PDF"},{id:"csv",key:"CSV"}],b=c("all"),x=c(""),o=ie({stores:[],categories:[],cities:[],tags:[],dates:null}),C=c(null),F=c(null),L=c(null),j=c(null),G=c([{label:"7 derniers jours",range:{start:p.now().minus({days:7}).toJSDate(),end:p.now().toJSDate()}},{label:"30 derniers jours",range:{start:p.now().minus({days:30}).toJSDate(),end:p.now().toJSDate()}},{label:"90 derniers jours",range:{start:p.now().minus({days:90}).toJSDate(),end:p.now().toJSDate()}}]),{data:m}=([v,f]=ne(async()=>K(async()=>{const s=ee(),{city:e}=s,l={$paginate:!1,city:e.code,specialType:"event",$select:["_id","name","catId","storeRanks","plannings","tags","ownerId","desc","bookingThreshold","seconds","possibleDays","city","contact","address"],$populate:["stores","categories"]},r=await U().$feathers.service("products").find({query:l}),V=r.flatMap(i=>i.stores||[]),t=r.map(i=>i.category).filter(Boolean),y=Array.from(new Set(V.map(i=>i.address?.city).filter(Boolean).map(i=>({name:i})))),z=Array.from(new Set(r.flatMap(i=>i.tags||[])));return{events:r,stores:V,categories:t,cities:y,tags:z,city:e}},"$1o7gJvvn-a")),v=await v,f(),v),B=d(()=>m.value?.stores||[]),J=d(()=>m.value?.events||[]),h=d(()=>m.value?.categories||[]),E=d(()=>m.value?.cities||[]),T=d(()=>m.value?.tags||[]),D=d(()=>m.value?.city),H=d(()=>b.value==="search"),Q=d(()=>Object.values(o).some(s=>s!==null&&s!==o.dates)),k=(s,e)=>{Array.isArray(e)?o[s]=e:o[s]=[e]},X=()=>{for(const s in o.value)s!=="dates"&&(o[s]=null);C.value?.resetInput(),F.value?.resetInput(),L.value?.resetInput(),j.value?.resetInput()},Y=()=>{U().$feathers.service("agenda-export").find({query:{csv:!0,events:J.value,filters:{...o,stores:o.stores.map(s=>({_id:s})),categories:o.categories.map(s=>({_id:s})),cities:o.cities.map(s=>({name:s})),tags:o.tags.map(s=>({name:s}))}}}).then(s=>{const e=new Blob(["\uFEFF"+s],{type:"text/csv"}),l=document.createElement("a");l.href=URL.createObjectURL(e),l.download=`evenements_${D.value.code}.csv`,l.click(),URL.revokeObjectURL(l.href)})},Z=async()=>{U().$feathers.service("agenda-export").find({query:{csv:!1,events:J.value,filters:{...o,stores:o.stores.map(s=>({_id:s})),categories:o.categories.map(s=>({_id:s})),cities:o.cities.map(s=>({name:s})),tags:o.tags.map(s=>({name:s}))},city:D.value}}).then(s=>{const e=new Blob([s],{type:"application/pdf"}),l=document.createElement("a");l.href=URL.createObjectURL(e),l.download=`evenements_${D.value.code}.pdf`,l.click(),URL.revokeObjectURL(l.href)})};return(s,e)=>{const l=te,r=se,V=oe;return u(),_("div",ue,[e[17]||(e[17]=n("p",{class:"text-lg font-semibold"},"Exporter les évènements",-1)),n("div",de,[e[12]||(e[12]=n("p",{class:"text-sm font-semibold mb-2"},"Dates",-1)),A(l,{modelValue:a(o).dates,"onUpdate:modelValue":e[0]||(e[0]=t=>a(o).dates=t),periods:!0,year:!1,ranges:a(G),type:"range",selected:"week"},null,8,["modelValue","ranges"])]),n("div",ce,[e[14]||(e[14]=n("p",{class:"text-sm font-semibold mb-2"},"Point d'activité",-1)),n("div",me,[n("ul",pe,[(u(),_(I,null,N(S,t=>n("li",{key:t.id},[R(n("input",{id:t.id,"onUpdate:modelValue":e[1]||(e[1]=y=>P(b)?b.value=y:null),type:"radio",value:t.id,class:"accent-primary"},null,8,ve),[[O,a(b)]]),n("label",{for:t,class:"ml-3"},q(t.key),9,fe)])),64))]),a(Q)?(u(),_("div",{key:0,onClick:X},[...e[13]||(e[13]=[n("span",{class:"font-semibold text-sm cursor-pointer"},"Réinitialiser",-1)])])):g("",!0)]),R(n("div",ye,[a(B).length?(u(),w(r,{
1key:0,ref_key:"storesAutocomplete",ref:C,modelValue:a(o).stores,"onUpdate:modelValue":[e[2]||(e[2]=t=>a(o).stores=t),e[3]||(e[3]=t=>k("stores",t))],options:a(B),"option-attribute":"name","value-attribute":"_id",placeholder:"Point d'activité",label:"Point d'activité",multiple:""},null,8,["modelValue","options"])):g("",!0),a(h).length?(u(),w(r,{key:1,ref_key:"categoriesAutocomplete",ref:F,modelValue:a(o).categories,"onUpdate:modelValue":[e[4]||(e[4]=t=>a(o).categories=t),e[5]||(e[5]=t=>k("categories",t))],options:a(h),"option-attribute":"name","value-attribute":"_id",placeholder:"Catégories",label:"Catégories",multiple:""},null,8,["modelValue","options"])):g("",!0),a(E).length?(u(),w(r,{key:2,ref_key:"citiesAutocomplete",ref:L,modelValue:a(o).cities,"onUpdate:modelValue":[e[6]||(e[6]=t=>a(o).cities=t),e[7]||(e[7]=t=>k("cities",t))],options:a(E),"option-attribute":"name","value-attribute":"name",placeholder:"Villes",label:"Villes",multiple:""},null,8,["modelValue","options"])):g("",!0),a(T).length?(u(),w(r,{key:3,ref_key:"tagsAutocomplete",ref:j,modelValue:a(o).tags,"onUpdate:modelValue":[e[8]||(e[8]=t=>a(o).tags=t),e[9]||(e[9]=t=>k("tags",t))],options:a(T),"option-attribute":"name","value-attribute":"name",placeholder:"Tags",label:"Tags",multiple:""},null,8,["modelValue","options"])):g("",!0)],512),[[le,a(H)]])]),n("div",ge,[e[15]||(e[15]=n("p",{class:"text-sm font-semibold mb-2"},"Fichier d'export",-1)),n("ul",_e,[(u(),_(I,null,N($,t=>n("li",{key:t.id},[R(n("input",{id:t.id,"onUpdate:modelValue":e[10]||(e[10]=y=>P(x)?x.value=y:null),type:"radio",value:t.id,class:"accent-primary"},null,8,be),[[O,a(x)]]),n("label",{for:t,class:"ml-3"},q(t.key),9,xe)])),64))])]),n("div",ke,[A(V,{onClick:e[11]||(e[11]=t=>a(x)==="pdf"?Z():Y())},{default:M(()=>[...e[16]||(e[16]=[re("Exporter",-1)])]),_:1})])])}}},we={class:"w-full cContainer-extra"},Ae={class:"flex"},Ce={__name:"index",setup(W){return(v,f)=>{const S=Ve,$=ae;return u(),_("div",we,[f[0]||(f[0]=n("div",{class:"flex"},[n("h1",{class:"p-0 font-bold text-2xl sm:text-4xl text-home-title-colo mb-4 mt-16"},"Agenda")],-1)),n("div",Ae,[A($,null,{default:M(()=>[A(S)]),_:1})])])}}};export{Ce 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.