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

2 lines
6.9 KiB
JavaScript

import{S as t,i as e,a as n,b as o,s as r,q as i,n as a,g as s,t as m,o as c,e as l,w as p,c as g,d,u as f,v as h,f as u,x as b,y as w}from"./index-5b685137.js";import{w as x}from"./index-8744cf8a.js";import{loadLocaleContent as y,getData as j}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as v,translate as k}from"../../../../../../../../../js/libraries/mapTools.js";import{addPartyPinContent as z}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function N(t,e,n){const o=t.slice();return o[12]=e[n][0],o[3]=e[n][1],o}function O(t,e,n){const o=t.slice();return o[15]=e[n],o}function T(t){let e,n,r,i,a,m,c,x,y,j,v,k,z,O,T,D,R,S,_,q,A=t[1].parties+"",C=t[1].p1+"",F=t[1].subheading1+"",H=t[1]["map-prompt"]+"",J=Object.entries(t[0]),K=[];for(let e=0;e<J.length;e+=1)K[e]=E(N(t,J,e));return{c(){e=l("div"),n=l("div"),r=l("h1"),i=p(A),a=g(),m=l("img"),x=g(),y=l("p"),j=p(C),v=g(),k=l("h3"),z=p(F),O=g(),T=l("map-component"),R=g(),S=l("p"),_=p(H),q=g();for(let t=0;t<K.length;t+=1)K[t].c();d(m,"id","party-img"),f(m.src,c="/img/common/parties.svg")||d(m,"src","/img/common/parties.svg"),d(m,"alt","party"),d(y,"class","description"),h(T,"id","map"),h(T,"callback",D=t[10]),d(S,"id","add-prompt"),d(n,"id","text-container"),d(e,"id","container")},m(t,s){o(t,e,s),u(e,n),u(n,r),u(r,i),u(n,a),u(n,m),u(n,x),u(n,y),u(y,j),u(n,v),u(n,k),u(k,z),u(n,O),u(n,T),u(n,R),u(n,S),u(S,_),u(n,q);for(let t=0;t<K.length;t+=1)K[t].m(n,null)},p(t,e){if(2&e&&A!==(A=t[1].parties+"")&&b(i,A),2&e&&C!==(C=t[1].p1+"")&&b(j,C),2&e&&F!==(F=t[1].subheading1+"")&&b(z,F),2&e&&D!==(D=t[10])&&h(T,"callback",D),2&e&&H!==(H=t[1]["map-prompt"]+"")&&b(_,H),771&e){let o;for(J=Object.entries(t[0]),o=0;o<J.length;o+=1){const r=N(t,J,o);K[o]?K[o].p(r,e):(K[o]=E(r),K[o].c(),K[o].m(n,null))}for(;o<K.length;o+=1)K[o].d(1);K.length=J.length}},d(t){t&&s(e),w(K,t)}}}function D(t){let e,n,r,i,a,m,c,f,h,w,x,y,j,v,k,z,N,O,T,D,E,R,S,_,q,A,C,F,H,J,K,L,M,Q,U,B,G,I,P,V,W,X,Y,Z,$,tt=t[1].name+"",et=t[15].name+"",nt=t[1].location+"",ot=t[9](t[15])+"",rt=t[1].website+"",it=t[15].website+"",at=t[1].contact+"",st=t[15].contact+"",mt=t[1].description+"",ct=t[15].description+"";return{c(){e=l("div"),n=l("div"),r=l("picture"),i=l("source"),m=g(),c=l("source"),h=g(),w=l("img"),x=g(),y=l("div"),j=l("p"),v=l("b"),k=p(tt),z=p(": "),N=p(et),O=g(),T=l("p"),D=l("b"),E=p(nt),R=p(": "),S=p(ot),_=g(),q=l("p"),A=l("b"),C=p(rt),F=p(": "),H=l("a"),J=p(it),L=g(),M=l("p"),Q=l("b"),U=p(at),B=p(": "),G=l("a"),I=p(st),V=g(),W=l("p"),X=l("b"),Y=p(mt),Z=p(": "),$=p(ct),d(i,"srcset",a="/img/parties/"+t[15].logo+".webp"),d(c,"srcset",f="/img/parties/"+t[15].logo+".jpg"),d(w,"class","party-logo"),d(w,"alt","logo"),d(H,"href",K=t[15].website),d(H,"target",";_blank;"),d(H,"rel","noreferrer"),d(G,"href",P=t[15].contact),d(G,"target",";_blank;"),d(G,"rel","noreferrer"),d(n,"class","img-general-info"),d(e,"class","location-info")},m(t,a){o(t,e,a),u(e,n),u(n,r),u(r,i),u(r,m),u(r,c),u(r,h),u(r,w),u(n,x),u(n,y),u(y,j),u(j,v),u(v,k),u(v,z),u(j,N),u(y,O),u(y,T),u(T,D),u(D,E),u(D,R),u(T,S),u(y,_),u(y,q),u(q,A),u(A,C),u(A,F),u(q,H),u(H,J),u(y,L),u(y,M),u(M,Q),u(Q,U),u(Q,B),u(M,G),u(G,I),u(e,V),u(e,W),u(W,X),u(X,Y),u(X,Z),u(W,$)},p(t,e){1&e&&a!==(a="/img/parties/"+t[15].logo+".webp")&&d(i,"srcset",a),1&e&&f!==(f="/img/parties/"+t[15].logo+".jpg")&&d(c,"srcset",f),2&e&&tt!==(tt=t[1].name+"")&&b(k,tt),1&e&&et!==(et=t[15].name+"")&&b(N,et),2&e&&nt!==(nt=t[1].location+"")&&b(E,nt),1&e&&ot!==(ot=t[9](t[15])+"")&&b(S,ot),2&e&&rt!==(rt=t[1].website+"")&&b(C,rt),1&e&&it!==(it=t[15].website+"")&&b(J,it),1&e&&K!==(K=t[15].website)&&d(H,"href",K),2&e&&at!==(at=t[1].contact+"")&&b(U,at),1&e&&st!==(st=t[15].contact+"")&&b(I,st),1&e&&P!==(P=t[15].contact)&&d(G,"href",P),2&e&&mt!==(mt=t[1].description+"")&&b(Y,mt),1&e&&ct!==(ct=t[15].description+"")&&b($,ct)},d(t){t&&s(e)}}}function E(t){let e,n,r,i,a,m=t[8](t[12])+"",c=t[3],f=[];for(let e=0;e<c.length;e+=1)f[e]=D(O(t,c,e));return{c(){e=l("h4"),n=p(m),r=g(),i=l("div");for(let t=0;t<f.length;t+=1)f[t].c();a=g(),d(e,"class","country-name"),d(i,"class","country-block")},m(t,s){o(t,e,s),u(e,n),o(t,r,s),o(t,i,s);for(let t=0;t<f.length;t+=1)f[t].m(i,null);u(i,a)},p(t,e){if(1&e&&m!==(m=t[8](t[12])+"")&&b(n,m),515&e){let n;for(c=t[3],n=0;n<c.length;n+=1){const o=O(t,c,n);f[n]?f[n].p(o,e):(f[n]=D(o),f[n].c(),f[n].m(i,a))}for(;n<f.length;n+=1)f[n].d(1);f.length=c.length}},d(t){t&&s(e),t&&s(r),t&&s(i),w(f,t)}}}function R(t){let e,n=3==t[2]&&T(t);return{c(){n&&n.c(),e=i()},m(t,r){n&&n.m(t,r),o(t,e,r)},p(t,o){3==t[2]?n?n.p(t,o):(n=T(t),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(t){n&&n.d(t),t&&s(e)}}}function S(t){let e,n=t[2],m=R(t);return{c(){m.c(),e=i(),this.c=a},m(t,n){m.m(t,n),o(t,e,n)},p(t,[o]){4&o&&r(n,n=t[2])?(m.d(1),m=R(t),m.c(),m.m(e.parentNode,e)):m.p(t,o)},i:a,o:a,d(t){t&&s(e),m.d(t)}}}function _(t,e,n){let o,r,i=x(0);m(t,i,(t=>n(2,r=t)));let a,s,l=x({});m(t,l,(t=>n(1,o=t)));let p=y(l,"parties-component",i);y(l,"countries",i);function g(t,e,n){let o=t([22,0],2);v(a,s,o,e,n,z,"gold")}j("/assets/parties.json",(t=>{n(3,a=JSON.parse(t)),n(0,s={});for(let t of a){let e=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),e in s?s[e].push(t):n(0,s[e]=[t],s)}i.update((t=>t+1))})),c((()=>{}));return[s,o,r,a,i,l,p,g,function(t){return"en"==p?t:k(o,t)},function(t){return[t.country,t.state,t.town].filter((t=>null!=t)).map((t=>"en"==p?t:k(o,t))).join(", ")},t=>g(t,o,p)]}class q extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.description{margin-bottom:1rem}#add-prompt{margin-bottom:2rem}#party-img{position:absolute;width:11.5rem;left:50%;transform:translate(-50%);z-index:0;opacity:0.2}#text-container>:nth-child(3){margin-top:8rem}h4{margin-bottom:2rem}.country-name{margin-bottom:1rem}.country-block{margin-bottom:2rem}.location-info{position:relative;margin-bottom:1rem}.location-info p{margin-bottom:0}.img-general-info{display:flex;align-content:center;width:100%;gap:1.5rem;align-items:center;margin-bottom:0.75rem}.img-general-info>:nth-child(2){flex:none}.party-logo{position:relative;right:0;max-height:6.5rem;max-width:100%;border-radius:1rem}a{color:#DD1C1A}#map{--height:30rem;--width:100%;--margin-bottom:0.5rem}#text-container{max-width:calc(100vw - 4rem);margin:auto}h1{margin-bottom:1rem;font-size:2.2rem;text-align:center}h3{margin-bottom:1rem}#container{margin:auto;max-width:800px;margin-top:1rem;margin-bottom:4rem}#container p{text-align:justify}@media only screen and (max-width: 500px){.img-general-info{display:flex;flex-direction:column;align-content:left;width:100%;gap:1rem;align-items:left;margin-bottom:0rem}.img-general-info>:nth-child(1){width:max-content}.img-general-info>:nth-child(2){width:100%}}</style>",e(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},_,S,r,{},null),t&&t.target&&o(t.target,this,t.anchor)}}customElements.define("parties-component",q);export{q as default};