2 lines
5.3 KiB
JavaScript
2 lines
5.3 KiB
JavaScript
import{S as t,i as o,a as n,b as e,s as r,q as s,n as a,g as i,t as m,o as c,e as l,w as p,c as u,d as g,u as d,v as f,f as h,x as b,y as j}from"./index-5b685137.js";import{w as x}from"./index-8744cf8a.js";import{loadLocaleContent as y,getData as v}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as w,translate as k}from"../../../../../../../../../js/libraries/mapTools.js";import{addGroupPinContent as z}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function N(t,o,n){const e=t.slice();return e[12]=o[n][0],e[3]=o[n][1],e}function O(t,o,n){const e=t.slice();return e[15]=o[n],e}function T(t){let o,n,r,s,a,m,c,x,y,v,w,k,z,O,T,D,R,S,q,A,C=t[1].groups+"",F=t[1].p1+"",H=t[1].subheading1+"",J=t[1]["map-prompt"]+"",K=Object.entries(t[0]),L=[];for(let o=0;o<K.length;o+=1)L[o]=E(N(t,K,o));return{c(){o=l("div"),n=l("div"),r=l("h1"),s=p(C),a=u(),m=l("img"),x=u(),y=l("p"),v=p(F),w=u(),k=l("h3"),z=p(H),O=u(),T=l("map-component"),R=u(),S=l("p"),q=p(J),A=u();for(let t=0;t<L.length;t+=1)L[t].c();g(m,"id","groups-img"),d(m.src,c="/img/common/groups.svg")||g(m,"src","/img/common/groups.svg"),g(m,"alt","groups"),g(y,"class","description"),f(T,"id","map"),f(T,"callback",D=t[10]),g(S,"id","add-prompt"),g(n,"id","text-container"),g(o,"id","container")},m(t,i){e(t,o,i),h(o,n),h(n,r),h(r,s),h(n,a),h(n,m),h(n,x),h(n,y),h(y,v),h(n,w),h(n,k),h(k,z),h(n,O),h(n,T),h(n,R),h(n,S),h(S,q),h(n,A);for(let t=0;t<L.length;t+=1)L[t].m(n,null)},p(t,o){if(2&o&&C!==(C=t[1].groups+"")&&b(s,C),2&o&&F!==(F=t[1].p1+"")&&b(v,F),2&o&&H!==(H=t[1].subheading1+"")&&b(z,H),2&o&&D!==(D=t[10])&&f(T,"callback",D),2&o&&J!==(J=t[1]["map-prompt"]+"")&&b(q,J),771&o){let e;for(K=Object.entries(t[0]),e=0;e<K.length;e+=1){const r=N(t,K,e);L[e]?L[e].p(r,o):(L[e]=E(r),L[e].c(),L[e].m(n,null))}for(;e<L.length;e+=1)L[e].d(1);L.length=K.length}},d(t){t&&i(o),j(L,t)}}}function D(t){let o,n,r,s,a,m,c,d,f,j,x,y,v,w,k,z,N,O,T,D,E=t[1].location+"",R=t[9](t[15])+"",S=t[1].members+"",q=t[15].members+"",A=t[1].contact+"",C=t[15].contact+"";return{c(){o=l("div"),n=l("p"),r=l("b"),s=p(E),a=p(": "),m=p(R),c=u(),d=l("p"),f=l("b"),j=p(S),x=p(": "),y=p(q),v=u(),w=l("p"),k=l("b"),z=p(A),N=p(": "),O=l("a"),T=p(C),g(O,"href",D=t[15].contact),g(O,"target",";_blank;"),g(O,"rel","noreferrer"),g(o,"class","location-info")},m(t,i){e(t,o,i),h(o,n),h(n,r),h(r,s),h(r,a),h(n,m),h(o,c),h(o,d),h(d,f),h(f,j),h(f,x),h(d,y),h(o,v),h(o,w),h(w,k),h(k,z),h(k,N),h(w,O),h(O,T)},p(t,o){2&o&&E!==(E=t[1].location+"")&&b(s,E),1&o&&R!==(R=t[9](t[15])+"")&&b(m,R),2&o&&S!==(S=t[1].members+"")&&b(j,S),1&o&&q!==(q=t[15].members+"")&&b(y,q),2&o&&A!==(A=t[1].contact+"")&&b(z,A),1&o&&C!==(C=t[15].contact+"")&&b(T,C),1&o&&D!==(D=t[15].contact)&&g(O,"href",D)},d(t){t&&i(o)}}}function E(t){let o,n,r,s,a,m=t[8](t[12])+"",c=t[3],d=[];for(let o=0;o<c.length;o+=1)d[o]=D(O(t,c,o));return{c(){o=l("h4"),n=p(m),r=u(),s=l("div");for(let t=0;t<d.length;t+=1)d[t].c();a=u(),g(o,"class","country-name"),g(s,"class","country-block")},m(t,i){e(t,o,i),h(o,n),e(t,r,i),e(t,s,i);for(let t=0;t<d.length;t+=1)d[t].m(s,null);h(s,a)},p(t,o){if(1&o&&m!==(m=t[8](t[12])+"")&&b(n,m),515&o){let n;for(c=t[3],n=0;n<c.length;n+=1){const e=O(t,c,n);d[n]?d[n].p(e,o):(d[n]=D(e),d[n].c(),d[n].m(s,a))}for(;n<d.length;n+=1)d[n].d(1);d.length=c.length}},d(t){t&&i(o),t&&i(r),t&&i(s),j(d,t)}}}function R(t){let o,n=3==t[2]&&T(t);return{c(){n&&n.c(),o=s()},m(t,r){n&&n.m(t,r),e(t,o,r)},p(t,e){3==t[2]?n?n.p(t,e):(n=T(t),n.c(),n.m(o.parentNode,o)):n&&(n.d(1),n=null)},d(t){n&&n.d(t),t&&i(o)}}}function S(t){let o,n=t[2],m=R(t);return{c(){m.c(),o=s(),this.c=a},m(t,n){m.m(t,n),e(t,o,n)},p(t,[e]){4&e&&r(n,n=t[2])?(m.d(1),m=R(t),m.c(),m.m(o.parentNode,o)):m.p(t,e)},i:a,o:a,d(t){t&&i(o),m.d(t)}}}function q(t,o,n){let e,r,s=x(0);m(t,s,(t=>n(2,r=t)));let a,i,l=x({});m(t,l,(t=>n(1,e=t)));let p=y(l,"groups-component",s);y(l,"countries",s);function u(t,o,n){let e=t([22,0],2);w(a,i,e,o,n,z,"green")}v("/assets/groups.json",(t=>{n(3,a=JSON.parse(t)),n(0,i={});for(let t of a){let o=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),o in i?i[o].push(t):n(0,i[o]=[t],i)}s.update((t=>t+1))})),c((()=>{}));return[i,e,r,a,s,l,p,u,function(t){return"en"==p?t:k(e,t)},function(t){return[t.country,t.state,t.town].filter((t=>null!=t)).map((t=>"en"==p?t:k(e,t))).join(", ")},t=>u(t,e,p)]}class A extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.description{margin-bottom:1rem}#add-prompt{margin-bottom:2rem}#groups-img{position:absolute;width:14rem;left:50%;transform:translate(-50%);z-index:0;opacity:0.2}#text-container>:nth-child(3){margin-top:8rem}.country-name{margin-bottom:0.5rem}.country-block{margin-bottom:2rem}.location-info{margin-bottom:0.75rem}.location-info p{margin-bottom:0}a{color:#DD1C1A}#map{--height:30rem;--width:100%;--margin-bottom:0.5rem}#text-container{position:relative;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}</style>",o(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},q,S,r,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("groups-component",A);export{A as default};
|