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

2 lines
5.2 KiB
JavaScript
Raw Normal View History

2023-07-22 17:22:35 +07:00
import{S as t,i as o,a as n,b as e,s as r,e as s,n as a,d as i,c as m,o as c,f as l,t as p,g as u,h as g,j as d,k as f,l as h,m as b,p as j}from"./index-4348483d.js";import{w as x}from"./index-71440b21.js";import{addMarkersGroups as y,translate as v}from"../../../../../../../../../js/groups.js";import{loadLocaleContent as w,getData as k}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function z(t,o,n){const e=t.slice();return e[12]=o[n][0],e[3]=o[n][1],e}function N(t,o,n){const e=t.slice();return e[15]=o[n],e}function O(t){let o,n,r,s,a,m,c,x,y,v,w,k,N,O,D,R,S,T,A,C,H=t[1].groups+"",J=t[1].p1+"",K=t[1].subheading1+"",L=t[1]["map-prompt"]+"",M=Object.entries(t[0]),Q=[];for(let o=0;o<M.length;o+=1)Q[o]=E(z(t,M,o));return{c(){o=l("div"),n=l("div"),r=l("h1"),s=p(H),a=u(),m=l("img"),x=u(),y=l("p"),v=p(J),w=u(),k=l("h3"),N=p(K),O=u(),D=l("map-component"),S=u(),T=l("p"),A=p(L),C=u();for(let t=0;t<Q.length;t+=1)Q[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(D,"id","map"),f(D,"callback",R=t[10]),g(T,"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,N),h(n,O),h(n,D),h(n,S),h(n,T),h(T,A),h(n,C);for(let t=0;t<Q.length;t+=1)Q[t].m(n,null)},p(t,o){if(2&o&&H!==(H=t[1].groups+"")&&b(s,H),2&o&&J!==(J=t[1].p1+"")&&b(v,J),2&o&&K!==(K=t[1].subheading1+"")&&b(N,K),2&o&&R!==(R=t[10])&&f(D,"callback",R),2&o&&L!==(L=t[1]["map-prompt"]+"")&&b(A,L),771&o){let e;for(M=Object.entries(t[0]),e=0;e<M.length;e+=1){const r=z(t,M,e);Q[e]?Q[e].p(r,o):(Q[e]=E(r),Q[e].c(),Q[e].m(n,null))}for(;e<Q.length;e+=1)Q[e].d(1);Q.length=M.length}},d(t){t&&i(o),j(Q,t)}}}function D(t){let o,n,r,s,a,m,c,d,f,j,x,y,v,w,k,z,N,O,D,E,R=t[1].location+"",S=t[9](t[15])+"",T=t[1].members+"",A=t[15].members+"",C=t[1].contact+"",H=t[15].contact+"";return{c(){o=l("div"),n=l("p"),r=l("b"),s=p(R),a=p(": "),m=p(S),c=u(),d=l("p"),f=l("b"),j=p(T),x=p(": "),y=p(A),v=u(),w=l("p"),k=l("b"),z=p(C),N=p(": "),O=l("a"),D=p(H),g(O,"href",E=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,D)},p(t,o){2&o&&R!==(R=t[1].location+"")&&b(s,R),1&o&&S!==(S=t[9](t[15])+"")&&b(m,S),2&o&&T!==(T=t[1].members+"")&&b(j,T),1&o&&A!==(A=t[15].members+"")&&b(y,A),2&o&&C!==(C=t[1].contact+"")&&b(z,C),1&o&&H!==(H=t[15].contact+"")&&b(D,H),1&o&&E!==(E=t[15].contact)&&g(O,"href",E)},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(N(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=N(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]&&O(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=O(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 T(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=w(l,"groups-component",s);w(l,"countries",s);function u(t,o,n){let e=t([22,0],2);y(a,i,e,o,n)}k("/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(