1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CInZzNoh.js","./Cu_WUodE.js","./entry.CCbJ4Qkl.css","./B7bDkzTY.js","./Bbiqjs46.js","./B6ZIr0m5.js","./strip.CjNV33-U.css","./photoswipe.383rE5Ak.css"])))=>i.map(i=>d[i]); 2import{_ as ee}from"./iemJtmaW.js";import{_ as te}from"./BaznBJYV.js";import{_ as oe}from"./CfxyrzU0.js";import{_ as se}from"./ugkiJrzT.js";import{_ as ne}from"./DwA4r_-F.js";import{aP as z,aG as h,aH as r,b2 as ae,b3 as ie,b0 as v,aI as i,aK as $,aL as V,aM as G,aJ as b,aN as le,aY as t,aR as U,bL as re,b5 as de,b8 as w,aQ as ce,aU as P,bo as F,aT as ue,bg as me,bM as H,aW as M,bp as pe,a_ as fe,bh as _e,bG as be,bD as ve,bE as he,bF as ge,br as Y,aS as $e}from"#entry";import{c as ye}from"./B7bDkzTY.js";import{m as T}from"./B6ZIr0m5.js";import"./CXLT4pWx.js";import"./lih_3xeR.js";try{(function(){var d=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},c=new d.Error().stack;c&&(d._sentryDebugIds=d._sentryDebugIds||{},d._sentryDebugIds[c]="e3e92036-23c7-481d-9fe1-1062a4f2c6c5",d._sentryDebugIdIdentifier="sentry-dbid-e3e92036-23c7-481d-9fe1-1062a4f2c6c5")})()}catch{}const xe=ye("components/submission/strip.vue",()=>re(()=>import("./CInZzNoh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7]),import.meta.url).then(d=>d.default||d)),ke={key:0},we={class:"flex flex-col md:flex-row"},Be={class:"text-xs"},De={class:"text-xs md:pl-1"},Re={class:"text-xs md:pl-1"},Ae=z({__name:"strips",props:{cid:{},oid:{},entries:{},roundsPhotoIds:{}},setup(d){const c=d;return(s,u)=>{const g=le,L=xe;return r(),h("div",null,[(r(!0),h(ae,null,ie(c.entries,(l,m)=>(r(),h("div",{key:m},[l.submitterName?(r(),h("div",ke,[i("div",null,[$(g,{to:`/org/${c.oid}/${c.cid}/entries/${l.eid}`,class:"font-semibold text-xl mt-4 mb-1 block capitalize"},{default:V(()=>[G(b(m+1)+". "+b(l.submitterName?.first)+" "+b(l.submitterName.last),1)]),_:2},1032,["to"])]),i("div",we,[i("div",Be,b(l.submitterDateOfBirth?`Date of birth: ${("makeTimestampHumanReadable"in s?s.makeTimestampHumanReadable:t(T))(l.submitterDateOfBirth)}, `:""),1),i("div",De,b(l.createdAt?`Created at: ${("makeTimestampHumanReadable"in s?s.makeTimestampHumanReadable:t(T))(l.createdAt)}, `:""),1),i("div",Re,b(l.uid),1)])])):v("",!0),i("div",null,[(r(),U(L,{"hydrate-on-visible":"",key:l.photos?.join("-")||m,cid:c.cid,eid:l.eid,oid:c.oid,roundsPhotoIds:s.roundsPhotoIds},null,8,["cid","eid","oid","roundsPhotoIds"]))])]))),128))])}}}),Ie=Object.assign(Ae,{__name:"SubmissionStrips"}),Ve={key:0,class:"text-2xl mb-2"},Ue={class:"controls my-4 flex flex-col md:flex-row md:justify-start md:items-top"},Oe={class:"filters age"},Ne={key:1,class:"filters round"},Pe={class:"flex space-between mb-2 justify-between"},Le={class:"flex items-center"},Se={key:0,class:"flex"},Ce={class:"pl-4"},qe=z({__name:"index",setup(d){const c=de(),s=w(()=>{const o=c.params.cid;return Array.isArray(o)?o[0]:o??""}),u=w(()=>{const o=c.params.oid;return Array.isArray(o)?o[0]:o??""}),g=ce(),L=P(g,`competitions/${s.value}/entries`),l=w(()=>ve(L,ge("photos","!=",null),he("createdAt","desc"))),m=F(l),Q=P(g,`competitions/${s.value}/rounds`),f=F(Q),q=ue(g,`competitions/${s.value}`),O=me(q),J=P(g,`competitions/${s.value}/submitters`),N=F(J);async function E(o){if(o.length===0)return[];async function e(a){const p=P(g,`competitions/${s.value}/rounds/${a}/photos`);return(await be(p)).docs.map(R=>R.id)}let n={};for(const a of o){const p=await e(a);n[a]=p}return n}const K=[{label:"Dashboard",to:`/org/${u.value}/${s.value}/`},{label:"Entries",to:`/org/${u.value}/${s.value}/entries`}],W=w(()=>[{label:"All",value:"all"},{label:"Aged Under 12",value:"agedUnder12"},{label:"Aged Over 12",value:"agedOver12"}]),B=H(`org-${u.value}-${s.value}-entries-filterByAge`,()=>"all"),X=w(()=>{const o=f.value?.map(e=>({label:e.name||e.rid,value:e.rid}))||[];return[{label:"All",value:"all"},...o]}),y=H(`org-${u.value}-${s.value}-entries-filterByRound`,()=>"all");M({});const D=M({}),j=w(()=>{let o=m.value||[];if(B.value==="agedUnder12"){const e=new Date;e.setFullYear(e.getFullYear()-13),o=o.filter(n=>{const a=n.submitterDateOfBirth;return!!a&&a.toDate()>e})}else if(B.value==="agedOver12"){const e=new Date;e.setFullYear(e.getFullYear()-13),o=o.filter(n=>{const a=n.submitterDateOfBirth;return!a||a.toDate()<=e})}if(y.value&&y.value!=="all"){const e=D.value[y.value]||[];o=o.filter(n=>(console.log("entry.photos:",n.photos,"pidsForRound:",e),console.log("is it here?",n.photos?.some(a=>e.includes(a))),n.photos?.some(a=>e.includes(a))))}return o.sort((e,n)=>{const a=e.createdAt?e.createdAt.toMillis():0;return(n.createdAt?n.createdAt.toMillis():0)-a}),o});pe(f,async o=>{if(o&&o.length>0&&Object.keys(D.value).length===0){const e=o.map(n=>n.rid);D.value=await E(e)}},{immediate:!0});function Z(){if(console.log("submitters:",N.value),!N.value||N.value.length===0){alert("No submitters available to download.");return}const o="UID,First Name,Last Name,Telephone,Date of Birth",e=N.value.map(_=>{const R=_.name?.first??"",S=_.name?.last??"",C=_.telephone??"",k=_.dateOfBirth?T(_.dateOfBirth):"",A=I=>I.includes(",")||I.includes('"')||I.includes(` 3`)?`"${I.replace(/"/g,'""')}"`:I;return`${A(_.uid)},${A(R)},${A(S)},${A(C)},${A(k)}`}).join(` 4`),n=`${o} 5${e}`,a=new Blob([n],{type:"text/csv;charset=utf-8;"}),p=window.URL.createObjectURL(a),x=document.createElement("a");x.href=p,x.download=`${O.value?.name||"competition"}_entrants_contacts.csv`,x.click(),window.URL.revokeObjectURL(p)}return fe(async()=>
5{if(console.log("mounted:",m.value),f.value&&f.value.length>0){const o=f.value.map(e=>e.rid);D.value=await E(o)}}),(o,e)=>{const n=ee,a=te,p=oe,x=se,_=ne,R=$e,S=Ie,C=_e;return r(),h("div",null,[$(C,{name:"organisation"},{navigationMobile:V(()=>[t(s)&&t(u)?(r(),U(n,{key:0,cid:t(s),oid:t(u)},null,8,["cid","oid"])):v("",!0)]),navigationDesktop:V(()=>[t(s)&&t(u)?(r(),U(n,{key:0,cid:t(s),oid:t(u)},null,8,["cid","oid"])):v("",!0)]),default:V(()=>[t(O)&&t(O).name?(r(),h("h1",Ve,b(t(O).name),1)):v("",!0),i("div",null,[$(a,{items:K})]),i("div",Ue,[i("div",Oe,[e[3]||(e[3]=i("div",{class:"font-semibold uppercase"},"Filter by Age",-1)),$(p,{modelValue:t(B),"onUpdate:modelValue":e[0]||(e[0]=k=>Y(B)?B.value=k:null),items:t(W)},null,8,["modelValue","items"])]),t(f)&&t(f).length>0?(r(),U(x,{key:0,orientation:"vertical",class:"h-24 px-12 opacity-98",color:"neutral"})):v("",!0),t(f)&&t(f).length>0?(r(),h("div",Ne,[e[4]||(e[4]=i("div",{class:"font-semibold uppercase"},"Filter by Round",-1)),$(p,{modelValue:t(y),"onUpdate:modelValue":e[1]||(e[1]=k=>Y(y)?y.value=k:null),items:t(X)},null,8,["modelValue","items"])])):v("",!0)]),i("div",Pe,[i("div",Le,[e[5]||(e[5]=i("div",{class:"pb-0 pr-2 text-4xl font-thin ml-3 md:ml-0 inline-block"}," Entries ",-1)),t(m)&&t(m).length>0?(r(),h("div",Se,[$(_,{color:"neutral"},{default:V(()=>[G(b(t(m)?.length||0),1)]),_:1}),i("span",Ce,"Showing: "+b(t(j).length),1)])):v("",!0)]),i("div",null,[$(R,{label:"Download CSV",color:"neutral",class:"cursor-pointer",onClick:e[2]||(e[2]=k=>Z())})])]),t(s)&&t(u)&&t(m)&&t(m).length>0?(r(),U(S,{key:1,cid:t(s),oid:t(u),entries:t(j),roundsPhotoIds:t(D)},null,8,["cid","oid","entries","roundsPhotoIds"])):v("",!0)]),_:1})])}}});export{qe 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.