"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9940],{9940:function(e,t,i){i.r(t);var n=i(29),l=i(7812),o=i(7794),r=i.n(o),a=i(5152),u=i.n(a),d=i(1664),s=i.n(d),c=i(7294),v=i(9045),f=i(3663),m=i(5292),h=i(1404),p=i(1163),g=i(72),_=i(794),x=i(5893);function j(e,t){var i="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"===typeof e)return y(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return y(e,t)}(e))||t&&e&&"number"===typeof e.length){i&&(e=i);var n=0,l=function(){};return{s:l,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,r=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return r=e.done,e},e:function(e){a=!0,o=e},f:function(){try{r||null==i.return||i.return()}finally{if(a)throw o}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var b=u()((function(){return i.e(2997).then(i.bind(i,2997))}),{loadableGenerated:{webpack:function(){return[2997]}}}),N=u()((function(){return Promise.all([i.e(1438),i.e(2881)]).then(i.bind(i,2881))}),{loadableGenerated:{webpack:function(){return[2881]}}});t.default=function(e){var t,i,o,a,u,d,y=e.children,w=e.regionData,S=e.width,k=e.allMetros,C=e.lang,T=e.global,M=e.dataCenters,z=(0,c.useState)(null===w||void 0===w?void 0:w.metros),A=z[0],Q=z[1],F=(0,c.useState)(""),Z=F[0],I=F[1],L=(0,c.useState)([]),O=L[0],q=L[1],E=(0,c.useState)([]),J=E[0],U=E[1],B=(0,c.useState)((0,m.Y2)(S)),D=B[0],G=B[1],P=(0,c.useState)((0,m.p$)(S)),K=P[0],W=P[1],$=(0,c.useState)(!1),V=$[0],R=$[1],H=(0,c.useState)(!1),Y=H[0],X=H[1],ee=(0,c.useState)(!1),te=ee[0],ie=ee[1],ne=(0,c.useState)(!1),le=ne[0],oe=ne[1],re=(0,c.useState)([]),ae=re[0],ue=re[1],de=(0,c.useState)(0),se=de[0],ce=de[1],ve=(0,c.useState)(0),fe=ve[0],me=ve[1],he=(0,c.useState)(null!==y&&void 0!==y&&null!==(t=y.field_map_minimum_zoom[0])&&void 0!==t&&t.value?Number(null===y||void 0===y||null===(i=y.field_map_minimum_zoom[0])||void 0===i?void 0:i.value):3),pe=he[0],ge=he[1],_e=(0,c.useState)([]),xe=(_e[0],_e[1]),je=(0,c.useState)(!1),ye=(je[0],je[1],(0,c.useState)(!1)),be=ye[0],Ne=ye[1],we=(0,c.useState)(!1),Se=(we[0],we[1]),ke=(0,c.useState)(M||[]),Ce=ke[0],Te=(ke[1],(0,c.useState)(!1)),Me=Te[0],ze=Te[1],Ae=(0,c.useState)(0),Qe=Ae[0],Fe=Ae[1],Ze=(0,c.useState)(""),Ie=(Ze[0],Ze[1]),Le=(0,p.useRouter)(),Oe=(0,m.VZ)(C);(0,c.useEffect)((function(){var e,t,i;if(null!==Le&&void 0!==Le&&null!==(e=Le.query)&&void 0!==e&&e.cloud||null!==Le&&void 0!==Le&&null!==(t=Le.query)&&void 0!==t&&t.certification){var n=[],o=[],r=De(w.facilities),a=Array.isArray(Le.query.cloud)?Le.query.cloud:[Le.query.cloud],u=Array.isArray(Le.query.certification)?Le.query.certification:[Le.query.certification];void 0!==a[0]&&(n=Ce.filter((function(e){return a.some((function(t){return e.name.toLowerCase().includes(t.toLowerCase())}))}))),void 0!==u[0]&&(o=r.filter((function(e){return u.some((function(t){return e.name.toLowerCase().includes(t.toLowerCase())}))})));var d=[].concat((0,l.Z)((0,f.UT)(n)),(0,l.Z)(o));"true"===(null===Le||void 0===Le||null===(i=Le.query)||void 0===i?void 0:i.tethered)&&(ze(!0),d=d.reduce((function(e,t){return e.push(t),t.name.includes("(T)")||null!==t&&void 0!==t&&t.vid||e.push({name:t.name+"(T)",tid:null===t||void 0===t?void 0:t.tid}),e}),[])),q(d)}}),[Le.query]),(0,c.useEffect)((function(){var e,t,i,n;return Q(w.metros),ge(null!==y&&void 0!==y&&null!==(e=y.field_map_minimum_zoom[0])&&void 0!==e&&e.value?Number(null===y||void 0===y||null===(t=y.field_map_minimum_zoom[0])||void 0===t?void 0:t.value):3),ce(null===(i=We(null===w||void 0===w?void 0:w.metros))||void 0===i?void 0:i.latitude),me(null===(n=We(null===w||void 0===w?void 0:w.metros))||void 0===n?void 0:n.longitude),function(){Q([]),ge(3),ce(0),me(0)}}),[w]),(0,c.useEffect)((function(){var e,t=document.getElementById("search-input");!t||(0,f.IK)(S)||(0,f.tq)(S)||(null===t||void 0===t||t.setAttribute("size",null===t||void 0===t||null===(e=t.getAttribute("placeholder"))||void 0===e?void 0:e.length))}),[le]);var qe=function(e){q(e);var t,i=[],n=j(e);try{for(n.s();!(t=n.n()).done;){var l=t.value;i.push(null===l||void 0===l?void 0:l.field_source_translation)}}catch(o){n.e(o)}finally{n.f()}};(0,c.useEffect)((function(){for(var e=document.getElementsByClassName("bottom-part"),t=document.getElementsByClassName("gradient"),i=0;i<e.length;i++)for(var n=0;n<t.length;n++)i==n&&(0==e[i].scrollLeft?t[n].style.display="block":t[n].style.display="none")}),[V]),(0,c.useEffect)((function(){Ge(Z,null===w||void 0===w?void 0:w.metros,O),Ue(Z)}),[Z,O,be]);var Ee=JSON.stringify([]),Je=JSON.stringify("search_api_language:"+C),Ue=function(){var e=(0,n.Z)(r().mark((function e(t){var i;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.length<2)){e.next=2;break}return e.abrupt("return");case 2:return i="https://O2VJB2KMPB-dsn.algolia.net/1/indexes/alllocations"+(0,f.w5)()+"?query="+encodeURIComponent(t)+"&facetFilters=["+Ee+","+Je+',["status:true"]]'+"&hitsPerPage=".concat(1e3),e.next=5,fetch(i,f.$I).then((function(e){return e.json()})).then((function(e){ue(e.hits)}));case 5:e.sent;case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Be=function(){q([]),qe([]),U([]),I("")},De=function(e){if(e&&e.length){var t=[];return e.map((function(e){0!=e.field_certifications_compliance.length&&e.field_certifications_compliance.map((function(e){null!==e&&void 0!==e&&e.tid&&t.push(e)}))})),t.filter((function(e,t,i){return i.findIndex((function(t){return t.tid===e.tid}))===t}))}},Ge=function(e,t,i){""==e&&0==i.length&&Q(t);var n,o=w.facilities;if(0!==o.length){var r=o.filter((function(e){return i.some((function(t){var i,n;return e.field_certifications_compliance.some((function(e){return(null===e||void 0===e?void 0:e.name)===(null===t||void 0===t?void 0:t.name)}))||(null===(i=e.field_available_clouds)||void 0===i?void 0:i.some((function(e){return null===e||void 0===e?void 0:e.name.includes(null===t||void 0===t?void 0:t.name)})))||(null===(n=e.field_available_tethered_t_acces)||void 0===n?void 0:n.some((function(e){return null===e||void 0===e?void 0:e.name.includes(null===t||void 0===t?void 0:t.name)})))}))}));if(Se(0===r.length),0!==i.length){var a=t.filter((function(e){return r.some((function(t){return t.metro===e.field_metro_name[0].name}))}));n=(0,l.Z)(new Set(a)),Q(n),0!=n.length||Q(t)}}},Pe=function(e,t){var i;if(e&&!(e.length<2)){var n,o;if(te){var r,a;n=ae.filter((function(e){var t;return"metro"===e.type&&(null===e||void 0===e||null===(t=e.objectID)||void 0===t?void 0:t.endsWith(C))})),o=ae.filter((function(e){var t;return"location"===e.type&&(null===e||void 0===e||null===(t=e.objectID)||void 0===t?void 0:t.endsWith(C))}));var u=[];null===(r=n)||void 0===r||r.map((function(e){o.map((function(t){t.facility_metro==e.metro_name&&u.push(e)}))})),(null===(a=o)||void 0===a?void 0:a.length)>0&&(null===k||void 0===k||k.map((function(e){o.map((function(t){t.facility_metro==e.metro&&u.push(e)}))}))),n=(0,l.Z)(new Set([].concat(u,(0,l.Z)(n)))),n=(0,m.pl)(n);var d=[],s=[];if(0==(null===ae||void 0===ae?void 0:ae.length))return(0,m._7)(T,Be);(0,_.Aj)(n,e).map((function(e,t){d.push((0,x.jsxs)("div",{onClick:function(){return null!==e&&void 0!==e&&e.url?(0,f.Kw)(null===e||void 0===e?void 0:e.url,Le,(0,g.G3)(window.location.hostname)):(0,f.Kw)(e["url-alias"],Le,(0,g.G3)(window.location.hostname))},className:"div-regional-map-link metro",children:[(0,x.jsx)("img",{alt:"search",src:"/images/search-image.png"}),(0,x.jsxs)("div",{className:"right",children:[(0,x.jsx)("span",{className:"title",children:null!==e&&void 0!==e&&e.metro_name?null===e||void 0===e?void 0:e.metro_name:null===e||void 0===e?void 0:e.metro}),(0,x.jsx)("span",{className:"sub-title",children:(0,f.UO)("string"===typeof(null===e||void 0===e?void 0:e.field_intro)?null===e||void 0===e?void 0:e.field_intro:(0,f.zQ)(null===e||void 0===e?void 0:e.field_intro),90,67,67,67)})]})]},"metro-index-".concat(t)))}));var c=0;return o.map((function(e){c++,s.push((0,x.jsxs)("div",{onClick:function(){return(0,f.Kw)(null===e||void 0===e?void 0:e.url,Le,(0,g.G3)(window.location.hostname))},className:"div-regional-map-link facility ".concat((0,v.uw)(e)),children:[(0,x.jsx)("img",{alt:"pin",src:"/images/map-pin.svg"}),(0,x.jsxs)("div",{className:"right",children:[(0,x.jsxs)("span",{className:"title",children:[null===e||void 0===e?void 0:e.facility_metro," ",null===e||void 0===e?void 0:e.field_site_code_location]}),(0,x.jsx)("a",{target:"_blank",className:"a-regional-map-link address",children:(0,f.Vt)(null===e||void 0===e?void 0:e.facility_address)})]})]},"facility-index-".concat(c)))})),Ke(d,s,d.length,c)}if(!t.length&&null!==(i=n)&&void 0!==i&&i.length){if(0==(null===ae||void 0===ae?void 0:ae.length))return(0,m._7)(T,Be);var h=[],p=[],j=[];n.map((function(e,t){var i;(0,f.dZ)(null===e||void 0===e?void 0:e.field_metro_name,o)&&(i=p).push.apply(i,(0,l.Z)((0,f.dZ)(null===e||void 0===e?void 0:e.field_metro_name,o)));h.push((0,x.jsxs)("div",{onClick:function(){return Le.push(null===e||void 0===e?void 0:e.url)},className:"div-regional-map-link metro",children:[(0,x.jsx)("img",{alt:"search",src:"/images/search-image.png"}),(0,x.jsxs)("div",{className:"right",children:[(0,x.jsx)("span",{className:"title",children:null===e||void 0===e?void 0:e.metro_name}),(0,x.jsx)("span",{className:"sub-title",children:(0,f.UO)(null===e||void 0===e?void 0:e.field_intro,90,67,67,67)})]})]},"metro-index-".concat(t)))})),p=(0,l.Z)(new Set(p));var y=0;return p.map((function(e){y++,j.push((0,x.jsxs)("div",{onClick:function(){return Le.push(null===e||void 0===e?void 0:e.url)},className:"div-regional-map-link facility ".concat((0,v.uw)(e)),children:[(0,x.jsx)("img",{alt:"pin",src:"/images/map-pin.svg"}),(0,x.jsxs)("div",{className:"right",children:[(0,x.jsxs)("span",{className:"title",children:[null===e||void 0===e?void 0:e.facility_metro," ",null===e||void 0===e?void 0:e.field_site_code_location]}),(0,x.jsx)("a",{target:"_blank",className:"a-regional-map-link address",children:(0,f.Vt)(null===e||void 0===e?void 0:e.facility_address)})]})]},"facility-index-".concat(y)))})),Ke(h,j,h.length,y)}}},Ke=function(e,t,i,n){return t=t.slice(0,K),e=e.slice(0,D),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsxs)("div",{className:"metro-results",children:[(0,x.jsxs)("span",{className:"regional-result-header",children:["Metro (",i,")"]}),e,e.length!==i&&(0,x.jsx)("div",{className:"see-more",onClick:function(){return G(D+(0,m.Y2)(S))},children:"See More"})]}),(0,x.jsx)("hr",{}),(0,x.jsxs)("div",{className:"facility-results",children:[(0,x.jsxs)("span",{className:"regional-result-header",children:["Facility (",n,")"]}),(0,x.jsx)("div",{className:"facilities",children:t}),t.length!==n&&(0,x.jsx)("div",{className:"see-more",onClick:function(){return W(K+(0,m.p$)(S))},children:"See More"})]})]})},We=function(e){if(e&&e.length){var t=[],i=[];return e.map((function(e){var n,l,o=Number(null===e||void 0===e||null===(n=e.field_latitude[0])||void 0===n?void 0:n.value),r=Number(null===e||void 0===e||null===(l=e.field_longitude[0])||void 0===l?void 0:l.value);o&&r&&(t.push(o),i.push(r))})),{latitude:t.reduce((function(e,i){return e+i/t.length}),0),longitude:i.reduce((function(e,t){return e+t/i.length}),0)}}};return(0,x.jsxs)("div",{className:"template-regional-map",onLoad:function(){return oe(!le)},children:[(0,x.jsx)(b,{lang:C,router:Le,clearQuery:function(){I(""),ie(!1),X(!0)},isSearchActive:te,isFilterActive:Y,setIsSearchActive:ie,setIsFilterActive:X,data:[{id:1,name:"Certifications",description:"",children:De(w.facilities)}],avaliableClouds:[{id:2,name:(0,f.zQ)(null===y||void 0===y?void 0:y.field_filter_group_label),description:"",children:(0,f.UT)(Ce)}],setQuery:I,clearAll:Be,searchQuery:Z,onSearchChange:function(e){I(0!==e.length?e:""),X(!1),ie(!0)},search:null===y||void 0===y||null===(o=y.field_search_text[0])||void 0===o?void 0:o.value,title:null===y||void 0===y||null===(a=y.field_filter_text[0])||void 0===a?void 0:a.value,filterProps:O,triggerFilter:qe,languageFilter:J,setLanguageFilter:U,screenWidth:S,cancelText:(0,f.zQ)(null===T||void 0===T?void 0:T.field_cancel_text_translation),applyFilterText:(0,f.zQ)(null===T||void 0===T?void 0:T.field_apply_filters_text),clearAllText:(0,f.zQ)(null===T||void 0===T?void 0:T.field_clear_all_text),selectedText:(0,f.zQ)(null===T||void 0===T?void 0:T.field_selected_text),seeMoreText:(0,f.zQ)(null===T||void 0===T?void 0:T.field_see_more_text),seeLessText:(0,f.zQ)(null===T||void 0===T?void 0:T.field_see_less),toggleText:(0,f.zQ)(null===y||void 0===y?void 0:y.field_toggle_button_text),onToggleChange:function(){Ne(!be);var e="";e=window.location.pathname,be?(0,f.E5)(Le,"true"):(0,f.bD)(Le,e,"true","tethered")},isToggled:be,tooltipText:(0,f.zQ)(null===y||void 0===y?void 0:y.field_tooltip_text),setTetheredFilters:xe,pageType:"regional-map",component:"region",firstLoad:Me,handleToggleChangeOnFirstLoad:function(){Qe<1&&Ne(!0),Fe(1)}}),(0,x.jsx)("div",{className:"inner-container",children:"object"==typeof Pe(Z,O)&&(0,x.jsx)("div",{className:"search-result-container",children:Pe(Z,O)})}),(0,x.jsxs)("div",{className:"regional-map-container",children:[(0,x.jsxs)("div",{className:"metro-container",children:[(0,x.jsx)("div",{className:"metro-header",children:(0,x.jsx)("div",{className:"metro-inner-container",children:(0,x.jsx)("div",{className:"metro-wrapper",children:(0,x.jsxs)("span",{children:[A.length," ",null===y||void 0===y||null===(u=y.field_title[0])||void 0===u?void 0:u.value]})})})}),(0,x.jsx)("div",{className:"metro-wrapper",children:(0,x.jsx)("div",{className:"metro-inner-container",children:function(e){if(e&&e.length)return e.map((function(e,t){var i,n,l,o,r;return(0,x.jsx)("div",{className:"wrapper",children:(0,x.jsx)(s(),{target:(0,f.xB)(e["url-alias"])?"_blank":"_self",href:e["url-alias"]?e["url-alias"]:"",legacybehavior:"true",children:(0,x.jsxs)("a",{className:"metro a-regional-map-link",children:[(0,x.jsxs)("div",{className:"top-part",children:[(0,x.jsxs)("div",{className:"top-left",children:[(0,x.jsx)("span",{className:"title",children:null===e||void 0===e||null===(i=e.field_metro_name[0])||void 0===i?void 0:i.name}),(0,x.jsx)("span",{className:"sub-title",children:null===e||void 0===e||null===(n=e.field_bullets[0])||void 0===n?void 0:n.value})]}),(0,x.jsx)("span",{className:"circle ".concat((0,v.uw)(w)),children:(0,f.as)(null===e||void 0===e||null===(l=e.field_metro_name[0])||void 0===l?void 0:l.original_tranlsation,null===w||void 0===w?void 0:w.facilities)})]}),(0,x.jsxs)("div",{onScroll:function(){return R(!V)},className:"bottom-part",children:["Imperial"==Oe?(0,x.jsxs)(x.Fragment,{children:[(null===e||void 0===e?void 0:e.metro_total_facility_ft2)&&(0,x.jsxs)("span",{children:[(0,h.h)(Math.round(null===e||void 0===e?void 0:e.metro_total_facility_ft2))," ","ft ",(0,x.jsx)("sup",{children:"2"})]}),(null===e||void 0===e?void 0:e.metro_total_facility_m2)&&(0,x.jsxs)("span",{children:[(0,h.h)(Math.round(null===e||void 0===e?void 0:e.metro_total_facility_m2))," ","m ",(0,x.jsx)("sup",{children:"2"})]})]}):(0,x.jsxs)(x.Fragment,{children:[(null===e||void 0===e?void 0:e.metro_total_facility_m2)&&(0,x.jsxs)("span",{children:[(0,h.h)(Math.round(null===e||void 0===e?void 0:e.metro_total_facility_m2))," ","m ",(0,x.jsx)("sup",{children:"2"})]}),(null===e||void 0===e?void 0:e.metro_total_facility_ft2)&&(0,x.jsxs)("span",{children:[(0,h.h)(Math.round(null===e||void 0===e?void 0:e.metro_total_facility_ft2))," ","ft ",(0,x.jsx)("sup",{children:"2"})]})]}),(null===e||void 0===e?void 0:e.metro_total_facility_kw)&&(0,x.jsxs)("span",{children:[(0,h.h)(Math.round(null===e||void 0===e?void 0:e.metro_total_facility_kw))," ","kW"]}),(null===e||void 0===e?void 0:e.metro_total_facility_kw)&&(0,x.jsxs)("span",{children:[(0,h.h)(Math.round(null===e||void 0===e?void 0:e.metro_total_facility_kw))," ","kW"]}),(null===e||void 0===e||null===(o=e.field_providers)||void 0===o?void 0:o.length)>0?(0,x.jsxs)("span",{children:[null===e||void 0===e?void 0:e.field_providers[0].value,"+"," ",(0,f.zQ)(null===y||void 0===y?void 0:y.field_providers_text)]}):null,(null===e||void 0===e||null===(r=e.field_customers)||void 0===r?void 0:r.length)>0?(0,x.jsxs)("span",{children:[null===e||void 0===e?void 0:e.field_customers[0].value,"+"," ",(0,f.zQ)(null===y||void 0===y?void 0:y.field_customers_text)]}):null,(0,x.jsx)("div",{className:"gradient"})]})]})})},"metro-index-".concat(t))}))}(A)})})]}),(0,x.jsx)("div",{className:"map-container",children:(0,x.jsx)(N,{blockTypeClass:"regional-map",filterText:(0,f.zQ)(null===y||void 0===y?void 0:y.field_filter_group_label),filterTextTethered:(0,f.zQ)(null===y||void 0===y?void 0:y.field_filter_group_2_label),currentZoom:pe,setCurrentZoom:ge,width:S,maxZoom:Number(null===y||void 0===y||null===(d=y.field_map_maximum_zoom[0])||void 0===d?void 0:d.value),latitude:se,longitude:fe,renderMarkers:function(e){if(e&&e.length){var t=[];return e.map((function(e){var i,n,o,r,a,u,d,s,c,h;if(null!==e&&void 0!==e&&null!==(i=e.field_latitude[0])&&void 0!==i&&i.value&&null!==e&&void 0!==e&&null!==(n=e.field_longitude[0])&&void 0!==n&&n.value){var p,g,_=(0,f.as)(null===e||void 0===e||null===(o=e.field_metro_name[0])||void 0===o?void 0:o.original_tranlsation,null===w||void 0===w?void 0:w.facilities),x=(0,m.Qg)(null===e||void 0===e||null===(r=e.field_metro_name[0])||void 0===r?void 0:r.original_tranlsation,null===w||void 0===w?void 0:w.facilities);if(x&&x.length>0)p=null===(g=(0,l.Z)(new Set(null===x||void 0===x?void 0:x.flatMap((function(e){return null===e||void 0===e?void 0:e.map((function(e){return e&&JSON.stringify(e)}))})))))||void 0===g?void 0:g.map((function(e){return e&&JSON.parse(e)}));var j=(0,m.D5)(null===e||void 0===e||null===(a=e.field_metro_name[0])||void 0===a?void 0:a.original_tranlsation,null===w||void 0===w?void 0:w.facilities),b=(0,l.Z)(new Set(j.flatMap((function(e){return e.map((function(e){return JSON.stringify(e)}))})))).map((function(e){return JSON.parse(e)}));t.push({latitude:Number(null===e||void 0===e||null===(u=e.field_latitude[0])||void 0===u?void 0:u.value),longitude:Number(null===e||void 0===e||null===(d=e.field_longitude[0])||void 0===d?void 0:d.value),regionColor:(0,v.uw)(w),title:null===e||void 0===e||null===(s=e.field_metro_name[0])||void 0===s?void 0:s.name,subTitle:null===e||void 0===e||null===(c=e.field_intro[0])||void 0===c?void 0:c.value,numberOfFacilities:_,link:e["url-alias"],infoText:(0,m.cD)((0,f.zQ)(null===y||void 0===y?void 0:y.field_info_box_text),_),avaliableFilters:(null===(h=p)||void 0===h?void 0:h.length)>0?p:[],availableFiltersTethered:(null===b||void 0===b?void 0:b.length)>0?b:[]})}})),t}}(A),regionalMap:!0,isToggled:be,setCurrentRegion:Ie})})]})]})}},794:function(e,t,i){i.d(t,{Aj:function(){return s},Gf:function(){return p},HQ:function(){return v},UH:function(){return d},a$:function(){return g},cs:function(){return u},kE:function(){return a},kv:function(){return m},mu:function(){return h},vs:function(){return _}});var n=i(7812),l=i(7294),o=i(3663),r=i(5893),a=function(e){return(0,r.jsx)("div",{className:"no-results-text",children:(0,o.zQ)(e)})},u=function(e,t){var i=e.filter((function(e){return!e.name.includes("(T)")}));return(0,r.jsxs)(l.Fragment,{children:[(0,r.jsx)("span",{className:"view-text",children:(0,o.zQ)(t)}),(0,r.jsx)("div",{className:"filters-container",children:null===i||void 0===i?void 0:i.map((function(e,t){return(0,r.jsxs)("div",{className:"filter",children:[(0,r.jsx)("img",{src:"/images/map-info-location.svg"}),(0,r.jsx)("span",{className:"filter-label",children:null===e||void 0===e?void 0:e.name})]},"filter-index-".concat(t))}))})]})},d=function(e,t){var i=(0,o.n8)(e.filter((function(e){return e.name.includes("(T)")})));return(0,r.jsxs)(l.Fragment,{children:[i.length>0&&(0,r.jsx)("span",{className:"view-text tethered",children:(0,o.zQ)(t)}),(0,r.jsx)("div",{className:"tethered-filters-container",children:null===i||void 0===i?void 0:i.map((function(e,t){return(0,r.jsxs)("div",{className:"filter",children:[(0,r.jsx)("img",{src:"/images/map-info-location.svg"}),(0,r.jsxs)("span",{className:"filter-label",children:[null===e||void 0===e?void 0:e.baseName,(0,r.jsxs)("span",{className:"tethered-font",children:["(",null===e||void 0===e?void 0:e.tag,")"]})]})]},"filter-index-".concat(t))}))})]})},s=function(e,t){return e.sort((function(e,i){var n=e.metro_name.toLowerCase().indexOf(t),l=i.metro_name.toLowerCase().indexOf(t);if(-1===n&&-1!==l)return 1;if(-1!==n&&-1===l)return-1;if(-1!==n&&-1!==l){if(n<l)return-1;if(n>l)return 1}return e.metro_name.localeCompare(i.metro_name)}))},c=function(e,t){var i=function(e){return e*Math.PI/180},n=i(t.latitude-e.latitude),l=i(t.longitude-e.longitude),o=Math.sin(n/2)*Math.sin(n/2)+Math.cos(i(e.latitude))*Math.cos(i(t.latitude))*Math.sin(l/2)*Math.sin(l/2);return 6378137*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))},v=function(e,t){for(var i=f(e),n=[],l=new Array(e.length).fill(!1),o=function n(o,r){l[o]=!0,r.push(e[o]);for(var a=0;a<e.length;a++)!l[a]&&i[o][a]<=t&&n(a,r)},r=0;r<e.length;r++)if(!l[r]){var a=[];o(r,a),n.push(a)}return n},f=function(e){for(var t=Array(e.length).fill(null).map((function(){return Array(e.length).fill(0)})),i=0;i<e.length;i++)for(var n=i+1;n<e.length;n++){var l=c(e[i],e[n]);t[i][n]=l,t[n][i]=l}return t},m=function(e){return e&&e.length?{latitude:e.reduce((function(e,t){return e+t.latitude}),0)/e.length,longitude:e.reduce((function(e,t){return e+t.longitude}),0)/e.length,regionColor:(0,n.Z)(new Set(e.map((function(e){return null===e||void 0===e?void 0:e.regionColor}))))[0]}:null},h=function(e){var t;switch(e){case 2:t=120;break;case 3:t=132;break;case 4:t=144;break;default:t=180}var i=(96-t)/2;return{width:"".concat(t,"px"),height:"".concat(t,"px"),marginLeft:"".concat(i,"px"),marginTop:"".concat(i,"px")}},p=function(e,t){var i={2:{1:{top:"15%",left:"20%"},2:{bottom:"15%",right:"20%"}},3:{1:{top:"20%",right:"15%"},2:{bottom:"10%"},3:{top:"20%",left:"15%"}},4:{1:{top:"8%"},2:{right:"8%"},3:{bottom:"8%"},4:{left:"8%"}},5:{1:{top:"8%"},2:{right:"8%"},3:{bottom:"8%"},4:{left:"8%"}},6:{1:{top:"5%"},2:{right:"10%",top:"20%"},3:{right:"10%",bottom:"20%"},4:{bottom:"5%"},5:{left:"10%",bottom:"20%"},6:{left:"10%",top:"20%"}},7:{1:{top:"5%"},2:{right:"10%",top:"20%"},3:{right:"10%",bottom:"20%"},4:{bottom:"5%"},5:{left:"10%",bottom:"20%"},6:{left:"10%",top:"20%"}},8:{1:{top:"5%"},2:{right:"14%",top:"14%"},3:{right:"5%"},4:{right:"14%",bottom:"14%"},5:{bottom:"5%"},6:{left:"14%",bottom:"14%"},7:{left:"5%"},8:{left:"14%",top:"14%"}},9:{1:{top:"5%"},2:{right:"14%",top:"14%"},3:{right:"5%"},4:{right:"14%",bottom:"14%"},5:{bottom:"5%"},6:{left:"5%"},7:{left:"14%",bottom:"14%"},8:{left:"14%",top:"14%"}},default:{1:{top:"5%"},2:{right:"14%",top:"14%"},3:{right:"5%"},4:{right:"14%",bottom:"14%"},5:{bottom:"5%"},6:{left:"5%"},7:{left:"14%",bottom:"14%"},8:{left:"14%",top:"14%"}}},n=e>=9?i.default:i[e];return n&&n[t]||{}},g=function(e){switch(e){case 10:default:return 1e4;case 11:return 5e3;case 12:return 3e3;case 13:return 1e3;case 14:return 500;case 15:return 200;case 16:case 17:case 18:return 50;case 19:return 10;case 20:case 21:case 22:return 0}},_=function(e,t){if(!t)return null;for(var i=0;i<e.length;i++)for(var n=0;n<e[i].length;n++)if(e[i][n].text.toLowerCase()===t.toLowerCase())return{index:i,childIndex:n};return null}}}]);
//# sourceMappingURL=9940.7ec5497c1987ace7.js.map