2 lines
5.0 KiB
JavaScript
2 lines
5.0 KiB
JavaScript
import{S as t,i as o,a as n,b as e,s as m,e as r,n as a,d as i,c,o as s,f as l,t as p,g as u,h as g,j as d,k as h,l as f,m as b,p as j}from"./index-4348483d.js";import{w as x}from"./index-71440b21.js";import{addMarkersCommunes as v,communesByCountry as w}from"../../../../../../../../../js/communes.js";import{loadLocaleContent as y}from"../../../../../../../../../js/libraries/serverTools.js";import"../../../../../../../../../js/components/map-component.js";function k(t,o,n){const e=t.slice();return e[8]=o[n][0],e[9]=o[n][1],e}function z(t,o,n){const e=t.slice();return e[12]=o[n],e}function D(t){let o,n,m,r,a,c,s,x,v,y,z,D,E,O,R,T,A,C,H,L,M=t[1].communes+"",S=t[1].p1+"",_=t[1].subheading1+"",q=t[1]["map-prompt"]+"",B=Object.entries(w),F=[];for(let o=0;o<B.length;o+=1)F[o]=N(k(t,B,o));return{c(){o=l("div"),n=l("div"),m=l("h1"),r=p(M),a=u(),c=l("img"),x=u(),v=l("p"),y=p(S),z=u(),D=l("h3"),E=p(_),O=u(),R=l("map-component"),A=u(),C=l("p"),H=p(q),L=u();for(let t=0;t<F.length;t+=1)F[t].c();g(c,"id","commune-img"),d(c.src,s="/img/common/commune.svg")||g(c,"src","/img/common/commune.svg"),g(c,"alt","commune"),g(v,"class","description"),h(R,"id","map"),h(R,"callback",T=t[6]),g(C,"id","add-prompt"),g(n,"id","text-container"),g(o,"id","container")},m(t,i){e(t,o,i),f(o,n),f(n,m),f(m,r),f(n,a),f(n,c),f(n,x),f(n,v),f(v,y),f(n,z),f(n,D),f(D,E),f(n,O),f(n,R),f(n,A),f(n,C),f(C,H),f(n,L);for(let t=0;t<F.length;t+=1)F[t].m(n,null)},p(t,o){if(2&o&&M!==(M=t[1].communes+"")&&b(r,M),2&o&&S!==(S=t[1].p1+"")&&b(y,S),2&o&&_!==(_=t[1].subheading1+"")&&b(E,_),2&o&&T!==(T=t[6])&&h(R,"callback",T),2&o&&q!==(q=t[1]["map-prompt"]+"")&&b(H,q),2&o){let e;for(B=Object.entries(w),e=0;e<B.length;e+=1){const m=k(t,B,e);F[e]?F[e].p(m,o):(F[e]=N(m),F[e].c(),F[e].m(n,null))}for(;e<F.length;e+=1)F[e].d(1);F.length=B.length}},d(t){t&&i(o),j(F,t)}}}function E(t){let o,n,m,r,a,c,s,d,h,j,x,v,w,y,k,z,D,E,N,O,R,T,A,C,H,L=t[1].location+"",M=t[12].location[0].map(t[7]).join(", ")+"",S=t[1].status+"",_=t[1][t[12].status]+"",q=t[1].members+"",B=t[12].members+"",F=t[1].contact+"",G=t[1][t[12].contact[1]]+"";return{c(){o=l("div"),n=l("p"),m=l("b"),r=p(L),a=p(": "),c=p(M),s=u(),d=l("p"),h=l("b"),j=p(S),x=p(": "),v=p(_),w=u(),y=l("p"),k=l("b"),z=p(q),D=p(": "),E=p(B),N=u(),O=l("p"),R=l("b"),T=p(F),A=p(": "),C=l("a"),H=p(G),g(C,"href",t[12].contact[0]),g(C,"target",";_blank;"),g(C,"rel","noreferrer"),g(o,"class","location-info")},m(t,i){e(t,o,i),f(o,n),f(n,m),f(m,r),f(m,a),f(n,c),f(o,s),f(o,d),f(d,h),f(h,j),f(h,x),f(d,v),f(o,w),f(o,y),f(y,k),f(k,z),f(k,D),f(y,E),f(o,N),f(o,O),f(O,R),f(R,T),f(R,A),f(O,C),f(C,H)},p(t,o){2&o&&L!==(L=t[1].location+"")&&b(r,L),2&o&&M!==(M=t[12].location[0].map(t[7]).join(", ")+"")&&b(c,M),2&o&&S!==(S=t[1].status+"")&&b(j,S),2&o&&_!==(_=t[1][t[12].status]+"")&&b(v,_),2&o&&q!==(q=t[1].members+"")&&b(z,q),2&o&&F!==(F=t[1].contact+"")&&b(T,F),2&o&&G!==(G=t[1][t[12].contact[1]]+"")&&b(H,G)},d(t){t&&i(o)}}}function N(t){let o,n,m,r,a,c=t[1][t[8]]+"",s=t[9],d=[];for(let o=0;o<s.length;o+=1)d[o]=E(z(t,s,o));return{c(){o=l("h4"),n=p(c),m=u(),r=l("div");for(let t=0;t<d.length;t+=1)d[t].c();a=u(),g(o,"class","country-name"),g(r,"class","country-block")},m(t,i){e(t,o,i),f(o,n),e(t,m,i),e(t,r,i);for(let t=0;t<d.length;t+=1)d[t].m(r,null);f(r,a)},p(t,o){if(2&o&&c!==(c=t[1][t[8]]+"")&&b(n,c),2&o){let n;for(s=t[9],n=0;n<s.length;n+=1){const e=z(t,s,n);d[n]?d[n].p(e,o):(d[n]=E(e),d[n].c(),d[n].m(r,a))}for(;n<d.length;n+=1)d[n].d(1);d.length=s.length}},d(t){t&&i(o),t&&i(m),t&&i(r),j(d,t)}}}function O(t){let o,n=2==t[0]&&D(t);return{c(){n&&n.c(),o=r()},m(t,m){n&&n.m(t,m),e(t,o,m)},p(t,e){2==t[0]?n?n.p(t,e):(n=D(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[0],c=O(t);return{c(){c.c(),o=r(),this.c=a},m(t,n){c.m(t,n),e(t,o,n)},p(t,[e]){1&e&&m(n,n=t[0])?(c.d(1),c=O(t),c.c(),c.m(o.parentNode,o)):c.p(t,e)},i:a,o:a,d(t){t&&i(o),c.d(t)}}}function T(t,o,n){let e,m,r=x(0);c(t,r,(t=>n(0,e=t)));let a=x({});c(t,a,(t=>n(1,m=t))),y(a,"countries",r);let i=y(a,"communes-component",r);function l(t,o){let n=t([22,0],2);v(n,o)}s((()=>{}));return[e,m,r,a,i,l,t=>l(t,m),t=>m[t]]}class A extends t{constructor(t){super(),this.shadowRoot.innerHTML="<style>@import '/css/common.css';.description{margin-bottom:1rem}#add-prompt{margin-bottom:2rem}#commune-img{position:absolute;width:11.5rem;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{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}</style>",o(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},T,R,m,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("communes-component",A);export{A as default};
|