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,C,E,R,S,q,A=t[1].groups+"",F=t[1].p1+"",G=t[1].subheading1+"",H=t[1]["map-prompt"]+"",J=Object.entries(t[0]),K=[];for(let o=0;o<J.length;o+=1)K[o]=D(N(t,J,o));return{c(){o=l("div"),n=l("div"),r=l("h1"),s=p(A),a=u(),m=l("img"),x=u(),y=l("p"),v=p(F),w=u(),k=l("h3"),z=p(G),O=u(),T=l("map-component"),E=u(),R=l("p"),S=p(H),q=u();for(let t=0;t<K.length;t+=1)K[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",C=t[10]),g(R,"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,E),h(n,R),h(R,S),h(n,q);for(let t=0;t<K.length;t+=1)K[t].m(n,null)},p(t,o){if(2&o&&A!==(A=t[1].groups+"")&&b(s,A),2&o&&F!==(F=t[1].p1+"")&&b(v,F),2&o&&G!==(G=t[1].subheading1+"")&&b(z,G),2&o&&C!==(C=t[10])&&f(T,"callback",C),2&o&&H!==(H=t[1]["map-prompt"]+"")&&b(S,H),771&o){let e;for(J=Object.entries(t[0]),e=0;e<J.length;e+=1){const r=N(t,J,e);K[e]?K[e].p(r,o):(K[e]=D(r),K[e].c(),K[e].m(n,null))}for(;e<K.length;e+=1)K[e].d(1);K.length=J.length}},d(t){t&&i(o),j(K,t)}}}function C(t){let o,n,r,s,a,m,c,d,f,j,x,y,v,w,k,z,N,O,T,C,D=t[1].location+"",E=t[9](t[15])+"",R=t[1].members+"",S=t[15].members+"",q=t[1].contact+"",A=t[15].contact+"";return{c(){o=l("div"),n=l("p"),r=l("b"),s=p(D),a=p(": "),m=p(E),c=u(),d=l("p"),f=l("b"),j=p(R),x=p(": "),y=p(S),v=u(),w=l("p"),k=l("b"),z=p(q),N=p(": "),O=l("a"),T=p(A),g(O,"href",C=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&&D!==(D=t[1].location+"")&&b(s,D),1&o&&E!==(E=t[9](t[15])+"")&&b(m,E),2&o&&R!==(R=t[1].members+"")&&b(j,R),1&o&&S!==(S=t[15].members+"")&&b(y,S),2&o&&q!==(q=t[1].contact+"")&&b(z,q),1&o&&A!==(A=t[15].contact+"")&&b(T,A),1&o&&C!==(C=t[15].contact)&&g(O,"href",C)},d(t){t&&i(o)}}}function D(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]=C(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]=C(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 E(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 R(t){let o,n=t[2],m=E(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=E(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 S(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",{enableCountryGrouping:!0})}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 q 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},S,R,r,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("groups-component",q);export{q as default};
|