1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5779],{90680:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[lang]/app/market",function(){return i(68054)}])},68054:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return w}});var n=i(47568),a=i(51438),s=i(52951),o=i(88029),l=i(5950),r=i(97582),c=i(85893),d=i(67294),u=i(9008),f=i.n(u),p=i(41664),h=i.n(p),m=i(14364),v=i(29473),y=i(37742),x=i(6158),g=i.n(x);i(81634);g().accessToken="pk.eyJ1IjoiZml6YmFjayIsImEiOiJjbGsxMDJvMWswMjdoM2Zxanl1cXRlZHVhIn0.j4lcVrU7zIlM3hsB3FOtwg";var k={},w=function(e){(0,o.Z)(i,e);var t=(0,l.Z)(i);function i(e){var n;return(0,a.Z)(this,i),(n=t.call(this,e)).state={map_opt:{lng:2.3488,lat:48.8534,zoom:2},typeAcc:null,loading:!1,data:[],filter:null,rank:"reviews",showType:null,showMap:!0,marketOff:!1},n.sizeIco=28,n.YEAR_DEFAULT="2025",n}return(0,s.Z)(i,[{key:"componentDidMount",value:function(){var e=this;return(0,n.Z)((function(){var t;return(0,r.__generator)(this,(function(i){switch(i.label){case 0:return e.mountPage=!0,[4,(0,m.ih)(e.props.lang)];case 1:return t=i.sent(),e.mountPage&&(document.addEventListener("mousedown",e.handleClickOutside.bind(e)),e.setState({typeAcc:t.type}),(0,y.S)("visit_market_page",{type:"overview",account:t.type}),e.state.showMap&&((k=new(g().Map)({container:e.mapContainer,style:"mapbox://styles/fizback/ckdt19jep1huc19pn4x4bo2i2",center:[e.state.map_opt.lng,e.state.map_opt.lat],zoom:e.state.map_opt.zoom})).addControl(new(g().NavigationControl)),k.on("dragend",function(e){this.setState({reload:!0})}.bind(e)),k.on("click",function(e){var t=k.queryRenderedFeatures(e.point);if(t.length>0){var i=t[0].properties.iso_3166_1,n=t[0].properties.ISO_A2_EH,a=null;i&&(a=i),n&&(a=n),this.handlePopup(e,a)}}.bind(e))),e.getLogInfo()),[2]}}))}))()}},{key:"componentWillUnmount",value:function(){this.mountPage=!1,document.removeEventListener("mousedown",this.handleClickOutside.bind(this))}},{key:"handleClickOutside",value:function(e){"modal-filtre-open-multi-id"!==e.srcElement.id&&null!==this.state.showType&&this.setState({showType:null})}},{key:"handlePopup",value:function(e,t){var i=this,n=this.state.data,a=null;if(t&&(n.forEach((function(e){e.isocode.toLowerCase()===t.toLowerCase()&&(a=e)})),a)){var s="";a.sources.forEach((function(e,t){4===t?s+='<div style="z-index: 1; width: '.concat(i.sizeIco,"px; height: ").concat(i.sizeIco,'px; margin: 2px 0 2px -4px; border-radius: 50%; border: 1px solid #fff; background-color: #f3f3f3; font-size: 11px; text-align: center; font-family: SP;color: #777;display: flex; justify-content: center; align-items: center;">\n +').concat(a.sources.length-4,"\n </div>"):t>4||(s+='<img alt="" src='.concat(e.img,' style="z-index: ').concat(5-t,"; width: ").concat(i.sizeIco,"px; height: ").concat(i.sizeIco,'px; margin: 2px 0 2px -6px; border-radius: 50%; border: 1px solid #fff;background-color: #fff;" />'))}));var o="";this.state.marketOff||(o='\n <div style="font-size: 14px;font-family: SPLight;">\n '.concat(a.money?m.GV[a.isocode.toLowerCase()]:"No "+this.YEAR_DEFAULT).concat(a.money?(0,m.OO)(a.money):""," market value\n </div>\n "));var l='\n <div style="width: 240px;">\n <div style="font-size: 15px;font-family: SPSemi;">\n '.concat(m.V2["name_pays_"+a.isocode.toUpperCase()],"\n </div>\n ").concat(o,'\n <div style="font-size: 14px;font-family: SPLight;">\n ').concat(a.reviews?(0,m.OO)(a.reviews):"No",' reviews\n </div>\n <div style="display: flex; justify-content: left; align-items: center; width: 100%; position: relative;">\n <div style="display: flex; justify-content: left; align-items: center; width: 100%;margin-top: 5px;margin-left: 5px;">\n ').concat(s,'\n </div>\n <a className="clean-a market-div transition-100" href=').concat((0,m.DW)(this.props.lang,"app/market/"+a.isocode.toLowerCase()),'>\n <div class="hover-opa-0-8" style="font-size: 12px;font-family: SP;color: #fff;background-color: #4184FC;border-radius: 3px; float: right;padding: 4px 10px;white-space: nowrap;margin-top: 5px;">\n ACCESS PAGE\n </div>\n </a>\n </div>\n </div>\n ');
1(new(g().Popup)).setLngLat(k.unproject(e.point)).setHTML(l).addTo(k)}}},{key:"getLogInfo",value:function(){var e=this;this.setState({loading:!0}),v.h.get("/get_market_info",{headers:{Authorization:"Bearer "+localStorage.getItem("auth_identifier_token")}}).then((function(t){e.setState({loading:!1,data:t.data.data,marketOff:t.data.market_off,rank:(t.data.market_off,"reviews")}),e.setLayer(t.data.data)})).catch((function(e){console.log(e)}))}},{key:"rankData",value:function(e){var t=[],i=[];return e.forEach((function(e){t.push(e.isocode)})),(0,m.fK)(t,null,!0).forEach((function(t){e.forEach((function(e){e.isocode===t&&i.push(JSON.parse(JSON.stringify(e)))}))})),"alphabetical"!==this.state.rank&&i.sort((function(e,t){var i=e.reviews,n=t.reviews;return i>n?-1:i<n?1:0})),"money"===this.state.rank&&i.sort((function(e,t){var i=e.money,n=t.money;return i>n?-1:i<n?1:0})),"reviews"===this.state.rank&&i.sort((function(e,t){var i=e.reviews,n=t.reviews;return i>n?-1:i<n?1:0})),i.sort((function(e,t){return(0,m.qO)(e.isocode)-(0,m.qO)(t.isocode)})),i}},{key:"setLayer",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.state.showMap)return null;setTimeout(function(){var i=this,n=e.filter((function(e){return!(0,m.hB)(e.isocode)}
1)),a=0,s=.85,o=.35;n.forEach((function(e){"all"!==e.isocode&&e[i.state.rank]&&e[i.state.rank]>a&&(a=e[i.state.rank])})),t&&n.forEach((function(e){try{if("all"!==e.isocode){k.removeLayer("country-"+e.isocode);var t=k.getStyle();delete t.sources["country-"+e.isocode],k.setStyle(t)}}catch(i){}})),n.forEach((function(e){if("all"!==e.isocode){var t=e[i.state.rank]?s*e[i.state.rank]/a:o-.2;e[i.state.rank]&&t<o&&(t=o),e[i.state.rank]&&t>s&&(t=s),k.addLayer({id:"country-"+e.isocode,type:"fill",source:{type:"vector",url:"mapbox://fizback.5dd8lm7h"},"source-layer":"ne_10m_admin_0_countries-61jsqq",paint:{"fill-color":"#4184FC","fill-opacity":t,"fill-outline-color":"#4184FC"}},"waterway-label"),k.setFilter("country-"+e.isocode,["in","ISO_A2_EH",e.isocode.toUpperCase()])}}))}.bind(this),20)}},{key:"render",value:function(){var e=this,t=this.state.data,i=["money","reviews","alphabetical"],n="Select market";return this.state.marketOff&&(i=["reviews","alphabetical"]),(0,c.jsxs)("div",{className:"container-withbg-list",style:{overflowX:"hidden"},children:[(0,c.jsx)(f(),{children:(0,c.jsx)("title",{children:n})}),(0,c.jsxs)("div",{className:"title-top-list",id:"len-list-tr",style:{display:"flex",justifyContent:"space-between"},children:[n,(0,c.jsx)("div",{style:{display:"flex",position:"relative"},children:(0,c.jsxs)("div",{id:"modal-filtre-open-multi-id",className:"filter-special-list-product transition-100 noselect",style:{fontSize:14},onClick:function(){e.setState({showType:null===e.state.showType?"rank":null})},children:[(0,c.jsx)("img",{alt:"",src:"/rank.png",style:{height:14}}),(0,c.jsxs)("span",{id:"modal-filtre-open-multi-id",className:"noselect",children:["Rank by: ","money"===this.state.rank?"Market Value":"alphabetical"===this.state.rank?"Alphabetical":"Reviews"]}),(0,c.jsx)("img",{alt:"arrow",id:"modal-filtre-open-multi-id",src:"/arrow.png",style:{height:20,right:0},className:"list-filter-listing-unique-arrow",onClick:function(){e.setState({showType:null===e.state.showType?"rank":null})}}),"rank"===this.state.showType?(0,c.jsx)("div",{id:"modal-filtre-open-multi-id",onClick:function(e){e.stopPropagation()},className:"list-filter-listing-unique-abs-medium",style:{height:6+31*i.length,width:175,left:"unset",right:0,top:30},children:(0,c.jsx)("div",{id:"modal-filtre-open-multi-id",className:"list-filter-listing-unique-abs-medium-scroll",style:{height:6+31*i.length,width:157,overflowY:"hidden"},children:i.map((function(i,n){return(0,c.jsx)("div",{id:"modal-filtre-open-multi-id",className:"list-filter-brand-list transition-100",style:{display:"flex"},onClick:function(){e.setState({rank:i,showType:null}),e.setLayer(t,!0)},children:(0,c.jsx)("div",{className:"list-filter-brand-list-txt-container",id:"modal-filtre-open-multi-id",children:(0,c.jsx)("div",{className:"list-filter-brand-list-txt",id:"modal-filtre-open-multi-id",style:{textTransform:"capitalize"},children:"money"===i?"Market Value":"alphabetical"===i?"Alphabetical":"Reviews"})})},"filterm"+n)}))})}):null]})})]}),this.state.showMap?(0,c.jsx)("div",{className:"white-area-content map-market-page",style:{width:"calc(100% - 12px)",minWidth:"calc(100% - 12px)",maxWidth:"calc(100% - 12px)",marginLeft:6,padding:0,borderRadius:9},children:(0,c.jsx)("div",{className:"size-div-map-in",style:{width:"100%",height:400,marginTop:10,borderRadius:9,boxShadow:"0px 1px 10px rgba(0, 0, 0, 0.05)"},ref:function(t){return e.mapContainer=t}})}):null,(0,c.jsx)("div",{style:{display:"flex",flexWrap:"wrap",width:"100%",position:"relative"},children:this.rankData(t).map((function(t,i){return(0,c.jsx)(h(),{href:(0,m.DW)(e.props.lang,"app/market/"+t.isocode.toLowerCase()),children:(0,c.jsx)("a",{className:"clean-a market-div transition-100",style:{},children:(0,c.jsxs)("div",{className:"market-div-2 market-div-2-modify transition-100",children:[(0,c.jsxs)("div",{style:{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center",width:"100%",position:"relative"},children:[(0,c.jsx)("div",{className:"market-div-img",children:(0,c.jsx)("img",{alt:"flag",src:"https://s3.eu-west-2.amazonaws.com/sommelier.tech/all_flags_app/"+t.isocode.toUpperCase()+".png",className:"market-div-img-in"})}),(0,c.jsx)("div",{style:{color:"#3e3e3e",fontSize:14,fontFamily:"SPSemi",marginTop:5,textTransform:"uppercase"},children:m.V2["name_pays_"+t.isocode.toUpperCase()]})]}),(0,c.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",marginTop:10,minHeight:32},children:0==t.sources.length?(0,c.jsx)("div",{style:{fontStyle:"italic",color:"#c2c2c2",fontSize:13},children:"No sources yet for this market"}):t.sources.map((function(n,a){return 4===a?(0,c.jsxs)("div",{style:{zIndex:1,width:e.sizeIco,height:e.sizeIco,margin:"2px 0 2px -4px",borderRadius:"50%",border:"1px solid rgba(0, 0, 0, 0.06)",backgroundColor:"#f3f3f3",fontSize:11,textAlign:"center",fontFamily:"SP",color:"#777",display:"flex",justifyContent:"center",alignItems:"center"},children:["+",t.sources.length-4]},"list_"+i+"_"+a):a>4?null:(0,c.jsx)("img",{alt:"",src:n.img,style:{zIndex:5-a,width:e.sizeIco,height:e.sizeIco,margin:"2px 0 2px -6px",borderRadius:"50%",backgroundColor:"#fff",border:"1px solid rgba(0, 0, 0, 0.06)"}},"list_"+i+"_"+a)}))}),(0,c.jsxs)("div",{style:{display:"flex",marginTop:15,alignItems:"center",width:"100%",justifyContent:"space-evenly"},children:[t.count_npd?(0,c.jsxs)("div",{className:"market-info-value",style:{minWidth:"29%"},children:[(0,c.jsx)("div",{className:"market-info-value-title",style:{},children:(0,m.OO)(t.count_npd)}),(0,c.jsx)("div",{className:"market-info-value-desc",style:{},children:"Sell-out products"})]}):null,t.money?(0,c.jsxs)("div",{className:"market-info-value",style:{minWidth:"29%"},children:[(0,c.jsxs)("div",{className:"market-info-value-title",style:{},children:[m.GV[t.isocode.toLowerCase()],(0,m.OO)(t.money)]}),(0,c.jsxs)("div",{className:"market-info-value-desc",style:{},children:[e.YEAR_DEFAULT," Sell-out"]})]}):null,t.reviews?(0,c.jsxs)("div",{className:"market-info-value",style:{minWidth:"29%"},children:[(0,c.jsx)("div",{className:"market-info-value-title",style:{},children:(0,m.OO)(t.reviews)}),(0,c.jsx)("div",{className:"market-info-value-desc",style:{},children:"Reviews"})]}):null]})]})})},t.isocode)}
1))})]})}}]),i}(d.Component)},81634:function(){}},function(e){e.O(0,[2634,7913,9774,2888,179],(function(){return t=90680,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.