1
0
Fork 0
mirror of https://github.com/voltbonn/profile-picture-generator.git synced 2024-12-23 00:05:09 +00:00
profile.volt.link/static/js/main.65fbae5c.chunk.js
2022-01-06 17:40:28 +00:00

2 lines
No EOL
20 KiB
JavaScript

(this["webpackJsonpprofile-picture-generator"]=this["webpackJsonpprofile-picture-generator"]||[]).push([[0],{38:function(e,t,n){},42:function(e,t,n){var a={"./0xSOM.png":[50,13],"./2xSOM-Blue-Green.png":[51,14],"./2xSOM-Red-Yellow.png":[52,15],"./4xSOM-Blue-Red-Yellow-Green.png":[53,16],"./5xSOM-Blue.png":[54,17],"./5xSOM-Green.png":[55,18],"./5xSOM-Pride.png":[56,19],"./5xSOM-Red.png":[57,20],"./5xSOM-White.png":[58,21],"./5xSOM-Yellow.png":[59,22],"./Volt-Stars.png":[60,23],"./btw_Meine_Stimme_Balken.png":[61,24],"./btw_Meine_Stimme_Sterne_bunt.png":[62,25],"./btw_Meine_Stimme_Sterne_lila.png":[63,26],"./btw_VoteVolt_Balken.png":[64,27],"./btw_VoteVolt_Sterne_bunt.png":[65,28],"./btw_VoteVolt_Sterne_lila.png":[66,29]};function c(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],c=t[0];return n.e(t[1]).then((function(){return n(c)}))}c.keys=function(){return Object.keys(a)},c.id=42,e.exports=c},43:function(e,t,n){var a={"./#DeineWahl.png":[67,30],"./#EUReform.png":[68,31],"./#Europa.png":[69,32],"./#EuropeCares.png":[70,33],"./#European.png":[71,34],"./#FutureMadeInEurope.png":[72,35],"./#GeneratieEuropa.png":[73,36],"./#GeneratieVolt.png":[74,37],"./#GenerationEuropa.png":[75,38],"./#IkStemVolt.png":[76,39],"./#JetztBistDuDran.png":[77,40],"./#JoinTheChange.png":[78,41],"./#RejoinEU.png":[79,42],"./#ValuesOverPower.png":[80,43],"./#Volt.png":[81,44],"./#Volt21.png":[82,45],"./#VoltEuropa.png":[83,46],"./#VoltForLGBTIAQ.png":[84,47],"./#VoltRLP.png":[85,48],"./#VoteVolt.png":[86,49],"./#ZukunftMadeInEurope.png":[87,50],"./#democracy.png":[88,51],"./#paneurop\xe4isch.png":[89,52],"./#pragmatisch.png":[90,53],"./#progressiv.png":[91,54],"./stemvolt.nl.png":[92,55]};function c(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],c=t[0];return n.e(t[1]).then((function(){return n(c)}))}c.keys=function(){return Object.keys(a)},c.id=43,e.exports=c},48:function(e,t,n){var a={"./de.ftl":[93,3],"./en.ftl":[94,4],"./es.ftl":[95,5],"./fr.ftl":[96,6],"./it.ftl":[97,7],"./nl.ftl":[98,8],"./pl.ftl":[99,9],"./pt.ftl":[100,10],"./ru.ftl":[101,11]};function c(e){if(!n.o(a,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=a[e],c=t[0];return n.e(t[1]).then((function(){return n(c)}))}c.keys=function(){return Object.keys(a)},c.id=48,e.exports=c},49:function(e,t,n){"use strict";n.r(t);var a=n(5),c=n(2),r=n(1),o=n(0),s=n.n(o),i=n(25),u=n.n(i),O=n(13),l=n(6),h=n(32),d=(n(38),n(30)),j=n(27),b=n(4),p=n.n(b),f=n(9);var g=function(e){var t=e.onChange,a=Object(o.useState)([]),s=Object(c.a)(a,2),i=s[0],u=s[1],O=Object(o.useState)(null),l=Object(c.a)(O,2),h=l[0],d=l[1],j=h?h.src:null;Object(o.useEffect)((function(){function e(){return(e=Object(f.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Promise.all(["4xSOM-Blue-Red-Yellow-Green","5xSOM-Pride","Volt-Stars","0xSOM","5xSOM-Blue","5xSOM-Green","5xSOM-Red","5xSOM-Yellow"].map(function(){var e=Object(f.a)(p.a.mark((function e(t){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.next=3,n(42)("./".concat(t,".png"));case 3:return e.t1=e.sent.default,e.abrupt("return",{name:e.t0,src:e.t1});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then((function(e){u(e),d(e[0])}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[]);var b=Object(o.useCallback)((function(e){d(e)}),[d]);return Object(o.useEffect)((function(){t(h)}),[t,h]),Object(r.jsx)("div",{className:"FrameChooser",children:i.map((function(e){var t=e.src,n=j===t;return Object(r.jsx)("div",{"data-src":t,className:n?"frame choosen":"frame",onClick:function(){return b(e)},children:Object(r.jsx)("img",{alt:e.name,src:t})},t)}))})},w=n(17),m=n(10),x=function(e){return Object(r.jsx)(w.b,Object(l.a)(Object(l.a)({},e),{},{elems:Object(l.a)({br:Object(r.jsx)("br",{})},e.elems),children:Object(r.jsx)(s.a.Fragment,{children:e.children})}),e.id)};function v(e){return function(t){var n=s.a.useContext(m.a);return s.a.createElement(e,Object(l.a)({getString:function(e,t,a){return n.getString(e,t,a||" ")}},t))}}var A=v((function(e){var t=e.onChange,a=e.getString,s=Object(o.useState)([]),i=Object(c.a)(s,2),u=i[0],l=i[1],h=Object(o.useState)(null),d=Object(c.a)(h,2),j=d[0],b=d[1],g=j?j.src:null,w=a("hashtags");Object(o.useEffect)((function(){function e(){return(e=Object(f.a)(p.a.mark((function e(){return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:Promise.all([""].concat(Object(O.a)(w.split("\n").map((function(e){return e.trim()})).filter((function(e){return e.length>0})))).map(function(){var e=Object(f.a)(p.a.mark((function e(t){var a;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=t,""===t){e.next=5;break}return e.next=4,n(43)("./".concat(t,".png"));case 4:a=e.sent.default;case 5:return e.abrupt("return",{name:t,src:a});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).then((function(e){l(e),b(e[0])}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[w]);var m=Object(o.useCallback)((function(e){b(e)}),[b]);return Object(o.useEffect)((function(){t(j)}),[t,j]),Object(r.jsx)("div",{className:"HashtagChooser",children:u.map((function(e){var t=e.src,n=g===t;return Object(r.jsx)("button",{"data-src":t,className:n?"isInRow choosen":"isInRow",onClick:function(){return m(e)},children:""===e.name?a("button_no_hashtag"):e.name},e.name)}))})})),C=n(28),D=n.n(C),Q=n(29),H=n.n(Q);function T(e,t,n){return Math.min(Math.max(t,e),n)}var U=function(e){var t=e.onChange,n=e.backgroundURL,a=e.backgroundRatio,s=e.frameURL,i=e.hashtagURL,u=Object(o.useRef)(null),O=Object(o.useRef)(null),l=Object(o.useState)(!1),h=Object(c.a)(l,2),d=h[0],j=h[1],b=Object(o.useState)(null),p=Object(c.a)(b,2),f=p[0],g=p[1],w=Object(o.useState)(null),m=Object(c.a)(w,2),x=m[0],v=m[1],A=Object(o.useState)(0),C=Object(c.a)(A,2),Q=C[0],U=C[1],N=Object(o.useState)(0),k=Object(c.a)(N,2),S=k[0],E=k[1],F=Object(o.useState)(0),_=Object(c.a)(F,2),M=_[0],y=_[1],K=Object(o.useState)(0),B=Object(c.a)(K,2),R=B[0],L=B[1],I=Object(o.useState)(1),V=Object(c.a)(I,2),P=V[0],Y=V[1],G=Object(o.useState)(300),z=Object(c.a)(G,2),J=z[0],X=z[1],W=Object(o.useState)(300),q=Object(c.a)(W,2),Z=q[0],$=q[1],ee=Object(o.useState)(300),te=Object(c.a)(ee,2),ne=te[0],ae=te[1],ce=Object(o.useState)(300),re=Object(c.a)(ce,2),oe=re[0],se=re[1],ie=Object(o.useState)(0),ue=Object(c.a)(ie,2),Oe=ue[0],le=ue[1],he=Object(o.useState)(0),de=Object(c.a)(he,2),je=de[0],be=de[1],pe=Object(o.useState)(0),fe=Object(c.a)(pe,2),ge=fe[0],we=fe[1],me=Object(o.useState)(0),xe=Object(c.a)(me,2),ve=xe[0],Ae=xe[1];Object(o.useEffect)((function(){t&&t({x:Q,y:S,scale:P})}),[t,Q,S,P]),Object(o.useEffect)((function(){if(u&&u.current){var e=u.current.offsetWidth,t=u.current.offsetHeight;se(t),ae(e);var n=1,c=1;a<1?n=1/a:a>1&&(c=1*a),X(n),$(c)}}),[a]),Object(o.useEffect)((function(){var e=function(e,t,n,a,c){var r=Math.max(0,e*n-a)/2,o=Math.max(0,t*n-c)/2;return{rangeMaxX:r,rangeMinX:0-r,rangeMaxY:o,rangeMinY:0-o}}(J*ne,Z*oe,P,ne,oe),t=e.rangeMinX,n=e.rangeMinY,a=e.rangeMaxX,c=e.rangeMaxY;le(t),be(n),we(a),Ae(c)}),[J,Z,ne,oe,P]),Object(o.useEffect)((function(){U(0),E(0),y(0),L(0),Y(1)}),[n]);var Ce=Object(o.useCallback)((function(e){var t=1*e.target.dataset.x,n=1*e.target.dataset.y,a=T(t+e.deltaX,Oe,ge),c=T(n+e.deltaY,je,ve);e.isFinal?(U(a||0),E(c||0),y(0),L(0)):(y(a-t||0),L(c-n||0))}),[Oe,je,ge,ve]),De=Object(o.useCallback)((function(e,t,n,a){e.preventDefault();var c=T(1*e.target.dataset.scale+t/200,1,8);Y(c||1);var r=1*e.target.dataset.x,o=1*e.target.dataset.y;U(T(r,Oe,ge)||0),E(T(o,je,ve)||0)}),[Oe,je,ge,ve]);return Object(o.useEffect)((function(){if(!d&&u&&u.current){var e=u.current;e.addEventListener("mousedown",(function(e){e.preventDefault()}),!1),e.addEventListener("touchstart",(function(e){e.preventDefault()}),!1),e.addEventListener("touchend",(function(e){e.preventDefault()}),!1),e.addEventListener("touchmove",(function(e){e.preventDefault()}),!1),g(new D.a(e,{direction:"DIRECTION_ALL"})),v(H()(e)),j(!0)}}),[u,d]),Object(o.useEffect)((function(){if(f&&x&&d&&u&&u.current)return f.on("pan",Ce),x.wheel(De),function(){f.off("pan",Ce),x.unwheel()}}),[u,Ce,De,d,f,x]),Object(r.jsxs)("div",{className:"Editor",ref:u,"data-x":Q,"data-y":S,"data-scale":P,children:[Object(r.jsx)("img",{src:n,ref:O,alt:"",className:"background",style:{width:100*J+"%",height:100*Z+"%",transform:"translate3d(calc(-50% + ".concat(Q+M,"px), calc(-50% + ").concat(S+R,"px), 0) scale(").concat(P,",").concat(P,")")}}),Object(r.jsx)("img",{src:s,alt:"",className:"foreground"}),Object(r.jsx)("img",{src:i,alt:"",className:"hashtag"})]})},N=n.p+"static/media/VoltLogoPurple.125355f6.svg",k="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABDgAAAQ4AgMAAACRfoQcAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJUExURVAjeFAjeE8jd3Yl3xwAAAADdFJOU//+/Q3dsqEAAATsSURBVHgB7dAxAQAABAAwQtI/ipMCvi3CgiMV6NChQ4cOHTp06NChQ4cOHTp06NChAx06dOjQoUOHDh06dOjQoUOHDh06dOhAhw4dOnTo0KFDhw4dOnTo0KFDhw4dOtChQ4cOHTp06NChQ4cOHTp06NChQ4cOdOjQoUOHDh06dOjQoUOHDh06dOjQoQMdOnTo0KFDhw4dOnTo0KFDhw4dOnToQIcOHTp06NChQ4cOHTp06NChQ4cOHejQoUOHDh06dOjQoUOHDh06dOjQoUMHOnTo0KFDhw4dOnTo0KFDhw4dOnTo0IEOHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06NChQIcOHTp06NChQ4cOHTp06NChQ4cOHejQoUOHDh06dOjQoUOHDh06dOjQoUMHOnTo0KFDhw4dOnTo0KFDhw4dOnTo0IEOHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06ECHDh06dOjQoUOHDh06dOjQoUOHDh060KFDhw4dOnTo0KFDhw4dOnTo0KFDhw506NChQ4cOHTp06NChQ4cOHTp06NChAx06dOjQoUOHDh06dOjQoUOHDh06dOhAhw4dOnTo0KFDhw4dOnTo0KFDhw4dOtChQ4cOHTp06NChQ4cOHTp06NChQ4cOBTp06NChQ4cOHTp06NChQ4cOHTp06ECHDh06dOjQoUOHDh06dOjQoUOHDh060KFDhw4dOnTo0KFDhw4dOnTo0KFDhw506NChQ4cOHTp06NChQ4cOHTp06NChAx06dOjQoUOHDh06dOjQoUOHDh06dOhAhw4dOnTo0KFDhw4dOnTo0KFDhw4dOtChQ4cOHTp06NChQ4cOHTp06NChQwc6dOjQoUOHDh06dOjQoUOHDh06dOjQgQ4dOnTo0KFDhw4dOnTo0KFDhw4dOnSgQ4cOHTp06NChQ4cOHTp06NChQ4cOHTx06NChQ4cOdOjQoUOHDh06dOjQoUOHDh06dOjQoQMdOnTo0KFDhw4dOnTo0KFDhw4dOnToQIcOHTp06NChQ4cOHTp06NChQ4cOHTrQoUOHDh06dOjQoUOHDh06dOjQoUOHDnTo0KFDhw4dOnTo0KFDhw4dOnTo0KEDHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06NCBDh06dOjQoUOHDh06dOjQoUOHDh06dKBDhw4dOnTo0KFDhw4dOnTo0KFDhw4d6NChQ4cOHTp06NChQ4cOHTp06NChQ4cCHTp06NChQ4cOHTp06NChQ4cOHTp0oEOHDh06dOjQoUOHDh06dOjQoUOHDh3o0KFDhw4dOnTo0KFDhw4dOnTo0KFDBzp06NChQ4cOHTp06NChQ4cOHTp06NCBDh06dOjQoUOHDh06dOjQoUOHDh06dKBDhw4dOnTo0KFDhw4dOnTo0KFDhw4dxeoB30xd38yzCvgAAAAASUVORK5CYII=",S="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAALSURBVHgBY2BgAAAAAwABjPg5OgAAAABJRU5ErkJggg==",E=1080;function F(e){var t=e.href,n=e.name,a=e.target,c=e.children,s=Object(h.a)(e,["href","name","target","children"]),i=Object(o.useCallback)((function(e){return window.umami&&n&&window.umami.trackEvent("A: "+n),a?window.open(t,a):setTimeout((function(){window.location=t}),200),e.preventDefault(),!1}),[t,n,a]);return Object(r.jsx)("a",Object(l.a)(Object(l.a)({},s),{},{href:t,onClick:i,children:c}))}var _=v((function(e){var t=e.getString,n=e.locales,a=e.currentLocale,s=e.onLanguageChange,i=Object(o.useState)(null),u=Object(c.a)(i,2),h=u[0],b=u[1],p=Object(o.useState)(null),f=Object(c.a)(p,2),w=f[0],m=f[1],v=Object(o.useState)(null),C=Object(c.a)(v,2),D=C[0],Q=C[1],H=Object(o.useState)(1),T=Object(c.a)(H,2),_=T[0],M=T[1],y=Object(o.useState)(null),K=Object(c.a)(y,2),B=K[0],R=K[1],L=h?h.src:null,I=w?w.src:null,V=Object(o.useState)(0),P=Object(c.a)(V,2),Y=P[0],G=P[1],z=Object(o.useState)(0),J=Object(c.a)(z,2),X=J[0],W=J[1],q=Object(o.useState)({x:0,y:0,scale:1}),Z=Object(c.a)(q,2),$=Z[0],ee=Z[1],te=Object(o.useCallback)((function(e){b(e)}),[b]),ne=Object(o.useCallback)((function(e){m(e)}),[m]),ae=Object(o.useCallback)((function(e){var t=e.x,n=e.y,a=e.scale;ee({x:t,y:n,scale:a})}),[]),ce=Object(o.useCallback)((function(e){if(e){var t=new FileReader;t.onload=function(t){var n=new Image;n.onload=function(){var a,c;n.width<n.height?(c=n.height/n.width*E,a=E):(c=E,a=n.width/n.height*E),function(e,t){var n=new FileReader;n.onload=function(e){var n=new DataView(e.target.result);if(65496!==n.getUint16(0,!1))return t(-2);for(var a=n.byteLength,c=2;c<a;){var r=n.getUint16(c,!1);if(c+=2,65505===r){if(1165519206!==n.getUint32(c+=2,!1))return t(-1);var o=18761===n.getUint16(c+=6,!1);c+=n.getUint32(c+4,o);var s=n.getUint16(c,o);c+=2;for(var i=0;i<s;i++)if(274===n.getUint16(c+12*i,o))return t(n.getUint16(c+12*i+8,o))}else{if(65280!==(65280&r))break;c+=n.getUint16(c,!1)}}return t(-1)},n.readAsArrayBuffer(e.slice(0,65536))}(e,(function(e){var n=1;switch(e){case 2:case 3:case 4:n=c/a;break;case 5:case 6:case 7:case 8:n=a/c;break;default:n=c/a}G(a),W(c),Q(t.target.result),R(e),M(n)}))},n.src=t.target.result},t.readAsDataURL(e)}}),[]),re=Object(o.useCallback)((function(e){ce(e.target.files[0])}),[ce]),oe=Object(o.useCallback)((function(e){ce(e[0])}),[ce]),se=Object(o.useCallback)((function(){var e=new Image;e.onload=function(){var t=document.createElement("canvas");t.width=E,t.height=E;var n=t.getContext("2d",{alpha:!0});switch(B){case 2:n.translate(t.width,0),n.scale(-1,1);break;case 3:n.translate(t.width,t.height),n.rotate(Math.PI);break;case 4:n.translate(0,t.height),n.scale(1,-1);break;case 5:n.rotate(.5*Math.PI),n.scale(1,-1);break;case 6:n.rotate(.5*Math.PI),n.translate(0,-t.height);break;case 7:n.rotate(.5*Math.PI),n.translate(t.width,-t.height),n.scale(-1,1);break;case 8:n.rotate(-.5*Math.PI),n.translate(-t.width,0)}var a=Y*$.scale,c=X*$.scale;n.drawImage(e,3.5*$.x+.5*(E-a),3.5*$.y+.5*(E-c),a,c);var r=t.toDataURL();Object(j.a)([k].concat(Object(O.a)(r?[r]:[]),Object(O.a)(L?[L]:[]),Object(O.a)(I?[I]:[]))).then((function(e){!function(e,t){var n=document.createElement("a");document.body.appendChild(n),n.download=e,n.href=t,n.click(),n.remove()}("volt-profile-picture.png",e);var t=h.name||"No-Frame",n=w.name||"No-Hashtag";window.umami&&(window.umami.trackEvent("F: "+t),window.umami.trackEvent("H: "+n),window.umami.trackEvent("C: "+[t,n].join(" | ")))}))},e.src=D}),[D,$.x,$.y,$.scale,B,L,I,X,Y,h,w]),ie=Object(d.a)({onDrop:oe,accept:"image/*",maxFiles:1,noKeyboard:!0}),ue=ie.isDragActive,Oe=ie.getRootProps;return Object(r.jsxs)("div",Object(l.a)(Object(l.a)({className:"App"},Oe()),{},{children:[Object(r.jsx)("img",{src:N,className:"HeaderImage",alt:t("alt_volt_logo")}),Object(r.jsx)("h1",{children:Object(r.jsx)(x,{id:"title_profile_generator"})}),Object(r.jsx)("div",{className:ue?"droparea active":"droparea",children:Object(r.jsx)(x,{id:"title_drop_photo_here"})}),Object(r.jsx)("h2",{children:Object(r.jsx)(x,{id:"title_choose_photo"})}),Object(r.jsx)("p",{children:Object(r.jsx)(x,{id:"text_choose_photo_info"})}),Object(r.jsxs)("label",{className:"labelButton",tabIndex:"0",style:{outline:"none"},children:[D?Object(r.jsx)("img",{src:D,alt:"Preview"}):null,Object(r.jsx)("span",{children:t(D?"button_change_photo":"button_load_photo")}),Object(r.jsx)("input",{onChange:re,type:"file",accept:"image/*",style:{display:"none"}})]}),Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)("h2",{children:Object(r.jsx)(x,{id:"title_choose_frame"})}),Object(r.jsx)(g,{onChange:te}),(L||"").startsWith("/static/media/btw_")?null:Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)("h2",{children:Object(r.jsx)(x,{id:"title_choose_hashtag"})}),Object(r.jsx)(A,{onChange:ne})]})]}),D&&L?Object(r.jsxs)(r.Fragment,{children:[Object(r.jsx)("h2",{children:Object(r.jsx)(x,{id:"title_reposition_photo"})}),Object(r.jsx)(U,{backgroundURL:D||S,backgroundRatio:_,frameURL:L,hashtagURL:I||S,onChange:ae}),Object(r.jsx)("button",{onClick:se,children:Object(r.jsx)(x,{id:"button_download"})})]}):null,Object(r.jsxs)("footer",{children:[Object(r.jsx)(F,{name:"imprint",href:"https://www.voltdeutschland.org/impressum",children:Object(r.jsx)(x,{id:"link_imprint"})}),"\xa0 \u2022 \xa0",Object(r.jsx)(F,{name:"privacy_policy",href:"https://www.voltdeutschland.org/datenschutz",children:Object(r.jsx)(x,{id:"link_privacy_policy"})}),"\xa0 \u2022 \xa0",Object(r.jsx)(F,{name:"source_code",href:"https://github.com/voltbonn/profile-picture-generator",children:Object(r.jsx)(x,{id:"link_source_code"})}),"\xa0 \u2022 \xa0",Object(r.jsx)(F,{name:"contact",href:"mailto:thomas.rosen@volteuropa.org",children:Object(r.jsx)(x,{id:"link_app_contact"})})]}),n&&s?Object(r.jsx)("div",{className:"locale_chooser",children:Object.entries(n).map((function(e){var t=Object(c.a)(e,2),n=t[0],o=t[1];return Object(r.jsx)("button",{className:n===a?"isInRow choosen":"isInRow","data-locale":n,onClick:s,children:o},n)}))}):null]}))})),M=function(e){e&&e instanceof Function&&n.e(12).then(n.bind(null,102)).then((function(t){var n=t.getCLS,a=t.getFID,c=t.getFCP,r=t.getLCP,o=t.getTTFB;n(e),a(e),c(e),r(e),o(e)}))},y=(n(44),n(21)),K=n(20),B=n(31),R={de:"Deutsch",en:"English",es:"Espa\xf1ol",pt:"Portugu\xeas",fr:"Fran\xe7ais",it:"Italiano",nl:"Nederlands",pl:"Polska",ru:"P\u0443\u0441\u0441\u043a\u0438\u0439"},L=Object.keys(R);function I(e){return V.apply(this,arguments)}function V(){return(V=Object(f.a)(p.a.mark((function e(t){var a,c,r;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n(48)("./"+t+".ftl");case 2:return a=e.sent,e.next=5,fetch(a.default);case 5:return c=e.sent,e.next=8,c.text();case 8:return r=e.sent,e.abrupt("return",Object(y.a)({},t,new K.b(r)));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function P(e){return Y.apply(this,arguments)}function Y(){return(Y=Object(f.a)(p.a.mark((function e(t){var n,c;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map(I));case 2:return n=e.sent,c=n.reduce((function(e,t){return Object.assign(e,t)})),e.abrupt("return",p.a.mark((function e(){var n,r,o,s;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Object(a.a)(t),e.prev=1,n.s();case 3:if((r=n.n()).done){e.next=11;break}return o=r.value,(s=new K.a(o)).addResource(c[o]),e.next=9,s;case 9:e.next=3;break;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(1),n.e(e.t0);case 16:return e.prev=16,n.f(),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,13,16,19]])})));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function G(e){var t=e.userLocales,n=e.children,a=e.onLocaleChange,s=Object(o.useState)(function(){var e=new K.a("");return e.addResource(new K.b("")),new w.c([e])}()),i=Object(c.a)(s,2),u=i[0],O=i[1];return Object(o.useEffect)((function(){function e(){return(e=Object(f.a)(p.a.mark((function e(){var n,c;return p.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Object(B.a)(t,L,{defaultLocale:"en"}),a&&a(n),e.next=4,P(n);case 4:c=e.sent,O(new w.c(c()));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(){e.apply(this,arguments)}()}),[t,a]),u?Object(r.jsx)(w.a,{l10n:u,children:n}):Object(r.jsx)("div",{children:"Loading texts\u2026"})}function z(){var e=Object(o.useState)(navigator.languages),t=Object(c.a)(e,2),n=t[0],s=t[1],i=Object(o.useState)(null),u=Object(c.a)(i,2),O=u[0],l=u[1];Object(o.useEffect)((function(){var e=navigator.languages;if(window.umami&&(e||Array.isArray(e))){var t,n=Object(a.a)(e);try{for(n.s();!(t=n.n()).done;){var c=t.value;window.umami.trackEvent("L: "+c)}}catch(r){n.e(r)}finally{n.f()}}}),[]);var h=Object(o.useCallback)((function(e){s([e.target.dataset.locale])}),[s]),d=Object(o.useCallback)((function(e){l(e.length>0?e[0]:"")}),[l]);return Object(r.jsx)(G,{userLocales:n,onLocaleChange:d,children:Object(r.jsx)(_,{locales:R,currentLocale:O,onLanguageChange:h})},"AppLocalizationProvider")}u.a.render(Object(r.jsx)(s.a.StrictMode,{children:Object(r.jsx)(z,{})}),document.getElementById("root")),M()}},[[49,1,2]]]);
//# sourceMappingURL=main.65fbae5c.chunk.js.map