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 h,v as f,f as u,x as b,y as w}from"./index-6e99513e.js";import{w as x}from"./index-3db98739.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,C,E,R,S,_,q=t[1].parties+"",A=t[1].p1+"",F=t[1].subheading1+"",G=t[1]["map-prompt"]+"",H=Object.entries(t[0]),J=[];for(let e=0;e<H.length;e+=1)J[e]=D(N(t,H,e));return{c(){e=l("div"),n=l("div"),r=l("h1"),i=p(q),a=g(),m=l("img"),x=g(),y=l("p"),j=p(A),v=g(),k=l("h3"),z=p(F),O=g(),T=l("map-component"),E=g(),R=l("p"),S=p(G),_=g();for(let t=0;t<J.length;t+=1)J[t].c();d(m,"id","party-img"),h(m.src,c="/img/common/parties.svg")||d(m,"src","/img/common/parties.svg"),d(m,"alt","party"),d(y,"class","description"),f(T,"id","map"),f(T,"callback",C=t[10]),d(R,"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,E),u(n,R),u(R,S),u(n,_);for(let t=0;t<J.length;t+=1)J[t].m(n,null)},p(t,e){if(2&e&&q!==(q=t[1].parties+"")&&b(i,q),2&e&&A!==(A=t[1].p1+"")&&b(j,A),2&e&&F!==(F=t[1].subheading1+"")&&b(z,F),2&e&&C!==(C=t[10])&&f(T,"callback",C),2&e&&G!==(G=t[1]["map-prompt"]+"")&&b(S,G),771&e){let o;for(H=Object.entries(t[0]),o=0;o<H.length;o+=1){const r=N(t,H,o);J[o]?J[o].p(r,e):(J[o]=D(r),J[o].c(),J[o].m(n,null))}for(;o<J.length;o+=1)J[o].d(1);J.length=H.length}},d(t){t&&s(e),w(J,t)}}}function C(t){let e,n,r,i,a,m,c,h,f,w,x,y,j,v,k,z,N,O,T,C,D,E,R,S,_,q,A,F,G,H,J,K,L,M,Q,U,B,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"),f=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"),C=l("b"),D=p(nt),E=p(": "),R=p(ot),S=g(),_=l("p"),q=l("b"),A=p(rt),F=p(": "),G=l("a"),H=p(it),K=g(),L=l("p"),M=l("b"),Q=p(at),U=p(": "),B=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",h="/img/parties/"+t[15].logo+".jpg"),d(w,"class","party-logo"),d(w,"alt","logo"),d(G,"href",J=t[15].website),d(G,"target",";_blank;"),d(G,"rel","noreferrer"),d(B,"href",P=t[15].contact),d(B,"target",";_blank;"),d(B,"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,f),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,C),u(C,D),u(C,E),u(T,R),u(y,S),u(y,_),u(_,q),u(q,A),u(q,F),u(_,G),u(G,H),u(y,K),u(y,L),u(L,M),u(M,Q),u(M,U),u(L,B),u(B,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&&h!==(h="/img/parties/"+t[15].logo+".jpg")&&d(c,"srcset",h),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(D,nt),1&e&&ot!==(ot=t[9](t[15])+"")&&b(R,ot),2&e&&rt!==(rt=t[1].website+"")&&b(A,rt),1&e&&it!==(it=t[15].website+"")&&b(H,it),1&e&&J!==(J=t[15].website)&&d(G,"href",J),2&e&&at!==(at=t[1].contact+"")&&b(Q,at),1&e&&st!==(st=t[15].contact+"")&&b(I,st),1&e&&P!==(P=t[15].contact)&&d(B,"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 D(t){let e,n,r,i,a,m=t[8](t[12])+"",c=t[3],h=[];for(let e=0;e<c.length;e+=1)h[e]=C(O(t,c,e));return{c(){e=l("h4"),n=p(m),r=g(),i=l("div");for(let t=0;t<h.length;t+=1)h[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<h.length;t+=1)h[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);h[n]?h[n].p(o,e):(h[n]=C(o),h[n].c(),h[n].m(i,a))}for(;n<h.length;n+=1)h[n].d(1);h.length=c.length}},d(t){t&&s(e),t&&s(r),t&&s(i),w(h,t)}}}function E(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 R(t){let e,n=t[2],m=E(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=E(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 S(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",{enableCountryGrouping:!0})}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 _ 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,r,{},null),t&&t.target&&o(t.target,this,t.anchor)}}customElements.define("parties-component",_);export{_ as default};