site-libsoc/Server/public/js/components/landing-component.js

2 lines
7.0 KiB
JavaScript

import{S as t,i as e,a as o,b as i,s as r,q as s,n,g as a,t as m,o as c,j as p,e as g,c as d,w as l,d as u,u as h,z as f,v,f as x,x as w}from"./index-5b685137.js";import{w as b}from"./index-8744cf8a.js";import{getData as T,loadLocaleContent as j}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as k}from"../../../../../../../../../js/libraries/mapTools.js";import{addGroupPinContent as y,addCommunePinContent as U,addCoopPinContent as z,addPartyPinContent as N}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function C(t){let e,o,r,s,n,m,c,p,b,T,j,k,y,U,z,N,C,F,L,A,E,H,K,M,Q,R,S,W,q,B,D,G,J,O,_,I,P,V,X,Y,Z,$,tt,et,ot,it,rt,st,nt,at,mt,ct,pt,gt,dt,lt,ut,ht,ft,vt,xt,wt,bt,Tt,jt,kt,yt,Ut=t[3].top+"",zt=t[3].groupsTitle+"",Nt=t[3].groupsText+"",Ct=t[3].partiesTitle+"",Ft=t[3].partiesText+"",Lt=t[3].cooperativesTitle+"",At=t[3].cooperativesText+"",Et=t[3].communesTitle+"",Ht=t[3].communesText+"",Kt=t[3].findUs+"",Mt=t[3].whatNow+"",Qt=t[3].joinUs+"",Rt=t[3].talkWithUs+"";return{c(){e=g("div"),o=g("picture"),o.innerHTML='<source srcset="/img/crowd.webp"/> \n <source srcset="/img/crowd.png"/> \n <img id="crowd" alt="crowd"/>',r=d(),s=g("div"),n=g("p"),m=l(Ut),c=d(),p=g("div"),b=g("div"),T=g("a"),j=g("h2"),k=l(zt),y=d(),U=g("img"),N=d(),C=g("p"),F=l(Nt),L=d(),A=g("div"),E=g("a"),H=g("h2"),K=l(Ct),M=d(),Q=g("img"),S=d(),W=g("p"),q=l(Ft),B=d(),D=g("div"),G=g("a"),J=g("h2"),O=l(Lt),_=d(),I=g("img"),V=d(),X=g("p"),Y=l(At),Z=d(),$=g("div"),tt=g("a"),et=g("h2"),ot=l(Et),it=d(),rt=g("img"),nt=d(),at=g("p"),mt=l(Ht),ct=d(),pt=g("h1"),gt=l(Kt),dt=d(),lt=g("map-component"),ht=d(),ft=g("h1"),vt=l(Mt),xt=d(),wt=g("div"),bt=g("a"),Tt=l(Qt),jt=d(),kt=g("a"),yt=l(Rt),u(T,"href","/"+t[6]+"/groups"),u(U,"id","groups-img"),h(U.src,z="/img/common/groups.svg")||u(U,"src","/img/common/groups.svg"),u(U,"alt","groups"),u(E,"href","/"+t[6]+"/parties"),u(Q,"id","parties-img"),h(Q.src,R="/img/common/parties.svg")||u(Q,"src","/img/common/parties.svg"),u(Q,"alt","coops"),u(G,"href","/"+t[6]+"/coops"),u(I,"id","coops-img"),h(I.src,P="/img/common/coops.svg")||u(I,"src","/img/common/coops.svg"),u(I,"alt","coops"),u(tt,"href","/"+t[6]+"/communes"),u(rt,"id","communes-img"),h(rt.src,st="/img/common/communes.svg")||u(rt,"src","/img/common/communes.svg"),u(rt,"alt","communes"),u(p,"id","container-grid"),f(p,"--grid-width",t[1]),u(pt,"id","find-us"),v(lt,"id","map"),v(lt,"callback",ut=t[9]),v(lt,"colors",["#23AC20","#CA2437","#217BC9","#FFD326"]),u(bt,"class","link-button"),u(bt,"href","/"+t[6]+"/join-us"),u(kt,"class","link-button"),u(kt,"href","https://discord.gg/Qk8KUk787z"),u(kt,"target","_blank"),u(kt,"rel","noreferrer"),u(wt,"id","action-container"),u(s,"id","text-container"),u(e,"id","container")},m(a,g){i(a,e,g),x(e,o),x(e,r),x(e,s),x(s,n),x(n,m),x(s,c),x(s,p),x(p,b),x(b,T),x(T,j),x(j,k),x(b,y),x(b,U),x(b,N),x(b,C),x(C,F),x(p,L),x(p,A),x(A,E),x(E,H),x(H,K),x(A,M),x(A,Q),x(A,S),x(A,W),x(W,q),x(p,B),x(p,D),x(D,G),x(G,J),x(J,O),x(D,_),x(D,I),x(D,V),x(D,X),x(X,Y),x(p,Z),x(p,$),x($,tt),x(tt,et),x(et,ot),x($,it),x($,rt),x($,nt),x($,at),x(at,mt),t[8](p),x(s,ct),x(s,pt),x(pt,gt),x(s,dt),x(s,lt),x(s,ht),x(s,ft),x(ft,vt),x(s,xt),x(s,wt),x(wt,bt),x(bt,Tt),x(wt,jt),x(wt,kt),x(kt,yt)},p(t,e){8&e&&Ut!==(Ut=t[3].top+"")&&w(m,Ut),8&e&&zt!==(zt=t[3].groupsTitle+"")&&w(k,zt),8&e&&Nt!==(Nt=t[3].groupsText+"")&&w(F,Nt),8&e&&Ct!==(Ct=t[3].partiesTitle+"")&&w(K,Ct),8&e&&Ft!==(Ft=t[3].partiesText+"")&&w(q,Ft),8&e&&Lt!==(Lt=t[3].cooperativesTitle+"")&&w(O,Lt),8&e&&At!==(At=t[3].cooperativesText+"")&&w(Y,At),8&e&&Et!==(Et=t[3].communesTitle+"")&&w(ot,Et),8&e&&Ht!==(Ht=t[3].communesText+"")&&w(mt,Ht),2&e&&f(p,"--grid-width",t[1]),8&e&&Kt!==(Kt=t[3].findUs+"")&&w(gt,Kt),8&e&&ut!==(ut=t[9])&&v(lt,"callback",ut),8&e&&Mt!==(Mt=t[3].whatNow+"")&&w(vt,Mt),8&e&&Qt!==(Qt=t[3].joinUs+"")&&w(Tt,Qt),8&e&&Rt!==(Rt=t[3].talkWithUs+"")&&w(yt,Rt)},d(o){o&&a(e),t[8](null)}}}function F(t){let e,o=10==t[2]&&C(t);return{c(){o&&o.c(),e=s()},m(t,r){o&&o.m(t,r),i(t,e,r)},p(t,i){10==t[2]?o?o.p(t,i):(o=C(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(t){o&&o.d(t),t&&a(e)}}}function A(t){let e,o=t[2],m=F(t);return{c(){m.c(),e=s(),this.c=n},m(t,o){m.m(t,o),i(t,e,o)},p(t,[i]){4&i&&r(o,o=t[2])?(m.d(1),m=F(t),m.c(),m.m(e.parentNode,e)):m.p(t,i)},i:n,o:n,d(t){t&&a(e),m.d(t)}}}function E(t,e,o){let i,r,s,n,a=b(0);m(t,a,(t=>o(2,i=t)));let g=b({});m(t,g,(t=>o(3,r=t)));let d={},l={};function u(t){o(1,n="1fr 1fr")}let h=(t,e)=>{d[e]=JSON.parse(t),l[e]={};for(let t of d[e]){let o=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),o in l[e]?l[e][o].push(t):l[e][o]=[t]}a.update((t=>t+1))};T("/assets/groups.json",(t=>h(t,"groups"))),T("/assets/communes.json",(t=>h(t,"communes"))),T("/assets/cooperatives.json",(t=>h(t,"cooperatives"))),T("/assets/parties.json",(t=>h(t,"parties"))),j(g,"groups-component",a),j(g,"communes-component",a),j(g,"cooperatives-component",a),j(g,"parties-component",a),j(g,"countries",a);let f=j(g,"landing-component",a,u);function v(t,e,o){let i=t([22,0],2),r={enableCountryGrouping:!0},s=k(d.groups,l.groups,i,e,o,y,"green",r),n=k(d.communes,l.communes,i,e,o,U,"red",r),a=k(d.cooperatives,l.cooperatives,i,e,o,z,"blue",r),m=k(d.parties,l.parties,i,e,o,N,"gold",r),c={};c[e.groups]=s,c[e.communes]=n,c[e.cooperatives]=a,c[e.parties]=m,L.control.layers(null,c).addTo(i)}u(),c((()=>{}));return[s,n,i,r,a,g,f,v,function(t){p[t?"unshift":"push"]((()=>{s=t,o(0,s)}))},t=>v(t,r,f)]}class H extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';#action-container{display:flex;justify-content:space-between;margin:auto;margin-top:2rem;max-width:34rem}.link-button{display:inline-block;font-size:1.6rem;font-family:var(--sans-serif,sans-serif);width:14rem;line-height:4rem;background:var(--red);color:white;text-align:center}#map{--margin-top:1rem;--height:30rem;--width:100%;--margin-bottom:3rem}h1{font-size:2rem;text-align:center;margin-bottom:1rem}#container-grid>div>a>h2{text-align:center}#groups-img,#communes-img,#coops-img,#parties-img{position:absolute;left:50%;transform:translate(-50%);z-index:0;opacity:0.2;height:8rem}#coops-img{margin-top:0.5rem;height:7.5rem}#text-container{max-width:calc(100vw - 4rem);margin:auto}#crowd{width:100%;margin-bottom:2rem}#container{margin:auto;max-width:800px;margin-top:2rem;margin-bottom:5rem}#container>div>p{margin-bottom:1rem}#container p{text-align:justify}#container-grid{display:grid;grid-template-columns:var(--grid-width);grid-template-rows:var(--grid-width);grid-gap:4rem;row-gap:2.5rem;margin-top:2rem;margin-bottom:1rem}#container-grid>div{position:relative}#container-grid>div>p{position:relative;margin-top:5rem;z-index:2}@media only screen and (max-width: 1060px){#container-grid{display:flex;flex-direction:column;gap:2rem}#action-container{flex-direction:column;align-items:center;gap:2.5rem}#container-grid>:nth-child(2){height:calc(100% - 2rem)}}</style>",e(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},E,A,r,{},null),t&&t.target&&i(t.target,this,t.anchor)}}customElements.define("landing-component",H);export{H as default};