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

2 lines
7.3 KiB
JavaScript
Raw Normal View History

2023-07-12 05:42:33 +07:00
import{S as e,i as o,a as t,b as n,s as i,e as a,n as r,d as l,c as s,o as c,f as d,g as m,t as h,h as p,j as g,l as u,q as f,m as b,p as v,r as k,w}from"./index-4348483d.js";import{w as y}from"./index-71440b21.js";import{loadLocaleContent as x,locales as j}from"../../../../../../../../../js/libraries/serverTools.js";function z(e,o,t){const n=e.slice();return n[14]=o[t][0],n[15]=o[t][1],n}function O(e){let o,t,i,a,r,s,c,w,y,x,O,H,L,M,N,S,E,R,U,q,I,X,A,B,C,D,F,G,J,K,P,Q,V,W,Y,Z,$,_,ee,oe,te,ne,ie,ae,re=e[3].orgName+"",le=e[3].manifesto+"",se=e[3].joinUs+"",ce=e[3].groups+"",de=e[3].communes+"",me=e[3].cooperatives+"",he=e[3].partners+"",pe=Object.entries(j),ge=[];for(let o=0;o<pe.length;o+=1)ge[o]=T(z(e,pe,o));return{c(){o=d("header"),t=d("input"),i=m(),a=d("label"),a.innerHTML='<span id="hamb-line"></span>',r=m(),s=d("a"),c=d("img"),y=m(),x=d("span"),O=h(re),H=m(),L=d("nav"),M=d("ul"),N=d("li"),S=d("a"),E=h(le),R=m(),U=d("li"),q=d("a"),I=h(se),X=m(),A=d("li"),B=d("a"),C=h(ce),D=m(),F=d("li"),G=d("a"),J=h(de),K=m(),P=d("li"),Q=d("a"),V=h(me),W=m(),Y=d("li"),Z=d("a"),$=h(he),_=m(),ee=d("li"),oe=d("button"),oe.innerHTML='<picture><source srcset="/img/common/globe.webp"/> \n <source srcset="/img/common/globe.png"/> \n <img id="locales-img" alt="globe"/></picture>',te=m(),ne=d("div");for(let e=0;e<ge.length;e+=1)ge[e].c();p(t,"type","checkbox"),p(t,"id","side-menu"),p(a,"id","hamb"),p(a,"for","side-menu"),g(c.src,w="/img/common/flag.png")||p(c,"src","/img/common/flag.png"),p(c,"id","navbar-logo"),p(c,"alt","logo"),p(x,"id","navbar-logo-text"),p(s,"id","logo-container"),p(s,"href","/"+e[6]+"/"),p(S,"href","/"+e[6]+"/manifesto"),p(q,"href","/"+e[6]+"/join-us"),p(B,"href","/"+e[6]+"/groups"),p(G,"href","/"+e[6]+"/communes"),p(Q,"href","/"+e[6]+"/cooperatives"),p(Z,"href","/"+e[6]+"/partners"),p(ee,"id","locales"),p(ne,"id","locales-dropdown"),p(M,"id","menu"),p(L,"id","nav"),p(o,"id","navbar")},m(l,d){n(l,o,d),u(o,t),e[10](t),u(o,i),u(o,a),u(o,r),u(o,s),u(s,c),u(s,y),u(s,x),u(x,O),u(o,H),u(o,L),u(L,M),u(M,N),u(N,S),u(S,E),u(M,R),u(M,U),u(U,q),u(q,I),u(M,X),u(M,A),u(A,B),u(B,C),u(M,D),u(M,F),u(F,G),u(G,J),u(M,K),u(M,P),u(P,Q),u(Q,V),u(M,W),u(M,Y),u(Y,Z),u(Z,$),u(M,_),u(M,ee),u(ee,oe),u(M,te),u(M,ne);for(let e=0;e<ge.length;e+=1)ge[e].m(ne,null);e[12](ne),e[13](o),ie||(ae=[f(t,"click",e[7]),f(oe,"click",e[8])],ie=!0)},p(e,o){if(8&o&&re!==(re=e[3].orgName+"")&&b(O,re),8&o&&le!==(le=e[3].manifesto+"")&&b(E,le),8&o&&se!==(se=e[3].joinUs+"")&&b(I,se),8&o&&ce!==(ce=e[3].groups+"")&&b(C,ce),8&o&&de!==(de=e[3].communes+"")&&b(J,de),8&o&&me!==(me=e[3].cooperatives+"")&&b(V,me),8&o&&he!==(he=e[3].partners+"")&&b($,he),512&o){let t;for(pe=Object.entries(j),t=0;t<pe.length;t+=1){const n=z(e,pe,t);ge[t]?ge[t].p(n,o):(ge[t]=T(n),ge[t].c(),ge[t].m(ne,null))}for(;t<ge.length;t+=1)ge[t].d(1);ge.length=pe.length}},d(t){t&&l(o),e[10](null),v(ge,t),e[12](null),e[13](null),ie=!1,k(ae)}}}function T(e){let o,t,i,a,r=e[15]+"";function s(){return e[11](e[14])}return{c(){o=d("button"),t=h(r)},m(e,r){n(e,o,r),u(o,t),i||(a=f(o,"click",s),i=!0)},p(o,t){e=o},d(e){e&&l(o),i=!1,a()}}}function H(e){let o,t=0!=Object.keys(e[3]).length,i=t&&O(e);return{c(){i&&i.c(),o=a(),this.c=r},m(e,t){i&&i.m(e,t),n(e,o,t)},p(e,[n]){8&n&&(t=0!=Object.keys(e[3]).length),t?i?i.p(e,n):(i=O(e),i.c(),i.m(o.parentNode,o)):i&&(i.d(1),i=null)},i:r,o:r,d(e){i&&i.d(e),e&&l(o)}}}function L(e,o,t){let n,i,a,r,l,d=y({});s(e,d,(e=>t(3,n=e)));let m=x(d,"navbar-component",l);function h(e){localStorage.setItem("locale",e);let o=location.href.split("/"),t=Object.keys(j);o=o.filter((e=>!t.includes(e)));let n=o.slice(0,o.length-1).join("/")+"/"+e+"/"+o[o.length-1];location.href=n}c((()=>{}));return[i,a,r,n,l,d,m,function(){i.checked?t(1,a.style.background="white",a):setTimeout((()=>{t(1,a.style.position="relative",a),t(1,a.style.background="",a),t(1,a.style.boxShadow="",a)}),510)},function(){"block"==r.style.display?t(2,r.style.display="none",r):t(2,r.style.display="block",r)},h,function(e){w[e?"unshift":"push"]((()=>{i=e,t(0,i)}))},e=>