2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{S as t,i as e,a as n,b as i,s,q as o,n as l,g as r,t as a,m as u,o as c,j as p,e as d,c as f,w as m,d as h,z as g,f as v,A as b,l as y,p as x,x as w,r as k,y as j}from"./index-5b685137.js";import{w as C}from"./index-8744cf8a.js";import{getData as z,sendData as E}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/select-component.js";import"../../../../../../../../../js/components/switch-component.js";function T(t,e,n){const i=t.slice();return i[62]=e[n],i[64]=n,i}function q(t){let e,n,o,l,a,u,c,p,j,C,z,E,T,q,A,M,G,I,N,H,S,_,U,F,J,K,Q,B,D,P,V,W,X,Y,Z,$,tt,et,nt,it,st,ot,lt,rt,at,ut,ct,pt,dt,ft,mt,ht,gt=t[1],vt=L(t);return{c(){e=d("div"),n=d("h2"),n.textContent="Groups",o=f(),l=d("div"),a=d("h3"),a.textContent="My group",u=f(),c=d("span"),p=f(),j=d("section"),C=d("div"),z=d("div"),E=d("span"),E.textContent="Location:",T=f(),q=d("div"),A=d("button"),M=m(t[10]),G=f(),I=d("object"),N=f(),H=d("div"),S=d("div"),_=d("span"),_.textContent="Members:",U=f(),F=d("div"),J=d("div"),K=d("button"),K.textContent="save",Q=f(),B=d("input"),D=f(),P=d("button"),V=d("object"),W=f(),X=d("div"),Y=d("div"),Z=d("span"),Z.textContent="Contact:",$=f(),tt=d("div"),et=d("div"),nt=d("button"),nt.textContent="save",it=f(),st=d("input"),ot=f(),lt=d("button"),rt=d("object"),at=f(),ut=d("h3"),ut.textContent="Requests",ct=f(),pt=d("section"),vt.c(),dt=f(),ft=d("groups-add-component"),h(a,"class","group-heading"),h(c,"class","status"),h(I,"type","image/svg+xml"),h(I,"data","/img/profile/icons/pencil.svg"),h(I,"title","pencil-icon"),h(I,"class","pencil"),h(A,"class","change-field-button"),h(q,"class","change-field-div"),h(z,"class","change-field-line"),h(K,"class","save-button"),g(K,"display","none"),h(J,"class","save-button-wrapper"),h(B,"id","membersInput"),h(B,"class","text-input"),h(B,"type","text"),h(V,"type","image/svg+xml"),h(V,"data","/img/profile/icons/pencil.svg"),h(V,"title","pencil-icon"),h(V,"class","pencil"),h(P,"class","text-input-pencil-button"),h(F,"class","change-field-div input-pencil"),h(S,"class","change-field-line"),h(nt,"class","save-button"),g(nt,"display","none"),h(et,"class","save-button-wrapper"),h(st,"id","contactInput"),h(st,"class","text-input"),h(st,"type","text"),h(rt,"type","image/svg+xml"),h(rt,"data","/img/profile/icons/pencil.svg"),h(rt,"title","pencil-icon"),h(rt,"class","pencil"),h(lt,"class","text-input-pencil-button"),h(tt,"class","change-field-div input-pencil"),h(Y,"class","change-field-line"),h(j,"class","entries-section"),h(pt,"class","entries-section"),g(ft,"display","none")},m(s,r){i(s,e,r),v(e,n),v(e,o),v(e,l),v(l,a),v(l,u),v(l,c),t[27](c),v(e,p),v(e,j),v(j,C),v(C,z),v(z,E),v(z,T),v(z,q),v(q,A),v(A,M),v(A,G),v(A,I),t[28](A),v(j,N),v(j,H),v(H,S),v(S,_),v(S,U),v(S,F),v(F,J),v(J,K),t[29](K),v(F,Q),v(F,B),t[30](B),b(B,t[12]),v(F,D),v(F,P),v(P,V),t[33](V),t[34](P),t[36](F),v(j,W),v(j,X),v(X,Y),v(Y,Z),v(Y,$),v(Y,tt),v(tt,et),v(et,nt),t[37](nt),v(tt,it),v(tt,st),t[38](st),b(st,t[11]),v(tt,ot),v(tt,lt),v(lt,rt),t[41](rt),t[42](lt),t[43](tt),t[44](j),v(e,at),v(e,ut),v(e,ct),v(e,pt),vt.m(pt,null),t[47](pt),t[48](e),i(s,dt,r),i(s,ft,r),t[49](ft),mt||(ht=[y(A,"click",t[26]),y(K,"click",t[23]),y(B,"input",t[31]),y(B,"click",t[32]),y(P,"click",t[35]),y(nt,"click",O),y(st,"input",t[39]),y(st,"click",t[40]),y(lt,"click",(function(){x(R(t[7]))&&R(t[7]).apply(this,arguments)}))],mt=!0)},p(e,n){t=e,1024&n[0]&&w(M,t[10]),4096&n[0]&&B.value!==t[12]&&b(B,t[12]),2048&n[0]&&st.value!==t[11]&&b(st,t[11]),2&n[0]&&s(gt,gt=t[1])?(vt.d(1),vt=L(t),vt.c(),vt.m(pt,null)):vt.p(t,n)},d(n){n&&r(e),t[27](null),t[28](null),t[29](null),t[30](null),t[33](null),t[34](null),t[36](null),t[37](null),t[38](null),t[41](null),t[42](null),t[43](null),t[44](null),vt.d(n),t[47](null),t[48](null),n&&r(dt),n&&r(ft),t[49](null),mt=!1,k(ht)}}}function A(t){let e,n,s,o,l,a,u,c,p,b,x,w,j=t[62].email+"";function C(){return t[45](t[64],t[62])}function z(){return t[46](t[64],t[62])}return{c(){e=d("div"),n=d("div"),s=d("span"),o=m(j),l=f(),a=d("div"),u=d("button"),u.textContent="approve",c=f(),p=d("button"),p.textContent="reject",b=f(),h(u,"class","approve-button"),h(p,"class","approve-button"),g(p,"display","visible"),h(a,"class","request-button-wrapper"),h(n,"class","change-field-line")},m(t,r){i(t,e,r),v(e,n),v(n,s),v(s,o),v(n,l),v(n,a),v(a,u),v(a,c),v(a,p),v(e,b),x||(w=[y(u,"click",C),y(p,"click",z)],x=!0)},p(e,n){t=e},d(t){t&&r(e),x=!1,k(w)}}}function L(t){let e,n=t[20],s=[];for(let e=0;e<n.length;e+=1)s[e]=A(T(t,n,e));return{c(){for(let t=0;t<s.length;t+=1)s[t].c();e=o()},m(t,n){for(let e=0;e<s.length;e+=1)s[e].m(t,n);i(t,e,n)},p(t,i){if(51380224&i[0]){let o;for(n=t[20],o=0;o<n.length;o+=1){const l=T(t,n,o);s[o]?s[o].p(l,i):(s[o]=A(l),s[o].c(),s[o].m(e.parentNode,e))}for(;o<s.length;o+=1)s[o].d(1);s.length=n.length}},d(t){j(s,t),t&&r(e)}}}function M(t){let e,n=t[19]==I&&q(t);return{c(){n&&n.c(),e=o()},m(t,s){n&&n.m(t,s),i(t,e,s)},p(t,i){t[19]==I?n?n.p(t,i):(n=q(t),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(t){n&&n.d(t),t&&r(e)}}}function G(t){let e,n=t[19],a=M(t);return{c(){a.c(),e=o(),this.c=l},m(t,n){a.m(t,n),i(t,e,n)},p(t,i){524288&i[0]&&s(n,n=t[19])?(a.d(1),a=M(t),a.c(),a.m(e.parentNode,e)):a.p(t,i)},i:l,o:l,d(t){t&&r(e),a.d(t)}}}let I=2;function N(t,e){e.readOnly||(t.style.display="initial")}function O(){}function R(t){t.focus(),t.click()}function H(t,e,n){let i,s,o=[],l=[],r=C({});a(t,r,(t=>n(52,t)));let d=C(0);a(t,d,(t=>n(19,i=t)));let f,m,h,g,v,b,y,x,w,k,j,T,q,A,L,M,G,O=0,H=u("profile-component"),S=H.maps;function _(t){if(null!=t){return[t.country,t.state,t.town].filter((t=>null!=t)).map((t=>t)).join(", ")}return"Create or join group"}function U(){n(5,g.style.display="none",g)}function F(){n(8,y.style.display="none",y)}function J(t){null!=t&&n(17,M.innerHTML=_(t),M)}function K(){if(i==I&&[g,y,v,x].every((t=>null!=t&&null!=t)))if(document.addEventListener("click",(function(t){let e,n=this.activeElement.shadowRoot;null!=n&&(e=n.activeElement,n=e.shadowRoot,null!=n&&(e=n.activeElement)),e==h||e==g?F():e==b||e==y?U():(U(),F())})),H.updateUserGroup=J,n(10,w=_(o[0])),0==o.length)n(11,k=""),n(12,j="");else{let e=o[0];n(11,(t=e.contact,k=null==t?"https://discord.gg/Qk8KUk787z":t)),n(12,j=e.members);let i=e.status;null!=i&&(0==i?(n(18,G.innerHTML="(pending)",G),n(18,G.style.color="#FFC90E",G)):2==i&&(n(18,G.innerHTML="(rejected)",G),n(18,G.style.color="#c52a28",G)),n(13,T.style.display="none",T),n(14,q.style.display="none",q),n(16,L.style.cursor="default",L),n(15,A.style.cursor="default",A),n(4,h.readOnly=!0,h),n(7,b.readOnly=!0,b))}else{setTimeout((()=>K()),100)}var t}function Q(t,e){E("/xx/group-approve-request",{user_id:e}),l.splice(t,1),n(1,O+=1)}function B(t,e){E("/xx/group-reject-request",{user_id:e}),l.splice(t,1),n(1,O+=1)}function D(){n(3,m.style.display="block",m),n(2,f.style.display="none",f),null!=S.groupsAdd&&S.groupsAdd.invalidateSize()}z("/xx/get-user-groups",(function(t){o=JSON.parse(t),H.userGroups=o,d.update((t=>t+1))})),z("/xx/get-group-requests",(function(t){let e=JSON.parse(t);l.push(...e),d.update((t=>t+1))})),H.onLoadedGroups=K,H.launchGroupsAdd=D,H.closeGroupsAdd=function(){n(3,m.style.display="none",m),n(2,f.style.display="block",f)},c((()=>{K()}));return[s,O,f,m,h,g,v,b,y,x,w,k,j,T,q,A,L,M,G,i,l,r,d,function(){let t=emailInput.value;AuthTools.checkEmail(t,emailMsg)&&(t!=user.email&&AuthTools.changeUser("email",t,user),U())},Q,B,D,function(t){p[t?"unshift":"push"]((()=>{G=t,n(18,G)}))},function(t){p[t?"unshift":"push"]((()=>{M=t,n(17,M)}))},function(t){p[t?"unshift":"push"]((()=>{g=t,n(5,g)}))},function(t){p[t?"unshift":"push"]((()=>{h=t,n(4,h)}))},function(){j=this.value,n(12,j)},()=>N(g,h),function(t){p[t?"unshift":"push"]((()=>{T=t,n(13,T)}))},function(t){p[t?"unshift":"push"]((()=>{A=t,n(15,A)}))},()=>{R(h)},function(t){p[t?"unshift":"push"]((()=>{v=t,n(6,v)}))},function(t){p[t?"unshift":"push"]((()=>{y=t,n(8,y)}))},function(t){p[t?"unshift":"push"]((()=>{b=t,n(7,b)}))},function(){k=this.value,n(11,k)},()=>N(y,b),function(t){p[t?"unshift":"push"]((()=>{q=t,n(14,q)}))},function(t){p[t?"unshift":"push"]((()=>{L=t,n(16,L)}))},function(t){p[t?"unshift":"push"]((()=>{x=t,n(9,x)}))},function(t){p[t?"unshift":"push"]((()=>{s=t,n(0,s)}))},(t,e)=>Q(t,e.user_id),(t,e)=>B(t,e.user_id),function(t){p[t?"unshift":"push"]((()=>{s=t,n(0,s)}))},function(t){p[t?"unshift":"push"]((()=>{f=t,n(2,f)}))},function(t){p[t?"unshift":"push"]((()=>{m=t,n(3,m)}))}]}class S extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.request-button-wrapper{display:flex;gap:1rem}.approve-button{height:2.7rem;padding:0rem 1rem;font-family:var(--sans-serif,sans-serif);font-size:1.15rem;color:white;background-color:var(--red);border-color:var(--red);border-radius:0.5rem;margin-top:-0.5rem}.group-heading{display:inline-block}.status{display:inline-block;font-size:1.15rem;font-family:var(--sans-serif,sans-serif);margin-left:0.5rem}input{font-family:var(--sans-serif,sans-serif)\n }.text-input-pencil-button{display:inline-block;position:relative;height:2.7rem;width:2rem}.text-input-pencil-button object{top:0rem}.pencil{pointer-events:none;position:absolute;width:1.5rem;right:0.0rem}.change-field-div input.text-input{position:relative;width:20.475rem;direction:rtl;border:0;outline:none;height:2.7rem;font-style:var(--sans-serif,sans-serif);background:transparent;margin-top:-0.5rem}#membersInput{width:5rem}#contactInput{max-width:18rem}.save-button{position:absolute;right:0;top:-0.4rem;margin-right:0.6rem;height:2.7rem;width:5rem;font-family:var(--sans-serif,sans-serif);font-size:1.15rem;color:white;background-color:var(--red);border-color:var(--red);border-radius:0.5rem}.save-button-wrapper{display:inline-block;position:relative;height:2rem}h2{text-align:center;margin-bottom:0.5rem}.entries-section{margin-bottom:1rem}.entries-section>div{height:3.5rem;padding-bottom:0.75rem;padding-top:0.75rem;border-bottom:0.14rem solid;border-color:#cdcdcd}.entries-section>div:last-child{padding-bottom:0.75rem;padding-top:0.75rem;border-bottom:0}.change-field-line{display:flex;justify-content:space-between}.change-field-div{width:max-content;position:relative;display:flex}.change-field-button{position:relative;cursor:pointer;height:2.7rem;font-size:1.15rem;font-family:var(--sans-serif,sans-serif);font-weight:500;text-align:right;padding-right:1.9rem;margin-top:-0.55rem;background-color:transparent;width:100%}h3{margin-bottom:0.5rem}span{font-family:var(--sans-serif,sans-serif);font-size:1.15rem}</style>",e(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},H,G,s,{},null,[-1,-1,-1]),t&&t.target&&i(t.target,this,t.anchor)}}customElements.define("profile-groups",S);export{S as default};
|