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

2 lines
6.8 KiB
JavaScript

import{S as t,i as e,a as o,b as n,s as r,e as i,n as a,d as s,c,o as m,f as l,t as p,g,h as d,j as f,k as h,l as u,m as b,p as w}from"./index-4348483d.js";import{w as x}from"./index-71440b21.js";import{addMarkersCoops as v,coopsByCountry as j}from"../../../../../../../../../js/coops.js";import{loadLocaleContent as k}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function y(t,e,o){const n=t.slice();return n[9]=e[o][0],n[10]=e[o][1],n}function z(t,e,o){const n=t.slice();return n[13]=e[o],n}function D(t){let e,o,r,i,a,c,m,x,v,k,z,D,E,O,R,T,_,A,C,H,L=t[0].cooperatives+"",M=t[0].p1+"",S=t[0].subheading1+"",q=t[0]["map-prompt"]+"",B=Object.entries(j),F=[];for(let e=0;e<B.length;e+=1)F[e]=N(y(t,B,e));return{c(){e=l("div"),o=l("div"),r=l("h1"),i=p(L),a=g(),c=l("img"),x=g(),v=l("p"),k=p(M),z=g(),D=l("h3"),E=p(S),O=g(),R=l("map-component"),_=g(),A=l("p"),C=p(q),H=g();for(let t=0;t<F.length;t+=1)F[t].c();d(c,"id","coops-img"),f(c.src,m="/img/common/coops.svg")||d(c,"src","/img/common/coops.svg"),d(c,"alt","coops"),d(v,"class","description"),h(R,"id","map"),h(R,"callback",T=t[8]),d(A,"id","add-prompt"),d(o,"id","text-container"),d(e,"id","container")},m(t,s){n(t,e,s),u(e,o),u(o,r),u(r,i),u(o,a),u(o,c),u(o,x),u(o,v),u(v,k),u(o,z),u(o,D),u(D,E),u(o,O),u(o,R),u(o,_),u(o,A),u(A,C),u(o,H);for(let t=0;t<F.length;t+=1)F[t].m(o,null)},p(t,e){if(1&e&&L!==(L=t[0].cooperatives+"")&&b(i,L),1&e&&M!==(M=t[0].p1+"")&&b(k,M),1&e&&S!==(S=t[0].subheading1+"")&&b(E,S),1&e&&T!==(T=t[8])&&h(R,"callback",T),1&e&&q!==(q=t[0]["map-prompt"]+"")&&b(C,q),193&e){let n;for(B=Object.entries(j),n=0;n<B.length;n+=1){const r=y(t,B,n);F[n]?F[n].p(r,e):(F[n]=N(r),F[n].c(),F[n].m(o,null))}for(;n<F.length;n+=1)F[n].d(1);F.length=B.length}},d(t){t&&s(e),w(F,t)}}}function E(t){let e,o,r,i,a,c,m,f,h,w,x,v,j,k,y,z,D,E,N,O,R,T,_,A,C,H,L,M,S,q,B,F,G,I,J,K,P,Q,U,V,W,X,Y,Z,$,tt,et,ot,nt,rt,it,at,st,ct,mt,lt,pt,gt,dt,ft=t[0].name+"",ht=t[13].name+"",ut=t[0].location+"",bt=t[7](t[13])+"",wt=t[0].market+"",xt=t[0][t[13].market]+"",vt=t[0].workers+"",jt=t[13].workers+"",kt=t[0].status+"",yt=t[0][t[13].status]+"",zt=t[0].website+"",Dt=t[13].website[1]+"",Et=t[0].contact+"",Nt=t[0][t[13].contact[1]]+"",Ot=t[0].description+"",Rt=t[0][t[13].description]+"";return{c(){e=l("div"),o=l("div"),r=l("div"),i=l("p"),a=l("b"),c=p(ft),m=p(": "),f=p(ht),h=g(),w=l("p"),x=l("b"),v=p(ut),j=p(": "),k=p(bt),y=g(),z=l("p"),D=l("b"),E=p(wt),N=p(": "),O=p(xt),R=g(),T=l("p"),_=l("b"),A=p(vt),C=p(": "),H=p(jt),L=g(),M=l("p"),S=l("b"),q=p(kt),B=p(": "),F=p(yt),G=g(),I=l("p"),J=l("b"),K=p(zt),P=p(": "),Q=l("a"),U=p(Dt),V=g(),W=l("p"),X=l("b"),Y=p(Et),Z=p(": "),$=l("a"),tt=p(Nt),et=g(),ot=l("picture"),nt=l("source"),rt=g(),it=l("source"),at=g(),st=l("img"),ct=g(),mt=l("p"),lt=l("b"),pt=p(Ot),gt=p(": "),dt=p(Rt),d(Q,"href",t[13].website[0]),d(Q,"target","_blank"),d(Q,"rel","noreferrer"),d($,"href",t[13].contact[0]),d($,"target",";_blank;"),d($,"rel","noreferrer"),d(nt,"srcset","/img/coops/"+t[13].logo+".webp"),d(it,"srcset","/img/coops/"+t[13].logo+".png"),d(st,"class","coop-logo"),d(st,"alt","logo"),d(o,"class","img-general-info"),d(e,"class","location-info")},m(t,s){n(t,e,s),u(e,o),u(o,r),u(r,i),u(i,a),u(a,c),u(a,m),u(i,f),u(r,h),u(r,w),u(w,x),u(x,v),u(x,j),u(w,k),u(r,y),u(r,z),u(z,D),u(D,E),u(D,N),u(z,O),u(r,R),u(r,T),u(T,_),u(_,A),u(_,C),u(T,H),u(r,L),u(r,M),u(M,S),u(S,q),u(S,B),u(M,F),u(r,G),u(r,I),u(I,J),u(J,K),u(J,P),u(I,Q),u(Q,U),u(r,V),u(r,W),u(W,X),u(X,Y),u(X,Z),u(W,$),u($,tt),u(o,et),u(o,ot),u(ot,nt),u(ot,rt),u(ot,it),u(ot,at),u(ot,st),u(e,ct),u(e,mt),u(mt,lt),u(lt,pt),u(lt,gt),u(mt,dt)},p(t,e){1&e&&ft!==(ft=t[0].name+"")&&b(c,ft),1&e&&ut!==(ut=t[0].location+"")&&b(v,ut),1&e&&wt!==(wt=t[0].market+"")&&b(E,wt),1&e&&xt!==(xt=t[0][t[13].market]+"")&&b(O,xt),1&e&&vt!==(vt=t[0].workers+"")&&b(A,vt),1&e&&kt!==(kt=t[0].status+"")&&b(q,kt),1&e&&yt!==(yt=t[0][t[13].status]+"")&&b(F,yt),1&e&&zt!==(zt=t[0].website+"")&&b(K,zt),1&e&&Et!==(Et=t[0].contact+"")&&b(Y,Et),1&e&&Nt!==(Nt=t[0][t[13].contact[1]]+"")&&b(tt,Nt),1&e&&Ot!==(Ot=t[0].description+"")&&b(pt,Ot),1&e&&Rt!==(Rt=t[0][t[13].description]+"")&&b(dt,Rt)},d(t){t&&s(e)}}}function N(t){let e,o,r,i,a,c=t[6](t[9])+"",m=t[10],f=[];for(let e=0;e<m.length;e+=1)f[e]=E(z(t,m,e));return{c(){e=l("h4"),o=p(c),r=g(),i=l("div");for(let t=0;t<f.length;t+=1)f[t].c();a=g(),d(e,"class","country-name"),d(i,"class","country-block")},m(t,s){n(t,e,s),u(e,o),n(t,r,s),n(t,i,s);for(let t=0;t<f.length;t+=1)f[t].m(i,null);u(i,a)},p(t,e){if(129&e){let o;for(m=t[10],o=0;o<m.length;o+=1){const n=z(t,m,o);f[o]?f[o].p(n,e):(f[o]=E(n),f[o].c(),f[o].m(i,a))}for(;o<f.length;o+=1)f[o].d(1);f.length=m.length}},d(t){t&&s(e),t&&s(r),t&&s(i),w(f,t)}}}function O(t){let e,o=2==t[1]&&D(t);return{c(){o&&o.c(),e=i()},m(t,r){o&&o.m(t,r),n(t,e,r)},p(t,n){2==t[1]?o?o.p(t,n):(o=D(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(t){o&&o.d(t),t&&s(e)}}}function R(t){let e,o=t[1],c=O(t);return{c(){c.c(),e=i(),this.c=a},m(t,o){c.m(t,o),n(t,e,o)},p(t,[n]){2&n&&r(o,o=t[1])?(c.d(1),c=O(t),c.c(),c.m(e.parentNode,e)):c.p(t,n)},i:a,o:a,d(t){t&&s(e),c.d(t)}}}function T(t,e,o){let n,r,i=x(0);c(t,i,(t=>o(1,r=t)));let a=x({});c(t,a,(t=>o(0,n=t)));let s=k(a,"countries",i);function l(t,e){let o=t([22,0],2);v(o,e,s)}k(a,"cooperatives-component",i),m((()=>{}));return[n,r,i,a,s,l,function(t){return"en"==s?t:n[t]},function(t){return t.location[0].map((t=>"en"==s?t:n[t])).join(", ")},t=>l(t,n)]}class _ extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.description{margin-bottom:1rem}#add-prompt{margin-bottom:2rem}#coops-img{position:absolute;width:10.5rem;left:50%;transform:translate(-50%);z-index:0;opacity:0.2}#text-container>:nth-child(3){margin-top:8rem}.img-general-info{display:flex;align-content:center;width:100%;justify-content:space-between;gap:3rem;align-items:center}.img-general-info>:first-child{flex:none}.coop-logo{position:relative;right:0;max-height:6rem;max-width:100%}.country-name{margin-bottom:1rem}.country-block{margin-bottom:2rem}.location-info{position:relative;margin-bottom:2rem}.location-info p{margin-bottom:0}a{color:#DD1C1A}#map{--height:30rem;--width:100%;--margin-bottom:0.5rem}#text-container{max-width:calc(100vw - 4rem);margin:auto}h1{margin-bottom:1rem;font-size:2.2rem;text-align:center}h3{margin-top:1rem;margin-bottom:1rem}#container{margin:auto;max-width:800px;margin-top:1rem;margin-bottom:4rem}#container p{text-align:justify}@media only screen and (max-width: 600px){.img-general-info{display:flex;flex-direction:column-reverse;align-content:left;width:100%;gap:1rem;align-items:left;margin-bottom:0rem}.img-general-info>:nth-child(2){width:max-content}.img-general-info>:nth-child(1){width:100%}}</style>",e(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},T,R,r,{},null),t&&t.target&&n(t.target,this,t.anchor)}}customElements.define("cooperatives-component",_);export{_ as default};